[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / memcpy-inline-builtin-no-extern.c
blobf6edbbf6aeb44f51091d40ef09dba1849084c567
1 // RUN: %clang_cc1 -triple x86_64 -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
2 //
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);