Skip to content

Commit 743c84b

Browse files
committed
[clang][NFC] Move CWG2353 test to its own file
1 parent de7f531 commit 743c84b

File tree

2 files changed

+49
-40
lines changed

2 files changed

+49
-40
lines changed

clang/test/CXX/drs/cwg2353.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors -ast-dump | FileCheck %s
2+
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors -ast-dump | FileCheck %s
3+
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors -ast-dump | FileCheck %s
4+
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors -ast-dump | FileCheck %s
5+
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors -ast-dump | FileCheck %s
6+
// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors -ast-dump | FileCheck %s
7+
// RUN: %clang_cc1 -std=c++2c -triple x86_64-unknown-unknown %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors -ast-dump | FileCheck %s
8+
9+
// expected-no-diagnostics
10+
11+
namespace cwg2353 { // cwg2353: 9
12+
struct X {
13+
static const int n = 0;
14+
};
15+
16+
// CHECK: FunctionDecl {{.*}} use
17+
int use(X x) {
18+
// CHECK: MemberExpr {{.*}} .n
19+
// CHECK-NOT: non_odr_use
20+
// CHECK: DeclRefExpr {{.*}} 'x'
21+
// CHECK-NOT: non_odr_use
22+
return *&x.n;
23+
}
24+
#pragma clang __debug dump use
25+
26+
// CHECK: FunctionDecl {{.*}} not_use
27+
int not_use(X x) {
28+
// CHECK: MemberExpr {{.*}} .n {{.*}} non_odr_use_constant
29+
// CHECK: DeclRefExpr {{.*}} 'x'
30+
return x.n;
31+
}
32+
#pragma clang __debug dump not_use
33+
34+
// CHECK: FunctionDecl {{.*}} not_use_2
35+
int not_use_2(X *x) {
36+
// CHECK: MemberExpr {{.*}} ->n {{.*}} non_odr_use_constant
37+
// CHECK: DeclRefExpr {{.*}} 'x'
38+
return x->n;
39+
}
40+
#pragma clang __debug dump not_use_2
41+
} // namespace cwg2353

clang/test/CXX/drs/cwg23xx.cpp

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// RUN: %clang_cc1 -std=c++98 %s -verify=expected,cxx98 -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
2-
// RUN: %clang_cc1 -std=c++11 %s -verify=expected,cxx11-14,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
3-
// RUN: %clang_cc1 -std=c++14 %s -verify=expected,cxx11-14,since-cxx11,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
4-
// RUN: %clang_cc1 -std=c++17 %s -verify=expected,since-cxx11,since-cxx14,since-cxx17 -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
5-
// RUN: %clang_cc1 -std=c++20 %s -verify=expected,since-cxx11,since-cxx14,since-cxx17,since-cxx20 -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
6-
// RUN: %clang_cc1 -std=c++23 %s -verify=expected,since-cxx11,since-cxx14,since-cxx17,since-cxx20 -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
7-
// RUN: %clang_cc1 -std=c++2c %s -verify=expected,since-cxx11,since-cxx14,since-cxx17,since-cxx20 -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
1+
// RUN: %clang_cc1 -std=c++98 %s -verify=expected,cxx98 -fexceptions -fcxx-exceptions -pedantic-errors
2+
// RUN: %clang_cc1 -std=c++11 %s -verify=expected,cxx11-14,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
3+
// RUN: %clang_cc1 -std=c++14 %s -verify=expected,cxx11-14,since-cxx11,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
4+
// RUN: %clang_cc1 -std=c++17 %s -verify=expected,since-cxx11,since-cxx14,since-cxx17 -fexceptions -fcxx-exceptions -pedantic-errors
5+
// RUN: %clang_cc1 -std=c++20 %s -verify=expected,since-cxx11,since-cxx14,since-cxx17,since-cxx20 -fexceptions -fcxx-exceptions -pedantic-errors
6+
// RUN: %clang_cc1 -std=c++23 %s -verify=expected,since-cxx11,since-cxx14,since-cxx17,since-cxx20 -fexceptions -fcxx-exceptions -pedantic-errors
7+
// RUN: %clang_cc1 -std=c++2c %s -verify=expected,since-cxx11,since-cxx14,since-cxx17,since-cxx20 -fexceptions -fcxx-exceptions -pedantic-errors
88

99
namespace std {
1010
__extension__ typedef __SIZE_TYPE__ size_t;
@@ -284,39 +284,7 @@ namespace cwg2352 { // cwg2352: 10
284284
#if __cplusplus >= 201103L
285285
static_assert(&p == &check_f, "");
286286
#endif
287-
}
288-
289-
namespace cwg2353 { // cwg2353: 9
290-
struct X {
291-
static const int n = 0;
292-
};
293-
294-
// CHECK: FunctionDecl {{.*}} use
295-
int use(X x) {
296-
// CHECK: MemberExpr {{.*}} .n
297-
// CHECK-NOT: non_odr_use
298-
// CHECK: DeclRefExpr {{.*}} 'x'
299-
// CHECK-NOT: non_odr_use
300-
return *&x.n;
301-
}
302-
#pragma clang __debug dump use
303-
304-
// CHECK: FunctionDecl {{.*}} not_use
305-
int not_use(X x) {
306-
// CHECK: MemberExpr {{.*}} .n {{.*}} non_odr_use_constant
307-
// CHECK: DeclRefExpr {{.*}} 'x'
308-
return x.n;
309-
}
310-
#pragma clang __debug dump not_use
311-
312-
// CHECK: FunctionDecl {{.*}} not_use_2
313-
int not_use_2(X *x) {
314-
// CHECK: MemberExpr {{.*}} ->n {{.*}} non_odr_use_constant
315-
// CHECK: DeclRefExpr {{.*}} 'x'
316-
return x->n;
317-
}
318-
#pragma clang __debug dump not_use_2
319-
}
287+
} // namespace cwg2352
320288

321289
namespace cwg2354 { // cwg2354: 15
322290
#if __cplusplus >= 201103L

0 commit comments

Comments
 (0)