summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/cast-and-cast.ll
blob: b141974bece66b2c4426d775f88cbb9c43b544e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep bitcast

bool %test1(uint %val) {
  %t1 = bitcast uint %val to int 
  %t2 = and int %t1, 1
  %t3 = trunc int %t2 to bool
  ret bool %t3
}

short %test1(uint %val) {
  %t1 = bitcast uint %val to int 
  %t2 = and int %t1, 1
  %t3 = trunc int %t2 to short
  ret short %t3
}