| 1 |
/* { dg-do compile { target { ! riscv_abi_e } } } */ |
| 2 |
/* { dg-require-effective-target rv64 } */ |
| 3 |
/* We aggressively skip as we really just need to test the basic synthesis |
| 4 |
which shouldn't vary based on the optimization level. -O1 seems to work |
| 5 |
and eliminates the usual sources of extraneous dead code that would throw |
| 6 |
off the counts. */ |
| 7 |
/* { dg-skip-if "" { *-*-* } { "-O0" "-Og" "-O2" "-O3" "-Os" "-Oz" "-flto" } } */ |
| 8 |
/* { dg-options "-march=rv64gcb" } */ |
| 9 |
|
| 10 |
/* Rather than test for a specific synthesis of all these constants or |
| 11 |
having thousands of tests each testing one variant, we just test the |
| 12 |
total number of instructions. |
| 13 |
|
| 14 |
This isn't expected to change much and any change is worthy of a look. */ |
| 15 |
/* { dg-final { scan-assembler-times "\\t(add|addi|bseti|li|ret|sh1add|sh2add|sh3add|slli)" 45 } } */ |
| 16 |
|
| 17 |
|
| 18 |
unsigned long foo_0x60000400000800(void) { return 0x60000400000800UL; } |
| 19 |
|
| 20 |
unsigned long foo_0xc0000400000800(void) { return 0xc0000400000800UL; } |
| 21 |
|
| 22 |
unsigned long foo_0x180000400000800(void) { return 0x180000400000800UL; } |
| 23 |
|
| 24 |
unsigned long foo_0x300000400000800(void) { return 0x300000400000800UL; } |
| 25 |
|
| 26 |
unsigned long foo_0x600000400000800(void) { return 0x600000400000800UL; } |
| 27 |
|
| 28 |
unsigned long foo_0xc00000400000800(void) { return 0xc00000400000800UL; } |
| 29 |
|
| 30 |
unsigned long foo_0x1800000400000800(void) { return 0x1800000400000800UL; } |
| 31 |
|
| 32 |
unsigned long foo_0x3000000400000800(void) { return 0x3000000400000800UL; } |
| 33 |
|
| 34 |
unsigned long foo_0x6000000400000800(void) { return 0x6000000400000800UL; } |