aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/slice.zig
diff options
context:
space:
mode:
authorDaniele Cocca <daniele.cocca@gmail.com>2022-03-28 21:30:07 +0100
committerAndrew Kelley <andrew@ziglang.org>2022-03-29 02:28:20 -0400
commit8238d4b33585a715c58ab559cd001dd3ea1db55b (patch)
treef1d659627f00427fdaecaaacb80806d033a2501d /test/behavior/slice.zig
parent8df84cce8b68339c332d30213efe90cdc833d059 (diff)
downloadzig-8238d4b33585a715c58ab559cd001dd3ea1db55b.tar.gz
zig-8238d4b33585a715c58ab559cd001dd3ea1db55b.zip
CBE: fix C output after PR #11302, reenable tests
Commit 052079c99455d01312d377d72fa1b8b5c0b22aad surfaced two issues with the generated C code: - renderInt128() contained a seemingly unnecessary assertion to verify that the high 64 bits of the number were nonzero, dating back to 9bf1681990fe87a6b2e5fc644a89f1aece304579. I removed it. - renderValue() didn't have any special handling for undefined structs, falling back to printing "{}" which generated invalid expressions such as "return {}" for functions returning structs, whereas "return (S){}" is the correct form. I changed it accordingly. At the same time I'm reenabling the relevant tests.
Diffstat (limited to 'test/behavior/slice.zig')
-rw-r--r--test/behavior/slice.zig2
1 files changed, 0 insertions, 2 deletions
diff --git a/test/behavior/slice.zig b/test/behavior/slice.zig
index a9f89130a1..09d15e3ac5 100644
--- a/test/behavior/slice.zig
+++ b/test/behavior/slice.zig
@@ -74,8 +74,6 @@ fn assertLenIsZero(msg: []const u8) !void {
}
test "access len index of sentinel-terminated slice" {
- if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
-
const S = struct {
fn doTheTest() !void {
var slice: [:0]const u8 = "hello";