* gdb.base/completion.exp: Tab-complete "complet" instead of
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / complex.c
1 /* Test taken from GCC. Verify that we can print a structure containing
2 a complex number. */
3
4 typedef __complex__ float cf;
5 struct x { char c; cf f; } __attribute__ ((__packed__));
6 struct unpacked_x { char c; cf f; };
7 extern void f4 (struct unpacked_x*);
8 extern void f3 (void);
9 extern void f2 (struct x*);
10 extern void f1 (void);
11 int
12 main (void)
13 {
14 f1 ();
15 f3 ();
16 exit (0);
17 }
18
19 void
20 f1 (void)
21 {
22 struct x s;
23 s.f = 1;
24 s.c = 42;
25 f2 (&s);
26 }
27
28 void
29 f2 (struct x *y)
30 {
31 if (y->f != 1 || y->c != 42)
32 abort ();
33 }
34
35 void
36 f3 (void)
37 {
38 struct unpacked_x s;
39 s.f = 1;
40 s.c = 42;
41 f4 (&s);
42 }
43
44 void
45 f4 (struct unpacked_x *y)
46 {
47 if (y->f != 1 || y->c != 42)
48 abort ();
49 }
This page took 0.037255 seconds and 4 git commands to generate.