Update tests that need to be run through llvm-upgrade. This is necessary
[oota-llvm.git] / test / CodeGen / CBackend / 2006-12-11-Float-Bitcast.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c &&
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | \
3 ; RUN:  grep '__BITCAST' | wc -l | grep 14
4
5 int %test1(float %F) {
6    %X = bitcast float %F to int
7    ret int %X
8 }
9
10 float %test2(int %I) {
11   %X = bitcast int %I to float
12   ret float %X
13 }
14
15 long %test3(double %D) {
16   %X = bitcast double %D to long
17   ret long %X
18 }
19
20 double %test4(long %L) {
21   %X = bitcast long %L to double
22   ret double %X
23 }
24
25 double %test5(double %D) {
26   %X = bitcast double %D to double
27   %Y = add double %X, 2.0
28   %Z = bitcast double %Y to long
29   %res = bitcast long %Z to double
30   ret double %res
31 }
32
33 float %test6(float %F) {
34   %X = bitcast float %F to float
35   %Y = add float %X, 2.0
36   %Z = bitcast float %Y to int
37   %res = bitcast int %Z to float
38   ret float %res
39 }
40
41 int %main(int %argc, sbyte** %argv) {
42   %a = call int %test1(float 3.1415926)
43   %b = call float %test2(int %a)
44   %c = call long %test3(double 3.1415926)
45   %d = call double %test4(long %c)
46   %e = call double %test5(double 7.0)
47   %f = call float %test6(float 7.0)
48   ret int %a
49 }