[WebAssembly] Don't perform the returned-argument optimization on constants.
[oota-llvm.git] / test / CodeGen / ARM / gv-stubs-crash.ll
1 ; RUN: llc < %s -mtriple=thumbv7-apple-ios -relocation-model=pic
2 ; <rdar://problem/10336715>
3
4 @Exn = external hidden unnamed_addr constant { i8*, i8* }
5
6 define hidden void @func(i32* %this, i32* %e) optsize align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
7   %e.ld = load i32, i32* %e, align 4
8   %inv = invoke zeroext i1 @func2(i32* %this, i32 %e.ld) optsize
9           to label %ret unwind label %lpad
10
11 ret:
12   ret void
13
14 lpad:
15   %lp = landingpad { i8*, i32 }
16           catch i8* bitcast ({ i8*, i8* }* @Exn to i8*)
17   br label %.loopexit4
18
19 .loopexit4:
20   %exn = call i8* @__cxa_allocate_exception(i32 8) nounwind
21   call void @__cxa_throw(i8* %exn, i8* bitcast ({ i8*, i8* }* @Exn to i8*), i8* bitcast (void (i32*)* @dtor to i8*)) noreturn
22   unreachable
23
24 resume:
25   resume { i8*, i32 } %lp
26 }
27
28 declare hidden zeroext i1 @func2(i32*, i32) optsize align 2
29
30 declare i8* @__cxa_allocate_exception(i32)
31
32 declare i32 @__gxx_personality_sj0(...)
33
34 declare void @dtor(i32*) optsize
35
36 declare void @__cxa_throw(i8*, i8*, i8*)