2017-12-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr35616.c
blobad2c9e99e99d41ab18dbaf697bb07a59361e63df
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
3 typedef void (*listener_fun)(
4 int a,
5 int b,
6 int c);
8 struct data_t
10 int a;
12 listener_fun listener;
14 int b;
15 int c;
16 int d;
19 extern void abort(void);
20 void function_calling_listener (struct data_t data);
22 void function_calling_listener (struct data_t data)
24 data.listener(data.a, data.c, data.d);
27 void my_listener(int a, int b, int c)
29 if (a != 42 || b != 44 || c != 45)
30 abort ();
33 int main()
35 struct data_t d;
36 d.a = 42;
37 d.b = 43;
38 d.c = 44;
39 d.d = 45;
40 d.listener = my_listener;
41 function_calling_listener (d);
42 return 0;