aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/s390/hotpatch-compile-8.c
blob: 489fc5dd9f0bd8bfe1a1f353585b1eb30def7cd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Functional tests for the function hotpatching feature.  */

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

#include <stdio.h>

int hp1(void)
{
  int nested1(void) /* { dg-warning "hotpatching is not compatible with nested functions" } */
  { return 1; }

  __attribute__ ((hotpatch))
  int nested2(void) /* { dg-warning "hotpatching is not compatible with nested functions" } */
  { return 1; }

  return nested1() - nested2();
}

int main (void)
{
  return hp1();
}