2009-10-27 04:49:20 +08:00
|
|
|
// RUN: clang-cc -emit-llvm -o - %s | FileCheck %s
|
2008-08-06 07:31:02 +08:00
|
|
|
|
2009-07-22 04:52:43 +08:00
|
|
|
int x() { return 1; }
|
2008-08-06 07:31:02 +08:00
|
|
|
|
2009-10-27 04:49:20 +08:00
|
|
|
// CHECK: %retval = alloca i32
|
|
|
|
// CHECK: store i32 1, i32* %retval
|
|
|
|
// CHECK: %0 = load i32* %retval
|
|
|
|
// CHECK: ret i32 %0
|
|
|
|
|
|
|
|
|
2008-08-06 07:31:02 +08:00
|
|
|
int f() __attribute__((weak, alias("x")));
|
|
|
|
|
|
|
|
/* Test that we link to the alias correctly instead of making a new
|
|
|
|
forward definition. */
|
|
|
|
int f();
|
|
|
|
int h() {
|
|
|
|
return f();
|
|
|
|
}
|
2009-10-27 04:49:20 +08:00
|
|
|
|
|
|
|
// CHECK: %retval = alloca i32
|
|
|
|
// CHECK: %call = call i32 (...)* @f()
|
|
|
|
// CHECK: store i32 %call, i32* %retval
|
|
|
|
// CHECK: %0 = load i32* %retval
|
|
|
|
// CHECK: ret i32 %0
|
|
|
|
|