1 ; RUN: llc -mtriple=i686-pc-windows-msvc < %s | FileCheck %s
3 ; Sometimes invokes of nounwind functions make it through to CodeGen, especially
4 ; at -O0, where Clang sometimes optimistically annotates functions as nounwind.
5 ; WinEHPrepare ends up outlining functions, and emitting references to LSDA
6 ; labels. Make sure we emit the LSDA in that case.
8 declare i32 @__CxxFrameHandler3(...)
9 declare void @nounwind_func() nounwind
10 declare void @cleanup()
12 define void @should_emit_tables() personality i32 (...)* @__CxxFrameHandler3 {
14 invoke void @nounwind_func()
15 to label %done unwind label %lpad
21 %vals = landingpad { i8*, i32 }
24 resume { i8*, i32 } %vals
27 ; CHECK: _should_emit_tables:
28 ; CHECK: calll _nounwind_func
31 ; CHECK: L__ehtable$should_emit_tables:
33 ; CHECK: ___ehhandler$should_emit_tables:
34 ; CHECK: movl $L__ehtable$should_emit_tables, %eax
35 ; CHECK: jmp ___CxxFrameHandler3 # TAILCALL