summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/struct-ret-3.c
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-04 17:51:05 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-04 17:51:05 +0000
commit7bcd0dfd339d5eda6db1ae52f12c348f1fb13ea6 (patch)
tree01d3b8da516b028a7d9a846954e671bcf811056e /gcc/testsuite/gcc.dg/struct-ret-3.c
parente48f3020ea46b73a92024377faa96a622d4cc894 (diff)
downloadgcc-7bcd0dfd339d5eda6db1ae52f12c348f1fb13ea6.tar.gz
* gcc.dg/struct-ret-3.c: Include unistd.h.
(main): Exit early if system memory page size is larger than 4096 bytes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143056 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/struct-ret-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/struct-ret-3.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/struct-ret-3.c b/gcc/testsuite/gcc.dg/struct-ret-3.c
index 4a603cbe681..c384d49c590 100644
--- a/gcc/testsuite/gcc.dg/struct-ret-3.c
+++ b/gcc/testsuite/gcc.dg/struct-ret-3.c
@@ -7,6 +7,7 @@
#include <string.h>
#include <stdio.h>
#include <errno.h>
+#include <unistd.h>
unsigned long ossAlignX(unsigned long i, unsigned long X)
{
@@ -69,6 +70,11 @@ int main(void)
char buf[sizeof(struct stuff)+4096];
struct stuff *u = (struct stuff *)ossAlignX((unsigned long)&buf[0], 4096);
+
+ /* This test assumes system memory page size of 4096 bytes or less. */
+ if (sysconf(_SC_PAGESIZE) > 4096)
+ return 0;
+
memset(u, 1, sizeof(struct stuff));
u->c1[0] = '\xAA';
u->c2[0] = '\xBB';