gcc/testsuite/gcc.target/ia64/asm-1.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options } */ |
| 3 | |
| 4 | extern void abort (void); |
| 5 | |
| 6 | /* Test that "=S" properly avoids the post-increment on the memory address. */ |
| 7 | |
| 8 | static void foo(int *x) |
| 9 | { |
| 10 | long i; |
| 11 | for (i = 0; i < 100; ++i) |
| 12 | __asm__("st4 %0 = r0" : "=S"(x[i])); |
| 13 | } |
| 14 | |
| 15 | int main() |
| 16 | { |
| 17 | int array[100]; |
| 18 | long i; |
| 19 | |
| 20 | for (i = 0; i < 100; ++i) |
| 21 | array[i] = -1; |
| 22 | |
| 23 | foo(array); |
| 24 | |
| 25 | for (i = 0; i < 100; ++i) |
| 26 | if (array[i]) |
| 27 | abort (); |
| 28 | return 0; |
| 29 | } |