Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / support / regression / tcc / 22_floating_point.c
blob2eb062c3f6c426950700290227d4558558f42329
1 #include <stdio.h>
2 #include <math.h>
4 float fd;
6 int
7 test()
9 // was an internal tcc compiler error with arm64 backend until 2019-11-08
10 if (fd < 5.5) {
11 return 1;
12 } else {
13 return 0;
17 int main()
19 // variables
20 float a = 12.34 + 56.78;
21 printf("%f\n", a);
23 // infix operators
24 printf("%f\n", 12.34 + 56.78);
25 printf("%f\n", 12.34 - 56.78);
26 printf("%f\n", 12.34 * 56.78);
27 printf("%f\n", 12.34 / 56.78);
29 // comparison operators
30 printf("%d %d %d %d %d %d\n", 12.34 < 56.78, 12.34 <= 56.78, 12.34 == 56.78, 12.34 >= 56.78, 12.34 > 56.78, 12.34 != 56.78);
31 printf("%d %d %d %d %d %d\n", 12.34 < 12.34, 12.34 <= 12.34, 12.34 == 12.34, 12.34 >= 12.34, 12.34 > 12.34, 12.34 != 12.34);
32 printf("%d %d %d %d %d %d\n", 56.78 < 12.34, 56.78 <= 12.34, 56.78 == 12.34, 56.78 >= 12.34, 56.78 > 12.34, 56.78 != 12.34);
34 // assignment operators
35 a = 12.34;
36 a += 56.78;
37 printf("%f\n", a);
39 a = 12.34;
40 a -= 56.78;
41 printf("%f\n", a);
43 a = 12.34;
44 a *= 56.78;
45 printf("%f\n", a);
47 a = 12.34;
48 a /= 56.78;
49 printf("%f\n", a);
51 // prefix operators
52 printf("%f\n", +12.34);
53 printf("%f\n", -12.34);
55 // type coercion
56 a = 2;
57 printf("%f\n", a);
58 printf("%f\n", sin(2));
60 return 0;
63 /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/