diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-21 19:47:46 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-21 19:47:46 +0000 |
commit | 9246b6830a468d9d0a0925eae168543b8d603e29 (patch) | |
tree | 3e36c7cd14cc4b3d92eab92de9f75fbaa22a4b3c /clang/test/CodeGenCXX/builtins.cpp | |
parent | fd4da713435a470be221ae1b823b3cb8ef518a60 (diff) | |
download | bcm5719-llvm-9246b6830a468d9d0a0925eae168543b8d603e29.tar.gz bcm5719-llvm-9246b6830a468d9d0a0925eae168543b8d603e29.zip |
In C++, if the user redeclares a builtin function with a type that is
inconsistent with the type that the builtin *should* have, forget
about the builtin altogether: we don't want subsequence analyses,
CodeGen, etc., to think that we have a proper builtin function.
C is protected from errors here because it allows one to use a
library builtin without having a declaration, and detects inconsistent
(re-)declarations of builtins during declaration merging. C++ was
unprotected, and therefore would crash.
Fixes PR8839.
llvm-svn: 122351
Diffstat (limited to 'clang/test/CodeGenCXX/builtins.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/builtins.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/builtins.cpp b/clang/test/CodeGenCXX/builtins.cpp new file mode 100644 index 00000000000..0629c31015c --- /dev/null +++ b/clang/test/CodeGenCXX/builtins.cpp @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s + +// PR8839 +extern "C" char memmove(); + +int main() { + // CHECK: call signext i8 @memmove() + return memmove(); +} |