diff --git a/src/compiler/sema_expr.c b/src/compiler/sema_expr.c index f2f6a8dc3..5e4917988 100644 --- a/src/compiler/sema_expr.c +++ b/src/compiler/sema_expr.c @@ -954,7 +954,7 @@ static inline bool sema_cast_ident_rvalue(SemaContext *context, Expr *expr) switch (decl->decl_kind) { case DECL_FUNC: - SEMA_ERROR(expr, "A function name cannot be used as a value, did you want to pass it by pointer? If so then you need to add '&', like '&%s'.", decl->span); + SEMA_ERROR(expr, "A function name cannot be used as a value, did you want to pass it by pointer? If so then you need to add '&', like '&%s'.", decl->name); return expr_poison(expr); case DECL_MACRO: SEMA_ERROR(expr, "Expected a macro followed by (...)."); diff --git a/test/test_suite/assert/unreachable_in_assign.c3t b/test/test_suite/assert/unreachable_in_assign.c3t index 937a6d766..6895a9f75 100644 --- a/test/test_suite/assert/unreachable_in_assign.c3t +++ b/test/test_suite/assert/unreachable_in_assign.c3t @@ -26,9 +26,13 @@ entry: %x = alloca i32, align 4 %blockret = alloca i32, align 4 unreachable + +after_macro: ; No predecessors! + store i32 poison, ptr %x, align 4 + ret void } -define i32 @main() #0 { +define i32 @test.main() #0 { entry: %x = alloca i32, align 4 %x.f = alloca i64, align 8 diff --git a/test/test_suite/assert/unreachable_in_macro.c3t b/test/test_suite/assert/unreachable_in_macro.c3t index 26c6a598c..c6f51f916 100644 --- a/test/test_suite/assert/unreachable_in_macro.c3t +++ b/test/test_suite/assert/unreachable_in_macro.c3t @@ -22,7 +22,7 @@ macro test() /* #expect: test.ll -define i32 @main() #0 { +define i32 @test.main() #0 { entry: %temp_err = alloca i64, align 8 %len = alloca i64, align 8