RISC-V: Fix factor in dwarf_poly_indeterminate_value [PR116305]
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / iinline-6.c
blobcddd1bbc40c770cce74da2806ea550c25f3b38c8
1 /* Verify that simple indirect calls are inlined even without early
2 inlining.. */
3 /* { dg-do run } */
4 /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining" } */
6 extern void abort (void);
8 struct S
10 int i;
11 void (*f)(struct S *);
12 int j,k,l;
15 struct Z
17 unsigned u;
18 void (*f)(struct Z *, int);
19 struct Z *next;
22 static struct S *gs;
23 static int gr = 111;
24 char gc[1024];
26 static __attribute__ ((noinline, noclone)) struct S *
27 get_s (void)
29 return (struct S *) &gc;
32 static void wrong_target (struct S *s)
34 abort ();
37 static void good_target (struct S *s)
39 gr = 0;
42 static void g1 (struct S *s)
44 s->f (s);
47 static void f2 (struct Z *z)
49 gs->f = good_target;
50 g1 ((struct S *) z);
53 static inline __attribute__ ((flatten)) void f1 (struct S *s)
55 f2 ((struct Z *) s);
58 int main (int argc, char **argv)
60 struct S *s = get_s();
61 s->i = 5678;
62 s->f = wrong_target;
63 s->j = 1234;
64 gs = s;
65 f1 (s);
67 return gr;
71 /* { dg-final { scan-ipa-dump-not "wrong_target\[^\\n\]*inline copy in" "inline" } } */