Home | History | Annotate | Download | only in CodeGenObjC
      1 // RUN: %clang_cc1 -triple x86_64-apple-macosx10 -emit-llvm -x objective-c %s -o - | FileCheck %s
      2 
      3 // CHECK: define internal zeroext i1 @"\01-[A0 p]"(
      4 // CHECK:   %[[ATOMIC_LOAD:.*]] = load atomic i8, i8* %{{.*}} seq_cst
      5 // CHECK:   %[[TOBOOL:.*]] = trunc i8 %[[ATOMIC_LOAD]] to i1
      6 // CHECK:   ret i1 %[[TOBOOL]]
      7 
      8 // CHECK: define internal void @"\01-[A0 setP:]"({{.*}} i1 zeroext {{.*}})
      9 // CHECK:   store atomic i8 %{{.*}}, i8* %{{.*}} seq_cst
     10 // CHECK:   ret void
     11 
     12 // CHECK: define internal zeroext i1 @"\01-[A1 p]"(
     13 // CHECK:   %[[ATOMIC_LOAD:.*]] = load atomic i8, i8* %{{.*}} unordered
     14 // CHECK:   %[[TOBOOL:.*]] = trunc i8 %load to i1
     15 // CHECK:   ret i1 %[[TOBOOL]]
     16 
     17 // CHECK: define internal void @"\01-[A1 setP:]"({{.*}} i1 zeroext %p)
     18 // CHECK:   store atomic i8 %{{.*}}, i8* %{{.*}} unordered
     19 // CHECK:   ret void
     20 
     21 @interface A0
     22 @property(nonatomic) _Atomic(_Bool) p;
     23 @end
     24 @implementation A0
     25 @end
     26 
     27 @interface A1 {
     28   _Atomic(_Bool) p;
     29 }
     30 @property _Atomic(_Bool) p;
     31 @end
     32 @implementation A1
     33 @synthesize p;
     34 @end
     35