diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-07 00:25:32 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-07-07 00:25:32 -0400 |
| commit | d8295c188946b0f07d62420c2f08c940f70b03ac (patch) | |
| tree | 96fc4b4199546dad9010ce659673e83ced997fe4 /test/compile_errors.zig | |
| parent | e19f0b5d9c26f4d309df9cfc84b7e5dc04b10ed5 (diff) | |
| download | zig-d8295c188946b0f07d62420c2f08c940f70b03ac.tar.gz zig-d8295c188946b0f07d62420c2f08c940f70b03ac.zip | |
add @popCount intrinsic
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index d508c7c36c..9071f0ad7e 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -1,6 +1,24 @@ const tests = @import("tests.zig"); pub fn addCases(cases: *tests.CompileErrorContext) void { + cases.add( + "@popCount - non-integer", + \\export fn entry(x: f32) u32 { + \\ return @popCount(x); + \\} + , + ".tmp_source.zig:2:22: error: expected integer type, found 'f32'", + ); + + cases.add( + "@popCount - negative comptime_int", + \\comptime { + \\ _ = @popCount(-1); + \\} + , + ".tmp_source.zig:2:9: error: @popCount on negative comptime_int value -1", + ); + cases.addCase(x: { const tc = cases.create( "wrong same named struct", |
