1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00
gbreynoo 3b4c521b04 [llvm-ar][test] Add to llvm-ar test coverage
- Added handling of thin archives to symtab.test.
- Added handling of newlines to response.test.
- 62fa3332c9c1af1e66dfecd40f5b4e78882998b2 exposed behaviour
  regarding the use of -- on the command line. Added
  double-hyphen.test to cover this.

Differential Revision: https://reviews.llvm.org/D73333
2020-03-04 10:56:48 +00:00

77 lines
2.1 KiB
Plaintext

## Test the s and S modifiers. Build and do not build a symbol table.
# RUN: yaml2obj %s -o %t.o
# RUN: touch %t-other.txt
## Default:
# RUN: rm -f %t-default.a
# RUN: llvm-ar rc %t-default.a %t.o
# RUN: llvm-nm --print-armap %t-default.a \
# RUN: | FileCheck %s --check-prefix=SYMTAB
## Use a modifer:
# RUN: rm -f %t-symtab.a
# RUN: llvm-ar rcs %t-symtab.a %t.o
# RUN: llvm-nm --print-armap %t-symtab.a \
# RUN: | FileCheck %s --check-prefix=SYMTAB
# RUN: rm -f %t-no-symtab.a
# RUN: llvm-ar rcS %t-no-symtab.a %t.o
# RUN: llvm-nm --print-armap %t-no-symtab.a \
# RUN: | FileCheck %s --check-prefix=NO-SYMTAB
## Use both modifers:
# RUN: rm -f %t-symtab-last.a
# RUN: llvm-ar rcSs %t-symtab-last.a %t.o
# RUN: llvm-nm --print-armap %t-symtab-last.a \
# RUN: | FileCheck %s --check-prefix=SYMTAB
# RUN: rm -f %t-no-symtab-last.a
# RUN: llvm-ar rcsS %t-no-symtab-last.a %t.o
# RUN: llvm-nm --print-armap %t-no-symtab-last.a \
# RUN: | FileCheck %s --check-prefix=NO-SYMTAB
## Use an existing archive:
# RUN: rm -f %t-to-symtab.a
# RUN: llvm-ar rcS %t-to-symtab.a %t.o
# RUN: llvm-ar rs %t-to-symtab.a %t-other.txt
# RUN: llvm-nm --print-armap %t-to-symtab.a \
# RUN: | FileCheck %s --check-prefix=SYMTAB
# RUN: llvm-ar rs %t-to-symtab.a %t-other.txt
# RUN: llvm-nm --print-armap %t-to-symtab.a \
# RUN: | FileCheck %s --check-prefix=SYMTAB
# RUN: rm -f %t-to-no-symtab.a
# RUN: llvm-ar rcs %t-to-no-symtab.a %t.o
# RUN: llvm-ar rS %t-to-no-symtab.a %t-other.txt
# RUN: llvm-nm --print-armap %t-to-no-symtab.a \
# RUN: | FileCheck %s --check-prefix=NO-SYMTAB
# RUN: llvm-ar rS %t-to-no-symtab.a %t-other.txt
# RUN: llvm-nm --print-armap %t-to-no-symtab.a \
# RUN: | FileCheck %s --check-prefix=NO-SYMTAB
## Thin Archive:
# RUN: rm -f %t-thin.a
# RUN: llvm-ar rcT %t-thin.a %t.o
# RUN: llvm-nm --print-armap %t-thin.a \
# RUN: | FileCheck %s --check-prefix=SYMTAB
# SYMTAB: symbol in
# NO-SYMTAB-NOT: symbol in
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .text
Type: SHT_PROGBITS
Symbols:
- Name: symbol
Binding: STB_GLOBAL
Section: .text