mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-02 05:46:09 +00:00

Basically, inline builtin definition are shadowed by externally visible redefinition. This matches GCC behavior. The implementation has to workaround the fact that: 1. inline builtin are renamed at callsite during codegen, but 2. they may be shadowed by a later external definition As a consequence, during codegen, we need to walk redecls and eventually rewrite some call sites, which is totally inelegant. Differential Revision: https://reviews.llvm.org/D112059
21 lines
507 B
C
21 lines
507 B
C
// RUN: %clang_cc1 -triple x86_64 -S -emit-llvm -O1 -o - %s | FileCheck %s
|
|
//
|
|
// Verifies that the gnu_inline version is ignored in favor of the redecl
|
|
|
|
extern inline __attribute__((gnu_inline)) unsigned long some_size(int c) {
|
|
return 1;
|
|
}
|
|
unsigned long mycall(int s) {
|
|
// CHECK-LABEL: i64 @mycall
|
|
// CHECK: ret i64 2
|
|
return some_size(s);
|
|
}
|
|
unsigned long some_size(int c) {
|
|
return 2;
|
|
}
|
|
unsigned long yourcall(int s) {
|
|
// CHECK-LABEL: i64 @yourcall
|
|
// CHECK: ret i64 2
|
|
return some_size(s);
|
|
}
|