brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 351cd00 Raw
49 lines · plain
1Test plain passthrough copying with llvm-objcopy, by checking that obj2yaml2produces identical output for both input and output object files/executables.3(Intentionally not comparing to the original input yaml, in case there are4superficial differences like line endings.) In order to have a check of the5whole file and not just individual fields with FileCheck, checking with6obj2yaml+cmp instead of llvm-readobj+cmp, as llvm-readobj also prints file7details that can differ between otherwise equal files (such as file offsets).8 9Actual copied object files/executables can differ in, among others, the10following aspects:11- The padding of executable sections (lld uses 0xcc, which is int3 on x86)12- The actual layout of the string table (it can be filled linearly,13  strings can be dedupliated, the table can be optimized by sharing tails14  of longer strings; different parts in llvm do each of these three options)15- The size indication for an empty/missing string table can either be 416  or left out altogether17- Alignment of section data18- Checksums19 20RUN: yaml2obj %p/Inputs/i386-obj.yaml -o %t.i386.o21RUN: llvm-objcopy %t.i386.o %t.i386-copy.o22RUN: obj2yaml %t.i386.o > %t.i386.o.yaml23RUN: obj2yaml %t.i386-copy.o > %t.i386-copy.o.yaml24RUN: cmp %t.i386.o.yaml %t.i386-copy.o.yaml25 26RUN: yaml2obj %p/Inputs/x86_64-obj.yaml -o %t.x86_64.o27RUN: llvm-objcopy %t.x86_64.o %t.x86_64-copy.o28RUN: obj2yaml %t.x86_64.o > %t.x86_64.o.yaml29RUN: obj2yaml %t.x86_64-copy.o > %t.x86_64-copy.o.yaml30RUN: cmp %t.x86_64.o.yaml %t.x86_64-copy.o.yaml31 32RUN: yaml2obj %p/Inputs/i386-exe.yaml -o %t.i386.exe33RUN: llvm-objcopy %t.i386.exe %t.i386-copy.exe34RUN: obj2yaml %t.i386.exe > %t.i386.exe.yaml35RUN: obj2yaml %t.i386-copy.exe > %t.i386-copy.exe.yaml36RUN: cmp %t.i386.exe.yaml %t.i386-copy.exe.yaml37 38RUN: yaml2obj %p/Inputs/x86_64-exe.yaml -o %t.x86_64.exe39RUN: llvm-objcopy %t.x86_64.exe %t.x86_64-copy.exe40RUN: obj2yaml %t.x86_64.exe > %t.x86_64.exe.yaml41RUN: obj2yaml %t.x86_64-copy.exe > %t.x86_64-copy.exe.yaml42RUN: cmp %t.x86_64.exe.yaml %t.x86_64-copy.exe.yaml43 44RUN: yaml2obj %p/Inputs/no-symbols.yaml -o %t.no-symbols.o45RUN: llvm-objcopy %t.no-symbols.o %t.no-symbols-copy.o46RUN: obj2yaml %t.no-symbols.o > %t.no-symbols.o.yaml47RUN: obj2yaml %t.no-symbols-copy.o > %t.no-symbols-copy.o.yaml48RUN: cmp %t.no-symbols.o.yaml %t.no-symbols-copy.o.yaml49