blob: 87b238b3b9d828378e6e1fc4066427750b7a1b4f [file] [log] [blame]
Daniel Dunbarf78925f2010-06-14 21:23:12 +00001// Check that we extract --no-demangle from '-Xlinker' and '-Wl,', since that
2// was a collect2 argument.
3
Sebastian Pop9ec60df2012-01-20 22:01:23 +00004// RUN: %clang -target i386-apple-darwin9 -### \
Daniel Dunbarf78925f2010-06-14 21:23:12 +00005// RUN: -Xlinker one -Xlinker --no-demangle \
Stephen Hines176edba2014-12-01 14:53:08 -08006// RUN: -Wl,two,--no-demangle,three -Xlinker four -z five %s 2> %t
Nick Lewyckye276cfc2012-08-17 03:39:16 +00007// RUN: FileCheck -check-prefix=DARWIN < %t %s
Daniel Dunbarf78925f2010-06-14 21:23:12 +00008//
Nick Lewyckye276cfc2012-08-17 03:39:16 +00009// RUN: %clang -target x86_64-pc-linux-gnu -### \
10// RUN: -Xlinker one -Xlinker --no-demangle \
Stephen Hines176edba2014-12-01 14:53:08 -080011// RUN: -Wl,two,--no-demangle,three -Xlinker four -z five %s 2> %t
Nick Lewyckye276cfc2012-08-17 03:39:16 +000012// RUN: FileCheck -check-prefix=LINUX < %t %s
13//
14// DARWIN-NOT: --no-demangle
Stephen Hines176edba2014-12-01 14:53:08 -080015// DARWIN: "one" "two" "three" "four" "-z" "five"
16// LINUX: "--no-demangle" "one" "two" "three" "four" "-z" "five"
Hans Wennborg2388b772013-08-14 01:24:35 +000017
18// Check that we forward '-Xlinker' and '-Wl,' on Windows.
19// RUN: %clang -target i686-pc-win32 -### \
20// RUN: -Xlinker one -Wl,two %s 2>&1 | \
21// RUN: FileCheck -check-prefix=WIN %s
22// WIN: link.exe
23// WIN: "one"
24// WIN: "two"