aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
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;
\\}
,