llvm-project/clang/test/CodeGenCXX/redefine_extname.cpp
Alexander Musman 70e9f5fcb3 PR5172: Fix for a bug in pragma redefine_extname implementation:
it doesn't work correctly when a structure is declared before pragma
and then a function with the same name declared after pragma.

Patch by Andrey Bokhanko

Differential Revision: http://reviews.llvm.org/D10187

llvm-svn: 239466
2015-06-10 11:20:26 +00:00

19 lines
478 B
C++

// RUN: %clang_cc1 -triple=i386-pc-solaris2.11 -w -emit-llvm %s -o - | FileCheck %s
extern "C" {
struct statvfs64 {
int f;
};
#pragma redefine_extname statvfs64 statvfs
int statvfs64(struct statvfs64 *);
}
void foo() {
struct statvfs64 st;
statvfs64(&st);
// Check that even if there is a structure with redefined name before the
// pragma, subsequent function name redefined properly. PR5172, Comment 11.
// CHECK: call i32 @statvfs(%struct.statvfs64* %st)
}