|
| 1 | +! Make sure that `-l` is "visible" to Flang's driver |
| 2 | +! RUN: %flang -lpgmath -### %s |
| 3 | + |
| 4 | +! Make sure that `-Wl` is "visible" to Flang's driver |
| 5 | +! RUN: %flang -Wl,abs -### %s |
| 6 | + |
| 7 | +! Make sure that `-fuse-ld' is "visible" to Flang's driver |
| 8 | +! RUN: %flang -fuse-ld= -### %s |
| 9 | + |
| 10 | +! Make sure that `-L' is "visible" to Flang's driver |
| 11 | +! RUN: %flang -L/ -### %s |
| 12 | + |
| 13 | +! ------------------------------------------------------------------------------ |
| 14 | +! Check that '-pie' and '-no-pie' are "visible" to Flang's driver. Check that |
| 15 | +! the correct option is added to the link line. |
| 16 | +! |
| 17 | +! Last match "wins" |
| 18 | +! RUN: %flang -target x86_64-pc-linux-gnu -pie -no-pie -### %s 2>&1 \ |
| 19 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 20 | +! RUN: %flang -target x86_64-pc-linux-gnu -no-pie -pie -### %s 2>&1 \ |
| 21 | +! RUN: | FileCheck %s --check-prefix=PIE |
| 22 | +! RUN: %flang -target x86_64-pc-linux-gnu -pie -### %s 2>&1 \ |
| 23 | +! RUN: | FileCheck %s --check-prefix=PIE |
| 24 | +! RUN: %flang -target x86_64-pc-linux-gnu -no-pie -### %s 2>&1 \ |
| 25 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 26 | +! |
| 27 | +! Ensure that "-pie" is passed to the linker. |
| 28 | +! RUN: %flang -target i386-unknown-freebsd -pie -### %s 2>&1 \ |
| 29 | +! RUN: | FileCheck %s --check-prefix=PIE |
| 30 | +! RUN: %flang -target aarch64-pc-linux-gnu -pie -### %s 2>&1 \ |
| 31 | +! RUN: | FileCheck %s --check-prefix=PIE |
| 32 | +! |
| 33 | +! On Musl Linux, PIE is enabled by default, but can be disabled. |
| 34 | +! RUN: %flang -target x86_64-linux-musl -### %s 2>&1 \ |
| 35 | +! RUN: | FileCheck %s --check-prefix=PIE |
| 36 | +! RUN: %flang -target i686-linux-musl -### %s 2>&1 \ |
| 37 | +! RUN: | FileCheck %s --check-prefix=PIE |
| 38 | +! RUN: %flang -target armv6-linux-musleabihf %s -### 2>&1 \ |
| 39 | +! RUN: | FileCheck %s --check-prefix=PIE |
| 40 | +! RUN: %flang -target armv7-linux-musleabihf %s -### 2>&1 \ |
| 41 | +! RUN: | FileCheck %s --check-prefix=PIE |
| 42 | +! RUN: %flang --target=x86_64-linux-musl -no-pie -### 2>&1 \ |
| 43 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 44 | +! |
| 45 | +! On OpenBSD, -pie is not passed to the linker, but can be forced. |
| 46 | +! RUN: %flang -target amd64-pc-openbsd -### %s 2>&1 \ |
| 47 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 48 | +! RUN: %flang -target i386-pc-openbsd -### %s 2>&1 \ |
| 49 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 50 | +! RUN: %flang -target aarch64-unknown-openbsd -### %s 2>&1 \ |
| 51 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 52 | +! RUN: %flang -target arm-unknown-openbsd -### %s 2>&1 \ |
| 53 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 54 | +! RUN: %flang -target powerpc-unknown-openbsd -### %s 2>&1 \ |
| 55 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 56 | +! RUN: %flang -target sparc64-unknown-openbsd -### %s 2>&1 \ |
| 57 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 58 | +! RUN: %flang -target i386-pc-openbsd -pie -### %s 2>&1 \ |
| 59 | +! RUN: | FileCheck %s --check-prefix=PIE |
| 60 | +! |
| 61 | +! On FreeBSD, -pie is not passed to the linker, but can be forced. |
| 62 | +! RUN: %flang -target amd64-pc-freebsd -### %s 2>&1 \ |
| 63 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 64 | +! RUN: %flang -target i386-pc-freebsd -### %s 2>&1 \ |
| 65 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 66 | +! RUN: %flang -target aarch64-unknown-freebsd -### %s 2>&1 \ |
| 67 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 68 | +! RUN: %flang -target arm-unknown-freebsd -### %s 2>&1 \ |
| 69 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 70 | +! RUN: %flang -target powerpc-unknown-freebsd -### %s 2>&1 \ |
| 71 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 72 | +! RUN: %flang -target sparc64-unknown-freebsd -### %s 2>&1 \ |
| 73 | +! RUN: | FileCheck %s --check-prefix=NO-PIE |
| 74 | +! RUN: %flang -target i386-pc-freebsd -pie -### %s 2>&1 \ |
| 75 | +! RUN: | FileCheck %s --check-prefix=PIE |
| 76 | +! |
| 77 | +! On AIX, -pie is never passed to the linker. |
| 78 | +! RUN: %flang -target powerpc64-unknown-aix -### %s 2>&1 \ |
| 79 | +! RUN: | FileCheck %s --check-prefixes=NO-PIE |
| 80 | +! RUN: %flang -target powerpc64-unknown-aix -pie -### %s 2>&1 \ |
| 81 | +! RUN: | FileCheck %s --check-prefixes=NO-PIE,UNUSED |
| 82 | +! RUN: %flang -target powerpc64-unknown-aix -no-pie -### %s 2>&1 \ |
| 83 | +! RUN: | FileCheck %s --check-prefixes=NO-PIE,UNUSED |
| 84 | +! |
| 85 | +! On MinGW and Windows, -pie may be specified, but it is ignored. |
| 86 | +! RUN: %flang -target aarch64-pc-windows-gnu -### %s 2>&1 \ |
| 87 | +! RUN: | FileCheck %s --check-prefixes=NO-PIE |
| 88 | +! RUN: %flang -target x86_64-pc-windows-gnu -pie -### %s 2>&1 \ |
| 89 | +! RUN: | FileCheck %s --check-prefixes=NO-PIE,UNUSED |
| 90 | +! RUN: %flang -target i686-pc-windows-gnu -no-pie -### %s 2>&1 \ |
| 91 | +! RUN: | FileCheck %s --check-prefixes=NO-PIE,UNUSED |
| 92 | +! RUN: %flang -target aarch64-windows-msvc -### %s 2>&1 \ |
| 93 | +! RUN: | FileCheck %s --check-prefixes=NO-PIE |
| 94 | +! RUN: %flang -target aarch64-windows-msvc -pie -### %s 2>&1 \ |
| 95 | +! RUN: | FileCheck %s --check-prefixes=NO-PIE,UNUSED |
| 96 | +! RUN: %flang -target aarch64-windows-msvc -no-pie -### %s 2>&1 \ |
| 97 | +! RUN: | FileCheck %s --check-prefixes=NO-PIE,UNUSED |
| 98 | +! |
| 99 | +! PIE: "-pie" |
| 100 | +! NO-PIE-NOT: "-pie" |
| 101 | +! UNUSED: warning: argument unused during compilation: '{{(-no)?}}-pie' |
| 102 | +! ------------------------------------------------------------------------------ |
| 103 | + |
| 104 | +program hello |
| 105 | + write(*,*), "Hello world!" |
| 106 | +end program hello |
0 commit comments