Rebase.
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / hotpatch-compile-7.c
blob98ccb42c003d883a621a7f23959158456f72cc3b
1 /* Functional tests for the function hotpatching feature. */
3 /* { dg-do run } */
4 /* { dg-options "-O3 -mzarch -mno-hotpatch" } */
6 #include <stdio.h>
8 __attribute__ ((hotpatch))
9 void hp1(void)
11 printf("hello, world!\n");
14 __attribute__ ((hotpatch))
15 inline void hp2(void)
17 printf("hello, world!\n");
20 __attribute__ ((hotpatch))
21 __attribute__ ((always_inline))
22 void hp3(void) /* { dg-warning "always_inline function might not be inlinable" } */
24 printf("hello, world!\n");
25 } /* { dg-warning "function 'hp3' with the 'always_inline' attribute is not hotpatchable" } */
27 __attribute__ ((hotpatch(0)))
28 void hp4(void)
30 printf("hello, world!\n");
33 __attribute__ ((hotpatch(0)))
34 inline void hp5(void)
36 printf("hello, world!\n");
39 __attribute__ ((hotpatch(0)))
40 __attribute__ ((always_inline))
41 void hp6(void) /* { dg-warning "always_inline function might not be inlinable" } */
43 printf("hello, world!\n");
44 } /* { dg-warning "function 'hp6' with the 'always_inline' attribute is not hotpatchable" } */
46 __attribute__ ((hotpatch(1)))
47 void hp7(void)
49 printf("hello, world!\n");
52 __attribute__ ((hotpatch(1)))
53 inline void hp8(void)
55 printf("hello, world!\n");
58 __attribute__ ((hotpatch(1)))
59 __attribute__ ((always_inline))
60 void hp9(void) /* { dg-warning "always_inline function might not be inlinable" } */
62 printf("hello, world!\n");
63 } /* { dg-warning "function 'hp9' with the 'always_inline' attribute is not hotpatchable" } */
65 int main (void)
67 return 0;