1 ; Test for handlerdata when the function has landingpad and nounwind.
3 ; This test case checks whether the handlerdata is generated for the function
4 ; with landingpad instruction, even if the function has "nounwind" atttribute.
6 ; For example, although the following function never throws any exception,
7 ; however, it is still required to generate LSDA, otherwise, we can't catch
8 ; the exception properly.
10 ; void test1() noexcept {
17 ; RUN: llc -mtriple arm-unknown-linux-gnueabi -filetype=asm -o - %s \
20 declare void @throw_exception()
22 declare i32 @__gxx_personality_v0(...)
24 declare i8* @__cxa_begin_catch(i8*)
26 declare void @__cxa_end_catch()
28 define void @test1() nounwind personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
30 invoke void @throw_exception() to label %try.cont unwind label %lpad
33 %0 = landingpad { i8*, i32 }
35 %1 = extractvalue { i8*, i32 } %0, 0
36 %2 = tail call i8* @__cxa_begin_catch(i8* %1)
37 tail call void @__cxa_end_catch()
46 ; CHECK: .type test1,%function
50 ; CHECK-NOT: .cantunwind
52 ; CHECK: .personality __gxx_personality_v0
55 ; CHECK-LABEL: GCC_except_table0:
56 ; CHECK-LABEL: .Lexception0:
57 ; CHECK: .byte 255 @ @LPStart Encoding = omit
58 ; CHECK: .byte 0 @ @TType Encoding = absptr
59 ; CHECK: .uleb128 .Lttbase
60 ; CHECK: .byte 1 @ Call site Encoding = uleb128