|
1 | | -# REQUIRES: x86, shell |
| 1 | +# REQUIRES: x86 |
2 | 2 | # UNSUPPORTED: system-windows |
3 | 3 | # RUN: rm -rf %t; split-file %s %t |
4 | 4 | # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o |
|
9 | 9 | # RUN: env TZ=GMT touch -t "197001010000.32" %t/foo.o |
10 | 10 | # RUN: llvm-ar rcsU %t/foo.a %t/foo.o |
11 | 11 |
|
12 | | -# RUN: ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.o %t/no-debug.o -o %t/test |
13 | | -# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ |
14 | | -# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \ |
15 | | -# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 |
| 12 | +# RUN: env ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.o %t/no-debug.o -o %t/test |
| 13 | +# RUN: llvm-objdump --section-headers %t/test > %t.out |
| 14 | +# RUN: dsymutil -s %t/test >> %t.out |
| 15 | +# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \ |
| 16 | +# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --input-file %t.out |
16 | 17 |
|
17 | 18 | ## Check that we emit the right modtime even when the object file is in an |
18 | 19 | ## archive. |
19 | | -# RUN: ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.a %t/no-debug.o -o %t/test |
20 | | -# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ |
21 | | -# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ |
22 | | -# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 |
| 20 | +# RUN: env ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.a %t/no-debug.o -o %t/test |
| 21 | +# RUN: llvm-objdump --section-headers %t/test > %t.out |
| 22 | +# RUN: dsymutil -s %t/test >> %t.out |
| 23 | +# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ |
| 24 | +# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --input-file %t.out |
23 | 25 |
|
24 | 26 | ## Check that we don't emit modtimes if ZERO_AR_DATE is set. |
25 | 27 | # RUN: env ZERO_AR_DATE=1 %lld -lSystem %t/test.o %t/foo.o %t/no-debug.o \ |
26 | 28 | # RUN: -o %t/test |
27 | | -# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ |
28 | | -# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \ |
29 | | -# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 |
| 29 | +# RUN: llvm-objdump --section-headers %t/test > %t.out |
| 30 | +# RUN: dsymutil -s %t/test >> %t.out |
| 31 | +# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \ |
| 32 | +# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out |
30 | 33 | # RUN: env %lld -lSystem %t/test.o %t/foo.a %t/no-debug.o \ |
31 | 34 | # RUN: -o %t/test |
32 | | -# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ |
33 | | -# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ |
34 | | -# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 |
| 35 | +# RUN: llvm-objdump --section-headers %t/test > %t.out |
| 36 | +# RUN: dsymutil -s %t/test >> %t.out |
| 37 | +# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ |
| 38 | +# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out |
35 | 39 | # RUN: env %lld -lSystem %t/test.o %t/no-debug.o \ |
36 | 40 | # RUN: -all_load %t/foo.a -o %t/test |
37 | | -# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ |
38 | | -# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ |
39 | | -# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 |
| 41 | +# RUN: llvm-objdump --section-headers %t/test > %t.out |
| 42 | +# RUN: dsymutil -s %t/test >> %t.out |
| 43 | +# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ |
| 44 | +# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out |
40 | 45 | # RUN: env %lld -lSystem %t/test.o %t/no-debug.o \ |
41 | 46 | # RUN: -force_load %t/foo.a -o %t/test |
42 | | -# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ |
43 | | -# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ |
44 | | -# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 |
| 47 | +# RUN: llvm-objdump --section-headers %t/test > %t.out |
| 48 | +# RUN: dsymutil -s %t/test >> %t.out |
| 49 | +# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ |
| 50 | +# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out |
45 | 51 | # RUN: env ZERO_AR_DATE=0 %lld -lSystem -reproducible %t/test.o %t/foo.o \ |
46 | 52 | # RUN: %t/no-debug.o -o %t/test |
47 | | -# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ |
48 | | -# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \ |
49 | | -# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 |
| 53 | +# RUN: llvm-objdump --section-headers %t/test > %t.out |
| 54 | +# RUN: dsymutil -s %t/test >> %t.out |
| 55 | +# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \ |
| 56 | +# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out |
50 | 57 |
|
51 | 58 | ## Check that we emit absolute paths to the object files in our OSO entries |
52 | 59 | ## even if our inputs are relative paths. |
53 | | -# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -o test |
54 | | -# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ |
55 | | -# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \ |
56 | | -# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 |
| 60 | +# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -o test |
| 61 | +# RUN: llvm-objdump --section-headers %t/test > %t.out |
| 62 | +# RUN: dsymutil -s %t/test >> %t.out |
| 63 | +# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \ |
| 64 | +# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --input-file %t.out |
57 | 65 |
|
58 | 66 | ## Check that we emit relative path to object files in OSO entries |
59 | 67 | ## when -oso_prefix <path> is used. |
60 | | -# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t" -o %t/test-rel |
| 68 | +# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t" -o %t/test-rel |
61 | 69 | # RUN: dsymutil -s %t/test-rel | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-PATH |
62 | | -# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t/" -o %t/test-rel |
| 70 | +# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t/" -o %t/test-rel |
63 | 71 | # RUN: dsymutil -s %t/test-rel | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-PATH-NO-SLASH |
64 | | -# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o %t/test-rel-dot |
| 72 | +# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o %t/test-rel-dot |
65 | 73 | # RUN: dsymutil -s %t/test-rel-dot | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT |
66 | | -# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem ./test.o ./foo.o ./no-debug.o -oso_prefix "." -o %t/test-rel-dot |
| 74 | +# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem ./test.o ./foo.o ./no-debug.o -oso_prefix "." -o %t/test-rel-dot |
67 | 75 | # RUN: dsymutil -s %t/test-rel-dot | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT-EXPLICIT |
68 | 76 |
|
69 | 77 | ## Check that symlinks are not expanded when -oso_prefix . is used. |
70 | 78 | # RUN: mkdir -p %t/private/var/folders/tmp && ln -s private/var %t/var |
71 | 79 | # RUN: cp %t/test.o %t/foo.o %t/no-debug.o %t/private/var/folders/tmp |
72 | 80 | # RUN: env TZ=GMT touch -t "197001010000.16" %t/private/var/folders/tmp/test.o |
73 | 81 | # RUN: env TZ=GMT touch -t "197001010000.32" %t/private/var/folders/tmp/foo.o |
74 | | -# RUN: cd %t/var/folders/tmp && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o test-rel-symlink |
| 82 | +# RUN: cd %t/var/folders/tmp && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o test-rel-symlink |
75 | 83 | # RUN: dsymutil -s %t/private/var/folders/tmp/test-rel-symlink | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT |
76 | | -# RUN: cd %t/var/folders/tmp && ZERO_AR_DATE=0 %lld -lSystem ./test.o ./foo.o ./no-debug.o -oso_prefix "." -o test-rel-symlink |
| 84 | +# RUN: cd %t/var/folders/tmp && env ZERO_AR_DATE=0 %lld -lSystem ./test.o ./foo.o ./no-debug.o -oso_prefix "." -o test-rel-symlink |
77 | 85 | # RUN: dsymutil -s %t/private/var/folders/tmp/test-rel-symlink | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT-EXPLICIT |
78 | 86 |
|
79 | 87 | ## Check that we don't emit DWARF or stabs when -S is used |
|
82 | 90 | ## expect to not find any entries which requires the exit code to be negated. |
83 | 91 | # RUN: llvm-nm -ap %t/test-no-debug | not grep -e ' - ' |
84 | 92 |
|
85 | | -# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.a no-debug.o -o %t/test |
86 | | -# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ |
87 | | -# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ |
88 | | -# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 |
| 93 | +# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.a no-debug.o -o %t/test |
| 94 | +# RUN: llvm-objdump --section-headers %t/test > %t.out |
| 95 | +# RUN: dsymutil -s %t/test >> %t.out |
| 96 | +# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ |
| 97 | +# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --input-file %t.out |
89 | 98 |
|
90 | 99 | # CHECK: Sections: |
91 | 100 | # CHECK-NEXT: Idx Name |
|
159 | 168 | ## when forming N_SO. |
160 | 169 | # RUN: llvm-mc -filetype obj -triple=x86_64-apple-darwin %t/abs-path.s -o %t/abs-path.o |
161 | 170 | # RUN: %lld %t/abs-path.o -o %t/test |
162 | | -# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | FileCheck %s --check-prefix=ABS-PATH |
| 171 | +# RUN: llvm-objdump --section-headers %t/test > %t.out |
| 172 | +# RUN: dsymutil -s %t/test >> %t.out |
| 173 | +# RUN: FileCheck %s --check-prefix=ABS-PATH --input-file %t.out |
163 | 174 | # ABS-PATH: (N_SO ) 00 0000 0000000000000000 '/foo.cpp' |
164 | 175 |
|
165 | 176 | #--- test.s |
|
0 commit comments