diff options
| author | George Burgess IV <george.burgess.iv@gmail.com> | 2020-04-16 10:56:19 -0700 |
|---|---|---|
| committer | Tom Stellard <tstellar@redhat.com> | 2020-05-07 13:47:01 -0700 |
| commit | eaae6dfc545000e335e6f89abb9c78818383d7ad (patch) | |
| tree | 93528939f1ecbfc8d2cce5410f2db128e73e4082 /clang/test/CodeGen | |
| parent | 3ab301b4d9700d7ce3ebc22750166c49b45e3e98 (diff) | |
| download | bcm5719-llvm-eaae6dfc545000e335e6f89abb9c78818383d7ad.tar.gz bcm5719-llvm-eaae6dfc545000e335e6f89abb9c78818383d7ad.zip | |
[CodeGen] fix inline builtin-related breakage from D78162
In cases where we have multiple decls of an inline builtin, we may need
to go hunting for the one with a definition when setting function
attributes.
An additional test-case was provided on
https://github.com/ClangBuiltLinux/linux/issues/979
(cherry picked from commit 94908088a831141cfbdd15fc5837dccf30cfeeb6)
Diffstat (limited to 'clang/test/CodeGen')
| -rw-r--r-- | clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.cpp b/clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.cpp new file mode 100644 index 00000000000..d27aa9c5341 --- /dev/null +++ b/clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -triple i686-linux-gnu -std=c++11 -S -emit-llvm -o - %s | FileCheck %s +// +// Regression test for the issue reported at +// https://reviews.llvm.org/D78162#1986104 + +typedef unsigned long size_t; + +extern "C" __inline__ __attribute__((__gnu_inline__)) void *memcpy(void *a, const void *b, unsigned c) { + return __builtin_memcpy(a, b, c); +} +void *memcpy(void *, const void *, unsigned); + +// CHECK-LABEL: define void @_Z1av +void a() { (void)memcpy; } + +// CHECK-NOT: nobuiltin |

