blob: a0dd748601340aec8bc718c068ce11352ff90f12 [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
Anders Carlsson577cacc2010-01-27 02:49:52 +00005// CHECK: define i32 @_Z3foov() nounwind 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
Richard Smithef4d5ce2012-09-28 22:46:07 +000016// CHECK: define void @_ZN1C4bar1Ev(%class.C* %this) unnamed_addr nounwind align 2
Mike Stump4c83f7c2009-10-05 22:24:47 +000017void C::bar1() { }
18
Richard Smithef4d5ce2012-09-28 22:46:07 +000019// CHECK: define void @_ZN1C4bar2Ev(%class.C* %this) unnamed_addr nounwind align 2
Mike Stump4c83f7c2009-10-05 22:24:47 +000020void C::bar2() { }
21
Richard Smithef4d5ce2012-09-28 22:46:07 +000022// CHECK: define void @_ZN1C4bar3Ev(%class.C* %this) unnamed_addr nounwind align 1024
Mike Stumpfb51ddf2009-10-05 22:49:20 +000023void C::bar3() { }
John McCallf746aa62010-03-19 23:29:14 +000024
Richard Smithef4d5ce2012-09-28 22:46:07 +000025// CHECK: define void @_ZN1C4bar4Ev(%class.C* %this) nounwind align 1024
26void 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")));