blob: d749d5ff13458b4be24c6d96a8e8d2f58fedae54 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as | opt -lowersetjmp | llvm-dis | grep invoke
2
3%JmpBuf = type int
4%.str_1 = internal constant [13 x sbyte] c"returned %d\0A\00"
5
6implementation
7
8declare void %llvm.longjmp(%JmpBuf *%B, int %Val)
9declare int %llvm.setjmp(%JmpBuf *%B)
10
11declare void %foo()
12
13int %simpletest() {
14 %B = alloca %JmpBuf
15 %Val = call int %llvm.setjmp(%JmpBuf* %B)
16 %V = cast int %Val to bool
17 br bool %V, label %LongJumped, label %Normal
18Normal:
19 call void %foo()
20 call void %llvm.longjmp(%JmpBuf* %B, int 42)
21 ret int 0 ;; not reached
22LongJumped:
23 ret int %Val
24}
25
26declare int %printf(sbyte*, ...)
27
28int %main() {
29 %V = call int %simpletest()
30 call int(sbyte*, ...)* %printf(sbyte* getelementptr ([13 x sbyte]* %.str_1, long 0, long 0), int %V)
31 ret int 0
32}