Skip to content

Commit 68e765c

Browse files
committed
[SYCL][TEST] Fix variable length array warning/notes
This also reverts commit e8bb014.
1 parent edccb9b commit 68e765c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

clang/test/SemaSYCL/sycl-restrict.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// RUN: %clang_cc1 -Wno-vla -fsycl-is-device -fcxx-exceptions -triple spir64 \
1+
// RUN: %clang_cc1 -fsycl-is-device -fcxx-exceptions -triple spir64 \
22
// RUN: -aux-triple x86_64-unknown-linux-gnu -Wno-return-type -verify \
33
// 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 \
55
// RUN: -aux-triple x86_64-unknown-linux-gnu -fno-sycl-allow-func-ptr \
66
// RUN: -Wno-return-type -verify -Wno-sycl-2017-compat -fsyntax-only \
77
// 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 \
99
// RUN: -aux-triple x86_64-unknown-linux-gnu -DALLOW_FP=1 \
1010
// RUN: -fsycl-allow-func-ptr -Wno-return-type -verify \
1111
// RUN: -Wno-sycl-2017-compat -fsyntax-only -std=c++17 %s
@@ -40,10 +40,12 @@ bool operator==(const Fraction &lhs, const Fraction &rhs) {
4040
} // namespace Check_User_Operators
4141

4242
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}}
4446
int index[p + 2];
4547
}
46-
void restriction(int p) {
48+
void restriction(int p) { // expected-note {{declared here}}
4749
// This particular violation is nested under two kernels with intermediate function calls.
4850
// e.g. main -> 1stkernel -> usage -> 2ndkernel -> isa_B -> restriction -> !!
4951
// 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) {
5254
// expected-note@#call_isa_B 2{{called by 'operator()'}}
5355
// expected-note@#rtti_kernel 2{{called by 'kernel1<kernel_name, (lambda at }}
5456
// 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}}
5559
int index[p + 2]; // expected-error {{variable length arrays are not supported for the current target}}
5660
}
5761
} // namespace Check_VLA_Restriction

0 commit comments

Comments
 (0)