[committed] Fix minor SH scan-asm failure after recent IOR->ADD changes
[official-gcc.git] / gcc / testsuite / g++.dg / pr48484.C
blob9dc6d1c4f2144395fa410406f9fb0bc1134faff5
1 /* { dg-do compile } */
2 /* { dg-options "-O -finline-functions -finline-small-functions -Wuninitialized" }  */
3 /* { dg-add-options bind_pic_locally } */
5 typedef int int32_t __attribute__((mode (__SI__)));
7 struct SQObjectPtr
9   int32_t _type;
10   SQObjectPtr operator = (long);
12 struct SQObjectPtrVec
14   SQObjectPtr fff (unsigned);
15   SQObjectPtr *_vals;
18 struct SQInstruction
20   int _arg1;
21   unsigned op;
22   unsigned _arg0;
23   unsigned _arg2;
25 struct SQVM
27   struct CallInfo
28   {
29     SQInstruction *_ip;
30   };
31     bool
32     Execute (SQObjectPtr &, long, long, long, SQObjectPtr &, unsigned, int);
33     bool
34     FOREACH_OP
35     (SQObjectPtr
36      &, SQObjectPtr &, SQObjectPtr &, SQObjectPtr &, long, int, int &);
37   SQObjectPtrVec _stack;
38   CallInfo *ci;
39   long _nnativecalls;
40   bool ShouldSuspend ();
42 struct AutoDec
44   AutoDec (long *);
45    ~AutoDec ();
47 bool
48   SQVM::FOREACH_OP
49   (SQObjectPtr
50    &
51    o1,
52    SQObjectPtr & o2, SQObjectPtr &, SQObjectPtr & o4, long, int, int &jump)
54   long
55     nrefidx = 0;
56   switch (o1._type)
57     {
58     case 0x02000000L:
59       o4 = nrefidx;
60       jump = 1;
61       return true;
62     case 0x00000080L:
63       {
64         long
65           idx = 10;
66         o2 = idx;
67         jump = 0;
68       }
69     }
71   return false;
74 bool
75   SQVM::Execute
76   (SQObjectPtr &, long, long, long, SQObjectPtr &, unsigned, int)
78   AutoDec
79   ad (&_nnativecalls);
80   for (;;)
81     {
82       if (ShouldSuspend ())
83         return true;
84       SQInstruction
85         _i_ = *ci->_ip;
86       switch (_i_.op)
87         {
88         case 0:
89           {
90             int
91               tojump;
93             FOREACH_OP
94               (_stack._vals
95                [_i_._arg0],
96                _stack._vals
97                [_i_._arg2],
98                _stack._vals
99                [_i_._arg2],
100                _stack._vals[_i_._arg2], _i_._arg2, _i_._arg1, tojump);
102             ci += tojump;  /* { dg-warning "uninitialized" "warning" }  */
103           }
104         case 1:
105           _stack.fff (_i_._arg1);
106         }
107     }
109   return true;