mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 16:12:33 +00:00
stage2 ARM: enable a handful of passing behavior tests
This commit is contained in:
parent
6f87f49f3d
commit
4468abfc42
@ -22,14 +22,10 @@ test "global variable alignment" {
|
||||
}
|
||||
|
||||
test "default alignment allows unspecified in type syntax" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
try expect(*u32 == *align(@alignOf(u32)) u32);
|
||||
}
|
||||
|
||||
test "implicitly decreasing pointer alignment" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
const a: u32 align(4) = 3;
|
||||
const b: u32 align(8) = 4;
|
||||
try expect(addUnaligned(&a, &b) == 7);
|
||||
@ -40,8 +36,6 @@ fn addUnaligned(a: *align(1) const u32, b: *align(1) const u32) u32 {
|
||||
}
|
||||
|
||||
test "@alignCast pointers" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
var x: u32 align(4) = 1;
|
||||
expectsOnly1(&x);
|
||||
try expect(x == 2);
|
||||
@ -54,8 +48,6 @@ fn expects4(x: *align(4) u32) void {
|
||||
}
|
||||
|
||||
test "alignment of structs" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
try expect(@alignOf(struct {
|
||||
a: i32,
|
||||
b: *i32,
|
||||
@ -63,15 +55,11 @@ test "alignment of structs" {
|
||||
}
|
||||
|
||||
test "alignment of >= 128-bit integer type" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
try expect(@alignOf(u128) == 16);
|
||||
try expect(@alignOf(u129) == 16);
|
||||
}
|
||||
|
||||
test "alignment of struct with 128-bit field" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
try expect(@alignOf(struct {
|
||||
x: u128,
|
||||
}) == 16);
|
||||
@ -84,8 +72,6 @@ test "alignment of struct with 128-bit field" {
|
||||
}
|
||||
|
||||
test "size of extern struct with 128-bit field" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
try expect(@sizeOf(extern struct {
|
||||
x: u128,
|
||||
y: u8,
|
||||
@ -100,8 +86,6 @@ test "size of extern struct with 128-bit field" {
|
||||
}
|
||||
|
||||
test "@ptrCast preserves alignment of bigger source" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
var x: u32 align(16) = 1234;
|
||||
const ptr = @ptrCast(*u8, &x);
|
||||
try expect(@TypeOf(ptr) == *align(16) u8);
|
||||
|
@ -22,7 +22,6 @@ test "@alignOf(T) before referencing T" {
|
||||
|
||||
test "comparison of @alignOf(T) against zero" {
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
{
|
||||
const T = struct { x: u32 };
|
||||
|
@ -76,7 +76,6 @@ test "@bitCast packed structs at runtime and comptime" {
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
const Full = packed struct {
|
||||
number: u16,
|
||||
@ -113,7 +112,6 @@ test "@bitCast extern structs at runtime and comptime" {
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
const Full = extern struct {
|
||||
number: u16,
|
||||
@ -147,7 +145,6 @@ test "bitcast packed struct to integer and back" {
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
const LevelUpMove = packed struct {
|
||||
move_id: u9,
|
||||
@ -184,7 +181,6 @@ test "bitcast packed struct literal to byte" {
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
const Foo = packed struct {
|
||||
value: u8,
|
||||
@ -198,7 +194,6 @@ test "comptime bitcast used in expression has the correct type" {
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
const Foo = packed struct {
|
||||
value: u8,
|
||||
@ -211,7 +206,6 @@ test "bitcast passed as tuple element" {
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
const S = struct {
|
||||
fn foo(args: anytype) !void {
|
||||
|
@ -10,7 +10,6 @@ fn getA() A {
|
||||
|
||||
test "bug 1025" {
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
const a = getA();
|
||||
try @import("std").testing.expect(a.B == u8);
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ const B = *const fn (A) void;
|
||||
|
||||
test "allow these dependencies" {
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
var a: A = undefined;
|
||||
var b: B = undefined;
|
||||
|
@ -166,7 +166,6 @@ test "generic fn keeps non-generic parameter types" {
|
||||
|
||||
test "array of generic fns" {
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
try expect(foos[0](true));
|
||||
try expect(!foos[1](true));
|
||||
@ -186,7 +185,6 @@ fn foo2(arg: anytype) bool {
|
||||
|
||||
test "generic struct" {
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
var a1 = GenNode(i32){
|
||||
.value = 13,
|
||||
|
@ -4,7 +4,6 @@ const expect = std.testing.expect;
|
||||
|
||||
test "namespace depends on compile var" {
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (some_namespace.a_bool) {
|
||||
try expect(some_namespace.a_bool);
|
||||
|
Loading…
Reference in New Issue
Block a user