blob: f76fe6252fef5151da472b64fa04ac9f27210f58 [file] [log] [blame]
Alexander Musman70e9f5f2015-06-10 11:20:26 +00001// RUN: %clang_cc1 -triple=i386-pc-solaris2.11 -w -emit-llvm %s -o - | FileCheck %s
2
3extern "C" {
4 struct statvfs64 {
5 int f;
6 };
7#pragma redefine_extname statvfs64 statvfs
8 int statvfs64(struct statvfs64 *);
9}
10
Aaron Ballman9ec96a22015-06-25 15:37:16 +000011void some_func() {
Alexander Musman70e9f5f2015-06-10 11:20:26 +000012 struct statvfs64 st;
13 statvfs64(&st);
14// Check that even if there is a structure with redefined name before the
15// pragma, subsequent function name redefined properly. PR5172, Comment 11.
16// CHECK: call i32 @statvfs(%struct.statvfs64* %st)
17}
18
Aaron Ballman9ec96a22015-06-25 15:37:16 +000019// This is a case when redefenition is deferred *and* we have a local of the
20// same name. PR23923.
21#pragma redefine_extname foo bar
22int f() {
23 int foo = 0;
24 return foo;
25}
26extern "C" {
27 int foo() { return 1; }
28// CHECK: define i32 @bar()
29}
30