| 1 |
/* C only: reuse of same array for int and label pointers. */ |
| 2 |
|
| 3 |
#include "../../gcc.dg/analyzer/analyzer-decls.h" |
| 4 |
|
| 5 |
void foo(int pc) { |
| 6 |
int *arr[2] = {&&x, &&y}; |
| 7 |
int var = 0; |
| 8 |
__analyzer_dump_path (); /* { dg-message "path" } */ |
| 9 |
|
| 10 |
goto *arr[pc]; |
| 11 |
|
| 12 |
x: |
| 13 |
__analyzer_dump_path (); /* { dg-message "path" } */ |
| 14 |
__analyzer_eval (pc == 0); /* { dg-warning "TRUE" } */ |
| 15 |
/* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */ |
| 16 |
arr[0] = (void *)0; |
| 17 |
*arr[0] = 10086; /* { dg-warning "dereference of NULL" } */ |
| 18 |
return; |
| 19 |
y: |
| 20 |
__analyzer_dump_path (); /* { dg-message "path" } */ |
| 21 |
__analyzer_eval (pc == 1); /* { dg-warning "TRUE" "" { xfail *-*-* } } */ |
| 22 |
/* { dg-bogus "FALSE" "" { target *-*-* } .-1 } */ |
| 23 |
/* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-2 } */ |
| 24 |
return; |
| 25 |
} |
| 26 |
|
| 27 |
int main() { foo(0); } |