aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/local_variable_shadowing_global.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-06-27 18:32:59 +0300
committerJakub Konka <kubkon@jakubkonka.com>2022-06-30 09:57:38 +0200
commit3204d00a5e7fe119b690e921138a439fb84dff5b (patch)
tree40dba7f0816a1a8cae35657aa0d6bcb0ec19b6ba /test/cases/compile_errors/local_variable_shadowing_global.zig
parentc248af3bdcd17c334e742d53a7ac7bda2422a688 (diff)
downloadzig-3204d00a5e7fe119b690e921138a439fb84dff5b.tar.gz
zig-3204d00a5e7fe119b690e921138a439fb84dff5b.zip
move passing stage1 compile error tests to stage2
Diffstat (limited to 'test/cases/compile_errors/local_variable_shadowing_global.zig')
-rw-r--r--test/cases/compile_errors/local_variable_shadowing_global.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/cases/compile_errors/local_variable_shadowing_global.zig b/test/cases/compile_errors/local_variable_shadowing_global.zig
new file mode 100644
index 0000000000..1320bfcb41
--- /dev/null
+++ b/test/cases/compile_errors/local_variable_shadowing_global.zig
@@ -0,0 +1,14 @@
+const Foo = struct {};
+const Bar = struct {};
+
+export fn entry() void {
+ var Bar : i32 = undefined;
+ _ = Bar;
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :5:9: error: local shadows declaration of 'Bar'
+// :2:1: note: declared here