1 ; RUN: llc < %s -mtriple=x86_64-linux -stack-size-section -function-sections | \
2 ; RUN: FileCheck %s --check-prefix=UNIQ
3 ; RUN: llc < %s -mtriple=x86_64-linux -stack-size-section -function-sections -unique-section-names=0 | \
4 ; RUN: FileCheck %s --check-prefix=NOUNIQ
6 ; Check we add SHF_LINK_ORDER for .stack_sizes and link it with the corresponding .text sections.
7 ; UNIQ: .section .text._Z3barv,"ax",@progbits{{$}}
8 ; UNIQ: .section .stack_sizes,"o",@progbits,.text._Z3barv{{$}}
9 ; UNIQ: .section .text._Z3foov,"ax",@progbits{{$}}
10 ; UNIQ: .section .stack_sizes,"o",@progbits,.text._Z3foov{{$}}
11 ; NOUNIQ: .section .text,"ax",@progbits,unique,1
12 ; NOUNIQ: .section .stack_sizes,"o",@progbits,.text,unique,1
13 ; NOUNIQ: .section .text,"ax",@progbits,unique,2
14 ; NOUNIQ: .section .stack_sizes,"o",@progbits,.text,unique,2
16 ; Check we add .stack_size section to a COMDAT group with the corresponding .text section if such a COMDAT exists.
17 ; UNIQ: .section .text._Z4fooTIiET_v,"axG",@progbits,_Z4fooTIiET_v,comdat{{$}}
18 ; UNIQ: .section .stack_sizes,"oG",@progbits,.text._Z4fooTIiET_v,_Z4fooTIiET_v,comdat{{$}}
19 ; NOUNIQ: .section .text,"axG",@progbits,_Z4fooTIiET_v,comdat,unique,3
20 ; NOUNIQ: .section .stack_sizes,"oG",@progbits,.text,_Z4fooTIiET_v,comdat,unique,3
22 $_Z4fooTIiET_v = comdat any
24 define dso_local i32 @_Z3barv() {
28 define dso_local i32 @_Z3foov() {
29 %1 = call i32 @_Z4fooTIiET_v()
33 define linkonce_odr dso_local i32 @_Z4fooTIiET_v() comdat {