Skip to content

Commit

Permalink
fixing tests (oops forgot to run all of them)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbellotti committed Sep 28, 2022
1 parent 6d68a64 commit d658101
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions ast/ast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func TestString(t *testing.T) {
want = "foo"
case *ParameterCall:
got = t.String()
want = "foobar"
want = "foo.bar"
case *AssertVar:
got = t.String()
want = "foo bar"
Expand Down Expand Up @@ -197,7 +197,7 @@ func TestTypes(t *testing.T) {
want = "INT"
case *DefStatement:
got = t.Type()
want = "INT"
want = "test"
case *AssertionStatement:
got = t.Type()
want = "INT"
Expand Down
1 change: 0 additions & 1 deletion listener/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,6 @@ func (l *FaultListener) ExitComponentDecl(c *parser.ComponentDeclContext) {
token := util.GenerateToken("COMPONENT", "COMPONENT", c.GetStart(), c.GetStop())

p, order := l.getPairs(len(pairs), []int{c.GetStart().GetLine(), c.GetStart().GetColumn()})
fmt.Println(order)
val :=
&ast.ComponentLiteral{
Token: token,
Expand Down
1 change: 0 additions & 1 deletion llvm/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,6 @@ func (c *Compiler) validOperator(node *ast.InfixExpression, boolsAllowed bool) b
func (c *Compiler) generateParameters(structName string, data map[string]ast.Node, id []string) []*ir.Param {
var p []*ir.Param
keys := c.generateOrder(structName, data)
fmt.Println(keys)
for _, k := range keys {
switch n := data[k].(type) {
case *ast.Instance:
Expand Down
20 changes: 10 additions & 10 deletions llvm/llvm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,40 +690,40 @@ func TestComponentIR(t *testing.T) {
`

expecting := `define void @__run() {
block-29:
block-28:
%test_foo_x = alloca double
store double 8.0, double* %test_foo_x
ret void
}
define void @test_foo_initial(double* %test_foo_x) {
block-30:
block-29:
%0 = load double, double* %test_foo_x
%1 = fcmp ogt double %0, 10.0
br i1 %1, label %block-32-true, label %block-33-false
br i1 %1, label %block-31-true, label %block-32-false
block-31-after:
block-30-after:
ret void
block-32-true:
block-31-true:
call void @stay()
br label %block-31-after
br label %block-30-after
block-33-false:
block-32-false:
%2 = alloca [10 x i8]
store [10 x i8] c"this.alarm", [10 x i8]* %2
%3 = bitcast [10 x i8]* %2 to i8*
call void @advance(i8* %3)
br label %block-31-after
br label %block-30-after
}
define void @stay() {
block-34:
block-33:
ret void
}
define void @advance(i8* %toState) {
block-35:
block-34:
ret void
}`
llvm, err := prepTestSys(test)
Expand Down
16 changes: 10 additions & 6 deletions smt/testdata/simple.smt2
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
(declare-fun simple_l_active_0 () Bool)
(declare-fun simple_l_vault_value_0 () Real)
(declare-fun simple_l_vault_value_2 () Real)
(declare-fun simple_l_vault_value_1 () Real)
(assert (= simple_l_vault_value_0 30.0))
(assert (= simple_l_vault_value_1 (+ simple_l_vault_value_0 (- simple_l_vault_value_0 2.0))))
(assert
(= simple_l_active_0 false))
(assert
(ite
(> simple_l_vault_value_0 4.0)
(= simple_l_vault_value_2 simple_l_vault_value_1)
(= simple_l_vault_value_2 simple_l_vault_value_0)))
(= simple_l_vault_value_0 30.0))
(assert
(= simple_l_vault_value_1 (+ simple_l_vault_value_0 (- simple_l_vault_value_0 2.0))))
(assert
(ite (> simple_l_vault_value_0 4.0)
(= simple_l_vault_value_2 simple_l_vault_value_1)
(= simple_l_vault_value_2 simple_l_vault_value_0)))

0 comments on commit d658101

Please sign in to comment.