| Alexander Musman | 70e9f5f | 2015-06-10 11:20:26 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple=i386-pc-solaris2.11 -w -emit-llvm %s -o - | FileCheck %s |
| 2 | |
| 3 | extern "C" { |
| 4 | struct statvfs64 { |
| 5 | int f; |
| 6 | }; |
| 7 | #pragma redefine_extname statvfs64 statvfs |
| 8 | int statvfs64(struct statvfs64 *); |
| 9 | } |
| 10 | |
| Aaron Ballman | 9ec96a2 | 2015-06-25 15:37:16 +0000 | [diff] [blame] | 11 | void some_func() { |
| Alexander Musman | 70e9f5f | 2015-06-10 11:20:26 +0000 | [diff] [blame] | 12 | 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 Ballman | 9ec96a2 | 2015-06-25 15:37:16 +0000 | [diff] [blame] | 19 | // 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 |
| 22 | int f() { |
| 23 | int foo = 0; |
| 24 | return foo; |
| 25 | } |
| 26 | extern "C" { |
| 27 | int foo() { return 1; } |
| 28 | // CHECK: define i32 @bar() |
| 29 | } |
| 30 | |