1 // RUN: %clang_cc1 -triple i386-apple-darwin9 -fno-constant-cfstrings -emit-llvm -o %t %s 2 // RUN: FileCheck --check-prefix CHECK-FRAGILE < %t %s 3 4 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fno-constant-cfstrings -emit-llvm -o %t %s 5 // RUN: FileCheck --check-prefix CHECK-NONFRAGILE < %t %s 6 7 @interface NSString @end 8 9 @interface NSSimpleCString : NSString { 10 @protected 11 char *bytes; 12 unsigned int numBytes; 13 } 14 @end 15 16 @interface NSConstantString : NSSimpleCString 17 @end 18 19 #if OBJC_API_VERSION >= 2 20 extern Class _NSConstantStringClassReference; 21 #else 22 extern struct objc_class _NSConstantStringClassReference; 23 #endif 24 25 const NSConstantString *appKey = @"MyApp"; 26 27 int main() { 28 const NSConstantString *appKey = @"MyApp"; 29 const NSConstantString *appKey1 = @"MyApp1"; 30 } 31 32 // CHECK-FRAGILE: @_NSConstantStringClassReference = external global 33 // CHECK-NONFRAGILE: @"OBJC_CLASS_$_NSConstantString" = external global 34 35 // CHECK-FRAGILE: @.str = private unnamed_addr constant [6 x i8] c"MyApp\00" 36 // CHECK-FRAGILE: @.str1 = private unnamed_addr constant [7 x i8] c"MyApp1\00" 37 38 // CHECK-NONFRAGILE: @.str = private unnamed_addr constant [6 x i8] c"MyApp\00" 39 // CHECK-NONFRAGILE: @.str1 = private unnamed_addr constant [7 x i8] c"MyApp1\00" 40