2017-08-02 08:28:10 +08:00
|
|
|
; RUN: llc < %s -mtriple=i686-- -mattr=+cmov | FileCheck %s
|
2010-11-19 04:05:18 +08:00
|
|
|
; Both values were being zero extended.
|
|
|
|
@u = external global i8
|
|
|
|
@s = external global i8
|
|
|
|
define i32 @foo(i1 %cond) {
|
|
|
|
; CHECK: @foo
|
2015-02-28 05:17:42 +08:00
|
|
|
%u_base = load i8, i8* @u
|
2010-11-19 04:05:18 +08:00
|
|
|
%u_val = zext i8 %u_base to i32
|
|
|
|
; CHECK: movzbl
|
|
|
|
; CHECK: movsbl
|
2015-02-28 05:17:42 +08:00
|
|
|
%s_base = load i8, i8* @s
|
2010-11-19 04:05:18 +08:00
|
|
|
%s_val = sext i8 %s_base to i32
|
|
|
|
%val = select i1 %cond, i32 %u_val, i32 %s_val
|
|
|
|
ret i32 %val
|
|
|
|
}
|