summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-07-10 03:47:27 +0000
committerChris Lattner <sabre@nondot.org>2011-07-10 03:47:27 +0000
commitd1f1158203fb5f715c9e51c9adaca0f3838345cb (patch)
treef5e659ad8400a40219814501d224f829ffdb2cdb /clang/test
parent1a5f8978e98759d47a69d03de67d9c516ce11f82 (diff)
downloadbcm5719-llvm-d1f1158203fb5f715c9e51c9adaca0f3838345cb.tar.gz
bcm5719-llvm-d1f1158203fb5f715c9e51c9adaca0f3838345cb.zip
Fix the clang bootstrap and Jay's testcase from llvm-dev by being completely
conservative when converting a functiontype to IR when in a "pointer within a struct" context. This has the unfortunate sideeffect of compiling all function pointers inside of structs into "{}*" which, though correct, is ugly. This has the positive side effect of being correct, and it is pretty straight-forward to improve on this. llvm-svn: 134861
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGen/struct.c13
-rw-r--r--clang/test/CodeGenCXX/anonymous-union-member-initializer.cpp2
-rw-r--r--clang/test/CodeGenObjC/arc-foreach.m8
-rw-r--r--clang/test/CodeGenObjC/arc.m6
-rw-r--r--clang/test/CodeGenObjCXX/arc-special-member-functions.mm8
5 files changed, 25 insertions, 12 deletions
diff --git a/clang/test/CodeGen/struct.c b/clang/test/CodeGen/struct.c
index 25477a052e8..e1739314d7f 100644
--- a/clang/test/CodeGen/struct.c
+++ b/clang/test/CodeGen/struct.c
@@ -181,3 +181,16 @@ range f18() {
rangepair rp;
return (rp = f18_ext()).range1;
}
+
+
+
+// Complex forward reference of struct.
+struct f19S;
+extern struct f19T {
+ struct f19S (*p)(void);
+} t;
+struct f19S { int i; };
+void f19(void) {
+ t.p();
+}
+
diff --git a/clang/test/CodeGenCXX/anonymous-union-member-initializer.cpp b/clang/test/CodeGenCXX/anonymous-union-member-initializer.cpp
index 2ddafecf665..1d514fb09e5 100644
--- a/clang/test/CodeGenCXX/anonymous-union-member-initializer.cpp
+++ b/clang/test/CodeGenCXX/anonymous-union-member-initializer.cpp
@@ -86,7 +86,7 @@ namespace test3 {
// CHECK-NEXT: [[UNION:%.*]] = getelementptr inbounds {{.*}} [[THIS]], i32 0, i32 0
// CHECK-NEXT: [[STRUCT:%.*]] = bitcast {{.*}}* [[UNION]] to
// CHECK-NEXT: [[CALLBACK:%.*]] = getelementptr inbounds {{.*}} [[STRUCT]], i32 0, i32 0
- // CHECK-NEXT: store void (i8*)* null, void (i8*)** [[CALLBACK]]
+ // CHECK-NEXT: store {{.*}}* null, {{.*}}** [[CALLBACK]]
// CHECK-NEXT: [[UNION:%.*]] = getelementptr inbounds {{.*}} [[THIS]], i32 0, i32 0
// CHECK-NEXT: [[STRUCT:%.*]] = bitcast {{.*}}* [[UNION]] to
// CHECK-NEXT: [[CVALUE:%.*]] = getelementptr inbounds {{.*}} [[STRUCT]], i32 0, i32 1
diff --git a/clang/test/CodeGenObjC/arc-foreach.m b/clang/test/CodeGenObjC/arc-foreach.m
index 89e05d59e9c..ccf655b1377 100644
--- a/clang/test/CodeGenObjC/arc-foreach.m
+++ b/clang/test/CodeGenObjC/arc-foreach.m
@@ -33,8 +33,8 @@ void test0(NSArray *array) {
// CHECK-LP64-NEXT: [[T1:%.*]] = load i8** [[X]]
// CHECK-LP64-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]])
// CHECK-LP64-NEXT: store i8* [[T2]], i8** [[T0]]
-// CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to void ()*
-// CHECK-LP64-NEXT: call void @use_block(void ()* [[T1]])
+// CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]]
+// CHECK-LP64-NEXT: call void @use_block({{.*}}* [[T1]])
// CHECK-LP64-NEXT: [[T1:%.*]] = load i8** [[T0]]
// CHECK-LP64-NEXT: call void @objc_release(i8* [[T1]])
@@ -66,7 +66,7 @@ void test1(NSArray *array) {
// CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5
// CHECK-LP64-NEXT: [[T1:%.*]] = call i8* @objc_loadWeak(i8** [[X]])
// CHECK-LP64-NEXT: call i8* @objc_initWeak(i8** [[T0]], i8* [[T1]])
-// CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to void ()*
-// CHECK-LP64-NEXT: call void @use_block(void ()* [[T1]])
+// CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to
+// CHECK-LP64-NEXT: call void @use_block({{.*}} [[T1]])
// CHECK-LP64-NEXT: call void @objc_destroyWeak(i8** [[T0]])
// CHECK-LP64-NEXT: call void @objc_destroyWeak(i8** [[X]])
diff --git a/clang/test/CodeGenObjC/arc.m b/clang/test/CodeGenObjC/arc.m
index ac7dad31d08..dbfd9d335cf 100644
--- a/clang/test/CodeGenObjC/arc.m
+++ b/clang/test/CodeGenObjC/arc.m
@@ -1225,8 +1225,8 @@ void test39(void) {
// CHECK: [[CAPTURE:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5
// CHECK-NEXT: [[T0:%.*]] = load i8** [[VAR]]
// CHECK-NEXT: store i8* [[T0]], i8** [[CAPTURE]]
- // CHECK-NEXT: [[T0:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to void ()*
- // CHECK-NEXT: call void @test39_helper(void ()* [[T0]])
+ // CHECK-NEXT: [[T0:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to
+ // CHECK-NEXT: call void @test39_helper({{.*}} [[T0]])
// CHECK-NEXT: ret void
}
@@ -1338,7 +1338,7 @@ void test41(void) {
// CHECK-NEXT: [[T3:%.*]] = call i8* @objc_retain(i8* [[T2]])
// CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to [[TEST42]]*
// CHECK-NEXT: store [[TEST42]]* [[T4]], [[TEST42]]** [[T0]]
-// CHECK-NEXT: bitcast [[BLOCK_T]]* [[BLOCK]] to void ()*
+// CHECK-NEXT: bitcast [[BLOCK_T]]* [[BLOCK]] to
// CHECK-NEXT: call void @test42_helper(
// CHECK-NEXT: [[T1:%.*]] = load [[TEST42]]** [[T0]]
// CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST42]]* [[T1]] to i8*
diff --git a/clang/test/CodeGenObjCXX/arc-special-member-functions.mm b/clang/test/CodeGenObjCXX/arc-special-member-functions.mm
index 598dd406107..14e0899cd49 100644
--- a/clang/test/CodeGenObjCXX/arc-special-member-functions.mm
+++ b/clang/test/CodeGenObjCXX/arc-special-member-functions.mm
@@ -94,9 +94,9 @@ void test_ObjCBlockMember_copy_assign(ObjCBlockMember m1, ObjCBlockMember m2) {
// CHECK: define linkonce_odr {{%.*}}* @_ZN15ObjCBlockMemberaSERKS_(
// CHECK: [[T0:%.*]] = call i8* @objc_retainBlock(
// CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to i32 (i32)*
-// CHECK-NEXT: [[T2:%.*]] = load i32 (i32)** [[SLOT:%.*]],
-// CHECK-NEXT: store i32 (i32)* [[T1]], i32 (i32)** [[SLOT]]
-// CHECK-NEXT: [[T3:%.*]] = bitcast i32 (i32)* [[T2]] to i8*
+// CHECK-NEXT: [[T2:%.*]] = load {{.*}} [[SLOT:%.*]],
+// CHECK: store
+// CHECK-NEXT: [[T3:%.*]] = bitcast
// CHECK-NEXT: call void @objc_release(i8* [[T3]])
// CHECK-NEXT: ret
@@ -112,7 +112,7 @@ void test_ObjCBlockMember_copy_assign(ObjCBlockMember m1, ObjCBlockMember m2) {
// Implicitly-generated default constructor for ObjCBlockMember
// CHECK: define linkonce_odr void @_ZN15ObjCBlockMemberC2Ev
-// CHECK: store i32 (i32)* null,
+// CHECK: store {{.*}} null,
// CHECK-NEXT: ret void
// Implicitly-generated copy constructor for ObjCArrayMember
OpenPOWER on IntegriCloud