3 ## The option specifies the type of object file on which llvm-ranlib will operate.
5 # RUN: rm -rf %t && mkdir %t && cd %t
6 # RUN: yaml2obj --docnum=1 -DFLAG=0x1DF %s -o t32_1.o
7 # RUN: yaml2obj --docnum=1 -DFLAG=0x1F7 %s -o t64_1.o
8 # RUN: yaml2obj --docnum=2 -DFLAG=0x1DF %s -o t32_2.o
9 # RUN: yaml2obj --docnum=2 -DFLAG=0x1F7 %s -o t64_2.o
11 # RUN: llvm-ar qS t_all.a t32_1.o t64_1.o t32_2.o t64_2.o
12 # RUN: cp t_all.a t_X32.a
13 # RUN: cp t_all.a t_X64.a
14 # RUN: cp t_all.a t_X32_64.a
16 ## Test the OBJECT_MODE environment variable when adding symbol table.
17 # RUN: unset OBJECT_MODE
18 # RUN: llvm-ranlib t_X32.a
19 # RUN: llvm-nm --print-armap t_X32.a 2>&1 | FileCheck --check-prefixes=GLOB32 --implicit-check-not="in t64" %s
20 # RUN: cp t_all.a t_X32.a
21 # RUN: env OBJECT_MODE=32 llvm-ranlib t_X32.a
22 # RUN: llvm-nm --print-armap t_X32.a 2>&1 | FileCheck --check-prefixes=GLOB32 --implicit-check-not="in t64" %s
24 # RUN: env OBJECT_MODE=64 llvm-ranlib t_X64.a
25 # RUN: llvm-nm --print-armap t_X64.a 2>&1 | FileCheck --check-prefixes=GLOB64 --implicit-check-not="in t32" %s
27 # RUN: env OBJECT_MODE=32_64 llvm-ranlib t_X32_64.a
28 # RUN: llvm-nm --print-armap t_X32_64.a 2>&1 | FileCheck --check-prefixes=GLOB32,GLOB64 %s
29 # RUN: cp t_all.a t_X32_64.a
30 # RUN: env OBJECT_MODE=any llvm-ranlib t_X32_64.a
31 # RUN: llvm-nm --print-armap t_X32_64.a 2>&1 | FileCheck --check-prefixes=GLOB32,GLOB64 %s
33 # RUN: cp t_all.a t_X32.a
34 # RUN: cp t_all.a t_X64.a
35 # RUN: cp t_all.a t_X32_64.a
37 ## Test the -X option when adding symbol table.
38 # RUN: llvm-ranlib -X32 t_X32.a
39 # RUN: llvm-nm --print-armap t_X32.a 2>&1 | FileCheck --check-prefixes=GLOB32 --implicit-check-not="in t64" %s
40 # RUN: llvm-ranlib -X64 t_X32.a
41 # RUN: llvm-nm --print-armap t_X32.a 2>&1 | FileCheck --check-prefixes=GLOB32,GLOB64 %s
43 # RUN: llvm-ranlib -X64 t_X64.a
44 # RUN: llvm-nm --print-armap t_X64.a 2>&1 | FileCheck --check-prefixes=GLOB64 --implicit-check-not="in t32" %s
45 # RUN: llvm-ranlib -X32 t_X64.a
46 # RUN: llvm-nm --print-armap t_X32.a 2>&1 | FileCheck --check-prefixes=GLOB32,GLOB64 %s
48 # RUN: llvm-ranlib -X32_64 t_X32_64.a
49 # RUN: llvm-nm --print-armap t_X32_64.a 2>&1 | FileCheck --check-prefixes=GLOB32,GLOB64 %s
50 # RUN: cp t_all.a t_X32_64.a
51 # RUN: llvm-ranlib -Xany t_X32_64.a
52 # RUN: llvm-nm --print-armap t_X32_64.a 2>&1 | FileCheck --check-prefixes=GLOB32,GLOB64 %s
54 # RUN: cp t_all.a t_X32.a
55 # RUN: cp t_all.a t_X64.a
57 ## Test that the -X option will override the "OBJECT_MODE" environment variable.
58 # RUN: env OBJECT_MODE=32_64 llvm-ranlib -X32 t_X32.a
59 # RUN: llvm-nm --print-armap t_X32.a 2>&1 | FileCheck --check-prefixes=GLOB32 --implicit-check-not="in t64" %s
61 # RUN: env OBJECT_MODE=32 llvm-ranlib -X64 t_X64.a
62 # RUN: llvm-nm --print-armap t_X64.a 2>&1 | FileCheck --check-prefixes=GLOB64 --implicit-check-not="in t32" %s
64 # GLOB32: sym1_0x1DF in t32_1.o
65 # GLOB32-NEXT: sym2_0x1DF in t32_1.o
66 # GLOB32-NEXT: sym3_0x1DF in t32_2.o
67 # GLOB32-NEXT: sym4_0x1DF in t32_2.o
69 # GLOB64: sym1_0x1F7 in t64_1.o
70 # GLOB64-NEXT: sym2_0x1F7 in t64_1.o
71 # GLOB64-NEXT: sym3_0x1F7 in t64_2.o
72 # GLOB64-NEXT: sym4_0x1F7 in t64_2.o
74 ## Test invalid -X option and OBJECT_MODE enviornment var.
75 # RUN: not env OBJECT_MODE= llvm-ranlib t_X32.a 2>&1 | FileCheck --implicit-check-not="error:" --check-prefixes=INVALID-OBJECT-MODE %s
76 # RUN: not env OBJECT_MODE="" llvm-ranlib t_X32.a 2>&1 | FileCheck --implicit-check-not="error:" --check-prefixes=INVALID-OBJECT-MODE %s
77 # RUN: not env OBJECT_MODE=31 llvm-ranlib t_X64.a 2>&1 | FileCheck --implicit-check-not="error:" --check-prefixes=INVALID-OBJECT-MODE %s
78 # RUN: not llvm-ranlib -X t_X64.a 2>&1 | FileCheck --implicit-check-not="error:" --check-prefixes=INVALID-X-OPTION %s
79 # RUN: not llvm-ranlib -X31 t_X64.a 2>&1 | FileCheck --implicit-check-not="error:" --check-prefixes=INVALID-X-OPTION %s
81 # INVALID-OBJECT-MODE: error: the OBJECT_MODE environment variable has an invalid value. OBJECT_MODE must be 32, 64, 32_64, or any
82 # INVALID-X-OPTION: error: the specified object mode is not valid. Specify -X32, -X64, -X32_64, or -Xany
97 SymbolAlignmentAndType: 0x09
98 StorageMappingClass: XMC_RW
105 SymbolAlignmentAndType: 0x09
106 StorageMappingClass: XMC_RW
110 MagicNumber: [[FLAG]]
115 - Name: sym3_[[FLAG]]
121 SymbolAlignmentAndType: 0x09
122 StorageMappingClass: XMC_PR
123 - Name: sym4_[[FLAG]]
129 SymbolAlignmentAndType: 0x09
130 StorageMappingClass: XMC_PR