1 ; RUN: llc < %s -mtriple=x86_64-linux -stack-size-section -function-sections | FileCheck %s
3 ; Check we add SHF_LINK_ORDER for .stack_sizes and link it with the corresponding .text sections.
4 ; CHECK: .section .text._Z3barv,"ax",@progbits
5 ; CHECK: .section .stack_sizes,"o",@progbits,.text._Z3barv,unique,0
6 ; CHECK: .section .text._Z3foov,"ax",@progbits
7 ; CHECK: .section .stack_sizes,"o",@progbits,.text._Z3foov,unique,1
9 ; Check we add .stack_size section to a COMDAT group with the corresponding .text section if such a COMDAT exists.
10 ; CHECK: .section .text._Z4fooTIiET_v,"axG",@progbits,_Z4fooTIiET_v,comdat
11 ; CHECK: .section .stack_sizes,"Go",@progbits,_Z4fooTIiET_v,comdat,.text._Z4fooTIiET_v,unique,2
13 $_Z4fooTIiET_v = comdat any
15 define dso_local i32 @_Z3barv() {
19 define dso_local i32 @_Z3foov() {
20 %1 = call i32 @_Z4fooTIiET_v()
24 define linkonce_odr dso_local i32 @_Z4fooTIiET_v() comdat {