Skip to content

Commit be84705

Browse files
tcorringhamTim Corringham
andauthored
[HLSL][SPIRV] Add error test for unpackhalf2x16 (#166969)
Add an error test to check that a suitable error diagnostic is generated for the use of the GL::unpackhalf2x16 operation in invalid contexts. Fixes #166965 Co-authored-by: Tim Corringham <[email protected]>
1 parent f22d588 commit be84705

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
; RUN: not llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o /dev/null 2>&1 | FileCheck %s
2+
; RUN: not llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o /dev/null 2>&1 | FileCheck %s
3+
4+
; CHECK: LLVM ERROR: %5:vfid(<2 x s64>) = nnan ninf nsz arcp afn reassoc G_INTRINSIC intrinsic(@llvm.spv.unpackhalf2x16), %0:iid(s64) is only supported with the GLSL extended instruction set.
5+
6+
define hidden spir_func noundef nofpclass(nan inf) float @_Z9test_funcj(i32 noundef %0) local_unnamed_addr #0 {
7+
%2 = tail call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.spv.unpackhalf2x16.v2f32(i32 %0)
8+
%3 = extractelement <2 x float> %2, i64 0
9+
ret float %3
10+
}
11+

0 commit comments

Comments
 (0)