From 1ab304dc648d1382f6c611f62ffef1f3b4e626b0 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Thu, 19 Jan 2023 11:28:24 +0100 Subject: [PATCH] Fix of overalignment on deref. --- src/compiler/llvm_codegen_expr.c | 1 + src/version.h | 2 +- .../test_suite/bitstruct/bitstruct_to_int.c3t | 2 +- test/test_suite/builtins/shufflevector.c3t | 4 +- .../cast/implicit_infer_len_cast.c3t | 2 +- .../compile_time/typeof_example.c3t | 4 +- test/test_suite/contracts/simple_test.c3t | 4 +- .../errors/optional_taddr_and_access.c3t | 4 +- test/test_suite/expressions/addr_compiles.c3t | 12 +-- test/test_suite/expressions/folding_ptr.c3t | 2 +- test/test_suite/expressions/ternary_bool.c3t | 10 +- test/test_suite/functions/assorted_tests.c3t | 4 +- test/test_suite/functions/simple_test.c3t | 2 +- test/test_suite/functions/test_regression.c3t | 6 +- .../functions/test_regression_mingw.c3t | 6 +- .../test_suite/functions/typeless_varargs.c3t | 2 +- .../macro_method_different_args.c3t | 4 +- test/test_suite/macros/macro_with_body.c3t | 4 +- test/test_suite/pointers/pointer_index.c3t | 4 +- .../pointers/subarray_variant_to_ptr.c3t | 4 +- test/test_suite/safe/deref.c3t | 2 +- .../statements/custom_foreach_with_ref.c3t | 10 +- test/test_suite/statements/foreach_common.c3t | 14 +-- .../foreach_more_implementations.c3t | 4 +- .../statements/foreach_r_common.c3t | 14 +-- test/test_suite/variant/variant_assign.c3t | 6 +- test/test_suite/variant/variant_switch.c3t | 6 +- .../bitstruct/bitstruct_to_int.c3t | 2 +- test/test_suite14/builtins/shufflevector.c3t | 4 +- .../cast/implicit_infer_len_cast.c3t | 92 +++++++++---------- .../compile_time/typeof_example.c3t | 72 +++++++-------- test/test_suite14/contracts/simple_test.c3t | 8 +- .../errors/optional_taddr_and_access.c3t | 4 +- .../expressions/addr_compiles.c3t | 12 +-- test/test_suite14/expressions/folding_ptr.c3t | 2 +- .../test_suite14/expressions/ternary_bool.c3t | 10 +- .../test_suite14/functions/assorted_tests.c3t | 7 +- test/test_suite14/functions/simple_test.c3t | 2 +- .../functions/test_regression.c3t | 6 +- .../functions/test_regression_mingw.c3t | 6 +- .../functions/typeless_varargs.c3t | 2 +- .../macro_method_different_args.c3t | 4 +- test/test_suite14/macros/macro_with_body.c3t | 4 +- test/test_suite14/pointers/pointer_index.c3t | 6 +- .../pointers/subarray_variant_to_ptr.c3t | 4 +- test/test_suite14/safe/deref.c3t | 2 +- .../statements/custom_foreach_with_ref.c3t | 10 +- .../statements/foreach_common.c3t | 14 +-- .../foreach_more_implementations.c3t | 4 +- test/test_suite14/variant/variant_assign.c3t | 7 +- test/test_suite14/variant/variant_switch.c3t | 6 +- 51 files changed, 219 insertions(+), 210 deletions(-) diff --git a/src/compiler/llvm_codegen_expr.c b/src/compiler/llvm_codegen_expr.c index 9c3645218..59429e081 100644 --- a/src/compiler/llvm_codegen_expr.c +++ b/src/compiler/llvm_codegen_expr.c @@ -2299,6 +2299,7 @@ static inline void llvm_emit_deref(GenContext *c, BEValue *value, Expr *inner, T // Convert pointer to address value->kind = BE_ADDRESS; value->type = type; + value->alignment = type_abi_alignment(type); } /** diff --git a/src/version.h b/src/version.h index 900da2d32..2384609f0 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define COMPILER_VERSION "0.4.13" \ No newline at end of file +#define COMPILER_VERSION "0.4.14" \ No newline at end of file diff --git a/test/test_suite/bitstruct/bitstruct_to_int.c3t b/test/test_suite/bitstruct/bitstruct_to_int.c3t index 70724f7b2..0975a5a0a 100644 --- a/test/test_suite/bitstruct/bitstruct_to_int.c3t +++ b/test/test_suite/bitstruct/bitstruct_to_int.c3t @@ -63,7 +63,7 @@ entry: store [4 x i8] %1, ptr %y, align 1 store ptr %b, ptr %c, align 8 %2 = load ptr, ptr %c, align 8 - %3 = load i32, ptr %2, align 8 + %3 = load i32, ptr %2, align 4 %shl = shl i32 %3, 28 %ashr = ashr i32 %shl, 29 %4 = load ptr, ptr %c, align 8 diff --git a/test/test_suite/builtins/shufflevector.c3t b/test/test_suite/builtins/shufflevector.c3t index e05139be8..4a4d80f5c 100644 --- a/test/test_suite/builtins/shufflevector.c3t +++ b/test/test_suite/builtins/shufflevector.c3t @@ -66,7 +66,7 @@ entry: store double %1, ptr %vec, align 8 %2 = getelementptr inbounds %Matrix2x2, ptr %0, i32 0, i32 0 %3 = getelementptr inbounds %.anon.1, ptr %2, i32 0, i32 0 - %4 = load <2 x float>, ptr %3, align 8 + %4 = load <2 x float>, ptr %3, align 16 %5 = getelementptr inbounds %Matrix2x2, ptr %0, i32 0, i32 0 %6 = getelementptr inbounds %.anon.1, ptr %5, i32 0, i32 1 %7 = load <2 x float>, ptr %6, align 8 @@ -74,7 +74,7 @@ entry: store <2 x float> %shuffle, ptr %a, align 8 %8 = getelementptr inbounds %Matrix2x2, ptr %0, i32 0, i32 0 %9 = getelementptr inbounds %.anon.1, ptr %8, i32 0, i32 0 - %10 = load <2 x float>, ptr %9, align 8 + %10 = load <2 x float>, ptr %9, align 16 %11 = getelementptr inbounds %Matrix2x2, ptr %0, i32 0, i32 0 %12 = getelementptr inbounds %.anon.1, ptr %11, i32 0, i32 1 %13 = load <2 x float>, ptr %12, align 8 diff --git a/test/test_suite/cast/implicit_infer_len_cast.c3t b/test/test_suite/cast/implicit_infer_len_cast.c3t index 945a96145..e8614113e 100644 --- a/test/test_suite/cast/implicit_infer_len_cast.c3t +++ b/test/test_suite/cast/implicit_infer_len_cast.c3t @@ -50,7 +50,7 @@ fn void main() store %"int[]" %9, ptr %5, align 16 store ptr %x, ptr %y2, align 8 %10 = load ptr, ptr %y2, align 8 - call void @llvm.memcpy.p0.p0.i32(ptr align 16 %z3, ptr align 8 %10, i32 16, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 16 %z3, ptr align 4 %10, i32 16, i1 false) %11 = getelementptr inbounds [2 x [2 x i32]], ptr %z3, i64 0, i64 1 %12 = getelementptr inbounds [2 x i32], ptr %11, i64 0, i64 1 ret void diff --git a/test/test_suite/compile_time/typeof_example.c3t b/test/test_suite/compile_time/typeof_example.c3t index 5ba86b817..18fc0e602 100644 --- a/test/test_suite/compile_time/typeof_example.c3t +++ b/test/test_suite/compile_time/typeof_example.c3t @@ -33,7 +33,7 @@ fn void main() store float %1, ptr %temp, align 4 store ptr %temp, ptr %result, align 8 %2 = load ptr, ptr %result, align 8 - %3 = load i32, ptr %2, align 8 + %3 = load i32, ptr %2, align 4 store i32 %3, ptr %i, align 4 %4 = load i32, ptr %i, align 4 store i32 %4, ptr %value1, align 4 @@ -41,7 +41,7 @@ fn void main() store i32 %5, ptr %temp2, align 4 store ptr %temp2, ptr %result3, align 8 %6 = load ptr, ptr %result3, align 8 - %7 = load float, ptr %6, align 8 + %7 = load float, ptr %6, align 4 store float %7, ptr %f2, align 4 %8 = load float, ptr %f, align 4 %fpfpext = fpext float %8 to double diff --git a/test/test_suite/contracts/simple_test.c3t b/test/test_suite/contracts/simple_test.c3t index 1406ba202..6251f3a4f 100644 --- a/test/test_suite/contracts/simple_test.c3t +++ b/test/test_suite/contracts/simple_test.c3t @@ -47,7 +47,7 @@ define void @simple_test_test(ptr %0, i32 %1) #0 { entry: %gt = icmp sgt i32 %1, 100 call void @llvm.assume(i1 %gt) - store i32 444, ptr %0, align 8 + store i32 444, ptr %0, align 4 ret void } @@ -55,7 +55,7 @@ define i32 @simple_test_test2(ptr %0, i32 %1) #0 { entry: %gt = icmp sgt i32 %1, 100 call void @llvm.assume(i1 %gt) - store i32 444, ptr %0, align 8 + store i32 444, ptr %0, align 4 %lt = icmp slt i32 %1, 200 call void @llvm.assume(i1 %lt) ret i32 %1 diff --git a/test/test_suite/errors/optional_taddr_and_access.c3t b/test/test_suite/errors/optional_taddr_and_access.c3t index e3ccb5135..1a52cdb0a 100644 --- a/test/test_suite/errors/optional_taddr_and_access.c3t +++ b/test/test_suite/errors/optional_taddr_and_access.c3t @@ -73,7 +73,7 @@ after_assign: ; preds = %after_check, %assig after_check3: ; preds = %after_assign %3 = load ptr, ptr %w, align 8 %4 = getelementptr inbounds %Foo, ptr %3, i32 0, i32 0 - %5 = load i32, ptr %4, align 8 + %5 = load i32, ptr %4, align 4 %6 = call i32 (ptr, ...) @printf(ptr @.str, i32 %5) br label %voiderr @@ -111,7 +111,7 @@ voiderr12: ; preds = %after_assign11 after_check15: ; preds = %voiderr12 %10 = load ptr, ptr %w, align 8 %11 = getelementptr inbounds %Foo, ptr %10, i32 0, i32 0 - %12 = load i32, ptr %11, align 8 + %12 = load i32, ptr %11, align 4 %13 = call i32 (ptr, ...) @printf(ptr @.str.1, i32 %12) br label %voiderr16 diff --git a/test/test_suite/expressions/addr_compiles.c3t b/test/test_suite/expressions/addr_compiles.c3t index b69bb3107..5d03a22c7 100644 --- a/test/test_suite/expressions/addr_compiles.c3t +++ b/test/test_suite/expressions/addr_compiles.c3t @@ -72,9 +72,9 @@ entry: store i32 %0, ptr %taddr, align 4 store ptr %taddr, ptr %h, align 8 %1 = load ptr, ptr %x, align 8 - %2 = load i32, ptr %1, align 8 + %2 = load i32, ptr %1, align 4 %3 = load ptr, ptr %h, align 8 - %4 = load i32, ptr %3, align 8 + %4 = load i32, ptr %3, align 4 call void (ptr, ...) @printf(ptr @.str, i32 %2, i32 %4) ret void } @@ -85,7 +85,7 @@ entry: %w = alloca ptr, align 8 store ptr @test_XX, ptr %w, align 8 %0 = load ptr, ptr %w, align 8 - %1 = load i32, ptr %0, align 8 + %1 = load i32, ptr %0, align 4 call void (ptr, ...) @printf(ptr @.str.1, i32 %1) ret void } @@ -107,9 +107,9 @@ entry: store ptr %1, ptr %zy, align 8 call void @llvm.memcpy.p0.p0.i32(ptr align 4 %arr, ptr align 4 @.__const.2, i32 12, i1 false) %2 = load ptr, ptr %zx, align 8 - %3 = load i32, ptr %2, align 8 + %3 = load i32, ptr %2, align 4 %4 = load ptr, ptr %zy, align 8 - %5 = load i32, ptr %4, align 8 + %5 = load i32, ptr %4, align 4 call void (ptr, ...) @printf(ptr @.str.3, i32 %3, i32 %5) %6 = getelementptr inbounds [3 x i32], ptr %arr, i64 0, i64 0 %7 = load i32, ptr %6, align 4 @@ -131,7 +131,7 @@ entry: store %"int[]" %15, ptr %taddr, align 8 store ptr %taddr, ptr %e, align 8 %16 = load ptr, ptr %d, align 8 - %17 = load i32, ptr %16, align 8 + %17 = load i32, ptr %16, align 4 %18 = load ptr, ptr %e, align 8 %19 = getelementptr inbounds %"int[]", ptr %18, i32 0, i32 0 %20 = load ptr, ptr %19, align 8 diff --git a/test/test_suite/expressions/folding_ptr.c3t b/test/test_suite/expressions/folding_ptr.c3t index 05f01edc0..930d5e112 100644 --- a/test/test_suite/expressions/folding_ptr.c3t +++ b/test/test_suite/expressions/folding_ptr.c3t @@ -29,6 +29,6 @@ if.then: ; preds = %entry if.exit: ; preds = %entry %1 = load ptr, ptr @cfun, align 8 %2 = getelementptr inbounds %Test, ptr %1, i32 0, i32 0 - %3 = load i32, ptr %2, align 8 + %3 = load i32, ptr %2, align 4 ret i32 %3 } diff --git a/test/test_suite/expressions/ternary_bool.c3t b/test/test_suite/expressions/ternary_bool.c3t index ac559f05f..fe89ad342 100644 --- a/test/test_suite/expressions/ternary_bool.c3t +++ b/test/test_suite/expressions/ternary_bool.c3t @@ -22,19 +22,19 @@ entry: store i8 1, ptr %b, align 1 store ptr %b, ptr %c, align 8 %0 = load ptr, ptr %c, align 8 - %1 = load i8, ptr %0, align 8 + %1 = load i8, ptr %0, align 1 %2 = trunc i8 %1 to i1 br i1 %2, label %cond.lhs, label %cond.rhs cond.lhs: ; preds = %entry %3 = load ptr, ptr %c, align 8 - %4 = load i8, ptr %3, align 8 + %4 = load i8, ptr %3, align 1 %5 = trunc i8 %4 to i1 br label %cond.phi cond.rhs: ; preds = %entry %6 = load ptr, ptr %c, align 8 - %7 = load i8, ptr %6, align 8 + %7 = load i8, ptr %6, align 1 %8 = trunc i8 %7 to i1 br label %cond.phi @@ -71,13 +71,13 @@ if.then5: ; preds = %cond.phi3 if.exit6: ; preds = %if.then5, %cond.phi3 %15 = load ptr, ptr %c, align 8 - %16 = load i8, ptr %15, align 8 + %16 = load i8, ptr %15, align 1 %17 = trunc i8 %16 to i1 br i1 %17, label %cond.phi8, label %cond.rhs7 cond.rhs7: ; preds = %if.exit6 %18 = load ptr, ptr %c, align 8 - %19 = load i8, ptr %18, align 8 + %19 = load i8, ptr %18, align 1 %20 = trunc i8 %19 to i1 br label %cond.phi8 diff --git a/test/test_suite/functions/assorted_tests.c3t b/test/test_suite/functions/assorted_tests.c3t index 0691478a4..13f358722 100644 --- a/test/test_suite/functions/assorted_tests.c3t +++ b/test/test_suite/functions/assorted_tests.c3t @@ -57,7 +57,7 @@ entry: %w_cnt = alloca i32, align 4 %0 = load i32, ptr %w_cnt, align 4 %1 = load ptr, ptr %pp, align 8 - %2 = load i8, ptr %1, align 8 + %2 = load i8, ptr %1, align 1 %zext = zext i8 %2 to i32 %add = add i32 %0, %zext store i32 %add, ptr %w_cnt, align 4 @@ -99,7 +99,7 @@ if.exit: ; preds = %if.then, %entry define void @test_setInternalFPFZero(ptr %0) #1 { entry: %1 = getelementptr inbounds %InternalFPF, ptr %0, i32 0, i32 0 - store i8 0, ptr %1, align 8 + store i8 0, ptr %1, align 1 ret void } diff --git a/test/test_suite/functions/simple_test.c3t b/test/test_suite/functions/simple_test.c3t index cd197087a..bb4244a87 100644 --- a/test/test_suite/functions/simple_test.c3t +++ b/test/test_suite/functions/simple_test.c3t @@ -21,7 +21,7 @@ entry: store i32 0, ptr %w_cnt, align 4 %0 = load i32, ptr %w_cnt, align 4 %1 = load ptr, ptr %pp, align 8 - %2 = load i8, ptr %1, align 8 + %2 = load i8, ptr %1, align 1 %zext = zext i8 %2 to i32 %add = add i32 %0, %zext store i32 %add, ptr %w_cnt, align 4 diff --git a/test/test_suite/functions/test_regression.c3t b/test/test_suite/functions/test_regression.c3t index 0092950a4..ac9fa1c8f 100644 --- a/test/test_suite/functions/test_regression.c3t +++ b/test/test_suite/functions/test_regression.c3t @@ -255,7 +255,7 @@ fn Type getValue(Blob blob) define void @test_Foo2_printme(ptr %0) #0 { entry: %1 = getelementptr inbounds %Foo2, ptr %0, i32 0, i32 0 - %2 = load i32, ptr %1, align 8 + %2 = load i32, ptr %1, align 4 %3 = call i32 (ptr, ...) @printf(ptr @.str.21, i32 %2) ret void } @@ -265,9 +265,9 @@ fn Type getValue(Blob blob) entry: %1 = call i32 (ptr, ...) @printf(ptr @.str.22) %2 = getelementptr inbounds %Foo2, ptr %0, i32 0, i32 0 - %3 = load i32, ptr %2, align 8 + %3 = load i32, ptr %2, align 4 %add = add i32 %3, 1 - store i32 %add, ptr %2, align 8 + store i32 %add, ptr %2, align 4 ret i32 %add } diff --git a/test/test_suite/functions/test_regression_mingw.c3t b/test/test_suite/functions/test_regression_mingw.c3t index feb7dd13e..b4ed290a6 100644 --- a/test/test_suite/functions/test_regression_mingw.c3t +++ b/test/test_suite/functions/test_regression_mingw.c3t @@ -296,7 +296,7 @@ $"ct$test_MyEnum" = comdat any define void @test_Foo2_printme(ptr %0) #0 { entry: %1 = getelementptr inbounds %Foo2, ptr %0, i32 0, i32 0 - %2 = load i32, ptr %1, align 8 + %2 = load i32, ptr %1, align 4 %3 = call i32 (ptr, ...) @printf(ptr @.str.21, i32 %2) ret void } @@ -306,9 +306,9 @@ define i32 @test_Foo2_mutate(ptr %0) #0 { entry: %1 = call i32 (ptr, ...) @printf(ptr @.str.22) %2 = getelementptr inbounds %Foo2, ptr %0, i32 0, i32 0 - %3 = load i32, ptr %2, align 8 + %3 = load i32, ptr %2, align 4 %add = add i32 %3, 1 - store i32 %add, ptr %2, align 8 + store i32 %add, ptr %2, align 4 ret i32 %add } diff --git a/test/test_suite/functions/typeless_varargs.c3t b/test/test_suite/functions/typeless_varargs.c3t index 3bb818d89..fd419f58f 100644 --- a/test/test_suite/functions/typeless_varargs.c3t +++ b/test/test_suite/functions/typeless_varargs.c3t @@ -51,7 +51,7 @@ entry: %ptroffset = getelementptr inbounds %variant, ptr %5, i64 0 %6 = getelementptr inbounds %variant, ptr %ptroffset, i32 0, i32 0 %7 = load ptr, ptr %6, align 8 - %8 = load i32, ptr %7, align 8 + %8 = load i32, ptr %7, align 4 call void (ptr, ...) @printf(ptr @.str, i32 %8) ret void } diff --git a/test/test_suite/macro_methods/macro_method_different_args.c3t b/test/test_suite/macro_methods/macro_method_different_args.c3t index f9bbb4540..08c2a6a7e 100644 --- a/test/test_suite/macro_methods/macro_method_different_args.c3t +++ b/test/test_suite/macro_methods/macro_method_different_args.c3t @@ -41,10 +41,10 @@ entry: store ptr %a, ptr %this, align 8 %5 = load ptr, ptr %this, align 8 %6 = getelementptr inbounds %Foo, ptr %5, i32 0, i32 0 - store i32 4, ptr %6, align 8 + store i32 4, ptr %6, align 4 %7 = load ptr, ptr %this, align 8 %8 = getelementptr inbounds %Foo, ptr %7, i32 0, i32 0 - %9 = load i32, ptr %8, align 8 + %9 = load i32, ptr %8, align 4 call void (ptr, ...) @printf(ptr @.str.2, i32 %9) %10 = getelementptr inbounds %Foo, ptr %a, i32 0, i32 0 %11 = load i32, ptr %10, align 4 diff --git a/test/test_suite/macros/macro_with_body.c3t b/test/test_suite/macros/macro_with_body.c3t index ba165e9da..f7b5ffde9 100644 --- a/test/test_suite/macros/macro_with_body.c3t +++ b/test/test_suite/macros/macro_with_body.c3t @@ -49,9 +49,9 @@ define i32 @withbody_Foo_mutate(ptr %0) #0 { entry: %1 = call i32 (ptr, ...) @printf(ptr @.str.2) %2 = getelementptr inbounds %Foo, ptr %0, i32 0, i32 0 - %3 = load i32, ptr %2, align 8 + %3 = load i32, ptr %2, align 4 %add = add i32 %3, 1 - store i32 %add, ptr %2, align 8 + store i32 %add, ptr %2, align 4 %mul = mul i32 10, %add ret i32 %mul } diff --git a/test/test_suite/pointers/pointer_index.c3t b/test/test_suite/pointers/pointer_index.c3t index 53d8e973a..d9be2607a 100644 --- a/test/test_suite/pointers/pointer_index.c3t +++ b/test/test_suite/pointers/pointer_index.c3t @@ -33,7 +33,7 @@ entry: %ptroffset = getelementptr inbounds i32, ptr %0, i64 0 %1 = load i32, ptr %ptroffset, align 4 store i32 %1, ptr %a, align 4 - %2 = load i32, ptr %0, align 8 + %2 = load i32, ptr %0, align 4 store i32 %2, ptr %b, align 4 %ptroffset1 = getelementptr inbounds i32, ptr %0, i64 1 %3 = load i32, ptr %ptroffset1, align 4 @@ -53,7 +53,7 @@ entry: %ptroffset = getelementptr inbounds i8, ptr %0, i64 0 %1 = load i8, ptr %ptroffset, align 1 store i8 %1, ptr %a, align 1 - %2 = load i8, ptr %0, align 8 + %2 = load i8, ptr %0, align 1 store i8 %2, ptr %b, align 1 %ptroffset1 = getelementptr inbounds i8, ptr %0, i64 1 %3 = load i8, ptr %ptroffset1, align 1 diff --git a/test/test_suite/pointers/subarray_variant_to_ptr.c3t b/test/test_suite/pointers/subarray_variant_to_ptr.c3t index 198403bd9..f54c2e7f9 100644 --- a/test/test_suite/pointers/subarray_variant_to_ptr.c3t +++ b/test/test_suite/pointers/subarray_variant_to_ptr.c3t @@ -43,7 +43,7 @@ entry: %5 = load ptr, ptr %4, align 8 store ptr %5, ptr %w, align 8 %6 = load ptr, ptr %w, align 8 - %7 = load i32, ptr %6, align 8 + %7 = load i32, ptr %6, align 4 call void (ptr, ...) @printf(ptr @.str, i32 %7) ret void } @@ -60,7 +60,7 @@ entry: %5 = load ptr, ptr %4, align 8 store ptr %5, ptr %w, align 8 %6 = load ptr, ptr %w, align 8 - %7 = load i32, ptr %6, align 8 + %7 = load i32, ptr %6, align 4 call void (ptr, ...) @printf(ptr @.str.1, i32 %7) ret void } diff --git a/test/test_suite/safe/deref.c3t b/test/test_suite/safe/deref.c3t index 2760e9973..05bc2d220 100644 --- a/test/test_suite/safe/deref.c3t +++ b/test/test_suite/safe/deref.c3t @@ -25,7 +25,7 @@ panic: ; preds = %entry br label %checkok checkok: ; preds = %panic, %entry - %2 = load i32, ptr %0, align 8 + %2 = load i32, ptr %0, align 4 store i32 %2, ptr %y, align 4 ret void } diff --git a/test/test_suite/statements/custom_foreach_with_ref.c3t b/test/test_suite/statements/custom_foreach_with_ref.c3t index 965410748..93c2c234f 100644 --- a/test/test_suite/statements/custom_foreach_with_ref.c3t +++ b/test/test_suite/statements/custom_foreach_with_ref.c3t @@ -251,12 +251,12 @@ loop.body13: ; preds = %loop.cond11 %31 = getelementptr inbounds [3 x i32], ptr %29, i64 0, i64 %sisiext17 store ptr %31, ptr %y15, align 8 %32 = load ptr, ptr %y15, align 8 - %33 = load i32, ptr %32, align 8 + %33 = load i32, ptr %32, align 4 %add18 = add i32 %33, 1 - store i32 %add18, ptr %32, align 8 + store i32 %add18, ptr %32, align 4 %34 = load i32, ptr %i14, align 4 %35 = load ptr, ptr %y15, align 8 - %36 = load i32, ptr %35, align 8 + %36 = load i32, ptr %35, align 4 call void (ptr, ...) @printf(ptr @.str.4, i32 %34, i32 %36) %37 = load i32, ptr %.anon10, align 4 %add19 = add i32 %37, 1 @@ -457,9 +457,9 @@ loop.exit81: ; preds = %loop.cond75 %108 = getelementptr inbounds [3 x i32], ptr %106, i64 0, i64 %sisiext88 store ptr %108, ptr %y86, align 8 %109 = load ptr, ptr %y86, align 8 - %110 = load i32, ptr %109, align 8 + %110 = load i32, ptr %109, align 4 %add89 = add i32 %110, 1 - store i32 %add89, ptr %109, align 8 + store i32 %add89, ptr %109, align 4 store i32 0, ptr %a90, align 4 %111 = getelementptr inbounds %Foo, ptr %x, i32 0, i32 0 %112 = load i32, ptr %a90, align 4 diff --git a/test/test_suite/statements/foreach_common.c3t b/test/test_suite/statements/foreach_common.c3t index 8cdbb6fc0..dabd33ce6 100644 --- a/test/test_suite/statements/foreach_common.c3t +++ b/test/test_suite/statements/foreach_common.c3t @@ -129,11 +129,11 @@ loop.body4: ; preds = %loop.cond2 %8 = getelementptr inbounds [3 x float], ptr %foo, i64 0, i64 %7 store ptr %8, ptr %a5, align 8 %9 = load ptr, ptr %a5, align 8 - %10 = load float, ptr %9, align 8 + %10 = load float, ptr %9, align 4 %fmul = fmul float %10, 2.000000e+00 - store float %fmul, ptr %9, align 8 + store float %fmul, ptr %9, align 4 %11 = load ptr, ptr %a5, align 8 - %12 = load float, ptr %11, align 8 + %12 = load float, ptr %11, align 4 %fpfpext6 = fpext float %12 to double call void (ptr, ...) @printf(ptr @.str.1, double %fpfpext6) %13 = load i64, ptr %.anon1, align 8 @@ -155,7 +155,7 @@ loop.body12: ; preds = %loop.cond10 %16 = getelementptr inbounds [3 x float], ptr %foo, i64 0, i64 %15 store ptr %16, ptr %a13, align 8 %17 = load ptr, ptr %a13, align 8 - %18 = load float, ptr %17, align 8 + %18 = load float, ptr %17, align 4 %fpfpext14 = fpext float %18 to double call void (ptr, ...) @printf(ptr @.str.2, double %fpfpext14) %19 = load i64, ptr %.anon9, align 8 @@ -277,11 +277,11 @@ loop.body54: ; preds = %loop.cond52 %52 = getelementptr inbounds <3 x float>, ptr %foo2, i64 0, i64 %51 store ptr %52, ptr %a55, align 8 %53 = load ptr, ptr %a55, align 8 - %54 = load float, ptr %53, align 8 + %54 = load float, ptr %53, align 4 %fmul56 = fmul float %54, 2.000000e+00 - store float %fmul56, ptr %53, align 8 + store float %fmul56, ptr %53, align 4 %55 = load ptr, ptr %a55, align 8 - %56 = load float, ptr %55, align 8 + %56 = load float, ptr %55, align 4 %fpfpext57 = fpext float %56 to double call void (ptr, ...) @printf(ptr @.str.7, double %fpfpext57) %57 = load i64, ptr %.anon51, align 8 diff --git a/test/test_suite/statements/foreach_more_implementations.c3t b/test/test_suite/statements/foreach_more_implementations.c3t index fbff1e940..5aab4a99a 100644 --- a/test/test_suite/statements/foreach_more_implementations.c3t +++ b/test/test_suite/statements/foreach_more_implementations.c3t @@ -102,9 +102,9 @@ after_check: ; preds = %loop.body voiderr: ; preds = %after_check, %loop.body %16 = load ptr, ptr %ref, align 8 - %17 = load i32, ptr %16, align 8 + %17 = load i32, ptr %16, align 4 %add = add i32 %17, 2 - store i32 %add, ptr %16, align 8 + store i32 %add, ptr %16, align 4 %18 = load i64, ptr %.anon1, align 8 %add3 = add i64 %18, 1 store i64 %add3, ptr %.anon1, align 8 diff --git a/test/test_suite/statements/foreach_r_common.c3t b/test/test_suite/statements/foreach_r_common.c3t index c8d675458..7d8e23055 100644 --- a/test/test_suite/statements/foreach_r_common.c3t +++ b/test/test_suite/statements/foreach_r_common.c3t @@ -127,11 +127,11 @@ loop.body4: ; preds = %loop.cond2 %9 = getelementptr inbounds [3 x float], ptr %foo, i64 0, i64 %8 store ptr %9, ptr %a6, align 8 %10 = load ptr, ptr %a6, align 8 - %11 = load float, ptr %10, align 8 + %11 = load float, ptr %10, align 4 %fmul = fmul float %11, 2.000000e+00 - store float %fmul, ptr %10, align 8 + store float %fmul, ptr %10, align 4 %12 = load ptr, ptr %a6, align 8 - %13 = load float, ptr %12, align 8 + %13 = load float, ptr %12, align 4 %fpfpext7 = fpext float %13 to double call void (ptr, ...) @printf(ptr @.str.1, double %fpfpext7) br label %loop.cond2 @@ -153,7 +153,7 @@ loop.body12: ; preds = %loop.cond10 %17 = getelementptr inbounds [3 x float], ptr %foo, i64 0, i64 %16 store ptr %17, ptr %a14, align 8 %18 = load ptr, ptr %a14, align 8 - %19 = load float, ptr %18, align 8 + %19 = load float, ptr %18, align 4 %fpfpext15 = fpext float %19 to double call void (ptr, ...) @printf(ptr @.str.2, double %fpfpext15) br label %loop.cond10 @@ -271,11 +271,11 @@ loop.body53: ; preds = %loop.cond51 %51 = getelementptr inbounds <3 x float>, ptr %foo2, i64 0, i64 %50 store ptr %51, ptr %a55, align 8 %52 = load ptr, ptr %a55, align 8 - %53 = load float, ptr %52, align 8 + %53 = load float, ptr %52, align 4 %fmul56 = fmul float %53, 2.000000e+00 - store float %fmul56, ptr %52, align 8 + store float %fmul56, ptr %52, align 4 %54 = load ptr, ptr %a55, align 8 - %55 = load float, ptr %54, align 8 + %55 = load float, ptr %54, align 4 %fpfpext57 = fpext float %55 to double call void (ptr, ...) @printf(ptr @.str.7, double %fpfpext57) br label %loop.cond51 diff --git a/test/test_suite/variant/variant_assign.c3t b/test/test_suite/variant/variant_assign.c3t index 9c494ac70..7c6966935 100644 --- a/test/test_suite/variant/variant_assign.c3t +++ b/test/test_suite/variant/variant_assign.c3t @@ -87,7 +87,7 @@ switch.case: ; preds = %switch.entry %8 = load ptr, ptr %7, align 8 store ptr %8, ptr %z1, align 8 %9 = load ptr, ptr %z1, align 8 - %10 = load i32, ptr %9, align 8 + %10 = load i32, ptr %9, align 4 call void (ptr, ...) @printf(ptr @.str, i32 %10) br label %switch.exit @@ -147,7 +147,7 @@ switch.case: ; preds = %switch.entry %10 = insertvalue %variant %9, i64 ptrtoint (ptr @"ct$int" to i64), 1 store %variant %10, ptr %y, align 8 %11 = load ptr, ptr %z, align 8 - %12 = load i32, ptr %11, align 8 + %12 = load i32, ptr %11, align 4 call void (ptr, ...) @printf(ptr @.str.3, i32 %12) br label %switch.exit @@ -200,7 +200,7 @@ switch.entry: ; preds = %entry switch.case: ; preds = %switch.entry %7 = getelementptr inbounds %variant, ptr %.anon, i32 0, i32 0 %8 = load ptr, ptr %7, align 8 - %9 = load i32, ptr %8, align 8 + %9 = load i32, ptr %8, align 4 store i32 %9, ptr %z, align 4 %10 = load i32, ptr %z, align 4 call void (ptr, ...) @printf(ptr @.str.6, i32 %10) diff --git a/test/test_suite/variant/variant_switch.c3t b/test/test_suite/variant/variant_switch.c3t index fdfd3c94c..cf3528609 100644 --- a/test/test_suite/variant/variant_switch.c3t +++ b/test/test_suite/variant/variant_switch.c3t @@ -59,10 +59,10 @@ switch.case: ; preds = %switch.entry %8 = load ptr, ptr %7, align 8 store ptr %8, ptr %z1, align 8 %9 = load ptr, ptr %z1, align 8 - %10 = load i32, ptr %9, align 8 + %10 = load i32, ptr %9, align 4 call void (ptr, ...) @printf(ptr @.str, i32 %10) %11 = load ptr, ptr %z1, align 8 - store i32 3, ptr %11, align 8 + store i32 3, ptr %11, align 4 br label %switch.exit next_if: ; preds = %switch.entry @@ -94,7 +94,7 @@ switch.exit: ; preds = %switch.default, %sw if.then: ; preds = %switch.exit %18 = getelementptr inbounds %variant, ptr %z, i32 0, i32 0 %19 = load ptr, ptr %18, align 8 - %20 = load i32, ptr %19, align 8 + %20 = load i32, ptr %19, align 4 call void (ptr, ...) @printf(ptr @.str.3, i32 %20) br label %if.exit diff --git a/test/test_suite14/bitstruct/bitstruct_to_int.c3t b/test/test_suite14/bitstruct/bitstruct_to_int.c3t index 8b45c964e..4954606b3 100644 --- a/test/test_suite14/bitstruct/bitstruct_to_int.c3t +++ b/test/test_suite14/bitstruct/bitstruct_to_int.c3t @@ -64,7 +64,7 @@ entry: store [4 x i8] %2, [4 x i8]* %y, align 1 store i32* %b, i32** %c, align 8 %3 = load i32*, i32** %c, align 8 - %4 = load i32, i32* %3, align 8 + %4 = load i32, i32* %3, align 4 %shl = shl i32 %4, 28 %ashr = ashr i32 %shl, 29 %5 = load i32*, i32** %c, align 8 diff --git a/test/test_suite14/builtins/shufflevector.c3t b/test/test_suite14/builtins/shufflevector.c3t index b4b81fc2f..3e591ae14 100644 --- a/test/test_suite14/builtins/shufflevector.c3t +++ b/test/test_suite14/builtins/shufflevector.c3t @@ -68,7 +68,7 @@ entry: %3 = getelementptr inbounds %Matrix2x2, %Matrix2x2* %0, i32 0, i32 0 %4 = bitcast %.anon* %3 to %.anon.1* %5 = getelementptr inbounds %.anon.1, %.anon.1* %4, i32 0, i32 0 - %6 = load <2 x float>, <2 x float>* %5, align 8 + %6 = load <2 x float>, <2 x float>* %5, align 16 %7 = getelementptr inbounds %Matrix2x2, %Matrix2x2* %0, i32 0, i32 0 %8 = bitcast %.anon* %7 to %.anon.1* %9 = getelementptr inbounds %.anon.1, %.anon.1* %8, i32 0, i32 1 @@ -78,7 +78,7 @@ entry: %11 = getelementptr inbounds %Matrix2x2, %Matrix2x2* %0, i32 0, i32 0 %12 = bitcast %.anon* %11 to %.anon.1* %13 = getelementptr inbounds %.anon.1, %.anon.1* %12, i32 0, i32 0 - %14 = load <2 x float>, <2 x float>* %13, align 8 + %14 = load <2 x float>, <2 x float>* %13, align 16 %15 = getelementptr inbounds %Matrix2x2, %Matrix2x2* %0, i32 0, i32 0 %16 = bitcast %.anon* %15 to %.anon.1* %17 = getelementptr inbounds %.anon.1, %.anon.1* %16, i32 0, i32 1 diff --git a/test/test_suite14/cast/implicit_infer_len_cast.c3t b/test/test_suite14/cast/implicit_infer_len_cast.c3t index b12a4ce60..88c57eb8f 100644 --- a/test/test_suite14/cast/implicit_infer_len_cast.c3t +++ b/test/test_suite14/cast/implicit_infer_len_cast.c3t @@ -18,49 +18,49 @@ fn void main() } /* #expect: test.ll - %x = alloca [2 x [2 x i32]], align 16 - %y = alloca [1 x <2 x i32>], align 8 - %z = alloca [1 x <2 x i32>], align 8 - %w = alloca [1 x <2 x i32>], align 8 - %aa = alloca %"int[<2>][]", align 8 - %literal = alloca [1 x <2 x i32>], align 8 - %bb = alloca [1 x %"int[]"], align 16 - %literal1 = alloca [2 x i32], align 4 - %y2 = alloca [2 x [2 x i32]]*, align 8 - %z3 = alloca [2 x [2 x i32]], align 16 - %0 = bitcast [2 x [2 x i32]]* %x to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 16 %0, i8* align 16 bitcast ([2 x [2 x i32]]* @.__const to i8*), i32 16, i1 false) - %1 = bitcast [1 x <2 x i32>]* %y to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %1, i8* align 8 bitcast ([1 x <2 x i32>]* @.__const.1 to i8*), i32 8, i1 false) - %2 = bitcast [1 x <2 x i32>]* %z to i8* - %3 = bitcast [1 x <2 x i32>]* %y to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %2, i8* align 8 %3, i32 8, i1 false) - %4 = bitcast [1 x <2 x i32>]* %w to i8* - %5 = bitcast [1 x <2 x i32>]* %z to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %4, i8* align 8 %5, i32 8, i1 false) - %6 = getelementptr inbounds [1 x <2 x i32>], [1 x <2 x i32>]* %literal, i64 0, i64 0 - %7 = getelementptr inbounds <2 x i32>, <2 x i32>* %6, i64 0, i64 0 - store i32 1, i32* %7, align 4 - %8 = getelementptr inbounds <2 x i32>, <2 x i32>* %6, i64 0, i64 1 - store i32 3, i32* %8, align 4 - %9 = bitcast [1 x <2 x i32>]* %literal to <2 x i32>* - %10 = insertvalue %"int[<2>][]" undef, <2 x i32>* %9, 0 - %11 = insertvalue %"int[<2>][]" %10, i64 1, 1 - store %"int[<2>][]" %11, %"int[<2>][]"* %aa, align 8 - %12 = getelementptr inbounds [1 x %"int[]"], [1 x %"int[]"]* %bb, i64 0, i64 0 - %13 = getelementptr inbounds [2 x i32], [2 x i32]* %literal1, i64 0, i64 0 - store i32 1, i32* %13, align 4 - %14 = getelementptr inbounds [2 x i32], [2 x i32]* %literal1, i64 0, i64 1 - store i32 3, i32* %14, align 4 - %15 = bitcast [2 x i32]* %literal1 to i32* - %16 = insertvalue %"int[]" undef, i32* %15, 0 - %17 = insertvalue %"int[]" %16, i64 2, 1 - store %"int[]" %17, %"int[]"* %12, align 16 - store [2 x [2 x i32]]* %x, [2 x [2 x i32]]** %y2, align 8 - %18 = load [2 x [2 x i32]]*, [2 x [2 x i32]]** %y2, align 8 - %19 = bitcast [2 x [2 x i32]]* %z3 to i8* - %20 = bitcast [2 x [2 x i32]]* %18 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 16 %19, i8* align 8 %20, i32 16, i1 false) - %21 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %z3, i64 0, i64 1 - %22 = getelementptr inbounds [2 x i32], [2 x i32]* %21, i64 0, i64 1 - ret void + %x = alloca [2 x [2 x i32]], align 16 + %y = alloca [1 x <2 x i32>], align 8 + %z = alloca [1 x <2 x i32>], align 8 + %w = alloca [1 x <2 x i32>], align 8 + %aa = alloca %"int[<2>][]", align 8 + %literal = alloca [1 x <2 x i32>], align 8 + %bb = alloca [1 x %"int[]"], align 16 + %literal1 = alloca [2 x i32], align 4 + %y2 = alloca [2 x [2 x i32]]*, align 8 + %z3 = alloca [2 x [2 x i32]], align 16 + %0 = bitcast [2 x [2 x i32]]* %x to i8* + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 16 %0, i8* align 16 bitcast ([2 x [2 x i32]]* @.__const to i8*), i32 16, i1 false) + %1 = bitcast [1 x <2 x i32>]* %y to i8* + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %1, i8* align 8 bitcast ([1 x <2 x i32>]* @.__const.1 to i8*), i32 8, i1 false) + %2 = bitcast [1 x <2 x i32>]* %z to i8* + %3 = bitcast [1 x <2 x i32>]* %y to i8* + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %2, i8* align 8 %3, i32 8, i1 false) + %4 = bitcast [1 x <2 x i32>]* %w to i8* + %5 = bitcast [1 x <2 x i32>]* %z to i8* + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %4, i8* align 8 %5, i32 8, i1 false) + %6 = getelementptr inbounds [1 x <2 x i32>], [1 x <2 x i32>]* %literal, i64 0, i64 0 + %7 = getelementptr inbounds <2 x i32>, <2 x i32>* %6, i64 0, i64 0 + store i32 1, i32* %7, align 4 + %8 = getelementptr inbounds <2 x i32>, <2 x i32>* %6, i64 0, i64 1 + store i32 3, i32* %8, align 4 + %9 = bitcast [1 x <2 x i32>]* %literal to <2 x i32>* + %10 = insertvalue %"int[<2>][]" undef, <2 x i32>* %9, 0 + %11 = insertvalue %"int[<2>][]" %10, i64 1, 1 + store %"int[<2>][]" %11, %"int[<2>][]"* %aa, align 8 + %12 = getelementptr inbounds [1 x %"int[]"], [1 x %"int[]"]* %bb, i64 0, i64 0 + %13 = getelementptr inbounds [2 x i32], [2 x i32]* %literal1, i64 0, i64 0 + store i32 1, i32* %13, align 4 + %14 = getelementptr inbounds [2 x i32], [2 x i32]* %literal1, i64 0, i64 1 + store i32 3, i32* %14, align 4 + %15 = bitcast [2 x i32]* %literal1 to i32* + %16 = insertvalue %"int[]" undef, i32* %15, 0 + %17 = insertvalue %"int[]" %16, i64 2, 1 + store %"int[]" %17, %"int[]"* %12, align 16 + store [2 x [2 x i32]]* %x, [2 x [2 x i32]]** %y2, align 8 + %18 = load [2 x [2 x i32]]*, [2 x [2 x i32]]** %y2, align 8 + %19 = bitcast [2 x [2 x i32]]* %z3 to i8* + %20 = bitcast [2 x [2 x i32]]* %18 to i8* + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 16 %19, i8* align 4 %20, i32 16, i1 false) + %21 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %z3, i64 0, i64 1 + %22 = getelementptr inbounds [2 x i32], [2 x i32]* %21, i64 0, i64 1 + ret void diff --git a/test/test_suite14/compile_time/typeof_example.c3t b/test/test_suite14/compile_time/typeof_example.c3t index 3b7491038..2c628ac56 100644 --- a/test/test_suite14/compile_time/typeof_example.c3t +++ b/test/test_suite14/compile_time/typeof_example.c3t @@ -15,40 +15,40 @@ fn void main() printf("Bitcast %f to %d to %f", f, i, f2); } -// #expect: typeof_example.ll +/* #expect: typeof_example.ll - %f = alloca float, align 4 - %i = alloca i32, align 4 - %value = alloca float, align 4 - %temp = alloca float, align 4 - %result = alloca i32*, align 8 - %f2 = alloca float, align 4 - %value1 = alloca i32, align 4 - %temp2 = alloca i32, align 4 - %result3 = alloca float*, align 8 - store float 1.000000e+02, float* %f, align 4 - %0 = load float, float* %f, align 4 - store float %0, float* %value, align 4 - %1 = load float, float* %value, align 4 - store float %1, float* %temp, align 4 - %ptrptr = bitcast float* %temp to i32* - store i32* %ptrptr, i32** %result, align 8 - %2 = load i32*, i32** %result, align 8 - %3 = load i32, i32* %2, align 8 - store i32 %3, i32* %i, align 4 - %4 = load i32, i32* %i, align 4 - store i32 %4, i32* %value1, align 4 - %5 = load i32, i32* %value1, align 4 - store i32 %5, i32* %temp2, align 4 - %ptrptr4 = bitcast i32* %temp2 to float* - store float* %ptrptr4, float** %result3, align 8 - %6 = load float*, float** %result3, align 8 - %7 = load float, float* %6, align 8 - store float %7, float* %f2, align 4 - %8 = load float, float* %f, align 4 - %fpfpext = fpext float %8 to double - %9 = load i32, i32* %i, align 4 - %10 = load float, float* %f2, align 4 - %fpfpext5 = fpext float %10 to double - call void (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0), double %fpfpext, i32 %9, double %fpfpext5) - ret void \ No newline at end of file + %f = alloca float, align 4 + %i = alloca i32, align 4 + %value = alloca float, align 4 + %temp = alloca float, align 4 + %result = alloca i32*, align 8 + %f2 = alloca float, align 4 + %value1 = alloca i32, align 4 + %temp2 = alloca i32, align 4 + %result3 = alloca float*, align 8 + store float 1.000000e+02, float* %f, align 4 + %0 = load float, float* %f, align 4 + store float %0, float* %value, align 4 + %1 = load float, float* %value, align 4 + store float %1, float* %temp, align 4 + %ptrptr = bitcast float* %temp to i32* + store i32* %ptrptr, i32** %result, align 8 + %2 = load i32*, i32** %result, align 8 + %3 = load i32, i32* %2, align 4 + store i32 %3, i32* %i, align 4 + %4 = load i32, i32* %i, align 4 + store i32 %4, i32* %value1, align 4 + %5 = load i32, i32* %value1, align 4 + store i32 %5, i32* %temp2, align 4 + %ptrptr4 = bitcast i32* %temp2 to float* + store float* %ptrptr4, float** %result3, align 8 + %6 = load float*, float** %result3, align 8 + %7 = load float, float* %6, align 4 + store float %7, float* %f2, align 4 + %8 = load float, float* %f, align 4 + %fpfpext = fpext float %8 to double + %9 = load i32, i32* %i, align 4 + %10 = load float, float* %f2, align 4 + %fpfpext5 = fpext float %10 to double + call void (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0), double %fpfpext, i32 %9, double %fpfpext5) + ret void \ No newline at end of file diff --git a/test/test_suite14/contracts/simple_test.c3t b/test/test_suite14/contracts/simple_test.c3t index 3df7b7166..2f752b62f 100644 --- a/test/test_suite14/contracts/simple_test.c3t +++ b/test/test_suite14/contracts/simple_test.c3t @@ -47,7 +47,7 @@ define void @simple_test_test(i32* %0, i32 %1) #0 { entry: %gt = icmp sgt i32 %1, 100 call void @llvm.assume(i1 %gt) - store i32 444, i32* %0, align 8 + store i32 444, i32* %0, align 4 ret void } @@ -55,7 +55,9 @@ define i32 @simple_test_test2(i32* %0, i32 %1) #0 { entry: %gt = icmp sgt i32 %1, 100 call void @llvm.assume(i1 %gt) - store i32 444, i32* %0, align 8 + store i32 444, i32* %0, align 4 + %lt = icmp slt i32 %1, 200 + call void @llvm.assume(i1 %lt) ret i32 %1 } @@ -64,6 +66,8 @@ entry: %gt = icmp sgt i32 %0, 0 call void @llvm.assume(i1 %gt) %add = add i32 %0, 1 + %gt1 = icmp sgt i32 %add, 0 + call void @llvm.assume(i1 %gt1) ret i32 %add } diff --git a/test/test_suite14/errors/optional_taddr_and_access.c3t b/test/test_suite14/errors/optional_taddr_and_access.c3t index b50d016a4..d7851c131 100644 --- a/test/test_suite14/errors/optional_taddr_and_access.c3t +++ b/test/test_suite14/errors/optional_taddr_and_access.c3t @@ -74,7 +74,7 @@ after_assign: ; preds = %after_check, %assig after_check3: ; preds = %after_assign %3 = load %Foo*, %Foo** %w, align 8 %4 = getelementptr inbounds %Foo, %Foo* %3, i32 0, i32 0 - %5 = load i32, i32* %4, align 8 + %5 = load i32, i32* %4, align 4 %6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %5) br label %voiderr @@ -112,7 +112,7 @@ voiderr12: ; preds = %after_assign11 after_check15: ; preds = %voiderr12 %10 = load %Foo*, %Foo** %w, align 8 %11 = getelementptr inbounds %Foo, %Foo* %10, i32 0, i32 0 - %12 = load i32, i32* %11, align 8 + %12 = load i32, i32* %11, align 4 %13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i32 0, i32 0), i32 %12) br label %voiderr16 diff --git a/test/test_suite14/expressions/addr_compiles.c3t b/test/test_suite14/expressions/addr_compiles.c3t index beb4f6d04..eb7869d4b 100644 --- a/test/test_suite14/expressions/addr_compiles.c3t +++ b/test/test_suite14/expressions/addr_compiles.c3t @@ -72,9 +72,9 @@ entry: store i32 %0, i32* %taddr, align 4 store i32* %taddr, i32** %h, align 8 %1 = load i32*, i32** %x, align 8 - %2 = load i32, i32* %1, align 8 + %2 = load i32, i32* %1, align 4 %3 = load i32*, i32** %h, align 8 - %4 = load i32, i32* %3, align 8 + %4 = load i32, i32* %3, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i32 0, i32 0), i32 %2, i32 %4) ret void } @@ -85,7 +85,7 @@ entry: %w = alloca i32*, align 8 store i32* @test_XX, i32** %w, align 8 %0 = load i32*, i32** %w, align 8 - %1 = load i32, i32* %0, align 8 + %1 = load i32, i32* %0, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i32 0, i32 0), i32 %1) ret void } @@ -109,9 +109,9 @@ entry: %3 = bitcast [3 x i32]* %arr to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %3, i8* align 4 bitcast ([3 x i32]* @.__const.2 to i8*), i32 12, i1 false) %4 = load i32*, i32** %zx, align 8 - %5 = load i32, i32* %4, align 8 + %5 = load i32, i32* %4, align 4 %6 = load i32*, i32** %zy, align 8 - %7 = load i32, i32* %6, align 8 + %7 = load i32, i32* %6, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i32 0, i32 0), i32 %5, i32 %7) %8 = getelementptr inbounds [3 x i32], [3 x i32]* %arr, i64 0, i64 0 %9 = load i32, i32* %8, align 4 @@ -133,7 +133,7 @@ entry: store %"int[]" %17, %"int[]"* %taddr, align 8 store %"int[]"* %taddr, %"int[]"** %e, align 8 %18 = load i32*, i32** %d, align 8 - %19 = load i32, i32* %18, align 8 + %19 = load i32, i32* %18, align 4 %20 = load %"int[]"*, %"int[]"** %e, align 8 %21 = getelementptr inbounds %"int[]", %"int[]"* %20, i32 0, i32 0 %22 = load i32*, i32** %21, align 8 diff --git a/test/test_suite14/expressions/folding_ptr.c3t b/test/test_suite14/expressions/folding_ptr.c3t index 51581256a..2e2915a35 100644 --- a/test/test_suite14/expressions/folding_ptr.c3t +++ b/test/test_suite14/expressions/folding_ptr.c3t @@ -29,6 +29,6 @@ if.then: ; preds = %entry if.exit: ; preds = %entry %1 = load %Test*, %Test** @cfun, align 8 %2 = getelementptr inbounds %Test, %Test* %1, i32 0, i32 0 - %3 = load i32, i32* %2, align 8 + %3 = load i32, i32* %2, align 4 ret i32 %3 } diff --git a/test/test_suite14/expressions/ternary_bool.c3t b/test/test_suite14/expressions/ternary_bool.c3t index f723b3a09..4b31bd5dd 100644 --- a/test/test_suite14/expressions/ternary_bool.c3t +++ b/test/test_suite14/expressions/ternary_bool.c3t @@ -22,19 +22,19 @@ entry: store i8 1, i8* %b, align 1 store i8* %b, i8** %c, align 8 %0 = load i8*, i8** %c, align 8 - %1 = load i8, i8* %0, align 8 + %1 = load i8, i8* %0, align 1 %2 = trunc i8 %1 to i1 br i1 %2, label %cond.lhs, label %cond.rhs cond.lhs: ; preds = %entry %3 = load i8*, i8** %c, align 8 - %4 = load i8, i8* %3, align 8 + %4 = load i8, i8* %3, align 1 %5 = trunc i8 %4 to i1 br label %cond.phi cond.rhs: ; preds = %entry %6 = load i8*, i8** %c, align 8 - %7 = load i8, i8* %6, align 8 + %7 = load i8, i8* %6, align 1 %8 = trunc i8 %7 to i1 br label %cond.phi @@ -71,13 +71,13 @@ if.then5: ; preds = %cond.phi3 if.exit6: ; preds = %if.then5, %cond.phi3 %15 = load i8*, i8** %c, align 8 - %16 = load i8, i8* %15, align 8 + %16 = load i8, i8* %15, align 1 %17 = trunc i8 %16 to i1 br i1 %17, label %cond.phi8, label %cond.rhs7 cond.rhs7: ; preds = %if.exit6 %18 = load i8*, i8** %c, align 8 - %19 = load i8, i8* %18, align 8 + %19 = load i8, i8* %18, align 1 %20 = trunc i8 %19 to i1 br label %cond.phi8 diff --git a/test/test_suite14/functions/assorted_tests.c3t b/test/test_suite14/functions/assorted_tests.c3t index 93dc4989b..a19405ecb 100644 --- a/test/test_suite14/functions/assorted_tests.c3t +++ b/test/test_suite14/functions/assorted_tests.c3t @@ -56,7 +56,7 @@ entry: %w_cnt = alloca i32, align 4 %0 = load i32, i32* %w_cnt, align 4 %1 = load i8*, i8** %pp, align 8 - %2 = load i8, i8* %1, align 8 + %2 = load i8, i8* %1, align 1 %zext = zext i8 %2 to i32 %add = add i32 %0, %zext store i32 %add, i32* %w_cnt, align 4 @@ -98,7 +98,7 @@ if.exit: ; preds = %if.then, %entry define void @test_setInternalFPFZero(%InternalFPF* %0) #1 { entry: %1 = getelementptr inbounds %InternalFPF, %InternalFPF* %0, i32 0, i32 0 - store i8 0, i8* %1, align 8 + store i8 0, i8* %1, align 1 ret void } @@ -107,3 +107,6 @@ entry: call void @test_setInternalFPFZero(%InternalFPF* %0) ret void } + +attributes #0 = { nounwind } +attributes #1 = { noinline nounwind } \ No newline at end of file diff --git a/test/test_suite14/functions/simple_test.c3t b/test/test_suite14/functions/simple_test.c3t index 889c1be63..03e4aab76 100644 --- a/test/test_suite14/functions/simple_test.c3t +++ b/test/test_suite14/functions/simple_test.c3t @@ -21,7 +21,7 @@ entry: store i32 0, i32* %w_cnt, align 4 %0 = load i32, i32* %w_cnt, align 4 %1 = load i8*, i8** %pp, align 8 - %2 = load i8, i8* %1, align 8 + %2 = load i8, i8* %1, align 1 %zext = zext i8 %2 to i32 %add = add i32 %0, %zext store i32 %add, i32* %w_cnt, align 4 diff --git a/test/test_suite14/functions/test_regression.c3t b/test/test_suite14/functions/test_regression.c3t index 89b467cec..51584818d 100644 --- a/test/test_suite14/functions/test_regression.c3t +++ b/test/test_suite14/functions/test_regression.c3t @@ -256,7 +256,7 @@ fn Type getValue(Blob blob) define void @test_Foo2_printme(%Foo2* %0) #0 { entry: %1 = getelementptr inbounds %Foo2, %Foo2* %0, i32 0, i32 0 - %2 = load i32, i32* %1, align 8 + %2 = load i32, i32* %1, align 4 %3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i32 0, i32 0), i32 %2) ret void } @@ -266,9 +266,9 @@ define i32 @test_Foo2_mutate(%Foo2* %0) #0 { entry: %1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i32 0, i32 0)) %2 = getelementptr inbounds %Foo2, %Foo2* %0, i32 0, i32 0 - %3 = load i32, i32* %2, align 8 + %3 = load i32, i32* %2, align 4 %add = add i32 %3, 1 - store i32 %add, i32* %2, align 8 + store i32 %add, i32* %2, align 4 ret i32 %add } diff --git a/test/test_suite14/functions/test_regression_mingw.c3t b/test/test_suite14/functions/test_regression_mingw.c3t index 35c13b155..06ea0e5df 100644 --- a/test/test_suite14/functions/test_regression_mingw.c3t +++ b/test/test_suite14/functions/test_regression_mingw.c3t @@ -297,7 +297,7 @@ $"ct$test_MyEnum" = comdat any define void @test_Foo2_printme(%Foo2* %0) #0 { entry: %1 = getelementptr inbounds %Foo2, %Foo2* %0, i32 0, i32 0 - %2 = load i32, i32* %1, align 8 + %2 = load i32, i32* %1, align 4 %3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i32 0, i32 0), i32 %2) ret void } @@ -307,9 +307,9 @@ define i32 @test_Foo2_mutate(%Foo2* %0) #0 { entry: %1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i32 0, i32 0)) %2 = getelementptr inbounds %Foo2, %Foo2* %0, i32 0, i32 0 - %3 = load i32, i32* %2, align 8 + %3 = load i32, i32* %2, align 4 %add = add i32 %3, 1 - store i32 %add, i32* %2, align 8 + store i32 %add, i32* %2, align 4 ret i32 %add } diff --git a/test/test_suite14/functions/typeless_varargs.c3t b/test/test_suite14/functions/typeless_varargs.c3t index 39019d43c..98f7adef1 100644 --- a/test/test_suite14/functions/typeless_varargs.c3t +++ b/test/test_suite14/functions/typeless_varargs.c3t @@ -54,7 +54,7 @@ entry: %6 = getelementptr inbounds %variant, %variant* %ptroffset, i32 0, i32 0 %7 = bitcast i8** %6 to i32** %8 = load i32*, i32** %7, align 8 - %9 = load i32, i32* %8, align 8 + %9 = load i32, i32* %8, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i32 0, i32 0), i32 %9) ret void } diff --git a/test/test_suite14/macro_methods/macro_method_different_args.c3t b/test/test_suite14/macro_methods/macro_method_different_args.c3t index 89e030d88..ea8356e07 100644 --- a/test/test_suite14/macro_methods/macro_method_different_args.c3t +++ b/test/test_suite14/macro_methods/macro_method_different_args.c3t @@ -42,10 +42,10 @@ entry: store %Foo* %a, %Foo** %this, align 8 %6 = load %Foo*, %Foo** %this, align 8 %7 = getelementptr inbounds %Foo, %Foo* %6, i32 0, i32 0 - store i32 4, i32* %7, align 8 + store i32 4, i32* %7, align 4 %8 = load %Foo*, %Foo** %this, align 8 %9 = getelementptr inbounds %Foo, %Foo* %8, i32 0, i32 0 - %10 = load i32, i32* %9, align 8 + %10 = load i32, i32* %9, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i32 %10) %11 = getelementptr inbounds %Foo, %Foo* %a, i32 0, i32 0 %12 = load i32, i32* %11, align 4 diff --git a/test/test_suite14/macros/macro_with_body.c3t b/test/test_suite14/macros/macro_with_body.c3t index d15233bc8..070c26b32 100644 --- a/test/test_suite14/macros/macro_with_body.c3t +++ b/test/test_suite14/macros/macro_with_body.c3t @@ -49,9 +49,9 @@ define i32 @withbody_Foo_mutate(%Foo* %0) #0 { entry: %1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0)) %2 = getelementptr inbounds %Foo, %Foo* %0, i32 0, i32 0 - %3 = load i32, i32* %2, align 8 + %3 = load i32, i32* %2, align 4 %add = add i32 %3, 1 - store i32 %add, i32* %2, align 8 + store i32 %add, i32* %2, align 4 %mul = mul i32 10, %add ret i32 %mul } diff --git a/test/test_suite14/pointers/pointer_index.c3t b/test/test_suite14/pointers/pointer_index.c3t index 13b7aa314..edcd6c111 100644 --- a/test/test_suite14/pointers/pointer_index.c3t +++ b/test/test_suite14/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(i32* %0) #0 { entry: @@ -33,7 +33,7 @@ entry: %ptroffset = getelementptr inbounds i32, i32* %0, i64 0 %1 = load i32, i32* %ptroffset, align 4 store i32 %1, i32* %a, align 4 - %2 = load i32, i32* %0, align 8 + %2 = load i32, i32* %0, align 4 store i32 %2, i32* %b, align 4 %ptroffset1 = getelementptr inbounds i32, i32* %0, i64 1 %3 = load i32, i32* %ptroffset1, align 4 @@ -53,7 +53,7 @@ entry: %ptroffset = getelementptr inbounds i8, i8* %0, i64 0 %1 = load i8, i8* %ptroffset, align 1 store i8 %1, i8* %a, align 1 - %2 = load i8, i8* %0, align 8 + %2 = load i8, i8* %0, align 1 store i8 %2, i8* %b, align 1 %ptroffset1 = getelementptr inbounds i8, i8* %0, i64 1 %3 = load i8, i8* %ptroffset1, align 1 diff --git a/test/test_suite14/pointers/subarray_variant_to_ptr.c3t b/test/test_suite14/pointers/subarray_variant_to_ptr.c3t index 6b9841930..a537f98ac 100644 --- a/test/test_suite14/pointers/subarray_variant_to_ptr.c3t +++ b/test/test_suite14/pointers/subarray_variant_to_ptr.c3t @@ -45,7 +45,7 @@ entry: %ptrptr = bitcast i8* %5 to i32* store i32* %ptrptr, i32** %w, align 8 %6 = load i32*, i32** %w, align 8 - %7 = load i32, i32* %6, align 8 + %7 = load i32, i32* %6, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %7) ret void } @@ -64,7 +64,7 @@ entry: %5 = load i32*, i32** %4, align 8 store i32* %5, i32** %w, align 8 %6 = load i32*, i32** %w, align 8 - %7 = load i32, i32* %6, align 8 + %7 = load i32, i32* %6, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i32 %7) ret void } diff --git a/test/test_suite14/safe/deref.c3t b/test/test_suite14/safe/deref.c3t index 8929aa549..8c54dc36f 100644 --- a/test/test_suite14/safe/deref.c3t +++ b/test/test_suite14/safe/deref.c3t @@ -25,7 +25,7 @@ panic: ; preds = %entry br label %checkok checkok: ; preds = %panic, %entry - %2 = load i32, i32* %0, align 8 + %2 = load i32, i32* %0, align 4 store i32 %2, i32* %y, align 4 ret void } diff --git a/test/test_suite14/statements/custom_foreach_with_ref.c3t b/test/test_suite14/statements/custom_foreach_with_ref.c3t index b45996738..78cc03d63 100644 --- a/test/test_suite14/statements/custom_foreach_with_ref.c3t +++ b/test/test_suite14/statements/custom_foreach_with_ref.c3t @@ -254,12 +254,12 @@ loop.body13: ; preds = %loop.cond11 %32 = getelementptr inbounds [3 x i32], [3 x i32]* %30, i64 0, i64 %sisiext17 store i32* %32, i32** %y15, align 8 %33 = load i32*, i32** %y15, align 8 - %34 = load i32, i32* %33, align 8 + %34 = load i32, i32* %33, align 4 %add18 = add i32 %34, 1 - store i32 %add18, i32* %33, align 8 + store i32 %add18, i32* %33, align 4 %35 = load i32, i32* %i14, align 4 %36 = load i32*, i32** %y15, align 8 - %37 = load i32, i32* %36, align 8 + %37 = load i32, i32* %36, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i32 0, i32 0), i32 %35, i32 %37) %38 = load i32, i32* %.anon10, align 4 %add19 = add i32 %38, 1 @@ -461,9 +461,9 @@ loop.exit81: ; preds = %loop.cond75 %110 = getelementptr inbounds [3 x i32], [3 x i32]* %108, i64 0, i64 %sisiext88 store i32* %110, i32** %y86, align 8 %111 = load i32*, i32** %y86, align 8 - %112 = load i32, i32* %111, align 8 + %112 = load i32, i32* %111, align 4 %add89 = add i32 %112, 1 - store i32 %add89, i32* %111, align 8 + store i32 %add89, i32* %111, align 4 store i32 0, i32* %a90, align 4 %113 = getelementptr inbounds %Foo, %Foo* %x, i32 0, i32 0 %114 = load i32, i32* %a90, align 4 diff --git a/test/test_suite14/statements/foreach_common.c3t b/test/test_suite14/statements/foreach_common.c3t index a5f1918f8..2c74a61a7 100644 --- a/test/test_suite14/statements/foreach_common.c3t +++ b/test/test_suite14/statements/foreach_common.c3t @@ -130,11 +130,11 @@ loop.body4: ; preds = %loop.cond2 %9 = getelementptr inbounds [3 x float], [3 x float]* %foo, i64 0, i64 %8 store float* %9, float** %a5, align 8 %10 = load float*, float** %a5, align 8 - %11 = load float, float* %10, align 8 + %11 = load float, float* %10, align 4 %fmul = fmul float %11, 2.000000e+00 - store float %fmul, float* %10, align 8 + store float %fmul, float* %10, align 4 %12 = load float*, float** %a5, align 8 - %13 = load float, float* %12, align 8 + %13 = load float, float* %12, align 4 %fpfpext6 = fpext float %13 to double call void (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i32 0, i32 0), double %fpfpext6) %14 = load i64, i64* %.anon1, align 8 @@ -158,7 +158,7 @@ loop.body12: ; preds = %loop.cond10 store i8* %ptrptr, i8** %a13, align 8 %18 = load i8*, i8** %a13, align 8 %ptrptr14 = bitcast i8* %18 to float* - %19 = load float, float* %ptrptr14, align 8 + %19 = load float, float* %ptrptr14, align 4 %fpfpext15 = fpext float %19 to double call void (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i32 0, i32 0), double %fpfpext15) %20 = load i64, i64* %.anon9, align 8 @@ -280,11 +280,11 @@ loop.body55: ; preds = %loop.cond53 %53 = getelementptr inbounds <3 x float>, <3 x float>* %foo2, i64 0, i64 %52 store float* %53, float** %a56, align 8 %54 = load float*, float** %a56, align 8 - %55 = load float, float* %54, align 8 + %55 = load float, float* %54, align 4 %fmul57 = fmul float %55, 2.000000e+00 - store float %fmul57, float* %54, align 8 + store float %fmul57, float* %54, align 4 %56 = load float*, float** %a56, align 8 - %57 = load float, float* %56, align 8 + %57 = load float, float* %56, align 4 %fpfpext58 = fpext float %57 to double call void (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i32 0, i32 0), double %fpfpext58) %58 = load i64, i64* %.anon52, align 8 diff --git a/test/test_suite14/statements/foreach_more_implementations.c3t b/test/test_suite14/statements/foreach_more_implementations.c3t index 8008fed16..92b8bf26f 100644 --- a/test/test_suite14/statements/foreach_more_implementations.c3t +++ b/test/test_suite14/statements/foreach_more_implementations.c3t @@ -118,9 +118,9 @@ after_check: ; preds = %loop.body voiderr: ; preds = %after_check, %loop.body %26 = load i32*, i32** %ref, align 8 - %27 = load i32, i32* %26, align 8 + %27 = load i32, i32* %26, align 4 %add = add i32 %27, 2 - store i32 %add, i32* %26, align 8 + store i32 %add, i32* %26, align 4 %28 = load i64, i64* %.anon1, align 8 %add3 = add i64 %28, 1 store i64 %add3, i64* %.anon1, align 8 diff --git a/test/test_suite14/variant/variant_assign.c3t b/test/test_suite14/variant/variant_assign.c3t index 0077353ed..a0e7c71c8 100644 --- a/test/test_suite14/variant/variant_assign.c3t +++ b/test/test_suite14/variant/variant_assign.c3t @@ -89,7 +89,7 @@ switch.case: ; preds = %switch.entry %9 = load i32*, i32** %8, align 8 store i32* %9, i32** %z1, align 8 %10 = load i32*, i32** %z1, align 8 - %11 = load i32, i32* %10, align 8 + %11 = load i32, i32* %10, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i32 %11) br label %switch.exit @@ -118,6 +118,7 @@ switch.exit: ; preds = %switch.default, %sw ret void } +; Function Attrs: nounwind define void @foo_test2(i64 %0, i8* %1) #0 { entry: %y = alloca %variant, align 8 @@ -155,7 +156,7 @@ switch.case: ; preds = %switch.entry %14 = insertvalue %variant %13, i64 ptrtoint (%.introspect* @"ct$int" to i64), 1 store %variant %14, %variant* %y, align 8 %15 = load i32*, i32** %z, align 8 - %16 = load i32, i32* %15, align 8 + %16 = load i32, i32* %15, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i32 %16) br label %switch.exit @@ -214,7 +215,7 @@ switch.case: ; preds = %switch.entry %9 = getelementptr inbounds %variant, %variant* %.anon, i32 0, i32 0 %10 = bitcast i8** %9 to i32** %11 = load i32*, i32** %10, align 8 - %12 = load i32, i32* %11, align 8 + %12 = load i32, i32* %11, align 4 store i32 %12, i32* %z, align 4 %13 = load i32, i32* %z, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i32 0, i32 0), i32 %13) diff --git a/test/test_suite14/variant/variant_switch.c3t b/test/test_suite14/variant/variant_switch.c3t index 0de5b2d8e..1695f95c3 100644 --- a/test/test_suite14/variant/variant_switch.c3t +++ b/test/test_suite14/variant/variant_switch.c3t @@ -61,10 +61,10 @@ switch.case: ; preds = %switch.entry %9 = load i32*, i32** %8, align 8 store i32* %9, i32** %z1, align 8 %10 = load i32*, i32** %z1, align 8 - %11 = load i32, i32* %10, align 8 + %11 = load i32, i32* %10, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i32 %11) %12 = load i32*, i32** %z1, align 8 - store i32 3, i32* %12, align 8 + store i32 3, i32* %12, align 4 br label %switch.exit next_if: ; preds = %switch.entry @@ -98,7 +98,7 @@ if.then: ; preds = %switch.exit %20 = getelementptr inbounds %variant, %variant* %z, i32 0, i32 0 %21 = bitcast i8** %20 to i32** %22 = load i32*, i32** %21, align 8 - %23 = load i32, i32* %22, align 8 + %23 = load i32, i32* %22, align 4 call void (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i32 %23) br label %if.exit