[flang-commits] [flang] [Flang][OpenMP] Fix default firstprivatization miscategorization of mod file symbols (PR #157009)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Mon Sep 8 12:27:04 PDT 2025


================
@@ -0,0 +1,37 @@
+! Test that we appropriately categorize types as firstprivate even across
+! module boundaries.
+
+!RUN: split-file %s %t
+
+!RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization-staging -fopenmp-version=50 %t/imp_scalar_map_module.f90 -o - \
+!RUN: | %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization-staging  -fopenmp-version=50 %t/imp_scalar_map_target.f90 -o - \
+!RUN: | FileCheck %t/imp_scalar_map_target.f90
----------------
luporl wrote:

Unfortunately this test is failing sometimes, on some bots, although I couldn't reproduce it.

We could try to not pipe the output of the first RUN to the second one. Maybe this will ensure`test_data.mod` will always be ready before the second RUN starts.

```
!RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization-staging -fopenmp-version=50 %t/imp_scalar_map_module.f90
!RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization-staging  -fopenmp-version=50 %t/imp_scalar_map_target.f90 -o - \
!RUN: | FileCheck %t/imp_scalar_map_target.f90
```

https://github.com/llvm/llvm-project/pull/157009


More information about the flang-commits mailing list