1 // RUN: %clang_cc1 -triple x86_64 -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
3 // Verifies that clang-generated *.inline are flagged as internal.
5 typedef unsigned long size_t;
7 #define AVAILABLE_EXTERNALLY extern inline __attribute__((always_inline)) __attribute__((gnu_inline))
8 // Clang recognizes an inline builtin and renames it to memcmp.inline to prevent conflict with builtins.
9 AVAILABLE_EXTERNALLY
int memcmp(const void *a
, const void *b
, size_t c
) {
10 return __builtin_memcmp(a
, b
, c
);
13 // CHECK: internal{{.*}}memcmp.inline
14 int bar(const void *a
, const void *b
, size_t c
) {
15 return memcmp(a
, b
, c
);
18 // Note that extern has been omitted here.
19 #define TRIPLE_INLINE inline __attribute__((always_inline)) __attribute__((gnu_inline))
21 // Clang recognizes an inline builtin and renames it to memcpy.inline to prevent conflict with builtins.
22 TRIPLE_INLINE
void *memcpy(void *a
, const void *b
, size_t c
) {
23 return __builtin_memcpy(a
, b
, c
);
26 // CHECK: internal{{.*}}memcpy.inline
27 void *foo(void *a
, const void *b
, size_t c
) {
28 return memcpy(a
, b
, c
);