diff options
author | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-04 19:12:25 +0000 |
---|---|---|
committer | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-04 19:12:25 +0000 |
commit | e55ce3b0df957db9f95b9cd9a93ac83b709a8b58 (patch) | |
tree | de6daa0b96a7574f7f9963c80422550019a59b9c /gcc/testsuite/g++.dg/expr/align68k-2.C | |
parent | 59bc598e01e292d67c32b6ae240b4544d4c234ab (diff) |
This commit was manufactured by cvs2svn to create tagapple/gcc-1747
'apple-gcc-1747'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/apple-gcc-1747@81485 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.C | 38 |
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; +} |