diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d43a42868..dcc29e751 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -264,6 +264,7 @@ jobs: ../build/c3c compile-run examples/load_world.c3 ../build/c3c compile-run examples/process.c3 ../build/c3c compile-run examples/ls.c3 + ../build/c3c compile-run --system-linker=no linux_stack.c3 ../build/c3c compile-run linux_stack.c3 - name: Compile run unit tests @@ -370,6 +371,8 @@ jobs: ../build/c3c compile-run examples/factorial_macro.c3 ../build/c3c compile-run examples/fasta.c3 ../build/c3c compile-run examples/process.c3 + ../build/c3c compile-run --system-linker=no linux_stack.c3 + ../build/c3c compile-run linux_stack.c3 - name: Compile run unit tests run: | diff --git a/lib/std/core/builtin.c3 b/lib/std/core/builtin.c3 index d8f1b729b..0f23f711f 100644 --- a/lib/std/core/builtin.c3 +++ b/lib/std/core/builtin.c3 @@ -87,7 +87,7 @@ struct CallstackElement uint line; } -fn bool print_backtrace(String message, int backtraces_to_ignore) @if(env::DARWIN || env::LINUX) +fn bool print_backtrace(String message, int backtraces_to_ignore) @if(env::NATIVE_STACKTRACE) { @pool() { @@ -115,7 +115,7 @@ fn bool print_backtrace(String message, int backtraces_to_ignore) @if(env::DARWI return true; }; } -fn void default_panic(String message, String file, String function, uint line) @if(env::DARWIN) +fn void default_panic(String message, String file, String function, uint line) @if(env::NATIVE_STACKTRACE) { $if $defined(io::stderr): if (!print_backtrace(message, 2)) @@ -127,7 +127,7 @@ fn void default_panic(String message, String file, String function, uint line) @ $$trap(); } -fn void default_panic(String message, String file, String function, uint line) @if(!env::DARWIN) +fn void default_panic(String message, String file, String function, uint line) @if(!env::NATIVE_STACKTRACE) { CallstackElement* stack = $$stacktrace(); $if $defined(io::stderr): @@ -367,35 +367,17 @@ macro uint void*.hash(void* ptr) => ((ulong)(uptr)ptr).hash(); module std::core::builtin @if((env::LINUX || env::DARWIN) && env::COMPILER_SAFE_MODE && env::DEBUG_SYMBOLS); import libc; -fn void sig_panic(String message) @if(env::DARWIN) +fn void sig_panic(String message) { default_panic(message, "???", "???", 0); } -fn void sig_panic(String message) @if(!env::DARWIN) -{ - $if $defined(io::stderr) && $defined(File.printf): - CallstackElement* stack = $$stacktrace(); - if (stack) stack = stack.prev; - if (stack) stack = stack.prev; - (void)io::stderr().print("\nSYSTEM ERROR: '"); - (void)io::stderr().print(message); - (void)io::stderr().printn("'"); - while (stack) - { - (void)io::stderr().printfn(" in %s %s (%s:%s)", stack.location.name, stack.function, stack.file, stack.line); - if (stack == stack.prev) break; - stack = stack.prev; - } - $endif -} - SignalFunction old_bus_error; SignalFunction old_segmentation_fault; fn void sig_bus_error(CInt i) { - $if !env::DARWIN: + $if !env::NATIVE_STACKTRACE: sig_panic("Illegal memory access."); $else $if $defined(io::stderr): @@ -410,7 +392,7 @@ fn void sig_bus_error(CInt i) fn void sig_segmentation_fault(CInt i) { - $if !env::DARWIN: + $if !env::NATIVE_STACKTRACE: sig_panic("Out of bounds memory access."); $else $if $defined(io::stderr): diff --git a/lib/std/core/env.c3 b/lib/std/core/env.c3 index 8a31312c6..024ca1ddf 100644 --- a/lib/std/core/env.c3 +++ b/lib/std/core/env.c3 @@ -132,7 +132,7 @@ const MemoryEnvironment MEMORY_ENV = (MemoryEnvironment)$$MEMORY_ENVIRONMENT; const bool TRACK_MEMORY = DEBUG_SYMBOLS && (COMPILER_SAFE_MODE || TESTING); const bool X86_64 = ARCH_TYPE == X86_64; const bool AARCH64 = ARCH_TYPE == AARCH64; - +const bool NATIVE_STACKTRACE = LINUX || DARWIN; const bool LINUX = LIBC && OS_TYPE == LINUX; const bool DARWIN = LIBC && os_is_darwin(); const bool WIN32 = LIBC && OS_TYPE == WIN32; diff --git a/lib/std/os/linux/linux.c3 b/lib/std/os/linux/linux.c3 index 20963c95d..353b92d8d 100644 --- a/lib/std/os/linux/linux.c3 +++ b/lib/std/os/linux/linux.c3 @@ -140,15 +140,16 @@ fn Backtrace! backtrace_load_element(void* addr, Allocator* allocator = mem::hea if (!addr) return backtrace::BACKTRACE_UNKNOWN; char[] buf = mem::temp_array(char, 1024); Linux_Dl_info info; - if (dladdr(addr, &info) == 0) return backtrace::BACKTRACE_UNKNOWN; + if (dladdr(addr, &info) == 0) return backtrace::BACKTRACE_UNKNOWN; void* obj_address = addr - (uptr)info.dli_fbase + (uptr)elf_module_image_base(info.dli_fname.str_view())!; ZString obj_path = info.dli_fname; + ZString sname = info.dli_sname ? info.dli_sname : (ZString)"???"; String s = process::execute_stdout_to_buffer(buf, { "addr2line", "-p", "-i", "-C", "-f", "-e", obj_path.str_view(), string::tformat("0x%x", obj_address) })!; String[] parts = s.tsplit(" at "); if (parts.len != 2) { return { - .function = info.dli_sname ? info.dli_sname.copy(allocator) : "???".copy(allocator), + .function = sname.copy(allocator), .object_file = info.dli_fname.copy(allocator), .offset = (uptr)addr, .file = "".copy(allocator), @@ -177,6 +178,7 @@ fn BacktraceList! backtrace_load(Allocator* allocator) { void*[256] bt_buffer; CInt size = posix::backtrace(&bt_buffer, 256); + io::printfn("Backtrace list %s", size); BacktraceList list; list.init_new(size, allocator); defer catch @@ -189,7 +191,7 @@ fn BacktraceList! backtrace_load(Allocator* allocator) } @pool(allocator) { - for (usz i = 1; i < size; i++) + for (usz i = 0; i < size; i++) { Backtrace trace = backtrace_load_element(bt_buffer[i], allocator)!; list.append(trace); diff --git a/resources/linux_stack.c3 b/resources/linux_stack.c3 index e8111cc2a..0ce201512 100644 --- a/resources/linux_stack.c3 +++ b/resources/linux_stack.c3 @@ -3,8 +3,20 @@ import std::io; import std::collections::map; import std::os; -fn void! main() +fn void! test2() { - int x = 2; - builtin::print_backtrace("Hello", 0); + BacktraceList list = linux::backtrace_load(mem::heap())!; + foreach (Backtrace trace : list) + { + io::printfn("%s", trace); + } +} + +fn void test1() +{ + (void)test2(); +} +fn void main() +{ + test1(); } \ No newline at end of file diff --git a/src/compiler/linker.c b/src/compiler/linker.c index 572789b21..942f63afb 100644 --- a/src/compiler/linker.c +++ b/src/compiler/linker.c @@ -386,6 +386,12 @@ static void linker_setup_linux(const char ***args_ref, LinkerType linker_type) { if (linker_type == LINKER_CC) { + if (!link_libc()) + { + add_arg("-nostdlib"); + return; + } + vec_add(active_target.linker_libs, "dl"); if (active_target.debug_info == DEBUG_INFO_FULL) { add_arg("-rdynamic"); @@ -430,6 +436,9 @@ static void linker_setup_linux(const char ***args_ref, LinkerType linker_type) } add_arg2(crt_dir, "crtn.o"); add_arg2("-L", crt_dir); + add_arg("-L"); + add_arg("/usr/lib/x86_64-linux-gnu/libdl.so"); + add_arg("-ldl"); add_arg("--dynamic-linker=/lib64/ld-linux-x86-64.so.2"); add_arg("-lm"); add_arg("-lpthread"); diff --git a/src/compiler/llvm_codegen.c b/src/compiler/llvm_codegen.c index a67f41f4d..3c2d8faa9 100644 --- a/src/compiler/llvm_codegen.c +++ b/src/compiler/llvm_codegen.c @@ -1066,6 +1066,7 @@ void llvm_append_function_attributes(GenContext *c, Decl *decl) llvm_set_alignment(function, decl->alignment); } llvm_attribute_add(c, function, attribute_id.nounwind, -1); + llvm_attribute_add_int(c, function, attribute_id.uwtable, 2, -1); if (decl->func_decl.attr_naked) { llvm_attribute_add(c, function, attribute_id.naked, -1); diff --git a/src/compiler/llvm_codegen_expr.c b/src/compiler/llvm_codegen_expr.c index 49c57bf2d..01a0dfd77 100644 --- a/src/compiler/llvm_codegen_expr.c +++ b/src/compiler/llvm_codegen_expr.c @@ -6189,7 +6189,7 @@ static inline void llvm_emit_macro_block(GenContext *c, BEValue *be_value, Expr llvm_emit_update_stack_row(c, expr->span.row); Decl *macro = expr->macro_block.macro; old_stack_trace = c->debug.stacktrace; - llvm_emit_push_stacktrace(c, macro, macro->name, ST_MACRO); + llvm_emit_push_emulated_stacktrace(c, macro, macro->name, ST_MACRO); } } llvm_emit_return_block(c, be_value, expr->type, expr->macro_block.first_stmt, expr->macro_block.block_exit, restore_at_exit ? &old_stack_trace : NULL); diff --git a/src/compiler/llvm_codegen_function.c b/src/compiler/llvm_codegen_function.c index 0862891af..2cc85440c 100644 --- a/src/compiler/llvm_codegen_function.c +++ b/src/compiler/llvm_codegen_function.c @@ -487,7 +487,7 @@ void llvm_emit_update_stack_row(GenContext *c, uint32_t row) llvm_store_to_ptr_raw_aligned(c, c->debug.stacktrace.row, llvm_const_int(c, type_uint, row), type_abi_alignment(type_uint)); } -void llvm_emit_push_stacktrace(GenContext *c, Decl *decl, const char *function_name, StacktraceType type) +void llvm_emit_push_emulated_stacktrace(GenContext *c, Decl *decl, const char *function_name, StacktraceType type) { LLVMTypeRef slot_type = c->debug.stack_type; AlignSize alignment = llvm_abi_alignment(c, slot_type); @@ -525,12 +525,27 @@ void llvm_emit_body(GenContext *c, LLVMValueRef function, FunctionPrototype *pro LLVMValueRef prev_function = c->function; LLVMBuilderRef prev_builder = c->builder; - bool use_stacktrace = emit_debug && c->debug.emulated_stacktrace; - if (use_stacktrace && !c->debug.stack_init_fn) + bool use_emulated_stacktrace = emit_debug && c->debug.emulated_stacktrace; + if (use_emulated_stacktrace && !c->debug.stack_init_fn) { llvm_emit_stacktrace_definitions(c); c->builder = prev_builder; } + else if (c->debug.enable_stacktrace && !c->debug.x && false) + { + { + c->debug.x = true; + LLVMTypeRef func_type = LLVMFunctionType(LLVMVoidTypeInContext(c->context), NULL, 0, false); + LLVMValueRef func = LLVMAddFunction(c->module, "foo", func_type); + LLVMSetLinkage(func, LLVMInternalLinkage); + LLVMSetVisibility(func, LLVMDefaultVisibility); + LLVMBuilderRef builder = LLVMCreateBuilderInContext(c->context); + LLVMBasicBlockRef entry = LLVMAppendBasicBlockInContext(c->context, func, "entry"); + LLVMPositionBuilderAtEnd(builder, entry); + LLVMBuildUnreachable(builder); + LLVMDisposeBuilder(builder); + } + } c->opt_var = NULL; c->catch_block = NULL; @@ -582,9 +597,9 @@ void llvm_emit_body(GenContext *c, LLVMValueRef function, FunctionPrototype *pro { llvm_debug_scope_push(c, c->debug.function); EMIT_LOC(c, body); - if (use_stacktrace) + if (use_emulated_stacktrace) { - llvm_emit_push_stacktrace(c, decl, function_name, type); + llvm_emit_push_emulated_stacktrace(c, decl, function_name, type); } } diff --git a/src/compiler/llvm_codegen_internal.h b/src/compiler/llvm_codegen_internal.h index b8980396c..932e9b77c 100644 --- a/src/compiler/llvm_codegen_internal.h +++ b/src/compiler/llvm_codegen_internal.h @@ -72,6 +72,7 @@ typedef struct unsigned runtime_version : 8; bool enable_stacktrace : 1; bool emulated_stacktrace : 1; + bool x : 1; LLVMDIBuilderRef builder; DebugFile *debug_files; DebugFile file; @@ -547,7 +548,7 @@ void llvm_emit_debug_local_var(GenContext *c, Decl *var); void llvm_emit_debug_global_var(GenContext *c, Decl *global); void llvm_emit_update_stack_row(GenContext *c, uint32_t row); void llvm_emit_pop_stacktrace(GenContext *c, Stacktrace *slot); -void llvm_emit_push_stacktrace(GenContext *c, Decl *decl, const char *function_name, StacktraceType type); +void llvm_emit_push_emulated_stacktrace(GenContext *c, Decl *decl, const char *function_name, StacktraceType type); #define EMIT_LOC(c, x) do { if (c->debug.builder) llvm_emit_debug_location(c, x->span); } while (0); diff --git a/src/compiler/llvm_codegen_module.c b/src/compiler/llvm_codegen_module.c index 0f9aa25f8..97b4e6590 100644 --- a/src/compiler/llvm_codegen_module.c +++ b/src/compiler/llvm_codegen_module.c @@ -169,6 +169,7 @@ void gencontext_begin_module(GenContext *c) LLVMStructSetBody(c->debug.stack_type, types, 5, false); c->debug.current_stack_ptr = NULL; c->debug.enable_stacktrace = true; + c->debug.x = false; c->debug.emulated_stacktrace = !os_supports_stacktrace(platform_target.os); } } diff --git a/src/compiler/llvm_codegen_stmt.c b/src/compiler/llvm_codegen_stmt.c index 110529785..65596a081 100644 --- a/src/compiler/llvm_codegen_stmt.c +++ b/src/compiler/llvm_codegen_stmt.c @@ -1408,7 +1408,7 @@ void llvm_emit_panic_if_true(GenContext *c, BEValue *value, const char *panic_na } } llvm_emit_panic(c, panic_name, loc, fmt, values); - llvm_emit_br(c, ok_block); + llvm_emit_unreachable(c); llvm_emit_block(c, ok_block); } diff --git a/test/test_suite/abi/darwin64_avx.c3t b/test/test_suite/abi/darwin64_avx.c3t index 776cd3a5f..2c1d346e0 100644 --- a/test/test_suite/abi/darwin64_avx.c3t +++ b/test/test_suite/abi/darwin64_avx.c3t @@ -110,9 +110,9 @@ fn void f61(SAtwo256 s) { declare void @f38(<8 x float>) #0 -; Function Attrs: nounwind + declare void @f37(<8 x float>) #0 -; Function Attrs: nounwind + define void @test.f39() #0 { entry: %0 = load <8 x float>, ptr @test.x38, align 32 @@ -121,25 +121,25 @@ entry: call void @f37(<8 x float> %1) ret void } -; Function Attrs: nounwind + declare void @func40(ptr byval(%Two128) align 16) #0 -; Function Attrs: nounwind + define void @test.func41(ptr byval(%Two128) align 16 %0) #0 { entry: call void @func40(ptr byval(%Two128) align 16 %0) ret void } -; Function Attrs: nounwind + declare void @func42(ptr byval(%Sa) align 16) #0 -; Function Attrs: nounwind + define void @test.func43(ptr byval(%Sa) align 16 %0) #0 { entry: call void @func42(ptr byval(%Sa) align 16 %0) ret void } -; Function Attrs: nounwind + declare void @f46(double, double, double, double, double, double, double, double, ptr byval(<2 x float>) align 8, ptr byval(<2 x float>) align 8) #0 -; Function Attrs: nounwind + define void @test.test46() #0 { entry: %x = alloca <2 x float>, align 8 @@ -155,9 +155,9 @@ entry: call void @f46(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, ptr byval(<2 x float>) align 8 %x, ptr byval(<2 x float>) align 8 %x) ret void } -; Function Attrs: nounwind + declare void @f47(i32, i32, i32, i32, i32, i32, i32) #0 -; Function Attrs: nounwind + define void @test.test47(i32 %0, i32 %1) #0 { entry: %b = alloca %Vec47, align 4 @@ -166,17 +166,17 @@ entry: call void @f47(i32 %0, i32 %0, i32 %0, i32 %0, i32 %0, i32 %0, i32 %2) ret void } -; Function Attrs: nounwind + declare void @test49_helper(double, ...) #0 -; Function Attrs: nounwind + define void @test.test49(double %0, double %1) #0 { entry: call void (double, ...) @test49_helper(double %0, double %1) ret void } -; Function Attrs: nounwind + declare void @test52_helper(i32, ...) #0 -; Function Attrs: nounwind + define void @test.test52() #0 { entry: %literal = alloca %Complex, align 8 @@ -189,9 +189,9 @@ entry: call void (i32, ...) @test52_helper(i32 0, <8 x float> %0, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double %lo, double %hi) ret void } -; Function Attrs: nounwind + declare void @test54_helper(<8 x float>, ...) #0 -; Function Attrs: nounwind + define void @test.test54() #0 { entry: %literal = alloca %Complex, align 8 @@ -210,28 +210,28 @@ entry: call void (<8 x float>, ...) @test54_helper(<8 x float> %4, <8 x float> %5, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, ptr byval(%Complex) align 8 %literal1) ret void } -; Function Attrs: nounwind + declare void @f55(ptr byval(%St512) align 64) #0 -; Function Attrs: nounwind + declare void @f56(ptr byval(<16 x float>) align 64) #0 -; Function Attrs: nounwind + define void @test.f57() #0 { entry: call void @f55(ptr byval(%St512) align 64 @test.x55) call void @f56(ptr byval(<16 x float>) align 64 @test.x56) ret void } -; Function Attrs: nounwind + declare void @f58(ptr byval(%Two256) align 32) #0 -; Function Attrs: nounwind + define void @test.f59(ptr byval(%Two256) align 32 %0) #0 { entry: call void @f58(ptr byval(%Two256) align 32 %0) ret void } -; Function Attrs: nounwind + declare void @f60(ptr byval(%SAtwo256) align 32) #0 -; Function Attrs: nounwind + define void @test.f61(ptr byval(%SAtwo256) align 32 %0) #0 { entry: call void @f60(ptr byval(%SAtwo256) align 32 %0) diff --git a/test/test_suite/abi/darwin64_avx512.c3t b/test/test_suite/abi/darwin64_avx512.c3t index 5e7b2fe13..17aff93a1 100644 --- a/test/test_suite/abi/darwin64_avx512.c3t +++ b/test/test_suite/abi/darwin64_avx512.c3t @@ -61,10 +61,10 @@ fn void f64() { declare void @f55(<16 x float>) #0 -; Function Attrs: nounwind + declare void @f56(<16 x float>) #0 -; Function Attrs: nounwind + define void @test.f57() #0 { entry: %0 = load <16 x float>, ptr @test.x55, align 64 @@ -74,30 +74,30 @@ entry: ret void } -; Function Attrs: nounwind + declare void @f58(ptr byval(%Two256) align 32) #0 -; Function Attrs: nounwind + define void @test.f59(ptr byval(%Two256) align 32 %0) #0 { entry: call void @f58(ptr byval(%Two256) align 32 %0) ret void } -; Function Attrs: nounwind + declare void @f60(ptr byval(%SAtwo256) align 32) #0 -; Function Attrs: nounwind + define void @test.f61(ptr byval(%SAtwo256) align 32 %0) #0 { entry: call void @f60(ptr byval(%SAtwo256) align 32 %0) ret void } -; Function Attrs: nounwind + declare void @f62_helper(i32, ...) #0 -; Function Attrs: nounwind + define void @test.f62() #0 { entry: %literal = alloca %Complex, align 8 @@ -111,10 +111,10 @@ entry: ret void } -; Function Attrs: nounwind + declare void @f64_helper(<16 x float>, ...) #0 -; Function Attrs: nounwind + define void @test.f64() #0 { entry: %literal = alloca %Complex, align 8 diff --git a/test/test_suite/abi/riscv32-ilp32-ilp32f-ilp32d-abi-1.c3t b/test/test_suite/abi/riscv32-ilp32-ilp32f-ilp32d-abi-1.c3t index 0568cae51..7541921be 100644 --- a/test/test_suite/abi/riscv32-ilp32-ilp32f-ilp32d-abi-1.c3t +++ b/test/test_suite/abi/riscv32-ilp32-ilp32f-ilp32d-abi-1.c3t @@ -218,17 +218,17 @@ define float @test.f_fp_scalar_1(float %0) #0 { entry: ret float %0 } -; Function Attrs: nounwind + define double @test.f_fp_scalar_2(double %0) #0 { entry: ret double %0 } -; Function Attrs: nounwind + define fp128 @test.f_fp_scalar_3(fp128 %0) #0 { entry: ret fp128 %0 } -; Function Attrs: nounwind + define void @test.f_agg_tiny(i32 %0) #0 { entry: %x = alloca %Tiny, align 1 @@ -255,7 +255,7 @@ entry: %0 = load i32, ptr %literal, align 1 ret i32 %0 } -; Function Attrs: nounwind + define void @test.f_vec_tiny_v4i8(i32 %0) #0 { entry: %x = alloca <4 x i8>, align 4 @@ -272,7 +272,7 @@ entry: store <4 x i8> %elemset1, ptr %x, align 4 ret void } -; Function Attrs: nounwind + define i32 @test.f_vec_tiny_v4i8_ret() #0 { entry: %taddr = alloca <4 x i8>, align 4 @@ -280,7 +280,7 @@ entry: %0 = load i32, ptr %taddr, align 4 ret i32 %0 } -; Function Attrs: nounwind + define void @test.f_vec_tiny_v1i32(i32 %0) #0 { entry: %x = alloca <1 x i32>, align 4 @@ -290,7 +290,7 @@ entry: store <1 x i32> %elemset, ptr %x, align 4 ret void } -; Function Attrs: nounwind + define i32 @test.f_vec_tiny_v1i32_ret() #0 { entry: %taddr = alloca <1 x i32>, align 4 @@ -298,7 +298,7 @@ entry: %0 = load i32, ptr %taddr, align 4 ret i32 %0 } -; Function Attrs: nounwind + define void @test.f_agg_small([2 x i32] %0) #0 { entry: %x = alloca %Small, align 4 @@ -315,7 +315,7 @@ entry: store ptr %7, ptr %6, align 4 ret void } -; Function Attrs: nounwind + define [2 x i32] @test.f_agg_small_ret() #0 { entry: %literal = alloca %Small, align 4 @@ -323,7 +323,7 @@ entry: %0 = load [2 x i32], ptr %literal, align 4 ret [2 x i32] %0 } -; Function Attrs: nounwind + define void @test.f_vec_small_v8i8(i64 %0) #0 { entry: %x = alloca <8 x i8>, align 8 @@ -335,7 +335,7 @@ entry: store <8 x i8> %elemset, ptr %x, align 8 ret void } -; Function Attrs: nounwind + define i64 @test.f_vec_small_v8i8_ret() #0 { entry: %taddr = alloca <8 x i8>, align 8 @@ -343,7 +343,7 @@ entry: %0 = load i64, ptr %taddr, align 8 ret i64 %0 } -; Function Attrs: nounwind + define void @test.f_vec_small_v1i64(i64 %0) #0 { entry: %x = alloca <1 x i64>, align 8 @@ -353,7 +353,7 @@ entry: store <1 x i64> %elemset, ptr %x, align 8 ret void } -; Function Attrs: nounwind + define i64 @test.f_vec_small_v1i64_ret() #0 { entry: %taddr = alloca <1 x i64>, align 8 @@ -361,7 +361,7 @@ entry: %0 = load i64, ptr %taddr, align 8 ret i64 %0 } -; Function Attrs: nounwind + define void @test.f_agg_small_aligned(i64 %0) #0 { entry: %x = alloca %Small_aligned, align 8 @@ -374,7 +374,7 @@ entry: store i64 %add, ptr %1, align 8 ret void } -; Function Attrs: nounwind + define i64 @test.f_agg_small_aligned_ret(i64 %0) #0 { entry: %x = alloca %Small_aligned, align 8 @@ -384,7 +384,7 @@ entry: %1 = load i64, ptr %literal, align 8 ret i64 %1 } -; Function Attrs: nounwind + define void @test.f_agg_large(ptr align 4 %0) #0 { entry: %1 = getelementptr inbounds %Large, ptr %0, i32 0, i32 0 @@ -399,7 +399,7 @@ entry: store i32 %add1, ptr %1, align 4 ret void } -; Function Attrs: nounwind + define void @test.f_agg_large_ret(ptr noalias sret(%Large) align 4 %0, i32 %1, i8 signext %2) #0 { entry: %literal = alloca %Large, align 4 @@ -407,7 +407,7 @@ entry: call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %literal, i32 16, i1 false) ret void } -; Function Attrs: nounwind + define void @test.f_vec_large_v16i8(ptr align 16 %0) #0 { entry: %1 = load <16 x i8>, ptr %0, align 16 @@ -417,13 +417,13 @@ entry: store <16 x i8> %elemset, ptr %0, align 16 ret void } -; Function Attrs: nounwind + define void @test.f_vec_large_v16i8_ret(ptr noalias sret(<16 x i8>) align 16 %0) #0 { entry: store <16 x i8> , ptr %0, align 16 ret void } -; Function Attrs: nounwind + define i32 @test.f_scalar_stack_1(i32 %0, [2 x i32] %1, i64 %2, ptr align 4 %3, i8 zeroext %4, i8 signext %5, i8 %6, i8 %7) #0 { entry: %a = alloca %Tiny, align 1 @@ -437,7 +437,7 @@ entry: %add = add i32 %zext, %sext ret i32 %add } -; Function Attrs: nounwind + define void @test.f_scalar_stack_2(ptr noalias sret(%Large) align 4 %0, i32 %1, i64 %2, i64 %3, fp128 %4, i8 zeroext %5, i8 %6, i8 %7) #0 { entry: %literal = alloca %Large, align 4 @@ -455,17 +455,17 @@ entry: call void @llvm.memcpy.p0.p0.i32(ptr align 4 %0, ptr align 4 %literal, i32 16, i1 false) ret void } -; Function Attrs: nounwind + define fp128 @test.f_scalar_stack_4(i32 %0, i64 %1, i64 %2, fp128 %3, i8 zeroext %4, i8 %5, i8 %6) #0 { entry: ret fp128 %3 } -; Function Attrs: nounwind + define void @test.f_scalar_stack_5(double %0, i64 %1, double %2, i64 %3, i32 %4, i64 %5, float %6, double %7, fp128 %8) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_agg_stack(double %0, i64 %1, double %2, i64 %3, i32 %4, [2 x i32] %5, i64 %6, ptr align 4 %7) #0 { entry: %e = alloca %Tiny, align 1 @@ -476,9 +476,9 @@ entry: store i64 %6, ptr %g, align 8 ret void } -; Function Attrs: nounwind + declare i32 @f_va_callee(i32, ...) #0 -; Function Attrs: nounwind + define void @test.f_va_caller() #0 { entry: %literal = alloca %Tiny, align 1 diff --git a/test/test_suite/abi/riscv32-ilp32-ilp32f-ilp32d-abi-2.c3t b/test/test_suite/abi/riscv32-ilp32-ilp32f-ilp32d-abi-2.c3t index c7b153ac3..1c7dd14f9 100644 --- a/test/test_suite/abi/riscv32-ilp32-ilp32f-ilp32d-abi-2.c3t +++ b/test/test_suite/abi/riscv32-ilp32-ilp32f-ilp32d-abi-2.c3t @@ -182,55 +182,55 @@ fn void f_va_caller() { define void @test.f_void() -; Function Attrs: nounwind + define signext i8 @test.f_scalar_1(i8 signext %0) #0 { entry: ret i8 %0 } -; Function Attrs: nounwind + define zeroext i8 @test.f_scalar_2(i8 zeroext %0) #0 { entry: ret i8 %0 } -; Function Attrs: nounwind + define i32 @test.f_scalar_3(i32 %0) #0 { entry: ret i32 %0 } -; Function Attrs: nounwind + define i64 @test.f_scalar_4(i64 %0) #0 { entry: ret i64 %0 } -; Function Attrs: nounwind + define i128 @test.f_scalar_5(i128 %0) #0 { entry: ret i128 %0 } -; Function Attrs: nounwind + define float @test.f_fp_scalar_1(float %0) #0 { entry: ret float %0 } -; Function Attrs: nounwind + define double @test.f_fp_scalar_2(double %0) #0 { entry: ret double %0 } -; Function Attrs: nounwind + define fp128 @test.f_fp_scalar_3(fp128 %0) #0 { entry: ret fp128 %0 } -; Function Attrs: nounwind + define void @test.f_agg_tiny(i32 %0) #0 { entry: %x = alloca %Tiny, align 1 @@ -250,7 +250,7 @@ entry: ret void } -; Function Attrs: nounwind + define i32 @test.f_agg_tiny_ret() #0 { entry: %literal = alloca %Tiny, align 1 @@ -259,7 +259,7 @@ entry: ret i32 %0 } -; Function Attrs: nounwind + define void @test.f_vec_tiny_v4i8(i32 %0) #0 { entry: %x = alloca <4 x i8>, align 4 @@ -277,7 +277,7 @@ entry: ret void } -; Function Attrs: nounwind + define i32 @test.f_vec_tiny_v4i8_ret() #0 { entry: %taddr = alloca <4 x i8>, align 4 @@ -286,7 +286,7 @@ entry: ret i32 %0 } -; Function Attrs: nounwind + define void @test.f_vec_tiny_v1i32(i32 %0) #0 { entry: %x = alloca <1 x i32>, align 4 @@ -297,7 +297,7 @@ entry: ret void } -; Function Attrs: nounwind + define i32 @test.f_vec_tiny_v1i32_ret() #0 { entry: %taddr = alloca <1 x i32>, align 4 @@ -306,7 +306,7 @@ entry: ret i32 %0 } -; Function Attrs: nounwind + define void @test.f_agg_small([2 x i32] %0) #0 { entry: %x = alloca %Small, align 4 @@ -324,7 +324,7 @@ entry: ret void } -; Function Attrs: nounwind + define [2 x i32] @test.f_agg_small_ret() #0 { entry: %literal = alloca %Small, align 4 @@ -333,7 +333,7 @@ entry: ret [2 x i32] %0 } -; Function Attrs: nounwind + define void @test.f_vec_small_v8i8(i64 %0) #0 { entry: %x = alloca <8 x i8>, align 8 @@ -346,7 +346,7 @@ entry: ret void } -; Function Attrs: nounwind + define i64 @test.f_vec_small_v8i8_ret() #0 { entry: %taddr = alloca <8 x i8>, align 8 @@ -355,7 +355,7 @@ entry: ret i64 %0 } -; Function Attrs: nounwind + define void @test.f_vec_small_v1i64(i64 %0) #0 { entry: %x = alloca <1 x i64>, align 8 @@ -366,7 +366,7 @@ entry: ret void } -; Function Attrs: nounwind + define i64 @test.f_vec_small_v1i64_ret() #0 { entry: %taddr = alloca <1 x i64>, align 8 @@ -375,7 +375,7 @@ entry: ret i64 %0 } -; Function Attrs: nounwind + define void @test.f_agg_small_aligned(i64 %0) #0 { entry: %x = alloca %Small_aligned, align 8 @@ -389,7 +389,7 @@ entry: ret void } -; Function Attrs: nounwind + define i64 @test.f_agg_small_aligned_ret(i64 %0) #0 { entry: %x = alloca %Small_aligned, align 8 @@ -400,7 +400,7 @@ entry: ret i64 %1 } -; Function Attrs: nounwind + define void @test.f_agg_large(ptr align 4 %0) #0 { entry: %1 = getelementptr inbounds %Large, ptr %0, i32 0, i32 0 @@ -416,7 +416,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_agg_large_ret(ptr noalias sret(%Large) align 4 %0, i32 %1, i8 signext %2) #0 { entry: %literal = alloca %Large, align 4 @@ -425,7 +425,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_vec_large_v16i8(ptr align 16 %0) #0 { entry: %1 = load <16 x i8>, ptr %0, align 16 @@ -436,14 +436,14 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_vec_large_v16i8_ret(ptr noalias sret(<16 x i8>) align 16 %0) #0 { entry: store <16 x i8> , ptr %0, align 16 ret void } -; Function Attrs: nounwind + define i32 @test.f_scalar_stack_1(i32 %0, [2 x i32] %1, i64 %2, ptr align 4 %3, i8 zeroext %4, i8 signext %5, i8 %6, i8 %7) #0 { entry: %a = alloca %Tiny, align 1 @@ -458,7 +458,7 @@ entry: ret i32 %add } -; Function Attrs: nounwind + define void @test.f_scalar_stack_2(ptr noalias sret(%Large) align 4 %0, i32 %1, i64 %2, i64 %3, fp128 %4, i8 zeroext %5, i8 %6, i8 %7) #0 { entry: %literal = alloca %Large, align 4 @@ -477,19 +477,19 @@ entry: ret void } -; Function Attrs: nounwind + define fp128 @test.f_scalar_stack_4(i32 %0, i64 %1, i64 %2, fp128 %3, i8 zeroext %4, i8 %5, i8 %6) #0 { entry: ret fp128 %3 } -; Function Attrs: nounwind + define void @test.f_scalar_stack_5(double %0, i64 %1, double %2, i64 %3, i32 %4, i64 %5, float %6, double %7, fp128 %8) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_agg_stack(double %0, i64 %1, double %2, i64 %3, i32 %4, [2 x i32] %5, i64 %6, ptr align 4 %7) #0 { entry: %e = alloca %Tiny, align 1 @@ -501,10 +501,10 @@ entry: ret void } -; Function Attrs: nounwind + declare i32 @f_va_callee(i32, ...) #0 -; Function Attrs: nounwind + define void @test.f_va_caller() #0 { entry: %literal = alloca %Tiny, align 1 diff --git a/test/test_suite/abi/riscv32-ilp32d-abi.c3t b/test/test_suite/abi/riscv32-ilp32d-abi.c3t index 3ad91b071..dd247f639 100644 --- a/test/test_suite/abi/riscv32-ilp32d-abi.c3t +++ b/test/test_suite/abi/riscv32-ilp32d-abi.c3t @@ -180,7 +180,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_double_s_arg(double %0) #0 { entry: %a = alloca %Double_s, align 8 @@ -188,7 +188,7 @@ entry: ret void } -; Function Attrs: nounwind + define double @test.f_ret_double_s() #0 { entry: %literal = alloca %Double_s, align 8 @@ -197,7 +197,7 @@ entry: ret double %0 } -; Function Attrs: nounwind + define void @test.f_double_double_s_arg(double %0, double %1) #0 { entry: %a = alloca %Double_double_s, align 8 @@ -207,7 +207,7 @@ entry: ret void } -; Function Attrs: nounwind + define { double, double } @test.f_ret_double_double_s() #0 { entry: %literal = alloca %Double_double_s, align 8 @@ -220,7 +220,7 @@ entry: ret { double, double } %3 } -; Function Attrs: nounwind + define void @test.f_double_float_s_arg(double %0, float %1) #0 { entry: %a = alloca %Double_float_s, align 8 @@ -230,7 +230,7 @@ entry: ret void } -; Function Attrs: nounwind + define { double, float } @test.f_ret_double_float_s() #0 { entry: %literal = alloca %Double_float_s, align 8 @@ -243,13 +243,13 @@ entry: ret { double, float } %3 } -; Function Attrs: nounwind + define void @test.f_double_double_s_arg_insufficient_fprs(float %0, double %1, double %2, double %3, double %4, double %5, double %6, ptr align 8 %7) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_double_int8_s_arg(double %0, i8 %1) #0 { entry: %a = alloca %Double_int8_s, align 8 @@ -259,7 +259,7 @@ entry: ret void } -; Function Attrs: nounwind + define { double, i8 } @test.f_ret_double_int8_s() #0 { entry: %literal = alloca %Double_int8_s, align 8 @@ -272,7 +272,7 @@ entry: ret { double, i8 } %3 } -; Function Attrs: nounwind + define void @test.f_double_uint8_s_arg(double %0, i8 %1) #0 { entry: %a = alloca %Double_uint8_s, align 8 @@ -282,7 +282,7 @@ entry: ret void } -; Function Attrs: nounwind + define { double, i8 } @test.f_ret_double_uint8_s() #0 { entry: %literal = alloca %Double_uint8_s, align 8 @@ -295,7 +295,7 @@ entry: ret { double, i8 } %3 } -; Function Attrs: nounwind + define void @test.f_double_int32_s_arg(double %0, i32 %1) #0 { entry: %a = alloca %Double_int32_s, align 8 @@ -305,7 +305,7 @@ entry: ret void } -; Function Attrs: nounwind + define { double, i32 } @test.f_ret_double_int32_s() #0 { entry: %literal = alloca %Double_int32_s, align 8 @@ -318,13 +318,13 @@ entry: ret { double, i32 } %3 } -; Function Attrs: nounwind + define void @test.f_double_int64_s_arg(ptr align 8 %0) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_ret_double_int64_s(ptr noalias sret(%Double_int64_s) align 8 %0) #0 { entry: %literal = alloca %Double_int64_s, align 8 @@ -333,19 +333,19 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_double_int8_s_arg_insufficient_gprs(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, ptr align 8 %8) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_struct_double_int8_insufficient_fprs(float %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, ptr align 8 %8) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_doublearr1_s_arg(double %0) #0 { entry: %a = alloca %Doublearr1_s, align 8 @@ -353,7 +353,7 @@ entry: ret void } -; Function Attrs: nounwind + define double @test.f_ret_doublearr1_s() #0 { entry: %literal = alloca %Doublearr1_s, align 8 @@ -362,7 +362,7 @@ entry: ret double %0 } -; Function Attrs: nounwind + define void @test.f_doublearr2_s_arg(double %0, double %1) #0 { entry: %a = alloca %Doublearr2_s, align 8 @@ -372,7 +372,7 @@ entry: ret void } -; Function Attrs: nounwind + define { double, double } @test.f_ret_doublearr2_s() #0 { entry: %literal = alloca %Doublearr2_s, align 8 @@ -385,7 +385,7 @@ entry: ret { double, double } %3 } -; Function Attrs: nounwind + define void @test.f_doublearr2_tricky1_s_arg(double %0, double %1) #0 { entry: %a = alloca %Doublearr2_tricky1_s, align 8 @@ -395,7 +395,7 @@ entry: ret void } -; Function Attrs: nounwind + define { double, double } @test.f_ret_doublearr2_tricky1_s() #0 { entry: %literal = alloca %Doublearr2_tricky1_s, align 8 @@ -408,13 +408,13 @@ entry: ret { double, double } %3 } -; Function Attrs: nounwind + define void @test.f_int_double_int_s_arg(ptr align 8 %0) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_ret_int_double_int_s(ptr noalias sret(%Int_double_int_s) align 8 %0) #0 { entry: %literal = alloca %Int_double_int_s, align 8 @@ -423,13 +423,13 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_int64_double_s_arg(ptr align 8 %0) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_ret_int64_double_s(ptr noalias sret(%Int64_double_s) align 8 %0) #0 { entry: %literal = alloca %Int64_double_s, align 8 @@ -438,13 +438,13 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_char_char_double_s_arg(ptr align 8 %0) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_ret_char_char_double_s(ptr noalias sret(%Char_char_double_s) align 8 %0) #0 { entry: %literal = alloca %Char_char_double_s, align 8 @@ -453,7 +453,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_double_u_arg(i64 %0) #0 { entry: %a = alloca %Double_u, align 8 @@ -461,7 +461,7 @@ entry: ret void } -; Function Attrs: nounwind + define i64 @test.f_ret_double_u() #0 { entry: %literal = alloca %Double_u, align 8 @@ -470,7 +470,7 @@ entry: ret i64 %0 } -; Function Attrs: nounwind + define { double, i32 } @test.f_ret_double_int32_s_double_int32_s_just_sufficient_gprs(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, double %7, i32 %8) #0 { entry: %h = alloca %Double_int32_s, align 8 @@ -487,7 +487,7 @@ entry: ret { double, i32 } %12 } -; Function Attrs: nounwind + define { double, double } @test.f_ret_double_double_s_double_int32_s_just_sufficient_gprs(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, double %7, i32 %8) #0 { entry: %h = alloca %Double_int32_s, align 8 diff --git a/test/test_suite/abi/riscv32-ilp32f-abi.c3t b/test/test_suite/abi/riscv32-ilp32f-abi.c3t index c0295a133..8da477614 100644 --- a/test/test_suite/abi/riscv32-ilp32f-abi.c3t +++ b/test/test_suite/abi/riscv32-ilp32f-abi.c3t @@ -40,7 +40,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_double_s_arg(i64 %0) #0 { entry: %a = alloca %Double_s, align 8 @@ -48,7 +48,7 @@ entry: ret void } -; Function Attrs: nounwind + define i64 @test.f_ret_double_s() #0 { entry: %literal = alloca %Double_s, align 8 @@ -57,13 +57,13 @@ entry: ret i64 %0 } -; Function Attrs: nounwind + define void @test.f_double_double_s_arg(ptr align 8 %0) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_ret_double_double_s(ptr noalias sret(%Double_double_s) align 8 %0) #0 { entry: %literal = alloca %Double_double_s, align 8 @@ -72,13 +72,13 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_int_double_s_arg(ptr align 8 %0) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_ret_int_double_s(ptr noalias sret(%Int_double_s) align 8 %0) #0 { entry: %literal = alloca %Int_double_s, align 8 diff --git a/test/test_suite/abi/riscv32-ilp32f-ilp32d-abi-2.c3t b/test/test_suite/abi/riscv32-ilp32f-ilp32d-abi-2.c3t index c21cd6d41..958fbf327 100644 --- a/test/test_suite/abi/riscv32-ilp32f-ilp32d-abi-2.c3t +++ b/test/test_suite/abi/riscv32-ilp32f-ilp32d-abi-2.c3t @@ -194,7 +194,7 @@ entry: ret { float, float } %3 } -; Function Attrs: nounwind + define void @test.f_float_float_s_arg_insufficient_fprs(float %0, float %1, float %2, float %3, float %4, float %5, float %6, [2 x i32] %7) #0 { entry: %h = alloca %Float_float_s, align 4 @@ -202,7 +202,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_float_int8_s_arg(float %0, i8 %1) #0 { entry: %a = alloca %Float_int8_s, align 4 @@ -212,7 +212,7 @@ entry: ret void } -; Function Attrs: nounwind + define { float, i8 } @test.f_ret_float_int8_s() #0 { entry: %literal = alloca %Float_int8_s, align 4 @@ -225,7 +225,7 @@ entry: ret { float, i8 } %3 } -; Function Attrs: nounwind + define void @test.f_float_uint8_s_arg(float %0, i8 %1) #0 { entry: %a = alloca %Float_uint8_s, align 4 @@ -235,7 +235,7 @@ entry: ret void } -; Function Attrs: nounwind + define { float, i8 } @test.f_ret_float_uint8_s() #0 { entry: %literal = alloca %Float_uint8_s, align 4 @@ -248,7 +248,7 @@ entry: ret { float, i8 } %3 } -; Function Attrs: nounwind + define void @test.f_float_int32_s_arg(float %0, i32 %1) #0 { entry: %a = alloca %Float_int32_s, align 4 @@ -258,7 +258,7 @@ entry: ret void } -; Function Attrs: nounwind + define { float, i32 } @test.f_ret_float_int32_s() #0 { entry: %literal = alloca %Float_int32_s, align 4 @@ -271,13 +271,13 @@ entry: ret { float, i32 } %3 } -; Function Attrs: nounwind + define void @test.f_float_int64_s_arg(ptr align 8 %0) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_ret_float_int64_s(ptr noalias sret(%Float_int64_s) align 8 %0) #0 { entry: %literal = alloca %Float_int64_s, align 8 @@ -286,7 +286,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_float_int8_s_arg_insufficient_gprs(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, [2 x i32] %8) #0 { entry: %i = alloca %Float_int8_s, align 4 @@ -294,7 +294,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_struct_float_int8_insufficient_fprs(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, [2 x i32] %8) #0 { entry: %i = alloca %Float_int8_s, align 4 @@ -302,7 +302,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_floatarr1_s_arg(float %0) #0 { entry: %a = alloca %Floatarr1_s, align 4 @@ -310,7 +310,7 @@ entry: ret void } -; Function Attrs: nounwind + define float @test.f_ret_floatarr1_s() #0 { entry: %literal = alloca %Floatarr1_s, align 4 @@ -319,7 +319,7 @@ entry: ret float %0 } -; Function Attrs: nounwind + define void @test.f_floatarr2_s_arg(float %0, float %1) #0 { entry: %a = alloca %Floatarr2_s, align 4 @@ -329,7 +329,7 @@ entry: ret void } -; Function Attrs: nounwind + define { float, float } @test.f_ret_floatarr2_s() #0 { entry: %literal = alloca %Floatarr2_s, align 4 @@ -342,7 +342,7 @@ entry: ret { float, float } %3 } -; Function Attrs: nounwind + define void @test.f_floatarr2_tricky1_s_arg(float %0, float %1) #0 { entry: %a = alloca %Floatarr2_tricky1_s, align 4 @@ -352,7 +352,7 @@ entry: ret void } -; Function Attrs: nounwind + define { float, float } @test.f_ret_floatarr2_tricky1_s() #0 { entry: %literal = alloca %Floatarr2_tricky1_s, align 4 @@ -365,13 +365,13 @@ entry: ret { float, float } %3 } -; Function Attrs: nounwind + define void @test.f_int_float_int_s_arg(ptr align 4 %0) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_ret_int_float_int_s(ptr noalias sret(%Int_float_int_s) align 4 %0) #0 { entry: %literal = alloca %Int_float_int_s, align 4 @@ -380,13 +380,13 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_int64_float_s_arg(ptr align 8 %0) #0 { entry: ret void } -; Function Attrs: nounwind + define void @test.f_ret_int64_float_s(ptr noalias sret(%Int64_float_s) align 8 %0) #0 { entry: %literal = alloca %Int64_float_s, align 8 @@ -395,7 +395,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_char_char_float_s_arg([2 x i32] %0) #0 { entry: %a = alloca %Char_char_float_s, align 4 @@ -403,7 +403,7 @@ entry: ret void } -; Function Attrs: nounwind + define [2 x i32] @test.f_ret_char_char_float_s() #0 { entry: %literal = alloca %Char_char_float_s, align 4 @@ -412,7 +412,7 @@ entry: ret [2 x i32] %0 } -; Function Attrs: nounwind + define void @test.f_float_u_arg(i32 %0) #0 { entry: %a = alloca %Float_u, align 4 @@ -420,7 +420,7 @@ entry: ret void } -; Function Attrs: nounwind + define i32 @test.f_ret_float_u() #0 { entry: %literal = alloca %Float_u, align 4 diff --git a/test/test_suite/abi/riscv64-lp64f-lp64d-abi-2.c3t b/test/test_suite/abi/riscv64-lp64f-lp64d-abi-2.c3t index fa84204ba..bba2af3f3 100644 --- a/test/test_suite/abi/riscv64-lp64f-lp64d-abi-2.c3t +++ b/test/test_suite/abi/riscv64-lp64f-lp64d-abi-2.c3t @@ -144,7 +144,7 @@ entry: ret void } -; Function Attrs: nounwind + define float @test.f_ret_float_s() #0 { entry: %literal = alloca %Float_s, align 4 @@ -153,7 +153,7 @@ entry: ret float %0 } -; Function Attrs: nounwind + define void @test.f_float_float_s_arg(float %0, float %1) #0 { entry: %a = alloca %Float_float_s, align 4 @@ -163,7 +163,7 @@ entry: ret void } -; Function Attrs: nounwind + define { float, float } @test.f_ret_float_float_s() #0 { entry: %literal = alloca %Float_float_s, align 4 @@ -176,7 +176,7 @@ entry: ret { float, float } %3 } -; Function Attrs: nounwind + define void @test.f_float_float_s_arg_insufficient_fprs(float %0, float %1, float %2, float %3, float %4, float %5, float %6, i64 %7) #0 { entry: %h = alloca %Float_float_s, align 4 @@ -184,7 +184,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_float_int8_s_arg(float %0, i8 %1) #0 { entry: %a = alloca %Float_int8_s, align 4 @@ -194,7 +194,7 @@ entry: ret void } -; Function Attrs: nounwind + define { float, i8 } @test.f_ret_float_int8_s() #0 { entry: %literal = alloca %Float_int8_s, align 4 @@ -207,7 +207,7 @@ entry: ret { float, i8 } %3 } -; Function Attrs: nounwind + define void @test.f_float_uint8_s_arg(float %0, i8 %1) #0 { entry: %a = alloca %Float_uint8_s, align 4 @@ -217,7 +217,7 @@ entry: ret void } -; Function Attrs: nounwind + define { float, i8 } @test.f_ret_float_uint8_s() #0 { entry: %literal = alloca %Float_uint8_s, align 4 @@ -230,7 +230,7 @@ entry: ret { float, i8 } %3 } -; Function Attrs: nounwind + define void @test.f_float_int32_s_arg(float %0, i32 %1) #0 { entry: %a = alloca %Float_int32_s, align 4 @@ -240,7 +240,7 @@ entry: ret void } -; Function Attrs: nounwind + define { float, i32 } @test.f_ret_float_int32_s() #0 { entry: %literal = alloca %Float_int32_s, align 4 @@ -253,7 +253,7 @@ entry: ret { float, i32 } %3 } -; Function Attrs: nounwind + define void @test.f_float_int64_s_arg(float %0, i64 %1) #0 { entry: %a = alloca %Float_int64_s, align 8 @@ -263,7 +263,7 @@ entry: ret void } -; Function Attrs: nounwind + define { float, i64 } @test.f_ret_float_int64_s() #0 { entry: %literal = alloca %Float_int64_s, align 8 @@ -276,7 +276,7 @@ entry: ret { float, i64 } %3 } -; Function Attrs: nounwind + define void @test.f_float_int8_s_arg_insufficient_gprs(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3, i32 signext %4, i32 signext %5, i32 signext %6, i32 signext %7, i64 %8) #0 { entry: %i = alloca %Float_int8_s, align 4 @@ -284,7 +284,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_struct_float_int8_insufficient_fprs(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, i64 %8) #0 { entry: %i = alloca %Float_int8_s, align 4 @@ -292,7 +292,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.f_floatarr1_s_arg(float %0) #0 { entry: %a = alloca %Floatarr1_s, align 4 @@ -300,7 +300,7 @@ entry: ret void } -; Function Attrs: nounwind + define float @test.f_ret_floatarr1_s() #0 { entry: %literal = alloca %Floatarr1_s, align 4 @@ -309,7 +309,7 @@ entry: ret float %0 } -; Function Attrs: nounwind + define void @test.f_floatarr2_s_arg(float %0, float %1) #0 { entry: %a = alloca %Floatarr2_s, align 4 @@ -319,7 +319,7 @@ entry: ret void } -; Function Attrs: nounwind + define { float, float } @test.f_ret_floatarr2_s() #0 { entry: %literal = alloca %Floatarr2_s, align 4 @@ -332,7 +332,7 @@ entry: ret { float, float } %3 } -; Function Attrs: nounwind + define void @test.f_floatarr2_tricky1_s_arg(float %0, float %1) #0 { entry: %a = alloca %Floatarr2_tricky1_s, align 4 @@ -342,7 +342,7 @@ entry: ret void } -; Function Attrs: nounwind + define { float, float } @test.f_ret_floatarr2_tricky1_s() #0 { entry: %literal = alloca %Floatarr2_tricky1_s, align 4 @@ -355,7 +355,7 @@ entry: ret { float, float } %3 } -; Function Attrs: nounwind + define void @test.f_int_float_int_s_arg([2 x i64] %0) #0 { entry: %a = alloca %Int_float_int_s, align 4 @@ -365,7 +365,7 @@ entry: ret void } -; Function Attrs: nounwind + define [2 x i64] @test.f_ret_int_float_int_s() #0 { entry: %literal = alloca %Int_float_int_s, align 4 @@ -376,7 +376,7 @@ entry: ret [2 x i64] %0 } -; Function Attrs: nounwind + define void @test.f_char_char_float_s_arg(i64 %0) #0 { entry: %a = alloca %Char_char_float_s, align 4 @@ -384,7 +384,7 @@ entry: ret void } -; Function Attrs: nounwind + define i64 @test.f_ret_char_char_float_s() #0 { entry: %literal = alloca %Char_char_float_s, align 4 @@ -393,7 +393,7 @@ entry: ret i64 %0 } -; Function Attrs: nounwind + define void @test.f_float_u_arg(i64 %0) #0 { entry: %a = alloca %Float_u, align 4 @@ -403,7 +403,7 @@ entry: ret void } -; Function Attrs: nounwind + define i64 @test.f_ret_float_u() #0 { entry: %literal = alloca %Float_u, align 4 diff --git a/test/test_suite/abi/small_struct_x64.c3t b/test/test_suite/abi/small_struct_x64.c3t index 4bd5f361a..292530165 100644 --- a/test/test_suite/abi/small_struct_x64.c3t +++ b/test/test_suite/abi/small_struct_x64.c3t @@ -25,7 +25,7 @@ fn Foo getFoo(Foo f) @"$ct.test.Foo" = linkonce global %.introspect { i8 10, i64 0, ptr null, i64 3, i64 0, i64 3, [0 x i64] zeroinitializer }, align 8 -; Function Attrs: nounwind + define i32 @test.testing() #0 { entry: %y = alloca %Foo, align 1 @@ -50,7 +50,7 @@ entry: ret i32 %add } -; Function Attrs: nounwind + define i24 @test.getFoo(i24 %0) #0 { entry: %f = alloca %Foo, align 1 diff --git a/test/test_suite/abi/wasm_extern.c3t b/test/test_suite/abi/wasm_extern.c3t index b79143320..9d269cdca 100644 --- a/test/test_suite/abi/wasm_extern.c3t +++ b/test/test_suite/abi/wasm_extern.c3t @@ -13,5 +13,5 @@ target triple = "wasm32-unknown-unknown" declare i32 @get_abc() #0 define i32 @fgh() #1 -attributes #0 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "wasm-import-name"="get_abc" } -attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "wasm-export-name"="fgh" } +attributes #0 = { nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" "wasm-import-name"="get_abc" } +attributes #1 = { nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" "wasm-export-name"="fgh" } diff --git a/test/test_suite/any/variant_assign.c3t b/test/test_suite/any/variant_assign.c3t index 03369b7e3..bb1b63835 100644 --- a/test/test_suite/any/variant_assign.c3t +++ b/test/test_suite/any/variant_assign.c3t @@ -144,7 +144,7 @@ switch.exit: ; preds = %switch.default, %sw ret void } -; Function Attrs: nounwind + define void @foo.test2(i64 %0, ptr %1) #0 { entry: %y = alloca %"any*", align 8 @@ -234,7 +234,7 @@ switch.exit: ; preds = %switch.default, %sw ret void } -; Function Attrs: nounwind + define void @foo.test3(i64 %0, ptr %1) #0 { entry: %y = alloca %"any*", align 8 diff --git a/test/test_suite/any/variant_switch.c3t b/test/test_suite/any/variant_switch.c3t index 46d8b1676..6820a8780 100644 --- a/test/test_suite/any/variant_switch.c3t +++ b/test/test_suite/any/variant_switch.c3t @@ -131,7 +131,7 @@ if.exit: ; preds = %if.then, %switch.ex ret void } -; Function Attrs: nounwind + define i32 @main() #0 { entry: %taddr = alloca double, align 8 diff --git a/test/test_suite/any/variant_test.c3t b/test/test_suite/any/variant_test.c3t index efedd9674..28e1a7532 100644 --- a/test/test_suite/any/variant_test.c3t +++ b/test/test_suite/any/variant_test.c3t @@ -163,7 +163,7 @@ switch.default: ; preds = %next_if21 switch.exit: ; preds = %switch.default, %switch.case20, %switch.case13, %switch.case6, %switch.case ret void } -; Function Attrs: nounwind + define void @foo.test_all(ptr %0, i64 %1) #0 { entry: %y = alloca %"any*[]", align 8 @@ -201,7 +201,7 @@ loop.body: ; preds = %loop.cond loop.exit: ; preds = %loop.cond ret void } -; Function Attrs: nounwind + define void @foo.main() #0 { entry: %x = alloca %"any*", align 8 diff --git a/test/test_suite/attributes/user_defined_attributes.c3t b/test/test_suite/attributes/user_defined_attributes.c3t index c3acb59a4..e69aa7ae1 100644 --- a/test/test_suite/attributes/user_defined_attributes.c3t +++ b/test/test_suite/attributes/user_defined_attributes.c3t @@ -53,6 +53,7 @@ entry: call void @test.testme() ret void } -attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" } -attributes #1 = { noinline nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" } -attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" } \ No newline at end of file + +attributes #0 = { noreturn nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" } +attributes #1 = { noinline nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" } +attributes #2 = { nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" } diff --git a/test/test_suite/bitstruct/bitstruct_arrays.c3t b/test/test_suite/bitstruct/bitstruct_arrays.c3t index 501b95ee7..1b2189446 100644 --- a/test/test_suite/bitstruct/bitstruct_arrays.c3t +++ b/test/test_suite/bitstruct/bitstruct_arrays.c3t @@ -332,7 +332,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @foo.test2() #0 { entry: %xx = alloca [3 x i8], align 1 @@ -729,7 +729,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @foo.test3() #0 { entry: %xx = alloca [3 x i8], align 1 diff --git a/test/test_suite/bitstruct/bitstruct_initializer.c3t b/test/test_suite/bitstruct/bitstruct_initializer.c3t index e1cf52086..6fba6ed6a 100644 --- a/test/test_suite/bitstruct/bitstruct_initializer.c3t +++ b/test/test_suite/bitstruct/bitstruct_initializer.c3t @@ -452,7 +452,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.main() #0 { entry: call void @test.hello(i32 12) diff --git a/test/test_suite/bitstruct/bitstruct_to_int.c3t b/test/test_suite/bitstruct/bitstruct_to_int.c3t index 2632d6aea..57b201631 100644 --- a/test/test_suite/bitstruct/bitstruct_to_int.c3t +++ b/test/test_suite/bitstruct/bitstruct_to_int.c3t @@ -75,7 +75,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @foo.test2() #0 { entry: %b = alloca [4 x i8], align 1 diff --git a/test/test_suite/clang/2002-01_02.c3t b/test/test_suite/clang/2002-01_02.c3t index 2810b1ac0..3e9f42934 100644 --- a/test/test_suite/clang/2002-01_02.c3t +++ b/test/test_suite/clang/2002-01_02.c3t @@ -200,7 +200,7 @@ entry: ret void } -; Function Attrs: nounwind + define i32 @test.do_merge(ptr %0, ptr %1) #0 { entry: %lvalid = alloca i32, align 4 diff --git a/test/test_suite/compile_time/compile_time_array.c3t b/test/test_suite/compile_time/compile_time_array.c3t index c108d0651..621e3f50e 100644 --- a/test/test_suite/compile_time/compile_time_array.c3t +++ b/test/test_suite/compile_time/compile_time_array.c3t @@ -17,7 +17,7 @@ fn void test() @.str = private unnamed_addr constant [2 x i8] c"a\00", align 1 -; Function Attrs: nounwind + define void @test.test() #0 { entry: %x = alloca i32, align 4 diff --git a/test/test_suite/compile_time/ct_builtin_time_date.c3t b/test/test_suite/compile_time/ct_builtin_time_date.c3t index 7e719df18..fe1c5b5df 100644 --- a/test/test_suite/compile_time/ct_builtin_time_date.c3t +++ b/test/test_suite/compile_time/ct_builtin_time_date.c3t @@ -256,7 +256,7 @@ noerr_block91: ; preds = %after_check89 voiderr93: ; preds = %noerr_block91, %guard_block90, %guard_block84, %guard_block78 ret void } -; Function Attrs: nounwind + define void @test.main() #0 { entry: %is_def2 = alloca i8, align 1 diff --git a/test/test_suite/compile_time/ct_memberof.c3t b/test/test_suite/compile_time/ct_memberof.c3t index 55b422a5d..c591f0d18 100644 --- a/test/test_suite/compile_time/ct_memberof.c3t +++ b/test/test_suite/compile_time/ct_memberof.c3t @@ -113,7 +113,7 @@ entry: store i64 %5, ptr %ptroffset1, align 8 ret void } -; Function Attrs: nounwind + define void @test.test(i32 %0) #0 { entry: %len = alloca i64, align 8 @@ -723,7 +723,7 @@ voiderr151: ; preds = %noerr_block149, %gu ret void } -; Function Attrs: nounwind + define void @test.main() #0 { entry: %varargslots = alloca [1 x %"any*"], align 16 diff --git a/test/test_suite/compile_time/ct_switch.c3t b/test/test_suite/compile_time/ct_switch.c3t index cd82cc7a7..7a625ffa5 100644 --- a/test/test_suite/compile_time/ct_switch.c3t +++ b/test/test_suite/compile_time/ct_switch.c3t @@ -50,10 +50,10 @@ fn void main() @.str.8 = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1 @.str.9 = private unnamed_addr constant [14 x i8] c"donnowifprime\00", align 1 -; Function Attrs: nounwind + declare void @printf(ptr, ...) #0 -; Function Attrs: nounwind + define void @test.main() #0 { entry: call void (ptr, ...) @printf(ptr @.str, ptr @.str.1) diff --git a/test/test_suite/compile_time/ct_switch_type_check.c3t b/test/test_suite/compile_time/ct_switch_type_check.c3t index 24576f17b..4fe4bf14c 100644 --- a/test/test_suite/compile_time/ct_switch_type_check.c3t +++ b/test/test_suite/compile_time/ct_switch_type_check.c3t @@ -33,10 +33,10 @@ fn void main() @.str.4 = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1 @.str.5 = private unnamed_addr constant [10 x i8] c"any other\00", align 1 -; Function Attrs: nounwind + declare void @printf(ptr, ...) #0 -; Function Attrs: nounwind + define void @test.main() #0 { entry: call void (ptr, ...) @printf(ptr @.str, ptr @.str.1) diff --git a/test/test_suite/compile_time/untyped_conversions.c3t b/test/test_suite/compile_time/untyped_conversions.c3t index afd8bdd39..f36d05853 100644 --- a/test/test_suite/compile_time/untyped_conversions.c3t +++ b/test/test_suite/compile_time/untyped_conversions.c3t @@ -47,7 +47,7 @@ fn void main() @.__const.6 = private unnamed_addr constant [2 x i32] [i32 3, i32 4], align 4 @.__const.7 = private unnamed_addr constant [2 x i32] [i32 2, i32 7], align 4 @.__const.8 = private unnamed_addr constant [2 x i32] [i32 2, i32 7], align 4 -; Function Attrs: nounwind + define void @test.test(i64 %0, ptr %1, i64 %2, double %3) #0 { entry: %a = alloca [2 x i32], align 4 @@ -75,7 +75,7 @@ entry: %13 = call i64 @std.io.printfn(ptr %retparam, ptr @.str, i64 8, ptr %varargslots, i64 3) ret void } -; Function Attrs: nounwind + define void @test.main() #0 { entry: %abc = alloca [1 x %Foo], align 4 diff --git a/test/test_suite/concurrency/atomic_load_store_debug.c3t b/test/test_suite/concurrency/atomic_load_store_debug.c3t index 5b81fba59..837d33d7d 100644 --- a/test/test_suite/concurrency/atomic_load_store_debug.c3t +++ b/test/test_suite/concurrency/atomic_load_store_debug.c3t @@ -64,7 +64,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 -; Function Attrs: nounwind + declare i64 @std.io.printfn(ptr, ptr, i64, ptr, i64) #0 declare i1 @llvm.expect.i1(i1, i1) #2 diff --git a/test/test_suite/defer/defer_static_var.c3t b/test/test_suite/defer/defer_static_var.c3t index 50f15e5bb..d2f3c456d 100644 --- a/test/test_suite/defer/defer_static_var.c3t +++ b/test/test_suite/defer/defer_static_var.c3t @@ -66,7 +66,7 @@ if.exit: ; preds = %entry call void (ptr, ...) @printf(ptr @.str.1, i32 %4) ret i32 %0 } -; Function Attrs: nounwind + define void @foo.main() #0 { entry: %i = alloca i32, align 4 diff --git a/test/test_suite/dynamic/overlapping_function.c3t b/test/test_suite/dynamic/overlapping_function.c3t index 472b668c2..c399c6c88 100644 --- a/test/test_suite/dynamic/overlapping_function.c3t +++ b/test/test_suite/dynamic/overlapping_function.c3t @@ -39,7 +39,7 @@ fn void main() @"$sel.foo" = linkonce_odr constant [4 x i8] c"foo\00", align 1 @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 1, ptr @.static_initialize.0, ptr null }] -; Function Attrs: nounwind + define void @overlap.main() #0 { entry: %z = alloca %"any*", align 8 diff --git a/test/test_suite/enumerations/enum_associated_value.c3t b/test/test_suite/enumerations/enum_associated_value.c3t index e01de3187..bb7a75f2c 100644 --- a/test/test_suite/enumerations/enum_associated_value.c3t +++ b/test/test_suite/enumerations/enum_associated_value.c3t @@ -29,7 +29,7 @@ fn void main() @.str.1 = private unnamed_addr constant [9 x i8] c"Number B\00", align 1 @"test.Foo$testme" = linkonce constant [2 x ptr] [ptr @.str, ptr @.str.1], align 8 @.str.2 = private unnamed_addr constant [17 x i8] c"%d (%s) %d (%s)\0A\00", align 1 -; Function Attrs: nounwind + define void @test.main() #0 { entry: %x = alloca i32, align 4 diff --git a/test/test_suite/enumerations/enum_conversions.c3t b/test/test_suite/enumerations/enum_conversions.c3t index 2362fd074..c1c597b43 100644 --- a/test/test_suite/enumerations/enum_conversions.c3t +++ b/test/test_suite/enumerations/enum_conversions.c3t @@ -38,9 +38,9 @@ panic: ; preds = %entry %"$$temp" = insertvalue %"any*[]" %4, i64 1, 1 store %"any*[]" %"$$temp", ptr %indirectarg, align 8 call void @std.core.builtin.panicf(ptr @.panic_msg, i64 7, ptr @.file, i64 19, ptr @.func, i64 4, i32 7, ptr byval(%"any*[]") align 8 %indirectarg) - br label %checkok + unreachable -checkok: ; preds = %panic, %entry +checkok: ; preds = %entry %ge = icmp sge i32 %0, 1 br i1 %ge, label %panic1, label %checkok6 @@ -54,9 +54,9 @@ panic1: ; preds = %checkok %"$$temp4" = insertvalue %"any*[]" %8, i64 1, 1 store %"any*[]" %"$$temp4", ptr %indirectarg5, align 8 call void @std.core.builtin.panicf(ptr @.panic_msg.1, i64 87, ptr @.file, i64 19, ptr @.func, i64 4, i32 7, ptr byval(%"any*[]") align 8 %indirectarg5) - br label %checkok6 + unreachable -checkok6: ; preds = %panic1, %checkok +checkok6: ; preds = %checkok %trunc = trunc i32 %0 to i8 store i8 %trunc, ptr %x, align 1 store i64 0, ptr %z, align 8 @@ -74,9 +74,9 @@ panic8: ; preds = %checkok6 %"$$temp11" = insertvalue %"any*[]" %13, i64 1, 1 store %"any*[]" %"$$temp11", ptr %indirectarg12, align 8 call void @std.core.builtin.panicf(ptr @.panic_msg.2, i64 8, ptr @.file, i64 19, ptr @.func, i64 4, i32 9, ptr byval(%"any*[]") align 8 %indirectarg12) - br label %checkok13 + unreachable -checkok13: ; preds = %panic8, %checkok6 +checkok13: ; preds = %checkok6 %ge14 = icmp sge i64 %9, 1 br i1 %ge14, label %panic15, label %checkok20 @@ -90,9 +90,9 @@ panic15: ; preds = %checkok13 %"$$temp18" = insertvalue %"any*[]" %17, i64 1, 1 store %"any*[]" %"$$temp18", ptr %indirectarg19, align 8 call void @std.core.builtin.panicf(ptr @.panic_msg.1, i64 87, ptr @.file, i64 19, ptr @.func, i64 4, i32 9, ptr byval(%"any*[]") align 8 %indirectarg19) - br label %checkok20 + unreachable -checkok20: ; preds = %panic15, %checkok13 +checkok20: ; preds = %checkok13 %trunc21 = trunc i64 %9 to i8 store i8 %trunc21, ptr %y, align 1 store i32 256, ptr %a, align 4 @@ -110,9 +110,9 @@ panic23: ; preds = %checkok20 %"$$temp26" = insertvalue %"any*[]" %22, i64 1, 1 store %"any*[]" %"$$temp26", ptr %indirectarg27, align 8 call void @std.core.builtin.panicf(ptr @.panic_msg.3, i64 62, ptr @.file, i64 19, ptr @.func, i64 4, i32 11, ptr byval(%"any*[]") align 8 %indirectarg27) - br label %checkok28 + unreachable -checkok28: ; preds = %panic23, %checkok20 +checkok28: ; preds = %checkok20 %ge29 = icmp sge i32 %18, 1 br i1 %ge29, label %panic30, label %checkok35 @@ -126,9 +126,9 @@ panic30: ; preds = %checkok28 %"$$temp33" = insertvalue %"any*[]" %26, i64 1, 1 store %"any*[]" %"$$temp33", ptr %indirectarg34, align 8 call void @std.core.builtin.panicf(ptr @.panic_msg.1, i64 87, ptr @.file, i64 19, ptr @.func, i64 4, i32 11, ptr byval(%"any*[]") align 8 %indirectarg34) - br label %checkok35 + unreachable -checkok35: ; preds = %panic30, %checkok28 +checkok35: ; preds = %checkok28 %trunc36 = trunc i32 %18 to i8 store i8 %trunc36, ptr %y, align 1 store i32 -1, ptr %a, align 4 @@ -146,9 +146,9 @@ panic38: ; preds = %checkok35 %"$$temp41" = insertvalue %"any*[]" %31, i64 1, 1 store %"any*[]" %"$$temp41", ptr %indirectarg42, align 8 call void @std.core.builtin.panicf(ptr @.panic_msg.3, i64 62, ptr @.file, i64 19, ptr @.func, i64 4, i32 13, ptr byval(%"any*[]") align 8 %indirectarg42) - br label %checkok43 + unreachable -checkok43: ; preds = %panic38, %checkok35 +checkok43: ; preds = %checkok35 %ge44 = icmp sge i32 %27, 1 br i1 %ge44, label %panic45, label %checkok50 @@ -162,9 +162,9 @@ panic45: ; preds = %checkok43 %"$$temp48" = insertvalue %"any*[]" %35, i64 1, 1 store %"any*[]" %"$$temp48", ptr %indirectarg49, align 8 call void @std.core.builtin.panicf(ptr @.panic_msg.1, i64 87, ptr @.file, i64 19, ptr @.func, i64 4, i32 13, ptr byval(%"any*[]") align 8 %indirectarg49) - br label %checkok50 + unreachable -checkok50: ; preds = %panic45, %checkok43 +checkok50: ; preds = %checkok43 %trunc51 = trunc i32 %27 to i8 store i8 %trunc51, ptr %y, align 1 ret void diff --git a/test/test_suite/errors/anyfault_void.c3t b/test/test_suite/errors/anyfault_void.c3t index 59dae647b..92a898c8c 100644 --- a/test/test_suite/errors/anyfault_void.c3t +++ b/test/test_suite/errors/anyfault_void.c3t @@ -30,15 +30,15 @@ define i64 @anyfault_void.errorThing() #0 { entry: ret i64 ptrtoint (ptr @"anyfault_void.MyError$BAR" to i64) } -; Function Attrs: nounwind + define i64 @anyfault_void.errorThing2() #0 { entry: %reterr = alloca i64, align 8 ret i64 0 } -; Function Attrs: nounwind + declare void @printf(ptr, ...) #0 -; Function Attrs: nounwind + define void @anyfault_void.main() #0 { entry: %z = alloca i64, align 8 diff --git a/test/test_suite/errors/else_checks.c3t b/test/test_suite/errors/else_checks.c3t index 189bf967a..9e51a873f 100644 --- a/test/test_suite/errors/else_checks.c3t +++ b/test/test_suite/errors/else_checks.c3t @@ -13,10 +13,10 @@ fn void test() /* #expect: else_checks.ll -; Function Attrs: nounwind + declare i64 @testError(ptr) #0 -; Function Attrs: nounwind + define void @else_checks.test() #0 { entry: %x = alloca double, align 8 diff --git a/test/test_suite/errors/error_regression_2.c3t b/test/test_suite/errors/error_regression_2.c3t index 14e2fb728..a2d1d8334 100644 --- a/test/test_suite/errors/error_regression_2.c3t +++ b/test/test_suite/errors/error_regression_2.c3t @@ -183,7 +183,7 @@ cond.phi: ; preds = %cond.rhs, %cond.lhs ret void } -; Function Attrs: nounwind + define zeroext i8 @test.contains(ptr %0, i64 %1, ptr %2, i64 %3) #0 { entry: %haystack = alloca %"char[]", align 8 @@ -259,7 +259,7 @@ loop.exit: ; preds = %loop.cond ret i8 0 } -; Function Attrs: nounwind + define i64 @test.readDoc(ptr %0, ptr %1, i64 %2) #0 { entry: %url = alloca %"char[]", align 8 @@ -510,7 +510,7 @@ noerr_block61: ; preds = %if.exit59 ret i64 0 } -; Function Attrs: nounwind + define { ptr, i8 } @test.buildSummary(ptr %0) #0 { entry: %doc = alloca %Doc, align 8 @@ -545,7 +545,7 @@ cond.phi: ; preds = %cond.rhs, %cond.lhs ret { ptr, i8 } %11 } -; Function Attrs: nounwind + define { ptr, i8 } @test.readAndBuildSummary(ptr %0, i64 %1) #0 { entry: %url = alloca %"char[]", align 8 @@ -584,7 +584,7 @@ phi_block: ; preds = %else_block, %after_ ret { ptr, i8 } %10 } -; Function Attrs: nounwind + define i64 @test.isTitleNonEmpty(ptr %0, ptr %1) #0 { entry: %doc = alloca %Doc, align 8 @@ -622,7 +622,7 @@ if.exit3: ; preds = %if.exit ret i64 0 } -; Function Attrs: nounwind + define i64 @test.readWhetherTitleNonEmpty(ptr %0, ptr %1, i64 %2) #0 { entry: %url = alloca %"char[]", align 8 @@ -666,7 +666,7 @@ err_retblock: ; preds = %assign_optional3, % ret i64 %11 } -; Function Attrs: nounwind + define ptr @test.bool_to_string(i8 zeroext %0) #0 { entry: %1 = trunc i8 %0 to i1 @@ -675,7 +675,7 @@ entry: ret ptr %2 } -; Function Attrs: nounwind + define ptr @test.nameFromError(i64 %0) #0 { entry: %switch = alloca i64, align 8 @@ -711,7 +711,7 @@ switch.default: ; preds = %next_if6 ret ptr @.str.15 } -; Function Attrs: nounwind + define void @test.main() #0 { entry: %.anon = alloca i64, align 8 diff --git a/test/test_suite/errors/general_error_regression.c3t b/test/test_suite/errors/general_error_regression.c3t index 7ffcc44d9..521baacaf 100644 --- a/test/test_suite/errors/general_error_regression.c3t +++ b/test/test_suite/errors/general_error_regression.c3t @@ -138,7 +138,7 @@ voiderr: ; preds = %noerr_block13, %gua ret void } -; Function Attrs: nounwind + define void @foo.Bar.hello(ptr %0) #0 { entry: %len = alloca i64, align 8 @@ -205,7 +205,7 @@ voiderr: ; preds = %noerr_block13, %gua ret void } -; Function Attrs: nounwind + define void @foo.MyEnum.hello(ptr %0) #0 { entry: %len = alloca i64, align 8 @@ -272,7 +272,7 @@ voiderr: ; preds = %noerr_block13, %gua ret void } -; Function Attrs: nounwind + define void @foo.main() #0 { entry: %f = alloca i64, align 8 diff --git a/test/test_suite/errors/macro_err.c3t b/test/test_suite/errors/macro_err.c3t index 3294da88d..23e6ff617 100644 --- a/test/test_suite/errors/macro_err.c3t +++ b/test/test_suite/errors/macro_err.c3t @@ -24,7 +24,7 @@ entry: ret i64 0 } -; Function Attrs: nounwind + define void @test.main() #0 { entry: %error_var = alloca i64, align 8 diff --git a/test/test_suite/errors/optional_chained_init.c3t b/test/test_suite/errors/optional_chained_init.c3t index e1bfb412c..c67fb5719 100644 --- a/test/test_suite/errors/optional_chained_init.c3t +++ b/test/test_suite/errors/optional_chained_init.c3t @@ -164,7 +164,7 @@ after_check30: ; preds = %after_check23, %aft ret void } -; Function Attrs: nounwind + define void @test.test2() #0 { entry: %x = alloca i32, align 4 @@ -307,7 +307,7 @@ after_check35: ; preds = %after_check28, %aft ret void } -; Function Attrs: nounwind + define void @test.test3() #0 { entry: %x = alloca i32, align 4 diff --git a/test/test_suite/errors/optional_inits.c3t b/test/test_suite/errors/optional_inits.c3t index c7c999b0e..54ac32e9c 100644 --- a/test/test_suite/errors/optional_inits.c3t +++ b/test/test_suite/errors/optional_inits.c3t @@ -61,7 +61,7 @@ noerr_block: ; preds = %after_check ret i64 0 } -; Function Attrs: nounwind + define i64 @test.test2() #0 { entry: %x = alloca %Bar, align 4 @@ -91,7 +91,7 @@ noerr_block: ; preds = %after_check ret i64 0 } -; Function Attrs: nounwind + define void @test.main() #0 { entry: %0 = call i64 @test.test1() diff --git a/test/test_suite/errors/optional_taddr_and_access.c3t b/test/test_suite/errors/optional_taddr_and_access.c3t index 2beb92188..ef8cf320b 100644 --- a/test/test_suite/errors/optional_taddr_and_access.c3t +++ b/test/test_suite/errors/optional_taddr_and_access.c3t @@ -34,10 +34,10 @@ fn void main() @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [17 x i8] c"Not visible: %d\0A\00", align 1 -; Function Attrs: nounwind + declare i32 @printf(ptr, ...) #0 -; Function Attrs: nounwind + define void @test.main() #0 { entry: %z = alloca i32, align 4 diff --git a/test/test_suite/errors/optional_with_optional.c3t b/test/test_suite/errors/optional_with_optional.c3t index d765e92ea..28354638b 100644 --- a/test/test_suite/errors/optional_with_optional.c3t +++ b/test/test_suite/errors/optional_with_optional.c3t @@ -268,7 +268,7 @@ expr_block.exit75: ; preds = %if.exit74, %if.then ret void } -; Function Attrs: nounwind + define i64 @test.get_a(ptr %0, i32 %1) #0 { entry: %reterr = alloca i64, align 8 @@ -285,7 +285,7 @@ if.exit: ; preds = %entry ret i64 0 } -; Function Attrs: nounwind + define i64 @test.get_b(ptr %0, i32 %1) #0 { entry: %reterr = alloca i64, align 8 diff --git a/test/test_suite/errors/or_and_rethrow.c3t b/test/test_suite/errors/or_and_rethrow.c3t index 943aa3926..04c977a58 100644 --- a/test/test_suite/errors/or_and_rethrow.c3t +++ b/test/test_suite/errors/or_and_rethrow.c3t @@ -338,7 +338,7 @@ voiderr96: ; preds = %noerr_block94, %gua ret i64 0 } -; Function Attrs: nounwind + define i64 @foo.test2(i32 %0) #0 { entry: %varargslots = alloca [1 x %"any*"], align 16 @@ -510,7 +510,7 @@ voiderr47: ; preds = %noerr_block45, %gua ret i64 0 } -; Function Attrs: nounwind + define void @foo.main() #0 { entry: %a = alloca i64, align 8 @@ -660,7 +660,7 @@ expr_block.exit33: ; preds = %if.exit32, %if.then ret void } -; Function Attrs: nounwind + define i32 @main(i32 %0, ptr %1) #0 { entry: call void @foo.main() diff --git a/test/test_suite/errors/printing_errors.c3t b/test/test_suite/errors/printing_errors.c3t index 3a3cf7efb..64800697a 100644 --- a/test/test_suite/errors/printing_errors.c3t +++ b/test/test_suite/errors/printing_errors.c3t @@ -51,7 +51,7 @@ fn void main() ret void } - ; Function Attrs: nounwind + define i32 @main(i32 %0, ptr %1) #0 { entry: call void @test.main() diff --git a/test/test_suite/errors/try_with_unwrapper.c3t b/test/test_suite/errors/try_with_unwrapper.c3t index 8fd20f2e6..b28b106c8 100644 --- a/test/test_suite/errors/try_with_unwrapper.c3t +++ b/test/test_suite/errors/try_with_unwrapper.c3t @@ -42,17 +42,17 @@ fn void test2() /* #expect: try_with_unwrapper.ll -; Function Attrs: nounwind + define i32 @try_with_unwrapper.hello(i32 %0) #0 { entry: %add = add i32 %0, 1 ret i32 %add } -; Function Attrs: nounwind + declare i32 @printf(ptr, ...) #0 -; Function Attrs: nounwind + define i64 @try_with_unwrapper.tester(ptr %0) #0 { entry: %reterr = alloca i64, align 8 @@ -61,7 +61,7 @@ entry: ret i64 0 } -; Function Attrs: nounwind + define void @try_with_unwrapper.test1() #0 { entry: %a = alloca i32, align 4 @@ -131,7 +131,7 @@ if.exit: ; preds = %if.then, %end_chain } -; Function Attrs: nounwind + define void @try_with_unwrapper.test2() #0 { entry: %a = alloca i32, align 4 diff --git a/test/test_suite/expressions/addr_compiles.c3t b/test/test_suite/expressions/addr_compiles.c3t index 2c06ce0f9..29f228d01 100644 --- a/test/test_suite/expressions/addr_compiles.c3t +++ b/test/test_suite/expressions/addr_compiles.c3t @@ -57,7 +57,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.test() #0 { entry: %f = alloca i32, align 4 @@ -79,7 +79,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.test2() #0 { entry: %w = alloca ptr, align 8 @@ -90,7 +90,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.test3() #0 { entry: %h = alloca %Foo, align 4 diff --git a/test/test_suite/expressions/optional_ternary.c3t b/test/test_suite/expressions/optional_ternary.c3t index 15823f281..77e4011c8 100644 --- a/test/test_suite/expressions/optional_ternary.c3t +++ b/test/test_suite/expressions/optional_ternary.c3t @@ -77,7 +77,7 @@ target triple = "x86_64-apple @.zstr.7 = internal constant [20 x i8] c"optional_ternary.c3\00", align 1 @.zstr.8 = internal constant [5 x i8] c"main\00", align 1 -; Function Attrs: nounwind + define i64 @test.test(i32* %0, i32 %1) #0 { entry: %reterr = alloca i64, align 8 @@ -97,7 +97,7 @@ err_retblock: ; preds = %cond.rhs ret i64 %2 } -; Function Attrs: nounwind + define i64 @test.test2(i32* %0, i32 %1) #0 { entry: %reterr = alloca i64, align 8 @@ -121,7 +121,7 @@ err_retblock: ; preds = %cond.rhs, %cond.lhs ret i64 %2 } -; Function Attrs: nounwind + define i64 @test.test3(i32* %0, i32 %1) #0 { entry: %reterr = alloca i64, align 8 @@ -144,7 +144,7 @@ err_retblock: ; preds = %cond.rhs ret i64 %2 } -; Function Attrs: nounwind + define i64 @test.test4(i32* %0, i32 %1) #0 { entry: %y = alloca i32, align 4 @@ -186,7 +186,7 @@ err_retblock: ; preds = %cond.rhs ret i64 %4 } -; Function Attrs: nounwind + define i64 @test.test5(i32* %0, i32 %1) #0 { entry: %y = alloca i32, align 4 @@ -232,7 +232,7 @@ err_retblock: ; preds = %cond.rhs, %cond.lhs ret i64 %4 } -; Function Attrs: nounwind + define i64 @test.test6(i32* %0, i32 %1) #0 { entry: %y = alloca i32, align 4 @@ -277,7 +277,7 @@ err_retblock: ; preds = %cond.rhs ret i64 %4 } -; Function Attrs: nounwind + define i64 @test.test7(i32* %0, i32 %1) #0 { entry: %y = alloca i32, align 4 @@ -322,7 +322,7 @@ err_retblock: ; preds = %cond.lhs ret i64 %4 } -; Function Attrs: nounwind + define void @test.main() #0 { entry: %error_var = alloca i64, align 8 @@ -403,7 +403,7 @@ after_assign: ; preds = %after_check18, %ass ret void } -; Function Attrs: nounwind + define i32 @main(i32 %0, i8** %1) #0 { entry: call void @test.main() diff --git a/test/test_suite/from_docs/examples_defer.c3t b/test/test_suite/from_docs/examples_defer.c3t index 5c442e8bf..d634771af 100644 --- a/test/test_suite/from_docs/examples_defer.c3t +++ b/test/test_suite/from_docs/examples_defer.c3t @@ -243,7 +243,7 @@ voiderr78: ; preds = %noerr_block76, %gua ret void } -; Function Attrs: nounwind + define void @defer1.main() #0 { entry: call void @defer1.test(i32 1) diff --git a/test/test_suite/from_docs/examples_forswitch.c3t b/test/test_suite/from_docs/examples_forswitch.c3t index ffc57631f..24ce59f90 100644 --- a/test/test_suite/from_docs/examples_forswitch.c3t +++ b/test/test_suite/from_docs/examples_forswitch.c3t @@ -114,7 +114,7 @@ loop.exit: ; preds = %loop.cond unreachable } -; Function Attrs: nounwind + define void @examples.demo_enum(i32 %0) #0 { entry: %switch = alloca i32, align 4 diff --git a/test/test_suite/functions/naked_function.c3t b/test/test_suite/functions/naked_function.c3t index 36dfe4383..91c545b61 100644 --- a/test/test_suite/functions/naked_function.c3t +++ b/test/test_suite/functions/naked_function.c3t @@ -12,4 +12,4 @@ entry: ret void } -attributes #0 = { naked nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" } \ No newline at end of file +attributes #0 = { naked nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" } diff --git a/test/test_suite/functions/test_regression.c3t b/test/test_suite/functions/test_regression.c3t index f045bccb0..bdf9fd223 100644 --- a/test/test_suite/functions/test_regression.c3t +++ b/test/test_suite/functions/test_regression.c3t @@ -261,7 +261,7 @@ entry: ret void } -; Function Attrs: nounwind + define i32 @test.Foo2.mutate(ptr %0) #0 { entry: %1 = call i32 (ptr, ...) @printf(ptr @.str.22) @@ -272,17 +272,17 @@ entry: ret i32 %add } -; Function Attrs: nounwind + declare i32 @printf(ptr, ...) #0 -; Function Attrs: nounwind + define void @test.helloWorld() #0 { entry: %0 = call i32 (ptr, ...) @printf(ptr @.str) ret void } -; Function Attrs: nounwind + define i32 @test.test_static() #0 { entry: %0 = load i32, ptr @test_static.x, align 4 @@ -294,7 +294,7 @@ entry: ret i32 %3 } -; Function Attrs: nounwind + define i32 @test.helo(double %0, ptr byval(%Bobo) align 8 %1) #0 { entry: %de = alloca [3 x i32], align 4 @@ -307,7 +307,7 @@ entry: ret i32 1 } -; Function Attrs: nounwind + define i32 @test.test1(i32 %0, i32 %1) #0 { entry: %a = alloca i32, align 4 @@ -327,7 +327,7 @@ if.exit: ; preds = %entry ret i32 %4 } -; Function Attrs: nounwind + define i32 @test.sum_us(ptr %0, i64 %1) #0 { entry: %x = alloca %"int[]", align 8 @@ -367,7 +367,7 @@ if.exit: ; preds = %entry ret i32 %15 } -; Function Attrs: nounwind + define i32 @test.sumd(ptr %0, i64 %1) #0 { entry: %x = alloca %"int[]", align 8 @@ -410,7 +410,7 @@ loop.exit: ; preds = %loop.cond ret i32 %11 } -; Function Attrs: nounwind + define void @test.main() #0 { entry: %list = alloca %LinkedList, align 8 diff --git a/test/test_suite/functions/test_regression_mingw.c3t b/test/test_suite/functions/test_regression_mingw.c3t index b30d5ec7b..492ae8325 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 @.str.21 = private unnamed_addr constant [12 x i8] c"Foo is: %d\0A\00", align 1 @.str.22 = private unnamed_addr constant [9 x i8] c"Mutating\00", align 1 -; Function Attrs: nounwind + define void @test.Foo2.printme(ptr %0) #0 { entry: %1 = getelementptr inbounds %Foo2, ptr %0, i32 0, i32 0 @@ -305,7 +305,7 @@ entry: ret void } -; Function Attrs: nounwind + define i32 @test.Foo2.mutate(ptr %0) #0 { entry: %1 = call i32 (ptr, ...) @printf(ptr @.str.22) @@ -316,17 +316,17 @@ entry: ret i32 %add } -; Function Attrs: nounwind + declare i32 @printf(ptr, ...) #0 -; Function Attrs: nounwind + define void @test.helloWorld() #0 { entry: %0 = call i32 (ptr, ...) @printf(ptr @.str) ret void } -; Function Attrs: nounwind + define i32 @test.test_static() #0 { entry: %0 = load i32, ptr @test_static.x, align 4 @@ -338,7 +338,7 @@ entry: ret i32 %3 } -; Function Attrs: nounwind + define i32 @test.helo(double %0, ptr align 4 %1) #0 { entry: %de = alloca [3 x i32], align 4 @@ -351,7 +351,7 @@ entry: ret i32 1 } -; Function Attrs: nounwind + define i32 @test.test1(i32 %0, i32 %1) #0 { entry: %a = alloca i32, align 4 @@ -371,7 +371,7 @@ if.exit: ; preds = %entry ret i32 %4 } -; Function Attrs: nounwind + define i32 @test.sum_us(ptr align 8 %0) #0 { entry: %sum = alloca i32, align 4 @@ -409,7 +409,7 @@ if.exit: ; preds = %entry ret i32 %14 } -; Function Attrs: nounwind + define i32 @test.sumd(ptr align 8 %0) #0 { entry: %sum = alloca i32, align 4 @@ -448,7 +448,7 @@ loop.exit: ; preds = %loop.cond ret i32 %10 } -; Function Attrs: nounwind + define void @test.main() #0 { entry: %list = alloca %LinkedList, align 8 diff --git a/test/test_suite/functions/varargs_followed_by_named.c3t b/test/test_suite/functions/varargs_followed_by_named.c3t index a0b547a45..5c0a08456 100644 --- a/test/test_suite/functions/varargs_followed_by_named.c3t +++ b/test/test_suite/functions/varargs_followed_by_named.c3t @@ -39,7 +39,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @foo.test2(i32 %0, ptr %1, i64 %2, i32 %3) #0 { entry: %y = alloca %"any*[]", align 8 @@ -53,7 +53,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @foo.main() #0 { entry: %varargslots = alloca [2 x i32], align 4 diff --git a/test/test_suite/generic/generic_lambda_complex.c3t b/test/test_suite/generic/generic_lambda_complex.c3t index 576477f13..f01c54aa1 100644 --- a/test/test_suite/generic/generic_lambda_complex.c3t +++ b/test/test_suite/generic/generic_lambda_complex.c3t @@ -170,7 +170,7 @@ fn void! main() /* #expect: text_test.ll -; Function Attrs: nounwind + define i64 @text_test.main() #0 { entry: %foo_tmpl = alloca %"char[]", align 8 diff --git a/test/test_suite/generic/generic_over_fn.c3t b/test/test_suite/generic/generic_over_fn.c3t index 49568ef94..ce110b7c6 100644 --- a/test/test_suite/generic/generic_over_fn.c3t +++ b/test/test_suite/generic/generic_over_fn.c3t @@ -134,7 +134,7 @@ loop.exit: ; preds = %loop.cond ret void } -; Function Attrs: nounwind + define void @sort_test.quicksort_with_value2() #0 { entry: %tcases = alloca %"int[][]", align 8 @@ -211,6 +211,6 @@ loop.exit: ; preds = %loop.cond ret void } -; Function Attrs: nounwind + declare void @"test_generic$sa$int$p$fn$int$int$$int$$.sort"(ptr, i64, i64, i64, ptr) #0 diff --git a/test/test_suite/initializer_lists/fasta.c3t b/test/test_suite/initializer_lists/fasta.c3t index 8dd22eb7e..b866bceb6 100644 --- a/test/test_suite/initializer_lists/fasta.c3t +++ b/test/test_suite/initializer_lists/fasta.c3t @@ -131,7 +131,7 @@ fn int main(int argc, char **argv) @.str.15 = private unnamed_addr constant [26 x i8] c">TWO IUB ambiguity codes\0A\00", align 1 @.str.16 = private unnamed_addr constant [31 x i8] c">THREE Homo sapiens frequency\0A\00", align 1 -; Function Attrs: nounwind + define float @fasta.fasta_rand(float %0) #0 { entry: %1 = load i32, ptr @fasta.seed, align 4 @@ -146,16 +146,16 @@ entry: ret float %fdiv } -; Function Attrs: nounwind + declare i32 @atoi(ptr) #0 -; Function Attrs: nounwind + declare i32 @printf(ptr, ...) #0 -; Function Attrs: nounwind + declare void @putchar(i32) #0 -; Function Attrs: nounwind + define void @fasta.repeat_fasta(ptr %0, i64 %1, i32 %2) #0 { entry: %seq = alloca %"char[]", align 8 @@ -215,7 +215,7 @@ if.exit5: ; preds = %if.then4, %loop.exi ret void } -; Function Attrs: nounwind + define void @fasta.random_fasta(ptr %0, i64 %1, ptr %2, i64 %3, i32 %4) #0 { entry: %symb = alloca %"char[]", align 8 @@ -323,7 +323,7 @@ if.exit16: ; preds = %if.then15, %loop.ex ret void } -; Function Attrs: nounwind + define i32 @main(i32 %0, ptr %1) #0 { entry: %n = alloca i32, align 4 diff --git a/test/test_suite/initializer_lists/general_tests.c3t b/test/test_suite/initializer_lists/general_tests.c3t index 79b0a2765..1973abe0f 100644 --- a/test/test_suite/initializer_lists/general_tests.c3t +++ b/test/test_suite/initializer_lists/general_tests.c3t @@ -43,7 +43,7 @@ fn int test() @test.foo1 = internal unnamed_addr global i32 22, align 4 @.str = private unnamed_addr constant [7 x i8] c"Hello!\00", align 1 -; Function Attrs: nounwind + define i32 @general_tests.test() #0 { entry: %ffe = alloca %Baz, align 8 diff --git a/test/test_suite/initializer_lists/subarrays.c3t b/test/test_suite/initializer_lists/subarrays.c3t index bf7436acd..2e23ee010 100644 --- a/test/test_suite/initializer_lists/subarrays.c3t +++ b/test/test_suite/initializer_lists/subarrays.c3t @@ -64,7 +64,7 @@ fn int main() @.str.9 = private unnamed_addr constant [25 x i8] c"Fofeo second element %d\0A\00", align 1 @.__const.10 = private unnamed_addr constant { i32, [4 x i8] } { i32 1, [4 x i8] undef }, align 8 @.str.12 = private unnamed_addr constant [3 x i8] c"Ok\00", align 1 -; Function Attrs: nounwind + define i32 @main() #0 { entry: %w = alloca %Bar, align 4 diff --git a/test/test_suite/lambda/ct_lambda.c3t b/test/test_suite/lambda/ct_lambda.c3t index a672c12df..e0647f182 100644 --- a/test/test_suite/lambda/ct_lambda.c3t +++ b/test/test_suite/lambda/ct_lambda.c3t @@ -87,7 +87,7 @@ fn int main() @init.foo = internal unnamed_addr global ptr @"test.$global$lambda1", align 8 @init.foo.2 = internal unnamed_addr global ptr @"test.$global$lambda2", align 8 -; Function Attrs: nounwind + define void @test.Foo.test(ptr %0, i32 %1) #0 { entry: %2 = getelementptr inbounds %Foo, ptr %0, i32 0, i32 0 @@ -96,7 +96,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @test.FooTest.init(ptr %0) #0 { entry: %1 = getelementptr inbounds %FooTest, ptr %0, i32 0, i32 0 @@ -124,7 +124,7 @@ if.exit: ; preds = %entry ret void } -; Function Attrs: nounwind + define internal void @"test.$global$lambda2"(ptr %0, i32 %1) #0 { entry: %z = alloca ptr, align 8 diff --git a/test/test_suite/lambda/ct_lambda2.c3t b/test/test_suite/lambda/ct_lambda2.c3t index 6b77b3178..52f261f08 100644 --- a/test/test_suite/lambda/ct_lambda2.c3t +++ b/test/test_suite/lambda/ct_lambda2.c3t @@ -33,7 +33,7 @@ fn int main() @.str.11 = private unnamed_addr constant [4 x i8] c"int\00", align 1 @.str.13 = private unnamed_addr constant [4 x i8] c"int\00", align 1 -; Function Attrs: nounwind + define i32 @main() #0 { store ptr @"main$lambda1", ptr %x, align 8 %0 = load ptr, ptr %x, align 8 diff --git a/test/test_suite/macros/macro_body_defer.c3t b/test/test_suite/macros/macro_body_defer.c3t index 99dedbb0a..d7e900d1e 100644 --- a/test/test_suite/macros/macro_body_defer.c3t +++ b/test/test_suite/macros/macro_body_defer.c3t @@ -85,7 +85,7 @@ loop.body1: ; preds = %loop.exit ret i64 0 } -; Function Attrs: nounwind + define i32 @main(i32 %0, ptr %1) #0 { entry: %blockret = alloca i32, align 4 diff --git a/test/test_suite/methods/enum_distinct_err_methods.c3t b/test/test_suite/methods/enum_distinct_err_methods.c3t index 99cc0ab68..d4ee7e08c 100644 --- a/test/test_suite/methods/enum_distinct_err_methods.c3t +++ b/test/test_suite/methods/enum_distinct_err_methods.c3t @@ -96,7 +96,7 @@ noerr_block13: ; preds = %after_check11 voiderr: ; preds = %noerr_block13, %guard_block12, %guard_block6, %guard_block ret void } -; Function Attrs: nounwind + define void @foo.Bar.hello(ptr %0) #0 { entry: %len = alloca i64, align 8 @@ -149,7 +149,7 @@ noerr_block13: ; preds = %after_check11 voiderr: ; preds = %noerr_block13, %guard_block12, %guard_block6, %guard_block ret void } -; Function Attrs: nounwind + define void @foo.MyEnum.hello(ptr %0) #0 { entry: %len = alloca i64, align 8 @@ -202,7 +202,7 @@ noerr_block13: ; preds = %after_check11 voiderr: ; preds = %noerr_block13, %guard_block12, %guard_block6, %guard_block ret void } -; Function Attrs: nounwind + define i32 @main() #0 { entry: %f = alloca i64, align 8 diff --git a/test/test_suite/pointers/pointer_index.c3t b/test/test_suite/pointers/pointer_index.c3t index c64d8e835..91991b306 100644 --- a/test/test_suite/pointers/pointer_index.c3t +++ b/test/test_suite/pointers/pointer_index.c3t @@ -44,7 +44,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @pointer_index.test2(ptr %0) #0 { entry: %a = alloca i8, 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 61b3372f6..efab5577e 100644 --- a/test/test_suite/pointers/subarray_variant_to_ptr.c3t +++ b/test/test_suite/pointers/subarray_variant_to_ptr.c3t @@ -47,7 +47,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @foo.test2(ptr %0, i64 %1) #0 { entry: %z = alloca %"int[]", align 8 diff --git a/test/test_suite/safe/deref.c3t b/test/test_suite/safe/deref.c3t index 127d3eb1d..4de8e3e7d 100644 --- a/test/test_suite/safe/deref.c3t +++ b/test/test_suite/safe/deref.c3t @@ -18,11 +18,13 @@ entry: %0 = load ptr, ptr %x, align 8 %checknull = icmp eq ptr %0, null br i1 %checknull, label %panic, label %checkok + panic: ; preds = %entry %1 = load ptr, ptr @std.core.builtin.panic, align 8 call void %1(ptr @.panic_msg, i64 42, ptr @.file, i64 8, ptr @.func, i64 4, i32 6) - br label %checkok -checkok: ; preds = %panic, %entry + unreachable + +checkok: ; preds = %entry %2 = load i32, ptr %0, align 4 store i32 %2, ptr %y, align 4 ret void diff --git a/test/test_suite/slices/slice_assign.c3t b/test/test_suite/slices/slice_assign.c3t index 5e26d4771..16a8f46d9 100644 --- a/test/test_suite/slices/slice_assign.c3t +++ b/test/test_suite/slices/slice_assign.c3t @@ -20,7 +20,7 @@ fn void main() @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 -; Function Attrs: nounwind + declare void @printf(ptr, ...) #0 define void @test.main() #0 { @@ -81,7 +81,7 @@ exit: ; preds = %cond ret void } -; Function Attrs: nounwind + define i32 @main(i32 %0, ptr %1) #0 { entry: call void @test.main() diff --git a/test/test_suite/statements/custom_foreach_with_ref.c3t b/test/test_suite/statements/custom_foreach_with_ref.c3t index 18c279767..a9390dfa2 100644 --- a/test/test_suite/statements/custom_foreach_with_ref.c3t +++ b/test/test_suite/statements/custom_foreach_with_ref.c3t @@ -103,10 +103,10 @@ fn void main() @.str.13 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 @.str.14 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 -; Function Attrs: nounwind + declare void @printf(ptr, ...) #0 -; Function Attrs: nounwind + define void @foo.getFields(ptr noalias sret([5 x i32]) align 4 %0) #0 { entry: %literal = alloca [5 x i32], align 16 @@ -116,14 +116,14 @@ entry: ret void } -; Function Attrs: nounwind + define ptr @foo.call(ptr %0) #0 { entry: call void (ptr, ...) @printf(ptr @.str.1) ret ptr %0 } -; Function Attrs: nounwind + define void @foo.main() #0 { entry: %x = alloca %Foo, align 4 diff --git a/test/test_suite/statements/defer_in_block.c3t b/test/test_suite/statements/defer_in_block.c3t index 46b3c9954..153f72d48 100644 --- a/test/test_suite/statements/defer_in_block.c3t +++ b/test/test_suite/statements/defer_in_block.c3t @@ -77,7 +77,7 @@ if.exit6: ; preds = %if.exit3 ret void } -; Function Attrs: nounwind + define void @foo.main() #0 { entry: call void @foo.test(i32 123) diff --git a/test/test_suite/statements/foreach_custom.c3t b/test/test_suite/statements/foreach_custom.c3t index 5b0fce27b..a096e4dbf 100644 --- a/test/test_suite/statements/foreach_custom.c3t +++ b/test/test_suite/statements/foreach_custom.c3t @@ -33,7 +33,7 @@ extern fn int printf(char *fmt, ...); /* #expect: test.ll -; Function Attrs: nounwind + define void @test.main() #0 { entry: %i = alloca [3 x i32], align 4 @@ -81,10 +81,10 @@ loop.exit: ; preds = %loop.body2, %loop.c ret void } -; Function Attrs: nounwind + declare i32 @printf(ptr, ...) #0 -; Function Attrs: nounwind + define i32 @main(i32 %0, ptr %1) #0 { entry: call void @test.main() diff --git a/test/test_suite/statements/foreach_custom_macro.c3t b/test/test_suite/statements/foreach_custom_macro.c3t index c100c6b30..77f659151 100644 --- a/test/test_suite/statements/foreach_custom_macro.c3t +++ b/test/test_suite/statements/foreach_custom_macro.c3t @@ -39,7 +39,7 @@ extern fn int printf(char *fmt, ...); @.__const = private unnamed_addr constant [3 x i32] [i32 1, i32 3, i32 10], align 4 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 -; Function Attrs: nounwind + define void @foo.main() #0 { entry: %i = alloca [3 x i32], align 4 @@ -87,10 +87,10 @@ loop.exit: ; preds = %loop.body2, %loop.c ret void } -; Function Attrs: nounwind + declare i32 @printf(ptr, ...) #0 -; Function Attrs: nounwind + define i32 @main(i32 %0, ptr %1) #0 { entry: call void @foo.main() diff --git a/test/test_suite/statements/foreach_r_break.c3t b/test/test_suite/statements/foreach_r_break.c3t index 2813f5f36..4dcff9524 100644 --- a/test/test_suite/statements/foreach_r_break.c3t +++ b/test/test_suite/statements/foreach_r_break.c3t @@ -15,7 +15,7 @@ fn void test() /* #expect: test.ll -; Function Attrs: nounwind + define void @test.test() #0 { entry: %x = alloca [3 x i32], align 4 diff --git a/test/test_suite/statements/foreach_r_custom.c3t b/test/test_suite/statements/foreach_r_custom.c3t index 906f0d596..711679c92 100644 --- a/test/test_suite/statements/foreach_r_custom.c3t +++ b/test/test_suite/statements/foreach_r_custom.c3t @@ -33,7 +33,7 @@ extern fn int printf(char *fmt, ...); /* #expect: test.ll -; Function Attrs: nounwind + define void @test.main() #0 { entry: %i = alloca [3 x i32], align 4 @@ -81,10 +81,10 @@ loop.exit: ; preds = %loop.body1, %loop.c ret void } -; Function Attrs: nounwind + declare i32 @printf(ptr, ...) #0 -; Function Attrs: nounwind + define i32 @main(i32 %0, ptr %1) #0 { entry: call void @test.main() diff --git a/test/test_suite/statements/foreach_r_custom_macro.c3t b/test/test_suite/statements/foreach_r_custom_macro.c3t index 1cd7d4b99..52d6933ad 100644 --- a/test/test_suite/statements/foreach_r_custom_macro.c3t +++ b/test/test_suite/statements/foreach_r_custom_macro.c3t @@ -32,7 +32,7 @@ extern fn int printf(char *fmt, ...); /* #expect: test.ll -; Function Attrs: nounwind + define void @test.main() #0 { entry: %i = alloca [3 x i32], align 4 @@ -80,10 +80,10 @@ loop.exit: ; preds = %loop.body1, %loop.c ret void } -; Function Attrs: nounwind + declare i32 @printf(ptr, ...) #0 -; Function Attrs: nounwind + define i32 @main(i32 %0, ptr %1) #0 { entry: call void @test.main() diff --git a/test/test_suite/statements/ranged_switch.c3t b/test/test_suite/statements/ranged_switch.c3t index 72dc3528e..74ccfd861 100644 --- a/test/test_suite/statements/ranged_switch.c3t +++ b/test/test_suite/statements/ranged_switch.c3t @@ -63,10 +63,10 @@ target triple = "x86_64-apple @.str.8 = private unnamed_addr constant [11 x i8] c"Was true!\0A\00", align 1 @.str.9 = private unnamed_addr constant [12 x i8] c"Was false!\0A\00", align 1 -; Function Attrs: nounwind + declare void @printf(ptr, ...) #0 -; Function Attrs: nounwind + define void @foo.main() #0 { entry: %i = alloca i32, align 4 @@ -220,7 +220,7 @@ switch.exit31: ; preds = %next_if30, %switch. ret void } -; Function Attrs: nounwind + define i32 @main(i32 %0, ptr %1) #0 { entry: call void @foo.main() diff --git a/test/test_suite/statements/simple_do.c3t b/test/test_suite/statements/simple_do.c3t index e1e5345b2..34fcae25a 100644 --- a/test/test_suite/statements/simple_do.c3t +++ b/test/test_suite/statements/simple_do.c3t @@ -34,7 +34,7 @@ target triple = "x86_64-apple @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%d, %d\0A\00", align 1 -; Function Attrs: nounwind + define i32 @foo.test() #0 { entry: %0 = load i32, ptr @test.x, align 4 @@ -44,10 +44,10 @@ entry: ret i32 %add1 } -; Function Attrs: nounwind + declare void @printf(ptr, ...) #0 -; Function Attrs: nounwind + define void @foo.main() #0 { entry: %i = alloca i32, align 4 @@ -104,7 +104,7 @@ loop.exit6: ; preds = %if.then4, %loop.con ret void } -; Function Attrs: nounwind + define i32 @main(i32 %0, ptr %1) #0 { entry: call void @foo.main() diff --git a/test/test_suite/statements/various_switching.c3t b/test/test_suite/statements/various_switching.c3t index 185d7aaea..975a43cf1 100644 --- a/test/test_suite/statements/various_switching.c3t +++ b/test/test_suite/statements/various_switching.c3t @@ -289,7 +289,7 @@ switch.exit45: ; preds = %switch.default44, % ret void } -; Function Attrs: nounwind + define void @mymodule.main() #0 { entry: call void @mymodule.test() diff --git a/test/test_suite/statements/while_switch.c3t b/test/test_suite/statements/while_switch.c3t index 80441557f..eb21d8b15 100644 --- a/test/test_suite/statements/while_switch.c3t +++ b/test/test_suite/statements/while_switch.c3t @@ -37,13 +37,13 @@ target triple = "x86_64-apple @.str = private unnamed_addr constant [2 x i8] c"3\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c"4\00", align 1 -; Function Attrs: nounwind + declare i32 @printf(ptr, ...) #0 -; Function Attrs: nounwind + declare i32 @foo() #0 -; Function Attrs: nounwind + define i32 @main() #0 { entry: %switch = alloca i32, align 4 diff --git a/test/test_suite/stdlib/map.c3t b/test/test_suite/stdlib/map.c3t index 2dee1d6f6..49eb1039f 100644 --- a/test/test_suite/stdlib/map.c3t +++ b/test/test_suite/stdlib/map.c3t @@ -86,7 +86,7 @@ entry: ret { ptr, i64 } %17 } -; Function Attrs: nounwind + define void @test.main() #0 { entry: %map = alloca %HashMap, align 8 diff --git a/test/test_suite/strings/literal_to_subarray.c3t b/test/test_suite/strings/literal_to_subarray.c3t index 77580f172..141707113 100644 --- a/test/test_suite/strings/literal_to_subarray.c3t +++ b/test/test_suite/strings/literal_to_subarray.c3t @@ -15,7 +15,7 @@ fn void test() @literal_to_subarray.y = local_unnamed_addr global %"char[]" { ptr @.str, i64 5 }, align 8 @.str.1 = private unnamed_addr constant [6 x i8] c"world\00", align 1 -; Function Attrs: nounwind + define void @literal_to_subarray.test() #0 { entry: %x = alloca %"char[]", align 8 diff --git a/test/test_suite/struct/nested_struct_init.c3t b/test/test_suite/struct/nested_struct_init.c3t index 359ac7e27..ab82f76c9 100644 --- a/test/test_suite/struct/nested_struct_init.c3t +++ b/test/test_suite/struct/nested_struct_init.c3t @@ -48,7 +48,7 @@ fn void main() @.__const.8 = private unnamed_addr constant %Matrix2x2_b { %.anon.1 { [4 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00] } }, align 4 @.str = private unnamed_addr constant [13 x i8] c"%f %f %f %f\0A\00", align 1 -; Function Attrs: nounwind + define void @foo.main() #0 { entry: %m = alloca %Matrix2x2, align 4 diff --git a/test/test_suite/switch/switch_in_defer_macro.c3t b/test/test_suite/switch/switch_in_defer_macro.c3t index a47cd1e4e..bf2cf218c 100644 --- a/test/test_suite/switch/switch_in_defer_macro.c3t +++ b/test/test_suite/switch/switch_in_defer_macro.c3t @@ -711,7 +711,7 @@ fn void test() @"$ct.std.io.ByteReader" = linkonce global %.introspect { i8 10, i64 0, ptr null, i64 24, i64 0, i64 2, [0 x i64] zeroinitializer }, align 8 @std.core.mem.thread_allocator = external thread_local global %"any*", align 8 -; Function Attrs: nounwind + define zeroext i8 @lexer_test.is_ident_char(i64 %0, i8 zeroext %1) #0 { entry: %eq = icmp eq i64 0, %0 @@ -745,7 +745,7 @@ or.phi: ; preds = %and.phi2, %and.phi ret i8 %6 } -; Function Attrs: nounwind + define i64 @lexer_test.lex_uint() #0 { entry: %tcases = alloca %"UintTest[]", align 8 diff --git a/test/test_suite/vector/vector_bit.c3t b/test/test_suite/vector/vector_bit.c3t index d9428c1f6..cb08e581a 100644 --- a/test/test_suite/vector/vector_bit.c3t +++ b/test/test_suite/vector/vector_bit.c3t @@ -59,7 +59,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @vector_bit.testi() #0 { entry: %y = alloca <4 x i32>, align 16 diff --git a/test/test_suite/vector/vector_incdec.c3t b/test/test_suite/vector/vector_incdec.c3t index c9bd25e1e..52e3f2c4a 100644 --- a/test/test_suite/vector/vector_incdec.c3t +++ b/test/test_suite/vector/vector_incdec.c3t @@ -112,7 +112,7 @@ entry: ret void } -; Function Attrs: nounwind + define void @vector_incdec.testi() #0 { entry: %y = alloca <4 x i32>, align 16 diff --git a/test/test_suite/vector/vector_init.c3t b/test/test_suite/vector/vector_init.c3t index 402fbd9bc..18469b719 100644 --- a/test/test_suite/vector/vector_init.c3t +++ b/test/test_suite/vector/vector_init.c3t @@ -16,7 +16,7 @@ fn void main() @vector_init.baz = local_unnamed_addr global <4 x i32> , align 16 -; Function Attrs: nounwind + define void @vector_init.main() #0 { entry: %foo = alloca <4 x i32>, align 16 diff --git a/test/test_suite/vector/vector_ops2.c3t b/test/test_suite/vector/vector_ops2.c3t index bf6648dea..d5ec15a6a 100644 --- a/test/test_suite/vector/vector_ops2.c3t +++ b/test/test_suite/vector/vector_ops2.c3t @@ -23,7 +23,7 @@ fn void testi() /* #expect: test.ll -; Function Attrs: nounwind + define void @test.testf() #0 { entry: %y = alloca <4 x float>, align 16 @@ -45,9 +45,9 @@ entry: panic: ; preds = %entry %6 = load ptr, ptr @std.core.builtin.panic, align 8 call void %6(ptr @.panic_msg, i64 17, ptr @.file, i64 14, ptr @.func, i64 5, i32 9) - br label %checkok + unreachable -checkok: ; preds = %panic, %entry +checkok: ; preds = %entry %fdiv = fdiv <4 x float> %2, %3 store <4 x float> %fdiv, ptr %w, align 16 ret void