Skip to content

Commit 07abde2

Browse files
authored
[flang][driver] Fix Driver/isysroot.f90 test (#78478)
Check for DEFAULT_SYSROOT, because when it is set -isysroot has no effect.
1 parent 30d4586 commit 07abde2

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

flang/test/Driver/isysroot.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
! Verify that the -isysroot flag is known to the frontend and, on Darwin,
22
! is passed on to the linker.
33

4+
! When DEFAULT_SYSROOT is set -isysroot has no effect.
5+
! REQUIRES: !default_sysroot
46
! RUN: %flang -### --target=aarch64-apple-darwin -isysroot /path/to/sysroot \
57
! RUN: %s 2>&1 | FileCheck %s --check-prefix=CHECK-DARWIN
68
! RUN: %flang -### --target=aarch64-linux-gnu -isysroot /path/to/sysroot \

flang/test/lit.cfg.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@
123123
if config.osx_sysroot:
124124
isysroot_flag = ["-isysroot", config.osx_sysroot]
125125

126+
# Check for DEFAULT_SYSROOT, because when it is set -isysroot has no effect.
127+
if config.default_sysroot:
128+
config.available_features.add("default_sysroot")
129+
126130
# For each occurrence of a flang tool name, replace it with the full path to
127131
# the build directory holding that tool.
128132
tools = [

flang/test/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ config.linked_bye_extension = @LLVM_BYE_LINK_INTO_TOOLS@
2424
config.cc = "@CMAKE_C_COMPILER@"
2525
config.osx_sysroot = path(r"@CMAKE_OSX_SYSROOT@")
2626
config.targets_to_build = "@TARGETS_TO_BUILD@"
27+
config.default_sysroot = "@DEFAULT_SYSROOT@"
2728

2829
import lit.llvm
2930
lit.llvm.initialize(lit_config, config)

0 commit comments

Comments
 (0)