llvm.org GIT mirror llvm / ea54773
[llvm] Get rid of "%T" expansions The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in llvm. Differential Revision: https://reviews.llvm.org/D36495 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310953 91177308-0d34-0410-b5e6-96231b3b80d8 Kuba Mracek 2 years ago
68 changed file(s) with 398 addition(s) and 367 deletion(s). Raw diff Collapse all Expand all
None (* RUN: cp %s %T/analysis.ml
1 * RUN: %ocamlc -g -w +A -package llvm.analysis -linkpkg %T/analysis.ml -o %t
2 * RUN: %t
3 * RUN: %ocamlopt -g -w +A -package llvm.analysis -linkpkg %T/analysis.ml -o %t
4 * RUN: %t
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/analysis.ml
1 * RUN: %ocamlc -g -w +A -package llvm.analysis -linkpkg %t/analysis.ml -o %t/executable
2 * RUN: %t/executable
3 * RUN: %ocamlopt -g -w +A -package llvm.analysis -linkpkg %t/analysis.ml -o %t/executable
4 * RUN: %t/executable
55 * XFAIL: vg_leak
66 *)
77
None (* RUN: cp %s %T/bitreader.ml
1 * RUN: %ocamlc -g -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitreader.ml -o %t
2 * RUN: %t %t.bc
3 * RUN: %ocamlopt -g -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitreader.ml -o %t
4 * RUN: %t %t.bc
5 * RUN: llvm-dis < %t.bc
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/bitreader.ml
1 * RUN: %ocamlc -g -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %t/bitreader.ml -o %t/executable
2 * RUN: %t/executable %t/bitcode.bc
3 * RUN: %ocamlopt -g -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %t/bitreader.ml -o %t/executable
4 * RUN: %t/executable %t/bitcode.bc
5 * RUN: llvm-dis < %t/bitcode.bc
66 * XFAIL: vg_leak
77 *)
88
None (* RUN: cp %s %T/bitwriter.ml
1 * RUN: %ocamlc -g -w -3 -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitwriter.ml -o %t
2 * RUN: %t %t.bc
3 * RUN: %ocamlopt -g -w -3 -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitwriter.ml -o %t
4 * RUN: %t %t.bc
5 * RUN: llvm-dis < %t.bc
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/bitwriter.ml
1 * RUN: %ocamlc -g -w -3 -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %t/bitwriter.ml -o %t/executable
2 * RUN: %t/executable %t/bitcode.bc
3 * RUN: %ocamlopt -g -w -3 -w +A -package llvm.bitreader -package llvm.bitwriter -linkpkg %t/bitwriter.ml -o %t/executable
4 * RUN: %t/executable %t/bitcode.bc
5 * RUN: llvm-dis < %t/bitcode.bc
66 * XFAIL: vg_leak
77 *)
88
None (* RUN: cp %s %T/core.ml
1 * RUN: %ocamlc -g -w +A -package llvm.analysis -package llvm.bitwriter -linkpkg %T/core.ml -o %t
2 * RUN: %t %t.bc
3 * RUN: %ocamlopt -g -w +A -package llvm.analysis -package llvm.bitwriter -linkpkg %T/core.ml -o %t
4 * RUN: %t %t.bc
5 * RUN: llvm-dis < %t.bc > %t.ll
6 * RUN: FileCheck %s < %t.ll
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/core.ml
1 * RUN: %ocamlc -g -w +A -package llvm.analysis -package llvm.bitwriter -linkpkg %t/core.ml -o %t/executable
2 * RUN: %t/executable %t/bitcode.bc
3 * RUN: %ocamlopt -g -w +A -package llvm.analysis -package llvm.bitwriter -linkpkg %t/core.ml -o %t/executable
4 * RUN: %t/executable %t/bitcode.bc
5 * RUN: llvm-dis < %t/bitcode.bc > %t/dis.ll
6 * RUN: FileCheck %s < %t/dis.ll
77 * Do a second pass for things that shouldn't be anywhere.
8 * RUN: FileCheck -check-prefix=CHECK-NOWHERE %s < %t.ll
8 * RUN: FileCheck -check-prefix=CHECK-NOWHERE %s < %t/dis.ll
99 * XFAIL: vg_leak
1010 *)
1111
None (* RUN: cp %s %T/diagnostic_handler.ml
1 * RUN: %ocamlc -g -w +A -package llvm.bitreader -linkpkg %T/diagnostic_handler.ml -o %t
2 * RUN: %t %t.bc | FileCheck %s
3 * RUN: %ocamlopt -g -w +A -package llvm.bitreader -linkpkg %T/diagnostic_handler.ml -o %t
4 * RUN: %t %t.bc | FileCheck %s
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/diagnostic_handler.ml
1 * RUN: %ocamlc -g -w +A -package llvm.bitreader -linkpkg %t/diagnostic_handler.ml -o %t/executable
2 * RUN: %t/executable %t/bitcode.bc | FileCheck %s
3 * RUN: %ocamlopt -g -w +A -package llvm.bitreader -linkpkg %t/diagnostic_handler.ml -o %t/executable
4 * RUN: %t/executable %t/bitcode.bc | FileCheck %s
55 * XFAIL: vg_leak
66 *)
77
None (* RUN: cp %s %T/executionengine.ml
1 * RUN: %ocamlc -g -w +A -package llvm.executionengine -linkpkg %T/executionengine.ml -o %t
2 * RUN: %t
3 * RUN: %ocamlopt -g -w +A -package llvm.executionengine -linkpkg %T/executionengine.ml -o %t
4 * RUN: %t
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/executionengine.ml
1 * RUN: %ocamlc -g -w +A -package llvm.executionengine -linkpkg %t/executionengine.ml -o %t/executable
2 * RUN: %t/executable
3 * RUN: %ocamlopt -g -w +A -package llvm.executionengine -linkpkg %t/executionengine.ml -o %t/executable
4 * RUN: %t/executable
55 * REQUIRES: native, object-emission
66 * XFAIL: vg_leak
77 *)
None (* RUN: cp %s %T/ext_exc.ml
1 * RUN: %ocamlc -g -w +A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
2 * RUN: %t
3 * RUN: %ocamlopt -g -w +A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
4 * RUN: %t
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/ext_exc.ml
1 * RUN: %ocamlc -g -w +A -package llvm.bitreader -linkpkg %t/ext_exc.ml -o %t/executable
2 * RUN: %t/executable
3 * RUN: %ocamlopt -g -w +A -package llvm.bitreader -linkpkg %t/ext_exc.ml -o %t/executable
4 * RUN: %t/executable
55 * XFAIL: vg_leak
66 *)
77
None (* RUN: cp %s %T/ipo_opts.ml
1 * RUN: %ocamlc -g -w +A -package llvm.ipo -linkpkg %T/ipo_opts.ml -o %t
2 * RUN: %t %t.bc
3 * RUN: %ocamlopt -g -w +A -package llvm.ipo -linkpkg %T/ipo_opts.ml -o %t
4 * RUN: %t %t.bc
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/ipo_opts.ml
1 * RUN: %ocamlc -g -w +A -package llvm.ipo -linkpkg %t/ipo_opts.ml -o %t/executable
2 * RUN: %t/executable %t/bitcode.bc
3 * RUN: %ocamlopt -g -w +A -package llvm.ipo -linkpkg %t/ipo_opts.ml -o %t/executable
4 * RUN: %t/executable %t/bitcode.bc
55 * XFAIL: vg_leak
66 *)
77
None (* RUN: cp %s %T/irreader.ml
1 * RUN: %ocamlc -g -w +A -package llvm.irreader -linkpkg %T/irreader.ml -o %t
2 * RUN: %t
3 * RUN: %ocamlopt -g -w +A -package llvm.irreader -linkpkg %T/irreader.ml -o %t
4 * RUN: %t
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/irreader.ml
1 * RUN: %ocamlc -g -w +A -package llvm.irreader -linkpkg %t/irreader.ml -o %t/executable
2 * RUN: %t/executable
3 * RUN: %ocamlopt -g -w +A -package llvm.irreader -linkpkg %t/irreader.ml -o %t/executable
4 * RUN: %t/executable
55 * XFAIL: vg_leak
66 *)
77
None (* RUN: cp %s %T/linker.ml
1 * RUN: %ocamlc -g -w +A -package llvm.linker -linkpkg %T/linker.ml -o %t
2 * RUN: %t
3 * RUN: %ocamlopt -g -w +A -package llvm.linker -linkpkg %T/linker.ml -o %t
4 * RUN: %t
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/linker.ml
1 * RUN: %ocamlc -g -w +A -package llvm.linker -linkpkg %t/linker.ml -o %t/executable
2 * RUN: %t/executable
3 * RUN: %ocamlopt -g -w +A -package llvm.linker -linkpkg %t/linker.ml -o %t/executable
4 * RUN: %t/executable
55 * XFAIL: vg_leak
66 *)
77
None (* RUN: cp %s %T/passmgr_builder.ml
1 * RUN: %ocamlc -g -w +A -package llvm.passmgr_builder -linkpkg %T/passmgr_builder.ml -o %t
2 * RUN: %t %t.bc
3 * RUN: %ocamlopt -g -w +A -package llvm.passmgr_builder -linkpkg %T/passmgr_builder.ml -o %t
4 * RUN: %t %t.bc
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/passmgr_builder.ml
1 * RUN: %ocamlc -g -w +A -package llvm.passmgr_builder -linkpkg %t/passmgr_builder.ml -o %t/executable
2 * RUN: %t/executable %t/bitcode.bc
3 * RUN: %ocamlopt -g -w +A -package llvm.passmgr_builder -linkpkg %t/passmgr_builder.ml -o %t/executable
4 * RUN: %t/executable %t/bitcode.bc
55 * XFAIL: vg_leak
66 *)
77
None (* RUN: cp %s %T/scalar_opts.ml
1 * RUN: %ocamlc -g -w +A -package llvm.scalar_opts -linkpkg %T/scalar_opts.ml -o %t
2 * RUN: %t %t.bc
3 * RUN: %ocamlopt -g -w +A -package llvm.scalar_opts -linkpkg %T/scalar_opts.ml -o %t
4 * RUN: %t %t.bc
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/scalar_opts.ml
1 * RUN: %ocamlc -g -w +A -package llvm.scalar_opts -linkpkg %t/scalar_opts.ml -o %t/executable
2 * RUN: %t/executable %t/bitcode.bc
3 * RUN: %ocamlopt -g -w +A -package llvm.scalar_opts -linkpkg %t/scalar_opts.ml -o %t/executable
4 * RUN: %t/executable %t/bitcode.bc
55 * XFAIL: vg_leak
66 *)
77
None (* RUN: cp %s %T/target.ml
1 * RUN: %ocamlc -g -w +A -package llvm.target -package llvm.all_backends -linkpkg %T/target.ml -o %t
2 * RUN: %ocamlopt -g -w +A -package llvm.target -package llvm.all_backends -linkpkg %T/target.ml -o %t
3 * RUN: %t %t.bc
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/target.ml
1 * RUN: %ocamlc -g -w +A -package llvm.target -package llvm.all_backends -linkpkg %t/target.ml -o %t/executable
2 * RUN: %ocamlopt -g -w +A -package llvm.target -package llvm.all_backends -linkpkg %t/target.ml -o %t/executable
3 * RUN: %t/executable %t/bitcode.bc
44 * XFAIL: vg_leak
55 *)
66
None (* RUN: cp %s %T/transform_utils.ml
1 * RUN: %ocamlc -g -w +A -package llvm.transform_utils -linkpkg %T/transform_utils.ml -o %t
2 * RUN: %t
3 * RUN: %ocamlopt -g -w +A -package llvm.transform_utils -linkpkg %T/transform_utils.ml -o %t
4 * RUN: %t
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/transform_utils.ml
1 * RUN: %ocamlc -g -w +A -package llvm.transform_utils -linkpkg %t/transform_utils.ml -o %t/executable
2 * RUN: %t/executable
3 * RUN: %ocamlopt -g -w +A -package llvm.transform_utils -linkpkg %t/transform_utils.ml -o %t/executable
4 * RUN: %t/executable
55 * XFAIL: vg_leak
66 *)
77
None (* RUN: cp %s %T/vectorize_opts.ml
1 * RUN: %ocamlc -g -w +A -package llvm.vectorize -linkpkg %T/vectorize_opts.ml -o %t
2 * RUN: %t %t.bc
3 * RUN: %ocamlopt -g -w +A -package llvm.vectorize -linkpkg %T/vectorize_opts.ml -o %t
4 * RUN: %t %t.bc
0 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/vectorize_opts.ml
1 * RUN: %ocamlc -g -w +A -package llvm.vectorize -linkpkg %t/vectorize_opts.ml -o %t/executable
2 * RUN: %t/executable %t/bitcode.bc
3 * RUN: %ocamlopt -g -w +A -package llvm.vectorize -linkpkg %t/vectorize_opts.ml -o %t/executable
4 * RUN: %t/executable %t/bitcode.bc
55 * XFAIL: vg_leak
66 *)
77
None # RUN: llvm-pdbdump yaml2pdb -pdb=%T/objfilename.pdb %s
1 # RUN: llvm-pdbdump pdb2yaml -dbi-module-info %T/objfilename.pdb \
0 # RUN: llvm-pdbdump yaml2pdb -pdb=%t %s
1 # RUN: llvm-pdbdump pdb2yaml -dbi-module-info %t \
22 # RUN: | FileCheck %s
33 #
44 # CHECK: DbiStream:
55 # that differ by one byte, so that at least one of those will only
66 # pass if alignment is implemented correctly.
77
8 RUN: llvm-pdbutil yaml2pdb -pdb=%T/source-names-1.pdb %p/Inputs/source-names-1.yaml
9 RUN: llvm-pdbutil pdb2yaml -module-files %T/source-names-1.pdb \
8 RUN: rm -rf %t && mkdir -p %t
9 RUN: llvm-pdbutil yaml2pdb -pdb=%t/source-names-1.pdb %p/Inputs/source-names-1.yaml
10 RUN: llvm-pdbutil pdb2yaml -module-files %t/source-names-1.pdb \
1011 RUN: | FileCheck -check-prefix=CHECK1 %s
11 RUN: llvm-pdbutil yaml2pdb -pdb=%T/source-names-2.pdb %p/Inputs/source-names-2.yaml
12 RUN: llvm-pdbutil pdb2yaml -module-files %T/source-names-2.pdb \
12 RUN: llvm-pdbutil yaml2pdb -pdb=%t/source-names-2.pdb %p/Inputs/source-names-2.yaml
13 RUN: llvm-pdbutil pdb2yaml -module-files %t/source-names-2.pdb \
1314 RUN: | FileCheck -check-prefix=CHECK2 %s
1415
1516 CHECK1: SourceFiles:
None ; RUN: %llc_dwarf -split-dwarf-file=foo.dwo %s -filetype=obj -o %T/a.o
1 ; RUN: %llc_dwarf -split-dwarf-file=bar.dwo %s -filetype=obj -o %T/b.o
2 ; RUN: llvm-dwarfdump -debug-dump=info %T/a.o %T/b.o | FileCheck %s
0 ; RUN: rm -rf %t && mkdir -p %t
1 ; RUN: %llc_dwarf -split-dwarf-file=foo.dwo %s -filetype=obj -o %t/a.o
2 ; RUN: %llc_dwarf -split-dwarf-file=bar.dwo %s -filetype=obj -o %t/b.o
3 ; RUN: llvm-dwarfdump -debug-dump=info %t/a.o %t/b.o | FileCheck %s
34
45 ; CHECK: dwo_id {{.*}}([[HASH:.*]])
56 ; CHECK-NOT: dwo_id {{.*}}([[HASH]])
0 REQUIRES: shell
1 RUN: cd %T
2 RUN: cp %p/Inputs/split-dwarf-empty.dwo %T
1 RUN: rm -rf %t && mkdir -p %t
2 RUN: cd %t
3 RUN: cp %p/Inputs/split-dwarf-empty.dwo %t
34 RUN: echo "%p/Inputs/split-dwarf-empty.o 0xdeadbeef" > %t.input
45
56 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
0 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400559" > %t.input
11 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64.debuglink 0x400559" >> %t.input
2 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400436" >> %t.input
3 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400528" >> %t.input
4 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400586" >> %t.input
5 RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004e8" >> %t.input
6 RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004f4" >> %t.input
7 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" >> %t.input
8 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x8dc" >> %t.input
9 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0xa05" >> %t.input
10 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x987" >> %t.input
11 RUN: echo "%p/Inputs/dwarfdump-inl-test.high_pc.elf-x86-64 0x568" >> %t.input
12 RUN: cp "%p/Inputs/dwarfdump-test3.elf-x86-64-space" "%T/dwarfdump-test3.elf-x86-64 space"
13 RUN: echo "\"%T/dwarfdump-test3.elf-x86-64 space\" 0x640" >> %t.input
14 RUN: echo "\"%T/dwarfdump-test3.elf-x86-64 space\" 0x633" >> %t.input
15 RUN: echo "\"%T/dwarfdump-test3.elf-x86-64 space\" 0x62d" >> %t.input
16 RUN: echo "%p/Inputs/macho-universal 0x1f84" >> %t.input
17 RUN: echo "%p/Inputs/macho-universal:i386 0x1f67" >> %t.input
18 RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input
19 RUN: echo "%p/Inputs/llvm-symbolizer-dwo-test 0x400514" >> %t.input
20 RUN: echo "%p/Inputs/fission-ranges.elf-x86_64 0x720" >> %t.input
21 RUN: echo "%p/Inputs/arange-overlap.elf-x86_64 0x714" >> %t.input
2 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64.debuglink 0x400559" >> %t/input
3 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400436" >> %t/input
4 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400528" >> %t/input
5 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400586" >> %t/input
6 RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004e8" >> %t/input
7 RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004f4" >> %t/input
8 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" >> %t/input
9 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x8dc" >> %t/input
10 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0xa05" >> %t/input
11 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x987" >> %t/input
12 RUN: echo "%p/Inputs/dwarfdump-inl-test.high_pc.elf-x86-64 0x568" >> %t/input
13 RUN: cp "%p/Inputs/dwarfdump-test3.elf-x86-64-space" "%t/dwarfdump-test3.elf-x86-64 space"
14 RUN: echo "\"%t/dwarfdump-test3.elf-x86-64 space\" 0x640" >> %t/input
15 RUN: echo "\"%t/dwarfdump-test3.elf-x86-64 space\" 0x633" >> %t/input
16 RUN: echo "\"%t/dwarfdump-test3.elf-x86-64 space\" 0x62d" >> %t/input
17 RUN: echo "%p/Inputs/macho-universal 0x1f84" >> %t/input
18 RUN: echo "%p/Inputs/macho-universal:i386 0x1f67" >> %t/input
19 RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t/input
20 RUN: echo "%p/Inputs/llvm-symbolizer-dwo-test 0x400514" >> %t/input
21 RUN: echo "%p/Inputs/fission-ranges.elf-x86_64 0x720" >> %t/input
22 RUN: echo "%p/Inputs/arange-overlap.elf-x86_64 0x714" >> %t/input
2223 RUN: cp %p/Inputs/split-dwarf-test.dwo %T
23 RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input
24 RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input
25 RUN: echo "%p/Inputs/cross-cu-inlining.x86_64-macho.o 0x17" >> %t.input
24 RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t/input
25 RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t/input
26 RUN: echo "%p/Inputs/cross-cu-inlining.x86_64-macho.o 0x17" >> %t/input
2627 RUN: cp %p/Inputs/split-dwarf-multiple-cu.dwo %T
27 RUN: echo "%p/Inputs/split-dwarf-multiple-cu.o 0x4" >> %t.input
28 RUN: echo "%p/Inputs/split-dwarf-multiple-cu.o 0x4" >> %t/input
2829 RUN: cp %p/Inputs/split-dwarf-addr-object-relocation.dwo %T
29 RUN: echo "%p/Inputs/split-dwarf-addr-object-relocation.o 0x14" >> %t.input
30 RUN: echo "%p/Inputs/split-dwarf-addr-object-relocation.o 0x14" >> %t/input
3031 RUN: cp %p/Inputs/split-dwarf-dwp.o %T
3132 RUN: cp %p/Inputs/split-dwarf-dwp.o.dwp %T
32 RUN: echo "%T/split-dwarf-dwp.o 0x4" >> %t.input
33
34 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
35 RUN: --default-arch=i386 < %t.input | FileCheck --check-prefix=CHECK --check-prefix=SPLIT --check-prefix=DWO %s
33 RUN: echo "%T/split-dwarf-dwp.o 0x4" >> %t/input
34
35 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
36 RUN: --default-arch=i386 < %t/input | FileCheck --check-prefix=CHECK --check-prefix=SPLIT --check-prefix=DWO %s
3637
3738 Ensure we get the same results in the absence of gmlt-like data in the executable but the presence of a .dwo file
3839
39 RUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005d4" >> %t.input
40 RUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005c4" >> %t.input
41 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
42 RUN: --default-arch=i386 < %t.input | FileCheck --check-prefix=SPLIT --check-prefix=DWO %s
40 RUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005d4" >> %t/input
41 RUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005c4" >> %t/input
42 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
43 RUN: --default-arch=i386 < %t/input | FileCheck --check-prefix=SPLIT --check-prefix=DWO %s
4344
4445 Ensure we get gmlt like results in the absence of a .dwo file but the presence of gmlt-like data in the executable
4546
4647 RUN: rm %T/split-dwarf-test.dwo
47 RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input
48 RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input
49 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
50 RUN: --default-arch=i386 < %t.input | FileCheck --check-prefix=SPLIT --check-prefix=NODWO %s
48 RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t/input
49 RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t/input
50 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
51 RUN: --default-arch=i386 < %t/input | FileCheck --check-prefix=SPLIT --check-prefix=NODWO %s
5152
5253 RUN: cp %p/Inputs/split-dwarf-dwp.o %T/split-dwarf-dwp-different-name.o
5354 RUN: echo "%T/split-dwarf-dwp-different-name.o 0x54" > %t.input
160161 DWP-NEXT: main
161162 DWP-NEXT: split-dwarf-dwp.cpp:10:0
162163
163 RUN: echo "unexisting-file 0x1234" > %t.input2
164 RUN: llvm-symbolizer < %t.input2 2>&1 | FileCheck %s --check-prefix=MISSING-FILE
164 RUN: echo "unexisting-file 0x1234" > %t/input2
165 RUN: llvm-symbolizer < %t/input2 2>&1 | FileCheck %s --check-prefix=MISSING-FILE
165166
166167 MISSING-FILE: LLVMSymbolizer: error reading file: {{[Nn]}}o such file or directory
167168
168 RUN: echo "%p/Inputs/macho-universal 0x1f84" > %t.input3
169 RUN: llvm-symbolizer < %t.input3 | FileCheck %s --check-prefix=UNKNOWN-ARCH
169 RUN: echo "%p/Inputs/macho-universal 0x1f84" > %t/input3
170 RUN: llvm-symbolizer < %t/input3 | FileCheck %s --check-prefix=UNKNOWN-ARCH
170171
171172 UNKNOWN-ARCH-NOT: main
172173 UNKNOWN-ARCH: ??
173174 UNKNOWN-ARCH-NOT: main
174175
175 RUN: echo "0x400559" > %t.input4
176 RUN: echo "0x400436" >> %t.input4
177 RUN: llvm-symbolizer --obj %p/Inputs/dwarfdump-test.elf-x86-64 < %t.input4 \
176 RUN: echo "0x400559" > %t/input4
177 RUN: echo "0x400436" >> %t/input4
178 RUN: llvm-symbolizer --obj %p/Inputs/dwarfdump-test.elf-x86-64 < %t/input4 \
178179 RUN: | FileCheck %s --check-prefix=BINARY
179180
180181 BINARY: main
181182 BINARY-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
182183 BINARY: _start
183184
184 RUN: echo "0x400720" > %t.input5
185 RUN: echo "0x4004a0" >> %t.input5
186 RUN: echo "0x4006f0" >> %t.input5
187 RUN: llvm-symbolizer --obj %p/Inputs/llvm-symbolizer-test.elf-x86-64 < %t.input5 \
185 RUN: echo "0x400720" > %t/input5
186 RUN: echo "0x4004a0" >> %t/input5
187 RUN: echo "0x4006f0" >> %t/input5
188 RUN: llvm-symbolizer --obj %p/Inputs/llvm-symbolizer-test.elf-x86-64 < %t/input5 \
188189 RUN: | FileCheck %s --check-prefix=BINARY_C
189190
190191 BINARY_C: main
192193 BINARY_C: _start
193194 BINARY_C: {{g$}}
194195
195 RUN: echo "0x1f1" > %t.input6
196 RUN: llvm-symbolizer --obj %p/Inputs/shared-object-stripped.elf-i386 < %t.input6 \
196 RUN: echo "0x1f1" > %t/input6
197 RUN: llvm-symbolizer --obj %p/Inputs/shared-object-stripped.elf-i386 < %t/input6 \
197198 RUN: | FileCheck %s --check-prefix=STRIPPED
198199
199200 STRIPPED: global_func
200201
201 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" > %t.input7
202 RUN: llvm-symbolizer --functions=short --demangle=false < %t.input7 \
202 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" > %t/input7
203 RUN: llvm-symbolizer --functions=short --demangle=false < %t/input7 \
203204 RUN: | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME
204205
205206 SHORT_FUNCTION_NAME-NOT: _Z1cv
None # RUN: llvm-mc -triple=aarch64_be-none-linux-gnu -filetype=obj -o %T/be-reloc.o %s
1 # RUN: llvm-rtdyld -triple=aarch64_be-none-linux-gnu -verify -dummy-extern f=0x0123456789abcdef -check=%s %T/be-reloc.o
0 # RUN: llvm-mc -triple=aarch64_be-none-linux-gnu -filetype=obj -o %t %s
1 # RUN: llvm-rtdyld -triple=aarch64_be-none-linux-gnu -verify -dummy-extern f=0x0123456789abcdef -check=%s %t
22
33 .globl Q
44 .section .dummy, "ax"
None # RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o %T/pic-reloc.o %s
1 # RUN: llvm-rtdyld -triple=arm64-none-linux-gnu -verify -check=%s %T/pic-reloc.o \
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o %t/pic-reloc.o %s
2 # RUN: llvm-rtdyld -triple=arm64-none-linux-gnu -verify -check=%s %t/pic-reloc.o \
23 # RUN: -map-section pic-reloc.o,.got=0x20000 -dummy-extern f=0x1234 -dummy-extern g=0x5678
34
45 _s:
None # RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o %T/branch.o %s
1 # RUN: llvm-rtdyld -triple=arm64-none-linux-gnu -verify -check=%s %T/branch.o
0 # RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o %t %s
1 # RUN: llvm-rtdyld -triple=arm64-none-linux-gnu -verify -check=%s %t
22
33 .globl _main
44 .weak _label1
None # RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o %T/reloc.o %s
1 # RUN: llvm-rtdyld -triple=arm64-none-linux-gnu -verify -dummy-extern f=0x0123456789abcdef -check=%s %T/reloc.o
0 # RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o %t %s
1 # RUN: llvm-rtdyld -triple=arm64-none-linux-gnu -verify -dummy-extern f=0x0123456789abcdef -check=%s %t
22
33 .globl Q
44 .section .dummy, "ax"
None # RUN: llvm-mc -triple=arm64-apple-ios7.0.0 -filetype=obj -o %T/foo.o %s
1 # RUN: llvm-rtdyld -triple=arm64-apple-ios7.0.0 -map-section foo.o,__text=0x10bc0 -verify -check=%s %/T/foo.o
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=arm64-apple-ios7.0.0 -filetype=obj -o %t/foo.o %s
2 # RUN: llvm-rtdyld -triple=arm64-apple-ios7.0.0 -map-section foo.o,__text=0x10bc0 -verify -check=%s %t/foo.o
23
34 .section __TEXT,__text,regular,pure_instructions
45 .ios_version_min 7, 0
None # RUN: llvm-mc -triple=arm-linux-gnueabihf -filetype=obj -o %T/reloc.o %s
1 # RUN: llvm-rtdyld -triple=arm-linux-gnueabihf -verify -map-section reloc.o,.ARM.exidx=0x6000 -map-section reloc.o,.text=0x4000 -dummy-extern __aeabi_unwind_cpp_pr0=0x1234 -check=%s %T/reloc.o
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=arm-linux-gnueabihf -filetype=obj -o %t/reloc.o %s
2 # RUN: llvm-rtdyld -triple=arm-linux-gnueabihf -verify -map-section reloc.o,.ARM.exidx=0x6000 -map-section reloc.o,.text=0x4000 -dummy-extern __aeabi_unwind_cpp_pr0=0x1234 -check=%s %t/reloc.o
23
34 .text
45 .syntax unified
None # RUN: llvm-mc -triple=armv7s-apple-ios7.0.0 -filetype=obj -o %T/foo.o %s
1 # RUN: llvm-rtdyld -triple=armv7s-apple-ios7.0.0 -verify -check=%s %/T/foo.o
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=armv7s-apple-ios7.0.0 -filetype=obj -o %t/foo.o %s
2 # RUN: llvm-rtdyld -triple=armv7s-apple-ios7.0.0 -verify -check=%s %t/foo.o
23
34 .syntax unified
45 .section __TEXT,__text,regular,pure_instructions
None # RUN: llvm-mc -triple=powerpc-unknown-linux-gnu -filetype=obj -o %T/ppc32_elf_rel_addr16.o %s
1 # RUN: llvm-rtdyld -triple=powerpc-unknown-linux-gnu -verify -check=%s %T/ppc32_elf_rel_addr16.o
0 # RUN: llvm-mc -triple=powerpc-unknown-linux-gnu -filetype=obj -o %t %s
1 # RUN: llvm-rtdyld -triple=powerpc-unknown-linux-gnu -verify -check=%s %t
22 .text
33 .file "ppc32_elf_rel_addr16.ll"
44 .globl lookup
11 // RUN: llvm-mc -triple s390x-linux-gnu -filetype=obj %s -o - | llvm-readobj -s -sr -sd | FileCheck %s
22
33 // Test that RuntimeDyld can fix up such relocations.
4 // RUN: llvm-mc -triple s390x-linux-gnu -filetype=obj %s -o %T/test-s390x-cfi-relo-pc64.o
5 // RUN: llc -mtriple=s390x-linux-gnu -filetype=obj %S/Inputs/rtdyld-globals.ll -o %T/test-s390x-rtdyld-globals.o
6 // RUN: llvm-rtdyld -triple=s390x-linux-gnu -verify %T/test-s390x-cfi-relo-pc64.o %T/test-s390x-rtdyld-globals.o
4 // RUN: rm -rf %t && mkdir -p %t
5 // RUN: llvm-mc -triple s390x-linux-gnu -filetype=obj %s -o %t/test-s390x-cfi-relo-pc64.o
6 // RUN: llc -mtriple=s390x-linux-gnu -filetype=obj %S/Inputs/rtdyld-globals.ll -o %t/test-s390x-rtdyld-globals.o
7 // RUN: llvm-rtdyld -triple=s390x-linux-gnu -verify %t/test-s390x-cfi-relo-pc64.o %t/test-s390x-rtdyld-globals.o
78
89 f1:
910 .cfi_startproc
None # RUN: llvm-mc -triple=x86_64-pc-win32 -filetype=obj -o %T/COFF_x86_64.o %s
1 # RUN: llvm-rtdyld -triple=x86_64-pc-win32 -verify -check=%s %/T/COFF_x86_64.o
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=x86_64-pc-win32 -filetype=obj -o %t/COFF_x86_64.o %s
2 # RUN: llvm-rtdyld -triple=x86_64-pc-win32 -verify -check=%s %t/COFF_x86_64.o
23 .text
34 .def F;
45 .scl 2;
None # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %T/file.o %p/Inputs/ELF_STT_FILE_GLOBAL.s
1 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %T/relaxed.o %s
2 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify %T/file.o %T/relaxed.o
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %t/file.o %p/Inputs/ELF_STT_FILE_GLOBAL.s
2 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %t/relaxed.o %s
3 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify %t/file.o %t/relaxed.o
34
45 # Test that RTDyldELF does not crash with 'unimplemented relocation'
56
None # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %T/test_ELF_STT_FILE_FILE_x86-64.o %p/Inputs/ELF_STT_FILE_FILE.s
1 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %T/test_ELF_STT_FILE_GLOBAL_x86-64.o %p/Inputs/ELF_STT_FILE_GLOBAL.s
2 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %T/test_ELF_STT_FILE_x86-64.o %s
3 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify %T/test_ELF_STT_FILE_GLOBAL_x86-64.o %T/test_ELF_STT_FILE_FILE_x86-64.o %T/test_ELF_STT_FILE_x86-64.o
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %t/test_ELF_STT_FILE_FILE_x86-64.o %p/Inputs/ELF_STT_FILE_FILE.s
2 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %t/test_ELF_STT_FILE_GLOBAL_x86-64.o %p/Inputs/ELF_STT_FILE_GLOBAL.s
3 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %t/test_ELF_STT_FILE_x86-64.o %s
4 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify %t/test_ELF_STT_FILE_GLOBAL_x86-64.o %t/test_ELF_STT_FILE_FILE_x86-64.o %t/test_ELF_STT_FILE_x86-64.o
45
56 # Test that RTDyldELF ignores STT_FILE symbols, and in particular does
67 # crash if we are relocating against a symbol that happens to have the
None # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %T/test_ELF_x86-64_PC8.o %s
1 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify -map-section test_ELF_x86-64_PC8.o,.text.bar=0x10000 -map-section test_ELF_x86-64_PC8.o,.text.baz=0x10040 %T/test_ELF_x86-64_PC8.o
2 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify -map-section test_ELF_x86-64_PC8.o,.text.baz=0x10000 -map-section test_ELF_x86-64_PC8.o,.text.bar=0x10040 %T/test_ELF_x86-64_PC8.o
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %t/test_ELF_x86-64_PC8.o %s
2 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify -map-section test_ELF_x86-64_PC8.o,.text.bar=0x10000 -map-section test_ELF_x86-64_PC8.o,.text.baz=0x10040 %t/test_ELF_x86-64_PC8.o
3 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify -map-section test_ELF_x86-64_PC8.o,.text.baz=0x10000 -map-section test_ELF_x86-64_PC8.o,.text.bar=0x10040 %t/test_ELF_x86-64_PC8.o
34
45 # Test that R_X86_64_PC8 relocation works.
56
None # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %T/test_ELF1_x86-64.o %s
1 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %T/test_ELF2_x86-64.o %s
2 # RUN: llc -mtriple=x86_64-pc-linux -filetype=obj -o %T/test_ELF_ExternalGlobal_x86-64.o %S/Inputs/ExternalGlobal.ll
3 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify %T/test_ELF1_x86-64.o %T/test_ELF_ExternalGlobal_x86-64.o
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %t/test_ELF1_x86-64.o %s
2 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %t/test_ELF2_x86-64.o %s
3 # RUN: llc -mtriple=x86_64-pc-linux -filetype=obj -o %t/test_ELF_ExternalGlobal_x86-64.o %S/Inputs/ExternalGlobal.ll
4 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify %t/test_ELF1_x86-64.o %t/test_ELF_ExternalGlobal_x86-64.o
45 # Test that we can load this code twice at memory locations more than 2GB apart
5 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify -map-section test_ELF1_x86-64.o,.got=0x10000 -map-section test_ELF2_x86-64.o,.text=0x100000000 -map-section test_ELF2_x86-64.o,.got=0x100010000 %T/test_ELF1_x86-64.o %T/test_ELF2_x86-64.o %T/test_ELF_ExternalGlobal_x86-64.o
6 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify -map-section test_ELF1_x86-64.o,.got=0x10000 -map-section test_ELF2_x86-64.o,.text=0x100000000 -map-section test_ELF2_x86-64.o,.got=0x100010000 %t/test_ELF1_x86-64.o %t/test_ELF2_x86-64.o %t/test_ELF_ExternalGlobal_x86-64.o
67
78 # Assembly obtained by compiling the following and adding checks:
89 # @G = external global i8*
None # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %T/ELF_x86-64_debug_frame.o %s
1 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify -check=%s %T/ELF_x86-64_debug_frame.o
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %t/ELF_x86-64_debug_frame.o %s
2 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify -check=%s %t/ELF_x86-64_debug_frame.o
23
34 .text
45 .file "debug_frame_test.c"
None # RUN: llvm-mc -triple=x86_64-apple-macosx10.10.0 -filetype=obj -o %T/test_ELF_x86_64_StubBuf.o %s
1 # RUN: llvm-rtdyld -print-alloc-requests -triple=x86_64-pc-linux -dummy-extern _g=196608 -verify %T/test_ELF_x86_64_StubBuf.o
0 # RUN: llvm-mc -triple=x86_64-apple-macosx10.10.0 -filetype=obj -o %t %s
1 # RUN: llvm-rtdyld -print-alloc-requests -triple=x86_64-pc-linux -dummy-extern _g=196608 -verify %t
22
33 # Compiled from Inputs/ELF/ELF_x86_64_StubBuf.ll
44
None # RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %T/empty_eh_frame.o %s
1 # RUN: llvm-rtdyld -verify -triple=x86_64-apple-macosx10.9 %T/empty_eh_frame.o
0 # RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t %s
1 # RUN: llvm-rtdyld -verify -triple=x86_64-apple-macosx10.9 %t
22
33 .section __TEXT,__eh_frame
44 .macosx_version_min 10, 10
None # RUN: llvm-mc -triple=i386-apple-macosx10.4 -filetype=obj -o %T/test_i386.o %s
1 # RUN: llvm-rtdyld -triple=i386-apple-macosx10.4 -verify -check=%s %/T/test_i386.o
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=i386-apple-macosx10.4 -filetype=obj -o %t/test_i386.o %s
2 # RUN: llvm-rtdyld -triple=i386-apple-macosx10.4 -verify -check=%s %t/test_i386.o
23
34 // Put the section used in the test at a non zero address.
45 .long 4
None # RUN: llvm-mc -triple=i386-apple-macosx10.4 -filetype=obj -o %T/MachO_i386_eh_frame.o %s
1 # RUN: llvm-rtdyld -triple=i386-apple-macosx10.4 -verify -map-section MachO_i386_eh_frame.o,__text=0x2000 -check=%s %/T/MachO_i386_eh_frame.o
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=i386-apple-macosx10.4 -filetype=obj -o %t/MachO_i386_eh_frame.o %s
2 # RUN: llvm-rtdyld -triple=i386-apple-macosx10.4 -verify -map-section MachO_i386_eh_frame.o,__text=0x2000 -check=%s %t/MachO_i386_eh_frame.o
23
34 # rtdyld-check: *{4}(section_addr(MachO_i386_eh_frame.o, __eh_frame) + 0x20) = (main - (section_addr(MachO_i386_eh_frame.o, __eh_frame) + 0x20))[31:0]
45 # rtdyld-check: *{4}(section_addr(MachO_i386_eh_frame.o, __eh_frame) + 0x24) = 0x9
None # RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %T/test_x86-64.o %s
1 # RUN: llvm-rtdyld -triple=x86_64-apple-macosx10.9 -dummy-extern ds1=0xfffffffffffffffe -dummy-extern ds2=0xffffffffffffffff -verify -check=%s %/T/test_x86-64.o
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t/test_x86-64.o %s
2 # RUN: llvm-rtdyld -triple=x86_64-apple-macosx10.9 -dummy-extern ds1=0xfffffffffffffffe -dummy-extern ds2=0xffffffffffffffff -verify -check=%s %t/test_x86-64.o
23
34 .section __TEXT,__text,regular,pure_instructions
45 .globl foo
None ; RUN: llvm-as -o %T/bcsection.bc %s
0 ; RUN: rm -rf %t && mkdir -p %t
1 ; RUN: llvm-as -o %t/bcsection.bc %s
12
2 ; RUN: llvm-mc -I=%T -filetype=obj -triple=x86_64-pc-win32 -o %T/bcsection.coff.bco %p/Inputs/bcsection.s
3 ; RUN: llvm-nm %T/bcsection.coff.bco | FileCheck %s
4 ; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %T/bcsection.coff.o %T/bcsection.coff.bco
5 ; RUN: llvm-nm %T/bcsection.coff.o | FileCheck %s
3 ; RUN: llvm-mc -I=%t -filetype=obj -triple=x86_64-pc-win32 -o %t/bcsection.coff.bco %p/Inputs/bcsection.s
4 ; RUN: llvm-nm %t/bcsection.coff.bco | FileCheck %s
5 ; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %t/bcsection.coff.o %t/bcsection.coff.bco
6 ; RUN: llvm-nm %t/bcsection.coff.o | FileCheck %s
67
7 ; RUN: llvm-mc -I=%T -filetype=obj -triple=x86_64-unknown-linux-gnu -o %T/bcsection.elf.bco %p/Inputs/bcsection.s
8 ; RUN: llvm-nm %T/bcsection.elf.bco | FileCheck %s
9 ; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %T/bcsection.elf.o %T/bcsection.elf.bco
10 ; RUN: llvm-nm %T/bcsection.elf.o | FileCheck %s
8 ; RUN: llvm-mc -I=%t -filetype=obj -triple=x86_64-unknown-linux-gnu -o %t/bcsection.elf.bco %p/Inputs/bcsection.s
9 ; RUN: llvm-nm %t/bcsection.elf.bco | FileCheck %s
10 ; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %t/bcsection.elf.o %t/bcsection.elf.bco
11 ; RUN: llvm-nm %t/bcsection.elf.o | FileCheck %s
1112
12 ; RUN: llvm-mc -I=%T -filetype=obj -triple=x86_64-apple-darwin11 -o %T/bcsection.macho.bco %p/Inputs/bcsection.macho.s
13 ; RUN: llvm-nm %T/bcsection.macho.bco | FileCheck %s
14 ; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %T/bcsection.macho.o %T/bcsection.macho.bco
15 ; RUN: llvm-nm %T/bcsection.macho.o | FileCheck %s
13 ; RUN: llvm-mc -I=%t -filetype=obj -triple=x86_64-apple-darwin11 -o %t/bcsection.macho.bco %p/Inputs/bcsection.macho.s
14 ; RUN: llvm-nm %t/bcsection.macho.bco | FileCheck %s
15 ; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %t/bcsection.macho.o %t/bcsection.macho.bco
16 ; RUN: llvm-nm %t/bcsection.macho.o | FileCheck %s
1617
1718 ; REQUIRES: default_triple
1819
None ; RUN: llvm-as -o %T/1.bc %s
1 ; RUN: llvm-as -o %T/2.bc %S/Inputs/list-symbols.ll
2 ; RUN: llvm-lto -list-symbols-only %T/1.bc %T/2.bc | FileCheck %s
0 ; RUN: rm -rf %t && mkdir -p %t
1 ; RUN: llvm-as -o %t/1.bc %s
2 ; RUN: llvm-as -o %t/2.bc %S/Inputs/list-symbols.ll
3 ; RUN: llvm-lto -list-symbols-only %t/1.bc %t/2.bc | FileCheck %s
34 ; REQUIRES: default_triple
45
56 ; CHECK-LABEL: 1.bc:
None RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %T/a.obj %S/Inputs/a.s
1 RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %T/b.o %S/Inputs/b.s
2 RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %T/c %S/Inputs/b.s
0 RUN: rm -rf %t && mkdir -p %t
1 RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/a.obj %S/Inputs/a.s
2 RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/b.o %S/Inputs/b.s
3 RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/c %S/Inputs/b.s
34
4 RUN: rm -f %T/a.lib
5 RUN: llvm-lib %T/a.obj
6 RUN: test -e %T/a.lib
5 RUN: rm -f %t/a.lib
6 RUN: llvm-lib %t/a.obj
7 RUN: test -e %t/a.lib
78
8 RUN: rm -f %T/b.lib
9 RUN: llvm-lib /libpath:%T b.o
10 RUN: test -e %T/b.lib
9 RUN: rm -f %t/b.lib
10 RUN: llvm-lib /libpath:%t b.o
11 RUN: test -e %t/b.lib
1112
12 RUN: rm -f %T/c.lib
13 RUN: llvm-lib /libpath:%T c
14 RUN: test -e %T/c.lib
13 RUN: rm -f %t/c.lib
14 RUN: llvm-lib /libpath:%t c
15 RUN: test -e %t/c.lib
None RUN: mkdir -p %T/a %T/b
1 RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %T/a/foo.obj %S/Inputs/a.s
2 RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %T/b/foo.obj %S/Inputs/b.s
0 RUN: mkdir -p %t/a %t/b
1 RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/a/foo.obj %S/Inputs/a.s
2 RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/b/foo.obj %S/Inputs/b.s
33
4 RUN: env "LIB=%T/a;%T/b" llvm-lib /out:%t1.lib foo.obj
4 RUN: env "LIB=%t/a;%t/b" llvm-lib /out:%t1.lib foo.obj
55 RUN: llvm-nm %t1.lib | FileCheck --check-prefix=A %s
66
7 RUN: llvm-lib /out:%t2.lib /libpath:%T/a /libpath:%T/b foo.obj
7 RUN: llvm-lib /out:%t2.lib /libpath:%t/a /libpath:%t/b foo.obj
88 RUN: llvm-nm %t2.lib | FileCheck --check-prefix=A %s
99
10 RUN: env LIB=%T/a llvm-lib /libpath:%T/b /out:%t3.lib foo.obj
10 RUN: env LIB=%t/a llvm-lib /libpath:%t/b /out:%t3.lib foo.obj
1111 RUN: llvm-nm %t3.lib | FileCheck --check-prefix=B %s
1212
1313 A: T a
0 Test the 'd' operation in llvm-ar
11
2 RUN: cd %T
2 RUN: cd `dirname %t`
33
44 RUN: rm -f %t.a
55 RUN: cp %p/Inputs/GNU.a %t.a
0 ; This test just makes sure that llvm-ar can extract bytecode members
11 ; from various style archives.
22
3 ; RUN: cd %T
3 ; RUN: cd `dirname %t`
44
55 ; RUN: rm -f very_long_bytecode_file_name.bc
66 ; RUN: llvm-ar p %p/Inputs/GNU.a very_long_bytecode_file_name.bc | \
0 Test the 'm' operation in llvm-ar
11
2 RUN: cd %T
2 RUN: cd `dirname %t`
33
44 RUN: rm -f %t.a
55 RUN: cp %p/Inputs/GNU.a %t.a
0 REQUIRES: system-windows
11
2 RUN: cd %T
2 RUN: cd `dirname %t`
33 RUN: mkdir -p archive-thin-paths.dir
44 RUN: echo foo > archive-thin-paths.dir/foo.o
55
0 Test the 'u' option of llvm-ar
11
2 RUN: cd %T
2 RUN: cd `dirname %t`
33 RUN: rm -f %t.a
44
55 Create a file named evenlen that is newer than the evenlen on the source dir.
None ;RUN: rm -f %T/test.a
1 ;RUN: not llvm-ar r %T/test.a . 2>&1 | FileCheck %s
0 ;RUN: rm -rf %t && mkdir -p %t
1 ;RUN: not llvm-ar r %t/test.a . 2>&1 | FileCheck %s
22 ;CHECK: .: {{I|i}}s a directory
33
4 ;RUN: rm -f %T/test.a
5 ;RUN: touch %T/a-very-long-file-name
6 ;RUN: llvm-ar r %T/test.a %s %T/a-very-long-file-name
7 ;RUN: llvm-ar r %T/test.a %T/a-very-long-file-name
8 ;RUN: llvm-ar t %T/test.a | FileCheck -check-prefix=MEMBERS %s
4 ;RUN: rm -f %t/test.a
5 ;RUN: touch %t/a-very-long-file-name
6 ;RUN: llvm-ar r %t/test.a %s %t/a-very-long-file-name
7 ;RUN: llvm-ar r %t/test.a %t/a-very-long-file-name
8 ;RUN: llvm-ar t %t/test.a | FileCheck -check-prefix=MEMBERS %s
99 ;MEMBERS-NOT: /
1010 ;MEMBERS: directory.ll
1111 ;MEMBERS: a-very-long-file-name
1313 test, but for now this test serves as a reminder to audit all the callers if
1414 we do that.
1515
16 RUN: cp -f %S/Inputs/TestProg/TestProg %T/TestProg
17 RUN: chmod 111 %T/TestProg
18 RUN: export PATH=%S/Inputs:%T:%S/Inputs/TestProg:$PATH
16 RUN: rm -rf %t && mkdir -p %t
17 RUN: cp -f %S/Inputs/TestProg/TestProg %t/TestProg
18 RUN: chmod 111 %t/TestProg
19 RUN: export PATH=%S/Inputs:%t:%S/Inputs/TestProg:$PATH
1920 RUN: not TestProg
None RUN: echo TA > %T/TA.txt
1 RUN: echo TB > %T/TB.txt
2 RUN: echo TAB > %T/TAB.txt
3
4 RUN: echo %T/TA* | FileCheck -check-prefix=STAR %s
5 RUN: echo %T/'TA'* | FileCheck -check-prefix=STAR %s
6 RUN: echo %T/T'A'* | FileCheck -check-prefix=STAR %s
7
8 RUN: echo %T/T?.txt | FileCheck -check-prefix=QUESTION %s
9 RUN: echo %T/'T'?.txt | FileCheck -check-prefix=QUESTION %s
10
11 RUN: echo %T/T??.txt | FileCheck -check-prefix=QUESTION2 %s
12 RUN: echo %T/'T'??.txt | FileCheck -check-prefix=QUESTION2 %s
13
14 RUN: echo 'T*' 'T?.txt' 'T??.txt' | FileCheck -check-prefix=QUOTEDARGS %s
15
0 RUN: rm -rf %t && mkdir -p %t
1 RUN: echo TA > %t/TA.txt
2 RUN: echo TB > %t/TB.txt
3 RUN: echo TAB > %t/TAB.txt
4
5 RUN: echo %t/TA* | FileCheck -check-prefix=STAR %s
6 RUN: echo %t/'TA'* | FileCheck -check-prefix=STAR %s
7 RUN: echo %t/T'A'* | FileCheck -check-prefix=STAR %s
8
9 RUN: echo %t/T?.txt | FileCheck -check-prefix=QUESTION %s
10 RUN: echo %t/'T'?.txt | FileCheck -check-prefix=QUESTION %s
11
12 RUN: echo %t/T??.txt | FileCheck -check-prefix=QUESTION2 %s
13 RUN: echo %t/'T'??.txt | FileCheck -check-prefix=QUESTION2 %s
14
15 RUN: echo 'T*' 'T?.txt' 'T??.txt' | FileCheck -check-prefix=QUOTEDARGS %s
16
1617 STAR-NOT: TB.txt
1718 STAR: {{(TA.txt.*TAB.txt|TAB.txt.*TA.txt)}}
1819
0 ; Check that changing the output path via prefix-replace works
11 ; Use of '/' in paths created here make this unsuitable for Windows.
2 ; RUN: mkdir -p %T/oldpath
3 ; RUN: opt -module-summary %s -o %T/oldpath/prefix_replace.o
2 ; RUN: mkdir -p %t/oldpath
3 ; RUN: opt -module-summary %s -o %t/oldpath/prefix_replace.o
44 ; Ensure that there is no existing file at the new path, so we properly
55 ; test the creation of the new file there.
6 ; RUN: rm -f %T/newpath/prefix_replace.o.thinlto.bc
6 ; RUN: rm -f %t/newpath/prefix_replace.o.thinlto.bc
77
8 ; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %T/oldpath/prefix_replace.o
9 ; RUN: llvm-lto -thinlto-action=distributedindexes -thinlto-prefix-replace="%T/oldpath/;%T/newpath/" -thinlto-index %t.index.bc %T/oldpath/prefix_replace.o
8 ; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t/oldpath/prefix_replace.o
9 ; RUN: llvm-lto -thinlto-action=distributedindexes -thinlto-prefix-replace="%t/oldpath/;%t/newpath/" -thinlto-index %t.index.bc %t/oldpath/prefix_replace.o
1010
11 ; RUN: ls %T/newpath/prefix_replace.o.thinlto.bc
11 ; RUN: ls %t/newpath/prefix_replace.o.thinlto.bc
1212
1313 define void @f() {
1414 entry:
11 ; functions aren't emitted.
22
33 ; Inject metadata to set the .gcno file location
4 ; RUN: echo '!14 = !{!"%/T/function-numbering.ll", !0}' > %t1
5 ; RUN: cat %s %t1 > %t2
4 ; RUN: rm -rf %t && mkdir -p %t
5 ; RUN: echo '!14 = !{!"%/t/function-numbering.ll", !0}' > %t/1
6 ; RUN: cat %s %t/1 > %t/2
67
7 ; RUN: opt -insert-gcov-profiling -S < %t2 | FileCheck --check-prefix GCDA %s
8 ; RUN: llvm-cov gcov -n -dump %T/function-numbering.gcno 2>&1 | FileCheck --check-prefix GCNO %s
9 ; RUNN: rm %T/function-numbering.gcno
8 ; RUN: opt -insert-gcov-profiling -S < %t/2 | FileCheck --check-prefix GCDA %s
9 ; RUN: llvm-cov gcov -n -dump %t/function-numbering.gcno 2>&1 | FileCheck --check-prefix GCNO %s
10 ; RUNN: rm %t/function-numbering.gcno
1011
11 ; RUN: opt -passes=insert-gcov-profiling -S < %t2 | FileCheck --check-prefix GCDA %s
12 ; RUN: llvm-cov gcov -n -dump %T/function-numbering.gcno 2>&1 | FileCheck --check-prefix GCNO %s
12 ; RUN: opt -passes=insert-gcov-profiling -S < %t/2 | FileCheck --check-prefix GCDA %s
13 ; RUN: llvm-cov gcov -n -dump %t/function-numbering.gcno 2>&1 | FileCheck --check-prefix GCNO %s
1314
1415 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
1516 target triple = "x86_64-apple-macosx10.10.0"
None ; RUN: echo '!16 = !{!"%/T/global-ctor.ll", !0}' > %t1
1 ; RUN: cat %s %t1 > %t2
2 ; RUN: opt -insert-gcov-profiling -disable-output < %t2
3 ; RUN: not grep '_GLOBAL__sub_I_global-ctor' %T/global-ctor.gcno
4 ; RUN: rm %T/global-ctor.gcno
0 ; RUN: rm -rf %t && mkdir -p %t
1 ; RUN: echo '!16 = !{!"%/t/global-ctor.ll", !0}' > %t/1
2 ; RUN: cat %s %t/1 > %t/2
3 ; RUN: opt -insert-gcov-profiling -disable-output < %t/2
4 ; RUN: not grep '_GLOBAL__sub_I_global-ctor' %t/global-ctor.gcno
5 ; RUN: rm %t/global-ctor.gcno
56
6 ; RUN: opt -passes=insert-gcov-profiling -disable-output < %t2
7 ; RUN: not grep '_GLOBAL__sub_I_global-ctor' %T/global-ctor.gcno
8 ; RUN: rm %T/global-ctor.gcno
7 ; RUN: opt -passes=insert-gcov-profiling -disable-output < %t/2
8 ; RUN: not grep '_GLOBAL__sub_I_global-ctor' %t/global-ctor.gcno
9 ; RUN: rm %t/global-ctor.gcno
910
1011 @x = global i32 0, align 4
1112 @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_global-ctor.ll, i8* null }]
None ; RUN: sed -e 's|PATTERN|%/T|g' %s | opt -insert-gcov-profiling -disable-output
1 ; RUN: rm %T/linezero.gcno
0 ; RUN: rm -rf %t && mkdir -p %t
21
3 ; RUN: sed -e 's|PATTERN|%/T|g' %s | opt -passes=insert-gcov-profiling -disable-output
4 ; RUN: rm %T/linezero.gcno
2 ; RUN: sed -e 's|PATTERN|%/t|g' %s | opt -insert-gcov-profiling -disable-output
3 ; RUN: rm %t/linezero.gcno
4
5 ; RUN: sed -e 's|PATTERN|%/t|g' %s | opt -passes=insert-gcov-profiling -disable-output
6 ; RUN: rm %t/linezero.gcno
57
68 ; This is a crash test.
79
None ; RUN: echo '!9 = !{!"%/T/linkagename.ll", !0}' > %t1
1 ; RUN: cat %s %t1 > %t2
2 ; RUN: opt -insert-gcov-profiling -disable-output < %t2
3 ; RUN: grep _Z3foov %T/linkagename.gcno
4 ; RUN: rm %T/linkagename.gcno
0 ; RUN: rm -rf %t && mkdir -p %t
1 ; RUN: echo '!9 = !{!"%/t/linkagename.ll", !0}' > %t/1
2 ; RUN: cat %s %t/1 > %t/2
3 ; RUN: opt -insert-gcov-profiling -disable-output < %t/2
4 ; RUN: grep _Z3foov %t/linkagename.gcno
5 ; RUN: rm %t/linkagename.gcno
56
6 ; RUN: opt -passes=insert-gcov-profiling -disable-output < %t2
7 ; RUN: grep _Z3foov %T/linkagename.gcno
8 ; RUN: rm %T/linkagename.gcno
7 ; RUN: opt -passes=insert-gcov-profiling -disable-output < %t/2
8 ; RUN: grep _Z3foov %t/linkagename.gcno
9 ; RUN: rm %t/linkagename.gcno
910
1011 define void @_Z3foov() !dbg !5 {
1112 entry:
0 ; Inject metadata to set the .gcno file location
1 ; RUN: echo '!19 = !{!"%/T/return-block.ll", !0}' > %t1
2 ; RUN: cat %s %t1 > %t2
1 ; RUN: rm -rf %t && mkdir -p %t
2 ; RUN: echo '!19 = !{!"%/t/return-block.ll", !0}' > %t/1
3 ; RUN: cat %s %t/1 > %t/2
34
45 ; By default, the return block is last.
5 ; RUN: opt -insert-gcov-profiling -disable-output %t2
6 ; RUN: llvm-cov gcov -n -dump %T/return-block.gcno 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=RETURN-LAST %s
6 ; RUN: opt -insert-gcov-profiling -disable-output %t/2
7 ; RUN: llvm-cov gcov -n -dump %t/return-block.gcno 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=RETURN-LAST %s
78
89 ; But we can optionally emit it second, to match newer gcc versions.
9 ; RUN: opt -insert-gcov-profiling -gcov-exit-block-before-body -disable-output %t2
10 ; RUN: llvm-cov gcov -n -dump %T/return-block.gcno 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=RETURN-SECOND %s
11 ; RUN: rm %T/return-block.gcno
10 ; RUN: opt -insert-gcov-profiling -gcov-exit-block-before-body -disable-output %t/2
11 ; RUN: llvm-cov gcov -n -dump %t/return-block.gcno 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=RETURN-SECOND %s
12 ; RUN: rm %t/return-block.gcno
1213
1314 ; By default, the return block is last.
14 ; RUN: opt -passes=insert-gcov-profiling -disable-output %t2
15 ; RUN: llvm-cov gcov -n -dump %T/return-block.gcno 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=RETURN-LAST %s
15 ; RUN: opt -passes=insert-gcov-profiling -disable-output %t/2
16 ; RUN: llvm-cov gcov -n -dump %t/return-block.gcno 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=RETURN-LAST %s
1617
1718 ; But we can optionally emit it second, to match newer gcc versions.
18 ; RUN: opt -passes=insert-gcov-profiling -gcov-exit-block-before-body -disable-output %t2
19 ; RUN: llvm-cov gcov -n -dump %T/return-block.gcno 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=RETURN-SECOND %s
19 ; RUN: opt -passes=insert-gcov-profiling -gcov-exit-block-before-body -disable-output %t/2
20 ; RUN: llvm-cov gcov -n -dump %t/return-block.gcno 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=RETURN-SECOND %s
2021
2122 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
2223 target triple = "x86_64-unknown-linux-gnu"
None ; RUN: echo '!10 = !{!"%/T/aaa.gcno", !"%/T/bbb.gcda", !0}' > %t1
1 ; RUN: cat %s %t1 > %t2
2 ; RUN: opt -insert-gcov-profiling -S -o %t3 < %t2
3 ; RUN: grep _Z3foov %T/aaa.gcno
4 ; RUN: grep bbb.gcda %t3
5 ; RUN: rm %T/aaa.gcno
0 ; RUN: rm -rf %t && mkdir -p %t
1 ; RUN: echo '!10 = !{!"%/t/aaa.gcno", !"%/t/bbb.gcda", !0}' > %t/1
2 ; RUN: cat %s %t/1 > %t/2
3 ; RUN: opt -insert-gcov-profiling -S -o %t/3 < %t/2
4 ; RUN: grep _Z3foov %t/aaa.gcno
5 ; RUN: grep bbb.gcda %t/3
6 ; RUN: rm %t/aaa.gcno
67
78 define void @_Z3foov() !dbg !5 {
89 entry:
None ; RUN: echo '!9 = !{!"%/T/version.ll", !0}' > %t1
1 ; RUN: cat %s %t1 > %t2
2 ; RUN: opt -insert-gcov-profiling -disable-output < %t2
3 ; RUN: head -c8 %T/version.gcno | grep '^oncg.204'
4 ; RUN: rm %T/version.gcno
5 ; RUN: not opt -insert-gcov-profiling -default-gcov-version=asdfasdf -disable-output < %t2
6 ; RUN: opt -insert-gcov-profiling -default-gcov-version=407* -disable-output < %t2
7 ; RUN: head -c8 %T/version.gcno | grep '^oncg.704'
8 ; RUN: rm %T/version.gcno
0 ; RUN: rm -rf %t && mkdir -p %t
1 ; RUN: echo '!9 = !{!"%/t/version.ll", !0}' > %t/1
2 ; RUN: cat %s %t/1 > %t/2
3 ; RUN: opt -insert-gcov-profiling -disable-output < %t/2
4 ; RUN: head -c8 %t/version.gcno | grep '^oncg.204'
5 ; RUN: rm %t/version.gcno
6 ; RUN: not opt -insert-gcov-profiling -default-gcov-version=asdfasdf -disable-output < %t/2
7 ; RUN: opt -insert-gcov-profiling -default-gcov-version=407* -disable-output < %t/2
8 ; RUN: head -c8 %t/version.gcno | grep '^oncg.704'
9 ; RUN: rm %t/version.gcno
910
10 ; RUN: opt -passes=insert-gcov-profiling -disable-output < %t2
11 ; RUN: head -c8 %T/version.gcno | grep '^oncg.204'
12 ; RUN: rm %T/version.gcno
13 ; RUN: not opt -passes=insert-gcov-profiling -default-gcov-version=asdfasdf -disable-output < %t2
14 ; RUN: opt -passes=insert-gcov-profiling -default-gcov-version=407* -disable-output < %t2
15 ; RUN: head -c8 %T/version.gcno | grep '^oncg.704'
16 ; RUN: rm %T/version.gcno
11 ; RUN: opt -passes=insert-gcov-profiling -disable-output < %t/2
12 ; RUN: head -c8 %t/version.gcno | grep '^oncg.204'
13 ; RUN: rm %t/version.gcno
14 ; RUN: not opt -passes=insert-gcov-profiling -default-gcov-version=asdfasdf -disable-output < %t/2
15 ; RUN: opt -passes=insert-gcov-profiling -default-gcov-version=407* -disable-output < %t/2
16 ; RUN: head -c8 %t/version.gcno | grep '^oncg.704'
17 ; RUN: rm %t/version.gcno
1718
1819 define void @test() !dbg !5 {
1920 ret void, !dbg !8
None RUN: rm -rf %T/basic-linking-bundle
1 RUN: mkdir -p %T/basic-linking-bundle/dsymdest
2 RUN: cat %p/../Inputs/basic.macho.x86_64 > %T/basic-linking-bundle/basic.macho.x86_64
0 RUN: rm -rf %t
1 RUN: mkdir -p %t/dsymdest
2 RUN: cat %p/../Inputs/basic.macho.x86_64 > %t/basic.macho.x86_64
33
4 RUN: llvm-dsymutil -oso-prepend-path=%p/.. %T/basic-linking-bundle/basic.macho.x86_64
4 RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64
55
66 Check that the object file in the bundle exists and is sane:
7 RUN: llvm-dwarfdump %T/basic-linking-bundle/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test
7 RUN: llvm-dwarfdump %t/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test
88
99 Check that llvm-dwarfdump recognizes the bundle as a dSYM:
10 RUN: llvm-dwarfdump %T/basic-linking-bundle/basic.macho.x86_64.dSYM | FileCheck %S/basic-linking-x86.test
10 RUN: llvm-dwarfdump %t/basic.macho.x86_64.dSYM | FileCheck %S/basic-linking-x86.test
1111
12 RUN: FileCheck %s --input-file %T/basic-linking-bundle/basic.macho.x86_64.dSYM/Contents/Info.plist
12 RUN: FileCheck %s --input-file %t/basic.macho.x86_64.dSYM/Contents/Info.plist
1313
14 RUN: llvm-dsymutil -oso-prepend-path=%p/.. %T/basic-linking-bundle/basic.macho.x86_64 -o %T/basic-linking-bundle/dsymdest/basic.macho.x86_64.dSYM
15 RUN: llvm-dwarfdump %T/basic-linking-bundle/dsymdest/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test
16 RUN: FileCheck %s --input-file %T/basic-linking-bundle/dsymdest/basic.macho.x86_64.dSYM/Contents/Info.plist
14 RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64 -o %t/dsymdest/basic.macho.x86_64.dSYM
15 RUN: llvm-dwarfdump %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test
16 RUN: FileCheck %s --input-file %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Info.plist
1717
1818 CHECK:
1919 CHECK-NEXT:
None RUN: rm -rf %T/multiple-inputs
1 RUN: mkdir -p %T/multiple-inputs
0 RUN: rm -rf %t
1 RUN: mkdir -p %t
22
3 RUN: cat %p/../Inputs/basic.macho.x86_64 > %T/multiple-inputs/basic.macho.x86_64
4 RUN: cat %p/../Inputs/basic-archive.macho.x86_64 > %T/multiple-inputs/basic-archive.macho.x86_64
5 RUN: cat %p/../Inputs/basic-lto.macho.x86_64 > %T/multiple-inputs/basic-lto.macho.x86_64
6 RUN: cat %p/../Inputs/basic-lto-dw4.macho.x86_64 > %T/multiple-inputs/basic-lto-dw4.macho.x86_64
3 RUN: cat %p/../Inputs/basic.macho.x86_64 > %t/basic.macho.x86_64
4 RUN: cat %p/../Inputs/basic-archive.macho.x86_64 > %t/basic-archive.macho.x86_64
5 RUN: cat %p/../Inputs/basic-lto.macho.x86_64 > %t/basic-lto.macho.x86_64
6 RUN: cat %p/../Inputs/basic-lto-dw4.macho.x86_64 > %t/basic-lto-dw4.macho.x86_64
77
88 # Multiple inputs in flat mode
9 RUN: llvm-dsymutil -f -oso-prepend-path=%p/.. %T/multiple-inputs/basic.macho.x86_64 %T/multiple-inputs/basic-archive.macho.x86_64 %T/multiple-inputs/basic-lto.macho.x86_64 %T/multiple-inputs/basic-lto-dw4.macho.x86_64
10 RUN: llvm-dwarfdump %T/multiple-inputs/basic.macho.x86_64.dwarf \
9 RUN: llvm-dsymutil -f -oso-prepend-path=%p/.. %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64
10 RUN: llvm-dwarfdump %t/basic.macho.x86_64.dwarf \
1111 RUN: | FileCheck %S/basic-linking-x86.test --check-prefix=CHECK --check-prefix=BASIC
12 RUN: llvm-dwarfdump %T/multiple-inputs/basic-archive.macho.x86_64.dwarf \
12 RUN: llvm-dwarfdump %t/basic-archive.macho.x86_64.dwarf \
1313 RUN: | FileCheck %S/basic-linking-x86.test --check-prefix=CHECK --check-prefix=ARCHIVE
14 RUN: llvm-dwarfdump %T/multiple-inputs/basic-lto.macho.x86_64.dwarf | FileCheck %S/basic-lto-linking-x86.test
15 RUN: llvm-dwarfdump %T/multiple-inputs/basic-lto-dw4.macho.x86_64.dwarf | FileCheck %S/basic-lto-dw4-linking-x86.test
14 RUN: llvm-dwarfdump %t/basic-lto.macho.x86_64.dwarf | FileCheck %S/basic-lto-linking-x86.test
15 RUN: llvm-dwarfdump %t/basic-lto-dw4.macho.x86_64.dwarf | FileCheck %S/basic-lto-dw4-linking-x86.test
1616
1717 # Multiple inputs that end up in the same named bundle
18 RUN: llvm-dsymutil -oso-prepend-path=%p/.. %T/multiple-inputs/basic.macho.x86_64 %T/multiple-inputs/basic-archive.macho.x86_64 %T/multiple-inputs/basic-lto.macho.x86_64 %T/multiple-inputs/basic-lto-dw4.macho.x86_64 -o %t.dSYM
18 RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64 -o %t.dSYM
1919 RUN: llvm-dwarfdump %t.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 \
2020 RUN: | FileCheck %S/basic-linking-x86.test --check-prefix=CHECK --check-prefix=BASIC
2121 RUN: llvm-dwarfdump %t.dSYM/Contents/Resources/DWARF/basic-archive.macho.x86_64 \
2424 RUN: llvm-dwarfdump %t.dSYM/Contents/Resources/DWARF/basic-lto-dw4.macho.x86_64 | FileCheck %S/basic-lto-dw4-linking-x86.test
2525
2626 # Multiple inputs in a named bundle in flat mode... impossible.
27 RUN: not llvm-dsymutil -f -oso-prepend-path=%p/.. %T/multiple-inputs/basic.macho.x86_64 %T/multiple-inputs/basic-archive.macho.x86_64 %T/multiple-inputs/basic-lto.macho.x86_64 %T/multiple-inputs/basic-lto-dw4.macho.x86_64 -o %t.dSYM 2>&1 | FileCheck %s
27 RUN: not llvm-dsymutil -f -oso-prepend-path=%p/.. %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64 -o %t.dSYM 2>&1 | FileCheck %s
2828
2929 CHECK: error: cannot use -o with multiple inputs in flat mode
3030
None ; RUN: llvm-as -o %T/bcsection.bc %s
0 ; RUN: rm -rf %t && mkdir -p %t
1 ; RUN: llvm-as -o %t/bcsection.bc %s
12
2 ; RUN: llvm-mc -I=%T -filetype=obj -triple=x86_64-unknown-unknown -o %T/bcsection.bco %p/Inputs/bcsection.s
3 ; RUN: llvm-nm -no-llvm-bc %T/bcsection.bco | count 0
4 ; RUN: %gold -r -o %T/bcsection.o -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so %T/bcsection.bco
5 ; RUN: llvm-nm -no-llvm-bc %T/bcsection.o | FileCheck %s
3 ; RUN: llvm-mc -I=%t -filetype=obj -triple=x86_64-unknown-unknown -o %t/bcsection.bco %p/Inputs/bcsection.s
4 ; RUN: llvm-nm -no-llvm-bc %t/bcsection.bco | count 0
5 ; RUN: %gold -r -o %t/bcsection.o -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so %t/bcsection.bco
6 ; RUN: llvm-nm -no-llvm-bc %t/bcsection.o | FileCheck %s
67
78 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
89 target triple = "x86_64-unknown-unknown"
0 ; RUN: llvm-as -o %t %s
11 ; RUN: not %gold -plugin %llvmshlibdir/LLVMgold.so \
2 ; RUN: --plugin-opt=obj-path=%T/nonexistent-dir/foo.o \
2 ; RUN: --plugin-opt=obj-path=%t/nonexistent-dir/foo.o \
33 ; RUN: %t -o %t2 2>&1 | FileCheck %s
44
55 ; CHECK: Could not open file {{.*}}nonexistent-dir
0 ; Check that changing the output path via thinlto-prefix-replace works
1 ; RUN: mkdir -p %T/oldpath
2 ; RUN: opt -module-summary %s -o %T/oldpath/thinlto_prefix_replace.o
1 ; RUN: mkdir -p %t/oldpath
2 ; RUN: opt -module-summary %s -o %t/oldpath/thinlto_prefix_replace.o
33 ; Ensure that there is no existing file at the new path, so we properly
44 ; test the creation of the new file there.
5 ; RUN: rm -f %T/newpath/thinlto_prefix_replace.o.thinlto.bc
5 ; RUN: rm -f %t/newpath/thinlto_prefix_replace.o.thinlto.bc
66 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
77 ; RUN: --plugin-opt=thinlto \
88 ; RUN: --plugin-opt=thinlto-index-only \
9 ; RUN: --plugin-opt=thinlto-prefix-replace="%T/oldpath/;%T/newpath/" \
10 ; RUN: -shared %T/oldpath/thinlto_prefix_replace.o -o %T/thinlto_prefix_replace
11 ; RUN: ls %T/newpath/thinlto_prefix_replace.o.thinlto.bc
9 ; RUN: --plugin-opt=thinlto-prefix-replace="%t/oldpath/;%t/newpath/" \
10 ; RUN: -shared %t/oldpath/thinlto_prefix_replace.o -o %t/thinlto_prefix_replace
11 ; RUN: ls %t/newpath/thinlto_prefix_replace.o.thinlto.bc
1212
1313 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
1414
0 RUN: llvm-dwp %p/../Inputs/type_dedup/a.dwo %p/../Inputs/type_dedup/b.dwo -o %t
11 RUN: llvm-dwarfdump %t | FileCheck %s
2 RUN: llvm-dwp %p/../Inputs/type_dedup/b.dwo -o %T/b.dwp
3 RUN: llvm-dwp %p/../Inputs/type_dedup/a.dwo %T/b.dwp -o %t
2 RUN: llvm-dwp %p/../Inputs/type_dedup/b.dwo -o %tb.dwp
3 RUN: llvm-dwp %p/../Inputs/type_dedup/a.dwo %tb.dwp -o %t
44 RUN: llvm-dwarfdump %t | FileCheck %s
55
66 a.cpp:
None RUN: rm -f %T/archive.a
1 RUN: llvm-ar -format gnu crs %T/archive.a %S/Inputs/abcd
2 RUN: llvm-strings -f %T/archive.a | FileCheck %s
3 RUN: llvm-strings --print-file-name %T/archive.a | FileCheck %s
0 RUN: rm -rf %t && mkdir -p %t
1 RUN: llvm-ar -format gnu crs %t/archive.a %S/Inputs/abcd
2 RUN: llvm-strings -f %t/archive.a | FileCheck %s
3 RUN: llvm-strings --print-file-name %t/archive.a | FileCheck %s
44
55 CHECK: archive.a: !
66 CHECK: archive.a: abcd/ 0 0 0 644 4 `
None RUN: rm -f %T/inner.ar
1 RUN: llvm-ar -format gnu crs %T/inner.a %S/Inputs/abcd
2 RUN: rm -f %T/outer.ar
3 RUN: llvm-ar -format gnu crs %T/outer.a %T/inner.a
4 RUN: llvm-strings %T/outer.a | FileCheck %s
0 RUN: rm -rf %t && mkdir -p %t
1 RUN: llvm-ar -format gnu crs %t/inner.a %S/Inputs/abcd
2 RUN: llvm-ar -format gnu crs %t/outer.a %t/inner.a
3 RUN: llvm-strings %t/outer.a | FileCheck %s
54
65 CHECK: !
76 CHECK: inner.a/ 0 0 0 644 72 `