diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-08-29 16:52:31 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-08-29 16:52:31 -0400 |
| commit | 816689a3b1c98ec008438e7f868e1a123889b2a7 (patch) | |
| tree | 84dcf5e1cb51689543fea4c39b4c9f24dde681e9 /test/compare_output.zig | |
| parent | be94299666e57486be6bdb8fee2b79dbf3623c5d (diff) | |
| download | zig-816689a3b1c98ec008438e7f868e1a123889b2a7.tar.gz zig-816689a3b1c98ec008438e7f868e1a123889b2a7.zip | |
ptrCast gives compile error for increasing alignment
See #37
Diffstat (limited to 'test/compare_output.zig')
| -rw-r--r-- | test/compare_output.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/compare_output.zig b/test/compare_output.zig index bf2255881b..39318c31a0 100644 --- a/test/compare_output.zig +++ b/test/compare_output.zig @@ -262,8 +262,8 @@ pub fn addCases(cases: &tests.CompareOutputContext) { \\const c = @cImport(@cInclude("stdlib.h")); \\ \\export fn compare_fn(a: ?&const c_void, b: ?&const c_void) -> c_int { - \\ const a_int = @ptrCast(&i32, a ?? unreachable); - \\ const b_int = @ptrCast(&i32, b ?? unreachable); + \\ const a_int = @ptrCast(&align 1 i32, a ?? unreachable); + \\ const b_int = @ptrCast(&align 1 i32, b ?? unreachable); \\ if (*a_int < *b_int) { \\ -1 \\ } else if (*a_int > *b_int) { |
