File: driver.test

package info (click to toggle)
llvm-toolchain-7 1%3A7.0.1-8
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 733,456 kB
  • sloc: cpp: 3,776,651; ansic: 633,271; asm: 350,301; python: 142,716; objc: 107,612; sh: 22,626; lisp: 11,056; perl: 7,999; pascal: 6,742; ml: 5,537; awk: 3,536; makefile: 2,557; cs: 2,027; xml: 841; ruby: 156
file content (70 lines) | stat: -rw-r--r-- 2,755 bytes parent folder | download | duplicates (3)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# REQUIRES: x86

# RUN: not ld.lld --unknown1 --unknown2 -m foo /no/such/file -lnosuchlib \
# RUN:   2>&1 | FileCheck -check-prefix=UNKNOWN %s

# UNKNOWN: unknown argument: --unknown1
# UNKNOWN: unknown argument: --unknown2
# UNKNOWN: unknown emulation: foo
# UNKNOWN: cannot open /no/such/file
# UNKNOWN: unable to find library -lnosuchlib

# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
# RUN: not ld.lld %t -o /no/such/file 2>&1 | FileCheck -check-prefix=MISSING %s
# MISSING: cannot open output file /no/such/file

# RUN: ld.lld --help 2>&1 | FileCheck -check-prefix=HELP %s
# HELP: USAGE:
# HELP: : supported targets:{{.*}} elf

# RUN: ld.lld --version 2>&1 | FileCheck -check-prefix=VERSION %s
# RUN: ld.lld -v 2>&1 | FileCheck -check-prefix=VERSION %s
# RUN: not ld.lld -v xyz 2>&1 | FileCheck -check-prefix=VERSION %s
# VERSION: LLD {{.*}} (compatible with GNU linkers)

## Attempt to link DSO with -r
# RUN: ld.lld -shared %t -o %t.so
# RUN: not ld.lld -r %t.so %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR %s
# ERR: attempted static link of dynamic object

## Attempt to use -r and -shared together
# RUN: not ld.lld -r -shared %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR2 %s
# ERR2: -r and -shared may not be used together

## Attempt to use -r and --gc-sections together
# RUN: not ld.lld -r --gc-sections %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR3 %s
# ERR3: -r and --gc-sections may not be used together

## Attempt to use -r and --gdb-index together
# RUN: not ld.lld -r --gdb-index %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR4 %s
# ERR4: -r and --gdb-index may not be used together

## Attempt to use -r and --icf together
# RUN: not ld.lld -r --icf=all %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR5 %s
# ERR5: -r and --icf may not be used together

## Attempt to use -r and -pie together
# RUN: not ld.lld -r -pie %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR6 %s
# ERR6: -r and -pie may not be used together

## Attempt to use -shared and -pie together
# RUN: not ld.lld -shared -pie %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR7 %s
# ERR7: -shared and -pie may not be used together

## "--output=foo" is equivalent to "-o foo".
# RUN: not ld.lld %t --output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR8 %s
# ERR8: cannot open output file /no/such/file

## "-output=foo" is equivalent to "-o utput=foo".
# RUN: not ld.lld %t -output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR9 %s
# ERR9: cannot open output file utput=/no/such/file

# RUN: not ld.lld %t -z foo 2>&1 | FileCheck -check-prefix=ERR10 %s
# ERR10: unknown -z value: foo

# RUN: not ld.lld %t -z max-page-size 2>&1 | FileCheck -check-prefix=ERR11 %s
# ERR11: unknown -z value: max-page-size

.globl _start
_start:
  nop