1 // RUN: %clang_cc1 -triple x86_64 -verify=expected,dev -std=c++11\
2 // RUN:            -verify-ignore-unexpected=note \
3 // RUN:            -fopenmp -fopenmp-version=45 -o - %s
4 
5 // RUN: %clang_cc1 -triple x86_64 -verify=expected,dev -std=c++11\
6 // RUN:            -verify-ignore-unexpected=note \
7 // RUN:            -fopenmp -o - %s
8 
9 // expected-no-diagnostics
10 
11 // Test no infinite recursion in DeferredDiagnosticEmitter.
foo(int * x)12 constexpr int foo(int *x) {
13   return 0;
14 }
15 
16 int a = foo(&a);
17 
18 // Test no crash when both caller and callee have target directives.
19 int foo();
20 
21 class B {
22 public:
barB(int * isHost)23   void barB(int *isHost) {
24   #pragma omp target map(tofrom: isHost)
25      {
26        *isHost = foo();
27      }
28   }
29 };
30 
31 class A : public B {
32 public:
barA(int * isHost)33   void barA(int *isHost) {
34   #pragma omp target map(tofrom: isHost)
35      {
36        barB(isHost);
37      }
38   }
39 };
40