llvm-project/clang/test/CodeGen/fread-inline-builtin-late-redecl.c
Fangrui Song c5de4dd1ea [test] %clang_cc1 -emit-llvm: remove redundant -S
And replace -emit-llvm -o - with -emit-llvm-only
2024-05-04 17:00:29 -07:00

27 lines
714 B
C

// RUN: %clang_cc1 -triple x86_64 -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
//
// Verifies that clang-generated *.inline are removed when shadowed by an
// external definition, even when that definition appears at the end of the
// file.
// CHECK-NOT: strlen.inline
extern unsigned long strlen(char const *s);
extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__)) unsigned long strlen(char const *s) {
return 1;
}
static unsigned long chesterfield(char const *s) {
return strlen(s);
}
static unsigned long (*_strlen)(char const *ptr);
unsigned long blutch(char const *s) {
return chesterfield(s);
}
unsigned long strlen(char const *s) {
return _strlen(s);
}