2018-05-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / guality / inline-params.c
blobf4c5f15094c2d630c73e945f894e9db5807cbe2f
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" } } */
8 #define GUALITY_DONT_FORCE_LIVE_AFTER -1
10 #ifndef STATIC_INLINE
11 #define STATIC_INLINE /*static*/
12 #endif
15 #include "guality.h"
17 struct a{
18 struct b {int a;} b;
19 struct c{ int a;} c;
22 __attribute__ ((always_inline)) static inline void
23 t1 (struct b *ab, int b)
25 GUALCHKXPRVAL ("b", 0xbbb, 0);
26 GUALCHKVAL (ab);
28 __attribute__ ((always_inline)) static inline void
29 t2 (struct c *ac, char *msg)
31 GUALCHKVAL (ac);
32 GUALCHKVAL (msg);
34 __attribute__ ((always_inline)) static inline void
35 t3 (struct a *a)
37 t1(&a->b, 0xbbb);
38 t2(&a->c, "test");
40 struct a a={{0},{1}};
41 int
42 main (int argc, char *argv[])
44 t3(&a);