1 // RUN: %clang_cc1 -verify=relaxed -fstrict-flex-arrays=1 %s
2 // RUN: %clang_cc1 -verify=relaxed,strict -fstrict-flex-arrays=2 %s
3 // RUN: %clang_cc1 -verify=relaxed,strict,very-strict -fstrict-flex-arrays=3 %s
5 // We cannot know for sure the size of a flexible array.
11 s2
->a
[2] = 0; // no-warning
14 // Under -fstrict-flex-arrays={1,2,3} `a` is not a flexible array
17 int a
[10]; // relaxed-note {{array 'a' declared here}}
20 s2
->a
[12] = 0; // relaxed-warning {{array index 12 is past the end of the array (that has type 'int[10]')}}
24 // Under -fstrict-flex-arrays=2 `a` is not a flexible array, but it is under -fstrict-flex-arrays=1
27 int a
[1]; // strict-note {{array 'a' declared here}}
30 s2
->a
[2] = 0; // strict-warning {{array index 2 is past the end of the array (that has type 'int[1]')}}
33 // Under -fstrict-flex-arrays={1,2} `a` is a flexible array, but not under -fstrict-flex-arrays=3.
36 int a
[0]; // very-strict-note {{array 'a' declared here}}
39 s2
->a
[2] = 0; // very-strict-warning {{array index 2 is past the end of the array (that has type 'int[0]')}}