Rafael Espindola | f5fe292 | 2010-12-07 15:23:23 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s |
Daniel Dunbar | 3c827a7 | 2008-08-05 23:31:02 +0000 | [diff] [blame] | 2 | |
Mike Stump | c36541e | 2009-07-21 20:52:43 +0000 | [diff] [blame] | 3 | int x() { return 1; } |
Daniel Dunbar | 3c827a7 | 2008-08-05 23:31:02 +0000 | [diff] [blame] | 4 | |
Chris Lattner | 35b21b8 | 2010-06-27 01:06:27 +0000 | [diff] [blame] | 5 | // CHECK: ret i32 1 |
Edward O'Callaghan | 07e72fd | 2009-10-26 20:49:20 +0000 | [diff] [blame] | 6 | |
| 7 | |
Daniel Dunbar | 3c827a7 | 2008-08-05 23:31:02 +0000 | [diff] [blame] | 8 | int f() __attribute__((weak, alias("x"))); |
| 9 | |
| 10 | /* Test that we link to the alias correctly instead of making a new |
| 11 | forward definition. */ |
| 12 | int f(); |
| 13 | int h() { |
| 14 | return f(); |
| 15 | } |
Edward O'Callaghan | 07e72fd | 2009-10-26 20:49:20 +0000 | [diff] [blame] | 16 | |
Daniel Dunbar | 47d1e82 | 2009-11-11 03:48:26 +0000 | [diff] [blame] | 17 | // CHECK: [[call:%.*]] = call i32 (...)* @f() |
Chris Lattner | 35b21b8 | 2010-06-27 01:06:27 +0000 | [diff] [blame] | 18 | // CHECK: ret i32 [[call]] |
Edward O'Callaghan | 07e72fd | 2009-10-26 20:49:20 +0000 | [diff] [blame] | 19 | |