1 // Check that we extract --no-demangle from '-Xlinker' and '-Wl,', since that
2 // was a collect2 argument.
4 // RUN: %clang -target i386-apple-darwin9 -### \
5 // RUN: -Xlinker one -Xlinker --no-demangle \
6 // RUN: -Wl,two,--no-demangle,three -Xlinker four -z five -r %s 2> %t
7 // RUN: FileCheck -check-prefix=DARWIN < %t %s
9 /// -T is reordered to the last to make sure -L takes precedence.
10 // RUN: %clang -target x86_64-pc-linux-gnu -### \
11 // RUN: -e _start -T a.lds -Xlinker one -Xlinker --no-demangle \
12 // RUN: -Wl,two,--no-demangle,three -Xlinker four -z five -r %s 2> %t
13 // RUN: FileCheck -check-prefix=LINUX < %t %s
15 /// Check that --no-demangle gets forwarded to the mingw linker
16 // RUN: %clang -target x86_64-w64-mingw32 -### \
17 // RUN: -Wl,--no-demangle %s 2> %t
18 // RUN: FileCheck -check-prefix=MINGW < %t %s
20 // RUN: %clang -target powerpc-unknown-aix -### \
21 // RUN: -b one -b two %s 2> %t
22 // RUN: FileCheck -check-prefix=AIX < %t %s
24 // RUN: %clang -target powerpc-unknown-linux -### \
25 // RUN: -b one %s 2> %t
26 // RUN: FileCheck -check-prefix=NOT-AIX < %t %s
28 // DARWIN-NOT: --no-demangle
29 // DARWIN: "one" "two" "three" "four" "-z" "five" "-r"
30 // LINUX: "--no-demangle" "-e" "_start" "one" "two" "three" "four" "-z" "five" "-r" {{.*}} "-T" "a.lds"
31 // MINGW: "--no-demangle"
32 // AIX: "-b" "one" "-b" "two"
33 // NOT-AIX: error: unsupported option '-b' for target 'powerpc-unknown-linux'
35 // Check that we forward '-Xlinker' and '-Wl,' on Windows.
36 // RUN: %clang -target i686-pc-win32 -fuse-ld=link -### \
37 // RUN: -Xlinker one -Wl,two %s 2>&1 | \
38 // RUN: FileCheck -check-prefix=WIN %s