PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / pr48484.C
blob19e9b9a8d0ac7c3920cd02e7a32c14afb5d6d6f7
1 /* { dg-do compile } */
2 /* { dg-options "-O -finline-functions -finline-small-functions -Wuninitialized" }  */
3 /* { dg-add-options bind_pic_locally } */
5 struct SQObjectPtr
7   int _type;
8   SQObjectPtr operator = (long);
9 };
10 struct SQObjectPtrVec
12   SQObjectPtr fff (unsigned);
13   SQObjectPtr *_vals;
16 struct SQInstruction
18   int _arg1;
19   unsigned op;
20   unsigned _arg0;
21   unsigned _arg2;
23 struct SQVM
25   struct CallInfo
26   {
27     SQInstruction *_ip;
28   };
29     bool
30     Execute (SQObjectPtr &, long, long, long, SQObjectPtr &, unsigned, int);
31     bool
32     FOREACH_OP
33     (SQObjectPtr
34      &, SQObjectPtr &, SQObjectPtr &, SQObjectPtr &, long, int, int &);
35   SQObjectPtrVec _stack;
36   CallInfo *ci;
37   long _nnativecalls;
38   bool ShouldSuspend ();
40 struct AutoDec
42   AutoDec (long *);
43    ~AutoDec ();
45 bool
46   SQVM::FOREACH_OP
47   (SQObjectPtr
48    &
49    o1,
50    SQObjectPtr & o2, SQObjectPtr &, SQObjectPtr & o4, long, int, int &jump)
52   long
53     nrefidx = 0;
54   switch (o1._type)
55     {
56     case 0x02000000:
57       o4 = nrefidx;
58       jump = 1;
59       return true;
60     case 0x00000080:
61       {
62         long
63           idx = 10;
64         o2 = idx;
65         jump = 0;
66       }
67     }
69   return false;
72 bool
73   SQVM::Execute
74   (SQObjectPtr &, long, long, long, SQObjectPtr &, unsigned, int)
76   AutoDec
77   ad (&_nnativecalls);
78   for (;;)
79     {
80       if (ShouldSuspend ())
81         return true;
82       SQInstruction
83         _i_ = *ci->_ip;
84       switch (_i_.op)
85         {
86         case 0:
87           {
88             int
89               tojump;
91             FOREACH_OP
92               (_stack._vals
93                [_i_._arg0],
94                _stack._vals
95                [_i_._arg2],
96                _stack._vals
97                [_i_._arg2],
98                _stack._vals[_i_._arg2], _i_._arg2, _i_._arg1, tojump);
100             ci += tojump;  /* { dg-warning "uninitialized" "warning" }  */
101           }
102         case 1:
103           _stack.fff (_i_._arg1);
104         }
105     }
107   return true;