aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/enum.zig
diff options
context:
space:
mode:
authorRobin Voetter <robin@voetter.nl>2023-05-18 02:45:21 +0200
committerRobin Voetter <robin@voetter.nl>2023-05-20 17:30:21 +0200
commit6e3770e970dbf460271a0e0cb60c2bf40a7c861e (patch)
treefa880846415c07b0d153688a1e1a7b8c35971671 /test/behavior/enum.zig
parent7077e90b3f8991c844deb08a16ad3f4e0569398f (diff)
downloadzig-6e3770e970dbf460271a0e0cb60c2bf40a7c861e.tar.gz
zig-6e3770e970dbf460271a0e0cb60c2bf40a7c861e.zip
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.
Diffstat (limited to 'test/behavior/enum.zig')
-rw-r--r--test/behavior/enum.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/behavior/enum.zig b/test/behavior/enum.zig
index 097caaad19..44a6026f2b 100644
--- a/test/behavior/enum.zig
+++ b/test/behavior/enum.zig
@@ -20,6 +20,8 @@ test "enum to int" {
}
fn testIntToEnumEval(x: i32) !void {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
try expect(@intToEnum(IntToEnumNumber, x) == IntToEnumNumber.Three);
}
const IntToEnumNumber = enum { Zero, One, Two, Three, Four };