2017-11-30 21:05:14 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-linux -stack-size-section | FileCheck %s
|
|
|
|
|
|
|
|
; CHECK-LABEL: func1:
|
2018-03-27 04:40:22 +08:00
|
|
|
; CHECK-NEXT: .Lfunc_begin0:
|
2020-02-15 13:14:31 +08:00
|
|
|
; CHECK: .section .stack_sizes,"o",@progbits,.text{{$}}
|
2018-03-27 04:40:22 +08:00
|
|
|
; CHECK-NEXT: .quad .Lfunc_begin0
|
2017-11-30 21:05:14 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
define void @func1(i32, i32) #0 {
|
|
|
|
alloca i32, align 4
|
|
|
|
alloca i32, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: func2:
|
2018-03-27 04:40:22 +08:00
|
|
|
; CHECK-NEXT: .Lfunc_begin1:
|
2020-02-15 13:14:31 +08:00
|
|
|
; CHECK: .section .stack_sizes,"o",@progbits,.text{{$}}
|
2018-03-27 04:40:22 +08:00
|
|
|
; CHECK-NEXT: .quad .Lfunc_begin1
|
2017-11-30 21:05:14 +08:00
|
|
|
; CHECK-NEXT: .byte 24
|
|
|
|
define void @func2() #0 {
|
|
|
|
alloca i32, align 4
|
|
|
|
call void @func1(i32 1, i32 2)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-06-22 18:53:47 +08:00
|
|
|
; Check that we still put .stack_sizes into the corresponding COMDAT group if any.
|
|
|
|
; CHECK: .section .text._Z4fooTIiET_v,"axG",@progbits,_Z4fooTIiET_v,comdat
|
2020-02-15 13:14:31 +08:00
|
|
|
; CHECK: .section .stack_sizes,"Go",@progbits,_Z4fooTIiET_v,comdat,.text._Z4fooTIiET_v{{$}}
|
2018-06-22 18:53:47 +08:00
|
|
|
$_Z4fooTIiET_v = comdat any
|
|
|
|
define linkonce_odr dso_local i32 @_Z4fooTIiET_v() comdat {
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: .section .text.func3,"ax",@progbits
|
2020-02-15 13:14:31 +08:00
|
|
|
; CHECK: .section .stack_sizes,"o",@progbits,.text.func3{{$}}
|
2018-06-22 18:53:47 +08:00
|
|
|
define dso_local i32 @func3() section ".text.func3" {
|
|
|
|
%1 = alloca i32, align 4
|
|
|
|
store i32 0, i32* %1, align 4
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
2017-11-30 21:05:14 +08:00
|
|
|
; CHECK-LABEL: dynalloc:
|
|
|
|
; CHECK-NOT: .section .stack_sizes
|
|
|
|
define void @dynalloc(i32 %N) #0 {
|
|
|
|
alloca i32, i32 %N
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2019-12-25 07:52:21 +08:00
|
|
|
attributes #0 = { "frame-pointer"="all" }
|