aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-08-26 13:29:24 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-08-26 13:29:24 -0400
commite726925e802eddab53cbfd9aacbc5eefe95c356f (patch)
treedd32cbabb1e04929090761bb1129c8b27ee38ce1 /test
parent3a4ea41fe891b5b0b9b50cb80200a392e20cc31f (diff)
downloadzig-e726925e802eddab53cbfd9aacbc5eefe95c356f.tar.gz
zig-e726925e802eddab53cbfd9aacbc5eefe95c356f.zip
remove @alignOf and add @cAbiAlignOf and @preferredAlignOf
See #396
Diffstat (limited to 'test')
-rw-r--r--test/cases/alignof.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/cases/alignof.zig b/test/cases/alignof.zig
index 27b95c7fdc..97f8efe503 100644
--- a/test/cases/alignof.zig
+++ b/test/cases/alignof.zig
@@ -3,9 +3,12 @@ const builtin = @import("builtin");
const Foo = struct { x: u32, y: u32, z: u32, };
-test "@alignOf(T) before referencing T" {
- comptime assert(@alignOf(Foo) != @maxValue(usize));
+test "@abiAlignOf(T) before referencing T" {
+ comptime assert(@cAbiAlignOf(Foo) != @maxValue(usize));
if (builtin.arch == builtin.Arch.x86_64) {
- comptime assert(@alignOf(Foo) == 4);
+ comptime {
+ assert(@cAbiAlignOf(Foo) == 4);
+ assert(@preferredAlignOf(Foo) == 8);
+ }
}
}