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 |
Mike Stump | 4c83f7c | 2009-10-05 22:24:47 +0000 | [diff] [blame] | 2 | |
John McCall | f746aa6 | 2010-03-19 23:29:14 +0000 | [diff] [blame] | 3 | // CHECK: @test2 = alias i32 ()* @_Z5test1v |
| 4 | |
Bill Wendling | 8992457 | 2013-02-27 00:06:04 +0000 | [diff] [blame] | 5 | // CHECK: define i32 @_Z3foov() [[NUW:#[0-9]+]] align 1024 |
Mike Stump | 4c83f7c | 2009-10-05 22:24:47 +0000 | [diff] [blame] | 6 | int foo() __attribute__((aligned(1024))); |
| 7 | int foo() { } |
| 8 | |
Mike Stump | 4c83f7c | 2009-10-05 22:24:47 +0000 | [diff] [blame] | 9 | class C { |
Mike Stump | fb51ddf | 2009-10-05 22:49:20 +0000 | [diff] [blame] | 10 | virtual void bar1() __attribute__((aligned(1))); |
| 11 | virtual void bar2() __attribute__((aligned(2))); |
| 12 | virtual void bar3() __attribute__((aligned(1024))); |
Richard Smith | ef4d5ce | 2012-09-28 22:46:07 +0000 | [diff] [blame] | 13 | void bar4() __attribute__((aligned(1024))); |
Mike Stump | 4c83f7c | 2009-10-05 22:24:47 +0000 | [diff] [blame] | 14 | } c; |
| 15 | |
Bill Wendling | 8992457 | 2013-02-27 00:06:04 +0000 | [diff] [blame] | 16 | // CHECK: define void @_ZN1C4bar1Ev(%class.C* %this) unnamed_addr [[NUW]] align 2 |
Mike Stump | 4c83f7c | 2009-10-05 22:24:47 +0000 | [diff] [blame] | 17 | void C::bar1() { } |
| 18 | |
Bill Wendling | 8992457 | 2013-02-27 00:06:04 +0000 | [diff] [blame] | 19 | // CHECK: define void @_ZN1C4bar2Ev(%class.C* %this) unnamed_addr [[NUW]] align 2 |
Mike Stump | 4c83f7c | 2009-10-05 22:24:47 +0000 | [diff] [blame] | 20 | void C::bar2() { } |
| 21 | |
Bill Wendling | 8992457 | 2013-02-27 00:06:04 +0000 | [diff] [blame] | 22 | // CHECK: define void @_ZN1C4bar3Ev(%class.C* %this) unnamed_addr [[NUW]] align 1024 |
Mike Stump | fb51ddf | 2009-10-05 22:49:20 +0000 | [diff] [blame] | 23 | void C::bar3() { } |
John McCall | f746aa6 | 2010-03-19 23:29:14 +0000 | [diff] [blame] | 24 | |
Bill Wendling | 8992457 | 2013-02-27 00:06:04 +0000 | [diff] [blame] | 25 | // CHECK: define void @_ZN1C4bar4Ev(%class.C* %this) [[NUW]] align 1024 |
Richard Smith | ef4d5ce | 2012-09-28 22:46:07 +0000 | [diff] [blame] | 26 | void C::bar4() { } |
| 27 | |
John McCall | f746aa6 | 2010-03-19 23:29:14 +0000 | [diff] [blame] | 28 | // PR6635 |
Stephen Lin | 93ab6bf | 2013-08-15 06:47:53 +0000 | [diff] [blame^] | 29 | // CHECK-LABEL: define i32 @_Z5test1v() |
John McCall | f746aa6 | 2010-03-19 23:29:14 +0000 | [diff] [blame] | 30 | int test1() { return 10; } |
| 31 | // CHECK at top of file |
| 32 | extern "C" int test2() __attribute__((alias("_Z5test1v"))); |
Bill Wendling | f7a9da0 | 2013-02-20 07:22:19 +0000 | [diff] [blame] | 33 | |
Bill Wendling | be9e8bf | 2013-02-28 22:49:57 +0000 | [diff] [blame] | 34 | // CHECK: attributes [[NUW]] = { nounwind{{.*}} } |