Reid Spencer | d45bff9 | 2006-12-29 20:21:51 +0000 | [diff] [blame] | 1 | ; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll |
Reid Spencer | 69ccadd | 2006-12-02 04:23:10 +0000 | [diff] [blame] | 2 | ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll |
| 3 | ; RUN: diff %t1.ll %t2.ll |
| 4 | |
| 5 | void "NewCasts" (short %x) { |
| 6 | %a = zext short %x to int |
| 7 | %b = sext short %x to uint |
| 8 | %c = trunc short %x to ubyte |
| 9 | %d = uitofp short %x to float |
| 10 | %e = sitofp short %x to double |
| 11 | %f = fptoui float %d to short |
| 12 | %g = fptosi double %e to short |
| 13 | %i = fpext float %d to double |
| 14 | %j = fptrunc double %i to float |
| 15 | %k = bitcast int %a to float |
| 16 | %l = inttoptr short %x to int* |
| 17 | %m = ptrtoint int* %l to long |
| 18 | ret void |
| 19 | } |
| 20 | |
| 21 | |
Reid Spencer | 0be3ed8 | 2006-12-18 01:11:46 +0000 | [diff] [blame] | 22 | ushort "ZExtConst" () { |
| 23 | ret ushort trunc ( uint zext ( short 42 to uint) to ushort ) |
| 24 | } |
| 25 | |
| 26 | short "SExtConst" () { |
| 27 | ret short trunc (int sext (ushort 42 to int) to short ) |
| 28 | } |