Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / scev-cast.c
blobfe6dde4bb1982b7cba62242d5cd1a29f8e603772
1 /* A test for various conversions of chrecs. */
3 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
4 /* { dg-options "-O2 -fdump-tree-optimized" } */
6 void blas (char xxx);
7 void blau (unsigned char xxx);
9 void tst(void)
11 unsigned i;
13 for (i = 0; i < 128; i++) /* This cast to char has to be preserved. */
14 blas ((char) i);
15 for (i = 0; i < 127; i++) /* And this one does not. */
16 blas ((char) i);
17 for (i = 0; i < 255; i++) /* This cast is not necessary. */
18 blau ((unsigned char) i);
19 for (i = 0; i < 256; i++)
20 blau ((unsigned char) i); /* This one is necessary. */
23 /* { dg-final { scan-tree-dump-times "\\(int\\) \\(unsigned char\\)" 1 "optimized" } } */
24 /* { dg-final { scan-tree-dump-times "\\(int\\) \\(char\\)" 1 "optimized" } } */
26 /* { dg-final { cleanup-tree-dump "optimized" } } */