[flang-commits] [flang] [Flang] Use a module directory to avoid race condition (PR #123215)
Kiran Chandramohan via flang-commits
flang-commits at lists.llvm.org
Thu Jan 16 08:29:17 PST 2025
https://github.com/kiranchandramohan updated https://github.com/llvm/llvm-project/pull/123215
>From 1fdbe07545ec5336f9bf7962fe7752a3da092e07 Mon Sep 17 00:00:00 2001
From: Kiran Chandramohan <kiran.chandramohan at arm.com>
Date: Thu, 16 Jan 2025 15:46:17 +0000
Subject: [PATCH 1/2] [Flang] Use a module directory to avoid race condition
Use a module directory in a test that uses another fortran test
to avoid race conditions in module creation.
---
flang/test/Lower/module_use.f90 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/flang/test/Lower/module_use.f90 b/flang/test/Lower/module_use.f90
index ad43865470b681..c7b29df882fadc 100644
--- a/flang/test/Lower/module_use.f90
+++ b/flang/test/Lower/module_use.f90
@@ -1,5 +1,6 @@
-! RUN: bbc -emit-fir %S/module_definition.f90
-! RUN: bbc -emit-fir %s -o - | FileCheck %s
+! RUN: rm -fr %t && mkdir %t
+! RUN: bbc -emit-fir -module %t %S/module_definition.f90
+! RUN: bbc -emit-fir -J %t %s -o - | FileCheck %s
! Test use of module data not defined in this file.
! The modules are defined in module_definition.f90
>From 3aa9057d298cbf983a84caf156a59fc4dee65add Mon Sep 17 00:00:00 2001
From: Kiran Chandramohan <kiran.chandramohan at arm.com>
Date: Thu, 16 Jan 2025 16:24:44 +0000
Subject: [PATCH 2/2] Create parent directories if necessary
---
flang/test/Lower/module_use.f90 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/flang/test/Lower/module_use.f90 b/flang/test/Lower/module_use.f90
index c7b29df882fadc..b976663239ef5a 100644
--- a/flang/test/Lower/module_use.f90
+++ b/flang/test/Lower/module_use.f90
@@ -1,4 +1,4 @@
-! RUN: rm -fr %t && mkdir %t
+! RUN: rm -fr %t && mkdir -p %t
! RUN: bbc -emit-fir -module %t %S/module_definition.f90
! RUN: bbc -emit-fir -J %t %s -o - | FileCheck %s
More information about the flang-commits
mailing list