blob: dd4748443ef9dcfb37ce27f6b37522a30352f22d [file] [log] [blame]
Reid Spencerce380562007-01-26 08:25:06 +00001; RUN: llvm-as < %s | llvm-dis > %t1.ll
Reid Spencerd0e30dc2006-12-02 04:23:10 +00002; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3; RUN: diff %t1.ll %t2.ll
4
Reid Spencerce380562007-01-26 08:25:06 +00005define void @"NewCasts" (i16 %x) {
6 %a = zext i16 %x to i32
7 %b = sext i16 %x to i32
8 %c = trunc i16 %x to i8
9 %d = uitofp i16 %x to float
10 %e = sitofp i16 %x to double
11 %f = fptoui float %d to i16
12 %g = fptosi double %e to i16
Reid Spencerd0e30dc2006-12-02 04:23:10 +000013 %i = fpext float %d to double
14 %j = fptrunc double %i to float
Reid Spencerce380562007-01-26 08:25:06 +000015 %k = bitcast i32 %a to float
16 %l = inttoptr i16 %x to i32*
17 %m = ptrtoint i32* %l to i64
Nate Begemand4d45c22007-11-17 03:58:34 +000018 %n = insertelement <4 x i32> undef, i32 %a, i32 0
19 %o = sitofp <4 x i32> %n to <4 x float>
20 %p = uitofp <4 x i32> %n to <4 x float>
21 %q = fptosi <4 x float> %p to <4 x i32>
22 %r = fptoui <4 x float> %p to <4 x i32>
Matt Arsenaultb03bd4d2013-11-15 01:34:59 +000023 %s = inttoptr <4 x i32> %n to <4 x i32*>
24 %t = addrspacecast <4 x i32*> %s to <4 x i32 addrspace(1)*>
25 %z = addrspacecast <4 x i32*> %s to <4 x float addrspace(2)*>
Reid Spencerd0e30dc2006-12-02 04:23:10 +000026 ret void
27}
28
29
Reid Spencerce380562007-01-26 08:25:06 +000030define i16 @"ZExtConst" () {
31 ret i16 trunc ( i32 zext ( i16 42 to i32) to i16 )
Reid Spencer0e60d552006-12-18 01:11:46 +000032}
33
Reid Spencerce380562007-01-26 08:25:06 +000034define i16 @"SExtConst" () {
35 ret i16 trunc (i32 sext (i16 42 to i32) to i16 )
Reid Spencer0e60d552006-12-18 01:11:46 +000036}