blob: 543524c220bed86e7de0274450797ddca01061e2 [file] [log] [blame]
Alexey Bataevdb390212015-05-20 04:24:19 +00001// RUN: %clang_cc1 -verify -fopenmp -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
2// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
Douglas Katzman3459ce22015-10-08 04:24:12 +00003// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
Alexey Bataeva8a9153a2017-12-29 18:07:07 +00004
5// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
6// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
7// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
8// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
Alexey Bataevcc37cc12014-11-20 04:34:54 +00009// expected-no-diagnostics
Alexey Bataevcc37cc12014-11-20 04:34:54 +000010#ifndef HEADER
11#define HEADER
12
13template <class T>
14T tmain(T argc) {
15 static T a;
16#pragma omp flush
17#pragma omp flush(a)
18 return a + argc;
19}
20
21// CHECK-LABEL: @main
22int main() {
23 static int a;
24#pragma omp flush
25#pragma omp flush(a)
David Blaikieea3e51d2015-06-29 17:29:50 +000026 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
27 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
Alexey Bataevcc37cc12014-11-20 04:34:54 +000028 return tmain(a);
29 // CHECK: call {{.*}} [[TMAIN:@.+]](
30 // CHECK: ret
31}
32
33// CHECK: [[TMAIN]]
David Blaikieea3e51d2015-06-29 17:29:50 +000034// CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
35// CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
Alexey Bataevcc37cc12014-11-20 04:34:54 +000036// CHECK: ret
37
Alexey Bataeva9b9cc02018-01-23 18:12:38 +000038// CHECK-NOT: line: 0,
39
Alexey Bataevcc37cc12014-11-20 04:34:54 +000040#endif