summaryrefslogtreecommitdiffhomepage
path: root/CompilerDriver/cc2/regression-tests/pure2-initialization-safety-with-else-if.cpp2
blob: 20db09f3c5dc11bc11a912b7a905ff62558f8426 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
main: (args) = {
    p : *int;

    a := 1;
    b := 2;
    c := 3;
    d := 4;

    if args.size() == 3 {
        p = a&;
    } else if true {
        if args.size() == 2 {
            p = c&;
        } else if b > 0 {
                p = a&;
        }
        else {
            p = d&;
        }
    } else {
        p = c&;
    }

    std::cout << p* << std::endl;
}