1 ; RUN: opt < %s -loop-reduce -S | FileCheck %s
2 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-pc-windows-msvc18.0.0"
5 %struct.L = type { i8, i8* }
7 declare i32 @__CxxFrameHandler3(...)
9 @GV1 = external global %struct.L*
10 @GV2 = external global %struct.L
12 define void @b_copy_ctor() personality i32 (...)* @__CxxFrameHandler3 {
14 %0 = load %struct.L*, %struct.L** @GV1, align 8
17 for.cond: ; preds = %call.i.noexc, %entry
18 %d.0 = phi %struct.L* [ %0, %entry ], [ %incdec.ptr, %call.i.noexc ]
19 invoke void @a_copy_ctor()
20 to label %call.i.noexc unwind label %catch.dispatch
22 call.i.noexc: ; preds = %for.cond
23 %incdec.ptr = getelementptr inbounds %struct.L, %struct.L* %d.0, i64 1
26 catch.dispatch: ; preds = %for.cond
27 %1 = catchswitch within none [label %catch] unwind to caller
29 catch: ; preds = %catch.dispatch
30 %2 = catchpad within %1 [i8* null, i32 64, i8* null]
31 %cmp16 = icmp eq %struct.L* %0, %d.0
32 br i1 %cmp16, label %for.end, label %for.body
34 for.body: ; preds = %for.body, %catch
35 %cmp = icmp eq %struct.L* @GV2, %d.0
36 br i1 %cmp, label %for.end, label %for.body
38 for.end: ; preds = %for.body, %catch
39 catchret from %2 to label %try.cont
41 try.cont: ; preds = %for.end
45 ; CHECK-LABEL: define void @b_copy_ctor(
47 ; CHECK-NEXT: icmp eq %struct.L
48 ; CHECK-NEXT: %4 = sub i64 0, %1
49 ; CHECK-NEXT: getelementptr {{.*}} getelementptr inbounds (%struct.L, %struct.L* @GV2, i32 0, i32 0), i64 %4
51 declare void @a_copy_ctor()