|
| 1 | +; RUN: llc -mtriple=aarch64 -aarch64-min-jump-table-entries=4 -stack-size-section %s -o - | FileCheck %s |
| 2 | + |
| 3 | +; CHECK-LABEL: .section .stack_sizes,"o",@progbits,.text{{$}} |
| 4 | +; CHECK-NEXT: .xword .Lfunc_begin0 |
| 5 | +; CHECK-NEXT: .byte 0 |
| 6 | +define void @empty() { |
| 7 | + ret void |
| 8 | +} |
| 9 | + |
| 10 | +; CHECK-LABEL: .section .stack_sizes,"o",@progbits,.text{{$}} |
| 11 | +; CHECK-NEXT: .xword .Lfunc_begin1 |
| 12 | +; CHECK-NEXT: .ascii "\200\001" |
| 13 | +define void @non_empty() #0 { |
| 14 | + alloca [32 x i32] |
| 15 | + ret void |
| 16 | +} |
| 17 | + |
| 18 | +; CHECK-LABEL: dynalloc: |
| 19 | +; CHECK-NOT: .section .stack_sizes |
| 20 | +define void @dynalloc(i32 %n) #0 { |
| 21 | + alloca i32, i32 %n |
| 22 | + ret void |
| 23 | +} |
| 24 | + |
| 25 | +; Check that .stack_sizes section is linked to the function's section (.text), |
| 26 | +; and not to the section containing the constant pool (.rodata). |
| 27 | +; CHECK-LABEL: linked_section: |
| 28 | +; CHECK: .section .rodata,"a",@progbits |
| 29 | +; CHECK: .section .stack_sizes,"o",@progbits,.text |
| 30 | +; CHECK-NEXT: .xword .Lfunc_begin3 |
| 31 | +; CHECK-NEXT: .ascii "\220\001" |
| 32 | +declare void @case0() |
| 33 | +declare void @case1() |
| 34 | +declare void @case2() |
| 35 | +declare void @case3() |
| 36 | +define void @linked_section(i32 %x) { |
| 37 | + %arr = alloca [32 x i32] |
| 38 | + switch i32 %x, label %sw.epilog [ |
| 39 | + i32 0, label %sw.bb0 |
| 40 | + i32 1, label %sw.bb1 |
| 41 | + i32 2, label %sw.bb2 |
| 42 | + i32 3, label %sw.bb3 |
| 43 | + ] |
| 44 | + |
| 45 | +sw.bb0: |
| 46 | + call void @case0() |
| 47 | + ret void |
| 48 | + |
| 49 | +sw.bb1: |
| 50 | + call void @case1() |
| 51 | + ret void |
| 52 | + |
| 53 | +sw.bb2: |
| 54 | + call void @case2() |
| 55 | + ret void |
| 56 | + |
| 57 | +sw.bb3: |
| 58 | + call void @case3() |
| 59 | + ret void |
| 60 | + |
| 61 | +sw.epilog: |
| 62 | + ret void |
| 63 | +} |
0 commit comments