Debian Codegraph @

gcc/testsuite/gcc.target/riscv/shift-add-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64gcb -mabi=lp64" } */
3 /* { dg-skip-if "" { *-*-* } { "-O0" "-Og" } } */
4
5 int composeFromSurrogate(const unsigned short high) {
6
7 return ((high - 0xD800) << 10) ;
8 }
9
10
11 long composeFromSurrogate_2(const unsigned long high) {
12
13 return ((high - 0xD800) << 10) ;
14 }
15
16
17 /* { dg-final { scan-assembler-times "\tli\t" 2 } } */
18 /* { dg-final { scan-assembler-times "\tslli\t" 2 } } */
19 /* { dg-final { scan-assembler-times "\taddw\t" 1 } } */
20 /* { dg-final { scan-assembler-times "\tadd\t" 1 } } */
21