diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-03-27 23:55:19 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-03-27 23:55:19 -0700 |
| commit | 68f4eb0f67b6e5f7c20332e79c8e8decb07748ee (patch) | |
| tree | 7830086e80412e46fecee38de9c6c43844dbc4be /test | |
| parent | 95cc457d977c3a4671adfe61d482465cd262d17f (diff) | |
| download | zig-68f4eb0f67b6e5f7c20332e79c8e8decb07748ee.tar.gz zig-68f4eb0f67b6e5f7c20332e79c8e8decb07748ee.zip | |
stage2: fully implement Type.eql for pointers
Also fixed abiAlignment - for pointers it was returning the abi
alignment inside the type, rather than of the pointer itself. There is
now `ptrAlignment` for getting the alignment inside the type of
pointers.
Diffstat (limited to 'test')
| -rw-r--r-- | test/stage2/test.zig | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/test/stage2/test.zig b/test/stage2/test.zig index 6df8789334..6628db9ed5 100644 --- a/test/stage2/test.zig +++ b/test/stage2/test.zig @@ -1502,27 +1502,27 @@ pub fn addCases(ctx: *TestContext) !void { "", ); - //case.addCompareOutput( - // \\export fn _start() noreturn { - // \\ const a: anyerror!comptime_int = 42; - // \\ const b: *const comptime_int = &(a catch unreachable); - // \\ assert(b.* == 42); - // \\ - // \\ exit(); - // \\} - // \\fn assert(b: bool) void { - // \\ if (!b) unreachable; // assertion failure - // \\} - // \\fn exit() noreturn { - // \\ asm volatile ("syscall" - // \\ : - // \\ : [number] "{rax}" (231), - // \\ [arg1] "{rdi}" (0) - // \\ : "rcx", "r11", "memory" - // \\ ); - // \\ unreachable; - // \\} - //, ""); + case.addCompareOutput( + \\export fn _start() noreturn { + \\ const a: anyerror!comptime_int = 42; + \\ const b: *const comptime_int = &(a catch unreachable); + \\ assert(b.* == 42); + \\ + \\ exit(); + \\} + \\fn assert(b: bool) void { + \\ if (!b) unreachable; // assertion failure + \\} + \\fn exit() noreturn { + \\ asm volatile ("syscall" + \\ : + \\ : [number] "{rax}" (231), + \\ [arg1] "{rdi}" (0) + \\ : "rcx", "r11", "memory" + \\ ); + \\ unreachable; + \\} + , ""); case.addCompareOutput( \\export fn _start() noreturn { |
