Home | History | Annotate | Download | only in CodeGenObjC
      1 // RUNX: llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o %t %s &&
      2 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-gc -emit-llvm -o %t %s
      3 // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"A\\00"' %t
      4 // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\11q\\10\\00"' %t
      5 // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"!q\\00"' %t
      6 // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\01\\14\\00"' %t
      7 // RUNX: llvm-gcc -ObjC++ -m64 -fobjc-gc -emit-llvm -S -o %t %s &&
      8 // RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-gc -emit-llvm -o %t %s
      9 // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"A\\00"' %t
     10 // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\11q\\10\\00"' %t
     11 // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"!q\\00"' %t
     12 // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\01\\14\\00"' %t
     13 
     14 /*
     15 
     16 Here is a handy command for looking at llvm-gcc's output:
     17 llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o - ivar-layout-64.m | \
     18   grep 'OBJC_CLASS_NAME.* =.*global' | \
     19   sed -e 's#, section.*# ...#' | \
     20   sed -e 's#_[0-9]*"#_NNN#' | \
     21   sort
     22 
     23 */
     24 
     25 @interface B @end
     26 
     27 @interface A {
     28   struct s0 {
     29     int f0;
     30     int f1;
     31   } f0;
     32   id f1;
     33 __weak B *f2;
     34   int f3 : 5;
     35   struct s1 {
     36     int *f0;
     37     int *f1;
     38   } f4[2][1];
     39 }
     40 @end
     41 
     42 @interface C : A
     43 @property int p3;
     44 @end
     45 
     46 @implementation C
     47 @synthesize p3 = _p3;
     48 @end
     49 
     50 @interface A()
     51 @property int p0;
     52 @property (assign) __strong id p1;
     53 @property (assign) __weak id p2;
     54 @end
     55 
     56 // FIXME: Check layout for this class, once it is clear what the right
     57 // answer is.
     58 @implementation A
     59 @synthesize p0 = _p0;
     60 @synthesize p1 = _p1;
     61 @synthesize p2 = _p2;
     62 @end
     63 
     64 @interface D : A
     65 @property int p3;
     66 @end
     67 
     68 // FIXME: Check layout for this class, once it is clear what the right
     69 // answer is.
     70 @implementation D
     71 @synthesize p3 = _p3;
     72 @end
     73 
     74 typedef unsigned short UInt16;
     75 
     76 
     77 typedef signed char BOOL;
     78 typedef unsigned int FSCatalogInfoBitmap;
     79 
     80 @interface NSFileLocationComponent {
     81     @private
     82 
     83     id _specifierOrStandardizedPath;
     84     BOOL _carbonCatalogInfoAndNameAreValid;
     85     FSCatalogInfoBitmap _carbonCatalogInfoMask;
     86     id _name;
     87     id _containerComponent;
     88     id _presentableName;
     89     id _iconAsAttributedString;
     90 }
     91 @end
     92 
     93 @implementation NSFileLocationComponent @end
     94 
     95