From ae383db14eb5a9035603e7c80126470389ea8029 Mon Sep 17 00:00:00 2001 From: Dominik Vogt Date: Thu, 13 Feb 2014 06:57:14 +0000 Subject: [PATCH 1/2] S390: Add test for hotpatching of nested functions. (Must generate a warning that it's not supported.) --- gcc/testsuite/gcc.target/s390/hotpatch-compile-8.c | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 gcc/testsuite/gcc.target/s390/hotpatch-compile-8.c diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-8.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-8.c new file mode 100644 index 0000000..489fc5d --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-8.c @@ -0,0 +1,23 @@ +/* Functional tests for the function hotpatching feature. */ + +/* { dg-do run } */ +/* { dg-options "-O3 -mzarch -mhotpatch" } */ + +#include + +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(); +} -- 1.8.3.1