brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.7 KiB · c056565 Raw
190 lines · plain
1## Test that the replace command with "u" updates the relevant members.2 3# RUN: rm -rf %t && mkdir -p %t/new/other4 5# RUN: yaml2obj %s -o %t/1.o --docnum=16# RUN: yaml2obj %s -o %t/2.o --docnum=27# RUN: yaml2obj %s -o %t/3.o --docnum=38 9# RUN: env TZ=GMT touch -t 200001020304 %t/1.o10# RUN: env TZ=GMT touch -t 200001020304 %t/2.o11# RUN: env TZ=GMT touch -t 200001020304 %t/3.o12 13# RUN: yaml2obj %s -o %t/new/1.o --docnum=414# RUN: yaml2obj %s -o %t/new/3.o --docnum=515 16# RUN: yaml2obj %s -o %t/new/other/1.o --docnum=617 18# RUN: env TZ=GMT touch -t 200001020304 %t/new/other/1.o19 20## Replace single member with newer file:21# RUN: llvm-ar rcU %t/single.a %t/1.o %t/2.o %t/3.o22# RUN: llvm-ar ruU %t/single.a %t/new/1.o23# RUN: llvm-ar t %t/single.a \24# RUN:   | FileCheck %s --check-prefix=SINGLE --implicit-check-not {{.}}25 26# SINGLE:      1.o27# SINGLE-NEXT: 2.o28# SINGLE-NEXT: 3.o29 30# RUN: llvm-nm --print-armap %t/single.a \31# RUN:   | FileCheck %s --check-prefix=SINGLE-SYM32 33# SINGLE-SYM:      symbolnew134# SINGLE-SYM-NEXT: symbol235# SINGLE-SYM-NEXT: symbol336 37## Replace new single member with older file:38# RUN: llvm-ar ruU %t/single.a %t/1.o39# RUN: llvm-ar t %t/single.a \40# RUN:   | FileCheck %s --check-prefix=SINGLE --implicit-check-not {{.}}41 42# RUN: llvm-nm --print-armap %t/single.a \43# RUN:   | FileCheck %s --check-prefix=SINGLE-SYM44 45## Replace multiple members with newer files:46# RUN: llvm-ar rcuU %t/multiple.a %t/1.o %t/2.o %t/3.o47# RUN: llvm-ar ruU %t/multiple.a %t/new/1.o %t/new/3.o48# RUN: llvm-ar t %t/multiple.a \49# RUN:   | FileCheck %s --check-prefix=MULTIPLE --implicit-check-not {{.}}50 51# MULTIPLE:      1.o52# MULTIPLE-NEXT: 2.o53# MULTIPLE-NEXT: 3.o54 55# RUN: llvm-nm --print-armap %t/multiple.a \56# RUN:   | FileCheck %s --check-prefix=MULTIPLE-SYM57 58# MULTIPLE-SYM:      symbolnew159# MULTIPLE-SYM-NEXT: symbol260# MULTIPLE-SYM-NEXTs: symbolnew361 62## Replace newer members with multiple older files:63# RUN: llvm-ar ruU %t/multiple.a %t/1.o %t/2.o64# RUN: llvm-ar t %t/multiple.a \65# RUN:   | FileCheck %s --check-prefix=MULTIPLE --implicit-check-not {{.}}66 67# RUN: llvm-nm --print-armap %t/multiple.a \68# RUN:   | FileCheck %s --check-prefix=MULTIPLE-SYM69 70## Replace same member with newer files:71# RUN: llvm-ar rcuU %t/same.a %t/1.o %t/2.o %t/3.o72# RUN: llvm-ar ruU %t/same.a %t/new/1.o %t/new/other/1.o73# RUN: llvm-ar t %t/same.a \74# RUN:   | FileCheck %s --check-prefix=SAME -DFILE=%t/2.o --implicit-check-not {{.}}75 76# SAME:      1.o77# SAME-NEXT: 2.o78# SAME-NEXT: 3.o79# SAME-NEXT: 1.o80 81# RUN: llvm-nm --print-armap %t/same.a \82# RUN:   | FileCheck %s --check-prefix=SAME-SYM83 84# SAME-SYM:      symbolnew185# SAME-SYM-NEXT: symbol286# SAME-SYM-NEXT: symbol387# SAME-SYM-NEXT: symbolother188 89## Replace multiple members with an older file and a newer file:90# RUN: llvm-ar rcuU %t/old-new.a %t/new/1.o %t/2.o %t/3.o91# RUN: llvm-ar ruU %t/old-new.a %t/1.o %t/new/3.o92# RUN: llvm-ar t %t/old-new.a \93# RUN:   | FileCheck %s --check-prefix=MULTIPLE --implicit-check-not {{.}}94 95# RUN: llvm-nm --print-armap %t/old-new.a \96# RUN:   | FileCheck %s --check-prefix=MULTIPLE-SYM97 98## Replace same member with an older file and a newer file:99# RUN: llvm-ar rcuU %t/old-new-same.a %t/new/1.o %t/2.o %t/3.o100# RUN: llvm-ar ruU %t/old-new-same.a %t/1.o %t/new/other/1.o101# RUN: llvm-ar t %t/old-new-same.a \102# RUN:   | FileCheck %s --check-prefix=SAME -DFILE=%t/2.o --implicit-check-not {{.}}103 104# RUN: llvm-nm --print-armap %t/same.a \105# RUN:   | FileCheck %s --check-prefix=SAME-SYM106 107--- !ELF108FileHeader:109  Class:   ELFCLASS64110  Data:    ELFDATA2LSB111  Type:    ET_REL112  Machine: EM_X86_64113Sections:114  - Name: .text115    Type: SHT_PROGBITS116Symbols:117  - Name:    symbol1118    Binding: STB_GLOBAL119    Section: .text120 121--- !ELF122FileHeader:123  Class:   ELFCLASS64124  Data:    ELFDATA2LSB125  Type:    ET_REL126  Machine: EM_X86_64127Sections:128  - Name: .text129    Type: SHT_PROGBITS130Symbols:131  - Name:    symbol2132    Binding: STB_GLOBAL133    Section: .text134 135--- !ELF136FileHeader:137  Class:   ELFCLASS64138  Data:    ELFDATA2LSB139  Type:    ET_REL140  Machine: EM_X86_64141Sections:142  - Name: .text143    Type: SHT_PROGBITS144Symbols:145  - Name:    symbol3146    Binding: STB_GLOBAL147    Section: .text148 149--- !ELF150FileHeader:151  Class:   ELFCLASS64152  Data:    ELFDATA2LSB153  Type:    ET_REL154  Machine: EM_X86_64155Sections:156  - Name: .text157    Type: SHT_PROGBITS158Symbols:159  - Name:    symbolnew1160    Binding: STB_GLOBAL161    Section: .text162 163--- !ELF164FileHeader:165  Class:   ELFCLASS64166  Data:    ELFDATA2LSB167  Type:    ET_REL168  Machine: EM_X86_64169Sections:170  - Name: .text171    Type: SHT_PROGBITS172Symbols:173  - Name:    symbolnew3174    Binding: STB_GLOBAL175    Section: .text176 177--- !ELF178FileHeader:179  Class:   ELFCLASS64180  Data:    ELFDATA2LSB181  Type:    ET_REL182  Machine: EM_X86_64183Sections:184  - Name: .text185    Type: SHT_PROGBITS186Symbols:187  - Name:    symbolother1188    Binding: STB_GLOBAL189    Section: .text190