spirv: implement pointer comparison in for air cmp
It turns out that the Khronos LLVM SPIRV translator does not support OpPtrEqual. Therefore, this instruction is emitted using a series of conversions. This commit breaks intToEnum, because enum was removed from the arithmetic type info. The enum should be converted to an int before this function is called.
This commit is contained in:
@@ -134,21 +134,18 @@ fn first4KeysOfHomeRow() []const u8 {
|
||||
|
||||
test "return string from function" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
try expect(mem.eql(u8, first4KeysOfHomeRow(), "aoeu"));
|
||||
}
|
||||
|
||||
test "hex escape" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
try expect(mem.eql(u8, "\x68\x65\x6c\x6c\x6f", "hello"));
|
||||
}
|
||||
|
||||
test "multiline string" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
const s1 =
|
||||
\\one
|
||||
@@ -161,7 +158,6 @@ test "multiline string" {
|
||||
|
||||
test "multiline string comments at start" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
const s1 =
|
||||
//\\one
|
||||
@@ -174,7 +170,6 @@ test "multiline string comments at start" {
|
||||
|
||||
test "multiline string comments at end" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
const s1 =
|
||||
\\one
|
||||
@@ -187,7 +182,6 @@ test "multiline string comments at end" {
|
||||
|
||||
test "multiline string comments in middle" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
const s1 =
|
||||
\\one
|
||||
@@ -200,7 +194,6 @@ test "multiline string comments in middle" {
|
||||
|
||||
test "multiline string comments at multiple places" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
const s1 =
|
||||
\\one
|
||||
@@ -214,14 +207,11 @@ test "multiline string comments at multiple places" {
|
||||
}
|
||||
|
||||
test "string concatenation simple" {
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
try expect(mem.eql(u8, "OK" ++ " IT " ++ "WORKED", "OK IT WORKED"));
|
||||
}
|
||||
|
||||
test "array mult operator" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
try expect(mem.eql(u8, "ab" ** 5, "ababababab"));
|
||||
}
|
||||
@@ -387,7 +377,6 @@ test "take address of parameter" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
try testTakeAddressOfParameter(12.34);
|
||||
}
|
||||
@@ -690,8 +679,6 @@ test "explicit cast optional pointers" {
|
||||
}
|
||||
|
||||
test "pointer comparison" {
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
const a = @as([]const u8, "a");
|
||||
const b = &a;
|
||||
try expect(ptrEql(b, b));
|
||||
@@ -892,8 +879,6 @@ test "catch in block has correct result location" {
|
||||
}
|
||||
|
||||
test "labeled block with runtime branch forwards its result location type to break statements" {
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
const E = enum { a, b };
|
||||
var a = false;
|
||||
const e: E = blk: {
|
||||
@@ -1062,8 +1047,6 @@ test "switch inside @as gets correct type" {
|
||||
}
|
||||
|
||||
test "inline call of function with a switch inside the return statement" {
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
const S = struct {
|
||||
inline fn foo(x: anytype) @TypeOf(x) {
|
||||
return switch (x) {
|
||||
|
||||
Reference in New Issue
Block a user