1 /* Functional tests for the function hotpatching feature. */
3 /* { dg-do compile } */
4 /* { dg-options "-mzarch" } */
6 typedef long (*fn_t
)(void);
8 __attribute__ ((hotpatch(1,2)))
11 __attribute__ ((hotpatch(4,8)))
14 __attribute__ ((hotpatch(16,32)))
19 return (long)(void *)nested2
;
25 /* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
26 /* { dg-final { scan-assembler "pre-label.*(4 halfwords)" } } */
27 /* { dg-final { scan-assembler "pre-label.*(16 halfwords)" } } */
28 /* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(2 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nopr\t" } } */
29 /* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(8 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*brcl\t0, 0" } } */
30 /* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(32 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*brcl\t0, 0" } } */
31 /* { dg-final { scan-assembler-times "alignment for hotpatch" 3 } } */
32 /* { 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" } } */