• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -verify %s
2 // expected-no-diagnostics
3 
4 int printf(const char *restrict,...);
5 
6 // Testing core functionality of the region store.
7 // radar://10127782
compoundLiteralTest()8 int compoundLiteralTest() {
9     int index = 0;
10     for (index = 0; index < 2; index++) {
11         int thing = (int []){0, 1}[index];
12         printf("thing: %i\n", thing);
13     }
14     return 0;
15 }
16 
compoundLiteralTest2()17 int compoundLiteralTest2() {
18     int index = 0;
19     for (index = 0; index < 3; index++) {
20         int thing = (int [][3]){{0,0,0}, {1,1,1}, {2,2,2}}[index][index];
21         printf("thing: %i\n", thing);
22     }
23     return 0;
24 }
25