diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/mips/r10k-cache-barrier-13.c')
-rw-r--r-- | gcc/testsuite/gcc.target/mips/r10k-cache-barrier-13.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-13.c b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-13.c new file mode 100644 index 00000000000..fa5a416ce20 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-13.c @@ -0,0 +1,14 @@ +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store" } */ + +/* Test that indirect calls are protected. */ + +int bar (int); + +NOMIPS16 void +foo (void (*fn) (void), int x) +{ + if (x) + (*fn) (); +} + +/* { dg-final { scan-assembler-times "\tcache\t" 1 } } */ |