From d06fb865eba3f85d80c38172b00c6895c89c9b3f Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 28 Apr 2010 00:00:30 +0000 Subject: Properly pass the address of a lazily-generated function declaration with incomplete type. Fixes PR6911. llvm-svn: 102473 --- clang/test/CodeGen/functions.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'clang/test/CodeGen/functions.c') diff --git a/clang/test/CodeGen/functions.c b/clang/test/CodeGen/functions.c index 5629ef582a6..a2c692d0ce3 100644 --- a/clang/test/CodeGen/functions.c +++ b/clang/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() +} -- cgit v1.2.3