aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-05-20 23:06:32 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-05-20 23:06:32 -0400
commit29b488245daa9210ed9b5e1ffb7290024677f0db (patch)
tree7bcee7504f7caa5f72c8d83bbf066aa494306a70 /test/compile_errors.zig
parent051ee8e626111445c27d6c868cb0cdec6df7409e (diff)
downloadzig-29b488245daa9210ed9b5e1ffb7290024677f0db.tar.gz
zig-29b488245daa9210ed9b5e1ffb7290024677f0db.zip
add setFloatMode builtin and std.math.floor
* skip installing std/rand_test.zig as it's not needed beyond running the std lib tests * add std.math.floor function * add setFloatMode builtin function to choose between builtin.FloatMode.Optimized (default) and builtin.FloatMode.Strict (Optimized is equivalent to -ffast-math in gcc)
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index a985949b6a..999e1eaa6d 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -1835,4 +1835,22 @@ pub fn addCases(cases: &tests.CompileErrorContext) {
\\}
,
".tmp_source.zig:3:20: error: cast from 'u16' to 'u8' truncates bits");
+
+ cases.add("@setDebugSafety twice for same scope",
+ \\export fn foo() {
+ \\ @setDebugSafety(this, false);
+ \\ @setDebugSafety(this, false);
+ \\}
+ ,
+ ".tmp_source.zig:3:5: error: debug safety set twice for same scope",
+ ".tmp_source.zig:2:5: note: first set here");
+
+ cases.add("@setFloatMode twice for same scope",
+ \\export fn foo() {
+ \\ @setFloatMode(this, @import("builtin").FloatMode.Optimized);
+ \\ @setFloatMode(this, @import("builtin").FloatMode.Optimized);
+ \\}
+ ,
+ ".tmp_source.zig:3:5: error: float mode set twice for same scope",
+ ".tmp_source.zig:2:5: note: first set here");
}