brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.0 KiB · 163980f Raw
108 lines · plain
1; RUN: llc < %s | FileCheck %s2 3; IR generated by the following C++ source with modifications to reuse the 'v'4; alloca between catchpads:5; extern "C" void maythrow();6; int main() {7;   try {8;     try {9;       maythrow();10;     } catch (int v) {11;       maythrow();12;     }13;   } catch (int v) {14;     maythrow();15;   }16;   return 0;17; }18 19; CHECK: $cppxdata$main:20; CHECK-NEXT: .long   429065506               # MagicNumber21; CHECK-NEXT: .long   4                       # MaxState22; CHECK-NEXT: .long   $stateUnwindMap$main@IMGREL # UnwindMap23; CHECK-NEXT: .long   2                       # NumTryBlocks24; CHECK-NEXT: .long   $tryMap$main@IMGREL   # TryBlockMap25; CHECK-NEXT: .long   5                       # IPMapEntries26; CHECK-NEXT: .long   $ip2state$main@IMGREL # IPToStateXData27; CHECK-NEXT: .long   32                      # UnwindHelp28; CHECK-NEXT: .long   0                       # ESTypeList29; CHECK-NEXT: .long   1                       # EHFlags30 31; CHECK: $tryMap$main:32; CHECK-NEXT: .long   1                       # TryLow33; CHECK-NEXT: .long   1                       # TryHigh34; CHECK-NEXT: .long   2                       # CatchHigh35; CHECK-NEXT: .long   1                       # NumCatches36; CHECK-NEXT: .long   $handlerMap$0$main@IMGREL # HandlerArray37; CHECK-NEXT: .long   0                       # TryLow38; CHECK-NEXT: .long   2                       # TryHigh39; CHECK-NEXT: .long   3                       # CatchHigh40; CHECK-NEXT: .long   1                       # NumCatches41; CHECK-NEXT: .long   $handlerMap$1$main@IMGREL # HandlerArray42 43; CHECK: $handlerMap$0$main:44; CHECK-NEXT: .long   0                       # Adjectives45; CHECK-NEXT: .long   "??_R0H@8"@IMGREL       # Type46; CHECK-NEXT: .long   [[v_offset:[0-9]+]]     # CatchObjOffset47; CHECK-NEXT: .long   "?catch$2@?0?main@4HA"@IMGREL # Handler48; CHECK-NEXT: .long   {{.*}}                  # ParentFrameOffset49 50; CHECK: $handlerMap$1$main:51; CHECK-NEXT: .long   0                       # Adjectives52; CHECK-NEXT: .long   "??_R0H@8"@IMGREL       # Type53; CHECK-NEXT: .long   [[v_offset]]            # CatchObjOffset54; CHECK-NEXT: .long   "?catch$4@?0?main@4HA"@IMGREL # Handler55; CHECK-NEXT: .long   {{.*}}                      # ParentFrameOffset56 57; ModuleID = 't.cpp'58source_filename = "t.cpp"59target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"60target triple = "x86_64-pc-windows-msvc19.0.24210"61 62%rtti.TypeDescriptor2 = type { ptr, ptr, [3 x i8] }63 64$"\01??_R0H@8" = comdat any65 66@"\01??_7type_info@@6B@" = external constant ptr67@"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { ptr @"\01??_7type_info@@6B@", ptr null, [3 x i8] c".H\00" }, comdat68 69; Function Attrs: norecurse uwtable70define i32 @main() local_unnamed_addr personality ptr @__CxxFrameHandler3 {71entry:72  %v = alloca i32, align 473  invoke void @maythrow()74          to label %try.cont6 unwind label %catch.dispatch75 76catch.dispatch:                                   ; preds = %entry77  %0 = catchswitch within none [label %catch] unwind label %catch.dispatch278 79catch:                                            ; preds = %catch.dispatch80  %1 = catchpad within %0 [ptr @"\01??_R0H@8", i32 0, ptr %v]81  invoke void @maythrow() [ "funclet"(token %1) ]82          to label %invoke.cont1 unwind label %catch.dispatch283 84catch.dispatch2:                                  ; preds = %catch, %catch.dispatch85  %2 = catchswitch within none [label %catch3] unwind to caller86 87catch3:                                           ; preds = %catch.dispatch288  %3 = catchpad within %2 [ptr @"\01??_R0H@8", i32 0, ptr %v]89  call void @maythrow() [ "funclet"(token %3) ]90  catchret from %3 to label %try.cont691 92try.cont6:                                        ; preds = %entry, %invoke.cont1, %catch393  ret i32 094 95invoke.cont1:                                     ; preds = %catch96  catchret from %1 to label %try.cont697}98 99declare void @maythrow() local_unnamed_addr #1100 101declare i32 @__CxxFrameHandler3(...)102 103!llvm.module.flags = !{!0}104!llvm.ident = !{!1}105 106!0 = !{i32 1, !"PIC Level", i32 2}107!1 = !{!"clang version 4.0.0 "}108