Debian Codegraph @

clang/test/OpenMP/assume_lambda.cpp

raw
1 // RUN: %clang_cc1 -fopenmp -fopenmp-version=60 -x c++ -std=c++11 -ast-print %s | FileCheck %s
2 // expected-no-diagnostics
3
4 extern int bar(int);
5
6 int foo(int arg)
7 {
8 #pragma omp assume no_openmp_routines
9 {
10 auto fn = [](int x) { return bar(x); };
11 // CHECK: auto fn = [](int x) {
12 return fn(5);
13 }
14 #pragma omp assume no_openmp_constructs
15 {
16 auto fn = [](int x) { return bar(x); };
17 // CHECK: auto fn = [](int x) {
18 return fn(6);
19 }
20 }
21
22 class C {
23 public:
24 int foo(int a);
25 };
26
27 // We're really just checking that this parses. All the assumptions are thrown
28 // away immediately for now.
29 int C::foo(int a)
30 {
31 #pragma omp assume holds(sizeof(void*) == 8) absent(parallel)
32 {
33 auto fn = [](int x) { return bar(x); };
34 // CHECK: auto fn = [](int x) {
35 return fn(5);
36 }
37 }