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