• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple aarch64-windows -verify-machineinstrs -filetype asm -o - %s | FileCheck %s -check-prefixes=CHECK,CHECK-OPT
2; RUN: llc -mtriple aarch64-windows -verify-machineinstrs -filetype asm -o - %s -O0 | FileCheck %s
3
4define void @func(i64 %a) {
5entry:
6  %0 = alloca i8, i64 %a, align 16
7  call void @func2(i8* nonnull %0)
8  ret void
9}
10
11declare void @func2(i8*)
12
13; The -O0 version here ends up much less elegant, so just check the
14; details of the optimized form, but check that -O0 at least emits the
15; call to __chkstk.
16
17; CHECK: add [[REG1:x[0-9]+]], x0, #15
18; CHECK-OPT: lsr x15, [[REG1]], #4
19; CHECK: bl __chkstk
20; CHECK: mov [[REG2:x[0-9]+]], sp
21; CHECK-OPT: sub [[REG3:x[0-9]+]], [[REG2]], x15, lsl #4
22; CHECK-OPT: mov sp, [[REG3]]
23; CHECK: bl func2
24