1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
llvm-mirror/test/tools/llvm-ar/symtab.test
Fangrui Song 02b17f57fa [llvm-ar][test] \r\n -> \n
Also simplify some empty output tests with 'count 0'

llvm-svn: 366324
2019-07-17 13:40:42 +00:00

71 lines
2.0 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
# 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