xref: /llvm-project/flang/test/Driver/isysroot.f90 (revision 5d33010f5edee8030d7b7d78c6e6f6992b659082)
1! Verify that the -isysroot flag is known to the frontend and, on Darwin,
2! is passed on to the linker.
3
4! When DEFAULT_SYSROOT is set -isysroot has no effect.
5! REQUIRES: !default_sysroot
6! RUN: %flang -### --target=aarch64-apple-darwin -isysroot /path/to/sysroot \
7! RUN:        %s 2>&1 | FileCheck %s --check-prefix=CHECK-DARWIN
8! RUN: %flang -### --target=aarch64-linux-gnu -isysroot /path/to/sysroot \
9! RUN:        %s 2>&1 | FileCheck %s --check-prefix=CHECK-LINUX
10
11! CHECK-DARWIN: "{{.*}}ld{{(64)?(\.lld)?(\.exe)?}}" {{.*}}"-syslibroot" "/path/to/sysroot"
12! Unused on Linux.
13! CHECK-LINUX: warning: argument unused during compilation: '-isysroot /path/to/sysroot'
14! CHECK-LINUX-NOT: /path/to/sysroot
15