[clang] [llvm] [HLSL] Add -HV option translation to clang-dxc.exe (PR #83938)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 12 07:53:59 PDT 2024


================
@@ -0,0 +1,18 @@
+// RUN: %clang_dxc -T lib_6_4 -HV 2016 %s 2>&1 -###   | FileCheck -check-prefix=2016 %s
+// RUN: %clang_dxc -T lib_6_4 -HV 2017 %s 2>&1 -###   | FileCheck -check-prefix=2017 %s
+// RUN: %clang_dxc -T lib_6_4 /HV 2018 %s 2>&1 -###   | FileCheck -check-prefix=2018 %s
+// RUN: %clang_dxc -T lib_6_4 /HV 2021 %s 2>&1 -###   | FileCheck -check-prefix=2021 %s
+// RUN: %clang_dxc -T lib_6_4 /HV 202x %s 2>&1 -###   | FileCheck -check-prefix=202x %s
+// RUN: not %clang_dxc -T lib_6_4 /HV gibberish -### %s 2>&1 | FileCheck -check-prefix=CHECK-ERR %s
+
+// 2016: "-std=hlsl2016"
+// 2017: "-std=hlsl2017"
+// 2018: "-std=hlsl2018"
+// 2021: "-std=hlsl2021"
+// 202x: "-std=hlsl202x"
+// CHECK-ERR: error: 'HV' dxc argument has invalid value 'gibberish'
----------------
llvm-beanz wrote:

We should be able to test that the `-std` flag is set for each possible value (as you do), and that if you don't pass `/HV` we don't pass through a `-std` flag.

https://github.com/llvm/llvm-project/pull/83938


More information about the cfe-commits mailing list