summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/builtin-expect.c
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-09-21 08:08:30 +0000
committerJohn McCall <rjmccall@apple.com>2011-09-21 08:08:30 +0000
commitcbc038a6c3fcb45439473a70d0284916d47d900e (patch)
tree068e2cd6328fb13ba95832e950d6bc6a8e0e2c7e /clang/test/CodeGen/builtin-expect.c
parent3b4de99158766ca7f41d7f6baafbd9b94a81e0a5 (diff)
downloadbcm5719-llvm-cbc038a6c3fcb45439473a70d0284916d47d900e.tar.gz
bcm5719-llvm-cbc038a6c3fcb45439473a70d0284916d47d900e.zip
ANSI C requires that a call to an unprototyped function type succeed
if the definition has a non-variadic prototype with compatible parameters. Therefore, the default rule for such calls must be to use a non-variadic convention. Achieve this by casting the callee to the function type with which it is required to be compatible, unless the target specifically opts out and insists that unprototyped calls should use the variadic rules. The only case of that I'm aware of is the x86-64 convention, which passes arguments the same way in both cases but also sets a small amount of extra information; here we seek to maintain compatibility with GCC, which does set this when calling an unprototyped function. Addresses PR10810 and PR10713. llvm-svn: 140241
Diffstat (limited to 'clang/test/CodeGen/builtin-expect.c')
-rw-r--r--clang/test/CodeGen/builtin-expect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/CodeGen/builtin-expect.c b/clang/test/CodeGen/builtin-expect.c
index 664c6b6a470..73b3b24be8f 100644
--- a/clang/test/CodeGen/builtin-expect.c
+++ b/clang/test/CodeGen/builtin-expect.c
@@ -18,7 +18,7 @@ int main() {
}
// CHECK: call void @isigprocmask()
-// CHECK: [[C:%.*]] = call i64 (...)* @bar()
+// CHECK: [[C:%.*]] = call i64 bitcast (i64 (...)* @bar to i64 ()*)()
// CHECK: @test1
OpenPOWER on IntegriCloud