summaryrefslogtreecommitdiffstats
path: root/test/Analysis/region-store.c
blob: 09c3f102e3ad36b38b97c075c955711020fef573 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -verify %s

int printf(const char *restrict,...);

// Testing core functionality of the region store.
// radar://10127782
int compoundLiteralTest() {
    int index = 0;
    for (index = 0; index < 2; index++) {
        int thing = (int []){0, 1}[index];
        printf("thing: %i\n", thing);
    }
    return 0;
}

int compoundLiteralTest2() {
    int index = 0;
    for (index = 0; index < 3; index++) {
        int thing = (int [][3]){{0,0,0}, {1,1,1}, {2,2,2}}[index][index];
        printf("thing: %i\n", thing);
    }
    return 0;
}
OpenPOWER on IntegriCloud