fixed bash/dash/sh issue (Ubuntu)
[zpugcc/jano.git] / toolchain / binutils / ld / testsuite / ld-auto-import / client.c
blobb3534eecc379efc7c4b079f15a33435e8bfc7f00
1 #include <stdio.h>
3 extern int var;
4 extern void (*func_ptr)(void);
5 extern void print_var (void);
6 extern void print_foo (void);
7 extern int foo;
8 extern int var2[2];
10 typedef struct
12 int * var;
13 void (* func_ptr)(void);
15 TEST;
17 TEST xyz = { &var, print_var };
19 int
20 main (void)
22 print_var ();
24 printf ("We see var = %d\n", var);
25 printf ("Setting var = 456\n");
27 var = 456;
29 print_var ();
30 printf ("We see var = %d\n\n", var);
32 var = 90;
33 print_var ();
34 printf ("We see var = %d\n\n", var);
36 print_foo ();
37 printf ("We see foo = %d\n", foo);
38 printf ("Setting foo = 19\n");
39 foo = 19;
40 print_foo ();
41 printf ("We see foo = %d\n\n", foo);
42 fflush (stdout);
44 printf ("Calling dllimported function pointer\n");
45 func_ptr ();
47 printf ("Calling functions using global structure\n");
48 xyz.func_ptr ();
49 * xyz.var = 40;
50 xyz.func_ptr ();
52 printf ("We see var2[0] = %d\n\n", var2[0]);
54 return 0;