1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details" } */
3 
4 struct bovid
5 {
6   float red;
7   int green;
8   void *blue;
9 };
10 
11 extern void foo (float, void *, void *, long);
12 
13 static int
14 __attribute__((noinline))
ox(struct bovid cow,int z,struct bovid calf,long l)15 ox (struct bovid cow, int z, struct bovid calf, long l)
16 {
17   foo (cow.red, cow.blue, cow.blue, l);
18   return 0;
19 }
20 
caller(void)21 void caller (void)
22 {
23   struct bovid cow, calf;
24 
25   cow.red = 7.4;
26   cow.green = 6;
27   cow.blue = &cow;
28 
29   calf.red = 8.4;
30   calf.green = 5;
31   calf.blue = &cow;
32 
33   ox (cow,4,calf,2);
34   return;
35 }
36 
37 /* { dg-final { scan-tree-dump "base: z, remove_param" "eipa_sra"  } } */
38 /* { dg-final { scan-tree-dump "base: calf, remove_param" "eipa_sra"  } } */
39 /* { dg-final { cleanup-tree-dump "eipa_sra" } } */
40