summaryrefslogtreecommitdiff
path: root/tests/metal
diff options
context:
space:
mode:
Diffstat (limited to 'tests/metal')
-rw-r--r--tests/metal/8bit-vector-types.slang24
-rw-r--r--tests/metal/byte-address-buffer.slang2
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/metal/8bit-vector-types.slang b/tests/metal/8bit-vector-types.slang
new file mode 100644
index 000000000..8bfb65fc8
--- /dev/null
+++ b/tests/metal/8bit-vector-types.slang
@@ -0,0 +1,24 @@
+//TEST:SIMPLE(filecheck=CHECK): -target metal -stage compute -entry computeMain
+
+RWStructuredBuffer<uint> outputBuffer;
+
+uint8_t2 createUChar2()
+{
+ return uint8_t2(1, 2);
+}
+
+int8_t2 createChar2()
+{
+ return int8_t2(3, 4);
+}
+
+[numthreads(1, 1, 1)]
+void computeMain()
+{
+ // CHECK: uchar2
+ // CHECK: char2
+ uint8_t2 u8v2 = createUChar2();
+ int8_t2 i8v2 = createChar2();
+
+ outputBuffer[0] = u8v2.x + i8v2.x;
+} \ No newline at end of file
diff --git a/tests/metal/byte-address-buffer.slang b/tests/metal/byte-address-buffer.slang
index 8514dafe6..c0fb6b6b2 100644
--- a/tests/metal/byte-address-buffer.slang
+++ b/tests/metal/byte-address-buffer.slang
@@ -18,7 +18,7 @@ struct TestStruct
void main_kernel(uint3 tid: SV_DispatchThreadID)
{
// CHECK: uint [[WORD0:[a-zA-Z0-9_]+]] = as_type<uint>({{.*}}[(0U)>>2]);
- // CHECK: uint8_t [[A:[a-zA-Z0-9_]+]] = uint8_t(([[WORD0]] >> 0U) & 255U);
+ // CHECK: uchar [[A:[a-zA-Z0-9_]+]] = uchar(([[WORD0]] >> 0U) & 255U);
// CHECK: uint [[WORD1:[a-zA-Z0-9_]+]] = as_type<uint>({{.*}}[(0U)>>2]);
// CHECK: half [[H:[a-zA-Z0-9_]+]] = as_type<half>(ushort(([[WORD1]] >> 16U) & 65535U));