| /* Functional tests for the function hotpatching feature. */ |
| |
| /* { dg-do compile } */ |
| /* { dg-options "-mzarch -mhotpatch=1,2" } */ |
| /* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */ |
| |
| #include <stdio.h> |
| |
| __attribute__ ((always_inline)) |
| static inline void hp2(void) |
| { |
| printf("hello, world!\n"); |
| } |
| |
| void hp1(void) |
| { |
| hp2(); |
| } |
| |
| /* Check number of occurences of certain instructions. */ |
| /* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */ |
| /* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(2 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nop\t0" } } */ |
| /* { dg-final { scan-assembler-times "nopr\t%r0" 1 } } */ |
| /* { dg-final { scan-assembler-times "nop\t0" 1 } } */ |
| /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ |