From cdc6e2c50f96119bdc4c1205ff5901ca82ec8357 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 29 Jan 2020 18:17:43 -0600 Subject: add old compiler with ARM support --- gcc_arm/testsuite/gcc.wendy/gnu29.c | 80 +++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100755 gcc_arm/testsuite/gcc.wendy/gnu29.c (limited to 'gcc_arm/testsuite/gcc.wendy/gnu29.c') diff --git a/gcc_arm/testsuite/gcc.wendy/gnu29.c b/gcc_arm/testsuite/gcc.wendy/gnu29.c new file mode 100755 index 0000000..98f0164 --- /dev/null +++ b/gcc_arm/testsuite/gcc.wendy/gnu29.c @@ -0,0 +1,80 @@ +/* +Date: 25 Jan 89 14:43:05 GMT +From: meyering@cs.utexas.edu (Jim Meyering) +Subject: 1.32 sun4os4 bug-- passing structures +Message-Id: <150@ai.cs.utexas.edu> +To: bug-gcc@prep.ai.mit.edu + */ + +/* + * gcc-1.32 (sun4-os4) has a problem passing structure arguments. + * + * If the type FLT is changed to float, all problems disappear. + * + * If PRINTF is defined and -O is *not* used, the program terminates + * with a segmentation fault. In all other cases I've tried, the + * program runs, but the arguments to foo are not properly copied. + * To be precise, in foo, the value that one would normally expect + * to find in b.y is overwritten with that of b.x. (see output in + * comments below) + */ + +typedef double FLT; +typedef struct point { FLT x, y; } PT; + +#define N 4 +FLT x[N]; + +#if defined(PRINTF) +#define PRINT(a) for (i=0;i +#define PRINT(a) for (i=0;i= 0) { + PRINT(w); + PRINT(x); + } else { + printf("Test passed.\n"); + } + exit(0); +} + + void +foo(PT a,PT b) +{ + extern FLT x[N]; + x[0] = a.x; + x[1] = a.y; + x[2] = b.x; + x[3] = b.y; +} -- cgit v1.2.3