1
- // RUN: %clang_cc1 -Wno-vla - fsycl-is-device -fcxx-exceptions -triple spir64 \
1
+ // RUN: %clang_cc1 -fsycl-is-device -fcxx-exceptions -triple spir64 \
2
2
// RUN: -aux-triple x86_64-unknown-linux-gnu -Wno-return-type -verify \
3
3
// RUN: -Wno-sycl-2017-compat -fsyntax-only -std=c++17 %s
4
- // RUN: %clang_cc1 -Wno-vla - fsycl-is-device -fcxx-exceptions -triple spir64 \
4
+ // RUN: %clang_cc1 -fsycl-is-device -fcxx-exceptions -triple spir64 \
5
5
// RUN: -aux-triple x86_64-unknown-linux-gnu -fno-sycl-allow-func-ptr \
6
6
// RUN: -Wno-return-type -verify -Wno-sycl-2017-compat -fsyntax-only \
7
7
// RUN: -std=c++17 %s
8
- // RUN: %clang_cc1 -Wno-vla - fsycl-is-device -fcxx-exceptions -triple spir64 \
8
+ // RUN: %clang_cc1 -fsycl-is-device -fcxx-exceptions -triple spir64 \
9
9
// RUN: -aux-triple x86_64-unknown-linux-gnu -DALLOW_FP=1 \
10
10
// RUN: -fsycl-allow-func-ptr -Wno-return-type -verify \
11
11
// RUN: -Wno-sycl-2017-compat -fsyntax-only -std=c++17 %s
@@ -40,10 +40,12 @@ bool operator==(const Fraction &lhs, const Fraction &rhs) {
40
40
} // namespace Check_User_Operators
41
41
42
42
namespace Check_VLA_Restriction {
43
- void no_restriction (int p) {
43
+ void no_restriction (int p) { // expected-note {{declared here}}
44
+ // expected-note@+2 {{function parameter 'p' with unknown value cannot be used in a constant expression}}
45
+ // expected-warning@+1 {{variable length arrays in C++ are a Clang extension}}
44
46
int index[p + 2 ];
45
47
}
46
- void restriction (int p) {
48
+ void restriction (int p) { // expected-note {{declared here}}
47
49
// This particular violation is nested under two kernels with intermediate function calls.
48
50
// e.g. main -> 1stkernel -> usage -> 2ndkernel -> isa_B -> restriction -> !!
49
51
// Because the error is in two different kernels, we are given helpful notes for the origination of the error, twice.
@@ -52,6 +54,8 @@ void restriction(int p) {
52
54
// expected-note@#call_isa_B 2{{called by 'operator()'}}
53
55
// expected-note@#rtti_kernel 2{{called by 'kernel1<kernel_name, (lambda at }}
54
56
// expected-note@#call_vla {{called by 'isa_B'}}
57
+ // expected-note@+2 {{function parameter 'p' with unknown value cannot be used in a constant expression}}
58
+ // expected-warning@+1 {{variable length arrays in C++ are a Clang extension}}
55
59
int index[p + 2 ]; // expected-error {{variable length arrays are not supported for the current target}}
56
60
}
57
61
} // namespace Check_VLA_Restriction
0 commit comments