1 /* { dg-do compile } */ 2 /* { dg-options "-O3 -fdump-ipa-cp-details -fno-ipa-sra" } */ 3 4 typedef struct S 5 { 6 int (*call)(int); 7 } S; 8 9 static int __attribute__((noinline)) bar(const S * f,int x)10bar (const S *f, int x) 11 { 12 x = f->call(x); 13 return x; 14 } 15 16 extern void impossible_aa (void); 17 18 static int __attribute__((noinline)) baz(const S * f,int x)19baz (const S *f, int x) 20 { 21 impossible_aa (); 22 return bar (f, x); 23 } 24 25 static int sq(int x)26sq (int x) 27 { 28 return x * x; 29 } 30 31 static const S s = {sq}; 32 33 int g(int x)34g (int x) 35 { 36 return baz (&s, x); 37 } 38 39 int obfuscate(int x)40obfuscate (int x) 41 { 42 return baz ((S *) 0, x); 43 } 44 45 /* { dg-final { scan-ipa-dump "Discovered an indirect call to a known target" "cp" } } */ 46 47