16e4dc6f2SAlexander Shaposhnikov# RUN: echo abcd > %t.txt 26e4dc6f2SAlexander Shaposhnikov 36e4dc6f2SAlexander Shaposhnikov# Preserve input to verify it is not modified 46e4dc6f2SAlexander Shaposhnikov# RUN: cp %t.txt %t-copy.txt 56e4dc6f2SAlexander Shaposhnikov 6*ba53030dSFangrui Song## -I binary -O binary preserves payload through in-memory representation. 7*ba53030dSFangrui Song# RUN: llvm-objcopy -I binary -O binary %t.txt %t.2.txt 86e4dc6f2SAlexander Shaposhnikov# RUN: cmp %t.txt %t.2.txt 96e4dc6f2SAlexander Shaposhnikov# RUN: cmp %t.txt %t-copy.txt 106e4dc6f2SAlexander Shaposhnikov 11*ba53030dSFangrui Song## If -O is not specified, it defaults to -I, i.e. "binary". 12*ba53030dSFangrui Song# RUN: llvm-objcopy -I binary %t.txt %t.3.txt 136e4dc6f2SAlexander Shaposhnikov# RUN: cmp %t.txt %t.3.txt 14*ba53030dSFangrui Song 15*ba53030dSFangrui Song## -I binary -O elf* creates an ELF. -O binary transforms it back to the 16*ba53030dSFangrui Song## original file. 17*ba53030dSFangrui Song# RUN: llvm-objcopy -I binary -O elf64-x86-64 %t.txt %t.o 18*ba53030dSFangrui Song# RUN: llvm-objcopy -O binary %t.o %t.4.txt 19*ba53030dSFangrui Song# RUN: cmp %t.txt %t.4.txt 20*ba53030dSFangrui Song 21*ba53030dSFangrui Song## -B is ignored. 22*ba53030dSFangrui Song# RUN: llvm-objcopy -I binary -B i386:x86-64 -O binary %t.txt %t.5.txt 23*ba53030dSFangrui Song# RUN: cmp %t.txt %t.5.txt 24