diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-10-15 16:49:59 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-10-21 21:38:41 -0400 |
| commit | ecfb18286a5270943382effdf383bae4546b184f (patch) | |
| tree | a0f2853e50a26ab2d7e98f92cde006ac66de022a /test/behavior | |
| parent | 3cd3052d4d303dbae7d517fa40f6d171c957afdd (diff) | |
| download | zig-ecfb18286a5270943382effdf383bae4546b184f.tar.gz zig-ecfb18286a5270943382effdf383bae4546b184f.zip | |
migrate make_ptr_const to new anonymous decl mechanism
Instead of creating Module.Decl objects, directly create InternPool
pointer values using the anon_decl Addr encoding.
The LLVM backend needed code to notice the alignment of the pointer and
lower accordingly. The other backends likely need a similar change.
Diffstat (limited to 'test/behavior')
| -rw-r--r-- | test/behavior/align.zig | 9 | ||||
| -rw-r--r-- | test/behavior/bugs/1741.zig | 11 |
2 files changed, 9 insertions, 11 deletions
diff --git a/test/behavior/align.zig b/test/behavior/align.zig index 00fbfc2cb5..217d0b7c15 100644 --- a/test/behavior/align.zig +++ b/test/behavior/align.zig @@ -15,6 +15,15 @@ test "global variable alignment" { } } +test "large alignment of local constant" { + if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; + if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; + if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // flaky + + const x: f32 align(128) = 12.34; + try std.testing.expect(@intFromPtr(&x) % 128 == 0); +} + test "slicing array of length 1 can not assume runtime index is always zero" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO diff --git a/test/behavior/bugs/1741.zig b/test/behavior/bugs/1741.zig deleted file mode 100644 index f4da8e5c2e..0000000000 --- a/test/behavior/bugs/1741.zig +++ /dev/null @@ -1,11 +0,0 @@ -const std = @import("std"); -const builtin = @import("builtin"); - -test "fixed" { - if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // flaky - - const x: f32 align(128) = 12.34; - try std.testing.expect(@intFromPtr(&x) % 128 == 0); -} |
