Someday we would like to support HLSL on a wider range of targets, but today targeting anything other than `dxil` is likly to cause lots of headaches. This adds an error and tests to validate that the expected target is `dxil-?-shadermodel`. We will continue to do a best effort to ensure the code we write makes it easy to support other targets (like SPIR-V), but this error will prevent users from hitting frustrating errors for unsupported cases. Reviewed By: jcranmer-intel, Anastasia Differential Revision: https://reviews.llvm.org/D132056
16 lines
539 B
HLSL
16 lines
539 B
HLSL
// RUN: %clang -cc1 -S -triple dxil-pc-shadermodel6.3-library -S -emit-llvm -xhlsl -validator-version 1.1 -o - %s | FileCheck %s
|
|
|
|
// FIXME:The following line should work once SPIR-V support for HLSL is added.
|
|
// DISABLED: %clang -cc1 -S -triple spirv32 -S -emit-llvm -xhlsl -validator-version 1.1 -o - %s | FileCheck %s --check-prefix=NOT_DXIL
|
|
|
|
// CHECK:!dx.valver = !{![[valver:[0-9]+]]}
|
|
// CHECK:![[valver]] = !{i32 1, i32 1}
|
|
|
|
// NOT_DXIL-NOT:!dx.valver
|
|
|
|
float bar(float a, float b);
|
|
|
|
float foo(float a, float b) {
|
|
return bar(a, b);
|
|
}
|