| ; RUN: split-file %s %t | |
| ; RUN: not opt -disable-output -passes=dxil-translate-metadata %t/signed.ll 2>&1 | FileCheck %s --check-prefix=CHECK-SIGNED | |
| ; RUN: not opt -disable-output -passes=dxil-translate-metadata %t/cols.ll 2>&1 | FileCheck %s --check-prefix=CHECK-COLS | |
| ; RUN: not opt -disable-output -passes=dxil-translate-metadata %t/index.ll 2>&1 | FileCheck %s --check-prefix=CHECK-INDEX | |
| ; RUN: not opt -disable-output -passes=dxil-translate-metadata %t/linear.ll 2>&1 | FileCheck %s --check-prefix=CHECK-LINEAR | |
| ; RUN: not opt -disable-output -passes=dxil-translate-metadata %t/unallocated.ll 2>&1 | FileCheck %s --check-prefix=CHECK-UNALLOCATED | |
| ; RUN: not opt -disable-output -passes=dxil-translate-metadata %t/vertex.ll 2>&1 | FileCheck %s --check-prefix=CHECK-VERTEX | |
| ; Each case is a complete module with one invalid SV_PrimitiveID declaration. | |
| ;--- signed.ll | |
| ; The component type is 4 (I32), a signed 32-bit integer. Clang always emits an | |
| ; unsigned component type (U16 or U32) for SV_PrimitiveID, so I32 is rejected. | |
| ; CHECK-SIGNED: SV_PrimitiveID requires a scalar 16- or 32-bit unsigned integer | |
| target triple = "dxil-pc-shadermodel6.0-pixel" | |
| define void @main() #0 { ret void } | |
| attributes #0 = { "hlsl.shader"="pixel" } | |
| !dx.semantic.signatures = !{!0} | |
| !0 = !{ptr @main, !1, null} | |
| !1 = !{!2} | |
| !2 = !{i32 0, !"SV_PrimitiveID", i32 4, i32 10, !3, i32 1, i32 1, i8 1, i32 0, i8 0, i8 0, i8 0, i32 0} | |
| !3 = !{i32 0} | |
| ;--- cols.ll | |
| ; CHECK-COLS: SV_PrimitiveID requires a scalar 16- or 32-bit unsigned integer | |
| target triple = "dxil-pc-shadermodel6.0-pixel" | |
| define void @main() #0 { ret void } | |
| attributes #0 = { "hlsl.shader"="pixel" } | |
| !dx.semantic.signatures = !{!0} | |
| !0 = !{ptr @main, !1, null} | |
| !1 = !{!2} | |
| !2 = !{i32 0, !"SV_PrimitiveID", i32 5, i32 10, !3, i32 1, i32 1, i8 2, i32 0, i8 0, i8 0, i8 0, i32 0} | |
| !3 = !{i32 0} | |
| ;--- index.ll | |
| ; CHECK-INDEX: SV_PrimitiveID requires semantic index 0 | |
| target triple = "dxil-pc-shadermodel6.0-pixel" | |
| define void @main() #0 { ret void } | |
| attributes #0 = { "hlsl.shader"="pixel" } | |
| !dx.semantic.signatures = !{!0} | |
| !0 = !{ptr @main, !1, null} | |
| !1 = !{!2} | |
| !2 = !{i32 0, !"SV_PrimitiveID", i32 5, i32 10, !3, i32 1, i32 1, i8 1, i32 0, i8 0, i8 0, i8 0, i32 0} | |
| !3 = !{i32 1} | |
| ;--- linear.ll | |
| ; CHECK-LINEAR: integer pixel inputs require constant interpolation | |
| target triple = "dxil-pc-shadermodel6.0-pixel" | |
| define void @main() #0 { ret void } | |
| attributes #0 = { "hlsl.shader"="pixel" } | |
| !dx.semantic.signatures = !{!0} | |
| !0 = !{ptr @main, !1, null} | |
| !1 = !{!2} | |
| !2 = !{i32 0, !"SV_PrimitiveID", i32 5, i32 10, !3, i32 2, i32 1, i8 1, i32 0, i8 0, i8 0, i8 0, i32 0} | |
| !3 = !{i32 0} | |
| ;--- unallocated.ll | |
| ; CHECK-UNALLOCATED: signature element 0 ('SV_PrimitiveID') has no allocated location | |
| target triple = "dxil-pc-shadermodel6.0-pixel" | |
| define void @main() #0 { ret void } | |
| attributes #0 = { "hlsl.shader"="pixel" } | |
| !dx.semantic.signatures = !{!0} | |
| !0 = !{ptr @main, !1, null} | |
| !1 = !{!2} | |
| !2 = !{i32 0, !"SV_PrimitiveID", i32 5, i32 10, !3, i32 1, i32 1, i8 1, i32 -1, i8 -1, i8 0, i8 0, i32 0} | |
| !3 = !{i32 0} | |
| ;--- vertex.ll | |
| ; CHECK-VERTEX: invalid or unsupported semantic for this stage and signature category | |
| target triple = "dxil-pc-shadermodel6.0-vertex" | |
| define void @main() #0 { ret void } | |
| attributes #0 = { "hlsl.shader"="vertex" } | |
| !dx.semantic.signatures = !{!0} | |
| !0 = !{ptr @main, !1, null} | |
| !1 = !{!2} | |
| !2 = !{i32 0, !"SV_PrimitiveID", i32 5, i32 10, !3, i32 1, i32 1, i8 1, i32 0, i8 0, i8 0, i8 0, i32 0} | |
| !3 = !{i32 0} |