| 1 |
/* Verify we don't ICE generating out-of-bounds diagram. */ |
| 2 |
|
| 3 |
/* { dg-additional-options "-O0 -fdiagnostics-text-art-charset=unicode" } */ |
| 4 |
|
| 5 |
#include <stdio.h> |
| 6 |
#include <stdint.h> |
| 7 |
|
| 8 |
struct a { |
| 9 |
uint32_t b; |
| 10 |
}; |
| 11 |
union c { |
| 12 |
int8_t b; |
| 13 |
}; |
| 14 |
|
| 15 |
int32_t *d( int32_t *j, int32_t k, struct a l) { |
| 16 |
int64_t m[1]= {0}; |
| 17 |
for (l.b = 0; l.b <= 0; l.b++) { |
| 18 |
printf("FLAG\n"); |
| 19 |
l.b == 12 && m[l.b]; /* { dg-bogus "stack-based buffer over-read" } */ |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
/* We don't care about the exact diagram, just that we don't ICE. */ |
| 24 |
|
| 25 |
/* { dg-allow-blank-lines-in-output 1 } */ |
| 26 |
/* { dg-prune-output ".*" } */ |