diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/mallign.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/mallign.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/mallign.c b/gcc/testsuite/gcc.dg/mallign.c new file mode 100644 index 000000000..6a0041e64 --- /dev/null +++ b/gcc/testsuite/gcc.dg/mallign.c @@ -0,0 +1,15 @@ +/* Check that malloc's alignment honors what we trust it + minimally should. */ + +/* { dg-do run } */ +/* { dg-options "-fno-builtin-malloc" } */ + +#include <stdlib.h> +typedef int word __attribute__((mode(word))); + +int main() +{ + if ((size_t)malloc (1) & (sizeof(word)-1)) + abort (); + return 0; +} |