Use gather loads for strided accesses
[official-gcc.git] / gcc / testsuite / gcc.target / nvptx / softstack.c
blob73e60f282a744ff146c6bc008897648bc4c3cb29
1 /* { dg-options "-O2 -msoft-stack" } */
2 /* { dg-do run } */
4 static __attribute__((noinline,noclone)) int f(int *p)
6 return __sync_lock_test_and_set(p, 1);
9 static __attribute__((noinline,noclone)) int g(int n)
11 /* Check that variable-length stack allocation works. */
12 int v[n];
13 v[0] = 0;
14 /* Check that atomic operations can be applied to auto data. */
15 return f(v) == 0 && v[0] == 1;
18 int main()
20 if (!g(1))
21 __builtin_abort();
22 return 0;