• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=x86_64-linux -stack-size-section | FileCheck %s
2
3; CHECK-LABEL: func1:
4; CHECK-NEXT: .Lfunc_begin0:
5; CHECK: .section .stack_sizes,"o",@progbits,.text{{$}}
6; CHECK-NEXT: .quad .Lfunc_begin0
7; CHECK-NEXT: .byte 8
8define void @func1(i32, i32) #0 {
9  alloca i32, align 4
10  alloca i32, align 4
11  ret void
12}
13
14; CHECK-LABEL: func2:
15; CHECK-NEXT: .Lfunc_begin1:
16; CHECK: .section .stack_sizes,"o",@progbits,.text{{$}}
17; CHECK-NEXT: .quad .Lfunc_begin1
18; CHECK-NEXT: .byte 24
19define void @func2() #0 {
20  alloca i32, align 4
21  call void @func1(i32 1, i32 2)
22  ret void
23}
24
25; Check that we still put .stack_sizes into the corresponding COMDAT group if any.
26; CHECK: .section .text._Z4fooTIiET_v,"axG",@progbits,_Z4fooTIiET_v,comdat
27; CHECK: .section .stack_sizes,"Go",@progbits,_Z4fooTIiET_v,comdat,.text._Z4fooTIiET_v{{$}}
28$_Z4fooTIiET_v = comdat any
29define linkonce_odr dso_local i32 @_Z4fooTIiET_v() comdat {
30  ret i32 0
31}
32
33; CHECK: .section .text.func3,"ax",@progbits
34; CHECK: .section .stack_sizes,"o",@progbits,.text.func3{{$}}
35define dso_local i32 @func3() section ".text.func3" {
36  %1 = alloca i32, align 4
37  store i32 0, i32* %1, align 4
38  ret i32 0
39}
40
41; CHECK-LABEL: dynalloc:
42; CHECK-NOT: .section .stack_sizes
43define void @dynalloc(i32 %N) #0 {
44  alloca i32, i32 %N
45  ret void
46}
47
48attributes #0 = { "frame-pointer"="all" }
49