summaryrefslogtreecommitdiff
path: root/test/CodeGen/Generic/stacksave-restore.ll
blob: b124b5f9b7d5521f7f9e09c2b6b6f9773fc52065 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
; RUN: llc < %s

declare i8* @llvm.stacksave()

declare void @llvm.stackrestore(i8*)

define i32* @test(i32 %N) {
        %tmp = call i8* @llvm.stacksave( )              ; <i8*> [#uses=1]
        %P = alloca i32, i32 %N         ; <i32*> [#uses=1]
        call void @llvm.stackrestore( i8* %tmp )
        %Q = alloca i32, i32 %N         ; <i32*> [#uses=0]
        ret i32* %P
}