1 ! This test checks lowering of OpenMP Threadprivate Directive.
2 ! Test for threadprivate variable double use in use association.
4 !RUN: %flang_fc1 -emit-fir -fopenmp %s -o - | FileCheck %s
5 !RUN: bbc -emit-fir -fopenmp %s -o - | FileCheck %s
7 ! CHECK-LABEL: fir.global @_QMmEx : i32
10 !$omp threadprivate(x)
13 ! CHECK-LABEL: func.func @_QMm2Ptest() {
14 ! CHECK: %[[VAL_0:.*]] = fir.address_of(@_QMmEx) : !fir.ref<i32>
15 ! CHECK: %[[VAL_1:.*]] = omp.threadprivate %[[VAL_0]] : !fir.ref<i32> -> !fir.ref<i32>
16 ! CHECK: fir.call @_QPbar(%[[VAL_1]]) {{.*}}: (!fir.ref<i32>) -> ()
20 ! CHECK-LABEL: func.func @_QMm2FtestPinternal_test() {
21 ! CHECK: %[[VAL_0:.*]] = fir.address_of(@_QMmEx) : !fir.ref<i32>
22 ! CHECK: %[[VAL_1:.*]] = omp.threadprivate %[[VAL_0]] : !fir.ref<i32> -> !fir.ref<i32>
23 ! CHECK: fir.call @_QPbar(%[[VAL_1]]) {{.*}}: (!fir.ref<i32>) -> ()
34 subroutine internal_test()