1 /* Functional tests for the function hotpatching feature. */
4 /* { dg-options "-O3 -mzarch -mno-hotpatch" } */
8 __attribute__ ((hotpatch
))
11 printf("hello, world!\n");
14 __attribute__ ((hotpatch
))
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)))
30 printf("hello, world!\n");
33 __attribute__ ((hotpatch(0)))
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)))
49 printf("hello, world!\n");
52 __attribute__ ((hotpatch(1)))
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" } */