diff --git a/resources/grammar/grammar.y b/resources/grammar/grammar.y index f8cdaf618..2704f733f 100644 --- a/resources/grammar/grammar.y +++ b/resources/grammar/grammar.y @@ -114,7 +114,7 @@ expr_block : LBRAPIPE opt_stmt_list RBRAPIPE ; -primary_expr +base_expr : string_expr | INTEGER | bytes_expr @@ -141,6 +141,11 @@ primary_expr | lambda_decl compound_statement ; +primary_expr + : base_expr + | initializer_list + ; + range_loc : expr | '^' expr @@ -175,17 +180,26 @@ access_ident | TYPEID ; +call_trailing + : '[' range_loc ']' + | '[' range_expr ']' + | call_invocation + | call_invocation compound_statement + | '.' access_ident + | INC_OP + | DEC_OP + | '!' + | BANGBANG + ; + +call_stmt_expr + : base_expr + | call_stmt_expr call_trailing + ; + call_expr : primary_expr - | call_expr '[' range_loc ']' - | call_expr '[' range_expr ']' - | call_expr call_invocation - | call_expr call_invocation compound_statement - | call_expr '.' access_ident - | call_expr INC_OP - | call_expr DEC_OP - | call_expr '!' - | call_expr BANGBANG + | call_expr call_trailing ; unary_expr @@ -193,6 +207,11 @@ unary_expr | unary_op unary_expr ; +unary_stmt_expr + : call_stmt_expr + | unary_op unary_expr + ; + unary_op : '&' | AND_OP @@ -217,6 +236,11 @@ mult_expr | mult_expr mult_op unary_expr ; +mult_stmt_expr + : unary_stmt_expr + | mult_stmt_expr mult_op unary_expr + ; + shift_op : SHL_OP | SHR_OP @@ -227,6 +251,12 @@ shift_expr | shift_expr shift_op mult_expr ; +shift_stmt_expr + : mult_stmt_expr + | shift_stmt_expr shift_op mult_expr + ; + + bit_op : '&' | '^' @@ -238,6 +268,11 @@ bit_expr | bit_expr bit_op shift_expr ; +bit_stmt_expr + : shift_stmt_expr + | bit_stmt_expr bit_op shift_expr + ; + additive_op : '+' | '-' @@ -246,7 +281,11 @@ additive_op additive_expr : bit_expr | additive_expr additive_op bit_expr - | additive_expr additive_op initializer_list + ; + +additive_stmt_expr + : bit_stmt_expr + | additive_stmt_expr additive_op bit_expr ; relational_op @@ -261,13 +300,16 @@ relational_op relational_expr : additive_expr | relational_expr relational_op additive_expr - | relational_expr relational_op initializer_list ; -rel_expr_or_list +relational_stmt_expr + : additive_stmt_expr + | relational_stmt_expr relational_op additive_expr + ; + +rel_or_lambda_expr : relational_expr | lambda_decl IMPLIES relational_expr - | initializer_list ; and_expr @@ -275,22 +317,46 @@ and_expr | and_expr AND_OP relational_expr ; +and_stmt_expr + : relational_stmt_expr + | and_stmt_expr AND_OP relational_expr + ; + or_expr : and_expr | or_expr OR_OP and_expr ; -ternary_op - : '?' expr ':' - | ELVIS - | OPTELSE +or_stmt_expr + : and_stmt_expr + | or_stmt_expr OR_OP and_expr + ; + +or_expr_with_suffix + : or_expr + | or_expr '?' + | or_expr '?' '!' + ; + +or_stmt_expr_with_suffix + : or_stmt_expr + | or_stmt_expr '?' + | or_stmt_expr '?' '!' ; ternary_expr - : or_expr - | or_expr ternary_op ternary_expr - | or_expr '?' - | or_expr '?' '!' + : or_expr_with_suffix + | or_expr '?' expr ':' ternary_expr + | or_expr_with_suffix ELVIS ternary_expr + | or_expr_with_suffix OPTELSE ternary_expr + | lambda_decl implies_body + ; + +ternary_stmt_expr + : or_stmt_expr_with_suffix + | or_stmt_expr '?' expr ':' ternary_expr + | or_stmt_expr_with_suffix ELVIS ternary_expr + | or_stmt_expr_with_suffix OPTELSE ternary_expr | lambda_decl implies_body ; @@ -316,29 +382,32 @@ assignment_expr : ternary_expr | CT_TYPE_IDENT '=' type | unary_expr assignment_op assignment_expr - | unary_expr assignment_op initializer_list + ; +assignment_stmt_expr + : ternary_stmt_expr + | CT_TYPE_IDENT '=' type + | unary_stmt_expr assignment_op assignment_expr ; implies_body - : IMPLIES expr_or_list + : IMPLIES expr ; lambda_decl : FN maybe_optional_type fn_parameter_list opt_attributes ; +expr_no_list + : assignment_stmt_expr + ; + expr : assignment_expr ; -expr_or_list - : expr - | initializer_list - ; constant_expr : ternary_expr - | initializer_list ; const_paren_expr @@ -356,11 +425,11 @@ param_path | param_path param_path_element ; -arg : param_path '=' expr_or_list +arg : param_path '=' expr | type | param_path '=' type - | expr_or_list - | CT_VASPLAT '(' constant_expr ')' + | expr + | CT_VASPLAT '(' range_expr ')' | CT_VASPLAT '(' ')' | ELLIPSIS expr ; @@ -409,7 +478,7 @@ identifier_list enum_param_decl : type | type IDENT - | type IDENT '=' expr_or_list + | type IDENT '=' expr ; base_type @@ -465,7 +534,7 @@ local_decl_after_type : CT_IDENT | CT_IDENT '=' constant_expr | IDENT opt_attributes - | IDENT opt_attributes '=' expr_or_list + | IDENT opt_attributes '=' expr ; local_decl_storage @@ -480,8 +549,8 @@ decl_or_expr ; var_decl - : VAR IDENT '=' expr_or_list - | VAR CT_IDENT '=' expr_or_list + : VAR IDENT '=' expr + | VAR CT_IDENT '=' expr | VAR CT_IDENT | VAR CT_TYPE_IDENT '=' type | VAR CT_TYPE_IDENT @@ -507,8 +576,9 @@ ct_for_stmt ; ct_foreach_stmt - : CT_FOREACH '(' CT_IDENT ':' expr_or_list ')' opt_stmt_list CT_ENDFOREACH - + : CT_FOREACH '(' CT_IDENT ':' expr ')' opt_stmt_list CT_ENDFOREACH + | CT_FOREACH '(' CT_IDENT ',' CT_IDENT ':' expr ')' opt_stmt_list CT_ENDFOREACH + ; ct_switch : CT_SWITCH '(' constant_expr ')' | CT_SWITCH '(' type ')' @@ -524,7 +594,7 @@ var_stmt decl_stmt_after_type : local_decl_after_type - | local_decl_after_type ',' identifier_list + | decl_stmt_after_type ',' local_decl_after_type ; declaration_stmt @@ -534,13 +604,13 @@ declaration_stmt ; return_stmt - : RETURN expr_or_list ';' + : RETURN expr ';' | RETURN ';' ; catch_unwrap_list - : rel_expr_or_list - | catch_unwrap_list ',' rel_expr_or_list + : relational_expr + | catch_unwrap_list ',' relational_expr ; catch_unwrap @@ -550,15 +620,15 @@ catch_unwrap ; try_unwrap - : TRY rel_expr_or_list - | TRY IDENT '=' rel_expr_or_list - | TRY type IDENT '=' rel_expr_or_list + : TRY rel_or_lambda_expr + | TRY IDENT '=' rel_or_lambda_expr + | TRY type IDENT '=' rel_or_lambda_expr ; try_unwrap_chain : try_unwrap | try_unwrap_chain AND_OP try_unwrap - | try_unwrap_chain AND_OP rel_expr_or_list + | try_unwrap_chain AND_OP rel_or_lambda_expr ; default_stmt @@ -651,6 +721,8 @@ break_stmt nextcase_stmt : NEXTCASE CONST_IDENT ':' expr ';' | NEXTCASE expr ';' + | NEXTCASE CONST_IDENT ':' type ';' + | NEXTCASE type ';' | NEXTCASE ';' ; @@ -667,8 +739,8 @@ foreach_vars ; foreach_stmt - : FOREACH optional_label '(' foreach_vars ':' expr_or_list ')' statement - : FOREACH_R optional_label '(' foreach_vars ':' expr_or_list ')' statement + : FOREACH optional_label '(' foreach_vars ':' expr ')' statement + : FOREACH_R optional_label '(' foreach_vars ':' expr ')' statement ; defer_stmt @@ -764,7 +836,7 @@ statement | ct_switch_stmt | ct_foreach_stmt | ct_for_stmt - | expr ';' + | expr_no_list ';' | assert_stmt | ';' ; @@ -982,10 +1054,10 @@ fn_parameter_list ; parameters - : parameter '=' expr_or_list + : parameter '=' expr | parameter | parameters ',' parameter - | parameters ',' parameter '=' expr_or_list + | parameters ',' parameter '=' expr ; parameter @@ -1012,8 +1084,8 @@ func_definition ; const_declaration - : CONST CONST_IDENT opt_attributes '=' expr_or_list ';' - | CONST type CONST_IDENT opt_attributes '=' expr_or_list ';' + : CONST CONST_IDENT opt_attributes '=' expr ';' + | CONST type CONST_IDENT opt_attributes '=' expr ';' ; func_typedef @@ -1058,7 +1130,7 @@ global_storage global_declaration : global_storage optional_type IDENT opt_attributes ';' | global_storage optional_type IDENT multi_declaration opt_attributes ';' - | global_storage optional_type IDENT opt_attributes '=' expr_or_list ';' + | global_storage optional_type IDENT opt_attributes '=' expr ';' ; opt_tl_stmts diff --git a/test/test_suite/arrays/array_struct.c3t b/test/test_suite/arrays/array_struct.c3t index 0bc58913a..ea62aa384 100644 --- a/test/test_suite/arrays/array_struct.c3t +++ b/test/test_suite/arrays/array_struct.c3t @@ -8,6 +8,6 @@ struct Foo Foo[10] array @private; -// #expect: test.ll +/* #expect: test.ll @test.array = protected unnamed_addr global [10 x %Foo] zeroinitializer, align 16 \ No newline at end of file diff --git a/test/test_suite/assert/assert_variants.c3t b/test/test_suite/assert/assert_variants.c3t index fa9add3f5..52b0288c5 100644 --- a/test/test_suite/assert/assert_variants.c3t +++ b/test/test_suite/assert/assert_variants.c3t @@ -19,7 +19,7 @@ fn void test() } -// #expect: assert_variants.ll +/* #expect: assert_variants.ll %x = alloca i32, align 4 %y = alloca i32, align 4 diff --git a/test/test_suite/assignment/int_assign.c3t b/test/test_suite/assignment/int_assign.c3t index f6663027d..ac2ec0f2a 100644 --- a/test/test_suite/assignment/int_assign.c3t +++ b/test/test_suite/assignment/int_assign.c3t @@ -18,7 +18,7 @@ fn int foo() } -// #expect: test.ll +/* #expect: test.ll %x = alloca i32, align 4 %y = alloca i32, align 4 diff --git a/test/test_suite/builtins/rounding_builtins.c3t b/test/test_suite/builtins/rounding_builtins.c3t index 593c7ec52..3f2abfae8 100644 --- a/test/test_suite/builtins/rounding_builtins.c3t +++ b/test/test_suite/builtins/rounding_builtins.c3t @@ -32,7 +32,7 @@ fn void main() return; } -// #expect: test.ll +/* #expect: test.ll %1 = call double @llvm.ceil.f64(double %0) %3 = call double @llvm.floor.f64(double %2) diff --git a/test/test_suite/compile_time/ct_if.c3t b/test/test_suite/compile_time/ct_if.c3t index 23c4dc0cb..38fd34b19 100644 --- a/test/test_suite/compile_time/ct_if.c3t +++ b/test/test_suite/compile_time/ct_if.c3t @@ -59,7 +59,7 @@ $default: $assert(false); $endswitch -// #expect: ct_if.ll +/* #expect: ct_if.ll @ct_if.d = local_unnamed_addr global i32 5, align 4 @ct_if.c = local_unnamed_addr global i32 5, align 4 diff --git a/test/test_suite/compile_time/cttype_reassign.c3t b/test/test_suite/compile_time/cttype_reassign.c3t index ef4e0b1fb..b6819292d 100644 --- a/test/test_suite/compile_time/cttype_reassign.c3t +++ b/test/test_suite/compile_time/cttype_reassign.c3t @@ -8,7 +8,7 @@ fn void test() $Foo hello; } -// #expect: reassign.ll +/* #expect: reassign.ll %hello = alloca i32, align 4 store i32 0, ptr %hello, align 4 diff --git a/test/test_suite/compile_time_introspection/offsetof.c3t b/test/test_suite/compile_time_introspection/offsetof.c3t index 9526bd136..920aa1805 100644 --- a/test/test_suite/compile_time_introspection/offsetof.c3t +++ b/test/test_suite/compile_time_introspection/offsetof.c3t @@ -42,7 +42,7 @@ int w = Bob.w.offsetof; int z0 = Foob.c.offsetof; int z03 = Foob.a.offsetof; -// #expect: foo.ll +/* #expect: foo.ll @foo.y = local_unnamed_addr global i16 16, align 2 @foo.z = local_unnamed_addr global i32 116, align 4 @foo.w = local_unnamed_addr global i32 116, align 4 diff --git a/test/test_suite/compile_time_introspection/sizeof.c3t b/test/test_suite/compile_time_introspection/sizeof.c3t index 772d36ae2..eaf721234 100644 --- a/test/test_suite/compile_time_introspection/sizeof.c3t +++ b/test/test_suite/compile_time_introspection/sizeof.c3t @@ -46,7 +46,7 @@ struct Foo char x; } -// #expect: foo.ll +/* #expect: foo.ll @foo.x = local_unnamed_addr global i64 64, align 8 @foo.y = local_unnamed_addr global i16 64, align 2 diff --git a/test/test_suite/constants/byte_literals.c3t b/test/test_suite/constants/byte_literals.c3t index 1a68db76d..9b6e90840 100644 --- a/test/test_suite/constants/byte_literals.c3t +++ b/test/test_suite/constants/byte_literals.c3t @@ -4,7 +4,7 @@ char[*] fooy = x'dead beef'; char[*] foow = x"4549234d e d"; char[*] foo64 = b64"SGVsbG8gV29ybGQ="; -// #expect: byte_literals.ll +/* #expect: byte_literals.ll @byte_literals.foob = local_unnamed_addr global [1 x i8] c"\A0", align 1 @byte_literals.fooz = local_unnamed_addr global [7 x i8] c"\00\AA\BB\CC\DD\EE\FF", align 1 diff --git a/test/test_suite/constants/char_literals.c3t b/test/test_suite/constants/char_literals.c3t index c4bbb0d6b..d30028121 100644 --- a/test/test_suite/constants/char_literals.c3t +++ b/test/test_suite/constants/char_literals.c3t @@ -11,7 +11,7 @@ char g = '"'; char h = '\\'; char i = '\e'; -// #expect: test.ll +/* #expect: test.ll @test.a = local_unnamed_addr global i8 32, align 1 @test.b = local_unnamed_addr global i8 13, align 1 diff --git a/test/test_suite/expressions/assignment_precedence.c3t b/test/test_suite/expressions/assignment_precedence.c3t index 679360c3a..e484d1a88 100644 --- a/test/test_suite/expressions/assignment_precedence.c3t +++ b/test/test_suite/expressions/assignment_precedence.c3t @@ -8,7 +8,7 @@ fn void test() int l = i = j = k; } -// #expect: prec.ll +/* #expect: prec.ll %i = alloca i32, align 4 %j = alloca i32, align 4 diff --git a/test/test_suite/expressions/call_inline.c3t b/test/test_suite/expressions/call_inline.c3t index 887ca9f24..4a2311bee 100644 --- a/test/test_suite/expressions/call_inline.c3t +++ b/test/test_suite/expressions/call_inline.c3t @@ -29,7 +29,7 @@ fn void main() test2(); test3(); } -// #expect: inlineme.ll +/* #expect: inlineme.ll entry: call void @inlineme.test1() #3 diff --git a/test/test_suite/expressions/casts/cast_expr.c3t b/test/test_suite/expressions/casts/cast_expr.c3t index 0a476eea0..913acc30c 100644 --- a/test/test_suite/expressions/casts/cast_expr.c3t +++ b/test/test_suite/expressions/casts/cast_expr.c3t @@ -9,7 +9,7 @@ fn int main(int argc, char** argv) return 0; } -// #expect: cast_expr.ll +/* #expect: cast_expr.ll define i32 @main diff --git a/test/test_suite/expressions/chained_conditional.c3t b/test/test_suite/expressions/chained_conditional.c3t index 021d36198..58ead758b 100644 --- a/test/test_suite/expressions/chained_conditional.c3t +++ b/test/test_suite/expressions/chained_conditional.c3t @@ -21,7 +21,7 @@ fn void test() } } -// #expect: chained.ll +/* #expect: chained.ll entry: %x = alloca i32, align 4 diff --git a/test/test_suite/expressions/check_implict_conversion_signed_unsigned.c3t b/test/test_suite/expressions/check_implict_conversion_signed_unsigned.c3t index c10fef9c5..cbc68d0cd 100644 --- a/test/test_suite/expressions/check_implict_conversion_signed_unsigned.c3t +++ b/test/test_suite/expressions/check_implict_conversion_signed_unsigned.c3t @@ -8,7 +8,7 @@ fn int main() return 1; } -// #expect: check.ll +/* #expect: check.ll entry: %a = alloca i32, align 4 diff --git a/test/test_suite/expressions/elvis.c3t b/test/test_suite/expressions/elvis.c3t index 86a464b46..f739926ab 100644 --- a/test/test_suite/expressions/elvis.c3t +++ b/test/test_suite/expressions/elvis.c3t @@ -15,7 +15,7 @@ fn bool elvis3(bool x, bool y) } -// #expect: elvis.ll +/* #expect: elvis.ll define ptr @elvis.elvis(ptr %0, ptr %1) #0 { entry: diff --git a/test/test_suite/expressions/parsed_numbers.c3t b/test/test_suite/expressions/parsed_numbers.c3t index ce2809a64..e217727c4 100644 --- a/test/test_suite/expressions/parsed_numbers.c3t +++ b/test/test_suite/expressions/parsed_numbers.c3t @@ -5,7 +5,7 @@ double b = -12.3e-12; double c = 0x1.1p-1; double d = 12.3e+12; -// #expect: numbers.ll +/* #expect: numbers.ll @numbers.a = local_unnamed_addr global double 2.125000e+00, align 8 @numbers.b = local_unnamed_addr global double -1.230000e-11, align 8 diff --git a/test/test_suite/expressions/simple_float_sub_neg.c3t b/test/test_suite/expressions/simple_float_sub_neg.c3t index 79cb304ab..7cef106cb 100644 --- a/test/test_suite/expressions/simple_float_sub_neg.c3t +++ b/test/test_suite/expressions/simple_float_sub_neg.c3t @@ -5,7 +5,7 @@ fn double test(double a, double b, double c, double d) return -(a-b) - (c-d); } -// #expect: simple_float_sub_neg.ll +/* #expect: simple_float_sub_neg.ll define double @simple_float_sub_neg.test(double %0, double %1, double %2, double %3) #0 { entry: diff --git a/test/test_suite/expressions/strings.c3t b/test/test_suite/expressions/strings.c3t index 5a3d23bc1..7e3dbc1bb 100644 --- a/test/test_suite/expressions/strings.c3t +++ b/test/test_suite/expressions/strings.c3t @@ -5,6 +5,6 @@ fn char* foo() return "*** Word \"%s\" on line %d is not" "" ""; } -// #expect: test.ll +/* #expect: test.ll @.str = private unnamed_addr constant [32 x i8] c"*** Word \22%s\22 on line %d is not\00" \ No newline at end of file diff --git a/test/test_suite/functions/defered_default_arguments.c3t b/test/test_suite/functions/defered_default_arguments.c3t index 72453205e..39d808cf7 100644 --- a/test/test_suite/functions/defered_default_arguments.c3t +++ b/test/test_suite/functions/defered_default_arguments.c3t @@ -35,7 +35,7 @@ fn void main() test::test(); } -// #expect: test3.ll +/* #expect: test3.ll entry: call void @test.test(i32 1, i32 2) diff --git a/test/test_suite/functions/double_return.c3t b/test/test_suite/functions/double_return.c3t index 752700bce..7f4875d93 100644 --- a/test/test_suite/functions/double_return.c3t +++ b/test/test_suite/functions/double_return.c3t @@ -6,7 +6,7 @@ fn int test(bool pos, bool color) return (int)(pos && color); } -// #expect: double_return.ll +/* #expect: double_return.ll entry: ret i32 0 diff --git a/test/test_suite/functions/macro_arguments.c3 b/test/test_suite/functions/macro_arguments.c3 index b893f9081..bc8667311 100644 --- a/test/test_suite/functions/macro_arguments.c3 +++ b/test/test_suite/functions/macro_arguments.c3 @@ -9,4 +9,4 @@ fn void foo4($Type) { } // #error: Only regular parameters are allowed for funct fn void foo8(int &foo) {} // #error: Only regular parameters are allowed for functions. -fn void foo9(int x, int x) {} // #error: Duplicate parameter name 'x'. \ No newline at end of file +fn void foo9(int x, int x) {} // #error: Duplicate parameter name 'x'. diff --git a/test/test_suite/functions/returning_void.c3t b/test/test_suite/functions/returning_void.c3t index e93e09790..7e1a7732d 100644 --- a/test/test_suite/functions/returning_void.c3t +++ b/test/test_suite/functions/returning_void.c3t @@ -4,7 +4,7 @@ fn void test1() if (x == 0) return; return test1(); } -// #expect: returning_void.ll +/* #expect: returning_void.ll %x = alloca i32, align 4 store i32 0, ptr %x, align 4 diff --git a/test/test_suite/globals/global_align.c3t b/test/test_suite/globals/global_align.c3t index 67c16ba8f..d0763503c 100644 --- a/test/test_suite/globals/global_align.c3t +++ b/test/test_suite/globals/global_align.c3t @@ -9,7 +9,7 @@ fn void test() int x = foo; } -// #expect: abc.ll +/* #expect: abc.ll @abc.foo = local_unnamed_addr global i32 0, align 32 diff --git a/test/test_suite/globals/global_extname.c3t b/test/test_suite/globals/global_extname.c3t index 25809eb13..41d08191b 100644 --- a/test/test_suite/globals/global_extname.c3t +++ b/test/test_suite/globals/global_extname.c3t @@ -2,6 +2,6 @@ module foo; int baz @extern("foobar") = 123; -// #expect: foo.ll +/* #expect: foo.ll @foobar = local_unnamed_addr global i32 123, align 4 \ No newline at end of file diff --git a/test/test_suite/initializer_lists/indexing_into_complist.c3 b/test/test_suite/initializer_lists/indexing_into_complist.c3 index 0fa56f3ab..b1e9b8de3 100644 --- a/test/test_suite/initializer_lists/indexing_into_complist.c3 +++ b/test/test_suite/initializer_lists/indexing_into_complist.c3 @@ -1,28 +1,5 @@ fn void test() { - char* c = { 1, 3, "hello"}[2]; + char* c = { 1, 3, "hello"}; int x; - int z = { 1, 3 }[x]; // #error: To subscript an untyped list a compile time integer index is needed -} - -fn void test2() -{ - int z = { 1, 3 }[-1]; // #error: The index may not be negative -} - -fn void test3() -{ - int z = { 1, 3 }[0xFFFF_FFFF_FFFF_FFFFu64]; // #error: The index is out of range. -} - -fn void test4() -{ - int z = { 1, 3 }[2]; // #error: An index of '2' is out of range, a value between 0 and 1 was expected. - int z2 = { 1 }[2]; // #error: An index of '2' is out of range, a value of 0 was expected. -} - -fn void test5() -{ - int z = { 1, 3 }[^4]; // #error: An index of '4' from the end is out of range, a value between 1 and 2 was expected - int z2 = { 1 }[^4]; // #error: An index of '4' from the end is out of range, a value of 1 was expected. -} +} \ No newline at end of file diff --git a/test/test_suite/pointers/pointer_index.c3t b/test/test_suite/pointers/pointer_index.c3t index 5c01c7fc9..c64d8e835 100644 --- a/test/test_suite/pointers/pointer_index.c3t +++ b/test/test_suite/pointers/pointer_index.c3t @@ -22,7 +22,7 @@ fn void test3(long* x) long c = x[1]; } -// #expect: pointer_index.ll +/* #expect: pointer_index.ll define void @pointer_index.test1(ptr %0) #0 { entry: diff --git a/test/test_suite/statements/defer_in_defer.c3t b/test/test_suite/statements/defer_in_defer.c3t index 6d9e15b73..91211749a 100644 --- a/test/test_suite/statements/defer_in_defer.c3t +++ b/test/test_suite/statements/defer_in_defer.c3t @@ -20,7 +20,7 @@ fn void test_line() defer { defer test1(); } } -// #expect: defer_in_defer.ll +/* #expect: defer_in_defer.ll define void @defer_in_defer.test() #0 { entry: diff --git a/test/test_suite/statements/if_tests.c3t b/test/test_suite/statements/if_tests.c3t index 5ed75c81c..a4a2d99b1 100644 --- a/test/test_suite/statements/if_tests.c3t +++ b/test/test_suite/statements/if_tests.c3t @@ -26,7 +26,7 @@ fn void test3(int x) else { x += 1; } } -// #expect: iftest.ll +/* #expect: iftest.ll define void @iftest.test1(i32 %0) #0 { entry: diff --git a/test/test_suite/statements/return_switch.c3t b/test/test_suite/statements/return_switch.c3t index 4b8295f83..cced667f5 100644 --- a/test/test_suite/statements/return_switch.c3t +++ b/test/test_suite/statements/return_switch.c3t @@ -14,7 +14,7 @@ fn int testReturnSwitch() } } -// #expect: return_switch.ll +/* #expect: return_switch.ll switch.entry: %1 = load i32, ptr %switch diff --git a/test/test_suite/stdlib/priorityqueue.c3t b/test/test_suite/stdlib/priorityqueue.c3t index e7590800b..47bd459c2 100644 --- a/test/test_suite/stdlib/priorityqueue.c3t +++ b/test/test_suite/stdlib/priorityqueue.c3t @@ -27,6 +27,6 @@ fn bool Foo.less(Foo* x, Foo y) @inline return x.x < y.x; } -// #expect: test.ll +/* #expect: test.ll %PriorityQueue = type { %List, i8 } diff --git a/test/test_suite/strings/multiline_strings.c3t b/test/test_suite/strings/multiline_strings.c3t index 5b087a023..13b1f69b0 100644 --- a/test/test_suite/strings/multiline_strings.c3t +++ b/test/test_suite/strings/multiline_strings.c3t @@ -10,7 +10,7 @@ char *message3 = "Hfo\u0044ke"; char *message4 = "\x64\x6f\x63\x75\x6d\x65\x6e\x74"; -// #expect: multiline_strings.ll +/* #expect: multiline_strings.ll @.str = private unnamed_addr constant [41 x i8] c"\0A `oh` superman\0A where are you now?\0A\00", align 1 diff --git a/test/test_suite/struct/simple_struct.c3t b/test/test_suite/struct/simple_struct.c3t index e2fc9b4fa..2a34a3d81 100644 --- a/test/test_suite/struct/simple_struct.c3t +++ b/test/test_suite/struct/simple_struct.c3t @@ -8,7 +8,7 @@ struct Foo double a; } -// #expect: test.ll +/* #expect: test.ll %Foo = type { i32, double } @test.a = protected unnamed_addr global %Foo zeroinitializer, align 8 \ No newline at end of file diff --git a/test/test_suite/union/union_codegen_const.c3t b/test/test_suite/union/union_codegen_const.c3t index b46d1ec9d..4704fddf0 100644 --- a/test/test_suite/union/union_codegen_const.c3t +++ b/test/test_suite/union/union_codegen_const.c3t @@ -11,7 +11,7 @@ Foo g @private = { .b = 2.3 }; Foo h @private = { .a = 23, .b = 2.3 }; Foo i = { .b = 2.3, .a = 23 }; -// #expect: test.ll +/* #expect: test.ll @test.f = protected unnamed_addr global { i32, [4 x i8] } { i32 23, [4 x i8] undef }, align 8 @test.g = protected unnamed_addr global %Foo { double 2.300000e+00 }, align 8 diff --git a/test/test_suite/union/union_in_struct.c3t b/test/test_suite/union/union_in_struct.c3t index 016259aa1..2380eb4b8 100644 --- a/test/test_suite/union/union_in_struct.c3t +++ b/test/test_suite/union/union_in_struct.c3t @@ -31,7 +31,7 @@ fn void test(Blend_Map_Entry* foo) { } -// #expect: test.ll +/* #expect: test.ll %Blend_Map_Entry = type { %vals }