1 ## Test a basic copy of an archive containing a wasm object.
3 # RUN: yaml2obj %s -o %t
5 ## Create an archive and copy it using llvm-objcopy.
7 # RUN: llvm-ar crs %t.a %t
8 # RUN: cp %t.a %t.copy.a
9 # RUN: llvm-objcopy %t.a %t2.a
10 ## Create another archive from an objcopy-copied object, verify that they match.
11 # RUN: llvm-objcopy %t %t2
12 # RUN: llvm-ar p %t2.a > %t3
15 ## Check that the copied archive has the correct index contents.
16 # RUN: llvm-nm --print-armap %t.a | FileCheck --check-prefix=INDEX-TABLE %s
17 # RUN: llvm-nm --print-armap %t2.a | FileCheck --check-prefix=INDEX-TABLE %s
18 ## Verify that llvm-objcopy has not modifed the input.
19 # RUN: cmp %t.copy.a %t.a
21 # INDEX-TABLE: Archive map
22 # INDEX-TABLE-NEXT: func1 in
24 ## Do the same with an archive that has no index.
25 # RUN: rm -f %t.no.index.a
26 # RUN: llvm-ar crS %t.no.index.a %t
27 # RUN: llvm-objcopy %t.no.index.a %t2.no.index.a
28 # RUN: llvm-ar p %t2.no.index.a > %t4
30 # RUN: llvm-nm --print-armap %t.no.index.a | FileCheck --check-prefix=NO-INDEX-TABLE %s
31 # RUN: llvm-nm --print-armap %t2.no.index.a | FileCheck --check-prefix=NO-INDEX-TABLE %s
34 # NO-INDEX-TABLE-NOT: Archive map
35 # NO-INDEX-TABLE-NOT: func1 in
59 - Type: R_WASM_TABLE_INDEX_SLEB
62 - Type: R_WASM_FUNCTION_INDEX_LEB