[flang-commits] [flang] [flang] Fix crash with USE of hermetic module file (PR #138785)

via flang-commits flang-commits at lists.llvm.org
Wed May 7 00:45:11 PDT 2025


================
@@ -0,0 +1,17 @@
+!RUN: (%flang -c -DWHICH=1 %s && %flang -c -DWHICH=2 %s && %flang_fc1 -fdebug-unparse %s) | FileCheck %s
+
+#if WHICH == 1
+module m1
+  use iso_c_binding
+end
+#elif WHICH == 2
+module m2
+  use m1
+end
+#else
+program test
+  use m2
+!CHECK: INTEGER(KIND=4_4) n
+  integer(c_int) n
----------------
jeanPerier wrote:

Something is broken here. See buildbots "flang/test/Semantics/modfile75.F90:15:11: error: Must be a constant value".

I am thinking this could be a lit "race" with module file (I am not sure, but I think all the tests are ran in the same directory in parallel, which would cause the issue since `m1` are common names and could be overridden before the final part of the test).

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


More information about the flang-commits mailing list