diff options
author | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
commit | 056abd2059c65a3e908193aeae16fad98017437c (patch) | |
tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/CodeGenCXX/regparm.cpp | |
parent | cc73504950eb7b5dff2dded9bedd67bc36d64641 (diff) | |
download | FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.zip FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.tar.gz |
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974
Diffstat (limited to 'test/CodeGenCXX/regparm.cpp')
-rw-r--r-- | test/CodeGenCXX/regparm.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGenCXX/regparm.cpp b/test/CodeGenCXX/regparm.cpp index f0ebd2b..2196c79 100644 --- a/test/CodeGenCXX/regparm.cpp +++ b/test/CodeGenCXX/regparm.cpp @@ -4,3 +4,35 @@ // CHECK: _Z3fooRi(i32* inreg void __attribute__ ((regparm (1))) foo(int &a) { } + +struct S1 { + int x; + S1(const S1 &y); +}; + +void __attribute__((regparm(3))) foo2(S1 a, int b); +// CHECK: declare void @_Z4foo22S1i(%struct.S1* inreg, i32 inreg) +void bar2(S1 a, int b) { + foo2(a, b); +} + +struct S2 { + int x; +}; + +void __attribute__((regparm(3))) foo3(struct S2 a, int b); +// CHECK: declare void @_Z4foo32S2i(i32 inreg, i32 inreg) +void bar3(struct S2 a, int b) { + foo3(a, b); +} + +struct S3 { + struct { + struct {} b[0]; + } a; +}; +__attribute((regparm(2))) void foo4(S3 a, int b); +// CHECK: declare void @_Z4foo42S3i(%struct.S3* byval align 4, i32 inreg) +void bar3(S3 a, int b) { + foo4(a, b); +} |