[WinEH] Ensure that funclets obey the x64 ABI
[oota-llvm.git] / test / CodeGen / X86 / win-catchpad.ll
index 7af13e67975c6547fcfb08b8b9644c91fd58cbb2..5a700b444f2c7b61006ee84529e022d81a9ae87e 100644 (file)
@@ -73,7 +73,13 @@ catchendblock:                                    ; preds = %catch, %catch.2, %c
 ; X86: [[contbb:LBB0_[0-9]+]]: # %try.cont
 ; X86: retl
 
-; X86: [[restorebb:LBB0_[0-9]+]]: # %invoke.cont.3
+; FIXME: These should be de-duplicated.
+; X86: [[restorebb1:LBB0_[0-9]+]]: # %invoke.cont.2
+; X86: movl -16(%ebp), %esp
+; X86: addl $12, %ebp
+; X86: jmp [[contbb]]
+
+; X86: [[restorebb2:LBB0_[0-9]+]]: # %invoke.cont.3
 ; X86: movl -16(%ebp), %esp
 ; X86: addl $12, %ebp
 ; X86: jmp [[contbb]]
@@ -89,9 +95,9 @@ catchendblock:                                    ; preds = %catch, %catch.2, %c
 ; X86-DAG: movl %[[addr_reg]], 4(%esp)
 ; X86-DAG: movl %[[e_reg]], (%esp)
 ; X86: calll _f
+; X86-NEXT: movl $[[restorebb1]], %eax
 ; X86-NEXT: addl $8, %esp
 ; X86-NEXT: popl %ebp
-; X86-NEXT: movl $[[restorebb]], %eax
 ; X86-NEXT: retl
 
 ; X86: "?catch$[[catch2bb:[0-9]+]]@?0?try_catch_catch@4HA":
@@ -104,9 +110,9 @@ catchendblock:                                    ; preds = %catch, %catch.2, %c
 ; X86-DAG: movl %[[addr_reg]], 4(%esp)
 ; X86-DAG: movl $3, (%esp)
 ; X86: calll _f
+; X86-NEXT: movl $[[restorebb2]], %eax
 ; X86-NEXT: addl $8, %esp
 ; X86-NEXT: popl %ebp
-; X86-NEXT: movl $[[restorebb]], %eax
 ; X86-NEXT: retl
 
 ; X86: L__ehtable$try_catch_catch:
@@ -147,9 +153,9 @@ catchendblock:                                    ; preds = %catch, %catch.2, %c
 ; X64-DAG: leaq -[[local_offs]](%rbp), %rdx
 ; X64-DAG: movl [[e_addr:[-0-9]+]](%rbp), %ecx
 ; X64: callq f
-; X64: addq $32, %rsp
+; X64: leaq [[contbb]](%rip), %rax
+; X64-NEXT: addq $32, %rsp
 ; X64-NEXT: popq %rbp
-; X64-NEXT: leaq [[contbb]](%rip), %rax
 ; X64-NEXT: retq
 
 ; X64: "?catch$[[catch2bb:[0-9]+]]@?0?try_catch_catch@4HA":
@@ -162,9 +168,9 @@ catchendblock:                                    ; preds = %catch, %catch.2, %c
 ; X64-DAG: movl $3, %ecx
 ; X64: callq f
 ; X64: .Ltmp3
-; X64: addq $32, %rsp
+; X64: leaq [[contbb]](%rip), %rax
+; X64-NEXT: addq $32, %rsp
 ; X64-NEXT: popq %rbp
-; X64-NEXT: leaq [[contbb]](%rip), %rax
 ; X64-NEXT: retq
 
 ; X64: $cppxdata$try_catch_catch: