gcc/testsuite/gcc.target/i386/cold-attribute-1.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -mno-avx" } */ |
| 3 | #include <string.h> |
| 4 | static inline |
| 5 | __attribute__ ((cold)) void |
| 6 | my_cold_memset (void *a, int b,int c) |
| 7 | { |
| 8 | memset (a,b,c); |
| 9 | } |
| 10 | void |
| 11 | t(void *a,int b,int c) |
| 12 | { |
| 13 | if (a) |
| 14 | my_cold_memset (a,b,40); |
| 15 | } |
| 16 | |
| 17 | /* The IF conditional should be predicted as cold and my_cold_memset inlined |
| 18 | for size expanding memset as rep; stosb. */ |
| 19 | /* { dg-final { scan-assembler "stosb" } } */ |