Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / InstCombine / stacksaverestore.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep call
3
4 ;; Test that llvm.stackrestore is removed when possible.
5
6 int* %test1(uint %P) {
7         %tmp = call sbyte* %llvm.stacksave()
8         call void %llvm.stackrestore(sbyte* %tmp) ;; not restoring anything
9         %A = alloca int, uint %P
10         ret int* %A
11 }
12
13 void %test2(sbyte* %X) {
14         call void %llvm.stackrestore(sbyte* %X)  ;; no allocas before return.
15         ret void
16 }
17
18 declare sbyte* %llvm.stacksave()
19
20 declare void %llvm.stackrestore(sbyte*)