Merge pull request #11079 from Vexu/stage2

stage2: make references to const allocs const
This commit is contained in:
Andrew Kelley
2022-03-08 13:49:29 -05:00
committed by GitHub
8 changed files with 42 additions and 18 deletions

View File

@@ -54,8 +54,6 @@ test "pointer-to-array constness for zero-size elements, var" {
}
test "pointer-to-array constness for zero-size elements, const" {
if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
try constant();
comptime try constant();
}

View File

@@ -1,4 +1,5 @@
const std = @import("std");
const builtin = @import("builtin");
const mem = std.mem;
const expect = std.testing.expect;
const Keys = struct {
@@ -9,6 +10,10 @@ const Keys = struct {
};
var keys: Keys = undefined;
test "zero keys with @memset" {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
@memset(@ptrCast([*]u8, &keys), 0, @sizeOf(@TypeOf(keys)));
try expect(!keys.up);
try expect(!keys.down);

View File

@@ -1 +1 @@
export const foo = @typeInfo(@This()).Struct.decls;
export const foo: c_int = @boolToInt(@typeInfo(@This()).Struct.is_tuple);