//RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=51 \
//RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \
//RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \
//RUN: -fsyntax-only -verify -o - %s
//RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fopenmp -fopenmp-version=51 \
//RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \
//RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \
//RUN: -fsyntax-only -verify -o - %s
//RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=51 \
//RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \
//RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \
//RUN: -emit-pch -o %t %s
// expected-no-diagnostics
//RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=51 \
//RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \
//RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \
//RUN: -ast-print %s | FileCheck %s --check-prefix=PRINT
//RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=51 \
//RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \
//RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \
//RUN: -ast-dump %s | FileCheck %s --check-prefix=DUMP
//RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=51 \
//RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \
//RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \
//RUN: -include-pch %t -ast-print %s | FileCheck %s --check-prefix=PRINT
//RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=51 \
//RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \
//RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \
//RUN: -include-pch %t -ast-dump-all %s | FileCheck %s --check-prefix=DUMP
void
void
void
//DUMP: FunctionDecl{{.*}} foo 'void (float *, float *, int *)'
//DUMP: OMPDeclareVariantAttr{{.*}}device={arch(x86, x86_64)}
//DUMP: DeclRefExpr{{.*}}Function{{.*}}foo_v3
//DUMP: DeclRefExpr{{.*}}ParmVar{{.*}}'I'
//DUMP: DeclRefExpr{{.*}}ParmVar{{.*}}'BBB'
//DUMP: OMPDeclareVariantAttr{{.*}}device={arch(ppc)}
//DUMP: DeclRefExpr{{.*}}Function{{.*}}foo_v2
//DUMP: DeclRefExpr{{.*}}ParmVar{{.*}}'AAA'
//DUMP: OMPDeclareVariantAttr{{.*}}device={arch(arm)}
//DUMP: DeclRefExpr{{.*}}Function{{.*}}foo_v1
//DUMP: DeclRefExpr{{.*}}ParmVar{{.*}}'AAA'
//DUMP: DeclRefExpr{{.*}}ParmVar{{.*}}'BBB'
//PRINT: #pragma omp declare variant(foo_v3) match(construct={dispatch}, device={arch(x86, x86_64)}) adjust_args(nothing:I) adjust_args(need_device_ptr:BBB)
//PRINT: #pragma omp declare variant(foo_v2) match(construct={dispatch}, device={arch(ppc)}) adjust_args(need_device_ptr:AAA)
//PRINT: omp declare variant(foo_v1) match(construct={dispatch}, device={arch(arm)}) adjust_args(need_device_ptr:AAA,BBB)
void
void
void
//PRINT: #pragma omp declare variant(Foo_Var) match(construct={dispatch}, device={arch(x86_64)}) adjust_args(nothing:BBB) adjust_args(need_device_ptr:AAA)
//DUMP: FunctionDecl{{.*}} Foo 'void (T *, T *)'
//DUMP: OMPDeclareVariantAttr{{.*}}device={arch(x86_64)}
//DUMP: DeclRefExpr{{.*}}Function{{.*}}Foo_Var
//DUMP: DeclRefExpr{{.*}}ParmVar{{.*}}'BBB'
//DUMP: DeclRefExpr{{.*}}ParmVar{{.*}}'AAA'
//
//DUMP: FunctionDecl{{.*}} Foo 'void (float *, float *)'
//DUMP: OMPDeclareVariantAttr{{.*}}device={arch(x86_64)}
//DUMP: DeclRefExpr{{.*}}Function{{.*}}Foo_Var
//DUMP: DeclRefExpr{{.*}}ParmVar{{.*}}'BBB'
//DUMP: DeclRefExpr{{.*}}ParmVar{{.*}}'AAA'
void
typedef void *omp_interop_t;
void ;
void ;
//PRINT: #pragma omp declare variant(bar_v1) match(construct={dispatch}) append_args(interop(target,targetsync))
//DUMP: FunctionDecl{{.*}}bar1 'void (float *, float *)'
//DUMP: OMPDeclareVariantAttr{{.*}}construct={dispatch} Target_TargetSync
//DUMP: DeclRefExpr{{.*}}bar_v1
void
//PRINT: #pragma omp declare variant(bar_v1) match(construct={dispatch}) append_args(interop(targetsync))
//DUMP: FunctionDecl{{.*}}bar2 'void (float *, float *)'
//DUMP: OMPDeclareVariantAttr{{.*}}construct={dispatch} TargetSync
//DUMP: DeclRefExpr{{.*}}bar_v1
void
//PRINT: #pragma omp declare variant(bar_v1) match(construct={dispatch}) append_args(interop(target))
//DUMP: FunctionDecl{{.*}}bar3 'void (float *, float *)'
//DUMP: OMPDeclareVariantAttr{{.*}}construct={dispatch} Target
//DUMP: DeclRefExpr{{.*}}bar_v1
void
//PRINT: #pragma omp declare variant(bar_v2) match(construct={dispatch}) append_args(interop(target), interop(targetsync))
//DUMP: FunctionDecl{{.*}}bar4 'void (float *, float *)'
//DUMP: OMPDeclareVariantAttr{{.*}}construct={dispatch} Target TargetSync
//DUMP: DeclRefExpr{{.*}}bar_v2
void
//PRINT: #pragma omp declare variant(bar_v2) match(construct={dispatch}) append_args(interop(targetsync), interop(target))
//DUMP: FunctionDecl{{.*}}bar5 'void (float *, float *)'
//DUMP: OMPDeclareVariantAttr{{.*}}construct={dispatch} TargetSync Target
//DUMP: DeclRefExpr{{.*}}bar_v2
void
//PRINT: class A {
//DUMP: CXXRecordDecl{{.*}}class A definition
;
void ;
void
//PRINT: #pragma omp declare variant(templatefoo_v1<int>) match(construct={dispatch}) append_args(interop(target))
//DUMP: FunctionDecl{{.*}}templatebar 'void (const int &)'
//DUMP: OMPDeclareVariantAttr{{.*}}Implicit construct={dispatch} Target
//DUMP: DeclRefExpr{{.*}}'templatefoo_v1' 'void (const int &, omp_interop_t)'
void
// HEADER