summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2019-05-29 21:23:30 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2019-05-29 21:23:30 +0000
commitf3c89b1a6be08ad90b30306554e6724467debf16 (patch)
tree89528345c0bfc6a91ba77cfb3c975d39cbda5cad /clang/test
parent46631dffc4b665bc2b8f473ab54c1b40cf87df76 (diff)
downloadbcm5719-llvm-f3c89b1a6be08ad90b30306554e6724467debf16.tar.gz
bcm5719-llvm-f3c89b1a6be08ad90b30306554e6724467debf16.zip
[ObjC] Fix encoding of ObjC pointer types that are pointers to typedefs
clang was encoding pointers to typedefs as if they were pointers to structs because that is apparently what gcc is doing. For example: ``` @class Class1; typedef NSArray<Class1 *> MyArray; void foo1(void) { const char *s0 = @encode(MyArray *); // "^{NSArray=#}" const char *s1 = @encode(NSArray<Class1 *> *); // "@" } ``` This commit removes the code that was there to make clang compatible with gcc and make clang emit the correct encoding for ObjC pointers, which is "@". rdar://problem/50563529 Differential Revision: https://reviews.llvm.org/D61974 llvm-svn: 362034
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenObjC/encode-test-6.m4
-rw-r--r--clang/test/CodeGenObjC/encode-test.m2
-rw-r--r--clang/test/CodeGenObjCXX/encode.mm2
3 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/CodeGenObjC/encode-test-6.m b/clang/test/CodeGenObjC/encode-test-6.m
index 583ba5ab4de..99f53a5059e 100644
--- a/clang/test/CodeGenObjC/encode-test-6.m
+++ b/clang/test/CodeGenObjC/encode-test-6.m
@@ -34,7 +34,7 @@ typedef BABugExample BABugExampleRedefinition;
@synthesize property = _property;
@end
-// CHECK: private unnamed_addr constant [24 x i8] c"^{BABugExample=@}16
+// CHECK: private unnamed_addr constant [8 x i8] c"@16
// rdar://14408244
@class SCNCamera;
@@ -52,7 +52,7 @@ typedef struct
C3DCameraStorage _storage;
}
@end
-// CHECK: private unnamed_addr constant [39 x i8] c"{?=\22presentationInstance\22^{SCNCamera}}\00"
+// CHECK: private unnamed_addr constant [39 x i8] c"{?=\22presentationInstance\22@\22SCNCamera\22}\00"
// rdar://16655340
int i;
diff --git a/clang/test/CodeGenObjC/encode-test.m b/clang/test/CodeGenObjC/encode-test.m
index 113dbef95f3..bf5340c5c52 100644
--- a/clang/test/CodeGenObjC/encode-test.m
+++ b/clang/test/CodeGenObjC/encode-test.m
@@ -107,7 +107,7 @@ const char g3[] = @encode(const struct S *);
// CHECK: @g4 = constant [6 x i8] c"{S=i}\00"
const char g4[] = @encode(const struct S);
-// CHECK: @g5 = constant [12 x i8] c"^{Object=#}\00"
+// CHECK: @g5 = constant [2 x i8] c"@\00"
const char g5[] = @encode(MyObj * const);
////
diff --git a/clang/test/CodeGenObjCXX/encode.mm b/clang/test/CodeGenObjCXX/encode.mm
index e4c7618f50c..7bc64dafb47 100644
--- a/clang/test/CodeGenObjCXX/encode.mm
+++ b/clang/test/CodeGenObjCXX/encode.mm
@@ -242,6 +242,6 @@ struct S {
@end
const char *expand_struct() {
- // CHECK: @{{.*}} = private unnamed_addr constant [16 x i8] c"{N={S<N>=^{N}}}\00"
+ // CHECK: @{{.*}} = private unnamed_addr constant [13 x i8] c"{N={S<N>=@}}\00"
return @encode(N);
}
OpenPOWER on IntegriCloud