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 | ||
085dd6e6 JM |
10 | #ifdef PROTOTYPES |
11 | long long callee(long long i) | |
12 | #else | |
c906108c SS |
13 | long long callee( i ) |
14 | long long i; | |
085dd6e6 | 15 | #endif |
c906108c SS |
16 | { |
17 | register long long result; | |
18 | ||
19 | result = 0x12345678; | |
20 | result = result << i; | |
21 | result += 0x9abcdef0; | |
22 | ||
23 | return result; | |
24 | } | |
25 | ||
26 | int known_types() | |
27 | { | |
28 | long long bin = 0, oct = 0, dec = 0, hex = 0; | |
29 | ||
30 | /* Known values, filling the full 64 bits. | |
31 | */ | |
32 | bin = 0x123456789abcdefLL; /* 64 bits = 16 hex digits */ | |
33 | oct = 01234567123456701234567LL; /* = 21+ octal digits */ | |
96baa820 | 34 | dec = 12345678901234567890ULL; /* = 19+ decimal digits */ |
c906108c SS |
35 | |
36 | /* Stop here and look! | |
37 | */ | |
38 | hex = bin - dec | oct; | |
085dd6e6 JM |
39 | |
40 | return 0; | |
c906108c SS |
41 | } |
42 | ||
43 | int main() { | |
44 | ||
45 | register long long x, y; | |
46 | register long long i; | |
47 | ||
48 | x = (long long) 0xfedcba9876543210LL; | |
49 | y = x++; | |
50 | x +=y; | |
51 | i = 11; | |
52 | x = callee( i ); | |
53 | y += x; | |
54 | ||
55 | known_types(); | |
56 | ||
57 | return 0; | |
58 | } | |
59 | ||
60 | ||
61 |