1 /* Functional tests for the function hotpatching feature. */
2
3 /* { dg-do compile } */
4 /* { dg-options "-O3 -mzarch" } */
5
6 #include <stdio.h>
7
8 __attribute__ ((hotpatch(1,2)))
9 static void hp1(void)
10 {
11 printf("hello, world!\n");
12 }
13
14 __attribute__ ((hotpatch(1,2)))
15 static inline void hp2(void)
16 {
17 printf("hello, world!\n");
18 }
19
20 __attribute__ ((hotpatch(0,0)))
21 __attribute__ ((always_inline))
22 static inline void hp3(void)
23 {
24 printf("hello, world!\n");
25 }
26
27 __attribute__ ((hotpatch(1,2)))
28 __attribute__ ((always_inline))
29 static inline void hp4(void)
30 {
31 printf("hello, world!\n");
32 }
33
34 void main(void)
35 {
36 hp1();
37 hp2();
38 hp3();
39 hp4();
40 }