| Tim Northover | a441585 | 2013-08-06 09:12:35 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=hexagon < %s | FileCheck %s | 
|  | 2 |  | 
|  | 3 | declare i32 @ret_i32() | 
|  | 4 |  | 
|  | 5 | define i8 @test_i8() { | 
|  | 6 | ; CHECK-LABEL: test_i8: | 
|  | 7 | ; CHECK: jump ret_i32 | 
|  | 8 | %res = tail call i32 @ret_i32() | 
|  | 9 | %val = trunc i32 %res to i8 | 
|  | 10 | ret i8 %val | 
|  | 11 | } | 
|  | 12 |  | 
|  | 13 | define i16 @test_i16() { | 
|  | 14 | ; CHECK-LABEL: test_i16: | 
|  | 15 | ; CHECK: jump ret_i32 | 
|  | 16 | %res = tail call i32 @ret_i32() | 
|  | 17 | %val = trunc i32 %res to i16 | 
|  | 18 | ret i16 %val | 
|  | 19 | } | 
|  | 20 |  | 
|  | 21 | declare i64 @ret_i64() | 
|  | 22 | define i32 @test_i32() { | 
|  | 23 | ; CHECK-LABEL: test_i32: | 
|  | 24 | ; CHECK: call ret_i64 | 
|  | 25 | %res = tail call i64 @ret_i64() | 
|  | 26 | %val = trunc i64 %res to i32 | 
|  | 27 | ret i32 42 | 
|  | 28 | } |