From fdb3d9b8d6b2378aaef5a4363ec8c3c45e77ebf7 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Wed, 20 Mar 2019 16:31:47 +0000 Subject: [NFC][clang][astdump] Some baseline tests for OpenMP Summary: Split off from D59214. Not a fully exhaustive test coverage, but better than what there currently is. Differential Revision: https://reviews.llvm.org/D59306 llvm-svn: 356569 --- clang/test/AST/ast-dump-openmp-sections.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 clang/test/AST/ast-dump-openmp-sections.c (limited to 'clang/test/AST/ast-dump-openmp-sections.c') diff --git a/clang/test/AST/ast-dump-openmp-sections.c b/clang/test/AST/ast-dump-openmp-sections.c new file mode 100644 index 00000000000..a035ffd6a3e --- /dev/null +++ b/clang/test/AST/ast-dump-openmp-sections.c @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -ast-dump %s | FileCheck --match-full-lines -implicit-check-not=openmp_structured_block %s + +void test_zero() { +#pragma omp sections + {} +} + +void test_one() { +#pragma omp sections + { ; } +} + +// CHECK: TranslationUnitDecl {{.*}} <> +// CHECK: |-FunctionDecl {{.*}} <{{.*}}ast-dump-openmp-sections.c:3:1, line:6:1> line:3:6 test_zero 'void ()' +// CHECK-NEXT: | `-CompoundStmt {{.*}} +// CHECK-NEXT: `-FunctionDecl {{.*}} line:8:6 test_one 'void ()' +// CHECK-NEXT: `-CompoundStmt {{.*}} +// CHECK-NEXT: `-OMPSectionsDirective {{.*}} +// CHECK-NEXT: `-CapturedStmt {{.*}} +// CHECK-NEXT: `-CapturedDecl {{.*}} <> +// CHECK-NEXT: |-CompoundStmt {{.*}} +// CHECK-NEXT: | `-NullStmt {{.*}} +// CHECK-NEXT: `-ImplicitParamDecl {{.*}} col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-sections.c:9:9) *const restrict' -- cgit v1.2.3