blob: 4748cda8cc47a660c23729de64a46d96350f0b35 [file] [log] [blame]
Rafael Espindolaf5fe2922010-12-07 15:23:23 +00001// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s
Mike Stump4c83f7c2009-10-05 22:24:47 +00002
John McCallf746aa62010-03-19 23:29:14 +00003// CHECK: @test2 = alias i32 ()* @_Z5test1v
4
Bill Wendling89924572013-02-27 00:06:04 +00005// CHECK: define i32 @_Z3foov() [[NUW:#[0-9]+]] align 1024
Mike Stump4c83f7c2009-10-05 22:24:47 +00006int foo() __attribute__((aligned(1024)));
7int foo() { }
8
Mike Stump4c83f7c2009-10-05 22:24:47 +00009class C {
Mike Stumpfb51ddf2009-10-05 22:49:20 +000010 virtual void bar1() __attribute__((aligned(1)));
11 virtual void bar2() __attribute__((aligned(2)));
12 virtual void bar3() __attribute__((aligned(1024)));
Richard Smithef4d5ce2012-09-28 22:46:07 +000013 void bar4() __attribute__((aligned(1024)));
Mike Stump4c83f7c2009-10-05 22:24:47 +000014} c;
15
Bill Wendling89924572013-02-27 00:06:04 +000016// CHECK: define void @_ZN1C4bar1Ev(%class.C* %this) unnamed_addr [[NUW]] align 2
Mike Stump4c83f7c2009-10-05 22:24:47 +000017void C::bar1() { }
18
Bill Wendling89924572013-02-27 00:06:04 +000019// CHECK: define void @_ZN1C4bar2Ev(%class.C* %this) unnamed_addr [[NUW]] align 2
Mike Stump4c83f7c2009-10-05 22:24:47 +000020void C::bar2() { }
21
Bill Wendling89924572013-02-27 00:06:04 +000022// CHECK: define void @_ZN1C4bar3Ev(%class.C* %this) unnamed_addr [[NUW]] align 1024
Mike Stumpfb51ddf2009-10-05 22:49:20 +000023void C::bar3() { }
John McCallf746aa62010-03-19 23:29:14 +000024
Bill Wendling89924572013-02-27 00:06:04 +000025// CHECK: define void @_ZN1C4bar4Ev(%class.C* %this) [[NUW]] align 1024
Richard Smithef4d5ce2012-09-28 22:46:07 +000026void C::bar4() { }
27
John McCallf746aa62010-03-19 23:29:14 +000028// PR6635
29// CHECK: define i32 @_Z5test1v()
30int test1() { return 10; }
31// CHECK at top of file
32extern "C" int test2() __attribute__((alias("_Z5test1v")));
Bill Wendlingf7a9da02013-02-20 07:22:19 +000033
Bill Wendlingbe9e8bf2013-02-28 22:49:57 +000034// CHECK: attributes [[NUW]] = { nounwind{{.*}} }