[cfe-commits] r102357 - /cfe/trunk/test/CodeGenObjC/ns-constant-strings.m
Fariborz Jahanian
fjahanian at apple.com
Mon Apr 26 10:59:24 PDT 2010
Author: fjahanian
Date: Mon Apr 26 12:59:24 2010
New Revision: 102357
URL: http://llvm.org/viewvc/llvm-project?rev=102357&view=rev
Log:
Test case for NeXt's -fno-constant-cfstrings option.
Added:
cfe/trunk/test/CodeGenObjC/ns-constant-strings.m
Added: cfe/trunk/test/CodeGenObjC/ns-constant-strings.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/ns-constant-strings.m?rev=102357&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/ns-constant-strings.m (added)
+++ cfe/trunk/test/CodeGenObjC/ns-constant-strings.m Mon Apr 26 12:59:24 2010
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -fno-constant-cfstrings -emit-llvm -o %t %s
+// RUN: FileCheck --check-prefix CHECK-FRAGILE < %t %s
+
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fno-constant-cfstrings -emit-llvm -o %t %s
+// RUN: FileCheck --check-prefix CHECK-NONFRAGILE < %t %s
+
+ at interface NSString @end
+
+ at interface NSSimpleCString : NSString {
+ at protected
+ char *bytes;
+ unsigned int numBytes;
+}
+ at end
+
+ at interface NSConstantString : NSSimpleCString
+ at end
+
+#if OBJC_API_VERSION >= 2
+extern Class _NSConstantStringClassReference;
+#else
+extern struct objc_class _NSConstantStringClassReference;
+#endif
+
+const NSConstantString *appKey = @"MyApp";
+
+int main() {
+ const NSConstantString *appKey = @"MyApp";
+ const NSConstantString *appKey1 = @"MyApp1";
+}
+
+// CHECK-FRAGILE: @_NSConstantStringClassReference = external global
+// CHECK-NONFRAGILE: @"OBJC_CLASS_$_NSConstantString" = external global
More information about the cfe-commits
mailing list