diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0baa7e644..915199875 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -230,7 +230,7 @@ jobs: fail-fast: false matrix: build_type: [Release, Debug] - llvm_version: [17, 18, 19, 20, 21] + llvm_version: [17, 18, 19, 20, 21, 22] steps: - uses: actions/checkout@v4 diff --git a/test/test_suite/switch/enum_jump_switch_and_range.c3t b/test/test_suite/switch/enum_jump_switch_and_range.c3t index 9f4956a68..d6b5adb3f 100644 --- a/test/test_suite/switch/enum_jump_switch_and_range.c3t +++ b/test/test_suite/switch/enum_jump_switch_and_range.c3t @@ -54,7 +54,7 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable, i32 %1 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case] + indirectbr ptr %target, [label %switch.case, label %switch.exit] switch.case: ; preds = %jumpblock %3 = call ptr @std.io.stdout() @@ -117,7 +117,7 @@ noerr_block13: ; preds = %after_check11 voiderr: ; preds = %noerr_block13, %guard_block12, %guard_block6, %guard_block br label %switch.exit -switch.exit: ; preds = %voiderr, %switch.entry +switch.exit: ; preds = %jumpblock, %voiderr, %switch.entry ret void } @@ -148,7 +148,7 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable.1, i32 %2 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case, label %switch.case14, label %switch.exit] + indirectbr ptr %target, [label %switch.case, label %switch.case14, label %switch.exit, label %switch.exit] switch.case: ; preds = %jumpblock %4 = call ptr @std.io.stdout() @@ -272,7 +272,7 @@ noerr_block36: ; preds = %after_check34 voiderr38: ; preds = %noerr_block36, %guard_block35, %guard_block29, %guard_block23 br label %switch.exit -switch.exit: ; preds = %jumpblock, %voiderr38, %voiderr, %switch.entry +switch.exit: ; preds = %jumpblock, %jumpblock, %voiderr38, %voiderr, %switch.entry ret void } @@ -312,7 +312,7 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable.4, i32 %2 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case, label %switch.case14] + indirectbr ptr %target, [label %switch.case, label %switch.case14, label %switch.default] switch.case: ; preds = %jumpblock %4 = call ptr @std.io.stdout() @@ -436,7 +436,7 @@ noerr_block36: ; preds = %after_check34 voiderr38: ; preds = %noerr_block36, %guard_block35, %guard_block29, %guard_block23 br label %switch.exit -switch.default: ; preds = %switch.entry +switch.default: ; preds = %jumpblock, %switch.entry %24 = call ptr @std.io.stdout() store %"char[]" { ptr @.str.7, i64 3 }, ptr %taddr43, align 8 %25 = load [2 x i64], ptr %taddr43, align 8 diff --git a/test/test_suite/switch/jump_bug_default.c3t b/test/test_suite/switch/jump_bug_default.c3t index 8f05c4275..be2094e91 100644 --- a/test/test_suite/switch/jump_bug_default.c3t +++ b/test/test_suite/switch/jump_bug_default.c3t @@ -38,9 +38,9 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable, i32 %2 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case] + indirectbr ptr %target, [label %switch.case, label %switch.case] -switch.case: ; preds = %jumpblock, %switch.entry +switch.case: ; preds = %jumpblock, %jumpblock, %switch.entry %4 = call ptr @std.io.stdout() store %"char[]" { ptr @.str, i64 5 }, ptr %taddr, align 8 %5 = load [2 x i64], ptr %taddr, align 8 diff --git a/test/test_suite/switch/jump_bug_nested.c3t b/test/test_suite/switch/jump_bug_nested.c3t index 125bc6e3f..051393c98 100644 --- a/test/test_suite/switch/jump_bug_nested.c3t +++ b/test/test_suite/switch/jump_bug_nested.c3t @@ -47,7 +47,7 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable, i32 %0 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case] + indirectbr ptr %target, [label %switch.case, label %switch.exit25] switch.case: ; preds = %jumpblock %2 = call ptr @std.io.stdout() @@ -120,7 +120,7 @@ switch.entry15: ; preds = %voiderr jumpblock16: ; preds = %switch.entry15 %ptroffset17 = getelementptr inbounds [8 x i8], ptr @jumptable.1, i32 %13 %target18 = load ptr, ptr %ptroffset17, align 8 - indirectbr ptr %target18, [label %switch.case19] + indirectbr ptr %target18, [label %switch.case19, label %switch.exit] switch.case19: ; preds = %jumpblock16 store %"char[]" { ptr @.str.2, i64 24 }, ptr %taddr21, align 8 @@ -130,10 +130,10 @@ switch.case19: ; preds = %jumpblock16 %17 = call i64 @std.io.printfn(ptr %retparam20, [2 x i64] %15, [2 x i64] %16) br label %switch.exit -switch.exit: ; preds = %switch.case19, %switch.entry15 +switch.exit: ; preds = %jumpblock16, %switch.case19, %switch.entry15 br label %switch.exit25 -switch.exit25: ; preds = %switch.exit, %switch.entry +switch.exit25: ; preds = %jumpblock, %switch.exit, %switch.entry ret void } diff --git a/test/test_suite/switch/jump_bugs.c3t b/test/test_suite/switch/jump_bugs.c3t index e457668dc..5048e7782 100644 --- a/test/test_suite/switch/jump_bugs.c3t +++ b/test/test_suite/switch/jump_bugs.c3t @@ -41,12 +41,12 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable, i32 %0 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case] + indirectbr ptr %target, [label %switch.case, label %switch.exit] switch.case: ; preds = %jumpblock br label %switch.exit -switch.exit: ; preds = %switch.case, %switch.entry +switch.exit: ; preds = %jumpblock, %switch.case, %switch.entry ret void } diff --git a/test/test_suite/switch/jump_with_inc.c3t b/test/test_suite/switch/jump_with_inc.c3t index ce8de6db7..6a9ef0e6f 100644 --- a/test/test_suite/switch/jump_with_inc.c3t +++ b/test/test_suite/switch/jump_with_inc.c3t @@ -34,7 +34,7 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable, i32 %2 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case, label %switch.case4] + indirectbr ptr %target, [label %switch.case, label %switch.case4, label %switch.default] switch.case: ; preds = %jumpblock5, %jumpblock1, %jumpblock %4 = load i32, ptr %x, align 4 @@ -60,6 +60,6 @@ jumpblock5: ; preds = %switch.case4 %target7 = load ptr, ptr %ptroffset6, align 8 indirectbr ptr %target7, [label %switch.case, label %switch.case4, label %switch.default] -switch.default: ; preds = %jumpblock5, %switch.case4, %jumpblock1, %switch.case, %switch.entry +switch.default: ; preds = %jumpblock, %jumpblock5, %switch.case4, %jumpblock1, %switch.case, %switch.entry unreachable } diff --git a/test/test_suite/switch/simple_jump.c3t b/test/test_suite/switch/simple_jump.c3t index 7e564f73d..113e93e88 100644 --- a/test/test_suite/switch/simple_jump.c3t +++ b/test/test_suite/switch/simple_jump.c3t @@ -102,7 +102,7 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable, i32 %1 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case, label %switch.case1] + indirectbr ptr %target, [label %switch.case, label %switch.case1, label %switch.exit] switch.case: ; preds = %jumpblock call void @simple_jump.res(i32 1) @@ -112,7 +112,7 @@ switch.case1: ; preds = %jumpblock call void @simple_jump.res(i32 2) br label %switch.exit -switch.exit: ; preds = %switch.case1, %switch.case, %switch.entry +switch.exit: ; preds = %jumpblock, %switch.case1, %switch.case, %switch.entry call void @simple_jump.res(i32 0) ret void } @@ -132,7 +132,7 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable.1, i32 %2 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case, label %switch.case1] + indirectbr ptr %target, [label %switch.case, label %switch.case1, label %switch.exit] switch.case: ; preds = %jumpblock call void @simple_jump.res(i32 1) @@ -142,7 +142,7 @@ switch.case1: ; preds = %jumpblock call void @simple_jump.res(i32 2) br label %switch.exit -switch.exit: ; preds = %switch.case1, %switch.case, %switch.entry +switch.exit: ; preds = %jumpblock, %switch.case1, %switch.case, %switch.entry ret void } @@ -161,7 +161,7 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable.2, i32 %2 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case, label %switch.case1, label %switch.exit] + indirectbr ptr %target, [label %switch.case, label %switch.case1, label %switch.exit, label %switch.exit] switch.case: ; preds = %jumpblock call void @simple_jump.res(i32 1) @@ -171,7 +171,7 @@ switch.case1: ; preds = %jumpblock call void @simple_jump.res(i32 3) br label %switch.exit -switch.exit: ; preds = %jumpblock, %switch.case1, %switch.case, %switch.entry +switch.exit: ; preds = %jumpblock, %jumpblock, %switch.case1, %switch.case, %switch.entry ret void } @@ -190,13 +190,13 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable.3, i32 %2 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case] + indirectbr ptr %target, [label %switch.case, label %switch.default] switch.case: ; preds = %jumpblock call void @simple_jump.res(i32 1) br label %switch.exit -switch.default: ; preds = %switch.entry +switch.default: ; preds = %jumpblock, %switch.entry call void @simple_jump.res(i32 -1) br label %switch.exit @@ -219,7 +219,7 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable.4, i32 %2 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case, label %switch.case1, label %switch.default] + indirectbr ptr %target, [label %switch.case, label %switch.case1, label %switch.default, label %switch.default] switch.case: ; preds = %jumpblock call void @simple_jump.res(i32 1) @@ -229,7 +229,7 @@ switch.case1: ; preds = %jumpblock call void @simple_jump.res(i32 4) br label %switch.exit -switch.default: ; preds = %jumpblock, %switch.entry +switch.default: ; preds = %jumpblock, %jumpblock, %switch.entry call void @simple_jump.res(i32 -1) br label %switch.exit @@ -253,17 +253,17 @@ switch.entry: ; preds = %entry jumpblock: ; preds = %switch.entry %ptroffset = getelementptr inbounds [8 x i8], ptr @jumptable.5, i32 %2 %target = load ptr, ptr %ptroffset, align 8 - indirectbr ptr %target, [label %switch.case, label %switch.case1, label %switch.case2, label %switch.default] + indirectbr ptr %target, [label %switch.case, label %switch.case1, label %switch.case2, label %switch.default, label %switch.default] -switch.case: ; preds = %jumpblock3, %jumpblock +switch.case: ; preds = %jumpblock, %jumpblock3 call void @simple_jump.res(i32 1) br label %switch.exit -switch.case1: ; preds = %jumpblock3, %jumpblock +switch.case1: ; preds = %jumpblock, %jumpblock3 call void @simple_jump.res(i32 4) br label %switch.exit -switch.case2: ; preds = %jumpblock3, %jumpblock +switch.case2: ; preds = %jumpblock, %jumpblock3 %mul = mul i32 %0, 2 %4 = sub i32 %mul, 1 %5 = icmp ugt i32 %4, 4 @@ -274,7 +274,7 @@ jumpblock3: ; preds = %switch.case2 %target5 = load ptr, ptr %ptroffset4, align 8 indirectbr ptr %target5, [label %switch.case, label %switch.case1, label %switch.case2, label %switch.default] -switch.default: ; preds = %jumpblock, %jumpblock3, %switch.case2, %switch.entry +switch.default: ; preds = %jumpblock, %jumpblock, %jumpblock3, %switch.case2, %switch.entry call void @simple_jump.res(i32 -1) br label %switch.exit