[llvm-commits] [test-suite] r102023 - /test-suite/trunk/SingleSource/UnitTests/byval-alignment.c
Daniel Dunbar
daniel at zuster.org
Wed Apr 21 13:08:26 PDT 2010
Author: ddunbar
Date: Wed Apr 21 15:08:26 2010
New Revision: 102023
URL: http://llvm.org/viewvc/llvm-project?rev=102023&view=rev
Log:
Add a test where byval alignment matters.
Added:
test-suite/trunk/SingleSource/UnitTests/byval-alignment.c
Added: test-suite/trunk/SingleSource/UnitTests/byval-alignment.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/byval-alignment.c?rev=102023&view=auto
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/byval-alignment.c (added)
+++ test-suite/trunk/SingleSource/UnitTests/byval-alignment.c Wed Apr 21 15:08:26 2010
@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+struct s0 {
+ long double x, y;
+};
+
+struct s0 g0;
+
+void f0(int i, struct s0 y) __attribute__((noinline));
+void f0(int i, struct s0 y) {
+ g0 = y;
+ g0.x += i;
+ g0.y += i;
+}
+
+int main() {
+ struct s0 a = { 1., 2. };
+ f0(1, a);
+ printf("g0.x: %.4f, g0.y: %.4f\n", (double) g0.x, (double) g0.y);
+ return 0;
+}
More information about the llvm-commits
mailing list