summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/mips64-padding-arg.c
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-01-07 00:25:33 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-01-07 00:25:33 +0000
commitf64e1adcbb897446fc7a94a0d286c7bad4011704 (patch)
treee8c2a10e5b8487000c57acd8059a8f06791820db /clang/test/CodeGen/mips64-padding-arg.c
parent6cb36f7a302af387c1e338705569dc9373fc74dd (diff)
downloadbcm5719-llvm-f64e1adcbb897446fc7a94a0d286c7bad4011704.tar.gz
bcm5719-llvm-f64e1adcbb897446fc7a94a0d286c7bad4011704.zip
Add field PaddingType to ABIArgInfo which specifies the type of padding that
is inserted before the real argument. Padding is needed to ensure the backend reads from or writes to the correct argument slots when the original alignment of a byval structure is unavailable due to flattening. llvm-svn: 147699
Diffstat (limited to 'clang/test/CodeGen/mips64-padding-arg.c')
-rw-r--r--clang/test/CodeGen/mips64-padding-arg.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeGen/mips64-padding-arg.c b/clang/test/CodeGen/mips64-padding-arg.c
new file mode 100644
index 00000000000..658e6ebea08
--- /dev/null
+++ b/clang/test/CodeGen/mips64-padding-arg.c
@@ -0,0 +1,19 @@
+// RUN: %clang -ccc-host-triple mips64el-unknown-linux -ccc-clang-archs mips64el -O3 -S -mabi=n64 -o - -emit-llvm %s | FileCheck %s
+
+typedef struct {
+ double d;
+ long double ld;
+} S0;
+
+// Insert padding to ensure arugments of type S0 are aligned to 16-byte boundaries.
+
+// CHECK: define void @foo1(i32 %a0, i64, double %a1.coerce0, i64 %a1.coerce1, i64 %a1.coerce2, i64 %a1.coerce3, double %a2.coerce0, i64 %a2.coerce1, i64 %a2.coerce2, i64 %a2.coerce3, i32 %b, i64, double %a3.coerce0, i64 %a3.coerce1, i64 %a3.coerce2, i64 %a3.coerce3)
+// CHECK: tail call void @foo2(i32 1, i32 2, i32 %a0, i64 undef, double %a1.coerce0, i64 %a1.coerce1, i64 %a1.coerce2, i64 %a1.coerce3, double %a2.coerce0, i64 %a2.coerce1, i64 %a2.coerce2, i64 %a2.coerce3, i32 3, i64 undef, double %a3.coerce0, i64 %a3.coerce1, i64 %a3.coerce2, i64 %a3.coerce3)
+// CHECK: declare void @foo2(i32, i32, i32, i64, double, i64, i64, i64, double, i64, i64, i64, i32, i64, double, i64, i64, i64)
+
+extern void foo2(int, int, int, S0, S0, int, S0);
+
+void foo1(int a0, S0 a1, S0 a2, int b, S0 a3) {
+ foo2(1, 2, a0, a1, a2, 3, a3);
+}
+
OpenPOWER on IntegriCloud