1# REQUIRES: x86
2# UNSUPPORTED: system-windows
3## Test that archive:file is supported in an input section description.
4
5# RUN: mkdir -p %t.dir
6# RUN: echo '.data; .byte 1' | llvm-mc -filetype=obj -triple=x86_64 - -o %t.dir/a.o
7# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.dir/b.o
8# RUN: rm -f %t.a
9# RUN: llvm-ar rc %t.a %t.dir/a.o %t.dir/b.o
10
11## *.a:b.o matches /path/to/input-archive.s.tmp.a:b.o
12## *b.o matches /path/to/input-archive.s.tmp.a:b.o
13# RUN: echo 'SECTIONS { \
14# RUN:   .foo : { "%t.a:a.o"(.data) } \
15# RUN:   .bar : { *.a:b.o(.data) } \
16# RUN:   .qux : { *b.o(.data1) } \
17# RUN:   }' > %t.script
18# RUN: ld.lld -T %t.script --whole-archive %t.a -o %t
19# RUN: llvm-readelf -x .foo -x .bar -x .qux %t | FileCheck %s
20
21# CHECK:      Hex dump of section '.foo':
22# CHECK-NEXT: 0x00000000 01
23# CHECK:      Hex dump of section '.bar':
24# CHECK-NEXT: 0x00000001 02
25# CHECK:      Hex dump of section '.qux':
26# CHECK-NEXT: 0x00000002 03
27
28.data
29.byte 2
30
31.section .data1,"aw",@progbits
32.byte 3
33