Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* Test long long expression; test printing in general. |
2 | * | |
3 | * /CLO/BUILD_ENV/Exports/cc -g +e -o long_long long_long.c | |
4 | * | |
5 | * or | |
6 | * | |
7 | * cc +e +DA2.0 -g -o long_long long_long.c | |
8 | */ | |
9 | ||
10 | long long callee( i ) | |
11 | long long i; | |
12 | { | |
13 | register long long result; | |
14 | ||
15 | result = 0x12345678; | |
16 | result = result << i; | |
17 | result += 0x9abcdef0; | |
18 | ||
19 | return result; | |
20 | } | |
21 | ||
22 | int known_types() | |
23 | { | |
24 | long long bin = 0, oct = 0, dec = 0, hex = 0; | |
25 | ||
26 | /* Known values, filling the full 64 bits. | |
27 | */ | |
28 | bin = 0x123456789abcdefLL; /* 64 bits = 16 hex digits */ | |
29 | oct = 01234567123456701234567LL; /* = 21+ octal digits */ | |
30 | dec = 12345678901234567890LL; /* = 19+ decimal digits */ | |
31 | ||
32 | /* Stop here and look! | |
33 | */ | |
34 | hex = bin - dec | oct; | |
35 | } | |
36 | ||
37 | int main() { | |
38 | ||
39 | register long long x, y; | |
40 | register long long i; | |
41 | ||
42 | x = (long long) 0xfedcba9876543210LL; | |
43 | y = x++; | |
44 | x +=y; | |
45 | i = 11; | |
46 | x = callee( i ); | |
47 | y += x; | |
48 | ||
49 | known_types(); | |
50 | ||
51 | return 0; | |
52 | } | |
53 | ||
54 | ||
55 |