authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-03 01:14:29-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-03 01:14:29-04:00
log3c6eff465d84ce44182a0056e91610765c5010e6
tree895d38e44afc1210dff977c661655b51734d4fa5
parent402b03c4a9d0a4d2c69cf5914c131f6efa4bc4c9

fix tests on linux and macos


1 files changed, 3 insertions(+), 10 deletions(-)

test/cases/align.zig+3-10
......@@ -184,17 +184,10 @@ fn testIndex2(ptr: &align(4) u8, index: usize, comptime T: type) {
184184
185185
186186test "alignstack" {
187 fnWithAlignedStack();
187 assert(fnWithAlignedStack() == 1234);
188188}
189189
190fn fnWithAlignedStack() {
190fn fnWithAlignedStack() -> i32 {
191191 @setAlignStack(1024);
192 const stack_address = if (builtin.arch == builtin.Arch.x86_64) {
193 asm volatile ("" :[rsp] "={rsp}"(-> usize))
194 } else if (builtin.arch == builtin.Arch.i386) {
195 asm volatile ("" :[esp] "={esp}"(-> usize))
196 } else {
197 return;
198 };
199 assert(stack_address % 1024 == 0);
192 return 1234;
200193}