brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · 74d1bee Raw
91 lines · plain
1## Test the s and S modifiers. Build and do not build a symbol table.2 3# RUN: yaml2obj %s -o %t.o4# RUN: touch %t-other.txt5 6## Default:7# RUN: rm -f %t-default.a8# RUN: llvm-ar rc %t-default.a %t.o9# RUN: llvm-nm --print-armap %t-default.a \10# RUN:   | FileCheck %s --check-prefix=SYMTAB11 12## Use a modifer:13# RUN: rm -f %t-symtab.a14# RUN: llvm-ar rcs %t-symtab.a %t.o15# RUN: llvm-nm --print-armap %t-symtab.a \16# RUN:   | FileCheck %s --check-prefix=SYMTAB17 18# RUN: rm -f %t-no-symtab.a19# RUN: llvm-ar rcS %t-no-symtab.a %t.o20# RUN: llvm-nm --print-armap %t-no-symtab.a \21# RUN:   | FileCheck %s --check-prefix=NO-SYMTAB22 23## Use both modifers:24# RUN: rm -f %t-symtab-last.a25# RUN: llvm-ar rcSs %t-symtab-last.a %t.o26# RUN: llvm-nm --print-armap %t-symtab-last.a \27# RUN:   | FileCheck %s --check-prefix=SYMTAB28 29# RUN: rm -f %t-no-symtab-last.a30# RUN: llvm-ar rcsS %t-no-symtab-last.a %t.o31# RUN: llvm-nm --print-armap %t-no-symtab-last.a \32# RUN:   | FileCheck %s --check-prefix=NO-SYMTAB33 34## Use an existing archive:35# RUN: rm -f %t-to-symtab.a36# RUN: llvm-ar rcS %t-to-symtab.a %t.o37# RUN: llvm-ar rs %t-to-symtab.a %t-other.txt38# RUN: llvm-nm --print-armap %t-to-symtab.a \39# RUN:   | FileCheck %s --check-prefix=SYMTAB40 41# RUN: llvm-ar rs %t-to-symtab.a %t-other.txt42# RUN: llvm-nm --print-armap %t-to-symtab.a \43# RUN:   | FileCheck %s --check-prefix=SYMTAB44 45# RUN: rm -f %t-to-no-symtab.a46# RUN: llvm-ar rcs %t-to-no-symtab.a %t.o47# RUN: llvm-ar rS %t-to-no-symtab.a %t-other.txt48# RUN: llvm-nm --print-armap %t-to-no-symtab.a \49# RUN:   | FileCheck %s --check-prefix=NO-SYMTAB50 51# RUN: llvm-ar rS %t-to-no-symtab.a %t-other.txt52# RUN: llvm-nm --print-armap %t-to-no-symtab.a \53# RUN:   | FileCheck %s --check-prefix=NO-SYMTAB54 55## Thin Archive:56# RUN: rm -f %t-thin.a57# RUN: llvm-ar rcT %t-thin.a %t.o58# RUN: llvm-nm --print-armap %t-thin.a \59# RUN:   | FileCheck %s --check-prefix=SYMTAB60 61## llvm-ranlib does not change a thin archive to a regular one.62# RUN: rm -f %t-thin.a && llvm-ar rcTS %t-thin.a %t.o63# RUN: llvm-nm --print-armap %t-thin.a | FileCheck %s --check-prefix=NO-SYMTAB64# RUN: llvm-ranlib %t-thin.a65# RUN: llvm-nm --print-armap %t-thin.a | FileCheck %s --check-prefix=SYMTAB66# RUN: FileCheck --input-file=%t-thin.a %s --check-prefixes=THIN67 68## llvm-ar -s is identical to ranlib and a duplicated operation does not change the output.69# RUN: rm -f %t-thin2.a && llvm-ar rcTS %t-thin2.a %t.o70# RUN: llvm-ar s %t-thin2.a && cmp %t-thin.a %t-thin2.a71# RUN: llvm-ar s %t-thin2.a && cmp %t-thin.a %t-thin2.a72 73# SYMTAB:        symbol in74# NO-SYMTAB-NOT: symbol in75 76# THIN: !<thin>77 78--- !ELF79FileHeader:80  Class:   ELFCLASS6481  Data:    ELFDATA2LSB82  Type:    ET_REL83  Machine: EM_X86_6484Sections:85  - Name: .text86    Type: SHT_PROGBITS87Symbols:88  - Name:    symbol89    Binding: STB_GLOBAL90    Section: .text91