File: Xlinker-args.c

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-16
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,496,368 kB
  • sloc: cpp: 5,593,980; ansic: 986,873; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,547; xml: 953; cs: 573; fortran: 567
file content (41 lines) | stat: -rw-r--r-- 1,647 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Check that we extract --no-demangle from '-Xlinker' and '-Wl,', since that
// was a collect2 argument.

// RUN: %clang -target i386-apple-darwin9 -### \
// RUN:   -Xlinker one -Xlinker --no-demangle \
// RUN:   -Wl,two,--no-demangle,three -Xlinker four -z five -r %s 2> %t
// RUN: FileCheck -check-prefix=DARWIN < %t %s

/// -T is reordered to the last to make sure -L takes precedence.
// RUN: %clang -target x86_64-pc-linux-gnu -### \
// RUN:   -e _start -T a.lds -Xlinker one -Xlinker --no-demangle \
// RUN:   -Wl,two,--no-demangle,three -Xlinker four -z five -r %s 2> %t
// RUN: FileCheck -check-prefix=LINUX < %t %s

/// Check that --no-demangle gets forwarded to the mingw linker
// RUN: %clang -target x86_64-w64-mingw32 -### \
// RUN:   -Wl,--no-demangle %s 2> %t
// RUN: FileCheck -check-prefix=MINGW < %t %s

// RUN: %clang -target powerpc-unknown-aix -### \
// RUN:   -b one -b two %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

// DARWIN-NOT: --no-demangle
// DARWIN: "one" "two" "three" "four" "-z" "five" "-r"
// LINUX: "--no-demangle" "-e" "_start" "one" "two" "three" "four" "-z" "five" "-r" {{.*}} "-T" "a.lds"
// MINGW: "--no-demangle"
// AIX: "-b" "one" "-b" "two"
// NOT-AIX: error: unsupported option '-b' for target 'powerpc-unknown-linux'

// Check that we forward '-Xlinker' and '-Wl,' on Windows.
// RUN: %clang -target i686-pc-win32 -fuse-ld=link -### \
// RUN:   -Xlinker one -Wl,two %s 2>&1 | \
// RUN:   FileCheck -check-prefix=WIN %s
// WIN: link.exe
// WIN: "one"
// WIN: "two"