Add __builtion_unreachable to vector::size(), vector::capacity()
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / computed-goto-1.c
blobd6877d3959fe657fd8492fb1eadad76922ff5684
1 #include "../../gcc.dg/analyzer/analyzer-decls.h"
3 void test_1 (int pc)
5 void *arr[2] = {&&x, &&y};
7 goto *arr[pc];
9 x:
10 __analyzer_dump_path (); /* { dg-message "path" } */
11 __analyzer_eval (pc == 0); /* { dg-warning "TRUE" "true" { xfail *-*-* } .-1 } */
12 /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
13 return;
16 __analyzer_dump_path (); /* { dg-message "path" } */
17 __analyzer_eval (pc == 1); /* { dg-warning "TRUE" "" { xfail *-*-* } } */
18 /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
19 return;
22 void test_duplicates (int pc)
24 void *arr[3] = {&&x, &&y, &&x};
25 int var = 0;
27 goto *arr[pc];
30 __analyzer_dump_path (); /* { dg-message "path" } */
31 __analyzer_eval (pc == 0); /* { dg-warning "UNKNOWN" } */
32 return;
35 __analyzer_dump_path (); /* { dg-message "path" } */
36 __analyzer_eval (pc == 1); /* { dg-warning "TRUE" "" { xfail *-*-* } } */
37 /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
38 return;
41 void test_multiple (int pc)
43 void *arr[2] = {&&x, &&y};
45 goto *arr[pc];
48 __analyzer_dump_path (); /* { dg-message "path" } */
49 __analyzer_eval (pc == 0); /* { dg-warning "TRUE" "true" { xfail *-*-* } .-1 } */
50 /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
52 goto *arr[pc];
55 __analyzer_dump_path (); /* { dg-message "path" } */
56 __analyzer_eval (pc == 1); /* { dg-warning "TRUE" "" { xfail *-*-* } } */
57 /* { dg-bogus "UNKNOWN" "unknown" { xfail *-*-* } .-1 } */
59 goto *arr[pc];