aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorMatthew McAllister <matthew.mcallister.0@gmail.com>2019-02-14 15:54:37 -0800
committerMatthew McAllister <matthew.mcallister.0@gmail.com>2019-02-17 14:02:37 -0800
commit51783510b9b972fab52d429ff3311b0fe8402e42 (patch)
treee01041cba524688af54615406fb108247000d067 /test/compile_errors.zig
parentde18ece29436290cae3608d2c942e7e0a69f1a44 (diff)
downloadzig-51783510b9b972fab52d429ff3311b0fe8402e42.tar.gz
zig-51783510b9b972fab52d429ff3311b0fe8402e42.zip
Deduplicate compile log statement warnings
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig18
1 files changed, 16 insertions, 2 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 9ef4af4162..7953eda2ab 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -138,6 +138,20 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
);
cases.addTest(
+ "compile log statement warning deduplication in generic fn",
+ \\export fn entry() void {
+ \\ inner(1);
+ \\ inner(2);
+ \\}
+ \\fn inner(comptime n: usize) void {
+ \\ comptime var i = 0;
+ \\ inline while (i < n) : (i += 1) { @compileLog("!@#$"); }
+ \\}
+ ,
+ ".tmp_source.zig:7:39: error: found compile log statement",
+ );
+
+ cases.addTest(
"@truncate undefined value",
\\export fn entry() void {
\\ var z = @truncate(u8, u16(undefined));
@@ -4920,7 +4934,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add(
"non-printable invalid character",
- "\xff\xfe" ++
+ "\xff\xfe" ++
\\fn test() bool {\r
\\ true\r
\\}
@@ -5480,7 +5494,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
\\ Baz: void,
\\};
\\comptime {
- \\ var foo = Foo {.Baz = {}};
+ \\ var foo = Foo {.Baz = {}};
\\ const bar_val = foo.Bar;
\\}
,