1 // { dg-options "-Og -fcse-follow-jumps -fipa-ra" }
2 // { dg-require-effective-target c++11 }
3 // { dg-additional-options "-march=goldmont -fPIC -mforce-indirect-call" { target { { i?86-*-* x86_64-*-* } && fpic } } }
4 
5 enum WindowClass { WC_NONE, WC_AI_SETTINGS, WC_AI_LIST };
6 enum { AWV_DECREASE, AWV_INCREASE };
7 enum WidgetType {
8   WWT_PANEL,
9   WWT_TEXT,
10   WWT_MATRIX,
11   WWT_FRAME,
12   WWT_CAPTION,
13   WWT_DEFSIZEBOX,
14   WWT_RESIZEBOX,
15   WWT_CLOSEBOX,
16   NWID_HORIZONTAL,
17   NWID_VERTICAL,
18   NWID_SPACER,
19   NWID_VSCROLLBAR,
20   WWT_PUSHTXTBTN,
21   WWT_PUSHARROWBTN
22 };
23 enum NWidContainerFlags { NC_NONE };
24 struct NWidgetPartPIP {
25   char prepost;
26 };
27 struct NWidgetPart {
28   NWidgetPartPIP pip;
29 } __trans_tmp_1;
SetResize(short,short)30 static NWidgetPart SetResize(short, short) {
31   NWidgetPart part;
32   return part;
33 }
34 NWidgetPart SetMinimalSize(short, short);
SetFill(int,int)35 static NWidgetPart SetFill(int, int) {
36   NWidgetPart part;
37   return part;
38 }
EndContainer()39 static NWidgetPart EndContainer() {
40   NWidgetPart part;
41   return part;
42 }
SetDataTip(int,int)43 static NWidgetPart SetDataTip(int, int) {
44   NWidgetPart part;
45   return part;
46 }
SetMatrixDataTip(char,char,int)47 static NWidgetPart SetMatrixDataTip(char, char, int) { return __trans_tmp_1; }
48 NWidgetPart SetPadding();
49 NWidgetPart SetScrollbar(int);
50 NWidgetPart NWidget(WidgetType, NWidContainerFlags = NC_NONE);
51 struct WindowDesc {
52   WindowDesc(const char *, short, short, WindowClass, WindowClass, int,
53              const NWidgetPart *, short, int * = nullptr);
54   ~WindowDesc();
55 };
56 class CommandCost {
57 public:
58   CommandCost(int);
59 } const CMD_ERROR(5);
60 enum { WID_AIC_SCROLLBAR };
61 const NWidgetPart _nested_ai_list_widgets[]{NWidget(NWID_HORIZONTAL),
62                                             NWidget(WWT_CLOSEBOX),
63                                             NWidget(WWT_CAPTION),
64                                             SetDataTip(8, 4),
65                                             NWidget(WWT_DEFSIZEBOX),
66                                             NWidget(NWID_HORIZONTAL),
67                                             NWidget(WWT_MATRIX),
68                                             SetMinimalSize(8, 2),
69                                             SetFill(1, 1),
70                                             SetResize(1, 1),
71                                             SetMatrixDataTip(1, 0, 1),
72                                             EndContainer(),
73                                             NWidget(WWT_PANEL),
74                                             EndContainer(),
75                                             NWidget(NWID_HORIZONTAL),
76                                             NWidget(NWID_HORIZONTAL),
77                                             NWidget(WWT_PUSHTXTBTN),
78                                             SetResize(1, 0),
79                                             SetFill(1, 0),
80                                             SetDataTip(5, 0),
81                                             NWidget(WWT_PUSHTXTBTN),
82                                             SetResize(1, 0),
83                                             SetFill(1, 0),
84                                             SetDataTip(1, 2),
85                                             EndContainer(),
86                                             NWidget(WWT_RESIZEBOX),
87                                             EndContainer()};
88 static WindowDesc _ai_list_desc("", 0, 4, WC_AI_LIST, WC_NONE, 0,
89                                 _nested_ai_list_widgets, 0);
90 const NWidgetPart _nested_ai_settings_widgets[]{NWidget(NWID_HORIZONTAL),
91                                                 NWidget(WWT_CLOSEBOX),
92                                                 NWidget(WWT_CAPTION),
93                                                 SetDataTip(0, 4),
94                                                 NWidget(WWT_DEFSIZEBOX),
95                                                 EndContainer(),
96                                                 NWidget(NWID_HORIZONTAL),
97                                                 NWidget(WWT_MATRIX),
98                                                 SetMinimalSize(8, 2),
99                                                 SetResize(1, 1),
100                                                 SetFill(1, 0),
101                                                 SetMatrixDataTip(1, 0, 0),
102                                                 EndContainer(),
103                                                 NWidget(NWID_HORIZONTAL),
104                                                 NWidget(NWID_HORIZONTAL),
105                                                 NWidget(WWT_PUSHTXTBTN),
106                                                 SetResize(1, 0),
107                                                 SetDataTip(3, 0),
108                                                 NWidget(WWT_PUSHTXTBTN),
109                                                 SetResize(1, 0),
110                                                 SetDataTip(4, 0),
111                                                 EndContainer(),
112                                                 NWidget(WWT_RESIZEBOX),
113                                                 EndContainer()};
114 static WindowDesc _ai_settings_desc("", 0, 208, WC_AI_SETTINGS, WC_NONE, 0,
115                                     _nested_ai_settings_widgets, 0);
116 NWidgetPart _nested_ai_config_widgets[]{NWidget(NWID_HORIZONTAL),
117                                         NWidget(WWT_CLOSEBOX),
118                                         NWidget(WWT_CAPTION),
119                                         SetDataTip(5, 4),
120                                         EndContainer(),
121                                         NWidget(WWT_PANEL),
122                                         NWidget(NWID_VERTICAL),
123                                         SetPadding(),
124                                         NWidget(NWID_HORIZONTAL),
125                                         SetPadding(),
126                                         NWidget(WWT_PUSHARROWBTN),
127                                         SetFill(0, 1),
128                                         SetDataTip(AWV_DECREASE, 0),
129                                         NWidget(WWT_PUSHARROWBTN),
130                                         SetFill(0, 1),
131                                         SetDataTip(AWV_INCREASE, 0),
132                                         NWidget(NWID_SPACER),
133                                         SetMinimalSize(6, 0),
134                                         NWidget(WWT_TEXT),
135                                         SetDataTip(3, 0),
136                                         SetFill(1, 0),
137                                         SetPadding(),
138                                         EndContainer(),
139                                         NWidget(NWID_HORIZONTAL),
140                                         SetPadding(),
141                                         NWidget(WWT_PUSHTXTBTN),
142                                         SetResize(1, 0),
143                                         SetFill(1, 0),
144                                         SetDataTip(1, 2),
145                                         NWidget(WWT_PUSHTXTBTN),
146                                         SetResize(1, 0),
147                                         SetFill(1, 0),
148                                         SetDataTip(3, 4),
149                                         EndContainer(),
150                                         EndContainer(),
151                                         SetPadding(),
152                                         NWidget(NWID_HORIZONTAL),
153                                         NWidget(WWT_MATRIX),
154                                         SetMinimalSize(1, 0),
155                                         SetMatrixDataTip(1, 8, 7),
156                                         SetScrollbar(WID_AIC_SCROLLBAR),
157                                         NWidget(NWID_VSCROLLBAR),
158                                         EndContainer(),
159                                         EndContainer(),
160                                         NWidget(NWID_SPACER),
161                                         SetMinimalSize(0, 9),
162                                         NWidget(WWT_FRAME),
163                                         SetDataTip(5, 0),
164                                         SetPadding(),
165                                         NWidget(WWT_MATRIX),
166                                         SetMinimalSize(1, 0),
167                                         SetMatrixDataTip(1, 1, 6),
168                                         EndContainer(),
169                                         NWidget(NWID_HORIZONTAL),
170                                         SetPadding(),
171                                         NWidget(WWT_PUSHTXTBTN),
172                                         SetFill(1, 0),
173                                         SetMinimalSize(3, 2),
174                                         SetDataTip(1, 5),
175                                         NWidget(WWT_PUSHTXTBTN),
176                                         SetFill(1, 0),
177                                         SetMinimalSize(3, 2),
178                                         SetDataTip(6, 7),
179                                         NWidget(WWT_PUSHTXTBTN),
180                                         SetFill(1, 0),
181                                         SetMinimalSize(3, 2),
182                                         SetDataTip(3, 0),
183                                         EndContainer(),
184                                         NWidget(WWT_PUSHTXTBTN),
185                                         SetFill(1, 0),
186                                         SetResize(1, 0),
187                                         SetDataTip(6, 0),
188                                         NWidget(WWT_PUSHTXTBTN),
189                                         SetFill(1, 0),
190                                         SetResize(1, 0),
191                                         SetDataTip(7, 0),
192                                         NWidget(WWT_PUSHTXTBTN),
193                                         SetFill(1, 0),
194                                         SetResize(1, 0),
195                                         SetDataTip(2, 3)};
196