1// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 -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 20extern Class _NSConstantStringClassReference; 21#else 22extern struct objc_class _NSConstantStringClassReference; 23#endif 24 25const NSConstantString *appKey = @"MyApp"; 26 27int 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: @.str.1 = 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: @.str.1 = private unnamed_addr constant [7 x i8] c"MyApp1\00" 40