Skip to content

Commit 18ee79b

Browse files
committed
add test and comment in response to feedback
1 parent 9a7be01 commit 18ee79b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8630,6 +8630,7 @@ def vtordisp_mode_EQ : Joined<["-"], "vtordisp-mode=">,
86308630
MarshallingInfoInt<LangOpts<"VtorDispMode">, "1">;
86318631
def fnative_int16_type : Flag<["-"], "fnative-int16-type">,
86328632
HelpText<"Use 16 bit integer types">,
8633+
// This option is implied unless we are in HLSL lang mode
86338634
ImpliedByAnyOf<[!strconcat("!", hlsl.KeyPath)]>,
86348635
MarshallingInfoFlag<LangOpts<"NativeInt16Type">>;
86358636
def fnative_half_type: Flag<["-"], "fnative-half-type">,

clang/test/Options/enable_16bit_types_validation_spirv.hlsl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
// RUN: not %clang_cc1 -internal-isystem D:\llvm-project\build\x64-Release\lib\clang\19\include -nostdsysteminc -triple spirv-vulkan-library -x hlsl -std=hlsl2016 -fnative-half-type -emit-llvm -disable-llvm-passes -o - %s 2>&1 | FileCheck %s --check-prefix=SPIRV
2-
// RUN: %clang_cc1 -internal-isystem D:\llvm-project\build\x64-Release\lib\clang\19\include -nostdsysteminc -triple spirv-vulkan-library -x hlsl -std=hlsl2021 -fnative-half-type -emit-llvm -disable-llvm-passes -o - %s 2>&1 | FileCheck %s --check-prefix=valid
1+
// RUN: not %clang_cc1 -internal-isystem D:\llvm-project\build\x64-Release\lib\clang\19\include -nostdsysteminc -triple spirv-vulkan-library -x hlsl -std=hlsl2016 -fnative-half-type -emit-llvm -disable-llvm-passes -o - %s 2>&1 | FileCheck %s --check-prefix=SPIRV-HALF
2+
// RUN: not %clang_cc1 -internal-isystem D:\llvm-project\build\x64-Release\lib\clang\19\include -nostdsysteminc -triple spirv-vulkan-library -x hlsl -std=hlsl2016 -fnative-int16-type -emit-llvm -disable-llvm-passes -o - %s 2>&1 | FileCheck %s --check-prefix=SPIRV-INT
3+
// RUN: %clang_cc1 -internal-isystem D:\llvm-project\build\x64-Release\lib\clang\19\include -nostdsysteminc -triple spirv-vulkan-library -x hlsl -std=hlsl2021 -fnative-half-type -fnative-int16-type -emit-llvm -disable-llvm-passes -o - %s 2>&1 | FileCheck %s --check-prefix=valid
34

4-
// SPIRV: error: '-fnative-half-type' option requires target HLSL Version >= 2018, but HLSL Version is 'hlsl2016'
5+
// SPIRV-HALF: error: '-fnative-half-type' option requires target HLSL Version >= 2018, but HLSL Version is 'hlsl2016'
6+
// SPIRV-INT: error: '-fnative-int16-type' option requires target HLSL Version >= 2018, but HLSL Version is 'hlsl2016'
57

68
// valid: "spirv-unknown-vulkan-library"
79
// valid: define hidden spir_func void @{{.*main.*}}() #0 {

0 commit comments

Comments
 (0)