1; RUN: opt -S -loop-unswitch -enable-new-pm=0 < %s | FileCheck %s
2; RUN: opt -S -loop-unswitch -enable-new-pm=0 -enable-mssa-loop-dependency=true -verify-memoryssa < %s | FileCheck %s
3target triple = "x86_64-pc-win32"
4
5define void @f(i32 %doit, i1 %x, i1 %y) personality i32 (...)* @__CxxFrameHandler3 {
6entry:
7  %tobool = icmp eq i32 %doit, 0
8  br label %for.cond
9
10for.cond:                                         ; preds = %for.inc, %entry
11  br i1 %x, label %for.body, label %for.end
12
13for.body:                                         ; preds = %for.cond
14  br i1 %tobool, label %if.then, label %for.inc
15
16if.then:                                          ; preds = %for.body
17  br i1 %y, label %for.inc, label %delete.notnull
18
19delete.notnull:                                   ; preds = %if.then
20  invoke void @g()
21          to label %invoke.cont unwind label %lpad
22
23invoke.cont:                                      ; preds = %delete.notnull
24  br label %for.inc
25
26lpad:                                             ; preds = %delete.notnull
27  %cp = cleanuppad within none []
28  cleanupret from %cp unwind to caller
29
30for.inc:                                          ; preds = %invoke.cont, %if.then, %for.body
31  br label %for.cond
32
33for.end:                                          ; preds = %for.cond
34  ret void
35}
36
37declare void @g()
38
39declare i32 @__CxxFrameHandler3(...)
40
41; CHECK-LABEL: define void @f(
42; CHECK: cleanuppad within none []
43; CHECK-NOT: cleanuppad
44
45attributes #0 = { ssp uwtable }
46