| 1 |
// RUN: %clang_cc1 -triple x86_64 -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s |
| 2 |
// |
| 3 |
// Verifies that clang-generated *.inline are removed when shadowed by an |
| 4 |
// external definition, even when that definition appears at the end of the |
| 5 |
// file. |
| 6 |
|
| 7 |
// CHECK-NOT: strlen.inline |
| 8 |
|
| 9 |
extern unsigned long strlen(char const *s); |
| 10 |
|
| 11 |
extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__)) unsigned long strlen(char const *s) { |
| 12 |
return 1; |
| 13 |
} |
| 14 |
|
| 15 |
static unsigned long chesterfield(char const *s) { |
| 16 |
return strlen(s); |
| 17 |
} |
| 18 |
static unsigned long (*_strlen)(char const *ptr); |
| 19 |
|
| 20 |
unsigned long blutch(char const *s) { |
| 21 |
return chesterfield(s); |
| 22 |
} |
| 23 |
|
| 24 |
unsigned long strlen(char const *s) { |
| 25 |
return _strlen(s); |
| 26 |
} |