|
19 | 19 | // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-linux -emit-llvm %s -o - | FileCheck -check-prefix=TLS-LAMBDA %s
|
20 | 20 | // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-linux -emit-llvm %s -o - | FileCheck -check-prefix=TLS-BLOCKS %s
|
21 | 21 | // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck -check-prefix=TLS-ARRAY %s
|
| 22 | +// RUN: %clang_cc1 -verify -fopenmp -x c++ -DNESTED -triple x86_64-linux -emit-llvm %s -o - | FileCheck %s -check-prefix=NESTED |
22 | 23 |
|
23 | 24 | // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-linux -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
|
24 | 25 | // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-linux -emit-pch -o %t %s
|
|
28 | 29 | // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
|
29 | 30 | // SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
|
30 | 31 | // expected-no-diagnostics
|
31 |
| -#ifndef ARRAY |
| 32 | +#if !defined(ARRAY) && !defined(NESTED) |
32 | 33 | #ifndef HEADER
|
33 | 34 | #define HEADER
|
34 | 35 |
|
@@ -493,7 +494,7 @@ int main() {
|
493 | 494 | // TLS-CHECK: ret void
|
494 | 495 |
|
495 | 496 | #endif
|
496 |
| -#else |
| 497 | +#elif defined(ARRAY) |
497 | 498 | // ARRAY-LABEL: array_func
|
498 | 499 | // TLS-ARRAY-LABEL: array_func
|
499 | 500 |
|
@@ -522,6 +523,24 @@ void array_func() {
|
522 | 523 | #pragma omp parallel copyin(a, s)
|
523 | 524 | ;
|
524 | 525 | }
|
525 |
| -#endif |
526 |
| - |
| 526 | +#elif defined(NESTED) |
| 527 | +int t; |
| 528 | +#pragma omp threadprivate(t) |
| 529 | +// NESTED: foo |
| 530 | +void foo() { |
| 531 | + // NESTED: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @{{.+}}, i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* [[OUTLINED:@.+]] to void (i32*, i32*, ...)*)) |
| 532 | +#pragma omp parallel |
| 533 | +#pragma omp parallel copyin(t) |
| 534 | + ++t; |
| 535 | +} |
| 536 | +// NESTED: define {{.*}}void [[OUTLINED]]( |
| 537 | +// NESTED: [[T:%.+]] = call i32* [[THRP_T:@.+]]() |
| 538 | +// NESTED: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @{{.+}}, i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*)* [[OUTLINED1:@.+]] to void (i32*, i32*, ...)*), i32* [[T]]) |
| 539 | + |
| 540 | +// NESTED: define {{.*}}void [[OUTLINED1]]( |
| 541 | +// NESTED: [[T_MASTER:%.+]] = load i32*, i32** % |
| 542 | +// NESTED: [[T:%.+]] = call i32* [[THRP_T]]() |
| 543 | +// NESTED: [[T_MASTER_VAL:%.+]] = load i32, i32* [[T_MASTER]], |
| 544 | +// NESTED: store i32 [[T_MASTER_VAL]], i32* [[T]], |
| 545 | +#endif // NESTED |
527 | 546 |
|
0 commit comments