forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 ClangBuiltLinux/linux#979 (cherry picked from commit 9490808)
- Loading branch information
1 parent
0c067d1
commit a3255f8
Showing
2 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |