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