Skip to content

Commit 3fa6105

Browse files
committed
tests: use --nowrap for constexpr diagnostics
Pass --nowrap to error-checking invocations and simplify FileCheck patterns now that diagnostics are not wrapped.
1 parent 58de15a commit 3fa6105

File tree

5 files changed

+16
-53
lines changed

5 files changed

+16
-53
lines changed
Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: X86_ENABLED && X86_64_HOST
2-
// RUN: not %{ispc} %s --target=generic-i32x4 --nostdlib -o /dev/null 2>&1 | FileCheck %s
2+
// RUN: not %{ispc} %s --target=generic-i32x4 --nostdlib --nowrap -o /dev/null 2>&1 | FileCheck %s
33

44
struct Pair {
55
uniform int a;
@@ -13,23 +13,7 @@ constexpr uniform int<2> v2 = {1, 2};
1313
constexpr uniform int<2> bad_swizzle_char = v2.qy;
1414
constexpr uniform int<2> bad_swizzle_oob = v2.zw;
1515

16-
// CHECK: Error:
17-
// CHECK: Initializer list
18-
// CHECK: for array
19-
// CHECK: "const uniform int32[2]"
20-
// CHECK: must have
21-
// CHECK: no more
22-
// CHECK: than 2
23-
// CHECK: elements
24-
// CHECK: (has 3).
25-
// CHECK: Error:
26-
// CHECK: Initializer list
27-
// CHECK: for struct
28-
// CHECK: "const uniform struct Pair"
29-
// CHECK: must
30-
// CHECK: have no
31-
// CHECK: more than 2
32-
// CHECK: elements
33-
// CHECK: (has 3).
34-
// CHECK: identifier "qy" unknown.
35-
// CHECK: character 'z' for constexpr vector.
16+
// CHECK: Error: Initializer list for array "const uniform int32[2]" must have no more than 2 elements (has 3).
17+
// CHECK: Error: Initializer list for struct "const uniform struct Pair" must have no more than 2 elements (has 3).
18+
// CHECK: Error: Vector element identifier "qy" unknown.
19+
// CHECK: Error: Invalid swizzle character 'z' for constexpr vector.
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: not %{ispc} %s --target=host --nostdlib -o /dev/null 2>&1 | FileCheck %s
1+
// RUN: not %{ispc} %s --target=host --nostdlib --nowrap -o /dev/null 2>&1 | FileCheck %s
22

33
constexpr uniform int bad(varying int x) {
44
if (x > 0) {
@@ -7,6 +7,4 @@ constexpr uniform int bad(varying int x) {
77
return 2;
88
}
99

10-
// CHECK: Error:
11-
// CHECK: constexpr function
12-
// CHECK: "bad" requires a uniform condition in "if".
10+
// CHECK: Error: constexpr function "bad" requires a uniform condition in "if".
Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: not %{ispc} %s --target=host --nostdlib -o /dev/null 2>&1 | FileCheck %s
1+
// RUN: not %{ispc} %s --target=host --nostdlib --nowrap -o /dev/null 2>&1 | FileCheck %s
22

33
uniform int g = 1;
44
constexpr uniform int badinit = g;
@@ -13,21 +13,7 @@ constexpr uniform int badstmt(uniform int x) {
1313
return x;
1414
}
1515

16-
// CHECK: Error:
17-
// CHECK: Initializer
18-
// CHECK: for global
19-
// CHECK: variable "badinit" must be a constant.
20-
// CHECK: Error:
21-
// CHECK: Missing
22-
// CHECK: initializer for
23-
// CHECK: constexpr variable "noinit".
24-
// CHECK: Error:
25-
// CHECK: constexpr
26-
// CHECK: function
27-
// CHECK: "badcall" calls non-constexpr function
28-
// CHECK: "nonconstexpr".
29-
// CHECK: Error:
30-
// CHECK: constexpr
31-
// CHECK: function
32-
// CHECK: "badstmt" contains disallowed statement
33-
// CHECK: "print".
16+
// CHECK: Error: Initializer for global variable "badinit" must be a constant.
17+
// CHECK: Error: Missing initializer for constexpr variable "noinit".
18+
// CHECK: Error: constexpr function "badcall" calls non-constexpr function "nonconstexpr".
19+
// CHECK: Error: constexpr function "badstmt" contains disallowed statement "print".
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// REQUIRES: X86_ENABLED && X86_64_HOST
2-
// RUN: not %{ispc} %s --target=generic-i32x4 -o /dev/null 2>&1 | FileCheck %s
2+
// RUN: not %{ispc} %s --target=generic-i32x4 --nowrap -o /dev/null 2>&1 | FileCheck %s
33

44
constexpr varying int Lane = programIndex;
55
uniform int arr[Lane];
66

7-
// CHECK: Error:
8-
// CHECK: Array size must
9-
// CHECK: be a uniform compile-time constant.
7+
// CHECK: Error: Array size must be a uniform compile-time constant.
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: not %{ispc} %s --target=sse4.1-i32x4 --enable-llvm-intrinsics -o /dev/null 2>&1 | FileCheck %s
1+
// RUN: not %{ispc} %s --target=sse4.1-i32x4 --enable-llvm-intrinsics --nowrap -o /dev/null 2>&1 | FileCheck %s
22
// REQUIRES: X86_ENABLED
33

44
uniform int gMode = 3;
@@ -7,7 +7,4 @@ float bad_round(float v) {
77
return @llvm.x86.sse41.round.ps(v, gMode);
88
}
99

10-
// CHECK: Error:
11-
// CHECK: Immediate argument 2 to
12-
// CHECK: "llvm.x86.sse41.round.ps" must be a
13-
// CHECK: compile-time constant.
10+
// CHECK: Error: Immediate argument 2 to "llvm.x86.sse41.round.ps" must be a compile-time constant.

0 commit comments

Comments
 (0)