1 /* { dg-do compile { target { nonpic } } } */
2 /* { dg-options "-fipa-pta -fdump-ipa-pta2 -fno-ipa-icf" } */
3 /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
4
5 struct X { char x; char y; };
6
7 char *q;
8
9 static void __attribute__((noinline))
bar(char * p)10 bar (char *p)
11 {
12 q = p;
13 }
14
test1(char a1,char b,char c,char d,char e,char f,char g,char h)15 void test1 (char a1, char b, char c, char d, char e, char f, char g, char h)
16 {
17 char *p = &a1;
18 p++;
19 bar (p);
20 }
21
test2(struct X a2,char b,char c,char d,char e,char f,char g,char h)22 void test2 (struct X a2, char b, char c, char d, char e, char f, char g, char h)
23 {
24 char *p = &a2.x;
25 p++;
26 bar (p);
27 }
28
test3(struct X a3,char b,char c,char d,char e,char f,char g,char h)29 void test3 (struct X a3, char b, char c, char d, char e, char f, char g, char h)
30 {
31 char *p = &a3.y;
32 bar (p);
33 }
34
test4(int a4,char b,char c,char d,char e,char f,char g,char h)35 void test4 (int a4, char b, char c, char d, char e, char f, char g, char h)
36 {
37 char *p = (char *)&a4;
38 p++;
39 p++;
40 p++;
41 p++;
42 bar (p);
43 }
44
45 /* { dg-final { scan-ipa-dump "bar.arg0 = { test4.arg0 test3.arg0 test2.arg0 test1.arg0 }" "pta2" } } */
46