atomic-requires-library-error.c 768 B

12345678910111213141516171819202122232425262728293031
  1. // RUN: %clang_cc1 %s -triple=i686-apple-darwin9 -verify
  2. // rdar://13973577
  3. struct foo {
  4. int big[128];
  5. };
  6. struct bar {
  7. char c[3];
  8. };
  9. struct bar smallThing;
  10. struct foo bigThing;
  11. _Atomic(struct foo) bigAtomic;
  12. void structAtomicStore() {
  13. struct foo f = {0};
  14. __c11_atomic_store(&bigAtomic, f, 5); // expected-error {{atomic store requires runtime support that is not available for this target}}
  15. struct bar b = {0};
  16. __atomic_store(&smallThing, &b, 5);
  17. __atomic_store(&bigThing, &f, 5);
  18. }
  19. void structAtomicLoad() {
  20. struct foo f = __c11_atomic_load(&bigAtomic, 5); // expected-error {{atomic load requires runtime support that is not available for this target}}
  21. struct bar b;
  22. __atomic_load(&smallThing, &b, 5);
  23. __atomic_load(&bigThing, &f, 5);
  24. }