// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp \ // RUN: -fsyntax-only -verify %s // expected-no-diagnostics // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp \ // RUN: -ast-print %s | FileCheck %s --check-prefix=PRINT // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp \ // RUN: -ast-dump %s | FileCheck %s --check-prefix=DUMP // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp \ // RUN: -emit-pch -o %t %s // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp \ // RUN: -include-pch %t -ast-dump-all %s | FileCheck %s --check-prefix=DUMP // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp \ // RUN: -include-pch %t -ast-print %s | FileCheck %s --check-prefix=PRINT #ifndef HEADER #define HEADER //PRINT: template void templ_foo(T t) { //PRINT: T j, z; //PRINT: #pragma omp simd collapse(C) reduction(+: z) lastprivate(j) //PRINT: for (T i = 0; i < t; ++i) //PRINT: for (j = 0; j < t; ++j) //PRINT: z += i + j; //PRINT: } //DUMP: FunctionTemplateDecl{{.*}}templ_foo //DUMP: TemplateTypeParmDecl{{.*}}T //DUMP: NonTypeTemplateParmDecl{{.*}}C //DUMP: OMPSimdDirective //DUMP: OMPCollapseClause //DUMP: DeclRefExpr{{.*}}'C' 'int' //DUMP: OMPReductionClause //DUMP: DeclRefExpr{{.*}}'z' 'T' //DUMP: OMPLastprivateClause //DUMP: DeclRefExpr{{.*}}'j' 'T' //DUMP: ForStmt //DUMP: ForStmt //PRINT: template<> void templ_foo(int t) { //PRINT: int j, z; //PRINT: #pragma omp simd collapse(2) reduction(+: z) lastprivate(j) //PRINT: for (int i = 0; i < t; ++i) //PRINT: for (j = 0; j < t; ++j) //PRINT: z += i + j; //PRINT: } //DUMP: FunctionDecl{{.*}}templ_foo 'void (int)' //DUMP: TemplateArgument type 'int' //DUMP: TemplateArgument integral 2 //DUMP: ParmVarDecl{{.*}}'int' //DUMP: OMPSimdDirective //DUMP: OMPCollapseClause //DUMP: ConstantExpr{{.*}}'int' //DUMP: value: Int 2 //DUMP: OMPReductionClause //DUMP: DeclRefExpr{{.*}}'z' 'int' //DUMP: OMPLastprivateClause //DUMP: DeclRefExpr{{.*}}'j' 'int' //DUMP: ForStmt template void templ_foo(T t) { T j,z; #pragma omp loop collapse(C) reduction(+:z) lastprivate(j) bind(thread) for (T i = 0; i(8); } #endif // HEADER