aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-02-17 23:53:43 -0500
committerGitHub <noreply@github.com>2019-02-17 23:53:43 -0500
commit39207fa1d46ccaf55de80e1afd89fbccca6a73e7 (patch)
treeadc43427b2ea4a30fba1cf12c5fa8117187ebe06 /test/compile_errors.zig
parent7e549540527fec891bc67d5e657f82b7087530a3 (diff)
parentc70ee9177e5b0095c152b66fe8f22cd870e778b9 (diff)
downloadzig-39207fa1d46ccaf55de80e1afd89fbccca6a73e7.tar.gz
zig-39207fa1d46ccaf55de80e1afd89fbccca6a73e7.zip
Merge pull request #1963 from matthew-mcallister/dedup-compile-log-warning
Deduplicate compile log statement warnings
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig22
1 files changed, 20 insertions, 2 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 9ef4af4162..a18884cc9a 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -137,6 +137,24 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
".tmp_source.zig:3:15: error: C pointers cannot point to non-C-ABI-compatible type 'Foo'",
);
+ cases.addCase(x: {
+ var tc = cases.create(
+ "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",
+ );
+ tc.expect_exact = true;
+ break :x tc;
+ });
+
cases.addTest(
"@truncate undefined value",
\\export fn entry() void {
@@ -4920,7 +4938,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 +5498,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
\\ Baz: void,
\\};
\\comptime {
- \\ var foo = Foo {.Baz = {}};
+ \\ var foo = Foo {.Baz = {}};
\\ const bar_val = foo.Bar;
\\}
,