2011-07-03 04:42:17 +08:00
|
|
|
; RUN: llc < %s -march=x86 | FileCheck %s
|
2009-01-20 09:06:45 +08:00
|
|
|
|
|
|
|
@foo = global i8 127
|
|
|
|
|
|
|
|
define i32 @main() nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: main:
|
2011-07-03 04:42:17 +08:00
|
|
|
; CHECK-NOT: ret
|
|
|
|
; CHECK: sar{{.}} $5
|
|
|
|
; CHECK: ret
|
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load i8, i8* @foo
|
2011-07-03 04:42:17 +08:00
|
|
|
%bf.lo = lshr i8 %tmp, 5
|
|
|
|
%bf.lo.cleared = and i8 %bf.lo, 7
|
|
|
|
%1 = shl i8 %bf.lo.cleared, 5
|
|
|
|
%bf.val.sext = ashr i8 %1, 5
|
|
|
|
%conv = sext i8 %bf.val.sext to i32
|
|
|
|
ret i32 %conv
|
2009-01-20 09:06:45 +08:00
|
|
|
}
|