• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -indvars -S < %s | FileCheck %s
2target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
3target triple = "x86_64-pc-windows-msvc18.0.0"
4
5define i32 @fn2() personality i32 (...)* @__CxxFrameHandler3 {
6entry:
7  br label %for.cond
8
9for.cond:                                         ; preds = %for.inc, %entry
10  %c.0 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
11; CHECK: %[[WIDE:.*]] = phi i64
12; CHECK: %[[NORM:.*]] = phi i32
13; CHECK: invoke void @fn1(i64 %[[WIDE]])
14  %idxprom = sext i32 %c.0 to i64
15  invoke void @fn1(i64 %idxprom)
16          to label %for.inc unwind label %catch.dispatch
17
18catch.dispatch:                                   ; preds = %for.cond
19  %c.0.lcssa = phi i32 [ %c.0, %for.cond ]
20; CHECK: %[[LCSSA:.*]] = phi i32 [ %[[NORM]],
21  %0 = catchswitch within none [label %catch] unwind to caller
22
23catch:                                            ; preds = %catch.dispatch
24  %1 = catchpad within %0 [i8* null, i32 64, i8* null]
25  catchret from %1 to label %exit
26
27exit:
28; CHECK: ret i32 %[[LCSSA]]
29  ret i32 %c.0.lcssa
30
31for.inc:                                          ; preds = %for.cond
32  %inc = add nsw nuw i32 %c.0, 1
33  br label %for.cond
34}
35
36declare void @fn1(i64 %idxprom)
37
38declare i32 @__CxxFrameHandler3(...)
39