brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · 0bf8370 Raw
118 lines · plain
1; RUN: llc -verify-machineinstrs -mtriple=i686-pc-windows-msvc < %s \2; RUN:     | FileCheck --check-prefix=CHECK --check-prefix=X86 %s3; RUN: llc -verify-machineinstrs -mtriple=x86_64-pc-windows-msvc < %s \4; RUN:     | FileCheck --check-prefix=CHECK --check-prefix=X64 %s5 6; Loosely based on IR for this C++ source code:7;   void f(int p);8;   void try_in_catch() {9;     try {10;       f(1);11;     } catch (...) {12;       try {13;         f(2);14;       } catch (...) {15;         f(3);16;       }17;     }18;   }19 20declare void @f(i32 %p)21declare i32 @__CxxFrameHandler3(...)22 23define i32 @try_in_catch() personality ptr @__CxxFrameHandler3 {24entry:25  invoke void @f(i32 1)26          to label %try.cont unwind label %catch.dispatch.127try.cont:28  ret i32 029 30catch.dispatch.1:31  %cs1 = catchswitch within none [label %handler1] unwind to caller32handler1:33  %h1 = catchpad within %cs1 [ptr null, i32 64, ptr null]34  invoke void @f(i32 2) [ "funclet"(token %h1) ]35          to label %catchret1 unwind label %catch.dispatch.236catchret1:37  catchret from %h1 to label %try.cont38 39catch.dispatch.2:40  %cs2 = catchswitch within %h1 [label %handler2] unwind to caller41handler2:42  %h2 = catchpad within %cs2 [ptr null, i32 64, ptr null]43  call void @f(i32 3)44  catchret from %h2 to label %catchret145}46 47; X86-LABEL: L__ehtable$try_in_catch:48; X64-LABEL: $cppxdata$try_in_catch:49; CHECK-NEXT: .long   42906550650; CHECK-NEXT: .long   451; CHECK-NEXT: .long   $stateUnwindMap$try_in_catch52; CHECK-NEXT: .long   253; CHECK-NEXT: .long   $tryMap$try_in_catch54; ip2state num + ptr55; X86-NEXT: .long   056; X86-NEXT: .long   057; X64-NEXT: .long   758; X64-NEXT: .long   $ip2state$try_in_catch59; unwindhelp offset60; X64-NEXT: .long   4061; CHECK-NEXT: .long   062; EHFlags63; CHECK-NEXT: .long   164 65; X86-LABEL: $tryMap$try_in_catch:66; X86-NEXT: .long   267; X86-NEXT: .long   268; X86-NEXT: .long   369; X86-NEXT: .long   170; X86-NEXT: .long   $handlerMap$0$try_in_catch71; X86-NEXT: .long   072; X86-NEXT: .long   073; X86-NEXT: .long   374; X86-NEXT: .long   175; X86-NEXT: .long   $handlerMap$1$try_in_catch76 77; X64-LABEL: $tryMap$try_in_catch:78; X64-NEXT: .long   079; X64-NEXT: .long   080; X64-NEXT: .long   381; X64-NEXT: .long   182; X64-NEXT: .long   $handlerMap$0$try_in_catch83; X64-NEXT: .long   284; X64-NEXT: .long   285; X64-NEXT: .long   386; X64-NEXT: .long   187; X64-NEXT: .long   $handlerMap$1$try_in_catch88 89; CHECK: $handlerMap$0$try_in_catch:90; CHECK-NEXT:   .long   6491; CHECK-NEXT:   .long   092; CHECK-NEXT:   .long   093; CHECK-NEXT:   .long   "?catch${{[0-9]+}}@?0?try_in_catch@4HA"94; X64-NEXT:   .long   5695 96; CHECK: $handlerMap$1$try_in_catch:97; CHECK-NEXT:   .long   6498; CHECK-NEXT:   .long   099; CHECK-NEXT:   .long   0100; CHECK-NEXT:   .long   "?catch${{[0-9]+}}@?0?try_in_catch@4HA"101; X64-NEXT:   .long   56102 103; X64: $ip2state$try_in_catch:104; X64-NEXT: .long   .Lfunc_begin0@IMGREL105; X64-NEXT: .long   -1106; X64-NEXT: .long   .Ltmp0@IMGREL107; X64-NEXT: .long   0108; X64-NEXT: .long   .Ltmp1@IMGREL109; X64-NEXT: .long   -1110; X64-NEXT: .long   "?catch$2@?0?try_in_catch@4HA"@IMGREL111; X64-NEXT: .long   1112; X64-NEXT: .long   .Ltmp2@IMGREL113; X64-NEXT: .long   2114; X64-NEXT: .long   .Ltmp3@IMGREL115; X64-NEXT: .long   1116; X64-NEXT: .long   "?catch$4@?0?try_in_catch@4HA"@IMGREL117; X64-NEXT: .long   3118