Debian Codegraph @

gcc/testsuite/gcc.target/pru/pragma-ctable_entry.c

raw
1 /* Test specification of custom instructions via command-line options. */
2
3 /* { dg-do compile } */
4 /* { dg-options "-O1" } */
5
6 /* -O1 in the options is significant. Without it LBCO/SBCO operations may
7 not be optimized to the respective instructions. */
8
9
10 #pragma ctable_entry 12 0x48040000
11
12 unsigned int
13 test_ctable (unsigned int val1, unsigned int val2)
14 {
15 ((volatile unsigned short int *)0x48040000)[0] = val2;
16 ((volatile unsigned int *)0x48040000)[val1] = val2;
17 return ((volatile unsigned int *)0x48040000)[4];
18 }
19
20 /* { dg-final { scan-assembler "sbco\\tr15.b\[012\]?, 12, 0, 2" } } */
21 /* { dg-final { scan-assembler "sbco\\tr15.b0, 12, r14, 4" } } */
22 /* { dg-final { scan-assembler "lbco\\tr14.b0, 12, 16, 4" } } */