blob: b8d84a901f56446b8bb8d880e9f17939d2de5c6b [file] [log] [blame]
James Y Knight2e64b8b2016-10-25 22:13:28 +00001;; Sparc backend can't currently handle variable allocas with
2;; alignment greater than the stack alignment. This code ought to
3;; compile, but doesn't currently.
4
5;; RUN: not llc -march=sparc < %s 2>&1 | FileCheck %s
6;; RUN: not llc -march=sparcv9 < %s 2>&1 | FileCheck %s
7;; CHECK: ERROR: Function {{.*}} required stack re-alignment
8
9define void @variable_alloca_with_overalignment(i32 %num) {
10 %aligned = alloca i32, align 64
11 %var_size = alloca i8, i32 %num, align 4
12 call void @foo(i32* %aligned, i8* %var_size)
13 ret void
14}
15
16;; Same but with the alloca itself overaligned
17define void @variable_alloca_with_overalignment_2(i32 %num) {
18 %var_size = alloca i8, i32 %num, align 64
19 call void @foo(i32* null, i8* %var_size)
20 ret void
21}
22
23declare void @foo(i32*, i8*);