1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3
4# RUN: ld.lld %t.o -o %t
5# RUN: llvm-readelf -S %t | FileCheck --check-prefix=SEC %s
6# RUN: llvm-readelf -x .cst8 %t | FileCheck %s
7
8# RUN: ld.lld -O0 -r %t.o -o %t1.o
9# RUN: llvm-readelf -S %t1.o | FileCheck --check-prefix=SEC %s
10# RUN: llvm-readelf -x .cst8 %t1.o | FileCheck %s
11
12## Check that if we have SHF_MERGE sections with the same name, flags and
13## entsize, but different alignments, we combine them with the maximum input
14## alignment as the output alignment.
15
16# SEC: Name  Type     {{.*}} Size   ES Flg Lk Inf Al
17# SEC: .cst8 PROGBITS {{.*}} 000018 08  AM  0   0  8
18
19# CHECK:      0x{{[0-9a-f]+}} 02000000 00000000 01000000 00000000
20# CHECK-NEXT: 0x{{[0-9a-f]+}} 03000000 00000000
21
22.section .cst8,"aM",@progbits,8,unique,0
23.align 4
24.quad 1
25.quad 1
26
27.section .cst8,"aM",@progbits,8,unique,1
28.align 4
29.quad 1
30.quad 2
31
32.section .cst8,"aM",@progbits,8,unique,2
33.align 8
34.quad 1
35.quad 3
36