================
@@ -6,8 +6,8 @@
 !-----------------------------------------
 ! FRONTEND FLANG DRIVER (flang -fc1)
 !-----------------------------------------
-! RUN: %flang_fc1 -fsyntax-only %s  2>&1 | FileCheck %s --allow-empty 
--check-prefix=WITHOUT
-! RUN: not %flang_fc1 -fsyntax-only -fintrinsic-modules-path %S/Inputs/ %s  
2>&1 | FileCheck %s --check-prefix=GIVEN
+! RUN:     %flang_bare -fsyntax-only                                     %s 
%intrinsic_module_flags 2>&1 | FileCheck %s --check-prefix=WITHOUT --allow-empty
----------------
Meinersbur wrote:

Some additional notes:
%flang_bare` actually is the driver (i.e. not `flang -fc1`, have to change the 
comments). The problem is that the intrinsic modules may not be in the resource 
directory, but in the directory defined by `FLANG_INTRINSIC_MODULES_DIR`, as 
otherwise it would not be possible run check-flang tests in a Flang-standalone 
build (that does not build flang-rt, hence no intrinsic modules).
`FLANG_INTRINSIC_MODULES_DIR` is implemented by replacing `flang` with `flang 
-fintrinsic-modules-path ${FLANG_INTRINSIC_MODULES_DIR}`, i.e. always comes 
first in the command line. This means it will always have priority over 
`-fintrinsic-modules-path %S/Inputs/`. This is incompatible with the second RUN 
line that depends on the files in  `%S/Inputs/` being picked up.
Hence, this test adds `-fintrinsic-modules-path ${FLANG_INTRINSIC_MODULES_DIR}` 
(if necessary) after  `-fintrinsic-modules-path %S/Inputs/`, since with a 
`%flang` substitution it is not possible to put it behind all other flags. 
`%flang_bare` avoids that `-fintrinsic-modules-path 
${FLANG_INTRINSIC_MODULES_DIR}` is (also) added before `%S/Inputs/`.

One could also redesign this test, i.e. that it expects the default intrinsic 
modules to be matched, not the ones in `%S/Inputs/`.

https://github.com/llvm/llvm-project/pull/137828
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to