Merge pull request #11079 from Vexu/stage2
stage2: make references to const allocs const
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const foo = @typeInfo(@This()).Struct.decls;
|
||||
export const foo: c_int = @boolToInt(@typeInfo(@This()).Struct.is_tuple);
|
||||
|
||||
Reference in New Issue
Block a user