diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/s390')
25 files changed, 86 insertions, 7 deletions
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-1.c b/gcc/testsuite/gcc.target/s390/hotpatch-1.c index 4e29817991e..b14fa9010a8 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-1.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-1.c @@ -11,6 +11,9 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler-not "post-label NOPs" } } */ /* { dg-final { scan-assembler-not "nopr\t%r7" } } */ /* { dg-final { scan-assembler-not "nop\t0" } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ +/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-10.c b/gcc/testsuite/gcc.target/s390/hotpatch-10.c index 352c9d500d7..a990c4cad6e 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-10.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-10.c @@ -11,6 +11,9 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler-not "post-label NOPs" } } */ /* { dg-final { scan-assembler-not "nopr\t%r7" } } */ /* { dg-final { scan-assembler-not "nop\t0" } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ +/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-11.c b/gcc/testsuite/gcc.target/s390/hotpatch-11.c index beb8738c653..6f8a52b26d3 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-11.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-11.c @@ -11,6 +11,8 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */ +/* { dg-final { scan-assembler-not "post-label NOPs" } } */ /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */ /* { dg-final { scan-assembler-not "nop\t0" } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-12.c b/gcc/testsuite/gcc.target/s390/hotpatch-12.c index d109478b04f..b73ca90fd3d 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-12.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-12.c @@ -11,6 +11,8 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler "pre-label.*(999 halfwords)" } } */ +/* { dg-final { scan-assembler-not "post-label NOPs" } } */ /* { dg-final { scan-assembler-times "nopr\t%r7" 999 } } */ /* { dg-final { scan-assembler-not "nop\t0" } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-13.c b/gcc/testsuite/gcc.target/s390/hotpatch-13.c index 9ac9f842d63..150667a1c66 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-13.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-13.c @@ -12,6 +12,10 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */ +/* { dg-final { scan-assembler-not "post-label NOPs" } } */ /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */ /* { dg-final { scan-assembler-not "nop\t0" } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ +/* { dg-final { scan-assembler "alignment for hotpatch" } } */ +/* { dg-final { scan-assembler-times "\.align\t8" 2 } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-14.c b/gcc/testsuite/gcc.target/s390/hotpatch-14.c index 209e4ac5e47..c5f118c1cc6 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-14.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-14.c @@ -12,6 +12,9 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */ /* { dg-final { scan-assembler-not "nopr\t%r7" } } */ /* { dg-final { scan-assembler-times "nop\t0" 1 } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ +/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-15.c b/gcc/testsuite/gcc.target/s390/hotpatch-15.c index 109034ef019..ef0fb746227 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-15.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-15.c @@ -12,6 +12,8 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */ +/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */ /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */ /* { dg-final { scan-assembler-times "nop\t0" 1 } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-16.c b/gcc/testsuite/gcc.target/s390/hotpatch-16.c index b01c1c32254..a34bf95c3cb 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-16.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-16.c @@ -12,6 +12,8 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */ +/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */ /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */ /* { dg-final { scan-assembler-times "nop\t0" 1 } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-17.c b/gcc/testsuite/gcc.target/s390/hotpatch-17.c index ce0b950f8d3..66ac725d16a 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-17.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-17.c @@ -12,6 +12,9 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler-not "post-label NOPs" } } */ /* { dg-final { scan-assembler-not "nopr\t%r7" } } */ /* { dg-final { scan-assembler-not "nop\t0" } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ +/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-18.c b/gcc/testsuite/gcc.target/s390/hotpatch-18.c index 9a24d5e6a77..8b076a4e175 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-18.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-18.c @@ -11,6 +11,9 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler-not "post-label NOPs" } } */ /* { dg-final { scan-assembler-not "nopr\t%r7" } } */ /* { dg-final { scan-assembler-not "nop\t0" } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ +/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-19.c b/gcc/testsuite/gcc.target/s390/hotpatch-19.c index 3586da29a89..6993c7e855c 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-19.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-19.c @@ -18,6 +18,8 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */ +/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */ /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */ /* { dg-final { scan-assembler-times "nop\t0" 1 } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-2.c b/gcc/testsuite/gcc.target/s390/hotpatch-2.c index 18be5aa2383..67189f8a28b 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-2.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-2.c @@ -11,7 +11,9 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler "post-label.*(1 halfwords)" } } */ /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */ /* { dg-final { scan-assembler-not "nop\t0" } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ -/* { dg-final { scan-assembler-times "\.align\t8" 2 } } */ +/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-21.c b/gcc/testsuite/gcc.target/s390/hotpatch-21.c index d72dee318cf..e9099900855 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-21.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-21.c @@ -11,4 +11,4 @@ void __attribute__ ((aligned(512))) hp1(void) } /* Check number of occurences of certain instructions. */ -/* { dg-final { scan-assembler-times "\.align\t512" 2 } } */ +/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-22.c b/gcc/testsuite/gcc.target/s390/hotpatch-22.c index 65074661023..d89d7790426 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-22.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-22.c @@ -11,4 +11,4 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ -/* { dg-final { scan-assembler-times "\.align\t1024" 2 } } */ +/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-23.c b/gcc/testsuite/gcc.target/s390/hotpatch-23.c index 7dce5b8b0fa..1e05d123c22 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-23.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-23.c @@ -11,4 +11,4 @@ void __attribute__ ((aligned(2048))) hp1(void) } /* Check number of occurences of certain instructions. */ -/* { dg-final { scan-assembler-times "\.align\t2048" 2 } } */ +/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-24.c b/gcc/testsuite/gcc.target/s390/hotpatch-24.c index 4d6815cb516..fc6427479d8 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-24.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-24.c @@ -11,4 +11,4 @@ void __attribute__ ((aligned(4096))) hp1(void) } /* Check number of occurences of certain instructions. */ -/* { dg-final { scan-assembler-times "\.align\t4096" 2 } } */ +/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-25.c b/gcc/testsuite/gcc.target/s390/hotpatch-25.c new file mode 100644 index 00000000000..e9257e3744e --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/hotpatch-25.c @@ -0,0 +1,33 @@ +/* Functional tests for the function hotpatching feature. */ + +/* { dg-do compile } */ +/* { dg-options "-O3 -mzarch" } */ + +typedef long (*fn_t)(void); + +__attribute__ ((hotpatch(1,2))) +fn_t outer(void) +{ + __attribute__ ((hotpatch(4,8))) + long nested1(void) + { + __attribute__ ((hotpatch(16,32))) + long nested2(void) + { + return 2; + } + return (long)(void *)nested2; + } + + return nested1; +} + +/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */ +/* { dg-final { scan-assembler "pre-label.*(4 halfwords)" } } */ +/* { dg-final { scan-assembler "pre-label.*(16 halfwords)" } } */ +/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */ +/* { dg-final { scan-assembler "post-label.*(8 halfwords)" } } */ +/* { dg-final { scan-assembler "post-label.*(32 halfwords)" } } */ +/* { dg-final { scan-assembler-times "alignment for hotpatch" 3 } } */ +/* { dg-final { scan-assembler-times "\.align\t8" 6 } } */ +/* { dg-final { scan-assembler "nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-3.c b/gcc/testsuite/gcc.target/s390/hotpatch-3.c index 8a2ab538e8d..ec4a978f72e 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-3.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-3.c @@ -11,6 +11,8 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */ /* { dg-final { scan-assembler-not "nopr\t%r7" } } */ /* { dg-final { scan-assembler-times "nop\t0" 1 } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-4.c b/gcc/testsuite/gcc.target/s390/hotpatch-4.c index 9a69459797e..d55e71d3d69 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-4.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-4.c @@ -11,6 +11,8 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler "post-label.*(3 halfwords)" } } */ /* { dg-final { scan-assembler-not "nopr\t%r7" } } */ /* { dg-final { scan-assembler-not "nop\t0" } } */ /* { dg-final { scan-assembler-times "brcl\t0, 0" 1 } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-5.c b/gcc/testsuite/gcc.target/s390/hotpatch-5.c index b3d990f499a..f77d83aea07 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-5.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-5.c @@ -11,6 +11,8 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler "post-label.*(4 halfwords)" } } */ /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */ /* { dg-final { scan-assembler-not "nop\t0" } } */ /* { dg-final { scan-assembler-times "brcl\t0, 0" 1 } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-6.c b/gcc/testsuite/gcc.target/s390/hotpatch-6.c index 10ba5580b0d..330cf5d011f 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-6.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-6.c @@ -11,6 +11,8 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler "post-label.*(5 halfwords)" } } */ /* { dg-final { scan-assembler-not "nopr\t%r7" } } */ /* { dg-final { scan-assembler-times "nop\t0" 1 } } */ /* { dg-final { scan-assembler-times "brcl\t0, 0" 1 } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-7.c b/gcc/testsuite/gcc.target/s390/hotpatch-7.c index edf67d3e22e..2f24e3cc152 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-7.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-7.c @@ -11,6 +11,8 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler "post-label.*(6 halfwords)" } } */ /* { dg-final { scan-assembler-not "nopr\t%r7" } } */ /* { dg-final { scan-assembler-not "nop\t0" } } */ /* { dg-final { scan-assembler-times "brcl\t0, 0" 2 } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-8.c b/gcc/testsuite/gcc.target/s390/hotpatch-8.c index a179c4a633c..7b266bd463e 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-8.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-8.c @@ -11,6 +11,9 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler "post-label.*(3 halfwords)" } } */ /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */ /* { dg-final { scan-assembler-times "nop\t0" 1 } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ +/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-9.c b/gcc/testsuite/gcc.target/s390/hotpatch-9.c index c4e21f2d3de..c0ad319c0bb 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-9.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-9.c @@ -11,6 +11,8 @@ void hp1(void) } /* Check number of occurences of certain instructions. */ +/* { dg-final { scan-assembler-not "pre-label NOPs" } } */ +/* { dg-final { scan-assembler "post-label.*(4 halfwords)" } } */ /* { dg-final { scan-assembler-not "nopr\t%r7" } } */ /* { dg-final { scan-assembler-times "nop\t0" 2 } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c index 3c5c7827206..2e8291ede34 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c @@ -1,4 +1,4 @@ -/* A warning will be issued when requesting hotpatching on a nested function. */ +/* Functional tests for the function hotpatching feature. */ /* { dg-do compile } */ /* { dg-options "-O3 -mzarch" } */ @@ -17,7 +17,7 @@ fn_t hp1(void) fn_t hp2(void) { __attribute__ ((hotpatch(1,2))) - int nested2(void) /* { dg-warning "hotpatching is not compatible with nested functions" } */ + int nested2(void) { return 2; } return nested2; |