75 lines · cpp
1// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s | FileCheck %s2// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s3// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s4 5// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=60 -ast-print %s | FileCheck %s6// RUN: %clang_cc1 -fopenmp -fopenmp-version=60 -x c++ -std=c++11 -emit-pch -o %t %s7// RUN: %clang_cc1 -fopenmp -fopenmp-version=60 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s8 9// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s | FileCheck %s10// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s11// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s12 13// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=60 -ast-print %s | FileCheck %s14// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=60 -x c++ -std=c++11 -emit-pch -o %t %s15// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=60 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s16// expected-no-diagnostics17 18#ifndef HEADER19#define HEADER20 21void foo() {}22 23template <class T>24T tmain(T argc) {25 static T a;26#pragma omp flush27#pragma omp flush acq_rel28#pragma omp flush acquire29#pragma omp flush release30#pragma omp flush seq_cst31#pragma omp flush(a)32 return a + argc;33}34// CHECK: static T a;35// CHECK-NEXT: #pragma omp flush{{$}}36// CHECK-NEXT: #pragma omp flush acq_rel{{$}}37// CHECK-NEXT: #pragma omp flush acquire{{$}}38// CHECK-NEXT: #pragma omp flush release{{$}}39// CHECK-NEXT: #pragma omp flush seq_cst{{$}}40// CHECK-NEXT: #pragma omp flush (a)41// CHECK: static int a;42// CHECK-NEXT: #pragma omp flush43// CHECK-NEXT: #pragma omp flush acq_rel{{$}}44// CHECK-NEXT: #pragma omp flush acquire{{$}}45// CHECK-NEXT: #pragma omp flush release{{$}}46// CHECK-NEXT: #pragma omp flush seq_cst{{$}}47// CHECK-NEXT: #pragma omp flush (a)48// CHECK: static char a;49// CHECK-NEXT: #pragma omp flush50// CHECK-NEXT: #pragma omp flush acq_rel{{$}}51// CHECK-NEXT: #pragma omp flush acquire{{$}}52// CHECK-NEXT: #pragma omp flush release{{$}}53// CHECK-NEXT: #pragma omp flush seq_cst{{$}}54// CHECK-NEXT: #pragma omp flush (a)55 56int main(int argc, char **argv) {57 static int a;58// CHECK: static int a;59#pragma omp flush60#pragma omp flush acq_rel61#pragma omp flush acquire62#pragma omp flush release63#pragma omp flush seq_cst64#pragma omp flush(a)65// CHECK-NEXT: #pragma omp flush66// CHECK-NEXT: #pragma omp flush acq_rel67// CHECK-NEXT: #pragma omp flush acquire{{$}}68// CHECK-NEXT: #pragma omp flush release69// CHECK-NEXT: #pragma omp flush seq_cst70// CHECK-NEXT: #pragma omp flush (a)71 return tmain(argc) + tmain(argv[0][0]) + a;72}73 74#endif75