gcc/testsuite/gcc.target/riscv/divmod-2.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* Skip this everywhere for now. Once we have a target with |
| 3 | divmod enabled, only skip for -O0, -O1, -Og, -Oz, -Os. */ |
| 4 | /* { dg-skip-if "" { *-*-* } { } } */ |
| 5 | |
| 6 | void |
| 7 | foo(int a, int b, int *c, int *d) |
| 8 | { |
| 9 | *c = a / b; |
| 10 | *d = a % b; |
| 11 | } |
| 12 | |
| 13 | /* { dg-final { scan-assembler-not "\trem" } } */ |
| 14 | /* { dg-final { scan-assembler-times "\tdiv" 1 } } */ |
| 15 | /* { dg-final { scan-assembler-times "\tmul" 1 } } */ |
| 16 | /* { dg-final { scan-assembler-times "\tsub" 1 } } */ |