aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/s390/hotpatch-compile-15.c
blob: 4ce7375a7c31ecc00f9e637103d218e8563530a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Functional tests for the function hotpatching feature.  */

/* { dg-do compile } */
/* { dg-options "-O3 -mzarch" } */

/* { dg-prune-output "always_inline function might not be inlinable" } */
/* { dg-prune-output "called from here" } */

#include <stdio.h>

__attribute__ ((hotpatch(1,2)))
static void hp1(void)
{
  printf("hello, world!\n");
}

__attribute__ ((hotpatch(1,2)))
static inline void hp2(void)
{
  printf("hello, world!\n");
}

__attribute__ ((hotpatch(0,0)))
__attribute__ ((always_inline))
static void hp3(void)
{
  printf("hello, world!\n");
}

__attribute__ ((hotpatch(1,2)))
__attribute__ ((always_inline))
static void hp4(void)
{
  printf("hello, world!\n");
}

void main(void)
{
  hp1();
  hp2();
  hp3();
  hp4();
}