• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=x86_64-pc-linux -stackrealign -stack-alignment=32 < %s | FileCheck %s
2; RUN: llc -mtriple=x86_64-pc-linux-gnux32 -stackrealign -stack-alignment=32 < %s | FileCheck -check-prefix=X32ABI %s
3; This should run with NaCl as well ( -mtriple=x86_64-pc-nacl ) but currently doesn't due to PR22655
4
5; Make sure the correct register gets set up as the base pointer
6; This should be rbx for x64 and 64-bit NaCl and ebx for x32
7; CHECK-LABEL: base
8; CHECK: subq $32, %rsp
9; CHECK: movq %rsp, %rbx
10; X32ABI-LABEL: base
11; X32ABI: subl $32, %esp
12; X32ABI: movl %esp, %ebx
13; NACL-LABEL: base
14; NACL: subq $32, %rsp
15; NACL: movq %rsp, %rbx
16
17declare i32 @helper() nounwind
18define void @base() #0 {
19entry:
20  %k = call i32 @helper()
21  %a = alloca i32, i32 %k, align 4
22  store i32 0, i32* %a, align 4
23  ret void
24}
25
26attributes #0 = { nounwind uwtable "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"}
27