OSDN Git Service

47e6498b19431611d50e51d154c28f220abd691b
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / guality / inline-params.c
1 /* { dg-do run } */
2 /* IPA-SRA removes the arguments as dead, so we don't see their values, early
3    inlining inlines the functions too early to test the real IPA passes (such
4    as IPA-CP).  */
5 /* { dg-options "-g -fno-early-inlining -fno-ipa-sra" } */
6 /* { dg-xfail-run-if "" { "*-*-*" } { "-O2" "-O3" "-Os" } { "-fwhopr" } } */
7
8 #define GUALITY_DONT_FORCE_LIVE_AFTER -1
9
10 #ifndef STATIC_INLINE
11 #define STATIC_INLINE /*static*/
12 #endif
13
14
15 #include "guality.h"
16
17 struct a{
18   struct b {int a;} b;
19   struct c{ int a;} c;
20 };
21
22 __attribute__ ((always_inline)) static inline void
23 t1 (struct b *ab, int b)
24 {
25   GUALCHKXPRVAL ("b", 0xbbb, 0);
26   GUALCHKVAL (ab);
27 }
28 __attribute__ ((always_inline)) static inline void
29 t2 (struct c *ac, char *msg)
30 {
31   GUALCHKVAL (ac);
32   GUALCHKVAL (msg);
33 }
34 __attribute__ ((always_inline)) static inline void
35 t3 (struct a *a)
36 {
37   t1(&a->b, 0xbbb);
38   t2(&a->c, "test");
39 }
40 struct a a={{0},{1}};
41 int
42 main (int argc, char *argv[])
43 {
44   t3(&a);
45 }