aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/expr/align68k-2.C
diff options
context:
space:
mode:
author(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-13 00:26:22 +0000
committer(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-13 00:26:22 +0000
commit642b971b14d7107cfe01bf72648ae3b510a2d33c (patch)
treebaf23254fca2fd8d16741acf27572f3219d56c89 /gcc/testsuite/g++.dg/expr/align68k-2.C
parent59bc598e01e292d67c32b6ae240b4544d4c234ab (diff)
This commit was manufactured by cvs2svn to create tagapple/gcc-1751
'apple-gcc-1751'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/apple-gcc-1751@81762 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/expr/align68k-2.C')
-rw-r--r--gcc/testsuite/g++.dg/expr/align68k-2.C38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/expr/align68k-2.C b/gcc/testsuite/g++.dg/expr/align68k-2.C
new file mode 100644
index 00000000000..4070bcdc0ff
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/align68k-2.C
@@ -0,0 +1,38 @@
+// APPLE LOCAL file test 68k alignment
+// Radar 3313261: Positive C++ test case
+// Origin: Matt Austern <austern@apple.com>
+// { dg-do run }
+
+#pragma options align=mac68k
+
+typedef struct PMR {
+ double x;
+ double y;
+}PMR;
+
+#pragma options align=reset
+
+static void GetDouble(double *doubleP)
+{
+ *doubleP = 1.;
+}
+
+static void GetPMR(PMR *p)
+{
+ GetDouble(&p->x);
+ GetDouble(&p->y);
+}
+
+int main(void)
+{
+ PMR tmp;
+ bool ok = true;
+
+ tmp.x = tmp.y = 0;
+ ok = ok && tmp.x == 0.0 && tmp.y == 0.0;
+
+ GetPMR(&tmp);
+ ok = ok && tmp.x == 1.0 && tmp.y == 1.0;
+
+ return !ok;
+}