Skip to content

[flang][driver] Fix Driver/isysroot.f90 test #78478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions flang/test/Driver/isysroot.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
! Verify that the -isysroot flag is known to the frontend and, on Darwin,
! is passed on to the linker.

! When DEFAULT_SYSROOT is set -isysroot has no effect.
! REQUIRES: !default_sysroot
! RUN: %flang -### --target=aarch64-apple-darwin -isysroot /path/to/sysroot \
! RUN: %s 2>&1 | FileCheck %s --check-prefix=CHECK-DARWIN
! RUN: %flang -### --target=aarch64-linux-gnu -isysroot /path/to/sysroot \
Expand Down
4 changes: 4 additions & 0 deletions flang/test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@
if config.osx_sysroot:
isysroot_flag = ["-isysroot", config.osx_sysroot]

# Check for DEFAULT_SYSROOT, because when it is set -isysroot has no effect.
if config.default_sysroot:
config.available_features.add("default_sysroot")

# For each occurrence of a flang tool name, replace it with the full path to
# the build directory holding that tool.
tools = [
Expand Down
1 change: 1 addition & 0 deletions flang/test/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ config.linked_bye_extension = @LLVM_BYE_LINK_INTO_TOOLS@
config.cc = "@CMAKE_C_COMPILER@"
config.osx_sysroot = path(r"@CMAKE_OSX_SYSROOT@")
config.targets_to_build = "@TARGETS_TO_BUILD@"
config.default_sysroot = "@DEFAULT_SYSROOT@"

import lit.llvm
lit.llvm.initialize(lit_config, config)
Expand Down