import gdb-1999-06-28 snapshot
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / long_long.c
CommitLineData
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
11long long callee(long long i)
12#else
c906108c
SS
13long long callee( i )
14long 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
26int 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 */
34 dec = 12345678901234567890LL; /* = 19+ decimal digits */
35
36 /* Stop here and look!
37 */
38 hex = bin - dec | oct;
085dd6e6
JM
39
40 return 0;
c906108c
SS
41}
42
43int 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
This page took 0.031528 seconds and 4 git commands to generate.