Debian Codegraph @

gcc/testsuite/gcc.target/riscv/fold-mem-offsets-3.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ffold-mem-offsets" } */
3
4 void load(int arr[2]);
5
6 int
7 foo(long unsigned int i)
8 {
9 int arr[2];
10 load(arr);
11
12 return arr[3 * i + 77];
13 }
14
15 /* The should be no negative memory offsets when using -ffold-mem-offsets. */
16 /* { dg-final { scan-assembler-not "lw\t.*,-.*\\(.*\\)" } } */
17 /* { dg-final { scan-assembler-not "addi\t.*,.*,77" } } */