2010-06-15 05:23:12 +08:00
|
|
|
// Check that we extract --no-demangle from '-Xlinker' and '-Wl,', since that
|
|
|
|
// was a collect2 argument.
|
|
|
|
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -### \
|
2010-06-15 05:23:12 +08:00
|
|
|
// RUN: -Xlinker one -Xlinker --no-demangle \
|
2015-09-11 06:31:45 +08:00
|
|
|
// RUN: -Wl,two,--no-demangle,three -Xlinker four -z five -r %s 2> %t
|
2012-08-17 11:39:16 +08:00
|
|
|
// RUN: FileCheck -check-prefix=DARWIN < %t %s
|
2020-05-17 14:32:28 +08:00
|
|
|
|
|
|
|
/// -T is reordered to the last to make sure -L takes precedence.
|
2012-08-17 11:39:16 +08:00
|
|
|
// RUN: %clang -target x86_64-pc-linux-gnu -### \
|
2020-07-31 14:49:32 +08:00
|
|
|
// RUN: -e _start -T a.lds -Xlinker one -Xlinker --no-demangle \
|
2015-09-11 06:31:45 +08:00
|
|
|
// RUN: -Wl,two,--no-demangle,three -Xlinker four -z five -r %s 2> %t
|
2012-08-17 11:39:16 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINUX < %t %s
|
2021-07-30 23:50:52 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target powerpc-unknown-aix -### \
|
|
|
|
// RUN: -b one %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=AIX < %t %s
|
|
|
|
|
|
|
|
// RUN: %clang -target powerpc-unknown-linux -### \
|
|
|
|
// RUN: -b one %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=NOT-AIX < %t %s
|
|
|
|
|
2012-08-17 11:39:16 +08:00
|
|
|
// DARWIN-NOT: --no-demangle
|
2015-09-11 06:31:45 +08:00
|
|
|
// DARWIN: "one" "two" "three" "four" "-z" "five" "-r"
|
2020-07-31 14:49:32 +08:00
|
|
|
// LINUX: "--no-demangle" "-e" "_start" "one" "two" "three" "four" "-z" "five" "-r" {{.*}} "-T" "a.lds"
|
2021-07-30 23:50:52 +08:00
|
|
|
// AIX: "-b" "one"
|
|
|
|
// NOT-AIX: error: unsupported option '-b' for target 'powerpc-unknown-linux'
|
2013-08-14 09:24:35 +08:00
|
|
|
|
|
|
|
// Check that we forward '-Xlinker' and '-Wl,' on Windows.
|
2021-03-19 21:37:19 +08:00
|
|
|
// RUN: %clang -target i686-pc-win32 -fuse-ld=link -### \
|
2013-08-14 09:24:35 +08:00
|
|
|
// RUN: -Xlinker one -Wl,two %s 2>&1 | \
|
|
|
|
// RUN: FileCheck -check-prefix=WIN %s
|
|
|
|
// WIN: link.exe
|
|
|
|
// WIN: "one"
|
|
|
|
// WIN: "two"
|