Skip to content

Commit 2807d0e

Browse files
committed
put test for each type in own file
1 parent 4ed0507 commit 2807d0e

File tree

4 files changed

+21
-27
lines changed

4 files changed

+21
-27
lines changed

clang/test/SemaHLSL/BuiltIns/clamp-errors-16bit.hlsl

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: not %clang_dxc -enable-16bit-types -T cs_6_0 -HV 202x %s 2>&1 | FileCheck %s
2+
3+
// check we error on 16 bit type if shader model is too old
4+
// CHECK: '-enable-16bit-types' option requires target HLSL Version >= 2018 and shader model >= 6.2, but HLSL Version is 'hlsl202x' and shader model is '6.0'
5+
half test_half_error(half p0, int p1) {
6+
return clamp(p0, p1, p1);
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: not %clang_dxc -enable-16bit-types -T cs_6_0 -HV 202x %s 2>&1 | FileCheck %s
2+
3+
// check we error on 16 bit type if shader model is too old
4+
// CHECK: '-enable-16bit-types' option requires target HLSL Version >= 2018 and shader model >= 6.2, but HLSL Version is 'hlsl202x' and shader model is '6.0'
5+
int16_t test_int16_t_error(int16_t p0, int p1) {
6+
return clamp(p0, p0, p1);
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: not %clang_dxc -enable-16bit-types -T cs_6_0 -HV 202x %s 2>&1 | FileCheck %s
2+
3+
// check we error on 16 bit type if shader model is too old
4+
// CHECK: '-enable-16bit-types' option requires target HLSL Version >= 2018 and shader model >= 6.2, but HLSL Version is 'hlsl202x' and shader model is '6.0'
5+
uint16_t test_uint16_t_error(uint16_t p0, int p1) {
6+
return clamp(p0, p0, p1);
7+
}

0 commit comments

Comments
 (0)