1 ; RUN: llc < %s -mtriple=i686-- | FileCheck %s
3 ; When doing sign extension, use the sext-load lowering to take advantage of
4 ; x86's sign extension during loads.
7 ; CHECK: movsbl {{.*}}, %eax
9 define i32 @test1(i32 %X) nounwind {
11 %tmp12 = trunc i32 %X to i8 ; <i8> [#uses=1]
12 %tmp123 = sext i8 %tmp12 to i32 ; <i32> [#uses=1]
16 ; When using a sextload representation, ensure that the sign extension is
17 ; preserved even when removing shifted-out low bits.
20 ; CHECK: movswl {{.*}}, %eax
22 define i32 @test2(ptr %this) {
24 %b48 = getelementptr inbounds { i16, [6 x i8] }, ptr %this, i32 0, i32 1
25 %bf.load = load i48, ptr %b48, align 2
26 %bf.ashr = ashr i48 %bf.load, 32
27 %bf.cast = trunc i48 %bf.ashr to i32