2 ; RUN: opt < %s -S -Os -debug -debug-only=loop-rotate 2>&1 | FileCheck %s -check-prefix=OS
3 ; RUN: opt < %s -S -Oz -debug -debug-only=loop-rotate 2>&1 | FileCheck %s -check-prefix=OZ
4 ; RUN: opt < %s -S -passes='default<Os>' -debug -debug-only=loop-rotate 2>&1 | FileCheck %s -check-prefix=OS
5 ; RUN: opt < %s -S -passes='default<Oz>' -debug -debug-only=loop-rotate 2>&1 | FileCheck %s -check-prefix=OZ
7 ;; Make sure -allow-loop-header-duplication overrides the default behavior at Oz
8 ; RUN: opt < %s -S -passes='default<Oz>' -enable-loop-header-duplication -debug -debug-only=loop-rotate 2>&1 | FileCheck %s -check-prefix=OS
10 ; Loop should be rotated for -Os but not for -Oz.
11 ; OS: rotating Loop at depth 1
12 ; OZ-NOT: rotating Loop at depth 1
16 declare void @use(i32)
20 %end = load i32, ptr @e
24 %n.phi = phi i32 [ %n, %loop.fin ], [ 0, %entry ]
25 %cond = icmp eq i32 %n.phi, %end
26 br i1 %cond, label %exit, label %loop.fin
29 %n = add i32 %n.phi, 1
30 call void @use(i32 %n)