aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/undefined.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-02-18 14:08:06 -0500
committerGitHub <noreply@github.com>2022-02-18 14:08:06 -0500
commit60bb1d4e1c262ff36c18cefe974aa2f773483af4 (patch)
tree159ff6e30d4f74006783bfcd76a9de7fd0acedb4 /test/behavior/undefined.zig
parent736b9dcdd60b83c07bfbdb69c62facfbe10611f1 (diff)
parent1639fd4c45ee816c7c67963fbff3513a32f5737b (diff)
downloadzig-60bb1d4e1c262ff36c18cefe974aa2f773483af4.tar.gz
zig-60bb1d4e1c262ff36c18cefe974aa2f773483af4.zip
Merge pull request #10906 from topolarity/cbe-array-support
stage2 CBE: Implement 2D array support
Diffstat (limited to 'test/behavior/undefined.zig')
-rw-r--r--test/behavior/undefined.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/behavior/undefined.zig b/test/behavior/undefined.zig
index 69fba3633d..280fbaf550 100644
--- a/test/behavior/undefined.zig
+++ b/test/behavior/undefined.zig
@@ -1,4 +1,5 @@
const std = @import("std");
+const builtin = @import("builtin");
const expect = std.testing.expect;
const mem = std.mem;
@@ -12,6 +13,10 @@ fn initStaticArray() [10]i32 {
}
const static_array = initStaticArray();
test "init static array to undefined" {
+ // This test causes `initStaticArray()` to be codegen'd, and the
+ // C backend does not yet support returning arrays, so it fails
+ if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
+
try expect(static_array[0] == 1);
try expect(static_array[4] == 2);
try expect(static_array[7] == 3);