gcc/testsuite/gcc.dg/torture/restrict-4.c
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | extern void abort (void); |
| 4 | |
| 5 | static inline void |
| 6 | foo (int * p) |
| 7 | { |
| 8 | int * __restrict pr = p; |
| 9 | *pr = 1; |
| 10 | } |
| 11 | |
| 12 | int __attribute__((noinline,noclone)) |
| 13 | bar (int * __restrict qr) |
| 14 | { |
| 15 | *qr = 0; |
| 16 | foo (qr); |
| 17 | return *qr; |
| 18 | } |
| 19 | |
| 20 | int main() |
| 21 | { |
| 22 | int i; |
| 23 | if (bar (&i) != 1) |
| 24 | abort (); |
| 25 | return 0; |
| 26 | } |