aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/auto-init-pr102276-4.c
blob: 662e0d1182e6ccb597975e52e8535ab2e06c3f16 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* { dg-do compile } */
/* { dg-options "-O2 -Wtrivial-auto-var-init -ftrivial-auto-var-init=pattern" } */

int g(int *, int *);
int f()
{
    switch (0) {
        int x;  /* { dg-warning "cannot be initialized with" } */
        int y;  /* { dg-warning "cannot be initialized with" } */
        default:
        return g(&x, &y);
    }
}

int g1(int, int);
int f1()
{
    switch (0) {
        int x; /* { dg-warning "cannot be initialized with" } */
        int y; /* { dg-warning "cannot be initialized with" } */
        default:
        return g1(x, y);
    }
}

struct S
{
  char a;
  int b;
};
int g2(int);
int f2(int input)
{
    switch (0) {
        struct S x; /* { dg-warning "cannot be initialized with" } */
        struct S y; /* { dg-warning "cannot be initialized with" } */
        default:
        return g2(input) + x.b + y.b;
    }
}