summaryrefslogtreecommitdiff
path: root/test/CodeGen/functions.c
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-04-28 00:00:30 +0000
committerJohn McCall <rjmccall@apple.com>2010-04-28 00:00:30 +0000
commit784f21121a6c9418ebd86baa6814e36e1176c410 (patch)
treea0813612cd1da2dbe9de63d71cc6bec5913908de /test/CodeGen/functions.c
parent15dedf067b65151f0fd89dd9f80cea96a0528db1 (diff)
downloadclang-784f21121a6c9418ebd86baa6814e36e1176c410.tar.gz
Properly pass the address of a lazily-generated function declaration with
incomplete type. Fixes PR6911. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102473 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/functions.c')
-rw-r--r--test/CodeGen/functions.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/functions.c b/test/CodeGen/functions.c
index 5629ef582a..a2c692d0ce 100644
--- a/test/CodeGen/functions.c
+++ b/test/CodeGen/functions.c
@@ -47,3 +47,15 @@ void f7(float f, float g) {
// CHECK: define void @f7(float{{.*}}, float{{.*}})
// CHECK: call void @f6(float{{.*}}, float{{.*}})
}
+
+// PR6911 - incomplete function types
+struct Incomplete;
+void f8_callback(struct Incomplete);
+void f8_user(void (*callback)(struct Incomplete));
+void f8_test() {
+ f8_user(&f8_callback);
+// CHECK: define void @f8_test()
+// CHECK: call void @f8_user({{.*}}* bitcast (void ()* @f8_callback to {{.*}}*))
+// CHECK: declare void @f8_user({{.*}}*)
+// CHECK: declare void @f8_callback()
+}