brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · e31b99b Raw
49 lines · cpp
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 - %s4 5// RUN: %clang_cc1 -triple x86_64 -verify=expected,dev -std=c++11\6// RUN:            -verify-ignore-unexpected=note \7// RUN:            -fopenmp -o - %s8 9// Test no infinite recursion in DeferredDiagnosticEmitter.10constexpr int foo(int *x) {11  return 0;12}13 14int a = foo(&a);15 16// Test no crash when both caller and callee have target directives.17int foo();18 19class B {20public:21  void barB(int *isHost) {22  #pragma omp target map(tofrom: isHost)23     {24       *isHost = foo();25     }26  }27};28 29class A : public B {30public:31  void barA(int *isHost) {32  #pragma omp target map(tofrom: isHost)33     {34       barB(isHost);35     }36  }37};38 39// Test that deleting an incomplete class type doesn't cause an assertion.40namespace TestDeleteIncompleteClassDefinition {41struct a;42struct b {43  b() {44    delete c; // expected-warning {{deleting pointer to incomplete type 'a' is incompatible with C++2c and may cause undefined behavior}}45  }46  a *c;47};48} // namespace TestDeleteIncompleteClassDefinition49