[WinEH] Teach AsmPrinter about funclets
[oota-llvm.git] / test / CodeGen / X86 / seh-safe-div.ll
index 1f9e22c54626cb3145d2158ca4b06f7733b7506e..cd0ef7171957b759de3d7da093dad164a7c196c1 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc -sehprepare -mtriple x86_64-pc-windows-msvc < %s | FileCheck %s
+; RUN: llc -mtriple x86_64-pc-windows-msvc < %s | FileCheck %s
 
 ; This test case is also intended to be run manually as a complete functional
 ; test. It should link, print something, and exit zero rather than crashing.
 @str1 = internal constant [27 x i8] c"EXCEPTION_ACCESS_VIOLATION\00"
 @str2 = internal constant [29 x i8] c"EXCEPTION_INT_DIVIDE_BY_ZERO\00"
 
-define i32 @safe_div(i32* %n, i32* %d) {
+define i32 @safe_div(i32* %n, i32* %d) personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
 entry:
   %r = alloca i32, align 4
   invoke void @try_body(i32* %r, i32* %n, i32* %d)
           to label %__try.cont unwind label %lpad
 
 lpad:
-  %vals = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+  %vals = landingpad { i8*, i32 }
           catch i8* bitcast (i32 (i8*, i8*)* @safe_div_filt0 to i8*)
           catch i8* bitcast (i32 (i8*, i8*)* @safe_div_filt1 to i8*)
   %ehptr = extractvalue { i8*, i32 } %vals, 0
@@ -90,6 +90,10 @@ __try.cont:
 ; CHECK: jmp [[cont_bb]]
 
 ; CHECK: .seh_handlerdata
+; CHECK-NEXT: .text
+; CHECK-NEXT: .Ltmp{{[0-9]+}}
+; CHECK-NEXT: .seh_endproc
+; CHECK-NEXT: .section .xdata,"dr"
 ; CHECK-NEXT: .long 2
 ; CHECK-NEXT: .long .Ltmp0@IMGREL
 ; CHECK-NEXT: .long .Ltmp1@IMGREL+1