gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / inline-1.c
blob4dce611d91283dcd020e4ea8d419b098c1d799ea
1 /* Verify that DECL_INLINE gets copied between DECLs properly. */
2 /* { dg-do compile } */
3 /* { dg-options "-O1" } */
4 /* { dg-final { if [ istarget hppa*-*-* ] { scan-assembler-not "xyzzy?,%r" } else { scan-assembler-not "xyzzy" } } } */
6 /* Test that declaration followed by definition inlines. */
7 static inline int xyzzy0 (int);
8 static int xyzzy0 (int x) { return x; }
9 int test0 (void)
11 return xyzzy0 (5);
14 /* Test that definition following declaration inlines. */
15 static int xyzzy1 (int);
16 static inline int xyzzy1 (int x) { return x; }
17 int test1 (void)
19 return xyzzy1 (5);
22 /* Test that redeclaration inside a function body inlines. */
23 extern inline int xyzzy2 (int x) { return x; }
24 int test2 (void)
26 extern int xyzzy2 (int);
27 return xyzzy2 (5);