1e4d22d59SJF Bastien; Check that stack alignment can be forced. Individual targets should test their
2e4d22d59SJF Bastien; specific implementation details.
3e4d22d59SJF Bastien
43787ee45SNick Desaulniers; RUN: llc < %s -stackrealign | FileCheck %s
5e4d22d59SJF Bastien; CHECK-LABEL: @f
6e4d22d59SJF Bastien; CHECK-LABEL: @g
7e4d22d59SJF Bastien
8541171f0SRainer Orth; Stack realignment not supported.
9541171f0SRainer Orth; XFAIL: sparc
10541171f0SRainer Orth
11*541cbeedSIgor Chebykin; NVPTX cannot select dynamic_stackalloc
12*541cbeedSIgor Chebykin; XFAIL: nvptx
13*541cbeedSIgor Chebykin
14e4d22d59SJF Bastiendefine i32 @f(i8* %p) nounwind {
15e4d22d59SJF Bastienentry:
16e4d22d59SJF Bastien  %0 = load i8, i8* %p
17e4d22d59SJF Bastien  %conv = sext i8 %0 to i32
18e4d22d59SJF Bastien  ret i32 %conv
19e4d22d59SJF Bastien}
20e4d22d59SJF Bastien
21e4d22d59SJF Bastiendefine i64 @g(i32 %i) nounwind {
22e4d22d59SJF Bastienentry:
23e4d22d59SJF Bastien  br label %if.then
24e4d22d59SJF Bastien
25e4d22d59SJF Bastienif.then:
26e4d22d59SJF Bastien  %0 = alloca i8, i32 %i
271e68724dSDaniel Neilson  call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 %i, i1 false)
28e4d22d59SJF Bastien  %call = call i32 @f(i8* %0)
29e4d22d59SJF Bastien  %conv = sext i32 %call to i64
30e4d22d59SJF Bastien  ret i64 %conv
31e4d22d59SJF Bastien}
32e4d22d59SJF Bastien
331e68724dSDaniel Neilsondeclare void @llvm.memset.p0i8.i32(i8*, i8, i32, i1) nounwind
343787ee45SNick Desaulniers
353787ee45SNick Desaulniers!llvm.module.flags = !{!0}
363787ee45SNick Desaulniers!0 = !{i32 2, !"override-stack-alignment", i32 32}
37