diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2012-01-25 22:46:34 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2012-01-25 22:46:34 +0000 |
| commit | a98d1f8ca63bbe8770dacec5e4ebee5070c0766d (patch) | |
| tree | f476ce56b9facbc6f4115054d6c32ace96e38c36 /clang/test/CodeGen | |
| parent | 04342eee52a865aaee6e8a2fcf21dbedf98b0443 (diff) | |
| download | bcm5719-llvm-a98d1f8ca63bbe8770dacec5e4ebee5070c0766d.tar.gz bcm5719-llvm-a98d1f8ca63bbe8770dacec5e4ebee5070c0766d.zip | |
Add some ABI tweaks for i386-pc-win32 triple so that we return structs in an MSVC-compatible way. Patch by Joe Groff.
llvm-svn: 148992
Diffstat (limited to 'clang/test/CodeGen')
| -rw-r--r-- | clang/test/CodeGen/x86_32-arguments-win32.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/clang/test/CodeGen/x86_32-arguments-win32.c b/clang/test/CodeGen/x86_32-arguments-win32.c new file mode 100644 index 00000000000..f18bb30fa47 --- /dev/null +++ b/clang/test/CodeGen/x86_32-arguments-win32.c @@ -0,0 +1,48 @@ +// RUN: %clang_cc1 -w -triple i386-pc-win32 -emit-llvm -o - %s | FileCheck %s + +// CHECK: define i64 @f1_1() +// CHECK: define void @f1_2(i32 %a0.0, i32 %a0.1) +struct s1 { + int a; + int b; +}; +struct s1 f1_1(void) { while (1) {} } +void f1_2(struct s1 a0) {} + +// CHECK: define i32 @f2_1() +struct s2 { + short a; + short b; +}; +struct s2 f2_1(void) { while (1) {} } + +// CHECK: define i16 @f3_1() +struct s3 { + char a; + char b; +}; +struct s3 f3_1(void) { while (1) {} } + +// CHECK: define i8 @f4_1() +struct s4 { + char a:4; + char b:4; +}; +struct s4 f4_1(void) { while (1) {} } + +// CHECK: define i64 @f5_1() +// CHECK: define void @f5_2(double %a0.0) +struct s5 { + double a; +}; +struct s5 f5_1(void) { while (1) {} } +void f5_2(struct s5 a0) {} + +// CHECK: define i32 @f6_1() +// CHECK: define void @f6_2(float %a0.0) +struct s6 { + float a; +}; +struct s6 f6_1(void) { while (1) {} } +void f6_2(struct s6 a0) {} + |

