From 186126c2a4032424e1b1cdb8ac379fb2beab7429 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 15 Oct 2021 17:17:59 -0700 Subject: stage2: make hasCodeGenBits() always true for pointers * LLVM backend: The `alloc` AIR instruction as well as pointer constants which point to a 0-bit element type now call a common codepath to produce a `*const llvm.Value` which is a non-zero pointer with a bogus-but-properly-aligned address. * LLVM backend: improve the lowering of optional types. * Type: `hasCodeGenBits()` now returns `true` for pointers even when it returns `false` for their element types. Effectively, #6706 is now implemented in stage2 but not stage1. --- test/behavior/basic.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/behavior/basic.zig') diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig index 23b0970191..ae4cb26354 100644 --- a/test/behavior/basic.zig +++ b/test/behavior/basic.zig @@ -246,7 +246,7 @@ fn testTakeAddressOfParameter(f: f32) !void { } test "pointer to void return type" { - testPointerToVoidReturnType() catch unreachable; + try testPointerToVoidReturnType(); } fn testPointerToVoidReturnType() anyerror!void { const a = testPointerToVoidReturnType2(); -- cgit v1.2.3