diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2014-06-25 11:44:49 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2014-06-25 11:44:49 +0000 |
commit | d3f8dd2d1595a626412202385461978c43eb049d (patch) | |
tree | e66eed96fa2181897866ce8a280637e3ca7d096a /clang/test/OpenMP/sections_ast_print.cpp | |
parent | 0b2d93c4f0c39f1cedb7a2ed59f3102eb7875efa (diff) | |
download | bcm5719-llvm-d3f8dd2d1595a626412202385461978c43eb049d.tar.gz bcm5719-llvm-d3f8dd2d1595a626412202385461978c43eb049d.zip |
[OPENMP] Initial support for 'sections' directive.
llvm-svn: 211685
Diffstat (limited to 'clang/test/OpenMP/sections_ast_print.cpp')
-rw-r--r-- | clang/test/OpenMP/sections_ast_print.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/clang/test/OpenMP/sections_ast_print.cpp b/clang/test/OpenMP/sections_ast_print.cpp new file mode 100644 index 00000000000..56c1c3c988c --- /dev/null +++ b/clang/test/OpenMP/sections_ast_print.cpp @@ -0,0 +1,46 @@ +// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp=libiomp5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s +// expected-no-diagnostics + +#ifndef HEADER +#define HEADER + +void foo() {} + +template <class T, int N> +T tmain(T argc) { + T b = argc, c, d, e, f, g; + static T a; +// CHECK: static T a; +#pragma omp parallel +#pragma omp sections private(argc, b), firstprivate(c, d), lastprivate(d, f) reduction (-: g) nowait + { + foo(); + } + // CHECK-NEXT: #pragma omp parallel + // CHECK-NEXT: #pragma omp sections private(argc,b) firstprivate(c,d) lastprivate(d,f) reduction(-: g) nowait + // CHECK-NEXT: { + // CHECK-NEXT: foo(); + // CHECK-NEXT: } + return T(); +} + +int main(int argc, char **argv) { + int b = argc, c, d, e, f, g; + static int a; +// CHECK: static int a; +#pragma omp parallel +#pragma omp sections private(argc, b), firstprivate(argv, c), lastprivate(d, f) reduction(+:g) nowait + { + foo(); + } + // CHECK-NEXT: #pragma omp parallel + // CHECK-NEXT: #pragma omp sections private(argc,b) firstprivate(argv,c) lastprivate(d,f) reduction(+: g) nowait + // CHECK-NEXT: { + // CHECK-NEXT: foo(); + // CHECK-NEXT: } + return (tmain<int, 5>(argc) + tmain<char, 1>(argv[0][0])); +} + +#endif |