Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/pr50527.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-do run } */ | |
2 /* { dg-options "-Os --param large-stack-frame=30 -Wno-pointer-to-int-cast" } */ | |
3 | |
4 extern void abort (void); | |
5 | |
6 void __attribute__((noinline)) | |
7 bar (char *a) | |
8 { | |
9 } | |
10 | |
11 void __attribute__((noinline)) | |
12 foo (char *a, int b) | |
13 { | |
14 } | |
15 | |
16 void __attribute__((noinline)) | |
17 test_align (char *p, int aligned, unsigned int mask) | |
18 { | |
19 int p_aligned = ((unsigned long int)p & mask) == 0; | |
20 if (aligned != p_aligned) | |
21 abort (); | |
22 } | |
23 | |
24 int | |
25 main () | |
26 { | |
27 const int kIterations = 4; | |
28 char results[kIterations]; | |
29 int i; | |
30 unsigned int mask; | |
31 | |
32 mask = 0xf; | |
33 test_align (results, ((unsigned long int)results & mask) == 0, mask); | |
34 mask = 0x7; | |
35 test_align (results, ((unsigned long int)results & mask) == 0, mask); | |
36 mask = 0x3; | |
37 test_align (results, ((unsigned long int)results & mask) == 0, mask); | |
38 mask = 0x1; | |
39 test_align (results, ((unsigned long int)results & mask) == 0, mask); | |
40 | |
41 bar (results); | |
42 for (i = 0; i < kIterations; i++) | |
43 foo ("%d ", results[i]); | |
44 | |
45 return 0; | |
46 } |