aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/offsetOf-non_struct.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/offsetOf-non_struct.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/offsetOf-non_struct.zig')
-rw-r--r--test/cases/compile_errors/offsetOf-non_struct.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/cases/compile_errors/offsetOf-non_struct.zig b/test/cases/compile_errors/offsetOf-non_struct.zig
new file mode 100644
index 0000000000..45e9cf9518
--- /dev/null
+++ b/test/cases/compile_errors/offsetOf-non_struct.zig
@@ -0,0 +1,10 @@
+const Foo = i32;
+export fn foo() usize {
+ return @offsetOf(Foo, "a",);
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :3:22: error: expected struct type, found 'i32'