aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/s390/hotpatch-compile-7.c
blob: 98ccb42c003d883a621a7f23959158456f72cc3b (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* Functional tests for the function hotpatching feature.  */

/* { dg-do run } */
/* { dg-options "-O3 -mzarch -mno-hotpatch" } */

#include <stdio.h>

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

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

__attribute__ ((hotpatch))
__attribute__ ((always_inline))
void hp3(void) /* { dg-warning "always_inline function might not be inlinable" } */
{
  printf("hello, world!\n");
} /* { dg-warning "function 'hp3' with the 'always_inline' attribute is not hotpatchable" } */

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

__attribute__ ((hotpatch(0)))
inline void hp5(void)
{
  printf("hello, world!\n");
}

__attribute__ ((hotpatch(0)))
__attribute__ ((always_inline))
void hp6(void) /* { dg-warning "always_inline function might not be inlinable" } */
{
  printf("hello, world!\n");
} /* { dg-warning "function 'hp6' with the 'always_inline' attribute is not hotpatchable" } */

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

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

__attribute__ ((hotpatch(1)))
__attribute__ ((always_inline))
void hp9(void) /* { dg-warning "always_inline function might not be inlinable" } */
{
  printf("hello, world!\n");
} /* { dg-warning "function 'hp9' with the 'always_inline' attribute is not hotpatchable" } */

int main (void)
{
  return 0;
}