blob: 9e946ae4ca3344a3c249d2b360d113d642cb8843 [file] [log] [blame]
Akira Hatanaka7cc27642014-07-10 18:00:53 +00001; RUN: llc < %s -march=x86-64 -mcpu=corei7-avx | FileCheck %s
2
3; testb should be scheduled right before je to enable macro-fusion.
4
5; CHECK: testb $2, %{{[abcd]}}h
6; CHECK-NEXT: je
7
8define i32 @check_flag(i32 %flags, ...) nounwind {
9entry:
10 %and = and i32 %flags, 512
11 %tobool = icmp eq i32 %and, 0
12 br i1 %tobool, label %if.end, label %if.then
13
14if.then:
15 br label %if.end
16
17if.end:
18 %hasflag = phi i32 [ 1, %if.then ], [ 0, %entry ]
19 ret i32 %hasflag
20}