diff --git a/test/vast/Conversion/hl-assign-a.c b/test/vast/Conversion/assign-b.c similarity index 91% rename from test/vast/Conversion/hl-assign-a.c rename to test/vast/Conversion/assign-b.c index 92f62d06a5..0ba90c992a 100644 --- a/test/vast/Conversion/hl-assign-a.c +++ b/test/vast/Conversion/assign-b.c @@ -1,7 +1,7 @@ // RUN: %vast-cc1 -vast-emit-mlir=llvm %s -o - | %file-check %s -// CHECK: llvm.func @count([[ARG:%arg[0-9]+]]: i32) -void count(int arg) +// CHECK: llvm.func @count +void count() { // CHECK: [[C:%[0-9]+]] = llvm.mlir.constant(1 : index) : i64 // CHECK: [[V1:%[0-9]+]] = llvm.alloca [[C]] x i32 : (i64) -> !llvm.ptr diff --git a/test/vast/Conversion/hl-assign-b.c b/test/vast/Conversion/assign-c.c similarity index 90% rename from test/vast/Conversion/hl-assign-b.c rename to test/vast/Conversion/assign-c.c index e7ec9ec64b..06e6c98e14 100644 --- a/test/vast/Conversion/hl-assign-b.c +++ b/test/vast/Conversion/assign-c.c @@ -1,7 +1,7 @@ // RUN: %vast-cc1 -vast-emit-mlir=llvm %s -o - | %file-check %s -// CHECK: llvm.func @count([[ARG:%arg[0-9]+]]: i32) -void count(int arg) +// CHECK: llvm.func @count +void count() { // CHECK: [[V0:%[0-9]+]] = llvm.mlir.constant(1 : index) : i64 // CHECK: [[V1:%[0-9]+]] = llvm.alloca [[V0]] x i32 : (i64) -> !llvm.ptr diff --git a/test/vast/Conversion/hl-assign-c.c b/test/vast/Conversion/assign-d.c similarity index 100% rename from test/vast/Conversion/hl-assign-c.c rename to test/vast/Conversion/assign-d.c diff --git a/test/vast/Conversion/direct-overlap-a.c b/test/vast/Conversion/direct-overlap-a.c index 877938b73d..2196ed2c1b 100644 --- a/test/vast/Conversion/direct-overlap-a.c +++ b/test/vast/Conversion/direct-overlap-a.c @@ -35,7 +35,7 @@ int sum( struct data d ) // ABI-NEXT: [[V28:%[0-9]+]] = abi.direct [[V15]] : si32 -> si32 // ABI-NEXT: {{.*}} = abi.yield [[V28]] : si32 -> si32 // ABI-NEXT: } : si32 -// ABI-NEXT: %7 = abi.yield [[V16]] : si32 -> si32 +// ABI-NEXT: abi.yield [[V16]] : si32 -> si32 // ABI-NEXT: } : (!hl.elaborated>) -> si32 // ABI-NEXT: hl.return [[V13]] : si32 diff --git a/test/vast/Conversion/do-while-a.c b/test/vast/Conversion/do-while-a.c index ecaffae1df..b6e5b31dd6 100644 --- a/test/vast/Conversion/do-while-a.c +++ b/test/vast/Conversion/do-while-a.c @@ -1,19 +1,20 @@ // RUN: %check-hl-to-ll-cf %s | %file-check %s -check-prefix=LL_CF // RUN: %check-core-to-llvm %s | %file-check %s -check-prefix=C_LLVM -// LL_CF: ll.func @fn external ([[ARG0:%.*]]: !hl.lvalue) -> none { +// LL_CF: ll.func @fn external ([[ARG0:%.*]]: !hl.lvalue) -> none +// LL_CF: hl.param @a // LL_CF: ll.scope { -// LL_CF: [[V3:%[0-9]+]] = ll.initialize {{.*}} : (!hl.lvalue, si32) -> !hl.lvalue +// LL_CF: hl.var @sum // LL_CF: ll.scope { // LL_CF: ll.br ^bb2 // LL_CF: ^bb1: // pred: ^bb2 -// LL_CF: [[V8:%[0-9]+]] = hl.ref [[ARG0]] : !hl.lvalue +// LL_CF: [[V8:%[0-9]+]] = hl.ref @a : !hl.lvalue // LL_CF: [[V9:%[0-9]+]] = hl.implicit_cast [[V8]] LValueToRValue : !hl.lvalue -> si32 // LL_CF: [[V11:%[0-9]+]] = hl.cmp sgt [[V9]], {{.*}} : si32, si32 -> si32 // LL_CF: [[V12:%[0-9]+]] = hl.implicit_cast [[V11]] IntegralCast : si32 -> i1 // LL_CF: ll.cond_scope_ret [[V12]] : i1, ^bb2 // LL_CF: ^bb2: // 2 preds: ^bb0, ^bb1 -// LL_CF: [[V6:%[0-9]+]] = hl.ref [[ARG0]] : !hl.lvalue +// LL_CF: [[V6:%[0-9]+]] = hl.ref @a : !hl.lvalue // LL_CF: {{,*}} = hl.pre.dec [[V6]] : !hl.lvalue -> si32 // LL_CF: ll.br ^bb1 // LL_CF: } diff --git a/test/vast/Conversion/do-while-b.c b/test/vast/Conversion/do-while-b.c index 38f04d1886..c633cc4b33 100644 --- a/test/vast/Conversion/do-while-b.c +++ b/test/vast/Conversion/do-while-b.c @@ -2,8 +2,9 @@ // RUN: %check-core-to-llvm %s | %file-check %s -check-prefix=C_LLVM // LL_CF: ll.func @fn external ([[ARG0:%.*]]: !hl.lvalue) -> none { +// LL_CF: hl.param @a // LL_CF: ll.scope { -// LL_CF: [[V3:%[0-9]+]] = ll.initialize {{.*}} : (!hl.lvalue, si32) -> !hl.lvalue +// LL_CF: hl.var @sum // LL_CF: ll.scope { // LL_CF: ll.br ^bb2 // LL_CF: ^bb1: // pred: ^bb4 @@ -12,7 +13,7 @@ // LL_CF: [[B1V8:%[0-9]+]] = hl.implicit_cast [[B1V7]] IntegralCast : si32 -> i1 // LL_CF: ll.cond_scope_ret [[B1V8]] : i1, ^bb2 // LL_CF: ^bb2: // 2 preds: ^bb0, ^bb1 -// LL_CF: [[V4:%[0-9]+]] = hl.ref [[ARG0]] : !hl.lvalue +// LL_CF: [[V4:%[0-9]+]] = hl.ref @a : !hl.lvalue // LL_CF: [[V5:%[0-9]+]] = hl.implicit_cast [[V4]] LValueToRValue : !hl.lvalue -> si32 // LL_CF: [[V6:%[0-9]+]] = hl.const #core.integer<42> : si32 // LL_CF: [[V7:%[0-9]+]] = hl.cmp eq [[V5]], [[V6]] : si32, si32 -> si32 @@ -21,7 +22,7 @@ // LL_CF: ^bb3: // pred: ^bb2 // LL_CF: ll.scope_ret // LL_CF: ^bb4: // pred: ^bb2 -// LL_CF: [[V9:%[0-9]+]] = hl.ref [[V3]] : !hl.lvalue +// LL_CF: [[V9:%[0-9]+]] = hl.ref @sum : !hl.lvalue // LL_CF: [[V10:%[0-9]+]] = hl.post.inc [[V9]] : !hl.lvalue -> si32 // LL_CF: ll.br ^bb1 // LL_CF: } diff --git a/test/vast/Conversion/empty-a.c b/test/vast/Conversion/empty-a.c index 730aba83e8..5ff80b045a 100644 --- a/test/vast/Conversion/empty-a.c +++ b/test/vast/Conversion/empty-a.c @@ -2,5 +2,9 @@ // No new operations should be emitted since the args are not used. // CHECK: ll.func {{.*}} -// CHECK-NEXT: %0 = hl.const #void_value +// CHECK-NEXT: ll.cell @arg0 +// CHECK-NEXT: ll.cell_init +// CHECK-NEXT: ll.cell @arg1 +// CHECK-NEXT: ll.cell_init +// CHECK-NEXT: hl.const #void_value void empty(int arg0, int arg1) {} diff --git a/test/vast/Conversion/fn-c.c b/test/vast/Conversion/fn-c.c index 41ed3b9c51..36c8efae9f 100644 --- a/test/vast/Conversion/fn-c.c +++ b/test/vast/Conversion/fn-c.c @@ -1,4 +1,4 @@ -// RUN: %check-vast-vars-to-cells %s | %file-check %s -check-prefix=CELLS +// RUN: %check-vars-to-cells %s | %file-check %s -check-prefix=CELLS // RUN: %check-strip-param-lvalues %s | %file-check %s -check-prefix=PARAMS // RUN: %check-lower-value-categories %s | %file-check %s -check-prefix=VAL_CAT // RUN: %check-core-to-llvm %s | %file-check %s -check-prefix=C_LLVM diff --git a/test/vast/Conversion/scope-a.c b/test/vast/Conversion/scope-a.c index bc2bd2fab6..4e1add0cd8 100644 --- a/test/vast/Conversion/scope-a.c +++ b/test/vast/Conversion/scope-a.c @@ -4,12 +4,13 @@ void fn(int arg) { // LL_CF: ll.scope { - // LL_CF: [[V3:%[0-9]+]] = ll.initialize {{.*}} : (!hl.lvalue, si32) -> !hl.lvalue + // LL_CF: hl.var @a // LL_CF: ll.scope { - // LL_CF: ll.cond_br {{.8}} : i1, ^bb1, ^bb2 + // LL_CF: ll.cond_br {{.*}} : i1, ^bb1, ^bb2 // LL_CF: ^bb1: // pred: ^bb0 - // LL_CF: [[V9:%[0-9]+]] = hl.ref [[V3]] : (!hl.lvalue) -> !hl.lvalue - // LL_CF: {{.*}} = hl.assign {{.*}} to [[V9]] : si32, !hl.lvalue -> si32 + // LL_CF: hl.ref @a + // LL_CF: hl.ref @arg + // LL_CF: hl.assign // LL_CF: ll.br ^bb2 // LL_CF: ^bb2: // 2 preds: ^bb0, ^bb1 // LL_CF: ll.scope_ret diff --git a/test/vast/Conversion/select-c.c b/test/vast/Conversion/select-c.c index 3a673781e3..d68875b45e 100644 --- a/test/vast/Conversion/select-c.c +++ b/test/vast/Conversion/select-c.c @@ -27,8 +27,8 @@ int main(int argc, char** argv) // C_LLVM: llvm.cond_br {{.*}}, ^bb1, ^bb5 // C_LLVM: ^bb1: // pred: ^bb0 - // C_LLVM: {{.*}} = llvm.mlir.constant(3 : i32) : i32 - // C_LLVM: llvm.cond_br %13, ^bb2, ^bb3 + // C_LLVM: llvm.mlir.constant(3 : i32) : i32 + // C_LLVM: llvm.cond_br {{.*}}, ^bb2, ^bb3 // C_LLVM: ^bb2: // pred: ^bb1 // C_LLVM: [[V14:%[0-9]+]] = llvm.mlir.constant(0 : i32) : i32 // C_LLVM: llvm.br ^bb4([[V14]] : i32) @@ -43,7 +43,5 @@ int main(int argc, char** argv) // C_LLVM: ^bb6([[V18:%[0-9]+]]: i32): // 2 preds: ^bb4, ^bb5 // C_LLVM: llvm.return [[V18]] : i32 - - return (argc >= 3) ? ( ( argc == 3) ? 0 : 1 ) - : 2; + return (argc >= 3) ? ((argc == 3) ? 0 : 1) : 2; } diff --git a/test/vast/Conversion/shift-a.c b/test/vast/Conversion/shift-a.c index 28b506d510..969fa285e5 100644 --- a/test/vast/Conversion/shift-a.c +++ b/test/vast/Conversion/shift-a.c @@ -1,4 +1,4 @@ -// RUN: %vast-front -vast-emit-mlir=llvm %s -o - %s | %file-check %s +// RUN: %vast-front -vast-emit-mlir=llvm %s -o - | %file-check %s #include