Skip to content

Commit fe02a55

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:384562495bae into amd-gfx:401ed9d8228d
Local branch amd-gfx 401ed9d Merged main:95a4d30b0d64 into amd-gfx:e579a32bca2b Remote branch main 3845624 [lldb] For a host socket, add a method to print the listening address. (llvm#118330)
2 parents 401ed9d + 3845624 commit fe02a55

File tree

69 files changed

+1439
-481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1439
-481
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
cmake -B libc-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libc" -DLLVM_ENABLE_SPHINX=ON ./runtimes
163163
TZ=UTC ninja -C libc-build docs-libc-html
164164
mkdir built-docs/libc
165-
cp -r libc-build/docs/* built-docs/libc/
165+
cp -r libc-build/libc/docs/* built-docs/libc/
166166
- name: Build LLD docs
167167
if: steps.docs-changed-subprojects.outputs.lld_any_changed == 'true'
168168
run: |

clang-tools-extra/clangd/index/BackgroundRebuild.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- BackgroundRebuild.cpp - when to rebuild thei background index -----===//
1+
//===-- BackgroundRebuild.cpp - when to rebuild the background index ------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

clang/docs/LanguageExtensions.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1989,7 +1989,7 @@ Enumerations with a fixed underlying type
19891989
-----------------------------------------
19901990
19911991
Clang provides support for C++11 enumerations with a fixed underlying type
1992-
within Objective-C. For example, one can write an enumeration type as:
1992+
within Objective-C and C `prior to C23 <https://open-std.org/JTC1/SC22/WG14/www/docs/n3030.htm>`_. For example, one can write an enumeration type as:
19931993
19941994
.. code-block:: c++
19951995
@@ -2001,6 +2001,14 @@ value, is ``unsigned char``.
20012001
Use ``__has_feature(objc_fixed_enum)`` to determine whether support for fixed
20022002
underlying types is available in Objective-C.
20032003
2004+
Use ``__has_extension(c_fixed_enum)`` to determine whether support for fixed
2005+
underlying types is available in C prior to C23. This will also report ``true`` in C23
2006+
and later modes as the functionality is available even if it's not an extension in
2007+
those modes.
2008+
2009+
Use ``__has_feature(c_fixed_enum)`` to determine whether support for fixed
2010+
underlying types is available in C23 and later.
2011+
20042012
Interoperability with C++11 lambdas
20052013
-----------------------------------
20062014

clang/include/clang/Basic/Features.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ FEATURE(c_atomic, LangOpts.C11)
163163
FEATURE(c_generic_selections, LangOpts.C11)
164164
FEATURE(c_static_assert, LangOpts.C11)
165165
FEATURE(c_thread_local, LangOpts.C11 &&PP.getTargetInfo().isTLSSupported())
166+
// C23 features
167+
FEATURE(c_fixed_enum, LangOpts.C23)
166168
// C++11 features
167169
FEATURE(cxx_access_control_sfinae, LangOpts.CPlusPlus11)
168170
FEATURE(cxx_alias_templates, LangOpts.CPlusPlus11)
@@ -269,6 +271,7 @@ EXTENSION(c_static_assert, true)
269271
EXTENSION(c_thread_local, PP.getTargetInfo().isTLSSupported())
270272
// C23 features supported by other languages as extensions
271273
EXTENSION(c_attributes, true)
274+
EXTENSION(c_fixed_enum, true)
272275
// C++11 features supported by other languages as extensions.
273276
EXTENSION(cxx_atomic, LangOpts.CPlusPlus)
274277
EXTENSION(cxx_default_function_template_args, LangOpts.CPlusPlus)

clang/lib/Sema/SemaOpenACC.cpp

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -694,14 +694,6 @@ OpenACCClause *SemaOpenACCClauseVisitor::VisitSelfClause(
694694

695695
OpenACCClause *SemaOpenACCClauseVisitor::VisitNumGangsClause(
696696
SemaOpenACC::OpenACCParsedClause &Clause) {
697-
// Restrictions only properly implemented on 'compute' constructs, and
698-
// 'compute' constructs are the only construct that can do anything with
699-
// this yet, so skip/treat as unimplemented in this case.
700-
// TODO OpenACC: Remove this check when we have combined constructs for this
701-
// clause.
702-
if (!isOpenACCComputeDirectiveKind(Clause.getDirectiveKind()))
703-
return isNotImplemented();
704-
705697
// There is no prose in the standard that says duplicates aren't allowed,
706698
// but this diagnostic is present in other compilers, as well as makes
707699
// sense.
@@ -730,6 +722,7 @@ OpenACCClause *SemaOpenACCClauseVisitor::VisitNumGangsClause(
730722
// OpenACC 3.3 Section 2.5.4:
731723
// A reduction clause may not appear on a parallel construct with a
732724
// num_gangs clause that has more than one argument.
725+
// TODO: OpenACC: Reduction on Combined Construct needs to do this too.
733726
if (Clause.getDirectiveKind() == OpenACCDirectiveKind::Parallel &&
734727
Clause.getIntExprs().size() > 1) {
735728
auto *Parallel =
@@ -751,13 +744,6 @@ OpenACCClause *SemaOpenACCClauseVisitor::VisitNumGangsClause(
751744

752745
OpenACCClause *SemaOpenACCClauseVisitor::VisitNumWorkersClause(
753746
SemaOpenACC::OpenACCParsedClause &Clause) {
754-
// Restrictions only properly implemented on 'compute' constructs, and
755-
// 'compute' constructs are the only construct that can do anything with
756-
// this yet, so skip/treat as unimplemented in this case.
757-
// TODO: OpenACC: Remove when we get combined constructs.
758-
if (!isOpenACCComputeDirectiveKind(Clause.getDirectiveKind()))
759-
return isNotImplemented();
760-
761747
// There is no prose in the standard that says duplicates aren't allowed,
762748
// but this diagnostic is present in other compilers, as well as makes
763749
// sense.
@@ -773,13 +759,6 @@ OpenACCClause *SemaOpenACCClauseVisitor::VisitNumWorkersClause(
773759

774760
OpenACCClause *SemaOpenACCClauseVisitor::VisitVectorLengthClause(
775761
SemaOpenACC::OpenACCParsedClause &Clause) {
776-
// Restrictions only properly implemented on 'compute' constructs, and
777-
// 'compute' constructs are the only construct that can do anything with
778-
// this yet, so skip/treat as unimplemented in this case.
779-
// TODO: OpenACC: Remove when we get combined constructs.
780-
if (!isOpenACCComputeDirectiveKind(Clause.getDirectiveKind()))
781-
return isNotImplemented();
782-
783762
// There is no prose in the standard that says duplicates aren't allowed,
784763
// but this diagnostic is present in other compilers, as well as makes
785764
// sense.

clang/test/AST/ast-print-openacc-combined-construct.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,22 @@ void foo() {
224224
for(int i = 0;i<5;++i)
225225
for(int i = 0;i<5;++i);
226226

227+
// CHECK: #pragma acc parallel loop num_gangs(i, (int)array[2])
228+
// CHECK-NEXT: for (int i = 0; i < 5; ++i)
229+
// CHECK-NEXT: ;
230+
#pragma acc parallel loop num_gangs(i, (int)array[2])
231+
for(int i = 0;i<5;++i);
232+
233+
// CHECK: #pragma acc parallel loop num_workers(i)
234+
// CHECK-NEXT: for (int i = 0; i < 5; ++i)
235+
// CHECK-NEXT: ;
236+
#pragma acc parallel loop num_workers(i)
237+
for(int i = 0;i<5;++i);
238+
239+
// CHECK: #pragma acc parallel loop vector_length((int)array[1])
240+
// CHECK-NEXT: for (int i = 0; i < 5; ++i)
241+
// CHECK-NEXT: ;
242+
#pragma acc parallel loop vector_length((int)array[1])
243+
for(int i = 0;i<5;++i);
244+
227245
}

clang/test/Sema/enum.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,21 @@ int NegativeShortTest[NegativeShort == -1 ? 1 : -1];
121121
enum Color { Red, Green, Blue }; // expected-note{{previous use is here}}
122122
typedef struct Color NewColor; // expected-error {{use of 'Color' with tag type that does not match previous declaration}}
123123

124+
// Enumerations with a fixed underlying type.
125+
// https://github.com/llvm/llvm-project/issues/116880
126+
#if __STDC_VERSION__ >= 202311L
127+
static_assert(__has_feature(c_fixed_enum));
128+
static_assert(__has_extension(c_fixed_enum)); // Matches behavior for c_alignas, etc
129+
#else
130+
_Static_assert(__has_extension(c_fixed_enum), "");
131+
_Static_assert(!__has_feature(c_fixed_enum), "");
132+
#if __STDC_VERSION__ < 201112L
133+
// expected-warning@-3 {{'_Static_assert' is a C11 extension}}
134+
// expected-warning@-3 {{'_Static_assert' is a C11 extension}}
135+
#endif
136+
#endif
137+
typedef enum : unsigned char { Pink, Black, Cyan } Color; // pre-c23-warning {{enumeration types with a fixed underlying type are a C23 extension}}
138+
124139
// PR28903
125140
// In C it is valid to define tags inside enums.
126141
struct PR28903 {

clang/test/SemaOpenACC/combined-construct-auto_seq_independent-clauses.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,10 @@ void uses() {
134134
// expected-warning@+1{{OpenACC clause 'bind' not yet implemented}}
135135
#pragma acc parallel loop auto bind(Var)
136136
for(unsigned i = 0; i < 5; ++i);
137-
// TODOexpected-error@+1{{OpenACC 'vector_length' clause is not valid on 'parallel loop' directive}}
138-
// expected-warning@+1{{OpenACC clause 'vector_length' not yet implemented}}
139137
#pragma acc parallel loop auto vector_length(1)
140138
for(unsigned i = 0; i < 5; ++i);
141-
// TODOexpected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'parallel loop' directive}}
142-
// expected-warning@+1{{OpenACC clause 'num_gangs' not yet implemented}}
143139
#pragma acc parallel loop auto num_gangs(1)
144140
for(unsigned i = 0; i < 5; ++i);
145-
// TODOexpected-error@+1{{OpenACC 'num_workers' clause is not valid on 'parallel loop' directive}}
146-
// expected-warning@+1{{OpenACC clause 'num_workers' not yet implemented}}
147141
#pragma acc parallel loop auto num_workers(1)
148142
for(unsigned i = 0; i < 5; ++i);
149143
// expected-warning@+1{{OpenACC clause 'device_num' not yet implemented}}
@@ -261,16 +255,10 @@ void uses() {
261255
// expected-warning@+1{{OpenACC clause 'bind' not yet implemented}}
262256
#pragma acc parallel loop bind(Var) auto
263257
for(unsigned i = 0; i < 5; ++i);
264-
// TODOexpected-error@+1{{OpenACC 'vector_length' clause is not valid on 'parallel loop' directive}}
265-
// expected-warning@+1{{OpenACC clause 'vector_length' not yet implemented}}
266258
#pragma acc parallel loop vector_length(1) auto
267259
for(unsigned i = 0; i < 5; ++i);
268-
// TODOexpected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'parallel loop' directive}}
269-
// expected-warning@+1{{OpenACC clause 'num_gangs' not yet implemented}}
270260
#pragma acc parallel loop num_gangs(1) auto
271261
for(unsigned i = 0; i < 5; ++i);
272-
// TODOexpected-error@+1{{OpenACC 'num_workers' clause is not valid on 'parallel loop' directive}}
273-
// expected-warning@+1{{OpenACC clause 'num_workers' not yet implemented}}
274262
#pragma acc parallel loop num_workers(1) auto
275263
for(unsigned i = 0; i < 5; ++i);
276264
// expected-warning@+1{{OpenACC clause 'device_num' not yet implemented}}
@@ -389,16 +377,10 @@ void uses() {
389377
// expected-warning@+1{{OpenACC clause 'bind' not yet implemented}}
390378
#pragma acc parallel loop independent bind(Var)
391379
for(unsigned i = 0; i < 5; ++i);
392-
// TODOexpected-error@+1{{OpenACC 'vector_length' clause is not valid on 'parallel loop' directive}}
393-
// expected-warning@+1{{OpenACC clause 'vector_length' not yet implemented}}
394380
#pragma acc parallel loop independent vector_length(1)
395381
for(unsigned i = 0; i < 5; ++i);
396-
// TODOexpected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'parallel loop' directive}}
397-
// expected-warning@+1{{OpenACC clause 'num_gangs' not yet implemented}}
398382
#pragma acc parallel loop independent num_gangs(1)
399383
for(unsigned i = 0; i < 5; ++i);
400-
// TODOexpected-error@+1{{OpenACC 'num_workers' clause is not valid on 'parallel loop' directive}}
401-
// expected-warning@+1{{OpenACC clause 'num_workers' not yet implemented}}
402384
#pragma acc parallel loop independent num_workers(1)
403385
for(unsigned i = 0; i < 5; ++i);
404386
// expected-warning@+1{{OpenACC clause 'device_num' not yet implemented}}
@@ -516,16 +498,10 @@ void uses() {
516498
// expected-warning@+1{{OpenACC clause 'bind' not yet implemented}}
517499
#pragma acc parallel loop bind(Var) independent
518500
for(unsigned i = 0; i < 5; ++i);
519-
// TODOexpected-error@+1{{OpenACC 'vector_length' clause is not valid on 'parallel loop' directive}}
520-
// expected-warning@+1{{OpenACC clause 'vector_length' not yet implemented}}
521501
#pragma acc parallel loop vector_length(1) independent
522502
for(unsigned i = 0; i < 5; ++i);
523-
// TODOexpected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'parallel loop' directive}}
524-
// expected-warning@+1{{OpenACC clause 'num_gangs' not yet implemented}}
525503
#pragma acc parallel loop num_gangs(1) independent
526504
for(unsigned i = 0; i < 5; ++i);
527-
// TODOexpected-error@+1{{OpenACC 'num_workers' clause is not valid on 'parallel loop' directive}}
528-
// expected-warning@+1{{OpenACC clause 'num_workers' not yet implemented}}
529505
#pragma acc parallel loop num_workers(1) independent
530506
for(unsigned i = 0; i < 5; ++i);
531507
// expected-warning@+1{{OpenACC clause 'device_num' not yet implemented}}
@@ -650,16 +626,10 @@ void uses() {
650626
// expected-warning@+1{{OpenACC clause 'bind' not yet implemented}}
651627
#pragma acc parallel loop seq bind(Var)
652628
for(unsigned i = 0; i < 5; ++i);
653-
// TODOexpected-error@+1{{OpenACC 'vector_length' clause is not valid on 'parallel loop' directive}}
654-
// expected-warning@+1{{OpenACC clause 'vector_length' not yet implemented}}
655629
#pragma acc parallel loop seq vector_length(1)
656630
for(unsigned i = 0; i < 5; ++i);
657-
// TODOexpected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'parallel loop' directive}}
658-
// expected-warning@+1{{OpenACC clause 'num_gangs' not yet implemented}}
659631
#pragma acc parallel loop seq num_gangs(1)
660632
for(unsigned i = 0; i < 5; ++i);
661-
// TODOexpected-error@+1{{OpenACC 'num_workers' clause is not valid on 'parallel loop' directive}}
662-
// expected-warning@+1{{OpenACC clause 'num_workers' not yet implemented}}
663633
#pragma acc parallel loop seq num_workers(1)
664634
for(unsigned i = 0; i < 5; ++i);
665635
// expected-warning@+1{{OpenACC clause 'device_num' not yet implemented}}
@@ -783,16 +753,10 @@ void uses() {
783753
// expected-warning@+1{{OpenACC clause 'bind' not yet implemented}}
784754
#pragma acc parallel loop bind(Var) seq
785755
for(unsigned i = 0; i < 5; ++i);
786-
// TODOexpected-error@+1{{OpenACC 'vector_length' clause is not valid on 'parallel loop' directive}}
787-
// expected-warning@+1{{OpenACC clause 'vector_length' not yet implemented}}
788756
#pragma acc parallel loop vector_length(1) seq
789757
for(unsigned i = 0; i < 5; ++i);
790-
// TODOexpected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'parallel loop' directive}}
791-
// expected-warning@+1{{OpenACC clause 'num_gangs' not yet implemented}}
792758
#pragma acc parallel loop num_gangs(1) seq
793759
for(unsigned i = 0; i < 5; ++i);
794-
// TODOexpected-error@+1{{OpenACC 'num_workers' clause is not valid on 'parallel loop' directive}}
795-
// expected-warning@+1{{OpenACC clause 'num_workers' not yet implemented}}
796760
#pragma acc parallel loop num_workers(1) seq
797761
for(unsigned i = 0; i < 5; ++i);
798762
// expected-warning@+1{{OpenACC clause 'device_num' not yet implemented}}

clang/test/SemaOpenACC/combined-construct-device_type-clause.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ void uses() {
195195
// expected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'serial loop' directive}}
196196
#pragma acc serial loop device_type(*) num_gangs(1)
197197
for(int i = 0; i < 5; ++i);
198-
// expected-warning@+1{{OpenACC clause 'num_workers' not yet implemented, clause ignored}}
199198
#pragma acc parallel loop device_type(*) num_workers(1)
200199
for(int i = 0; i < 5; ++i);
201200
// expected-error@+2{{OpenACC clause 'device_num' may not follow a 'device_type' clause in a 'serial loop' construct}}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
// RUN: %clang_cc1 %s -fopenacc -ast-dump | FileCheck %s
2+
3+
// Test this with PCH.
4+
// RUN: %clang_cc1 %s -fopenacc -emit-pch -o %t %s
5+
// RUN: %clang_cc1 %s -fopenacc -include-pch %t -ast-dump-all | FileCheck %s
6+
7+
#ifndef PCH_HELPER
8+
#define PCH_HELPER
9+
int some_int();
10+
short some_short();
11+
long some_long();
12+
struct CorrectConvert {
13+
operator int();
14+
} Convert;
15+
16+
17+
void NormalUses() {
18+
// CHECK: FunctionDecl{{.*}}NormalUses
19+
// CHECK-NEXT: CompoundStmt
20+
21+
#pragma acc parallel loop num_gangs(some_int(), some_long(), some_short())
22+
for (unsigned i = 0; i < 5; ++i);
23+
// CHECK-NEXT: OpenACCCombinedConstruct{{.*}} parallel loop
24+
// CHECK-NEXT: num_gangs clause
25+
// CHECK-NEXT: CallExpr{{.*}}'int'
26+
// CHECK-NEXT: ImplicitCastExpr{{.*}}'int (*)()' <FunctionToPointerDecay>
27+
// CHECK-NEXT: DeclRefExpr{{.*}}'int ()' lvalue Function{{.*}} 'some_int' 'int ()'
28+
// CHECK-NEXT: CallExpr{{.*}}'long'
29+
// CHECK-NEXT: ImplicitCastExpr{{.*}}'long (*)()' <FunctionToPointerDecay>
30+
// CHECK-NEXT: DeclRefExpr{{.*}}'long ()' lvalue Function{{.*}} 'some_long' 'long ()'
31+
// CHECK-NEXT: CallExpr{{.*}}'short'
32+
// CHECK-NEXT: ImplicitCastExpr{{.*}}'short (*)()' <FunctionToPointerDecay>
33+
// CHECK-NEXT: DeclRefExpr{{.*}}'short ()' lvalue Function{{.*}} 'some_short' 'short ()'
34+
// CHECK-NEXT: ForStmt
35+
// CHECK: NullStmt
36+
37+
#pragma acc kernels loop num_gangs(some_int())
38+
for (unsigned i = 0; i < 5; ++i);
39+
// CHECK-NEXT: OpenACCCombinedConstruct{{.*}} kernels loop
40+
// CHECK-NEXT: num_gangs clause
41+
// CHECK-NEXT: CallExpr{{.*}}'int'
42+
// CHECK-NEXT: ImplicitCastExpr{{.*}}'int (*)()' <FunctionToPointerDecay>
43+
// CHECK-NEXT: DeclRefExpr{{.*}}'int ()' lvalue Function{{.*}} 'some_int' 'int ()'
44+
// CHECK-NEXT: ForStmt
45+
// CHECK: NullStmt
46+
}
47+
48+
template<typename T, typename U>
49+
void TemplUses(T t, U u) {
50+
// CHECK-NEXT: FunctionTemplateDecl
51+
// CHECK-NEXT: TemplateTypeParmDecl{{.*}}typename depth 0 index 0 T
52+
// CHECK-NEXT: TemplateTypeParmDecl{{.*}}typename depth 0 index 1 U
53+
// CHECK-NEXT: FunctionDecl{{.*}} TemplUses 'void (T, U)'
54+
// CHECK-NEXT: ParmVarDecl{{.*}} t 'T'
55+
// CHECK-NEXT: ParmVarDecl{{.*}} u 'U'
56+
// CHECK-NEXT: CompoundStmt
57+
58+
#pragma acc kernels loop num_gangs(u)
59+
for (unsigned i = 0; i < 5; ++i);
60+
// CHECK-NEXT: OpenACCCombinedConstruct{{.*}} kernels loop
61+
// CHECK-NEXT: num_gangs clause
62+
// CHECK-NEXT: DeclRefExpr{{.*}} 'U' lvalue ParmVar{{.*}} 'u' 'U'
63+
// CHECK-NEXT: ForStmt
64+
// CHECK: NullStmt
65+
66+
#pragma acc parallel loop num_gangs(u, U::value)
67+
for (unsigned i = 0; i < 5; ++i);
68+
// CHECK-NEXT: OpenACCCombinedConstruct{{.*}} parallel loop
69+
// CHECK-NEXT: num_gangs clause
70+
// CHECK-NEXT: DeclRefExpr{{.*}} 'U' lvalue ParmVar{{.*}} 'u' 'U'
71+
// CHECK-NEXT: DependentScopeDeclRefExpr{{.*}} '<dependent type>' lvalue
72+
// CHECK-NEXT: NestedNameSpecifier TypeSpec 'U'
73+
// CHECK-NEXT: ForStmt
74+
// CHECK: NullStmt
75+
76+
// Check the instantiated versions of the above.
77+
// CHECK-NEXT: FunctionDecl{{.*}} used TemplUses 'void (CorrectConvert, HasInt)' implicit_instantiation
78+
// CHECK-NEXT: TemplateArgument type 'CorrectConvert'
79+
// CHECK-NEXT: RecordType{{.*}} 'CorrectConvert'
80+
// CHECK-NEXT: CXXRecord{{.*}} 'CorrectConvert'
81+
// CHECK-NEXT: TemplateArgument type 'HasInt'
82+
// CHECK-NEXT: RecordType{{.*}} 'HasInt'
83+
// CHECK-NEXT: CXXRecord{{.*}} 'HasInt'
84+
// CHECK-NEXT: ParmVarDecl{{.*}} t 'CorrectConvert'
85+
// CHECK-NEXT: ParmVarDecl{{.*}} u 'HasInt'
86+
// CHECK-NEXT: CompoundStmt
87+
88+
// CHECK-NEXT: OpenACCCombinedConstruct{{.*}} kernels loop
89+
// CHECK-NEXT: num_gangs clause
90+
// CHECK-NEXT: ImplicitCastExpr{{.*}} 'char' <UserDefinedConversion>
91+
// CHECK-NEXT: CXXMemberCallExpr{{.*}}'char'
92+
// CHECK-NEXT: MemberExpr{{.*}} '<bound member function type>' .operator char
93+
// CHECK-NEXT: DeclRefExpr{{.*}} 'HasInt' lvalue ParmVar
94+
// CHECK-NEXT: ForStmt
95+
// CHECK: NullStmt
96+
97+
// CHECK-NEXT: OpenACCCombinedConstruct{{.*}} parallel loop
98+
// CHECK-NEXT: num_gangs clause
99+
// CHECK-NEXT: ImplicitCastExpr{{.*}} 'char' <UserDefinedConversion>
100+
// CHECK-NEXT: CXXMemberCallExpr{{.*}}'char'
101+
// CHECK-NEXT: MemberExpr{{.*}} '<bound member function type>' .operator char
102+
// CHECK-NEXT: DeclRefExpr{{.*}} 'HasInt' lvalue ParmVar
103+
// CHECK-NEXT: ImplicitCastExpr{{.*}} 'int' <LValueToRValue>
104+
// CHECK-NEXT: DeclRefExpr{{.*}} 'const int' lvalue Var{{.*}} 'value' 'const int'
105+
// CHECK-NEXT: NestedNameSpecifier TypeSpec 'HasInt'
106+
// CHECK-NEXT: ForStmt
107+
// CHECK: NullStmt
108+
}
109+
110+
struct HasInt {
111+
using IntTy = int;
112+
using ShortTy = short;
113+
static constexpr int value = 1;
114+
115+
operator char();
116+
};
117+
118+
void Inst() {
119+
TemplUses<CorrectConvert, HasInt>({}, {});
120+
}
121+
#endif // PCH_HELPER

0 commit comments

Comments
 (0)