gcc/testsuite/gcc.target/arc/mno-lock.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-mno-lock" } */ |
| 3 | /* Would also like to assemble and check that we get the expected |
| 4 | "Error: bad instruction" assembler messages, but at the moment our |
| 5 | testharness can't do that. */ |
| 6 | |
| 7 | int f (void *p) |
| 8 | { |
| 9 | int i; |
| 10 | |
| 11 | __asm__("llock %0, [%1]\n\t" |
| 12 | "scond %0, [%1]" : "=&r"(i) : "r"(p)); |
| 13 | return i; |
| 14 | } |