Skip to content

Commit 6a7ef68

Browse files
Add Invalid stage test to ddx/y_coarse tests
1 parent 449b422 commit 6a7ef68

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
1+
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck --check-prefixes=CHECK-TYPE %s
2+
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-compute %s 2>&1 | FileCheck --check-prefixes=CHECK-STAGE %s
23

34
; DXIL operation ddx.coarse does not support double overload type
4-
; CHECK: in function ddx.coarse
5-
; CHECK-SAME: Cannot create DerivCoarseX operation: Invalid overload type
5+
; CHECK-TYPE: in function ddx.coarse
6+
; CHECK-TYPE-SAME: Cannot create DerivCoarseX operation: Invalid overload type
67

78
; Function Attrs: noinline nounwind optnone
89
define noundef double @ddx.coarse_double(double noundef %a) #0 {
@@ -13,3 +14,16 @@ entry:
1314
%dx.ddx.coarse = call double @llvm.dx.ddx.coarse.f64(double %0)
1415
ret double %dx.ddx.coarse
1516
}
17+
18+
; DXIL operation ddx.coarse does not support compute shader stage
19+
; CHECK-STAGE: in function ddx.coarse
20+
; CHECK-STAGE-SAME: Cannot create DerivCoarseX operation: Invalid stage
21+
; Function Attrs: noinline nounwind optnone
22+
define noundef float @ddx.coarse_float(float noundef %a) #0 {
23+
entry:
24+
%a.addr = alloca float, align 8
25+
store float %a, ptr %a.addr, align 8
26+
%0 = load float, ptr %a.addr, align 8
27+
%dx.ddx.coarse = call float @llvm.dx.ddx.coarse.f32(float %0)
28+
ret float %dx.ddx.coarse
29+
}
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
1+
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck --check-prefixes=CHECK-TYPE %s
2+
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-compute %s 2>&1 | FileCheck --check-prefixes=CHECK-STAGE %s
23

34
; DXIL operation ddy.coarse does not support double overload type
4-
; CHECK: in function ddy.coarse
5-
; CHECK-SAME: Cannot create DerivCoarseY operation: Invalid overload type
5+
; CHECK-TYPE: in function ddy.coarse
6+
; CHECK-TYPE-SAME: Cannot create DerivCoarseY operation: Invalid overload type
67

78
; Function Attrs: noinline nounwind optnone
89
define noundef double @ddy.coarse_double(double noundef %a) #0 {
@@ -13,3 +14,17 @@ entry:
1314
%dx.ddy.coarse = call double @llvm.dx.ddy.coarse.f64(double %0)
1415
ret double %dx.ddy.coarse
1516
}
17+
18+
; DXIL operation ddy.coarse does not support compute shader stage
19+
; CHECK-STAGE: in function ddy.coarse
20+
; CHECK-STAGE-SAME: Cannot create DerivCoarseY operation: Invalid stage
21+
22+
; Function Attrs: noinline nounwind optnone
23+
define noundef float @ddy.coarse_float(float noundef %a) #0 {
24+
entry:
25+
%a.addr = alloca float, align 8
26+
store float %a, ptr %a.addr, align 8
27+
%0 = load float, ptr %a.addr, align 8
28+
%dx.ddy.coarse = call float @llvm.dx.ddy.coarse.f32(float %0)
29+
ret float %dx.ddy.coarse
30+
}

0 commit comments

Comments
 (0)