aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/ada/acats/tests
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/ada/acats/tests')
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c330001.a354
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c330002.a326
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c332001.a226
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c340001.a470
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c340a01.a165
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c340a02.a221
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c341a01.a117
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c341a02.a145
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c341a03.a140
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c341a04.a141
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c352001.a270
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c354002.a335
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c354003.a211
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c360002.a268
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c371001.a388
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c371002.a364
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c371003.a474
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c380001.a128
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c380002.a72
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c380003.a223
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c380004.a385
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3900010.a147
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c390002.a165
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c390003.a419
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c390004.a404
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3900050.a157
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3900051.a137
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3900052.a138
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3900060.a159
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3900061.a138
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3900062.a137
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c390007.a374
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c390010.a216
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c390011.a250
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c390a010.a127
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c390a020.a90
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c390a021.a133
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c390a030.a188
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c391001.a329
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c391002.a493
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392002.a349
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392003.a453
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392004.a189
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392005.a367
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392008.a401
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392010.a512
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392011.a299
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392013.a179
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392014.a225
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392a01.a265
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392c05.a164
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392c07.a190
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392d01.a324
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392d02.a185
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c392d03.a248
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393001.a407
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393007.a157
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393008.a204
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393009.a170
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393010.a306
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393011.a220
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393012.a221
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393a02.a213
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393a03.a242
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393a05.a166
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393a06.a201
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393b12.a131
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393b13.a105
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c393b14.a147
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0001.a138
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0002.a142
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0003.a144
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0004.a115
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0005.a147
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0006.a163
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0007.a234
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0008.a150
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0009.a219
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0010.a158
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0011.a186
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a00120.a83
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a00121.a76
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0013.a347
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0014.a453
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a0015.a267
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a1001.a315
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a1002.a251
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a2001.a460
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a2002.a295
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a2003.a329
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a2a01.a367
-rw-r--r--gcc/testsuite/ada/acats/tests/c3/c3a2a02.a396
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c410001.a303
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c420001.a110
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c431001.a464
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c432001.a512
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c432002.a764
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c432003.a594
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c432004.a319
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c433001.a302
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c450001.a434
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c452001.a707
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c455001.a164
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460001.a300
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460002.a330
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460004.a335
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460005.a260
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460006.a378
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460007.a239
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460008.a286
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460009.a467
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460010.a354
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460011.a210
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460012.a93
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460a01.a408
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c460a02.a413
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c490001.a215
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c490002.a239
-rw-r--r--gcc/testsuite/ada/acats/tests/c4/c490003.a215
-rw-r--r--gcc/testsuite/ada/acats/tests/c5/c540001.a410
-rw-r--r--gcc/testsuite/ada/acats/tests/c6/c631001.a134
-rw-r--r--gcc/testsuite/ada/acats/tests/c6/c640001.a334
-rw-r--r--gcc/testsuite/ada/acats/tests/c6/c641001.a281
-rw-r--r--gcc/testsuite/ada/acats/tests/c6/c650001.a412
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c730001.a437
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c730002.a383
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c730003.a283
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c730004.a327
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c730a01.a176
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c730a02.a252
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c731001.a407
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c760001.a390
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c760002.a489
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c760007.a247
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c760009.a533
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c760010.a418
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c760011.a291
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c760012.a256
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c760013.a108
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c761001.a117
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c761002.a245
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c761003.a447
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c761004.a305
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c761005.a288
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c761006.a425
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c761007.a419
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c761010.a447
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c761011.a410
-rw-r--r--gcc/testsuite/ada/acats/tests/c7/c761012.a151
-rw-r--r--gcc/testsuite/ada/acats/tests/c8/c840001.a257
-rw-r--r--gcc/testsuite/ada/acats/tests/c8/c854001.a277
-rw-r--r--gcc/testsuite/ada/acats/tests/c8/c854002.a185
-rw-r--r--gcc/testsuite/ada/acats/tests/c8/c854003.a64
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c910001.a224
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c910002.a143
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c910003.a185
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c930001.a153
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940001.a212
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940002.a309
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940004.a416
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940005.a370
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940006.a223
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940007.a427
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940010.a269
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940011.a175
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940012.a174
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940013.a379
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940014.a177
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940015.a149
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940016.a211
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c940a03.a350
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c951001.a192
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c951002.a334
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c953001.a188
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c953002.a242
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c953003.a189
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954001.a273
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954010.a286
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954011.a384
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954012.a496
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954013.a521
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954014.a485
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954015.a549
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954016.a182
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954017.a184
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954018.a227
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954019.a314
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954020.a422
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954021.a524
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954022.a351
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954023.a558
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954024.a380
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954025.a237
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954026.a269
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954a01.a262
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954a02.a259
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c954a03.a322
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c960001.a164
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c960002.a171
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c960004.a206
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974001.a152
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974002.a209
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974003.a249
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974004.a273
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974005.a259
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974006.a197
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974007.a205
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974008.a229
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974009.a206
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974010.a209
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974011.a275
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974012.a165
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974013.a167
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c974014.a132
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c980001.a303
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c980002.a165
-rw-r--r--gcc/testsuite/ada/acats/tests/c9/c980003.a294
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11001.a276
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11002.a238
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11003.a290
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca110040.a90
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca110041.a118
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca110050.a99
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11006.a211
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11007.a228
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11008.a216
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11009.a246
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11010.a254
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11011.a271
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11012.a259
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11013.a201
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11014.a302
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11015.a312
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11016.a321
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11017.a246
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11018.a366
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11019.a306
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11020.a238
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11021.a245
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11022.a242
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11a01.a228
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11a02.a156
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11b01.a208
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11b02.a169
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11c01.a170
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11c02.a158
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11c03.a186
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11d010.a119
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11d011.a79
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11d012.a73
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11d02.a393
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca11d03.a174
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca13001.a370
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca13002.a259
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca13003.a256
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca13a01.a320
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca13a02.a301
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca140230.a62
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca140231.a59
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca140233.a68
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca140280.a77
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca140281.a67
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca140282.a64
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca15003.a161
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca200020.a70
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca200021.a66
-rw-r--r--gcc/testsuite/ada/acats/tests/ca/ca21001.a152
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb10002.a128
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb20001.a228
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb20003.a286
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb20004.a203
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb20005.a210
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb20006.a217
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb20007.a196
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb20a02.a155
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb40005.a339
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb40a01.a135
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb40a020.a95
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb40a030.a105
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb40a04.a119
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb41001.a213
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb41002.a283
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb41003.a358
-rw-r--r--gcc/testsuite/ada/acats/tests/cb/cb41004.a316
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc30001.a219
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc30002.a349
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc40001.a403
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc50001.a257
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc50a01.a313
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc50a02.a227
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc51001.a186
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc51002.a198
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc51003.a187
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc51004.a181
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc51006.a224
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc51007.a305
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc51008.a124
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc51a01.a193
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc51b03.a258
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc51d01.a262
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc51d02.a244
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc54001.a184
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc54002.a223
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc54003.a234
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc54004.a295
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc70001.a309
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc70002.a241
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc70003.a212
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc70a01.a208
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc70a02.a193
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc70b01.a170
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc70b02.a222
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc70c01.a187
-rw-r--r--gcc/testsuite/ada/acats/tests/cc/cc70c02.a192
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd10001.a300
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd10002.a1198
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd20001.a275
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd30001.a284
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd30002.a207
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd30003.a227
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd30004.a215
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd33001.a139
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd33002.a140
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd40001.a181
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd70001.a201
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd72a01.a165
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd72a02.a225
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd90001.a233
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cd92001.a229
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cdb0a01.a305
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cdb0a02.a329
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cdd1001.a94
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cdd2001.a203
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cdd2a01.a379
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cdd2a02.a345
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cdd2a03.a325
-rw-r--r--gcc/testsuite/ada/acats/tests/cd/cde0001.a324
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa3001.a507
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa3002.a318
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa3003.a243
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa3004.a235
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4001.a218
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4002.a182
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4003.a326
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4004.a431
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4005.a683
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4006.a319
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4007.a334
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4008.a662
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4009.a619
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4010.a275
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4011.a376
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4012.a305
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4013.a203
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4014.a359
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4015.a580
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4016.a685
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4017.a337
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4018.a379
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4019.a1027
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4020.a688
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4021.a311
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4022.a531
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4023.a585
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4024.a350
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4025.a376
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4026.a526
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4027.a342
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4028.a331
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4029.a333
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4030.a414
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4031.a291
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4032.a457
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4033.a405
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa4034.a281
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5011.a471
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5012.a536
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5015.a342
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5a01.a338
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5a02.a328
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5a03.a426
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5a04.a434
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5a05.a338
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5a06.a334
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5a07.a413
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5a08.a474
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5a09.a400
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa5a10.a551
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa8001.a243
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa8002.a285
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa8003.a214
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa9001.a287
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa9002.a482
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa001.a279
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa002.a257
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa003.a293
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa004.a260
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa005.a292
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa006.a285
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa007.a263
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa008.a271
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa009.a290
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa010.a335
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa011.a266
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa012.a167
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa013.a167
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa014.a178
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa015.a227
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa016.a462
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa017.a400
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa018.a277
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaa019.a138
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxab001.a272
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxac001.a292
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxac002.a426
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxac003.a376
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxac004.a310
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxac005.a343
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaca01.a291
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaca02.a360
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxacb01.a264
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxacb02.a421
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxacc01.a299
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxaf001.a199
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb2001.a633
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb2002.a259
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb2003.a255
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3001.a179
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3002.a158
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3003.a167
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3005.a396
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3007.a408
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3008.a226
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3009.a305
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3010.a320
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3011.a282
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3012.a342
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3014.a254
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3015.a520
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb3016.a516
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb4001.a230
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb4002.a308
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb4003.a310
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb4004.a443
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb4005.a332
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb4006.a322
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb4007.a271
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb4008.a248
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb5001.a110
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb5002.a334
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb5003.a295
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf1001.a261
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf2001.a755
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf2002.a352
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf2003.a363
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf2004.a513
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf2005.a293
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf2a01.a448
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf2a02.a354
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf3001.a192
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf3002.a231
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf3003.a292
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf3004.a257
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf3a01.a167
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf3a02.a267
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf3a03.a429
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf3a04.a293
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf3a05.a266
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf3a06.a302
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf3a07.a337
-rw-r--r--gcc/testsuite/ada/acats/tests/cxf/cxf3a08.a289
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg1001.a276
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg1002.a198
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg1003.a478
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg1004.a360
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg1005.a393
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2001.a322
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2002.a468
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2003.a701
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2004.a499
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2005.a204
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2006.a281
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2007.a291
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2008.a948
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2009.a421
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2010.a892
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2011.a490
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2012.a438
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2013.a367
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2014.a399
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2015.a686
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2016.a482
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2017.a296
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2018.a355
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2019.a338
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2020.a351
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2021.a386
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2022.a309
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2023.a351
-rw-r--r--gcc/testsuite/ada/acats/tests/cxg/cxg2024.a191
-rw-r--r--gcc/testsuite/ada/acats/tests/cxh/cxh1001.a349
-rw-r--r--gcc/testsuite/ada/acats/tests/cxh/cxh3001.a243
-rw-r--r--gcc/testsuite/ada/acats/tests/cxh/cxh3002.a343
-rw-r--r--gcc/testsuite/ada/acats/tests/cxh/cxh30030.a54
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140010.a51
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140012.a55
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140020.a60
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140022.a66
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140030.a57
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140031.a66
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140033.a56
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140040.a52
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140042.a53
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140050.a60
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140051.a56
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140053.a60
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140060.a54
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140061.a66
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140063.a70
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140070.a62
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140071.a72
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140073.a63
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140080.a52
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140081.a63
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140083.a61
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140090.a60
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140091.a60
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140093.a59
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140100.a56
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140101.a89
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140103.a58
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140110.a64
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140111.a62
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140113.a59
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140120.a63
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140121.a64
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140123.a59
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140130.a57
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140131.a58
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140133.a58
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140140.a55
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140141.a57
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140143.a64
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140150.a56
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140151.a65
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140153.a61
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140160.a54
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140161.a63
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140163.a67
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140170.a64
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140171.a69
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140173.a75
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140180.a65
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140181.a54
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140183.a60
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140190.a61
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140191.a74
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140193.a64
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140200.a76
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140201.a71
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140203.a71
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140210.a69
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140212.a74
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140220.a64
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140222.a69
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140240.a61
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140241.a55
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140243.a61
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140250.a56
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140252.a59
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140260.a98
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140261.a52
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140263.a57
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140270.a56
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140271.a93
-rw-r--r--gcc/testsuite/ada/acats/tests/l/la140273.a58
576 files changed, 0 insertions, 151307 deletions
diff --git a/gcc/testsuite/ada/acats/tests/c3/c330001.a b/gcc/testsuite/ada/acats/tests/c3/c330001.a
deleted file mode 100644
index 218896d679d..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c330001.a
+++ /dev/null
@@ -1,354 +0,0 @@
--- C330001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a variable object of an indefinite type is properly
--- initialized/constrained by an initial value assignment that is
--- a) an aggregate, b) a function, or c) an object. Check that objects
--- of the above types do not need explicit constraints if they have
--- initial values.
---
--- TEST DESCRIPTION:
--- An indefinite subtype is either:
--- a) An unconstrained array subtype.
--- b) A subtype with unknown discriminants.
--- c) A subtype with unconstrained discriminants without defaults.
---
--- Declare several indefinite types in a parent package specification.
--- In the private part, complete one type with a discriminant without
--- default (indefinite) and the other with a default discriminant
--- (definite). Declare objects of both indefinite and definite subtypes
--- in children (private and public) with initialization expressions. The
--- test verifies all values of the objects. It also verifies that
--- Constraint_Error is raised if an attempt is made to change the
--- discriminants of the objects of the indefinite subtypes.
---
---
--- CHANGE HISTORY:
--- 15 Jan 95 SAIC Initial version for ACVC 2.1
--- 25 Jul 96 SAIC Modified test description. Deleted use C330001_0.
--- 20 Nov 98 RLB Added Elaborate pragmas to avoid problems
--- with an unconventional, but legal, elaboration
--- order.
---!
-
-package C330001_0 is
-
- subtype Sub_Type is Integer range 1 .. 20;
-
- type Tag_W_Disc (D : Sub_Type) is tagged record
- C1 : String (1 .. D);
- end record;
-
- -- Indefinite type declarations.
-
- type FullViewDefinite_Unknown_Disc (<>) is private;
-
- type Indefinite_No_Disc is array (Positive range <>) of Integer;
-
- type Indefinite_Tag_W_Disc (D : Sub_Type) is tagged
- record
- C1 : Boolean := False;
- end record;
-
- type Indefinite_New_W_Disc (ND : Sub_Type) is new
- Indefinite_Tag_W_Disc (ND) with record
- C2 : Integer := 9;
- end record;
-
- type Indefinite_W_Inherit_Disc_1 is new Tag_W_Disc with
- record
- S : Sub_Type := 18;
- end record;
-
- type Indefinite_W_Inherit_Disc_2 is
- new Tag_W_Disc with private;
-
- function Indef_Func_1 return FullViewDefinite_Unknown_Disc;
-
- function Indef_Func_2 (P : Sub_Type) return Indefinite_W_Inherit_Disc_2;
-
-private
-
- type FullViewDefinite_Unknown_Disc (D : Sub_Type := 2) is
- record
- S : String (1 .. D) := "Hi";
- end record;
-
- type Indefinite_W_Inherit_Disc_2 is new Tag_W_Disc with
- record
- S : Sub_Type;
- end record;
-
-end C330001_0;
-
- --==================================================================--
-
-package body C330001_0 is
-
- function Indef_Func_1 return FullViewDefinite_Unknown_Disc is
- Var_1 : FullViewDefinite_Unknown_Disc; -- No need for explicit
- -- constraints, use initial
- begin -- values.
- return Var_1;
- end Indef_Func_1;
-
- ------------------------------------------------------------------
- function Indef_Func_2 (P : Sub_Type) return Indefinite_W_Inherit_Disc_2 is
- Var_2 : Indefinite_W_Inherit_Disc_2 := (D => 5, C1 => "Hello", S => P);
- begin
- return Var_2;
- end Indef_Func_2;
-
-end C330001_0;
-
- --==================================================================--
-
-with C330001_0;
-pragma Elaborate(C330001_0); -- Insure that the functions can be called.
-private
-package C330001_0.C330001_1 is
-
- PrivateChild_Obj : Tag_W_Disc := (D => 4, C1 => "ACVC");
-
- PrivateChild_Obj_01 : Indefinite_W_Inherit_Disc_1
- := Indefinite_W_Inherit_Disc_1'(PrivateChild_Obj with S => 15);
-
- -- Since full view of Indefinite_W_Inherit_Disc_2 is indefinite in
- -- the parent package, Indefinite_W_Inherit_Disc_2 needs an initialization
- -- expression.
-
- PrivateChild_Obj_02 : Indefinite_W_Inherit_Disc_2 := Indef_Func_2 (19);
-
- -- Since full view of FullViewDefinite_Unknown_Disc is definite in the
- -- parent package, no initialization expression needed for
- -- PrivateChild_Obj_03.
-
- PrivateChild_Obj_03 : FullViewDefinite_Unknown_Disc;
-
- PrivateChild_Obj_04 : Indefinite_No_Disc := (12, 15);
-
-end C330001_0.C330001_1;
-
- --==================================================================--
-
-with C330001_0;
-pragma Elaborate(C330001_0); -- Insure that the functions can be called.
-package C330001_0.C330001_2 is
-
- PublicChild_Obj_01 : FullViewDefinite_Unknown_Disc := Indef_Func_1;
-
- PublicChild_Obj_02 : Indefinite_W_Inherit_Disc_2 := Indef_Func_2 (4);
-
- PublicChild_Obj_03 : Indefinite_No_Disc := (38, 72, 21, 59);
-
- PublicChild_Obj_04 : Indefinite_Tag_W_Disc := (D => 7, C1 => True);
-
- PublicChild_Obj_05 : Indefinite_Tag_W_Disc := PublicChild_Obj_04;
-
- PublicChild_Obj_06 : Indefinite_New_W_Disc (6);
-
- procedure Assign_Private_Obj_3;
-
- function Raised_CE_PublicChild_Obj return Boolean;
-
- function Raised_CE_PrivateChild_Obj return Boolean;
-
- -- The following functions check the private types defined in the parent
- -- and the private child package from within the client program.
-
- function Verify_Public_Obj_1 return Boolean;
-
- function Verify_Public_Obj_2 return Boolean;
-
- function Verify_Private_Obj_1 return Boolean;
-
- function Verify_Private_Obj_2 return Boolean;
-
- function Verify_Private_Obj_3 return Boolean;
-
-end C330001_0.C330001_2;
-
- --==================================================================--
-
-with Report;
-with C330001_0.C330001_1;
-package body C330001_0.C330001_2 is
-
- procedure Assign_Private_Obj_3 is
- begin
- C330001_0.C330001_1.PrivateChild_Obj_03 := (5, "Aloha");
- end Assign_Private_Obj_3;
-
- ------------------------------------------------------------------
- function Raised_CE_PublicChild_Obj return Boolean is
- begin
- PublicChild_Obj_03 := (16, 13); -- C_E, can't change constraints
- -- of PublicChild_Obj_03.
-
- Report.Failed ("Constraint_Error not raised - Public child");
-
- -- Next line prevents dead assignment.
-
- Report.Comment ("PublicChild_Obj_03'First is" & Integer'Image
- (PublicChild_Obj_03'First) );
- return False;
-
- exception
- when Constraint_Error =>
- return True; -- Exception is expected.
- when others =>
- return False;
- end Raised_CE_PublicChild_Obj;
-
- ------------------------------------------------------------------
- function Raised_CE_PrivateChild_Obj return Boolean is
- begin
- C330001_0.C330001_1.PrivateChild_Obj_04 := (21, 87, 18);
- -- C_E, can't change constraints
- -- of PrivateChild_Obj_04.
-
- Report.Failed ("Constraint_Error not raised - Private child");
-
- -- Next line prevents dead assignment.
-
- Report.Comment ("PrivateChild_Obj_04'Last is" & Integer'Image
- (C330001_0.C330001_1.PrivateChild_Obj_04'Last) );
- return False;
-
- exception
- when Constraint_Error =>
- return True; -- Exception is expected.
- when others =>
- return False;
- end Raised_CE_PrivateChild_Obj;
-
- ------------------------------------------------------------------
- function Verify_Public_Obj_1 return Boolean is
- begin
- return (PublicChild_Obj_01.D = 2 and PublicChild_Obj_01.S = "Hi");
-
- end Verify_Public_Obj_1;
-
- ------------------------------------------------------------------
- function Verify_Public_Obj_2 return Boolean is
- begin
- return (PublicChild_Obj_02.D = 5 and
- PublicChild_Obj_02.C1 = "Hello" and
- PublicChild_Obj_02.S = 4);
-
- end Verify_Public_Obj_2;
-
- ------------------------------------------------------------------
- function Verify_Private_Obj_1 return Boolean is
- begin
- return (C330001_0.C330001_1.PrivateChild_Obj_01.D = 4 and
- C330001_0.C330001_1.PrivateChild_Obj_01.C1 = "ACVC" and
- C330001_0.C330001_1.PrivateChild_Obj_01.S = 15);
-
- end Verify_Private_Obj_1;
-
- ------------------------------------------------------------------
- function Verify_Private_Obj_2 return Boolean is
- begin
- return (C330001_0.C330001_1.PrivateChild_Obj_02.D = 5 and
- C330001_0.C330001_1.PrivateChild_Obj_02.C1 = "Hello" and
- C330001_0.C330001_1.PrivateChild_Obj_02.S = 19);
-
- end Verify_Private_Obj_2;
-
- ------------------------------------------------------------------
- function Verify_Private_Obj_3 return Boolean is
- begin
- return (C330001_0.C330001_1.PrivateChild_Obj_03.D = 5 and
- C330001_0.C330001_1.PrivateChild_Obj_03.S = "Aloha");
-
- end Verify_Private_Obj_3;
-
-end C330001_0.C330001_2;
-
- --==================================================================--
-
-with C330001_0.C330001_2;
-with Report;
-
-use C330001_0.C330001_2;
-
-procedure C330001 is
-begin
- Report.Test ("C330001", "Check that a variable object of an indefinite " &
- "type is properly initialized/constrained by an initial " &
- "value assignment that is a) an aggregate, b) a function, " &
- "or c) an object. Check that objects of the above types " &
- "do not need explicit constraints if they have initial " &
- "values");
-
- -- Verify values of public child objects.
-
- if not (Verify_Public_Obj_1 and Verify_Public_Obj_2) then
- Report.Failed ("Wrong values for PublicChild_Obj_01 or " &
- "PublicChild_Obj_02");
- end if;
-
- if PublicChild_Obj_03'First /= 1 or
- PublicChild_Obj_03'Last /= 4 then
- Report.Failed ("Wrong values for PublicChild_Obj_03");
- end if;
-
- if PublicChild_Obj_05.D /= 7 or
- not PublicChild_Obj_05.C1 then
- Report.Failed ("Wrong values for PublicChild_Obj_05");
- end if;
-
- if PublicChild_Obj_06.ND /= 6 or
- PublicChild_Obj_06.C2 /= 9 or
- PublicChild_Obj_06.C1 then
- Report.Failed ("Wrong values for PublicChild_Obj_06");
- end if;
-
- -- Definite object can have its discriminant changed by assignment to
- -- the entire object.
-
- Assign_Private_Obj_3;
-
- -- Verify values of private child objects.
-
- if not Verify_Private_Obj_1 or not
- Verify_Private_Obj_2 or not
- Verify_Private_Obj_3 then
- Report.Failed ("Wrong values for PrivateChild_Obj_01 or " &
- "PrivateChild_Obj_02 or PrivateChild_Obj_03");
- end if;
-
- -- Attempt to change the discriminants of the objects of the indefinite
- -- subtypes: Constraint_Error.
-
- if not Raised_CE_PublicChild_Obj or not Raised_CE_PrivateChild_Obj then
- Report.Failed ("Constraint_Error not raised");
- end if;
-
- Report.Result;
-
-end C330001;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c330002.a b/gcc/testsuite/ada/acats/tests/c3/c330002.a
deleted file mode 100644
index 1403d5557b1..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c330002.a
+++ /dev/null
@@ -1,326 +0,0 @@
--- C330002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if a subtype indication of a variable object defines an
--- indefinite subtype, then there is an initialization expression.
--- Check that the object remains so constrained throughout its lifetime.
--- Check for cases of tagged record, arrays and generic formal type.
---
--- TEST DESCRIPTION:
--- An indefinite subtype is either:
--- a) An unconstrained array subtype.
--- b) A subtype with unknown discriminants (this includes class-wide
--- types).
--- c) A subtype with unconstrained discriminants without defaults.
---
--- Declare tagged types with unconstrained discriminants without
--- defaults. Declare an unconstrained array. Declare a generic formal
--- type with an unknown discriminant and a formal object of this type.
--- In the generic package, declare an object of the formal type using
--- the formal object as its initial value. In the main program,
--- declare objects of tagged types. Instantiate the generic package.
--- The test checks that Constraint_Error is raised if an attempt is
--- made to change bounds as well as discriminants of the objects of the
--- indefinite subtypes.
---
---
--- CHANGE HISTORY:
--- 01 Nov 95 SAIC Initial prerelease version.
--- 27 Jul 96 SAIC Modified test description & Report.Test. Added
--- code to prevent dead variable optimization.
---
---!
-
-package C330002_0 is
-
- subtype Small_Num is Integer range 1 .. 20;
-
- -- Types with unconstrained discriminants without defaults.
-
- type Tag_Type (Disc : Small_Num) is tagged
- record
- S : String (1 .. Disc);
- end record;
-
- function Tag_Value return Tag_Type;
-
- procedure Assign_Tag (A : out Tag_Type);
-
- procedure Avoid_Optimization_and_Fail (P : Tag_Type; Msg : String);
-
- ---------------------------------------------------------------------
- -- An unconstrained array type.
-
- type Array_Type is array (Positive range <>) of Integer;
-
- function Array_Value return Array_Type;
-
- procedure Assign_Array (A : out Array_Type);
-
- ---------------------------------------------------------------------
- generic
- -- Type with an unknown discriminant.
- type Formal_Type (<>) is private;
- FT_Obj : Formal_Type;
- package Gen is
- Gen_Obj : Formal_Type := FT_Obj;
- end Gen;
-
-end C330002_0;
-
- --==================================================================--
-
-with Report;
-package body C330002_0 is
-
- procedure Assign_Tag (A : out Tag_Type) is
- begin
- A := (3, "Bye");
- end Assign_Tag;
-
- ----------------------------------------------------------------------
- procedure Avoid_Optimization_and_Fail (P : Tag_Type; Msg : String) is
- Default : Tag_Type := (1, "!"); -- Unique value.
- begin
- if P = Default then -- Both If branches can't do the same thing.
- Report.Failed (Msg & ": Constraint_Error not raised");
- else -- Subtests should always select this path.
- Report.Failed ("Constraint_Error not raised " & Msg);
- end if;
- end Avoid_Optimization_and_Fail;
-
- ----------------------------------------------------------------------
- function Tag_Value return Tag_Type is
- TO : Tag_Type := (4 , "ACVC");
- begin
- return TO;
- end Tag_Value;
-
- ----------------------------------------------------------------------
- function Array_Value return Array_Type is
- IA : Array_Type := (20, 31);
- begin
- return IA;
- end Array_Value;
-
- ----------------------------------------------------------------------
- procedure Assign_Array (A : out Array_Type) is
- begin
- A := (84, 36);
- end Assign_Array;
-
-end C330002_0;
-
- --==================================================================--
-
-with Report;
-with C330002_0;
-use C330002_0;
-
-procedure C330002 is
-
-begin
- Report.Test ("C330002", "Check that if a subtype indication of a " &
- "variable object defines an indefinite subtype, then " &
- "there is an initialization expression. Check that " &
- "the object remains so constrained throughout its " &
- "lifetime. Check that Constraint_Error is raised " &
- "if an attempt is made to change bounds as well as " &
- "discriminants of the objects of the indefinite " &
- "subtypes. Check for cases of tagged record and generic " &
- "formal types");
-
- TagObj_Block:
- declare
- TObj_ByAgg : Tag_Type := (5, "Hello"); -- Initial assignment is
- -- aggregate.
- TObj_ByObj : Tag_Type := TObj_ByAgg; -- Initial assignment is
- -- an object.
- TObj_ByFunc : Tag_Type := Tag_Value; -- Initial assignment is
- -- function return value.
- Ren_Obj : Tag_Type renames TObj_ByAgg;
-
- begin
-
- begin
- if (TObj_ByAgg.Disc /= 5) or (TObj_ByAgg.S /= "Hello") then
- Report.Failed ("Wrong initial values for TObj_ByAgg");
- end if;
-
- TObj_ByAgg := (2, "Hi"); -- C_E, can't change the
- -- value of the discriminant.
-
- Avoid_Optimization_and_Fail (TObj_ByAgg, "Subtest 1");
-
- exception
- when Constraint_Error => null; -- Exception is expected.
- when others =>
- Report.Failed ("Unexpected exception - Subtest 1");
- end;
-
-
- begin
- Assign_Tag (Ren_Obj); -- C_E, can't change the
- -- value of the discriminant.
-
- Avoid_Optimization_and_Fail (Ren_Obj, "Subtest 2");
-
- exception
- when Constraint_Error => null; -- Exception is expected.
- when others =>
- Report.Failed ("Unexpected exception - Subtest 2");
- end;
-
-
- begin
- if (TObj_ByObj.Disc /= 5) or (TObj_ByObj.S /= "Hello") then
- Report.Failed ("Wrong initial values for TObj_ByObj");
- end if;
-
- TObj_ByObj := (3, "Bye"); -- C_E, can't change the
- -- value of the discriminant.
-
- Avoid_Optimization_and_Fail (TObj_ByObj, "Subtest 3");
-
- exception
- when Constraint_Error => null; -- Exception is expected.
- when others =>
- Report.Failed ("Unexpected exception - Subtest 3");
- end;
-
-
- begin
- if (TObj_ByFunc.Disc /= 4) or (TObj_ByFunc.S /= "ACVC") then
- Report.Failed ("Wrong initial values for TObj_ByFunc");
- end if;
-
- TObj_ByFunc := (5, "Aloha"); -- C_E, can't change the
- -- value of the discriminant.
-
- Avoid_Optimization_and_Fail (TObj_ByFunc, "Subtest 4");
-
- exception
- when Constraint_Error => null; -- Exception is expected.
- when others =>
- Report.Failed ("Unexpected exception - Subtest 4");
- end;
-
- end TagObj_Block;
-
-
- ArrObj_Block:
- declare
- Arr_Const : constant Array_Type
- := (9, 7, 6, 8);
- Arr_ByAgg : Array_Type -- Initial assignment is
- := (10, 11, 12); -- aggregate.
- Arr_ByFunc : Array_Type -- Initial assignment is
- := Array_Value; -- function return value.
- Arr_ByObj : Array_Type -- Initial assignment is
- := Arr_ByAgg; -- object.
-
- Arr_Obj : array (Positive range <>) of Integer
- := (1, 2, 3, 4, 5);
- begin
-
- begin
- if (Arr_Const'First /= 1) or (Arr_Const'Last /= 4) then
- Report.Failed ("Wrong bounds for Arr_Const");
- end if;
-
- if (Arr_ByAgg'First /= 1) or (Arr_ByAgg'Last /= 3) then
- Report.Failed ("Wrong bounds for Arr_ByAgg");
- end if;
-
- if (Arr_ByFunc'First /= 1) or (Arr_ByFunc'Last /= 2) then
- Report.Failed ("Wrong bounds for Arr_ByFunc");
- end if;
-
- if (Arr_ByObj'First /= 1) or (Arr_ByObj'Last /= 3) then
- Report.Failed ("Wrong bounds for Arr_ByObj");
- end if;
-
- Assign_Array (Arr_ByObj); -- C_E, Arr_ByObj bounds are
- -- 1..3.
-
- Report.Failed ("Constraint_Error not raised - Subtest 5");
-
- exception
- when Constraint_Error => null; -- Exception is expected.
- when others =>
- Report.Failed ("Unexpected exception - Subtest 5");
- end;
-
-
- begin
- if (Arr_Obj'First /= 1) or (Arr_Obj'Last /= 5) then
- Report.Failed ("Wrong bounds for Arr_Obj");
- end if;
-
- for I in 0 .. 5 loop
- Arr_Obj (I + 1) := I + 5; -- C_E, Arr_Obj bounds are
- end loop; -- 1..5.
-
- Report.Failed ("Constraint_Error not raised - Subtest 6");
-
- exception
- when Constraint_Error => null; -- Exception is expected.
- when others =>
- Report.Failed ("Unexpected exception - Subtest 6");
- end;
-
- end ArrObj_Block;
-
-
- GenericObj_Block:
- declare
- type Rec (Disc : Small_Num) is
- record
- S : Small_Num := Disc;
- end record;
-
- Rec_Obj : Rec := (2, 2);
- package IGen is new Gen (Rec, Rec_Obj);
-
- begin
- IGen.Gen_Obj := (3, 3); -- C_E, can't change the
- -- value of the discriminant.
-
- Report.Failed ("Constraint_Error not raised - Subtest 7");
-
- -- Next line prevents dead assignment.
- Report.Comment ("Disc is" & Integer'Image (IGen.Gen_Obj.Disc));
-
- exception
- when Constraint_Error => null; -- Exception is expected.
- when others =>
- Report.Failed ("Unexpected exception - Subtest 7");
-
- end GenericObj_Block;
-
- Report.Result;
-
-end C330002;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c332001.a b/gcc/testsuite/ada/acats/tests/c3/c332001.a
deleted file mode 100644
index 21d65737304..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c332001.a
+++ /dev/null
@@ -1,226 +0,0 @@
--- C332001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the static expression given for a number declaration may be
--- of any numeric type. Check that the type of a named number is
--- universal_integer or universal_real regardless of the type of the
--- static expression that provides its value.
---
--- TEST DESCRIPTION:
--- This test defines a large cross section of mixed type named numbers.
--- Well, obviously the named numbers don't have types (other than
--- universal_integer and universal_real) associated with them.
--- This test uses typed static values in the definition of several named
--- numbers, and then mixes the named numbers to ensure that their typed
--- origins do not interfere with the use of their values.
---
---
--- CHANGE HISTORY:
--- 10 OCT 95 SAIC Initial version
--- 11 APR 96 SAIC Fixed a few arithmetic errors for 2.1
--- 24 NOV 98 RLB Removed decimal types to insure that this
--- test is applicable to all implementations.
---
---!
-
------------------------------------------------------------------ C332001_0
-
-package C332001_0 is
-
- type Enumeration_Type is ( Ah, Gnome, Er, Ay, Shun );
-
- type Integer_Type is range 0..1023;
-
- type Modular_Type is mod 256;
-
- type Floating_Type is digits 4;
-
- type Fixed_Type is delta 0.125 range -10.0 .. 10.0;
-
- type Mod_Array is array(Modular_Type) of Floating_Type;
-
- type Int_Array is array(Integer_Type) of Fixed_Type;
-
- type Record_Type is record
- Pinkie : Integer_Type;
- Ring : Modular_Type;
- Middle : Floating_Type;
- Index : Fixed_Type;
- end record;
-
- Mod_Array_Object : Mod_Array;
- Int_Array_Object : Int_Array;
-
- Record_Object : Record_Type;
-
- -- numeric_literals
-
- Nothing_New_Integer : constant := 1;
- Nothing_New_Real : constant := 1.0;
-
- -- static constants
-
- Integ : constant Integer_Type := 2;
- Modul : constant Modular_Type := 2;
- Float : constant Floating_Type := 2.0; -- bad practice, good test
- Fixed : constant Fixed_Type := 2.0;
-
- Named_Integer : constant := Integ; -- 2
- Named_Modular : constant := Modul; -- 2
- Named_Float : constant := Float; -- 2.0
- Named_Fixed : constant := Fixed; -- 2.0
-
- -- function calls
- -- parenthetical expressions
-
- Fn_Integer : constant := Integer_Type'Min(Integ * 2, 8); -- 4
- Fn_Modular : constant := Modular_Type'Max(Modul + 2, Modular_Type'First);--4
- Fn_Float : constant := (Float ** 2); -- 4.0
- Fn_Fixed : constant := - Fixed; -- -2.0
- -- attributes
-
- ITF : constant := Integer_Type'First; -- 0
- MTL : constant := Modular_Type'Last; -- 255
- MTM : constant := Modular_Type'Modulus; -- 256
- ENP : constant := Enumeration_Type'Pos(Ay); -- 3
- MTP : constant := Modular_Type'Pred(Modul); -- 1
- FTS : constant := Fixed_Type'Size; -- # impdef
- ITS : constant := Integer_Type'Succ(Integ); -- 3
-
- -- array attributes 'First, 'Last, 'Length
-
- MAFirst : constant := Mod_Array_Object'First; -- 0
- IALast : constant := Int_Array_Object'Last; -- 1023
- MAL : constant := Mod_Array_Object'Length; -- 255
- IAL : constant := Int_Array_Object'Length; -- 1024
-
- -- type conversions
- --
- -- F\T Int Mod Flt Fix
- -- Int . X O X
- -- Mod O . X O
- -- Flt X O . X
- -- Fix O X O .
-
- Int2Mod : constant := Modular_Type (Integ); -- 2
- Int2Fix : constant := Fixed_Type (Integ); -- 2.0
- Mod2Flt : constant := Floating_Type (Modul); -- 2.0
- Flt2Int : constant := Integer_Type(Float); -- 2
- Flt2Fix : constant := Fixed_Type (Float); -- 2.0
- Fix2Mod : constant := Modular_Type (Fixed); -- 2
-
- procedure Check_Values;
-
- -- TRANSITION CHECKS
- --
- -- The following were illegal in Ada83; they are now legal in Ada95
- --
-
- Int_Base_First : constant := Integer'Base'First; -- # impdef
- Int_First : constant := Integer'First; -- # impdef
- Int_Last : constant := Integer'Last; -- # impdef
- Int_Val : constant := Integer'Val(17); -- 17
-
- -- END OF TRANSITION CHECKS
-
-end C332001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body C332001_0 is
-
- procedure Assert( Truth : Boolean; Message: String ) is
- begin
- if not Truth then
- Report.Failed("Assertion " & Message & " not true" );
- end if;
- end Assert;
-
- procedure Check_Values is
- begin
-
- Assert( Nothing_New_Integer * Named_Integer = Named_Modular,
- "Nothing_New_Integer * Named_Integer = Named_Modular" ); -- 1*2 = 2
- Assert( Nothing_New_Real * Named_Float = Named_Fixed,
- "Nothing_New_Real * Named_Float = Named_Fixed" );-- 1.0*2.0 = 2.0
-
- Assert( Fn_Integer = Int2Mod + Flt2Int,
- "Fn_Integer = Int2Mod + Flt2Int" ); -- 4 = 2+2
- Assert( Fn_Modular = Flt2Int * 2,
- "Fn_Modular = Flt2Int * 2" ); -- 4 = 2*2
- Assert( Fn_Float = Mod2Flt ** Fix2Mod,
- "Fn_Float = Mod2Flt ** Fix2Mod" ); -- 4.0 = 2.0**2
- Assert( Fn_Fixed = (- Mod2Flt),
- "Fn_Fixed = (- Mod2Flt)" ); -- -2.0 = (-2.0)
-
- Assert( ITF = Modular_Type'First,
- "ITF = Modular_Type'First" ); -- 0 = 0
- Assert( MTL < Integer_Type'Last,
- "MTL < Integer_Type'Last" ); -- 255 < 1023
- Assert( MTM < Integer_Type'Last,
- "MTM < Integer_Type'Last" ); -- 256 < 1023
- Assert( ENP > MTP,
- "ENP > MTP" ); -- 3 > 1
- Assert( (FTS < MTL) or (FTS >= MTL), -- given FTS is impdef...
- "(FTS < MTL) or (FTS >= MTL)" ); -- True
- Assert( FTS > ITS,
- "FTS > ITS" ); -- impdef > 3
-
- Assert( MAFirst = Int_Array_Object'First,
- "MAFirst = Int_Array_Object'First" ); -- 0 = 0
- Assert( IALast > MAFirst,
- "IALast > MAFirst" ); -- 1023 > 0
- Assert( MAL < IAL,
- "MAL < IAL" ); -- 255 < 1024
-
- Assert( Mod2Flt = Flt2Fix,
- "Mod2Flt = Flt2Fix" ); -- 2.0 = 2.0
-
- end Check_Values;
-
-end C332001_0;
-
-------------------------------------------------------------------- C332001
-
-with Report;
-with C332001_0;
-procedure C332001 is
-
-begin -- Main test procedure.
-
- Report.Test ("C332001", "Check that the static expression given for a " &
- "number declaration may be of any numeric type. " &
- "Check that the type of the named number is " &
- "universal_integer of universal_real regardless " &
- "of the type of the static expression that " &
- "provides its value" );
-
- C332001_0.Check_Values;
-
- Report.Result;
-
-end C332001;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c340001.a b/gcc/testsuite/ada/acats/tests/c3/c340001.a
deleted file mode 100644
index dce98bdb05b..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c340001.a
+++ /dev/null
@@ -1,470 +0,0 @@
--- C340001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that user-defined equality operators are inherited by a
--- derived type except when the derived type is a nonlimited record
--- extension. In the latter case, ensure that the primitive
--- equality operation of the record extension compares any extended
--- components according to the predefined equality operators of the
--- component types. Also check that the parent portion of the extended
--- type is compared using the user-defined equality operation of the
--- parent type.
---
--- TEST DESCRIPTION:
--- Declares a nonlimited tagged record and a limited tagged record
--- type, each in a separate package. A user-defined "=" operation is
--- defined for each type. Each type is extended with one new record
--- component added.
---
--- Objects are declared for each parent and extended types and are
--- assigned values. For the limited type, modifier operations defined
--- in the package are used to assign values.
---
--- To verify the use of the user-defined "=", values are assigned so
--- that predefined equality will return the opposite result if called.
--- Similarly, values are assigned to the extended type objects so that
--- one comparison will verify that the inherited components from the
--- parent are compared using the user-defined equality operation.
---
--- A second comparison sets the values of the inherited components to
--- be the same so that equality based on the extended component may be
--- verified. For the nonlimited type, the test for equality should
--- fail, as the "=" defined for this type should include testing
--- equality of the extended component. For the limited type, "=" of the
--- parent should be inherited as-is, so the test for equality should
--- succeed even though the records differ in the extended component.
---
--- A third package declares a discriminated tagged record. Equality
--- is user-defined and ignores the discriminant value. A type
--- extension is declared which also contains a discriminant. Since
--- an inherited discriminant may not be referenced other than in a
--- "new" discriminant, the type extension is also discriminated. The
--- discriminant is used as the constraint for the parent type.
---
--- A variant part is declared in the type extension based on the new
--- discriminant. Comparisons are made to confirm that the user-defined
--- equality operator is used to compare values of the type extension.
--- Two record objects are given values so that user-defined equality
--- for the parent portion of the record succeeds, but the variant
--- parts in the type extended object differ. These objects are checked
--- to ensure that they are not equal.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Removed RM references from objective text.
---
---!
-
-with Ada.Calendar;
-package C340001_0 is
-
- type DB_Record is tagged record
- Key : Natural range 1 .. 9999;
- Data : String (1..10);
- end record;
-
- function "=" (L, R : in DB_Record) return Boolean;
-
- type Dated_Record is new DB_Record with record
- Retrieval_Time : Ada.Calendar.Time;
- end record;
-
-end C340001_0;
-
-package body C340001_0 is
-
- function "=" (L, R : in DB_Record) return Boolean is
- -- Key is ignored in determining equality of records
- begin
- return L.Data = R.Data;
- end "=";
-
-end C340001_0;
-
-package C340001_1 is
-
- type List_Contents is array (1..10) of Integer;
- type List is tagged limited record
- Length : Natural range 0..10 := 0;
- Contents : List_Contents := (others => 0);
- end record;
-
- procedure Add_To (L : in out List; New_Value : in Integer);
- procedure Remove_From (L : in out List);
-
- function "=" (L, R : in List) return Boolean;
-
- subtype Revision_Mark is Character range 'A' .. 'Z';
- type Revisable_List is new List with record
- Revision : Revision_Mark := 'A';
- end record;
-
- procedure Revise (L : in out Revisable_List);
-
-end C340001_1;
-
-package body C340001_1 is
-
- -- Note: This is not a complete abstraction of a list. Exceptions
- -- are not defined and boundary checks are not made.
-
- procedure Add_To (L : in out List; New_Value : in Integer) is
- begin
- L.Length := L.Length + 1;
- L.Contents (L.Length) := New_Value;
- end Add_To;
-
- procedure Remove_From (L : in out List) is
- -- The list length is decremented. "Old" values are left in the
- -- array. They are overwritten when a new value is added.
- begin
- L.Length := L.Length - 1;
- end Remove_From;
-
- function "=" (L, R : in List) return Boolean is
- -- Two lists are equal if they are the same length and
- -- the component values within that length are the same.
- -- Values stored past the end of the list are ignored.
- begin
- return L.Length = R.Length
- and then L.Contents (1..L.Length) = R.Contents (1..R.Length);
- end "=";
-
- procedure Revise (L : in out Revisable_List) is
- begin
- L.Revision := Character'Succ (L.Revision);
- end Revise;
-
-end C340001_1;
-
-package C340001_2 is
-
- type Media is (Paper, Electronic);
-
- type Transaction (Medium : Media) is tagged record
- ID : Natural range 1000 .. 9999;
- end record;
-
- function "=" (L, R : in Transaction) return Boolean;
-
- type Authorization (Kind : Media) is new Transaction (Medium => Kind)
- with record
- case Kind is
- when Paper =>
- Signature_On_File : Boolean;
- when Electronic =>
- Paper_Backup : Boolean; -- to retain opposing value
- end case;
- end record;
-
-end C340001_2;
-
-package body C340001_2 is
-
- function "=" (L, R : in Transaction) return Boolean is
- -- There may be electronic and paper copies of the same transaction.
- -- The ID uniquely identifies a transaction. The medium (stored in
- -- the discriminant) is ignored.
- begin
- return L.ID = R.ID;
- end "=";
-
-end C340001_2;
-
-
-with C340001_0; -- nonlimited tagged record declarations
-with C340001_1; -- limited tagged record declarations
-with C340001_2; -- tagged variant declarations
-with Ada.Calendar;
-with Report;
-procedure C340001 is
-
- DB_Rec1 : C340001_0.DB_Record := (Key => 1,
- Data => "aaaaaaaaaa");
- DB_Rec2 : C340001_0.DB_Record := (Key => 55,
- Data => "aaaaaaaaaa");
- -- DB_Rec1 = DB_Rec2 using user-defined equality
- -- DB_Rec1 /= DB_Rec2 using predefined equality
-
- Some_Time : Ada.Calendar.Time :=
- Ada.Calendar.Time_Of (Month => 9, Day => 16, Year => 1993);
-
- Another_Time : Ada.Calendar.Time :=
- Ada.Calendar.Time_Of (Month => 9, Day => 19, Year => 1993);
-
- Dated_Rec1 : C340001_0.Dated_Record := (Key => 2,
- Data => "aaaaaaaaaa",
- Retrieval_Time => Some_Time);
- Dated_Rec2 : C340001_0.Dated_Record := (Key => 77,
- Data => "aaaaaaaaaa",
- Retrieval_Time => Some_Time);
- Dated_Rec3 : C340001_0.Dated_Record := (Key => 77,
- Data => "aaaaaaaaaa",
- Retrieval_Time => Another_Time);
- -- Dated_Rec1 = Dated_Rec2 if DB_Record."=" used for parent portion
- -- Dated_Rec2 /= Dated_Rec3 if extended component is compared
- -- using Ada.Calendar.Time."="
-
- List1 : C340001_1.List;
- List2 : C340001_1.List;
-
- RList1 : C340001_1.Revisable_List;
- RList2 : C340001_1.Revisable_List;
- RList3 : C340001_1.Revisable_List;
-
- Current : C340001_2.Transaction (C340001_2.Paper) :=
- (C340001_2.Paper, 2001);
- Last : C340001_2.Transaction (C340001_2.Electronic) :=
- (C340001_2.Electronic, 2001);
- -- Current = Last using user-defined equality
- -- Current /= Last using predefined equality
-
- Approval1 : C340001_2.Authorization (C340001_2.Paper)
- := (Kind => C340001_2.Paper,
- ID => 1040,
- Signature_On_File => True);
- Approval2 : C340001_2.Authorization (C340001_2.Paper)
- := (Kind => C340001_2.Paper,
- ID => 2167,
- Signature_On_File => False);
- Approval3 : C340001_2.Authorization (C340001_2.Electronic)
- := (Kind => C340001_2.Electronic,
- ID => 2167,
- Paper_Backup => False);
- -- Approval1 /= Approval2 if user-defined equality extended with
- -- component equality.
- -- Approval2 /= Approval3 if differing variant parts checked
-
- -- Direct visibility to operator symbols
- use type C340001_0.DB_Record;
- use type C340001_0.Dated_Record;
-
- use type C340001_1.List;
- use type C340001_1.Revisable_List;
-
- use type C340001_2.Transaction;
- use type C340001_2.Authorization;
-
-begin
-
- Report.Test ("C340001", "Inheritance of user-defined ""=""");
-
- -- Approval1 /= Approval2 if user-defined equality extended with
- -- component equality.
- -- Approval2 /= Approval3 if differing variant parts checked
-
- ---------------------------------------------------------------------
- -- Check that "=" and "/=" for the parent type call the user-defined
- -- operation
- ---------------------------------------------------------------------
-
- if not (DB_Rec1 = DB_Rec2) then
- Report.Failed ("Nonlimited tagged record: " &
- "User-defined equality did not override predefined " &
- "equality");
- end if;
-
- if DB_Rec1 /= DB_Rec2 then
- Report.Failed ("Nonlimited tagged record: " &
- "User-defined equality did not override predefined " &
- "inequality as well");
- end if;
-
- ---------------------------------------------------------------------
- -- Check that "=" and "/=" for the type extension use the user-defined
- -- equality operations from the parent to compare the inherited
- -- components
- ---------------------------------------------------------------------
-
- if not (Dated_Rec1 = Dated_Rec2) then
- Report.Failed ("Nonlimited tagged record: " &
- "User-defined equality was not used to compare " &
- "components inherited from parent");
- end if;
-
- if Dated_Rec1 /= Dated_Rec2 then
- Report.Failed ("Nonlimited tagged record: " &
- "User-defined inequality was not used to compare " &
- "components inherited from parent");
- end if;
-
- ---------------------------------------------------------------------
- -- Check that equality and inequality for the type extension incorporate
- -- the predefined equality operators for the extended component type
- ---------------------------------------------------------------------
- if Dated_Rec2 = Dated_Rec3 then
- Report.Failed ("Nonlimited tagged record: " &
- "Record equality was not extended with component " &
- "equality");
- end if;
-
- if not (Dated_Rec2 /= Dated_Rec3) then
- Report.Failed ("Nonlimited tagged record: " &
- "Record inequality was not extended with component " &
- "equality");
- end if;
-
- ---------------------------------------------------------------------
- C340001_1.Add_To (List1, 1);
- C340001_1.Add_To (List1, 2);
- C340001_1.Add_To (List1, 3);
- C340001_1.Remove_From (List1);
-
- C340001_1.Add_To (List2, 1);
- C340001_1.Add_To (List2, 2);
-
- -- List1 contents are (2, (1, 2, 3, 0, 0, 0, 0, 0, 0, 0))
- -- List2 contents are (2, (1, 2, 0, 0, 0, 0, 0, 0, 0, 0))
-
- -- List1 = List2 using user-defined equality
- -- List1 /= List2 using predefined equality
-
- ---------------------------------------------------------------------
- -- Check that "=" and "/=" for the parent type call the user-defined
- -- operation
- ---------------------------------------------------------------------
- if not (List1 = List2) then
- Report.Failed ("Limited tagged record : " &
- "User-defined equality incorrectly implemented " );
- end if;
-
- if List1 /= List2 then
- Report.Failed ("Limited tagged record : " &
- "User-defined equality incorrectly implemented " );
- end if;
-
- ---------------------------------------------------------------------
- -- RList1 and RList2 are made equal but "different" by adding
- -- a nonzero value to RList1 then removing it. Removal updates
- -- the list Length only, not its contents. The two lists will be
- -- equal according to the defined list abstraction, but the records
- -- will contain differing component values.
-
- C340001_1.Add_To (RList1, 1);
- C340001_1.Add_To (RList1, 2);
- C340001_1.Add_To (RList1, 3);
- C340001_1.Remove_From (RList1);
-
- C340001_1.Add_To (RList2, 1);
- C340001_1.Add_To (RList2, 2);
-
- C340001_1.Add_To (RList3, 1);
- C340001_1.Add_To (RList3, 2);
-
- C340001_1.Revise (RList3);
-
- -- RList1 contents are (2, (1, 2, 3, 0, 0, 0, 0, 0, 0, 0), 'A')
- -- RList2 contents are (2, (1, 2, 0, 0, 0, 0, 0, 0, 0, 0), 'A')
- -- RList3 contents are (2, (1, 2, 0, 0, 0, 0, 0, 0, 0, 0), 'B')
-
- -- RList1 = RList2 if List."=" inherited
- -- RList2 /= RList3 if List."=" inherited and extended with Character "="
-
- ---------------------------------------------------------------------
- -- Check that "=" and "/=" are the user-defined operations inherited
- -- from the parent type.
- ---------------------------------------------------------------------
- if not (RList1 = RList2) then
- Report.Failed ("Limited tagged record : " &
- "User-defined equality was not inherited");
- end if;
-
- if RList1 /= RList2 then
- Report.Failed ("Limited tagged record : " &
- "User-defined inequality was not inherited");
- end if;
- ---------------------------------------------------------------------
- -- Check that "=" and "/=" for the type extension are NOT extended
- -- with the predefined equality operators for the extended component.
- -- A limited type extension should inherit the parent equality operation
- -- as is.
- ---------------------------------------------------------------------
- if not (RList2 = RList3) then
- Report.Failed ("Limited tagged record : " &
- "Inherited equality operation was extended with " &
- "component equality");
- end if;
-
- if RList2 /= RList3 then
- Report.Failed ("Limited tagged record : " &
- "Inherited inequality operation was extended with " &
- "component equality");
- end if;
-
- ---------------------------------------------------------------------
- -- Check that "=" and "/=" for the parent type call the user-defined
- -- operation
- ---------------------------------------------------------------------
- if not (Current = Last) then
- Report.Failed ("Variant record : " &
- "User-defined equality did not override predefined " &
- "equality");
- end if;
-
- if Current /= Last then
- Report.Failed ("Variant record : " &
- "User-defined inequality did not override predefined " &
- "inequality");
- end if;
-
- ---------------------------------------------------------------------
- -- Check that user-defined equality was incorporated and extended
- -- with equality of extended components.
- ---------------------------------------------------------------------
- if not (Approval1 /= Approval2) then
- Report.Failed ("Variant record : " &
- "Inequality was not extended with component " &
- "inequality");
- end if;
-
- if Approval1 = Approval2 then
- Report.Failed ("Variant record : " &
- "Equality was not extended with component " &
- "equality");
- end if;
-
- ---------------------------------------------------------------------
- -- Check that equality and inequality for the type extension
- -- succeed despite the presence of differing variant parts.
- ---------------------------------------------------------------------
- if Approval2 = Approval3 then
- Report.Failed ("Variant record : " &
- "Equality succeeded even though variant parts " &
- "in type extension differ");
- end if;
-
- if not (Approval2 /= Approval3) then
- Report.Failed ("Variant record : " &
- "Inequality failed even though variant parts " &
- "in type extension differ");
- end if;
-
- ---------------------------------------------------------------------
- Report.Result;
- ---------------------------------------------------------------------
-
-end C340001;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c340a01.a b/gcc/testsuite/ada/acats/tests/c3/c340a01.a
deleted file mode 100644
index 108a30b5ff6..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c340a01.a
+++ /dev/null
@@ -1,165 +0,0 @@
--- C340A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a tagged type declared in a package specification
--- may be passed as a generic formal (tagged) private type to a generic
--- package declaration. Check that the formal type may be extended with
--- a record extension in the generic package.
---
--- Check that, in the instance, the record extension inherits the
--- user-defined primitive subprograms of the tagged actual.
---
--- TEST DESCRIPTION:
--- Declare a tagged type and an associated primitive subprogram in a
--- package specification (foundation code). Declare a generic package
--- which takes a tagged type as a formal parameter, and then extends
--- it with a record extension (foundation code).
---
--- Instantiate the generic package with the tagged type from the first
--- package (the "generic" extension should now have inherited
--- the primitive subprogram of the tagged type from the first
--- package).
---
--- In the main program, call the primitive subprogram inherited by the
--- "generic" extension, and verify the correctness of the components.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- F340A000.A
--- F340A001.A
--- => C340A01.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 12 Jun 96 SAIC ACVC 2.1: Modified prologue. Removed extraneous
--- comments.
---
---!
-
-with F340A001; -- Book definitions.
-package C340A01_0 is -- Raw data to be used in creating book elements.
-
-
- Book_Count : constant := 3;
-
- subtype Number_Of_Books is Integer range 1 .. Book_Count;
-
- type Data_List is array (Number_Of_Books) of F340A001.Text_Ptr;
-
- Title_List : Data_List := (new String'("Wuthering Heights"),
- new String'("Heart of Darkness"),
- new String'("Ulysses"));
-
- Author_List : Data_List := (new String'("Bronte, Emily"),
- new String'("Conrad, Joseph"),
- new String'("Joyce, James"));
-
-end C340A01_0;
-
-
- --==================================================================--
-
-
--- Library-level instantiation. Actual parameter is tagged record.
-
-with F340A001; -- Book definitions.
-with F340A000; -- Singly-linked list abstraction.
-package C340A01_1 is new F340A000 (Parent_Type => F340A001.Book_Type);
-
-
- --==================================================================--
-
-
-with Report;
-
-with F340A001; -- Book definitions.
-with C340A01_0; -- Raw book data.
-with C340A01_1; -- Instance.
-
-use F340A001; -- Primitive operations of Book_Type directly visible.
-use C340A01_1; -- Operations inherited by Node_Type directly visible.
-
-procedure C340A01 is
-
-
- List_Of_Books : Node_Ptr := null; -- Head of linked list of books.
-
-
- --========================================================--
-
-
- procedure Create_List (Title, Author : in C340A01_0.Data_List;
- Head : in out Node_Ptr) is
-
- Book : Node_Type; -- Object of extended type.
- Book_Ptr : Node_Ptr;
-
- begin
- for I in C340A01_0.Number_Of_Books loop
- Create_Book (Title (I), Author (I), Book); -- Call inherited
- -- operation.
- Book_Ptr := new Node_Type'(Book);
- Add (Book_Ptr, Head);
- end loop;
- end Create_List;
-
-
- --========================================================--
-
-
- function Bad_List_Contents return Boolean is
- begin
- return (List_Of_Books.Title.all /= "Ulysses" or
- List_Of_Books.Author.all /= "Joyce, James" or
- List_Of_Books.Next.Title.all /= "Heart of Darkness" or
- List_Of_Books.Next.Author.all /= "Conrad, Joseph" or
- List_Of_Books.Next.Next.Title.all /= "Wuthering Heights" or
- List_Of_Books.Next.Next.Author.all /= "Bronte, Emily");
- end Bad_List_Contents;
-
-
- --========================================================--
-
-
-begin -- Main program.
-
- Report.Test ("C340A01", "Inheritance of primitive operations: record " &
- "extension of formal tagged private type; actual is " &
- "an ultimate ancestor type");
-
- -- Create linked list using inherited operation:
- Create_List (C340A01_0.Title_List, C340A01_0.Author_List, List_Of_Books);
-
- -- Verify results:
- if Bad_List_Contents then
- Report.Failed ("Wrong values after call to inherited operation");
- end if;
-
- Report.Result;
-
-end C340A01;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c340a02.a b/gcc/testsuite/ada/acats/tests/c3/c340a02.a
deleted file mode 100644
index 2dd8f175c09..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c340a02.a
+++ /dev/null
@@ -1,221 +0,0 @@
--- C340A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a record extension (declared in a package specification) of
--- a tagged type (declared in a different package specification) may be
--- passed as a generic formal (tagged) private type to a generic package
--- declaration. Check that the formal type may be further extended with a
--- record extension in the generic package.
---
--- Check that, in the instance, the record extension inherits the
--- user-defined primitive subprograms of the tagged actual, including
--- those inherited by the actual from its parent.
---
--- TEST DESCRIPTION:
--- Declare a tagged type and an associated primitive subprogram in a
--- package specification (foundation code). Declare a record extension
--- of the tagged type and an associated primitive subprogram in a second
--- package specification. Declare a generic package which takes a tagged
--- type as a formal parameter, and then extends it with a record
--- extension (foundation code).
---
--- Instantiate the generic package with the record extension from the
--- second package (the "generic" extension should now have inherited
--- the primitive subprograms of the record extension from the second
--- package).
---
--- In the main program, call the primitive subprograms inherited by the
--- "generic" extension. There are two: (1) Create_Book, declared for
--- the root tagged type in the first package (inherited by the record
--- extension of the second package, and then in turn by the "generic"
--- extension), and (2) Update_Pages, declared for the record extension
--- in the second package. Verify the correctness of the components.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- F340A000.A
--- F340A001.A
--- => C340A02.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 12 Jun 96 SAIC ACVC 2.1: Modified prologue. Removed extraneous
--- comments.
---
---!
-
-with F340A001; -- Book definitions.
-package C340A02_0 is -- Extended book abstraction.
-
-
- type Detailed_Book_Type is new F340A001.Book_Type with record
- Pages : Natural; -- Record ext.
- end record; -- of root tagged
- -- type.
-
- -- Inherits Create_Book from Book_Type.
-
- procedure Update_Pages (Book : in out Detailed_Book_Type; -- Primitive op.
- Pages : in Natural); -- of extension.
-
-
-end C340A02_0;
-
-
- --==================================================================--
-
-
-package body C340A02_0 is
-
-
- procedure Update_Pages (Book : in out Detailed_Book_Type;
- Pages : in Natural) is
- begin
- Book.Pages := Pages;
- end Update_Pages;
-
-
-end C340A02_0;
-
-
- --==================================================================--
-
-
-with F340A001; -- Book definitions.
-package C340A02_1 is -- Raw data to be used in creating book elements.
-
-
- Book_Count : constant := 3;
-
- subtype Number_Of_Books is Integer range 1 .. Book_Count;
-
- type Data_List is array (Number_Of_Books) of F340A001.Text_Ptr;
- type Page_Counts is array (Number_Of_Books) of Natural;
-
- Title_List : Data_List := (new String'("Wuthering Heights"),
- new String'("Heart of Darkness"),
- new String'("Ulysses"));
-
- Author_List : Data_List := (new String'("Bronte, Emily"),
- new String'("Conrad, Joseph"),
- new String'("Joyce, James"));
-
- Page_List : Page_Counts := (237, 215, 456);
-
-end C340A02_1;
-
-
- --==================================================================--
-
-
--- Library-level instantiation. Actual parameter is record extension.
-
-with C340A02_0; -- Extended book abstraction.
-with F340A000; -- Singly-linked list abstraction.
-package C340A02_2 is new F340A000
- (Parent_Type => C340A02_0.Detailed_Book_Type);
-
-
- --==================================================================--
-
-
-with Report;
-
-with C340A02_0; -- Extended book abstraction.
-with C340A02_1; -- Raw book data.
-with C340A02_2; -- Instance.
-
-use C340A02_0; -- Primitive operations of Detailed_Book_Type directly visible.
-use C340A02_2; -- Operations inherited by Node_Type directly visible.
-
-procedure C340A02 is
-
-
- List_Of_Books : Node_Ptr := null; -- Head of linked list of books.
-
-
- --========================================================--
-
-
- procedure Create_List (Title, Author : in C340A02_1.Data_List;
- Pages : in C340A02_1.Page_Counts;
- Head : in out Node_Ptr) is
-
- Book : Node_Type; -- Object of extended type.
- Book_Ptr : Node_Ptr;
-
- begin
- for I in C340A02_1.Number_Of_Books loop
- Create_Book (Title (I), Author (I), Book); -- Call twice-inherited
- -- operation.
- Update_Pages (Book, Pages (I)); -- Call inherited op.
- Book_Ptr := new Node_Type'(Book);
- Add (Book_Ptr, Head);
- end loop;
- end Create_List;
-
-
- --========================================================--
-
-
- function Bad_List_Contents return Boolean is
- begin
- return (List_Of_Books.Title.all /= "Ulysses" or
- List_Of_Books.Author.all /= "Joyce, James" or
- List_Of_Books.Pages /= 456 or
- List_Of_Books.Next.Title.all /= "Heart of Darkness" or
- List_Of_Books.Next.Author.all /= "Conrad, Joseph" or
- List_Of_Books.Next.Pages /= 215 or
- List_Of_Books.Next.Next.Title.all /= "Wuthering Heights" or
- List_Of_Books.Next.Next.Author.all /= "Bronte, Emily" or
- List_Of_Books.Next.Next.Pages /= 237);
-
- end Bad_List_Contents;
-
-
- --========================================================--
-
-
-begin -- Main program.
-
- Report.Test ("C340A02", "Inheritance of primitive operations: record " &
- "extension of formal tagged private type; actual is " &
- "a record extension");
-
- -- Create linked list using inherited operation:
- Create_List (C340A02_1.Title_List, C340A02_1.Author_List,
- C340A02_1.Page_List, List_Of_Books);
-
- -- Verify results:
- if Bad_List_Contents then
- Report.Failed ("Wrong values after call to inherited operations");
- end if;
-
- Report.Result;
-
-end C340A02;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c341a01.a b/gcc/testsuite/ada/acats/tests/c3/c341a01.a
deleted file mode 100644
index 34a1eeeaac6..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c341a01.a
+++ /dev/null
@@ -1,117 +0,0 @@
--- C341A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that formal parameters of a class-wide type can be passed
--- values of any specific type within the class.
---
--- TEST DESCRIPTION:
--- Define an object of a root tagged type and of various types derived
--- from the root. Define objects of the root class, and initialize them
--- by parameter association of objects of the specific types (root and
--- extended types) within the class.
---
--- The particular root and extended types used in this abstraction are
--- defined in foundation code (F341A00.A), and are graphically displayed
--- as follows:
---
--- package Bank
--- type Account
--- |
--- |
--- |
--- package Checking
--- type Account
--- |
--- |
--- |
--- package Interest_Checking
--- type Account
---
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- F341A00.A
---
--- The following files comprise this test:
---
--- => C341A01.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with F341A00_0; -- package Bank
-with F341A00_1; -- package Checking
-with F341A00_2; -- package Interest_Checking
-with Report;
-
-procedure C341A01 is
-
- package Bank renames F341A00_0;
- use type Bank.Dollar_Amount;
- package Checking renames F341A00_1;
- package Interest_Checking renames F341A00_2;
-
- Max_Accts : constant := 3;
- Bank_Balance : Bank.Dollar_Amount := 0.00;
-
- -- Initialize objects of specific tagged types.
- B_Acct : Bank.Account := (Current_Balance => 10.00);
- C_Acct : Checking.Account := (100.00, 10.00);
- IC_Acct : Interest_Checking.Account := (1000.00, 10.00, 0.030);
-
- -- Define and initialize (by parameter association) objects of class-wide
- -- type originating from the root type (Bank.Account).
-
- -- Define an account auditing procedure with a class-wide
- -- variable that can hold a value of any object within the class.
- procedure Audit (Next_Account : Bank.Account'Class) is
- begin
- Bank_Balance := Bank_Balance + Next_Account.Current_Balance;
- end Audit;
-
-
-begin -- C341A01
-
- Report.Test ("C341A01", "Check that objects of a class-wide type can " &
- "be initialized, by direct assignment, to a " &
- "value of any specific type within the class" );
-
- -- Perform nightly audit of total funds on deposit in bank.
- Audit (B_Acct);
- Audit (C_Acct);
- Audit (IC_Acct);
-
- if Bank_Balance /= 1110.00 then
- Report.Failed ("Class-wide object processing failed");
- end if;
-
- Report.Result;
-
-end C341A01;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c341a02.a b/gcc/testsuite/ada/acats/tests/c3/c341a02.a
deleted file mode 100644
index 4fa9842bf60..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c341a02.a
+++ /dev/null
@@ -1,145 +0,0 @@
--- C341A02.A
- --
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
- --
- -- OBJECTIVE:
- -- Check that class-wide objects can be reassigned with objects from
- -- the same specific type used to initialize them.
- --
- -- TEST DESCRIPTION:
- -- Define new objects of specific types from within a class. Reassign
- -- previously declared class-wide objects with the new specific type
- -- objects. Check that new assignments were performed.
- --
- -- The particular root and extended types used in this abstraction are
- -- defined in foundation code (F341A00.A), and are graphically displayed
- -- as follows:
- --
- -- package Bank
- -- type Account
- -- |
- -- |
- -- |
- -- package Checking
- -- type Account
- -- |
- -- |
- -- |
- -- package Interest_Checking
- -- type Account
- --
- -- TEST FILES:
- -- This test depends on the following foundation code:
- --
- -- F341A00.A
- --
- -- The following files comprise this test:
- --
- -- => C341A02.A
- --
- --
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
- --!
-
- with F341A00_0; -- package Bank
- with F341A00_1; -- package Checking
- with F341A00_2; -- package Interest_Checking
- with Report;
-
- procedure C341A02 is
-
- package Bank renames F341A00_0;
- package Checking renames F341A00_1;
- package Interest_Checking renames F341A00_2;
-
- Max_Accts : constant := 3;
- Bank_Balance : Bank.Dollar_Amount := 0.00;
-
- -- Define and initialize objects of specific types.
- B_Acct : aliased Bank.Account := (Current_Balance => 10.00);
- C_Acct : aliased Checking.Account := (100.00, 10.00);
- IC_Acct : aliased Interest_Checking.Account := (1000.00, 10.00, 0.030);
- New_B_Acct : aliased Bank.Account := (Current_Balance => 20.00);
- New_C_Acct : aliased Checking.Account := (200.00, 20.00);
- New_IC_Acct : aliased Interest_Checking.Account := (2000.00, 20.00, 0.060);
-
-
- -- Define and initialize (by direct assignment) objects of a class-wide
- -- type originating from the root type (Bank.Account).
-
- type ATM_Card is access all Bank.Account'Class;
-
- Accounts : array (1 .. Max_Accts) of ATM_Card :=
- (1 => B_Acct'Access, 2 => C_Acct'Access, 3 => IC_Acct'Access);
-
- New_Accounts : array (1 .. Max_Accts) of ATM_Card :=
- (1 => New_B_Acct'Access,
- 2 => New_C_Acct'Access,
- 3 => New_IC_Acct'Access);
-
- -- Define an account auditing procedure with a class-wide
- -- variable that can hold a value of any object within the class,
- -- and once initialized, can hold other values of the same specific type.
-
- procedure Audit (Num : in integer;
- Amt : out Bank.Dollar_Amount) is
- Account_Being_Audited : Bank.Account'Class := Accounts(Num).all;
- use type Bank.Dollar_Amount;
- begin
- Amt := Account_Being_Audited.Current_Balance;
- -- Reassign class-wide variable to another object of the type used to
- -- initialize it.
- Account_Being_Audited := New_Accounts(Num).all;
- Amt := Amt + Account_Being_Audited.Current_Balance; -- Reading OUT
- end Audit; -- parameter.
-
-
- begin
-
- Report.Test ("C341A02", "Check that class-wide objects can be " &
- "reassigned with objects from the same " &
- "specific type used to initialize them" );
- Night_Audit:
- declare
- use type Bank.Dollar_Amount;
- Acct_Value : Bank.Dollar_Amount := 0.00;
- begin
- -- Perform nightly audit of total funds on deposit in bank.
- for i in 1 .. Max_Accts loop
- Audit (i, Acct_Value);
- Bank_Balance := Bank_Balance + Acct_Value;
- end loop;
-
- if Bank_Balance /= 3330.00 then
- Report.Failed ("Class-wide object processing failed");
- end if;
-
- end Night_Audit;
-
- Report.Result;
-
- end C341A02;
-
diff --git a/gcc/testsuite/ada/acats/tests/c3/c341a03.a b/gcc/testsuite/ada/acats/tests/c3/c341a03.a
deleted file mode 100644
index 0911e636d57..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c341a03.a
+++ /dev/null
@@ -1,140 +0,0 @@
--- C341A03.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an object of one class-wide type can initialize a
--- class-wide object of a different type when the operation is embedded
--- in a generic unit.
---
--- TEST DESCRIPTION:
--- Declare specific-type objects of an extended type. Declare an array
--- of access values designating class-wide objects, initialized to point
--- to the objects of the specific type. Define a generic subprogram
--- having a generic formal derived type parameter. Within the generic,
--- declare a class-wide variable of the formal parameter type. Verify
--- that the variable can be initialized with the value of an object
--- of another class-wide type within the class.
---
--- The particular root and extended types used in this abstraction are
--- defined in foundation code (F341A00.A), and are graphically displayed
--- as follows:
---
--- package Bank
--- type Account
--- |
--- |
--- |
--- package Checking
--- type Account
--- |
--- |
--- |
--- package Interest_Checking
--- type Account
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- F341A00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 16 Dec 94 SAIC Changed level of 'Class for ATM_Card
---
---!
-
-with F341A00_0; -- package Bank
-generic
- type Account_Type is new F341A00_0.Account with private; -- new Bank.Account
-function C341A03_0 (The_Account : Account_Type'Class) -- function Audit
- return F341A00_0.Dollar_Amount;
-
-function C341A03_0 (The_Account : Account_Type'Class)
- return F341A00_0.Dollar_Amount is
- Acct : Account_Type'Class := The_Account; -- Init. of class-wide with
-begin -- another class-wide object.
- return Acct.Current_Balance;
-end C341A03_0;
-
-
- --=================================================================--
-
-
-with F341A00_0; -- package Bank
-with F341A00_1; -- package Checking
-with C341A03_0; -- generic function Audit
-with Report;
-
-procedure C341A03 is
-
- package Bank renames F341A00_0;
- package Checking renames F341A00_1;
-
- Current_Checking_Accounts : constant := 3;
-
- Checking_Acct1 : aliased Checking.Account := (Current_Balance => 10.00,
- Overdraft_Fee => 5.00);
- Checking_Acct2 : aliased Checking.Account := (Current_Balance => 20.00,
- Overdraft_Fee => 5.00);
- Checking_Acct3 : aliased Checking.Account := (Current_Balance => 30.00,
- Overdraft_Fee => 5.00);
-
- type ATM_Card is access all Checking.Account'Class;
-
- -- Declare array of accesses to class-wide objects.
- Account_Array : array (1 .. Current_Checking_Accounts) of
- ATM_Card := (Checking_Acct1'Access,
- Checking_Acct2'Access,
- Checking_Acct3'Access);
-begin -- C341A03
-
- Report.Test ("C341A03", "Check that an object of one class-wide type " &
- "can initialize a class-wide object of a " &
- "different type when the operation is embedded " &
- "in a generic unit" );
-
- Audit_Checking_Accounts:
- declare
- Balance_In_Checking_Accounts : Bank.Dollar_Amount := 0.00;
- -- Instantiate with a specific extended type.
- function Checking_Audit is new C341A03_0 (Checking.Account);
- use type Bank.Dollar_Amount;
- begin
-
- for I in 1 .. Current_Checking_Accounts loop
- Balance_In_Checking_Accounts := Balance_In_Checking_Accounts +
- Checking_Audit (Account_Array (I).all);
- end loop;
-
- if Balance_In_Checking_Accounts /= 60.00 then
- Report.Failed ("Incorrect initialization of class-wide object");
- end if;
-
- end Audit_Checking_Accounts;
-
- Report.Result;
-
-end C341A03;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c341a04.a b/gcc/testsuite/ada/acats/tests/c3/c341a04.a
deleted file mode 100644
index d7392568e48..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c341a04.a
+++ /dev/null
@@ -1,141 +0,0 @@
--- C341A04.A
- --
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
- --
- -- OBJECTIVE:
- -- Check that class-wide objects can be initialized using allocation.
- --
- -- TEST DESCRIPTION:
- -- Declare access types that refer to class-wide types, one with basis
- -- of the root type, another with basis of a type extended from the root.
- -- Declare objects of these access types, and allocate class-wide
- -- objects, initialized to values of specific types within the particular
- -- classes.
- --
- -- The particular root and extended types used in this abstraction are
- -- defined in foundation code (F341A00.A), and are graphically displayed
- -- as follows:
- --
- -- package Bank
- -- type Account
- -- |
- -- |
- -- |
- -- package Checking
- -- type Account
- -- |
- -- |
- -- |
- -- package Interest_Checking
- -- type Account
- --
- -- TEST FILES:
- -- This test depends on the following foundation code:
- --
- -- F341A00.A
- --
- -- The following files comprise this test:
- --
- -- => C341A04.A
- --
- --
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
- --!
-
- with F341A00_0; -- package Bank
- with F341A00_1; -- package Checking
- with F341A00_2; -- package Interest_Checking
- with Report;
-
- procedure C341A04 is
-
- package Bank renames F341A00_0;
- package Checking renames F341A00_1;
- package Interest_Checking renames F341A00_2;
-
- use type Bank.Dollar_Amount;
-
- Max_Accts : constant := 3;
- Bank_Balance : Bank.Dollar_Amount := 0.00;
-
- -- Define access types referring to class of types rooted at
- -- Bank.Account (root).
-
- type Bank_Account_Pointer is access Bank.Account'Class;
-
- --
- -- Define class-wide objects, initializing them through allocation.
- --
-
- -- Initialized to specific type that is basis of class.
- Bank_Acct : Bank_Account_Pointer :=
- new Bank.Account'(Current_Balance => 10.00);
-
- -- Initialized to specific type that has been extended from the basis
- -- of the class.
- Checking_Acct : Bank_Account_Pointer :=
- new Checking.Account'(Current_Balance => 100.00,
- Overdraft_Fee => 10.00);
-
- -- Initialized to specific type that has been twice extended from the
- -- basis of the class.
- IC_Acct : Bank_Account_Pointer :=
- new Interest_Checking.Account'(Current_Balance => 1000.00,
- Overdraft_Fee => 10.00,
- Rate => 0.030);
-
- -- Declare and initialize array of pointers to objects of
- -- Bank.Account'Class.
-
- Accounts : array (1 .. Max_Accts) of Bank_Account_Pointer :=
- (Bank_Acct, Checking_Acct, IC_Acct);
-
-
- -- Audit will process any account object within Bank.Account'Class.
-
- function Audit (Ptr : Bank_Account_Pointer) return Bank.Dollar_Amount is
- begin
- return (Ptr.Current_Balance);
- end Audit;
-
-
- begin -- C341A04
-
- Report.Test ("C341A04", "Check that class-wide objects were " &
- "successfully initialized using allocation" );
-
- for i in 1 .. Max_Accts loop
- Bank_Balance := Bank_Balance + Audit (Accounts(i));
- end loop;
-
- if Bank_Balance /= 1110.00 then
- Report.Failed ("Failed class-wide object allocation");
- end if;
-
- Report.Result;
-
- end C341A04;
-
diff --git a/gcc/testsuite/ada/acats/tests/c3/c352001.a b/gcc/testsuite/ada/acats/tests/c3/c352001.a
deleted file mode 100644
index 04b094f1ff3..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c352001.a
+++ /dev/null
@@ -1,270 +0,0 @@
---
--- C352001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the predefined Character type comprises 256 positions.
--- Check that the names of the non-graphic characters are usable with
--- the attributes (Wide_)Image and (Wide_)Value, and that these
--- attributes produce the correct result.
---
--- TEST DESCRIPTION:
--- Build two tables of nongraphic characters from positions of Row 00
--- (0000-001F and 007F-009F) of the ISO 10646 Basic Multilingual Plane.
--- Fill the first table with compiler created strings. Fill the second
--- table with strings defined by the language. Compare the two tables.
--- Check 256 positions of the predefined character type. Use attributes
--- (Wide_)Image and (Wide_)Value to check the values of the non-graphic
--- characters and the last 2 characters.
---
---
--- CHANGE HISTORY:
--- 20 Jun 95 SAIC Initial prerelease version.
--- 27 Jan 96 SAIC Revised for 2.1. Hid values, added "del" case.
---
---!
-
-with Ada.Characters.Handling;
-with Report;
-procedure C352001 is
-
- Lower_Bound : Integer := 0;
- Middle_Bound : Integer := 31;
- Upper_Bound : Integer := 159;
- Half_Bound : Integer := 127;
- Max_Bound : Integer := 255;
-
- type Dyn_String is access String;
- type Value_Result is array (Character) of Dyn_String;
-
- Table_Of_Character : Value_Result;
- TC_Table : Value_Result;
-
- function CVII(K : Natural) return Character is
- begin
- return Character'Val( Report.Ident_Int(K) );
- end CVII;
-
- function "=" (L, R : String) return Boolean is
- UCL : String (L'First .. L'Last);
- UCR : String (R'First .. R'last);
- begin
- UCL := Ada.Characters.Handling.To_Upper (L);
- UCR := Ada.Characters.Handling.To_Upper (R);
- if UCL'Last /= UCR'Last then
- return False;
- else
- for I in UCL'First .. UCR'Last loop
- if UCL (I) /= UCR (I) then
- return False;
- end if;
- end loop;
- return True;
- end if;
- end "=";
-
-begin
-
- Report.Test ("C352001", "Check that, the predefined Character type " &
- "comprises 256 positions. Check that the names of the " &
- "non-graphic characters are usable with the attributes " &
- "(Wide_)Image and (Wide_)Value, and that these attributes " &
- "produce the correct result");
-
- -- Fill table with strings (positions of Row 00 (0000-001F) of the ISO
- -- 10646 Basic Multilingual Plane created by the compiler.
-
- for I in CVII(Lower_Bound) .. CVII(Middle_Bound) loop
- Table_Of_Character (I) := new String'(Character'Image(I));
- end loop;
-
- -- Fill table with strings (positions of Row 00 (007F-009F) of the ISO
- -- 10646 Basic Multilingual Plane created by the compiler.
-
- for I in CVII(Half_Bound) .. CVII(Upper_Bound) loop
- Table_Of_Character (I) := new String'(Character'Image(I));
- end loop;
-
- -- Fill table with strings (positions of Row 00 (0000-001F) of the ISO
- -- 10646 Basic Multilingual Plane defined by the language.
-
- TC_Table (CVII(0)) := new String'("nul");
- TC_Table (CVII(1)) := new String'("soh");
- TC_Table (CVII(2)) := new String'("stx");
- TC_Table (CVII(3)) := new String'("etx");
- TC_Table (CVII(4)) := new String'("eot");
- TC_Table (CVII(5)) := new String'("enq");
- TC_Table (CVII(6)) := new String'("ack");
- TC_Table (CVII(7)) := new String'("bel");
- TC_Table (CVII(8)) := new String'("bs");
- TC_Table (CVII(9)) := new String'("ht");
- TC_Table (CVII(10)) := new String'("lf");
- TC_Table (CVII(11)) := new String'("vt");
- TC_Table (CVII(12)) := new String'("ff");
- TC_Table (CVII(13)) := new String'("cr");
- TC_Table (CVII(14)) := new String'("so");
- TC_Table (CVII(15)) := new String'("si");
- TC_Table (CVII(16)) := new String'("dle");
- TC_Table (CVII(17)) := new String'("dc1");
- TC_Table (CVII(18)) := new String'("dc2");
- TC_Table (CVII(19)) := new String'("dc3");
- TC_Table (CVII(20)) := new String'("dc4");
- TC_Table (CVII(21)) := new String'("nak");
- TC_Table (CVII(22)) := new String'("syn");
- TC_Table (CVII(23)) := new String'("etb");
- TC_Table (CVII(24)) := new String'("can");
- TC_Table (CVII(25)) := new String'("em");
- TC_Table (CVII(26)) := new String'("sub");
- TC_Table (CVII(27)) := new String'("esc");
- TC_Table (CVII(28)) := new String'("fs");
- TC_Table (CVII(29)) := new String'("gs");
- TC_Table (CVII(30)) := new String'("rs");
- TC_Table (CVII(31)) := new String'("us");
- TC_Table (CVII(127)) := new String'("del");
-
- -- Fill table with strings (positions of Row 00 (007F-009F) of the ISO
- -- 10646 Basic Multilingual Plane defined by the language.
-
- TC_Table (CVII(128)) := new String'("reserved_128");
- TC_Table (CVII(129)) := new String'("reserved_129");
- TC_Table (CVII(130)) := new String'("bph");
- TC_Table (CVII(131)) := new String'("nbh");
- TC_Table (CVII(132)) := new String'("reserved_132");
- TC_Table (CVII(133)) := new String'("nel");
- TC_Table (CVII(134)) := new String'("ssa");
- TC_Table (CVII(135)) := new String'("esa");
- TC_Table (CVII(136)) := new String'("hts");
- TC_Table (CVII(137)) := new String'("htj");
- TC_Table (CVII(138)) := new String'("vts");
- TC_Table (CVII(139)) := new String'("pld");
- TC_Table (CVII(140)) := new String'("plu");
- TC_Table (CVII(141)) := new String'("ri");
- TC_Table (CVII(142)) := new String'("ss2");
- TC_Table (CVII(143)) := new String'("ss3");
- TC_Table (CVII(144)) := new String'("dcs");
- TC_Table (CVII(145)) := new String'("pu1");
- TC_Table (CVII(146)) := new String'("pu2");
- TC_Table (CVII(147)) := new String'("sts");
- TC_Table (CVII(148)) := new String'("cch");
- TC_Table (CVII(149)) := new String'("mw");
- TC_Table (CVII(150)) := new String'("spa");
- TC_Table (CVII(151)) := new String'("epa");
- TC_Table (CVII(152)) := new String'("sos");
- TC_Table (CVII(153)) := new String'("reserved_153");
- TC_Table (CVII(154)) := new String'("sci");
- TC_Table (CVII(155)) := new String'("csi");
- TC_Table (CVII(156)) := new String'("st");
- TC_Table (CVII(157)) := new String'("osc");
- TC_Table (CVII(158)) := new String'("pm");
- TC_Table (CVII(159)) := new String'("apc");
-
-
- -- Compare the first half of two tables.
- for I in CVII(Lower_Bound) .. CVII(Middle_Bound) loop
- if TC_Table(I).all /= Table_Of_Character(I).all then
- Report.Failed("Value of character#" & Integer'Image(Character'Pos(I)) &
- " is not the same in the first half of the table");
- end if;
- end loop;
-
-
- -- Compare the second half of two tables.
- for I in CVII(Half_Bound) .. CVII(Upper_Bound) loop
- if TC_Table(I).all /= Table_Of_Character(I).all then
- Report.Failed("Value of character#" & Integer'Image(Character'Pos(I)) &
- " is not the same in the second half of the table");
- end if;
- end loop;
-
-
- -- Check the first character.
- if Character'Image( Character'First ) /= "NUL" then
- Report.Failed("Value of character#" &
- Integer'Image(Character'Pos (Character'First)) &
- " is not NUL");
- end if;
-
-
- -- Check that the names of the non-graphic characters are usable with
- -- Image and Value attributes.
- if Character'Value( Character'Image( CVII(153) )) /=
- CVII( 153 ) then
- Report.Failed ("Value of character#" &
- Integer'Image( Character'Pos(CVII(153)) ) &
- " is not reserved_153");
- end if;
-
-
- for I in CVII(Lower_Bound) .. CVII(Max_Bound) loop
- if Character'Value(
- Report.Ident_Str(
- Character'Image(CVII(Character'Pos(I)))))
- /= CVII( Character'Pos(I)) then
- Report.Failed ("Value of character#" &
- Integer'Image( Character'Pos(I) ) &
- " is not the same as the predefined character type");
- end if;
- end loop;
-
-
- -- Check Wide_Character attributes.
- for I in Wide_Character'Val(Lower_Bound) .. Wide_Character'Val(Max_Bound)
- loop
- if Wide_Character'Wide_Value(
- Report.Ident_Wide_Str(
- Wide_Character'Wide_Image(
- Wide_Character'Val(Wide_Character'Pos(I)))))
- /= Wide_Character'Val(Wide_Character'Pos(I))
- then
- Report.Failed ("Value of the predefined Wide_Character type " &
- "is not correct");
- end if;
- end loop;
-
-
- if Wide_Character'Value( Wide_Character'Image(Wide_Character'Val(132)) )
- /= Wide_Character'Val( Report.Ident_Int(132) ) then
- Report.Failed ("Wide_Character at 132 is not reserved_132");
- end if;
-
-
- if Wide_Character'Image( Wide_Character'First ) /= "NUL" then
- Report.Failed ("Wide_Character'First is not NUL");
- end if;
-
-
- if Wide_Character'Image
- (Wide_Character'Pred (Wide_Character'Last) ) /= "FFFE" then
- Report.Failed ("Wide_Character at 65534 is not FFFE");
- end if;
-
-
- if Wide_Character'Image(Wide_Character'Last) /= "FFFF" then
- Report.Failed ("Wide_Character'Last is not FFFF");
- end if;
-
- Report.Result;
-
-end C352001;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c354002.a b/gcc/testsuite/ada/acats/tests/c3/c354002.a
deleted file mode 100644
index 3129182b704..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c354002.a
+++ /dev/null
@@ -1,335 +0,0 @@
---
--- C354002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the attributes of modular types yield
--- correct values/results. The attributes checked are:
---
--- First, Last, Range, Base, Min, Max, Succ, Pred,
--- Image, Width, Value, Pos, and Val
---
--- TEST DESCRIPTION:
--- This test defines several modular types. One type defined at
--- each of System.Max_Binary_Modulus, System.Max_Nonbinary_Modulus,
--- a power of two half that of System.Max_Binary_Modulus, one less
--- than that power of two; one more than that power of two, two
--- less than a (large) power of two. For each of these types,
--- determine the correct operation of the following attributes:
---
--- First, Last, Range, Base, Min, Max, Succ, Pred, Image, Width,
--- Value, Pos, Val, and Modulus
---
--- The attributes Wide_Image and Wide_Value are deferred to C354003.
---
---
---
--- CHANGE HISTORY:
--- 08 SEP 94 SAIC Initial version
--- 17 NOV 94 SAIC Revised version
--- 13 DEC 94 SAIC split off Wide_String attributes into C354003
--- 06 JAN 95 SAIC Promoted to next release
--- 19 APR 95 SAIC Revised in accord with reviewer comments
--- 27 JAN 96 SAIC Eliminated 32/64 bit potential conflict for 2.1
---
---!
-
-with Report;
-with System;
-with TCTouch;
-procedure C354002 is
-
- function ID(Local_Value: Integer) return Integer renames Report.Ident_Int;
- function ID(Local_Value: String) return String renames Report.Ident_Str;
-
- Power_2_Bits : constant := System.Storage_Unit;
- Half_Max_Binary_Value : constant := System.Max_Binary_Modulus / 2;
-
- type Max_Binary is mod System.Max_Binary_Modulus;
- type Max_NonBinary is mod System.Max_Nonbinary_Modulus;
- type Half_Max_Binary is mod Half_Max_Binary_Value;
-
- type Medium is mod 2048;
- type Medium_Plus is mod 2042;
- type Medium_Minus is mod 2111;
-
- type Small is mod 2;
- type Finger is mod 5;
-
- MBL : constant := Max_NonBinary'Last;
- MNBM : constant := Max_NonBinary'Modulus;
-
- Ones_Complement_Permission : constant Boolean := MBL = MNBM;
-
- type Finger_Id is (Thumb, Index, Middle, Ring, Pinkie);
-
- subtype Midrange is Medium_Minus range 222 .. 1111;
-
--- a few numbers for testing purposes
- Max_Binary_Mod_Over_3 : constant := Max_Binary'Modulus / 3;
- Max_NonBinary_Mod_Over_4 : constant := Max_NonBinary'Modulus / 4;
- System_Max_Bin_Mod_Pred : constant := System.Max_Binary_Modulus - 1;
- System_Max_NonBin_Mod_Pred : constant := System.Max_Nonbinary_Modulus - 1;
- Half_Max_Bin_Value_Pred : constant := Half_Max_Binary_Value - 1;
-
- AMB, BMB : Max_Binary;
- AHMB, BHMB : Half_Max_Binary;
- AM, BM : Medium;
- AMP, BMP : Medium_Plus;
- AMM, BMM : Medium_Minus;
- AS, BS : Small;
- AF, BF : Finger;
-
- TC_Pass_Case : Boolean := True;
-
- procedure Value_Fault( S: String ) is
- -- check 'Value for failure modes
- begin
- -- the evaluation of the 'Value expression should raise C_E
- TCTouch.Assert_Not( Midrange'Value(S) = 0, "Value_Fault" );
- if Midrange'Value(S) not in Midrange'Base then
- Report.Failed("'Value(" & S & ") raised no exception");
- end if;
- exception
- when Constraint_Error => null; -- expected case
- when others =>
- Report.Failed("'Value(" & S & ") raised wrong exception");
- end Value_Fault;
-
-begin -- Main test procedure.
-
- Report.Test ("C354002", "Check attributes of modular types" );
-
--- Base
- TCTouch.Assert( Midrange'Base'First = 0, "Midrange'Base'First" );
- TCTouch.Assert( Midrange'Base'Last = Medium_Minus'Last,
- "Midrange'Base'Last" );
-
--- First
- TCTouch.Assert( Max_Binary'First = 0, "Max_Binary'First" );
- TCTouch.Assert( Max_NonBinary'First = 0, "Max_NonBinary'First" );
- TCTouch.Assert( Half_Max_Binary'First = 0, "Half_Max_Binary'First" );
-
- TCTouch.Assert( Medium'First = Medium(ID(0)), "Medium'First" );
- TCTouch.Assert( Medium_Plus'First = Medium_Plus(ID(0)),
- "Medium_Plus'First" );
- TCTouch.Assert( Medium_Minus'First = Medium_Minus(ID(0)),
- "Medium_Minus'First" );
-
- TCTouch.Assert( Small'First = Small(ID(0)), "Small'First" );
- TCTouch.Assert( Finger'First = Finger(ID(0)), "Finger'First" );
- TCTouch.Assert( Midrange'First = Midrange(ID(222)),
- "Midrange'First" );
-
--- Image
- TCTouch.Assert( Half_Max_Binary'Image(255) = " 255",
- "Half_Max_Binary'Image" );
- TCTouch.Assert( Medium'Image(0) = ID(" 0"), "Medium'Image" );
- TCTouch.Assert( Medium_Plus'Image(Medium_Plus'Last) = " 2041",
- "Medium_Plus'Image" );
- TCTouch.Assert( Medium_Minus'Image(Medium_Minus(ID(1024))) = " 1024",
- "Medium_Minus'Image" );
- TCTouch.Assert( Small'Image(Small(ID(1))) = " 1", "Small'Image" );
- TCTouch.Assert( Midrange'Image(Midrange(ID(333))) = " 333",
- "Midrange'Image" );
-
--- Last
- TCTouch.Assert( Max_Binary'Last = System_Max_Bin_Mod_Pred,
- "Max_Binary'Last");
- if Ones_Complement_Permission then
- TCTouch.Assert( Max_NonBinary'Last >= System_Max_NonBin_Mod_Pred,
- "Max_NonBinary'Last (ones comp)");
- else
- TCTouch.Assert( Max_NonBinary'Last = System_Max_NonBin_Mod_Pred,
- "Max_NonBinary'Last");
- end if;
- TCTouch.Assert( Half_Max_Binary'Last = Half_Max_Bin_Value_Pred,
- "Half_Max_Binary'Last");
-
- TCTouch.Assert( Medium'Last = Medium(ID(2047)), "Medium'Last");
- TCTouch.Assert( Medium_Plus'Last = Medium_Plus(ID(2041)),
- "Medium_Plus'Last");
- TCTouch.Assert( Medium_Minus'Last = Medium_Minus(ID(2110)),
- "Medium_Minus'Last");
- TCTouch.Assert( Small'Last = Small(ID(1)), "Small'Last");
- TCTouch.Assert( Finger'Last = Finger(ID(4)), "Finger'Last");
- TCTouch.Assert( Midrange'Last = Midrange(ID(1111)), "Midrange'Last");
-
--- Max
- TCTouch.Assert( Max_Binary'Max(Power_2_Bits, Max_Binary'Last)
- = Max_Binary'Last, "Max_Binary'Max");
- TCTouch.Assert( Max_NonBinary'Max(100,2000) = 2000, "Max_NonBinary'Max");
- TCTouch.Assert( Half_Max_Binary'Max(123,456) = 456,
- "Half_Max_Binary'Max");
-
- TCTouch.Assert( Medium'Max(0,2040) = 2040, "Medium'Max");
- TCTouch.Assert( Medium_Plus'Max(0,1) = 1, "Medium_Plus'Max");
- TCTouch.Assert( Medium_Minus'Max(2001,1995) = 2001, "Medium_Minus'Max");
- TCTouch.Assert( Small'Max(1,0) = 1, "Small'Max");
- TCTouch.Assert( Finger'Max(Finger'Last+1,4) = 4, "Finger'Max");
- TCTouch.Assert( Midrange'Max(Midrange'First+1,222) = Midrange'First+1,
- "Midrange'Max");
-
--- Min
- TCTouch.Assert( Max_Binary'Min(Power_2_Bits, Max_Binary'Last)
- = Power_2_Bits, "Max_Binary'Min");
- TCTouch.Assert( Max_NonBinary'Min(100,2000) = 100, "Max_NonBinary'Min");
- TCTouch.Assert( Half_Max_Binary'Min(123,456) = 123,
- "Half_Max_Binary'Min");
-
- TCTouch.Assert( Medium'Min(0,Medium(ID(2040))) = 0, "Medium'Min");
- TCTouch.Assert( Medium_Plus'Min(0,1) = 0, "Medium_Plus'Min");
- TCTouch.Assert( Medium_Minus'Min(2001,1995) = 1995, "Medium_Minus'Min");
- TCTouch.Assert( Small'Min(1,0) = 0, "Small'Min");
- TCTouch.Assert( Finger'Min(Finger'Last+1,4) /= 4, "Finger'Min");
- TCTouch.Assert( Midrange'Min(Midrange'First+1,222) = 222,
- "Midrange'Min");
--- Modulus
- TCTouch.Assert( Max_Binary'Modulus = System.Max_Binary_Modulus,
- "Max_Binary'Modulus");
- TCTouch.Assert( Max_NonBinary'Modulus = System.Max_Nonbinary_Modulus,
- "Max_NonBinary'Modulus");
- TCTouch.Assert( Half_Max_Binary'Modulus = Half_Max_Binary_Value,
- "Half_Max_Binary'Modulus");
-
- TCTouch.Assert( Medium'Modulus = 2048, "Medium'Modulus");
- TCTouch.Assert( Medium_Plus'Modulus = 2042, "Medium_Plus'Modulus");
- TCTouch.Assert( Medium_Minus'Modulus = 2111, "Medium_Minus'Modulus");
- TCTouch.Assert( Small'Modulus = 2, "Small'Modulus");
- TCTouch.Assert( Finger'Modulus = 5, "Finger'Modulus");
- TCTouch.Assert( Midrange'Modulus = ID(2111), "Midrange'Modulus");
-
--- Pos
- declare
- Int : Natural := 222;
- begin
- for I in Midrange loop
- TC_Pass_Case := TC_Pass_Case and Midrange'Pos(I) = Int;
-
- Int := Int +1;
- end loop;
- end;
-
- TCTouch.Assert( TC_Pass_Case, "Midrange'Pos");
-
--- Pred
- TCTouch.Assert( Max_Binary'Pred(0) = System_Max_Bin_Mod_Pred,
- "Max_Binary'Pred(0)");
- if Ones_Complement_Permission then
- TCTouch.Assert( Max_NonBinary'Pred(0) >= System_Max_NonBin_Mod_Pred,
- "Max_NonBinary'Pred(0) (ones comp)");
- else
- TCTouch.Assert( Max_NonBinary'Pred(0) = System_Max_NonBin_Mod_Pred,
- "Max_NonBinary'Pred(0)");
- end if;
- TCTouch.Assert( Half_Max_Binary'Pred(0) = Half_Max_Bin_Value_Pred,
- "Half_Max_Binary'Pred(0)");
-
- TCTouch.Assert( Medium'Pred(Medium(ID(0))) = 2047, "Medium'Pred(0)");
- TCTouch.Assert( Medium_Plus'Pred(0) = 2041, "Medium_Plus'Pred(0)");
- TCTouch.Assert( Medium_Minus'Pred(0) = 2110, "Medium_Minus'Pred(0)");
- TCTouch.Assert( Small'Pred(0) = 1, "Small'Pred(0)");
- TCTouch.Assert( Finger'Pred(Finger(ID(0))) = 4, "Finger'Pred(0)");
- TCTouch.Assert( Midrange'Pred(222) = 221, "Midrange'Pred('First)");
-
--- Range
- for I in Midrange'Range loop
- if I not in Midrange then
- Report.Failed("Midrange loop test");
- end if;
- end loop;
- for I in Medium'Range loop
- if I not in Medium then
- Report.Failed("Medium loop test");
- end if;
- end loop;
- for I in Medium_Minus'Range loop
- if I not in 0..2110 then
- Report.Failed("Medium loop test");
- end if;
- end loop;
-
--- Succ
- TCTouch.Assert( Max_Binary'Succ(System_Max_Bin_Mod_Pred) = 0,
- "Max_Binary'Succ('Last)");
- if Ones_Complement_Permission then
- TCTouch.Assert( (Max_NonBinary'Succ(System_Max_NonBin_Mod_Pred) = 0)
- or (Max_NonBinary'Succ(System_Max_NonBin_Mod_Pred)
- = Max_NonBinary'Last),
- "Max_NonBinary'Succ('Last) (ones comp)");
- else
- TCTouch.Assert( Max_NonBinary'Succ(System_Max_NonBin_Mod_Pred) = 0,
- "Max_NonBinary'Succ('Last)");
- end if;
- TCTouch.Assert( Half_Max_Binary'Succ(Half_Max_Bin_Value_Pred) = 0,
- "Half_Max_Binary'Succ('Last)");
-
- TCTouch.Assert( Medium'Succ(2047) = 0, "Medium'Succ('Last)");
- TCTouch.Assert( Medium_Plus'Succ(2041) = 0, "Medium_Plus'Succ('Last)");
- TCTouch.Assert( Medium_Minus'Succ(2110) = 0, "Medium_Minus'Succ('Last)");
- TCTouch.Assert( Small'Succ(1) = 0, "Small'Succ('Last)");
- TCTouch.Assert( Finger'Succ(4) = 0, "Finger'Succ('Last)");
- TCTouch.Assert( Midrange'Succ(Midrange(ID(1111))) = 1112,
- "Midrange'Succ('Last)");
-
--- Val
- for I in Natural range ID(222)..ID(1111) loop
- TCTouch.Assert( Midrange'Val(I) = Medium_Minus(I), "Midrange'Val");
- end loop;
-
--- Value
-
- TCTouch.Assert( Half_Max_Binary'Value("255") = 255,
- "Half_Max_Binary'Value" );
-
- TCTouch.Assert( Medium'Value(" 1e2") = 100, "Medium'Value(""1e2"")" );
- TCTouch.Assert( Medium'Value(" 0 ") = 0, "Medium'Value" );
- TCTouch.Assert( Medium_Plus'Value(ID("2041")) = 2041,
- "Medium_Plus'Value" );
- TCTouch.Assert( Medium_Minus'Value(ID("+10_24")) = 1024,
- "Medium_Minus'Value" );
-
- TCTouch.Assert( Small'Value("+1") = 1, "Small'Value" );
- TCTouch.Assert( Midrange'Value(ID("333")) = 333, "Midrange'Value" );
- TCTouch.Assert( Midrange'Value("1E3") = 1000,
- "Midrange'Value(""1E3"")" );
-
- Value_Fault( "bad input" );
- Value_Fault( "-333" );
- Value_Fault( "9999" );
- Value_Fault( ".1" );
- Value_Fault( "1e-1" );
-
--- Width
- TCTouch.Assert( Medium'Width = 5, "Medium'Width");
- TCTouch.Assert( Medium_Plus'Width = 5, "Medium_Plus'Width");
- TCTouch.Assert( Medium_Minus'Width = 5, "Medium_Minus'Width");
- TCTouch.Assert( Small'Width = 2, "Small'Width");
- TCTouch.Assert( Finger'Width = 2, "Finger'Width");
- TCTouch.Assert( Midrange'Width = 5, "Midrange'Width");
-
- Report.Result;
-
-end C354002;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c354003.a b/gcc/testsuite/ada/acats/tests/c3/c354003.a
deleted file mode 100644
index 1f607a7e691..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c354003.a
+++ /dev/null
@@ -1,211 +0,0 @@
--- C354003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the Wide_String attributes of modular types yield
--- correct values/results. The attributes checked are:
---
--- Wide_Image
--- Wide_Value
---
--- TEST DESCRIPTION:
--- This test is split from C354002. It tests only the attributes:
---
--- Wide_Image, Wide_Value
---
--- This test defines several modular types. One type defined at
--- each of System.Max_Binary_Modulus, System.Max_Nonbinary_Modulus,
--- a power of two half that of System.Max_Binary_Modulus, one less
--- than that power of two; one more than that power of two, two
--- less than a (large) power of two. For each of these types,
--- determine the correct operation of the Wide_String attributes.
---
---
--- CHANGE HISTORY:
--- 13 DEC 94 SAIC Initial version
--- 06 JAN 94 SAIC Promoted to future release
--- 19 APR 95 SAIC Revised in accord with reviewer comments
--- 01 DEC 95 SAIC Corrected for 2.0.1
--- 27 JAN 96 SAIC Eliminated potential 32/64 bit conflict for 2.1
--- 24 FEB 97 PWB.CTA Corrected out-of-range value
---!
-
-with Report;
-with System;
-with TCTouch;
-with Ada.Characters.Handling;
-procedure C354003 is
-
- function ID(Local_Value: Integer) return Integer renames Report.Ident_Int;
- function ID(Local_Value: String) return String renames Report.Ident_Str;
-
- function ID(Local_Value: String) return Wide_String is
- begin
- return Ada.Characters.Handling.To_Wide_String( ID( Local_Value ) );
- end ID;
-
- Half_Max_Binary_Value : constant := System.Max_Binary_Modulus / 2;
-
- type Max_Binary is mod System.Max_Binary_Modulus;
- type Max_NonBinary is mod System.Max_Nonbinary_Modulus;
- type Half_Max_Binary is mod Half_Max_Binary_Value;
-
- type Medium is mod 2048;
- type Medium_Plus is mod 2042;
- type Medium_Minus is mod 2111;
-
- type Small is mod 2;
- type Finger is mod 5;
-
- type Finger_Id is (Thumb, Index, Middle, Ring, Pinkie);
-
- subtype Midrange is Medium_Minus range 222 .. 1111;
-
- AMB, BMB : Max_Binary;
- AHMB, BHMB : Half_Max_Binary;
- AM, BM : Medium;
- AMP, BMP : Medium_Plus;
- AMM, BMM : Medium_Minus;
- AS, BS : Small;
- AF, BF : Finger;
-
- procedure Wide_Value_Fault( S: Wide_String ) is
- -- check 'Wide_Value for failure modes
- begin
- -- the evaluation of the 'Wide_Value expression should raise C_E
- TCTouch.Assert_Not( Midrange'Wide_Value(S) = 0, "Wide_Value_Fault" );
- if Midrange'Wide_Value(S) not in Midrange'Base then
- Report.Failed("'Wide_Value raised no exception");
- end if;
- exception
- when Constraint_Error => null; -- expected case
- when others =>
- Report.Failed("'Wide_Value raised wrong exception");
- end Wide_Value_Fault;
-
-
- The_Cap, The_Toe : Natural;
-
- procedure Check_Non_Static_Cases( Lower_Bound,Upper_Bound : Medium ) is
- subtype Non_Static is Medium range Lower_Bound..Upper_Bound;
- begin
- -- First, Last, Range, Min, Max, Succ, Pred, Pos, and Val
-
- TCTouch.Assert( Non_Static'First = Medium(The_Toe), "Non_Static'First" );
- TCTouch.Assert( Non_Static'Last = Non_Static(The_Cap),
- "Non_Static'Last" );
- TCTouch.Assert( Non_Static(The_Cap/2) in Non_Static'Range,
- "Non_Static'Range" );
- TCTouch.Assert( Non_Static'Min(Medium(Report.Ident_Int(100)),
- Medium(Report.Ident_Int(200))) = 100,
- "Non_Static'Min" );
- TCTouch.Assert( Non_Static'Max(Medium(Report.Ident_Int(100)),
- Medium(Report.Ident_Int(200))) = 200,
- "Non_Static'Max" );
- TCTouch.Assert( Non_Static'Succ(Non_Static(The_Cap))
- = Medium'Succ(Upper_Bound),
- "Non_Static'Succ" );
- TCTouch.Assert( Non_Static'Pred(Medium(Report.Ident_Int(The_Cap)))
- = Non_Static(Report.Ident_Int(The_Cap-1)),
- "Non_Static'Pred" );
- TCTouch.Assert( Non_Static'Pos(Upper_Bound) = Non_Static(The_Cap),
- "Non_Static'Pos" );
- TCTouch.Assert( Non_Static'Val(Non_Static(The_Cap)) = Upper_Bound,
- "Non_Static'Val" );
-
- end Check_Non_Static_Cases;
-
-
-begin -- Main test procedure.
-
- Report.Test ("C354003", "Check Wide_String attributes of modular types" );
-
- Wide_Strings_Needed: declare
-
- Max_Bin_Mod_Div_3 : constant := Max_Binary'Modulus/3;
- Max_Non_Mod_Div_4 : constant := Max_NonBinary'Modulus/4;
-
- begin
-
--- Wide_Image
-
- TCTouch.Assert( Half_Max_Binary'Wide_Image(255) = " 255",
- "Half_Max_Binary'Wide_Image" );
-
- TCTouch.Assert( Medium'Wide_Image(0) = " 0", "Medium'Wide_Image" );
-
- TCTouch.Assert( Medium_Plus'Wide_Image(Medium_Plus'Last) = " 2041",
- "Medium_Plus'Wide_Image" );
-
- TCTouch.Assert( Medium_Minus'Wide_Image(Medium_Minus(ID(1024))) = " 1024",
- "Medium_Minus'Wide_Image" );
-
- TCTouch.Assert( Small'Wide_Image(1) = " 1", "Small'Wide_Image" );
-
- TCTouch.Assert( Midrange'Wide_Image(Midrange(ID(333))) = " 333",
- "Midrange'Wide_Image" );
-
--- Wide_Value
-
- TCTouch.Assert( Half_Max_Binary'Wide_Value("255") = 255,
- "Half_Max_Binary'Wide_Value" );
-
- TCTouch.Assert( Medium'Wide_Value(" 0 ") = 0, "Medium'Wide_Value" );
-
- TCTouch.Assert( Medium_Plus'Wide_Value(ID("2041")) = Medium_Plus'Last,
- "Medium_Plus'Wide_Value" );
-
- TCTouch.Assert( Medium_Minus'Wide_Value("+1_4 ") = 14,
- "Medium_Minus'Wide_Value" );
-
- TCTouch.Assert( Small'Wide_Value("+1") = 1, "Small'Wide_Value" );
-
- TCTouch.Assert( Midrange'Wide_Value(ID("333")) = 333,
- "Midrange'Wide_Value" );
-
- TCTouch.Assert( Midrange'Wide_Value(ID("1E3")) = 1000,
- "Midrange'Wide_Value(""1E3"")" );
-
- Wide_Value_Fault( "bad input" );
- Wide_Value_Fault( "-333" );
- Wide_Value_Fault( "9999" );
- Wide_Value_Fault( ".1" );
- Wide_Value_Fault( "1e-1" );
-
- end Wide_Strings_Needed;
-
- The_Toe := Report.Ident_Int(25);
- The_Cap := Report.Ident_Int(256);
- Check_Non_Static_Cases( Medium(Report.Ident_Int(The_Toe)),
- Medium(Report.Ident_Int(The_Cap)) );
-
- The_Toe := Report.Ident_Int(40);
- The_Cap := Report.Ident_Int(2047);
- Check_Non_Static_Cases( Medium(Report.Ident_Int(The_Toe)),
- Medium(Report.Ident_Int(The_Cap)) );
-
- Report.Result;
-
-end C354003;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c360002.a b/gcc/testsuite/ada/acats/tests/c3/c360002.a
deleted file mode 100644
index 95cb3ef07d7..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c360002.a
+++ /dev/null
@@ -1,268 +0,0 @@
--- C360002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that modular types may be used as array indices.
---
--- Check that if aliased appears in the component_definition of an
--- array_type that each component of the array is aliased.
---
--- Check that references to aliased array objects produce correct
--- results, and that out-of-bounds indexing correctly produces
--- Constraint_Error.
---
--- TEST DESCRIPTION:
--- This test defines several array types and subtypes indexed by modular
--- types; some aliased some not, some with aliased components, some not.
---
--- It then checks that assignments move the correct data.
---
---
--- CHANGE HISTORY:
--- 28 SEP 95 SAIC Initial version
--- 23 APR 96 SAIC Doc fixes, fixed constrained/unconstrained conflict
--- 13 FEB 97 PWB.CTA Removed illegal declarations and affected code
---!
-
-------------------------------------------------------------------- C360002
-
-with Report;
-
-procedure C360002 is
-
- Verbose : Boolean := Report.Ident_Bool( False );
-
- type Mod_128 is mod 128;
-
- function Ident_128( I: Integer ) return Mod_128 is
- begin
- return Mod_128( Report.Ident_Int( I ) );
- end Ident_128;
-
- type Unconstrained_Array
- is array( Mod_128 range <> ) of Integer;
-
- type Unconstrained_Array_Aliased
- is array( Mod_128 range <> ) of aliased Integer;
-
- type Access_All_Unconstrained_Array
- is access all Unconstrained_Array;
-
- type Access_All_Unconstrained_Array_Aliased
- is access all Unconstrained_Array_Aliased;
-
- subtype Array_01_10
- is Unconstrained_Array(01..10);
-
- subtype Array_11_20
- is Unconstrained_Array(11..20);
-
- subtype Array_Aliased_01_10
- is Unconstrained_Array_Aliased(01..10);
-
- subtype Array_Aliased_11_20
- is Unconstrained_Array_Aliased(11..20);
-
- subtype Access_All_01_10_Array
- is Access_All_Unconstrained_Array(01..10);
-
- subtype Access_All_01_10_Array_Aliased
- is Access_All_Unconstrained_Array_Aliased(01..10);
-
- subtype Access_All_11_20_Array
- is Access_All_Unconstrained_Array(11..20);
-
- subtype Access_All_11_20_Array_Aliased
- is Access_All_Unconstrained_Array_Aliased(11..20);
-
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- -- these 'filler' functions create unique values for every element that
- -- is used and/or tested in this test.
-
- Well_Bottom : Integer := 0;
-
- function Filler( Size : Mod_128 ) return Unconstrained_Array is
- It : Unconstrained_Array( 0..Size-1 );
- begin
- for Eyes in It'Range loop
- It(Eyes) := Integer( Eyes ) + Well_Bottom;
- end loop;
- Well_Bottom := Well_Bottom + It'Length;
- return It;
- end Filler;
-
- function Filler( Size : Mod_128 ) return Unconstrained_Array_Aliased is
- It : Unconstrained_Array_Aliased( 0..Size-1 );
- begin
- for Ayes in It'Range loop
- It(Ayes) := Integer( Ayes ) + Well_Bottom;
- end loop;
- Well_Bottom := Well_Bottom + It'Length;
- return It;
- end Filler;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- An_Integer : Integer;
-
- type AAI is access all Integer;
-
- An_Integer_Access : AAI;
-
- Array_Item_01_10 : Array_01_10 := Filler(10); -- 0..9
-
- Array_Item_11_20 : Array_11_20 := Filler(10); -- 10..19 (sliding)
-
- Array_Aliased_Item_01_10 : Array_Aliased_01_10 := Filler(10); -- 20..29
-
- Array_Aliased_Item_11_20 : Array_Aliased_11_20 := Filler(10); -- 30..39
-
- Aliased_Array_Item_01_10 : aliased Array_01_10 := Filler(10); -- 40..49
-
- Aliased_Array_Item_11_20 : aliased Array_11_20 := Filler(10); -- 50..59
-
- Aliased_Array_Aliased_Item_01_10 : aliased Array_Aliased_01_10
- := Filler(10); -- 60..69
-
- Aliased_Array_Aliased_Item_11_20 : aliased Array_Aliased_11_20
- := Filler(10); -- 70..79
-
- Check_Item : Access_All_Unconstrained_Array;
-
- Check_Aliased_Item : Access_All_Unconstrained_Array_Aliased;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- procedure Fail( Message : String; CI, SB : Integer ) is
- begin
- Report.Failed("Wrong value passed " & Message);
- if Verbose then
- Report.Comment("got" & Integer'Image(CI) &
- " should be" & Integer'Image(SB) );
- end if;
- end Fail;
-
- procedure Check_Array_01_10( Checked_Item : Array_01_10;
- Low_SB : Integer ) is
- begin
- for Index in Checked_Item'Range loop
- if (Checked_Item(Index) /= (Low_SB +Integer(Index)-1)) then
- Fail("unaliased 1..10", Checked_Item(Index),
- (Low_SB +Integer(Index)-1));
- end if;
- end loop;
- end Check_Array_01_10;
-
- procedure Check_Array_11_20( Checked_Item : Array_11_20;
- Low_SB : Integer ) is
- begin
- for Index in Checked_Item'Range loop
- if (Checked_Item(Index) /= (Low_SB +Integer(Index)-11)) then
- Fail("unaliased 11..20", Checked_Item(Index),
- (Low_SB +Integer(Index)-11));
- end if;
- end loop;
- end Check_Array_11_20;
-
- procedure Check_Single_Integer( The_Integer, SB : Integer;
- Message : String ) is
- begin
- if The_Integer /= SB then
- Report.Failed("Wrong integer value for " & Message );
- end if;
- end Check_Single_Integer;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-begin -- Main test procedure.
-
- Report.Test ("C360002", "Check that modular types may be used as array " &
- "indices. Check that if aliased appears in " &
- "the component_definition of an array_type that " &
- "each component of the array is aliased. Check " &
- "that references to aliased array objects " &
- "produce correct results, and that out of bound " &
- "references to aliased objects correctly " &
- "produce Constraint_Error" );
- -- start with checks that the Filler assignments produced the expected
- -- result. This is a "case 0" test to check that nothing REALLY surprising
- -- is happening
-
- Check_Array_01_10( Array_Item_01_10, 0 );
- Check_Array_11_20( Array_Item_11_20, 10 );
-
- -- check that having the variable aliased makes no difference
- Check_Array_01_10( Aliased_Array_Item_01_10, 40 );
- Check_Array_11_20( Aliased_Array_Item_11_20, 50 );
-
- -- now check that conversion between array types where the only
- -- difference in the definitions is that the components are aliased works
-
- Check_Array_01_10( Unconstrained_Array( Array_Aliased_Item_01_10 ), 20 );
- Check_Array_11_20( Unconstrained_Array( Array_Aliased_Item_11_20 ), 30 );
-
- -- check that conversion of an aliased object with aliased components
- -- also works
-
- Check_Array_01_10( Unconstrained_Array( Aliased_Array_Aliased_Item_01_10 ),
- 60 );
- Check_Array_11_20( Unconstrained_Array( Aliased_Array_Aliased_Item_11_20 ),
- 70 );
-
- -- check that the bounds will slide
-
- Check_Array_01_10( Array_01_10( Array_Item_11_20 ), 10 );
- Check_Array_11_20( Array_11_20( Array_Item_01_10 ), 0 );
-
- -- point at some of the components and check them
-
- An_Integer_Access := Array_Aliased_Item_01_10(5)'Access;
-
- Check_Single_Integer( An_Integer_Access.all, 24,
- "Aliased component 'Access");
-
- An_Integer_Access := Aliased_Array_Aliased_Item_01_10(7)'Access;
-
- Check_Single_Integer( An_Integer_Access.all, 66,
- "Aliased Aliased component 'Access");
-
- -- check some assignments
-
- Array_Item_01_10 := Aliased_Array_Item_01_10;
- Check_Array_01_10( Array_Item_01_10, 40 );
-
- Aliased_Array_Item_01_10 := Aliased_Array_Item_11_20(11..20);
- Check_Array_01_10( Aliased_Array_Item_01_10, 50 );
-
- Aliased_Array_Aliased_Item_11_20(11..20)
- := Aliased_Array_Aliased_Item_01_10;
- Check_Array_11_20( Unconstrained_Array( Aliased_Array_Aliased_Item_11_20 ),
- 60 );
-
- Report.Result;
-
-end C360002;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c371001.a b/gcc/testsuite/ada/acats/tests/c3/c371001.a
deleted file mode 100644
index f6823570b06..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c371001.a
+++ /dev/null
@@ -1,388 +0,0 @@
--- C371001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if a discriminant constraint depends on a discriminant,
--- the evaluation of the expressions in the constraint is deferred
--- until an object of the subtype is created. Check for cases of
--- records with private type component.
---
--- TEST DESCRIPTION:
--- This transition test defines record type and incomplete types with
--- discriminant components which depend on the discriminants. The
--- discriminants are calculated by function calls. The test verifies
--- that Constraint_Error is raised during the object creations when
--- values of discriminants are incompatible with the subtypes.
---
--- Inspired by C37214A.ADA and C37216A.ADA.
---
---
--- CHANGE HISTORY:
--- 11 Apr 96 SAIC Initial version for ACVC 2.1.
--- 06 Oct 96 SAIC Added LM references. Replaced "others exception"
--- with "unexpected exception"
---
---!
-
-with Report;
-
-procedure C371001 is
-
- subtype Small_Int is Integer range 1..10;
-
- Func1_Cons : Integer := 0;
-
- ---------------------------------------------------------
- function Func1 return Integer is
- begin
- Func1_Cons := Func1_Cons + Report.Ident_Int(1);
- return Func1_Cons;
- end Func1;
-
-
-begin
- Report.Test ("C371001", "Check that if a discriminant constraint " &
- "depends on a discriminant, the evaluation of the " &
- "expressions in the constraint is deferred until " &
- "object declarations");
-
- ---------------------------------------------------------
- -- Constraint checks on an object declaration of a record.
-
- begin
-
- declare
-
- package C371001_0 is
-
- type PT_W_Disc (D : Small_Int) is private;
- type Rec_W_Private (D1 : Integer) is
- record
- C : PT_W_Disc (D1);
- end record;
-
- type Rec (D3 : Integer) is
- record
- C1 : Rec_W_Private (D3);
- end record;
-
- private
- type PT_W_Disc (D : Small_Int) is
- record
- Str : String (1 .. D) := (others => '*');
- end record;
-
- end C371001_0;
-
- --=====================================================--
-
- Obj : C371001_0.Rec(Report.Ident_Int(0)); -- Constraint_Error raised.
-
- begin
- Report.Failed ("Obj - Constraint_Error should be raised");
- if Obj.C1.D1 /= 0 then
- Report.Failed ("Obj - Shouldn't get here");
- end if;
-
- exception
- when others =>
- Report.Failed ("Obj - exception raised too late");
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj - unexpected exception raised");
- end;
-
- -------------------------------------------------------------------
- -- Constraint checks on an object declaration of an array.
-
- begin
- declare
-
- package C371001_1 is
-
- type PT_W_Disc (D : Small_Int) is private;
- type Rec_W_Private (D1 : Integer) is
- record
- C : PT_W_Disc (D1);
- end record;
-
- type Rec_01 (D3 : Integer) is
- record
- C1 : Rec_W_Private (D3);
- end record;
-
- type Arr is array (1 .. 5) of
- Rec_01(Report.Ident_Int(0)); -- No Constraint_Error
- -- raised.
- private
- type PT_W_Disc (D : Small_Int) is
- record
- Str : String (1 .. D) := (others => '*');
- end record;
-
- end C371001_1;
-
- --=====================================================--
-
- begin
- declare
- Obj1 : C371001_1.Arr; -- Constraint_Error raised.
- begin
- Report.Failed ("Obj1 - Constraint_Error should be raised");
- if Obj1(1).D3 /= 0 then
- Report.Failed ("Obj1 - Shouldn't get here");
- end if;
-
- exception
- when others =>
- Report.Failed ("Obj1 - exception raised too late");
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj1 - unexpected exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Arr - Constraint_Error raised");
- when others =>
- Report.Failed ("Arr - unexpected exception raised");
- end;
-
-
- -------------------------------------------------------------------
- -- Constraint checks on an object declaration of an access type.
-
- begin
- declare
-
- package C371001_2 is
-
- type PT_W_Disc (D : Small_Int) is private;
- type Rec_W_Private (D1 : Integer) is
- record
- C : PT_W_Disc (D1);
- end record;
-
- type Rec_02 (D3 : Integer) is
- record
- C1 : Rec_W_Private (D3);
- end record;
-
- type Acc_Rec2 is access Rec_02 -- No Constraint_Error
- (Report.Ident_Int(11)); -- raised.
-
- private
- type PT_W_Disc (D : Small_Int) is
- record
- Str : String (1 .. D) := (others => '*');
- end record;
-
- end C371001_2;
-
- --=====================================================--
-
- begin
- declare
- Obj2 : C371001_2.Acc_Rec2; -- No Constraint_Error
- -- raised.
- begin
- Obj2 := new C371001_2.Rec_02 (Report.Ident_Int(11));
- -- Constraint_Error raised.
-
- Report.Failed ("Obj2 - Constraint_Error should be raised");
- if Obj2.D3 /= 1 then
- Report.Failed ("Obj2 - Shouldn't get here");
- end if;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj2 - unexpected exception raised in " &
- "assignment");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Obj2 - Constraint_Error raised in declaration");
- when others =>
- Report.Failed ("Obj2 - unexpected exception raised in " &
- "declaration");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Acc_Rec2 - Constraint_Error raised");
- when others =>
- Report.Failed ("Acc_Rec2 - unexpected exception raised");
- end;
-
- -------------------------------------------------------------------
- -- Constraint checks on an object declaration of a subtype.
-
- Func1_Cons := -1;
-
- begin
- declare
-
- package C371001_3 is
-
- type PT_W_Disc (D1, D2 : Small_Int) is private;
- type Rec_W_Private (D3, D4 : Integer) is
- record
- C : PT_W_Disc (D3, D4);
- end record;
-
- type Rec_03 (D5 : Integer) is
- record
- C1 : Rec_W_Private (D5, Func1); -- Func1 evaluated,
- end record; -- value 0.
-
- subtype Subtype_Rec is Rec_03(1); -- No Constraint_Error
- -- raised.
- private
- type PT_W_Disc (D1, D2 : Small_Int) is
- record
- Str1 : String (1 .. D1) := (others => '*');
- Str2 : String (1 .. D2) := (others => '*');
- end record;
-
- end C371001_3;
-
- --=====================================================--
-
- begin
- declare
- Obj3 : C371001_3.Subtype_Rec; -- Constraint_Error raised.
- begin
- Report.Failed ("Obj3 - Constraint_Error should be raised");
- if Obj3.D5 /= 1 then
- Report.Failed ("Obj3 - Shouldn't get here");
- end if;
-
- exception
- when others =>
- Report.Failed ("Obj3 - exception raised too late");
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj3 - unexpected exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Subtype_Rec - Constraint_Error raised");
- when others =>
- Report.Failed ("Subtype_Rec - unexpected exception raised");
- end;
-
- -------------------------------------------------------------------
- -- Constraint checks on an object declaration of an incomplete type.
-
- Func1_Cons := 10;
-
- begin
- declare
-
- package C371001_4 is
-
- type Rec_04 (D3 : Integer);
- type PT_W_Disc (D : Small_Int) is private;
- type Rec_W_Private (D1, D2 : Small_Int) is
- record
- C : PT_W_Disc (D2);
- end record;
-
- type Rec_04 (D3 : Integer) is
- record
- C1 : Rec_W_Private (D3, Func1); -- Func1 evaluated
- end record; -- value 11.
-
- type Acc_Rec4 is access Rec_04 (1); -- No Constraint_Error
- -- raised.
- private
- type PT_W_Disc (D : Small_Int) is
- record
- Str : String (1 .. D) := (others => '*');
- end record;
-
- end C371001_4;
-
- --=====================================================--
-
- begin
- declare
- Obj4 : C371001_4.Acc_Rec4; -- No Constraint_Error
- -- raised.
- begin
- Obj4 := new C371001_4.Rec_04 (1); -- Constraint_Error raised.
-
- Report.Failed ("Obj4 - Constraint_Error should be raised");
- if Obj4.D3 /= 1 then
- Report.Failed ("Obj4 - Shouldn't get here");
- end if;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj4 - unexpected exception raised in " &
- "assignment");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Obj4 - Constraint_Error raised in declaration");
- when others =>
- Report.Failed ("Obj4 - unexpected exception raised in " &
- "declaration");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Acc_Rec4 - Constraint_Error raised");
- when others =>
- Report.Failed ("Acc_Rec4 - unexpected exception raised");
- end;
-
- Report.Result;
-
-exception
- when others =>
- Report.Failed ("Discriminant value checked too soon");
- Report.Result;
-
-end C371001;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c371002.a b/gcc/testsuite/ada/acats/tests/c3/c371002.a
deleted file mode 100644
index ea532550cd8..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c371002.a
+++ /dev/null
@@ -1,364 +0,0 @@
--- C371002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if a discriminant constraint depends on a discriminant,
--- the evaluation of the expressions in the constraint is deferred until
--- an object of the subtype is created. Check for cases of records.
---
--- TEST DESCRIPTION:
--- This transition test defines record types with discriminant components
--- which depend on the discriminants. The discriminants are calculated
--- by function calls. The test verifies that Constraint_Error is raised
--- during the object creations when values of discriminants are
--- incompatible with the subtypes.
---
--- Inspired by C37213A.ADA, C37213C.ADA, C37215A.ADA and C37215C.ADA.
---
---
--- CHANGE HISTORY:
--- 05 Apr 96 SAIC Initial version for ACVC 2.1.
---
---!
-
-with Report;
-
-procedure C371002 is
-
- subtype Small_Int is Integer range 1..10;
-
- type Rec_W_Disc (Disc1, Disc2 : Small_Int) is
- record
- Str1 : String (1 .. Disc1) := (others => '*');
- Str2 : String (1 .. Disc2) := (others => '*');
- end record;
-
- type My_Array is array (Small_Int range <>) of Integer;
-
- Func1_Cons : Integer := 0;
-
- ---------------------------------------------------------
- function Chk (Cons : Integer;
- Value : Integer;
- Message : String) return Boolean is
- begin
- if Cons /= Value then
- Report.Failed (Message & ": Func1_Cons is " &
- Integer'Image(Func1_Cons));
- end if;
- return True;
- end Chk;
-
- ---------------------------------------------------------
- function Func1 return Integer is
- begin
- Func1_Cons := Func1_Cons + Report.Ident_Int(1);
- return Func1_Cons;
- end Func1;
-
-begin
- Report.Test ("C371002", "Check that if a discriminant constraint " &
- "depends on a discriminant, the evaluation of the " &
- "expressions in the constraint is deferred until " &
- "object declarations");
-
- ---------------------------------------------------------
- declare
- type Rec1 (D3 : Integer) is
- record
- C1 : Rec_W_Disc (D3, Func1); -- Func1 evaluated, value 1.
- end record;
-
- Chk1 : Boolean := Chk (Func1_Cons, 1,
- "Func1 not evaluated for Rec1");
-
- Obj1 : Rec1 (1); -- Func1 not evaluated again.
- Obj2 : Rec1 (2); -- Func1 not evaluated again.
-
- Chk2 : Boolean := Chk (Func1_Cons, 1,
- "Func1 evaluated too many times");
- begin
- if Obj1 /= (D3 => 1,
- C1 => (Disc1 => 1,
- Disc2 => 1,
- Str1 => (others => '*'),
- Str2 => (others => '*'))) or
- Obj2 /= (D3 => 2,
- C1 => (Disc1 => 2,
- Disc2 => 1,
- Str1 => (others => '*'),
- Str2 => (others => '*'))) then
- Report.Failed ("Obj1 & Obj2 - Discriminant values not correct");
- end if;
- end;
-
- ---------------------------------------------------------
- Func1_Cons := -11;
-
- declare
- type Rec_Of_Rec_01 (D3 : Integer) is
- record
- C1 : Rec_W_Disc (D3, Func1); -- Func1 evaluated, value -10.
- end record; -- Constraint_Error not raised.
-
- type Rec_Of_MyArr_01 (D3 : Integer) is
- record
- C1 : My_Array (Func1 .. D3); -- Func1 evaluated, value -9.
- end record; -- Constraint_Error not raised.
-
- type Rec_Of_Rec_02 (D3 : Integer) is
- record
- C1 : Rec_W_Disc (D3, 1);
- end record;
-
- type Rec_Of_MyArr_02 (D3 : Integer) is
- record
- C1 : My_Array (D3 .. 1);
- end record;
-
- begin
-
- ---------------------------------------------------------
- begin
- declare
- Obj3 : Rec_Of_Rec_01(1); -- Constraint_Error raised.
- begin
- Report.Failed ("Obj3 - Constraint_Error should be raised");
- if Obj3 /= (1, (1, 1, others => (others => '*'))) then
- Report.Comment ("Obj3 - Shouldn't get here");
- end if;
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj3 - others exception raised");
- end;
-
- ---------------------------------------------------------
- begin
- declare
- subtype Subtype_Rec is Rec_Of_Rec_01(1);
- -- No Constraint_Error raised.
- begin
- declare
- Obj4 : Subtype_Rec; -- Constraint_Error raised.
- begin
- Report.Failed ("Obj4 - Constraint_Error should be raised");
- if Obj4 /= (D3 => 1,
- C1 => (Disc1 => 1,
- Disc2 => 1,
- Str1 => (others => '*'),
- Str2 => (others => '*'))) then
- Report.Comment ("Obj4 - Shouldn't get here");
- end if;
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj4 - others exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Subtype_Rec - Constraint_Error raised");
- when others =>
- Report.Failed ("Subtype_Rec - others exception raised");
- end;
-
- ---------------------------------------------------------
- begin
- declare
- type Arr is array (1..5) -- No Constraint_Error raised.
- of Rec_Of_Rec_01(1);
-
- begin
- declare
- Obj5 : Arr; -- Constraint_Error raised.
- begin
- Report.Failed ("Obj5 - Constraint_Error should be raised");
- if Obj5 /= (1..5 => (1, (1, 1, others => (others => '*')))) then
- Report.Comment ("Obj5 - Shouldn't get here");
- end if;
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj5 - others exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Arr - Constraint_Error raised");
- when others =>
- Report.Failed ("Arr - others exception raised");
- end;
-
- ---------------------------------------------------------
- begin
- declare
- type Rec_Of_Rec_Of_MyArr is
- record
- C1 : Rec_Of_MyArr_01(1); -- No Constraint_Error raised.
- end record;
- begin
- declare
- Obj6 : Rec_Of_Rec_Of_MyArr; -- Constraint_Error raised.
- begin
- Report.Failed ("Obj6 - Constraint_Error should be raised");
- if Obj6 /= (C1 => (1, (1, 1))) then
- Report.Comment ("Obj6 - Shouldn't get here");
- end if;
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj6 - others exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Rec_Of_Rec_Of_MyArr - Constraint_Error raised");
- when others =>
- Report.Failed ("Rec_Of_Rec_Of_MyArr - others exception raised");
- end;
-
- ---------------------------------------------------------
- begin
- declare
- type New_Rec is
- new Rec_Of_MyArr_01(1); -- No Constraint_Error raised.
-
- begin
- declare
- Obj7 : New_Rec; -- Constraint_Error raised.
- begin
- Report.Failed ("Obj7 - Constraint_Error should be raised");
- if Obj7 /= (1, (1, 1)) then
- Report.Comment ("Obj7 - Shouldn't get here");
- end if;
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj7 - others exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("New_Rec - Constraint_Error raised");
- when others =>
- Report.Failed ("New_Rec - others exception raised");
- end;
-
- ---------------------------------------------------------
- begin
- declare
- type Acc_Rec is
- access Rec_Of_Rec_02 (Report.Ident_Int(0));
- -- No Constraint_Error raised.
- begin
- declare
- Obj8 : Acc_Rec; -- No Constraint_Error raised.
-
- begin
- Obj8 := new Rec_Of_Rec_02 (Report.Ident_Int(0));
- -- Constraint_Error raised.
-
- Report.Failed ("Obj8 - Constraint_Error should be raised");
- if Obj8.all /= (D3 => 1,
- C1 => (Disc1 => 1,
- Disc2 => 1,
- Str1 => (others => '*'),
- Str2 => (others => '*'))) then
- Report.Comment ("Obj8 - Shouldn't get here");
- end if;
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj8 - others exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Acc_Rec - Constraint_Error raised");
- when others =>
- Report.Failed ("Acc_Rec - others exception raised");
- end;
-
- ---------------------------------------------------------
- begin
- declare
- type Acc_Rec_MyArr is access
- Rec_Of_MyArr_02; -- No Constraint_Error
- -- raised for either
- Obj9 : Acc_Rec_MyArr; -- declaration.
-
- begin
- Obj9 := new Rec_Of_MyArr_02 (Report.Ident_Int(0));
- -- Constraint_Error raised.
-
- Report.Failed ("Obj9 - Constraint_Error should be raised");
-
- if Obj9.all /= (1, (1, 1)) then
- Report.Comment ("Obj9 - Shouldn't get here");
- end if;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj9 - others exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Acc_Rec_MyArr - Constraint_Error raised");
- when others =>
- Report.Failed ("Acc_Rec_MyArr - others exception raised");
- end;
-
- end;
-
- Report.Result;
-
-exception
- when others =>
- Report.Failed ("Discriminant value checked too soon");
- Report.Result;
-
-end C371002;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c371003.a b/gcc/testsuite/ada/acats/tests/c3/c371003.a
deleted file mode 100644
index c4a8345f610..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c371003.a
+++ /dev/null
@@ -1,474 +0,0 @@
--- C371003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if a discriminant constraint depends on a discriminant,
--- the evaluation of the expressions in the constraint is deferred
--- until an object of the subtype is created. Check for cases of
--- records where the component containing the constraint is present
--- in the subtype.
---
--- TEST DESCRIPTION:
--- This transition test defines record types with discriminant components
--- which depend on the discriminants. The discriminants are calculated
--- by function calls. The test verifies that Constraint_Error is raised
--- during the object creations when values of discriminants are
--- incompatible with the subtypes. Also check for cases, where the
--- component is absent.
---
--- Inspired by C37213E.ADA, C37213G.ADA, C37215E.ADA, and C37215G.ADA.
---
---
--- CHANGE HISTORY:
--- 10 Apr 96 SAIC Initial version for ACVC 2.1.
--- 14 Jul 96 SAIC Modified test description. Added exception handler
--- for VObj_10 assignment.
--- 26 Oct 96 SAIC Added LM references.
---
---!
-
-with Report;
-
-procedure C371003 is
-
- subtype Small_Int is Integer range 1..10;
-
- type Rec_W_Disc (Disc1, Disc2 : Small_Int) is
- record
- Str1 : String (1 .. Disc1) := (others => '*');
- Str2 : String (1 .. Disc2) := (others => '*');
- end record;
-
- type My_Array is array (Small_Int range <>) of Integer;
-
- Func1_Cons : Integer := 0;
-
- ---------------------------------------------------------
- function Chk (Cons : Integer;
- Value : Integer;
- Message : String) return Boolean is
- begin
- if Cons /= Value then
- Report.Failed (Message & ": Func1_Cons is " &
- Integer'Image(Func1_Cons));
- end if;
- return True;
- end Chk;
-
- ---------------------------------------------------------
- function Func1 return Integer is
- begin
- Func1_Cons := Func1_Cons + Report.Ident_Int(1);
- return Func1_Cons;
- end Func1;
-
-
-begin
- Report.Test ("C371003", "Check that if a discriminant constraint " &
- "depends on a discriminant, the evaluation of the " &
- "expressions in the constraint is deferred until " &
- "object declarations");
-
- ---------------------------------------------------------
- declare
- type VRec_01 (D3 : Integer) is
- record
- case D3 is
- when -5..10 =>
- C1 : Rec_W_Disc (D3, Func1); -- Func1 evaluated, value 1.
- when others =>
- C2 : Integer := Report.Ident_Int(0);
- end case;
- end record;
-
- Chk1 : Boolean := Chk (Func1_Cons, 1,
- "Func1 not evaluated for VRec_01");
-
- VObj_1 : VRec_01(1); -- Func1 not evaluated again
- VObj_2 : VRec_01(2); -- Func1 not evaluated again
-
- Chk2 : Boolean := Chk (Func1_Cons, 1,
- "Func1 evaluated too many times");
-
- begin
- if VObj_1 /= (D3 => 1,
- C1 => (Disc1 => 1,
- Disc2 => 1,
- Str1 => (others => '*'),
- Str2 => (others => '*'))) or
- VObj_2 /= (D3 => 2,
- C1 => (Disc1 => 2,
- Disc2 => 1,
- Str1 => (others => '*'),
- Str2 => (others => '*'))) then
- Report.Failed ("VObj_1 & VObj_2 - Discriminant values not correct");
- end if;
- end;
-
- ---------------------------------------------------------
- Func1_Cons := -11;
-
- declare
- type VRec_Of_VRec_01 (D3 : Integer) is
- record
- case D3 is
- when -5..10 =>
- C1 : Rec_W_Disc (Func1, D3); -- Func1 evaluated, value -10.
- when others => -- Constraint_Error not raised.
- C2 : Integer := Report.Ident_Int(0);
- end case;
- end record;
-
- type VRec_Of_VRec_02 (D3 : Integer) is
- record
- case D3 is
- when -5..10 =>
- C1 : Rec_W_Disc (1, D3);
- when others =>
- C2 : Integer := Report.Ident_Int(0);
- end case;
- end record;
-
- type VRec_Of_MyArr_01 (D3 : Integer) is
- record
- case D3 is
- when -5..10 =>
- C1 : My_Array (Func1..D3); -- Func1 evaluated, value -9.
- when others => -- Constraint_Error not raised.
- C2 : Integer := Report.Ident_Int(0);
- end case;
- end record;
-
- type VRec_Of_MyArr_02 (D3 : Integer) is
- record
- case D3 is
- when -5..10 =>
- C1 : My_Array (D3..1);
- when others =>
- C2 : Integer := Report.Ident_Int(0);
- end case;
- end record;
-
- begin
-
- ---------------------------------------------------------
- -- Component containing the constraint is present.
- begin
- declare
- VObj_3 : VRec_Of_VRec_01(1); -- Constraint_Error raised.
- begin
- Report.Failed ("VObj_3 - Constraint_Error should be raised");
- if VObj_3 /= (1, (1, 1, others => (others => '*'))) then
- Report.Comment ("VObj_3 - Shouldn't get here");
- end if;
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("VObj_3 - unexpected exception raised");
- end;
-
- ---------------------------------------------------------
- -- Component containing the constraint is present.
- begin
- declare
- subtype Subtype_VRec is -- No Constraint_Error raised.
- VRec_Of_VRec_01(Report.Ident_Int(1));
- begin
- declare
- VObj_4 : Subtype_VRec; -- Constraint_Error raised.
- begin
- Report.Failed ("VObj_4 - Constraint_Error should be raised");
- if VObj_4 /= (D3 => 1,
- C1 => (Disc1 => 1,
- Disc2 => 1,
- Str1 => (others => '*'),
- Str2 => (others => '*'))) then
- Report.Comment ("VObj_4 - Shouldn't get here");
- end if;
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("VObj_4 - unexpected exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Subtype_VRec - Constraint_Error raised");
- when others =>
- Report.Failed ("Subtype_VRec - unexpected exception raised");
- end;
-
- ---------------------------------------------------------
- -- Component containing the constraint is absent.
- begin
- declare
- type Arr is array (1..5) of
- VRec_Of_VRec_01(Report.Ident_Int(-6)); -- No Constraint_Error
- VObj_5 : Arr; -- for either declaration.
-
- begin
- if VObj_5 /= (1 .. 5 => (-6, 0)) then
- Report.Comment ("VObj_5 - wrong values");
- end if;
- end;
-
- exception
- when others =>
- Report.Failed ("Arr - unexpected exception raised");
- end;
-
- ---------------------------------------------------------
- -- Component containing the constraint is present.
- begin
- declare
- type Rec_Of_Rec_Of_MyArr is
- record
- C1 : VRec_Of_MyArr_01(1); -- No Constraint_Error raised.
- end record;
- begin
- declare
- Obj_6 : Rec_Of_Rec_Of_MyArr; -- Constraint_Error raised.
- begin
- Report.Failed ("Obj_6 - Constraint_Error should be raised");
- if Obj_6 /= (C1 => (1, (1, 1))) then
- Report.Comment ("Obj_6 - Shouldn't get here");
- end if;
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("Obj_6 - unexpected exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Rec_Of_Rec_Of_MyArr - Constraint_Error raised");
- when others =>
- Report.Failed ("Rec_Of_Rec_Of_MyArr - unexpected exception " &
- "raised");
- end;
-
- ---------------------------------------------------------
- -- Component containing the constraint is absent.
- begin
- declare
- type New_VRec_Arr is
- new VRec_Of_MyArr_01(11); -- No Constraint_Error raised
- Obj_7 : New_VRec_Arr; -- for either declaration.
-
- begin
- if Obj_7 /= (11, 0) then
- Report.Failed ("Obj_7 - value incorrect");
- end if;
- end;
-
- exception
- when others =>
- Report.Failed ("New_VRec_Arr - unexpected exception raised");
- end;
-
- ---------------------------------------------------------
- -- Component containing the constraint is present.
- begin
- declare
- type New_VRec is new
- VRec_Of_VRec_02(Report.Ident_Int(0)); -- No Constraint_Error
- -- raised.
- begin
- declare
- VObj_8 : New_VRec; -- Constraint_Error raised.
- begin
- Report.Failed ("VObj_8 - Constraint_Error should be raised");
- if VObj_8 /= (1, (1, 1, others => (others => '*'))) then
- Report.Comment ("VObj_8 - Shouldn't get here");
- end if;
- end;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("VObj_8 - unexpected exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("New_VRec - Constraint_Error raised");
- when others =>
- Report.Failed ("New_VRec - unexpected exception raised");
- end;
-
- ---------------------------------------------------------
- -- Component containing the constraint is absent.
- begin
- declare
- subtype Sub_VRec is
- VRec_Of_VRec_02(Report.Ident_Int(11)); -- No Constraint_Error
- VObj_9 : Sub_VRec; -- raised for either
- -- declaration.
- begin
- if VObj_9 /= (11, 0) then
- Report.Comment ("VObj_9 - wrong values");
- end if;
- end;
-
- exception
- when others =>
- Report.Failed ("Sub_VRec - unexpected exception raised");
- end;
-
- ---------------------------------------------------------
- -- Component containing the constraint is present.
- begin
- declare
- type Acc_VRec_01 is access
- VRec_Of_VRec_02(Report.Ident_Int(0)); -- No Constraint_Error
- -- raised.
- begin
- declare
- VObj_10 : Acc_VRec_01; -- No Constraint_Error
- -- raised.
- begin
- VObj_10 := new VRec_Of_VRec_02
- (Report.Ident_Int(0)); -- Constraint_Error
- -- raised.
- Report.Failed ("VObj_10 - Constraint_Error should be raised");
- if VObj_10.all /= (1, (1, 1, others => (others => '*'))) then
- Report.Comment ("VObj_10 - Shouldn't get here");
- end if;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("VObj_10 - unexpected exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("VObj_10 - Constraint_Error exception raised");
- when others =>
- Report.Failed ("VObj_10 - unexpected exception raised at " &
- "declaration");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Acc_VRec_01 - Constraint_Error raised");
- when others =>
- Report.Failed ("Acc_VRec_01 - unexpected exception raised");
- end;
-
- ---------------------------------------------------------
- -- Component containing the constraint is absent.
- begin
- declare
- type Acc_VRec_02 is access
- VRec_Of_VRec_02(11); -- No Constraint_Error
- -- raised for either
- VObj_11 : Acc_VRec_02; -- declaration.
-
- begin
- VObj_11 := new VRec_Of_VRec_02(11);
- if VObj_11.all /= (11, 0) then
- Report.Comment ("VObj_11 - wrong values");
- end if;
- end;
-
- exception
- when others =>
- Report.Failed ("Acc_VRec_02 - unexpected exception raised");
- end;
-
- ---------------------------------------------------------
- -- Component containing the constraint is present.
- begin
- declare
- type Acc_VRec_03 is access
- VRec_Of_MyArr_02; -- No Constraint_Error
- -- raised for either
- VObj_12 : Acc_VRec_03; -- declaration.
- begin
- VObj_12 := new VRec_Of_MyArr_02
- (Report.Ident_Int(0)); -- Constraint_Error raised.
-
- Report.Failed ("VObj_12 - Constraint_Error should be raised");
- if VObj_12.all /= (1, (1, 1)) then
- Report.Comment ("VObj_12 - Shouldn't get here");
- end if;
-
- exception
- when Constraint_Error => -- Exception expected.
- null;
- when others =>
- Report.Failed ("VObj_12 - unexpected exception raised");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Acc_VRec_03 - Constraint_Error raised");
- when others =>
- Report.Failed ("Acc_VRec_03 - unexpected exception raised");
- end;
-
- ---------------------------------------------------------
- -- Component containing the constraint is absent.
- begin
- declare
- type Acc_VRec_04 is access
- VRec_Of_MyArr_02(11); -- No Constraint_Error
- -- raised for either
- VObj_13 : Acc_VRec_04; -- declaration.
-
- begin
- VObj_13 := new VRec_Of_MyArr_02(11);
- if VObj_13.all /= (11, 0) then
- Report.Comment ("VObj_13 - wrong values");
- end if;
- end;
-
- exception
- when others =>
- Report.Failed ("Acc_VRec_04 - unexpected exception raised");
- end;
-
- end;
-
- Report.Result;
-
-exception
- when others =>
- Report.Failed ("Discriminant value checked too soon");
- Report.Result;
-
-end C371003;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c380001.a b/gcc/testsuite/ada/acats/tests/c3/c380001.a
deleted file mode 100644
index 0ebe4d31cfb..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c380001.a
+++ /dev/null
@@ -1,128 +0,0 @@
--- C380001.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE ACAA MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that checks are made properly when a per-object expression contains
--- an attribute whose prefix denotes the current instance of the type.
--- (Defect Report 8652/0002, as reflected in Technical Corrigendum 1,
--- RM95 3.8(18/1)).
---
--- CHANGE HISTORY:
--- 9 FEB 2001 PHL Initial version.
--- 29 JUN 2002 RLB Readied for release.
---
---!
-with Ada.Exceptions;
-use Ada.Exceptions;
-with Report;
-use Report;
-procedure C380001 is
-
- type Negative is range Integer'First .. -1;
-
- type R1 is
- record
- C : Negative := Negative (Ident_Int (R1'Size));
- end record;
-
-
- type R2;
-
- type R3 (D1 : access R2; D2 : Natural) is limited null record;
-
- type R2 is limited
- record
- C : R3 (R2'Access, Ident_Int (-1));
- end record;
-
-begin
- Test ("C380001", "Check that checks are made properly when a " &
- "per-object expression contains an attribute whose " &
- "prefix denotes the current instance of the type");
- begin
- declare
- X : R1;
- begin
- Failed
- ("No exception raised when evaluating a per-object expression " &
- "containing an attribute - 1");
- end;
- exception
- when Constraint_Error =>
- null;
- when E: others =>
- Failed ("Exception " & Exception_Name (E) &
- " raised - " & Exception_Information (E) & " - 1");
- end;
-
- declare
- type A is access R1;
- X : A;
- begin
- X := new R1;
- Failed ("No exception raised when evaluating a per-object expression " &
- "containing an attribute - 2");
- exception
- when Constraint_Error =>
- null;
- when E: others =>
- Failed ("Exception " & Exception_Name (E) &
- " raised - " & Exception_Information (E) & " - 2");
- end;
-
- begin
- declare
- X : R2;
- begin
- Failed
- ("No exception raised when elaborating a per-object constraint " &
- "containing an attribute - 3");
- end;
- exception
- when Constraint_Error =>
- null;
- when E: others =>
- Failed ("Exception " & Exception_Name (E) &
- " raised - " & Exception_Information (E) & " - 3");
- end;
-
- declare
- type A is access R2;
- X : A;
- begin
- X := new R2;
- Failed
- ("No exception raised when evaluating a per-object constraint " &
- "containing an attribute - 4");
- exception
- when Constraint_Error =>
- null;
- when E: others =>
- Failed ("Exception " & Exception_Name (E) &
- " raised - " & Exception_Information (E) & " - 4");
- end;
-
- Result;
-end C380001;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c380002.a b/gcc/testsuite/ada/acats/tests/c3/c380002.a
deleted file mode 100644
index ae58676cb26..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c380002.a
+++ /dev/null
@@ -1,72 +0,0 @@
--- C380002.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE ACAA MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an expression in a per-object discriminant constraint which is
--- part of a named association is evaluated once for each association.
--- (Defect Report 8652/0002, as reflected in Technical Corrigendum 1,
--- RM95 3.8(18.1/1)).
---
--- CHANGE HISTORY:
--- 9 FEB 2001 PHL Initial version.
--- 29 JUN 2002 RLB Readied for release.
---
---!
-with Ada.Exceptions;
-use Ada.Exceptions;
-with Report;
-use Report;
-procedure C380002 is
-
- F_Val : Integer := Ident_Int (0);
-
- function F return Integer is
- begin
- F_Val := F_Val + Ident_Int (1);
- return F_Val;
- end F;
-
- type R1;
-
- type R2 (D0 : Integer; D1 : access R1; D2 : Integer; D3 : Integer) is
- limited null record;
-
- type R1 is limited
- record
- C : R2 (D1 => R1'Access, D0 | D2 | D3 => F);
- end record;
-
-begin
- Test ("C380002", "Check that an expression in a per-object discriminant " &
- "constraint which is part of a named association is " &
- "evaluated once for each association");
-
- if not Equal (F_Val, 3) then
- Failed ("Expression not evaluated the proper number of times");
- end if;
-
- Result;
-end C380002;
-
diff --git a/gcc/testsuite/ada/acats/tests/c3/c380003.a b/gcc/testsuite/ada/acats/tests/c3/c380003.a
deleted file mode 100644
index 451d177036c..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c380003.a
+++ /dev/null
@@ -1,223 +0,0 @@
--- C380003.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE ACAA MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that per-object expressions are evaluated as specified for
--- protected components. (Defect Report 8652/0002, as reflected in
--- Technical Corrigendum 1, RM95 3.6(22/1) and 3.8(18/1)).
---
--- CHANGE HISTORY:
--- 9 FEB 2001 PHL Initial version.
--- 29 JUN 2002 RLB Readied for release.
---
---!
-with Report;
-use Report;
-procedure C380003 is
-
- subtype Sm is Integer range 1 .. 10;
-
- type Rec (D1, D2 : Sm) is
- record
- null;
- end record;
-
-begin
- Test ("C380003",
- "Check compatibility of discriminant expressions" &
- " when the constraint depends on discriminants, " &
- "and the discriminants have defaults - protected components");
-
- declare
- protected type Cons (D3 : Integer := Ident_Int (11)) is
- function C1_D1 return Integer;
- function C1_D2 return Integer;
- private
- C1 : Rec (D3, 1);
- end Cons;
- protected body Cons is
- function C1_D1 return Integer is
- begin
- return C1.D1;
- end C1_D1;
- function C1_D2 return Integer is
- begin
- return C1.D2;
- end C1_D2;
- end Cons;
-
- function Is_Ok
- (C : Cons; D3 : Integer; C1_D1 : Integer; C1_D2 : Integer)
- return Boolean is
- begin
- return C.D3 = D3 and C.C1_D1 = C1_D1 and C.C1_D2 = C1_D2;
- end Is_Ok;
-
- begin
- begin
- declare
- X : Cons;
- begin
- Failed ("Discriminant check not performed - 1");
- if not Is_Ok (X, 1, 1, 1) then
- Comment ("Shouldn't get here");
- end if;
- end;
- exception
- when Constraint_Error =>
- null;
- when others =>
- Failed ("Unexpected exception - 1");
- end;
-
- begin
- declare
- type Acc_Cons is access Cons;
- X : Acc_Cons;
- begin
- X := new Cons;
- Failed ("Discriminant check not performed - 2");
- begin
- if not Is_Ok (X.all, 1, 1, 1) then
- Comment ("Irrelevant");
- end if;
- end;
- exception
- when Constraint_Error =>
- null;
- when others =>
- Failed ("Unexpected exception raised - 2");
- end;
- exception
- when others =>
- Failed ("Constraint checked too soon - 2");
- end;
-
- begin
- declare
- subtype Scons is Cons;
- begin
- declare
- X : Scons;
- begin
- Failed ("Discriminant check not performed - 3");
- if not Is_Ok (X, 1, 1, 1) then
- Comment ("Irrelevant");
- end if;
- end;
- exception
- when Constraint_Error =>
- null;
- when others =>
- Failed ("Unexpected exception raised - 3");
- end;
- exception
- when others =>
- Failed ("Constraint checked too soon - 3");
- end;
-
- begin
- declare
- type Arr is array (1 .. 5) of Cons;
- begin
- declare
- X : Arr;
- begin
- Failed ("Discriminant check not performed - 4");
- for I in Arr'Range loop
- if not Is_Ok (X (I), 1, 1, 1) then
- Comment ("Irrelevant");
- end if;
- end loop;
- end;
- exception
- when Constraint_Error =>
- null;
- when others =>
- Failed ("Unexpected exception raised - 4");
- end;
- exception
- when others =>
- Failed ("Constraint checked too soon - 4");
- end;
-
- begin
- declare
- type Nrec is
- record
- C1 : Cons;
- end record;
- begin
- declare
- X : Nrec;
- begin
- Failed ("Discriminant check not performed - 5");
- if not Is_Ok (X.C1, 1, 1, 1) then
- Comment ("Irrelevant");
- end if;
- end;
- exception
- when Constraint_Error =>
- null;
- when others =>
- Failed ("Unexpected exception raised - 5");
- end;
- exception
- when others =>
- Failed ("Constraint checked too soon - 5");
- end;
-
- begin
- declare
- type Drec is new Cons;
- begin
- declare
- X : Drec;
- begin
- Failed ("Discriminant check not performed - 6");
- if not Is_Ok (Cons (X), 1, 1, 1) then
- Comment ("Irrelevant");
- end if;
- end;
- exception
- when Constraint_Error =>
- null;
- when others =>
- Failed ("Unexpected exception raised - 6");
- end;
- exception
- when others =>
- Failed ("Constraint checked too soon - 6");
- end;
-
- end;
-
- Result;
-
-exception
- when others =>
- Failed ("Constraint check done too early");
- Result;
-end C380003;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c380004.a b/gcc/testsuite/ada/acats/tests/c3/c380004.a
deleted file mode 100644
index f83728b5f48..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c380004.a
+++ /dev/null
@@ -1,385 +0,0 @@
--- C380004.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE ACAA MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that per-object expressions are evaluated as specified for entry
--- families and protected components. (Defect Report 8652/0002,
--- as reflected in Technical Corrigendum 1, RM95 3.6(22/1), 3.8(18/1), and
--- 9.5.2(22/1)).
---
--- CHANGE HISTORY:
--- 9 FEB 2001 PHL Initial version.
--- 29 JUN 2002 RLB Readied for release.
---
---!
-with Report;
-use Report;
-procedure C380004 is
-
- type Rec (D1, D2 : Positive) is
- record
- null;
- end record;
-
- F1_Poe : Integer;
-
- function Chk (Poe : Integer; Value : Integer; Message : String)
- return Boolean is
- begin
- if Poe /= Value then
- Failed (Message & ": Poe is " & Integer'Image (Poe));
- end if;
- return True;
- end Chk;
-
- function F1 return Integer is
- begin
- F1_Poe := F1_Poe - Ident_Int (1);
- return F1_Poe;
- end F1;
-
- generic
- type T is limited private;
- with function Is_Ok (X : T;
- Param1 : Integer;
- Param2 : Integer;
- Param3 : Integer) return Boolean;
- procedure Check;
-
- procedure Check is
- begin
-
- declare
- type Poe is new T;
- Chk1 : Boolean := Chk (F1_Poe, 17, "F1 evaluated");
- X : Poe; -- F1 evaluated
- Y : Poe; -- F1 evaluated
- Chk2 : Boolean := Chk (F1_Poe, 15, "F1 not evaluated");
- begin
- if not Is_Ok (T (X), 16, 16, 17) or
- not Is_Ok (T (Y), 15, 15, 17) then
- Failed ("Discriminant values not correct - 0");
- end if;
- end;
-
- declare
- type Poe is new T;
- begin
- begin
- declare
- X : Poe;
- begin
- if not Is_Ok (T (X), 14, 14, 17) then
- Failed ("Discriminant values not correct - 1");
- end if;
- end;
- exception
- when others =>
- Failed ("Unexpected exception - 1");
- end;
-
- declare
- type Acc_Poe is access Poe;
- X : Acc_Poe;
- begin
- X := new Poe;
- begin
- if not Is_Ok (T (X.all), 13, 13, 17) then
- Failed ("Discriminant values not correct - 2");
- end if;
- end;
- exception
- when others =>
- Failed ("Unexpected exception raised - 2");
- end;
-
- declare
- subtype Spoe is Poe;
- X : Spoe;
- begin
- if not Is_Ok (T (X), 12, 12, 17) then
- Failed ("Discriminant values not correct - 3");
- end if;
- exception
- when others =>
- Failed ("Unexpected exception raised - 3");
- end;
-
- declare
- type Arr is array (1 .. 2) of Poe;
- X : Arr;
- begin
- if Is_Ok (T (X (1)), 11, 11, 17) and then
- Is_Ok (T (X (2)), 10, 10, 17) then
- null;
- elsif Is_Ok (T (X (2)), 11, 11, 17) and then
- Is_Ok (T (X (1)), 10, 10, 17) then
- null;
- else
- Failed ("Discriminant values not correct - 4");
- end if;
- exception
- when others =>
- Failed ("Unexpected exception raised - 4");
- end;
-
- declare
- type Nrec is
- record
- C1, C2 : Poe;
- end record;
- X : Nrec;
- begin
- if Is_Ok (T (X.C1), 8, 8, 17) and then
- Is_Ok (T (X.C2), 9, 9, 17) then
- null;
- elsif Is_Ok (T (X.C2), 8, 8, 17) and then
- Is_Ok (T (X.C1), 9, 9, 17) then
- null;
- else
- Failed ("Discriminant values not correct - 5");
- end if;
- exception
- when others =>
- Failed ("Unexpected exception raised - 5");
- end;
-
- declare
- type Drec is new Poe;
- X : Drec;
- begin
- if not Is_Ok (T (X), 7, 7, 17) then
- Failed ("Discriminant values not correct - 6");
- end if;
- exception
- when others =>
- Failed ("Unexpected exception raised - 6");
- end;
- end;
- end Check;
-
-
-begin
- Test ("C380004",
- "Check evaluation of discriminant expressions " &
- "when the constraint depends on a discriminant, " &
- "and the discriminants have defaults - discriminant-dependent" &
- "entry families and protected components");
-
-
- Comment ("Discriminant-dependent entry families for task types");
-
- F1_Poe := 18;
-
- declare
- task type Poe (D3 : Positive := F1) is
- entry E (D3 .. F1); -- F1 evaluated
- entry Is_Ok (D3 : Integer;
- E_First : Integer;
- E_Last : Integer;
- Ok : out Boolean);
- end Poe;
- task body Poe is
- begin
- loop
- select
- accept Is_Ok (D3 : Integer;
- E_First : Integer;
- E_Last : Integer;
- Ok : out Boolean) do
- declare
- Cnt : Natural;
- begin
- if Poe.D3 = D3 then
- -- Can't think of a better way to check the
- -- bounds of the entry family.
- begin
- Cnt := E (E_First)'Count;
- Cnt := E (E_Last)'Count;
- exception
- when Constraint_Error =>
- Ok := False;
- return;
- end;
- begin
- Cnt := E (E_First - 1)'Count;
- Ok := False;
- return;
- exception
- when Constraint_Error =>
- null;
- when others =>
- Ok := False;
- return;
- end;
- begin
- Cnt := E (E_Last + 1)'Count;
- Ok := False;
- return;
- exception
- when Constraint_Error =>
- null;
- when others =>
- Ok := False;
- return;
- end;
- Ok := True;
- else
- Ok := False;
- return;
- end if;
- end;
- end Is_Ok;
- or
- terminate;
- end select;
- end loop;
- end Poe;
-
- function Is_Ok
- (C : Poe; D3 : Integer; E_First : Integer; E_Last : Integer)
- return Boolean is
- Ok : Boolean;
- begin
- C.Is_Ok (D3, E_First, E_Last, Ok);
- return Ok;
- end Is_Ok;
-
- procedure Chk is new Check (Poe, Is_Ok);
-
- begin
- Chk;
- end;
-
-
- Comment ("Discriminant-dependent entry families for protected types");
-
- F1_Poe := 18;
-
- declare
- protected type Poe (D3 : Integer := F1) is
- entry E (D3 .. F1); -- F1 evaluated
- function Is_Ok (D3 : Integer; E_First : Integer; E_Last : Integer)
- return Boolean;
- end Poe;
- protected body Poe is
- entry E (for I in D3 .. F1) when True is
- begin
- null;
- end E;
- function Is_Ok (D3 : Integer; E_First : Integer; E_Last : Integer)
- return Boolean is
- Cnt : Natural;
- begin
- if Poe.D3 = D3 then
- -- Can't think of a better way to check the
- -- bounds of the entry family.
- begin
- Cnt := E (E_First)'Count;
- Cnt := E (E_Last)'Count;
- exception
- when Constraint_Error =>
- return False;
- end;
- begin
- Cnt := E (E_First - 1)'Count;
- return False;
- exception
- when Constraint_Error =>
- null;
- when others =>
- return False;
- end;
- begin
- Cnt := E (E_Last + 1)'Count;
- return False;
- exception
- when Constraint_Error =>
- null;
- when others =>
- return False;
- end;
- return True;
- else
- return False;
- end if;
- end Is_Ok;
- end Poe;
-
- function Is_Ok
- (C : Poe; D3 : Integer; E_First : Integer; E_Last : Integer)
- return Boolean is
- begin
- return C.Is_Ok (D3, E_First, E_Last);
- end Is_Ok;
-
- procedure Chk is new Check (Poe, Is_Ok);
-
- begin
- Chk;
- end;
-
- Comment ("Protected components");
-
- F1_Poe := 18;
-
- declare
- protected type Poe (D3 : Integer := F1) is
- function C1_D1 return Integer;
- function C1_D2 return Integer;
- private
- C1 : Rec (D3, F1); -- F1 evaluated
- end Poe;
- protected body Poe is
- function C1_D1 return Integer is
- begin
- return C1.D1;
- end C1_D1;
- function C1_D2 return Integer is
- begin
- return C1.D2;
- end C1_D2;
- end Poe;
-
- function Is_Ok (C : Poe; D3 : Integer; C1_D1 : Integer; C1_D2 : Integer)
- return Boolean is
- begin
- return C.D3 = D3 and C.C1_D1 = C1_D1 and C.C1_D2 = C1_D2;
- end Is_Ok;
-
- procedure Chk is new Check (Poe, Is_Ok);
-
- begin
- Chk;
- end;
-
- Result;
-
-exception
- when others =>
- Failed ("Unexpected exception");
- Result;
-
-end C380004;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3900010.a b/gcc/testsuite/ada/acats/tests/c3/c3900010.a
deleted file mode 100644
index 6d9ddb4a1db..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3900010.a
+++ /dev/null
@@ -1,147 +0,0 @@
--- C3900010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See C3900011.AM.
---
--- TEST DESCRIPTION:
--- See C3900011.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- => C3900010.A
--- C3900011.AM
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 May 96 SAIC ACVC 2.1: Modified prologue. Added pragma Elaborate
--- for Ada.Calendar.
---
---!
-
-with Ada.Calendar;
-pragma Elaborate (Ada.Calendar);
-
-package C3900010 is
-
-
- -- Declarations used by component Display_On and procedure Display.
-
- type Device_Enum is (Null_Device, Teletype, Console, Big_Screen);
- type Display_Counters is array (Device_Enum) of Natural;
-
- Display_Count_For : Display_Counters := (others => 0);
-
-
- -- Declarations required for component Arrival_Time.
-
- Default_Time : constant Ada.Calendar.Time :=
- Ada.Calendar.Time_Of (1901, 1, 1);
- Alert_Time : constant Ada.Calendar.Time :=
- Ada.Calendar.Time_Of (1991, 6, 15);
-
-
- type Alert_Type is tagged record -- Root tagged type.
- Arrival_Time : Ada.Calendar.Time := Default_Time;
- Display_On : Device_Enum := Null_Device;
- end record;
-
-
- procedure Display (A : in Alert_Type); -- To be inherited by
- -- all derivatives.
-
- procedure Handle (A : in out Alert_Type); -- To be inherited by
- -- all derivatives.
-
-
-
- type Low_Alert_Type is new Alert_Type with record -- Record extension of
- Level : Integer := 0; -- root tagged type.
- end record;
-
- -- Inherits procedure Display from Alert.
- -- Inherits procedure Handle from Alert.
-
- function Level_Of (LA : in Low_Alert_Type) -- To be inherited by
- return Integer; -- all derivatives.
-
-
-
- -- Declarations required for component Action_Officer;
-
- type Person_Enum is (Nobody, Duty_Officer,
- Watch_Commander, Commanding_Officer);
-
-
-
- type Medium_Alert_Type is new Low_Alert_Type with record
- Action_Officer : Person_Enum := Nobody; -- Record extension of
- end record; -- record extension.
-
- -- Inherits (inherited) procedure Display from Low_Alert_Type.
- -- Inherits (inherited) procedure Handle from Low_Alert_Type.
-
- -- Inherits function Level_Of from Low_Alert_Type.
-
- procedure Assign_Officer (MA : in out Medium_Alert_Type;
- To : in Person_Enum);
-
-
-end C3900010;
-
-
- --==================================================================--
-
-
-package body C3900010 is
-
-
- procedure Display (A : in Alert_Type) is
- begin
- Display_Count_For (A.Display_On) := Display_Count_For (A.Display_On) + 1;
- end Display;
-
-
- procedure Handle (A : in out Alert_Type) is
- begin
- A.Arrival_Time := Alert_Time;
- end Handle;
-
-
- function Level_Of (LA : in Low_Alert_Type) return Integer is
- begin
- return (LA.Level + 1);
- end Level_Of;
-
-
- procedure Assign_Officer (MA : in out Medium_Alert_Type;
- To : in Person_Enum) is
- begin
- MA.Action_Officer := To;
- end Assign_Officer;
-
-
-end C3900010;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c390002.a b/gcc/testsuite/ada/acats/tests/c3/c390002.a
deleted file mode 100644
index b3d11afed26..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c390002.a
+++ /dev/null
@@ -1,165 +0,0 @@
--- C390002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a tagged base type may be declared, and derived
--- from in simple, private and extended forms. (Overlaps with C390B04)
--- Check that the package Ada.Tags is present and correctly implemented.
--- Check for the correct operation of Expanded_Name, External_Tag and
--- Internal_Tag within that package. Check that the exception Tag_Error
--- is correctly raised on calling Internal_Tag with bad input.
---
--- TEST DESCRIPTION:
--- This test declares a tagged type, and derives three types from it.
--- These types are then used to test the presence and function of the
--- package Ada.Tags.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Removed RM references from objective text.
--- 27 Jan 96 SAIC Update RM references for 2.1
---
---!
-
-with Report;
-with Ada.Tags;
-
-procedure C390002 is
-
- package Vehicle is
-
- type Object is tagged limited private; -- ancestor type
- procedure Create( The_Vehicle : in out Object; Wheels : in Natural );
- function Wheels( The_Vehicle : Object ) return Natural;
-
- private
-
- type Object is tagged limited record
- Wheel_Count : Natural := 0;
- end record;
-
- end Vehicle;
-
- package Motivators is
-
- type Bicycle is new Vehicle.Object with null record; -- simple
-
- type Car is new Vehicle.Object with record -- extended
- Convertible : Boolean;
- end record;
-
- type Truck is new Vehicle.Object with private; -- private
-
- private
-
- type Truck is new Vehicle.Object with record
- Air_Horn : Boolean;
- end record;
-
- end Motivators;
-
- package body Vehicle is
-
- procedure Create( The_Vehicle : in out Object; Wheels : in Natural ) is
- begin
- The_Vehicle.Wheel_Count := Wheels;
- end Create;
-
- function Wheels( The_Vehicle : Object ) return Natural is
- begin
- return The_Vehicle.Wheel_Count;
- end Wheels;
-
- end Vehicle;
-
- function TC_ID_Tag( Tag : in Ada.Tags.Tag ) return Ada.Tags.Tag is
- begin
- return Ada.Tags.Internal_Tag( Ada.Tags.External_Tag( Tag ) );
- Report.Comment("This message intentionally blank.");
- end TC_ID_Tag;
-
- procedure Check_Tags( Machine : in Vehicle.Object'Class;
- Expected_Name : in String;
- External_Tag : in String ) is
- The_Tag : constant Ada.Tags.Tag := Machine'Tag;
- use type Ada.Tags.Tag;
- begin
- if Ada.Tags.Expanded_Name(The_Tag) /= Expected_Name then
- Report.Failed ("Failed in Check_Tags, Expanded_Name "
- & Expected_Name);
- end if;
- if Ada.Tags.External_Tag(The_Tag) /= External_Tag then
- Report.Failed ("Failed in Check_Tags, External_Tag "
- & Expected_Name);
- end if;
- if Ada.Tags.Internal_Tag(External_Tag) /= The_Tag then
- Report.Failed ("Failed in Check_Tags, Internal_Tag "
- & Expected_Name);
- end if;
- end Check_Tags;
-
- procedure Check_Exception is
- Boeing_777_Id : Ada.Tags.Tag;
- begin
- Boeing_777_Id := Ada.Tags.Internal_Tag("!@#$%^:*\/?"" not a tag!");
- Report.Failed ("Failed in Check_Exception, no exception");
- Boeing_777_Id := TC_ID_Tag( Boeing_777_Id );
- exception
- when Ada.Tags.Tag_Error => null;
- when others =>
- Report.Failed ("Failed in Check_Exception, wrong exception");
- end Check_Exception;
-
- use Motivators;
- Two_Wheeler : Bicycle;
- Four_Wheeler : Car;
- Eighteen_Wheeler : Truck;
-
-begin -- Main test procedure.
-
- Report.Test ("C390002", "Check that a tagged type may be declared and " &
- "derived from in simple, private and extended forms. " &
- "Check package Ada.Tags" );
-
- Create( Two_Wheeler, 2 );
- Create( Four_Wheeler, 4 );
- Create( Eighteen_Wheeler, 18 );
-
- Check_Tags( Machine => Two_Wheeler,
- Expected_Name => "C390002.MOTIVATORS.BICYCLE",
- External_Tag => Bicycle'External_Tag );
- Check_Tags( Machine => Four_Wheeler,
- Expected_Name => "C390002.MOTIVATORS.CAR",
- External_Tag => Car'External_Tag );
- Check_Tags( Machine => Eighteen_Wheeler,
- Expected_Name => "C390002.MOTIVATORS.TRUCK",
- External_Tag => Truck'External_Tag );
-
- Check_Exception;
-
- Report.Result;
-
-end C390002;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c390003.a b/gcc/testsuite/ada/acats/tests/c3/c390003.a
deleted file mode 100644
index 643aad1cd18..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c390003.a
+++ /dev/null
@@ -1,419 +0,0 @@
--- C390003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that for a subtype S of a tagged type T, S'Class denotes a
--- class-wide subtype. Check that T'Tag denotes the tag of the type T,
--- and that, for a class-wide tagged type X, X'Tag denotes the tag of X.
--- Check that the tags of stand alone objects, record and array
--- components, aggregates, and formal parameters identify their type.
--- Check that the tag of a value of a formal parameter is that of the
--- actual parameter, even if the actual is passed by a view conversion.
---
--- TEST DESCRIPTION:
--- This test defines a class hierarchy (based on C390002) and
--- uses it to determine the correctness of the resulting tag
--- information generated by the compiler. A type is defined in the
--- class which contains components of the class as part of its
--- definition. This is to reduce the overall number of types
--- required, and to achieve the required nesting to accomplish
--- this test. The model is that of a car carrier truck; both car
--- and truck being in the class of Vehicle.
---
--- Class Hierarchy:
--- Vehicle - - - - - - - (Bicycle)
--- / | \ / \
--- Truck Car Q_Machine Tandem Motorcycle
--- |
--- Auto_Carrier
--- Contains:
--- Auto_Carrier( Car )
--- Q_Machine( Car, Motorcycle )
---
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Removed ARM references from objective text.
--- 20 Dec 94 SAIC Replaced three unnecessary extension
--- aggregates with simple aggregates.
--- 16 Oct 95 SAIC Fixed bugs for ACVC 2.0.1
---
---!
-
------------------------------------------------------------------ C390003_1
-
-with Ada.Tags;
-package C390003_1 is -- Vehicle
-
- type TC_Keys is (Veh, MC, Tand, Car, Q, Truk, Heavy);
- type States is (Good, Flat, Worn);
-
- type Wheel_List is array(Positive range <>) of States;
-
- type Object(Wheels: Positive) is tagged record
- Wheel_State : Wheel_List(1..Wheels);
- end record;
-
- procedure TC_Validate( It: Object; Key: TC_Keys );
- procedure TC_Validate( It: Object'Class; The_Tag: Ada.Tags.Tag );
-
- procedure Create( The_Vehicle : in out Object; Tyres : in States );
- procedure Rotate( The_Vehicle : in out Object );
- function Wheels( The_Vehicle : Object ) return Positive;
-
-end C390003_1; -- Vehicle;
-
------------------------------------------------------------------ C390003_2
-
-with C390003_1;
-package C390003_2 is -- Motivators
-
- package Vehicle renames C390003_1;
- subtype Bicycle is Vehicle.Object(2); -- constrained subtype
-
- type Motorcycle is new Bicycle with record
- Displacement : Natural;
- end record;
- procedure TC_Validate( It: Motorcycle; Key: Vehicle.TC_Keys );
-
- type Tandem is new Bicycle with null record;
- procedure TC_Validate( It: Tandem; Key: Vehicle.TC_Keys );
-
- type Car is new Vehicle.Object(4) with -- extended, constrained
- record
- Displacement : Natural;
- end record;
- procedure TC_Validate( It: Car; Key: Vehicle.TC_Keys );
-
- type Truck is new Vehicle.Object with -- extended, unconstrained
- record
- Tare : Natural;
- end record;
- procedure TC_Validate( It: Truck; Key: Vehicle.TC_Keys );
-
-end C390003_2; -- Motivators;
-
------------------------------------------------------------------ C390003_3
-
-with C390003_1;
-with C390003_2;
-package C390003_3 is -- Special_Trucks
- package Vehicle renames C390003_1;
- package Motivators renames C390003_2;
- Max_Cars_On_Vehicle : constant := 6;
- type Cargo_Index is range 0..Max_Cars_On_Vehicle;
- type Cargo is array(Cargo_Index range 1..Max_Cars_On_Vehicle)
- of Motivators.Car;
- type Auto_Carrier is new Motivators.Truck(18) with
- record
- Load_Count : Cargo_Index := 0;
- Payload : Cargo;
- end record;
- procedure TC_Validate( It: Auto_Carrier; Key: Vehicle.TC_Keys );
- procedure Load ( The_Car : in Motivators.Car;
- Onto : in out Auto_Carrier);
- procedure Unload( The_Car : out Motivators.Car;
- Off_of : in out Auto_Carrier);
-end C390003_3;
-
------------------------------------------------------------------ C390003_4
-
-with C390003_1;
-with C390003_2;
-package C390003_4 is -- James_Bond
-
- package Vehicle renames C390003_1;
- package Motivators renames C390003_2;
-
- type Q_Machine is new Vehicle.Object(4) with record
- Car_Part : Motivators.Car;
- Bike_Part : Motivators.Motorcycle;
- end record;
- procedure TC_Validate( It: Q_Machine; Key: Vehicle.TC_Keys );
-
-end C390003_4;
-
------------------------------------------------------------------ C390003_1
-
-with Report;
-with Ada.Tags;
-package body C390003_1 is -- Vehicle
-
- function "="(A,B: Ada.Tags.Tag) return Boolean renames Ada.Tags."=";
-
- procedure TC_Validate( It: Object; Key: TC_Keys ) is
- begin
- if Key /= Veh then
- Report.Failed("Expected Veh Key");
- end if;
- end TC_Validate;
-
- procedure TC_Validate( It: Object'Class; The_Tag: Ada.Tags.Tag ) is
- begin
- if It'Tag /= The_Tag then
- Report.Failed("Unexpected Tag for classwide formal");
- end if;
- end TC_Validate;
-
- procedure Create( The_Vehicle : in out Object; Tyres : in States ) is
- begin
- The_Vehicle.Wheel_State := ( others => Tyres );
- end Create;
-
- function Wheels( The_Vehicle : Object ) return Positive is
- begin
- return The_Vehicle.Wheels;
- end Wheels;
-
- procedure Rotate( The_Vehicle : in out Object ) is
- Push : States;
- Pulled : States
- := The_Vehicle.Wheel_State(The_Vehicle.Wheel_State'Last);
- begin
- for Finger in
- The_Vehicle.Wheel_State'First..The_Vehicle.Wheel_State'Last loop
- Push := The_Vehicle.Wheel_State(Finger);
- The_Vehicle.Wheel_State(Finger) := Pulled;
- Pulled := Push;
- end loop;
- end Rotate;
-
-end C390003_1; -- Vehicle;
-
------------------------------------------------------------------ C390003_2
-
-with Ada.Tags;
-with Report;
-package body C390003_2 is -- Motivators
-
- function "="(A,B: Ada.Tags.Tag) return Boolean renames Ada.Tags."=";
- function "="(A,B: Vehicle.TC_Keys) return Boolean renames Vehicle."=";
-
- procedure TC_Validate( It: Motorcycle; Key: Vehicle.TC_Keys ) is
- begin
- if Key /= Vehicle.MC then
- Report.Failed("Expected MC Key");
- end if;
- end TC_Validate;
-
- procedure TC_Validate( It: Tandem; Key: Vehicle.TC_Keys ) is
- begin
- if Key /= Vehicle.Tand then
- Report.Failed("Expected Tand Key");
- end if;
- end TC_Validate;
-
- procedure TC_Validate( It: Car; Key: Vehicle.TC_Keys ) is
- begin
- if Key /= Vehicle.Car then
- Report.Failed("Expected Car Key");
- end if;
- end TC_Validate;
-
- procedure TC_Validate( It: Truck; Key: Vehicle.TC_Keys ) is
- begin
- if Key /= Vehicle.Truk then
- Report.Failed("Expected Truk Key");
- end if;
- end TC_Validate;
-end C390003_2; -- Motivators;
-
------------------------------------------------------------------ C390003_3
-
-with Ada.Tags;
-with Report;
-package body C390003_3 is -- Special_Trucks
-
- function "="(A,B: Ada.Tags.Tag) return Boolean renames Ada.Tags."=";
- function "="(A,B: Vehicle.TC_Keys) return Boolean renames Vehicle."=";
-
- procedure TC_Validate( It: Auto_Carrier; Key: Vehicle.TC_Keys ) is
- begin
- if Key /= Vehicle.Heavy then
- Report.Failed("Expected Heavy Key");
- end if;
- end TC_Validate;
-
- procedure Load ( The_Car : in Motivators.Car;
- Onto : in out Auto_Carrier) is
- begin
- Onto.Load_Count := Onto.Load_Count +1;
- Onto.Payload(Onto.Load_Count) := The_Car;
- end Load;
- procedure Unload( The_Car : out Motivators.Car;
- Off_of : in out Auto_Carrier) is
- begin
- The_Car := Off_of.Payload(Off_of.Load_Count);
- Off_of.Load_Count := Off_of.Load_Count -1;
- end Unload;
-
-end C390003_3;
-
------------------------------------------------------------------ C390003_4
-
-with Report, Ada.Tags;
-package body C390003_4 is -- James_Bond
-
- function "="(A,B: Ada.Tags.Tag) return Boolean renames Ada.Tags."=";
- function "="(A,B: Vehicle.TC_Keys) return Boolean renames Vehicle."=";
-
- procedure TC_Validate( It: Q_Machine; Key: Vehicle.TC_Keys ) is
- begin
- if Key /= Vehicle.Q then
- Report.Failed("Expected Q Key");
- end if;
- end TC_Validate;
-
-end C390003_4;
-
-------------------------------------------------------------------- C390003
-
-with Report;
-with C390003_1;
-with C390003_2;
-with C390003_3;
-with C390003_4;
-procedure C390003 is
-
- package Vehicle renames C390003_1; use Vehicle;
- package Motivators renames C390003_2;
- package Special_Trucks renames C390003_3;
- package James_Bond renames C390003_4;
-
- -- The cast, in order of complexity:
-
- Pennys_Bike : Motivators.Bicycle;
- Weekender : Motivators.Tandem;
- Qs_Moped : Motivators.Motorcycle;
- Ms_Limo : Motivators.Car;
- Yard_Van : Motivators.Truck(8);
- Specter_X : Special_Trucks.Auto_Carrier;
- Gen_II : James_Bond.Q_Machine;
-
-
- -- Check compatibility with the corresponding class wide type.
-
- procedure Vehicle_Shop( It : in out Vehicle.Object'Class;
- Key : in Vehicle.TC_Keys ) is
-
- -- Check that Subtype'Class is defined for tagged subtypes.
- procedure Bike_Shop( Bike: in out Motivators.Bicycle'Class ) is
- begin
- -- Dispatch to appropriate TC_Validate
- Vehicle.TC_Validate( Bike, Key );
- end Bike_Shop;
-
- begin
- Vehicle.TC_Validate( It, Key );
- if Vehicle.Wheels( It ) = 2 then
- Bike_Shop( It ); -- only call Bike_Shop when It has 2 wheels
- end if;
- end Vehicle_Shop;
-
-begin -- Main test procedure.
-
- Report.Test ("C390003", "Check that for a subtype S of a tagged type " &
- "T, S'Class denotes a class-wide subtype. Check that " &
- "T'Tag denotes the tag of the type T, and that, for a " &
- "class-wide tagged type X, X'Tag denotes the tag of X. " &
- "Check that the tags of stand alone objects, record and " &
- "array components, aggregates, and formal parameters " &
- "identify their type. Check that the tag of a value of a " &
- "formal parameter is that of the actual parameter, even " &
- "if the actual is passed by a view conversion" );
-
--- Check that the tags of stand alone objects, record and array
--- components, aggregates, and formal parameters identify their type.
--- Check that the tag of a value of a formal parameter is that of the
--- actual parameter, even if the actual is passed by a view conversion.
-
- Vehicle_Shop( Pennys_Bike, Veh );
- Vehicle_Shop( Weekender, Tand );
- Vehicle_Shop( Qs_Moped, MC );
- Vehicle_Shop( Ms_Limo, Car );
- Vehicle_Shop( Yard_Van, Truk );
- Vehicle_Shop( Specter_X, Heavy );
- Vehicle_Shop( Specter_X.Payload(1), Car );
- Vehicle_Shop( Gen_II, Q );
- Vehicle_Shop( Gen_II.Car_Part, Car );
- Vehicle_Shop( Gen_II.Bike_Part, MC );
-
- Vehicle.TC_Validate( Pennys_Bike, Vehicle.Object'Tag );
- Vehicle.TC_Validate( Weekender, Motivators.Tandem'Tag );
- Vehicle.TC_Validate( Qs_Moped, Motivators.Motorcycle'Tag );
- Vehicle.TC_Validate( Ms_Limo, Motivators.Car'Tag );
- Vehicle.TC_Validate( Yard_Van, Motivators.Truck'Tag );
- Vehicle.TC_Validate( Specter_X, Special_Trucks.Auto_Carrier'Tag );
- Vehicle.TC_Validate( Specter_X.Payload(1), Motivators.Car'Tag );
- Vehicle.TC_Validate( Gen_II, James_Bond.Q_Machine'Tag );
- Vehicle.TC_Validate( Gen_II.Car_Part, Motivators.Car'Tag );
- Vehicle.TC_Validate( Gen_II.Bike_Part, Motivators.Motorcycle'Tag );
-
--- Check the tag generated for an aggregate.
-
- Rentals: declare
- Mikes_Rental : Vehicle.Object'Class :=
- Vehicle.Object'( 3, (Good, Flat, Worn));
- Diannes_Car : Vehicle.Object'Class :=
- Motivators.Tandem'( Wheels => 2,
- Wheel_State => (Good, Good) );
- Jims_Bike : Vehicle.Object'Class :=
- Motivators.Motorcycle'( Pennys_Bike
- with Displacement => 350 );
- Bills_Limo : Vehicle.Object'Class :=
- Motivators.Car'( Wheels => 4,
- Wheel_State => (others => Good),
- Displacement => 282 );
- Alans_Car : Vehicle.Object'Class :=
- Motivators.Truck'( 18, (others => Worn),
- Tare => 5_500 );
- Pats_Truck : Vehicle.Object'Class := Specter_X;
- Keiths_Car : Vehicle.Object'Class := Gen_II;
- Isaacs_Bus : Vehicle.Object'Class := Keiths_Car;
-
- begin
- Vehicle.TC_Validate( Mikes_Rental, Vehicle.Object'Tag );
- Vehicle.TC_Validate( Diannes_Car, Motivators.Tandem'Tag );
- Vehicle.TC_Validate( Jims_Bike, Motivators.Motorcycle'Tag );
- Vehicle.TC_Validate( Bills_Limo, Motivators.Car'Tag );
- Vehicle.TC_Validate( Alans_Car, Motivators.Truck'Tag );
- Vehicle.TC_Validate( Pats_Truck, Special_Trucks.Auto_Carrier'Tag );
- Vehicle.TC_Validate( Keiths_Car, James_Bond.Q_Machine'Tag );
- end Rentals;
-
--- Check the tag of parameters.
--- Check that the tag is not affected by view conversion.
-
- Vehicle.TC_Validate( Vehicle.Object( Gen_II ), James_Bond.Q_Machine'Tag );
- Vehicle.TC_Validate( Vehicle.Object( Ms_Limo ), Motivators.Car'Tag );
- Vehicle.TC_Validate( Motivators.Bicycle( Weekender ),
- Motivators.Tandem'Tag );
- Vehicle.TC_Validate( Motivators.Bicycle( Gen_II.Bike_Part ),
- Motivators.Motorcycle'Tag );
-
- Report.Result;
-
-end C390003;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c390004.a b/gcc/testsuite/ada/acats/tests/c3/c390004.a
deleted file mode 100644
index 2c120bab92b..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c390004.a
+++ /dev/null
@@ -1,404 +0,0 @@
--- C390004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the tags of allocated objects correctly identify the
--- type of the allocated object. Check that the tag corresponds
--- correctly to the value resulting from both normal and view
--- conversion. Check that the tags of accessed values designating
--- aliased objects correctly identify the type of the object. Check
--- that the tag of a function result correctly evaluates. Check this
--- for class-wide functions. The tag of a class-wide function result
--- should be the tag appropriate to the actual value returned, not the
--- tag of the ancestor type.
---
--- TEST DESCRIPTION:
--- This test defines a class hierarchy of types, with reference
--- semantics (an access type to the class-wide type). Similar in
--- structure to C392005, this test checks that dynamic allocation does
--- not adversely impact the tagging of types.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C390004_1 is -- DMV
- type Equipment is ( T_Veh, T_Car, T_Con, T_Jep );
-
- type Vehicle is tagged record
- Wheels : Natural := 4;
- Parked : Boolean := False;
- end record;
-
- function Wheels ( It: Vehicle ) return Natural;
- procedure Park ( It: in out Vehicle );
- procedure UnPark ( It: in out Vehicle );
- procedure Set_Wheels( It: in out Vehicle; To_Count: in Natural );
- procedure TC_Check ( It: in Vehicle; To_Equip: in Equipment );
-
- type Car is new Vehicle with record
- Passengers : Natural := 0;
- end record;
-
- function Passengers ( It: Car ) return Natural;
- procedure Load_Passengers( It: in out Car; To_Count: in Natural );
- procedure Park ( It: in out Car );
- procedure TC_Check ( It: in Car; To_Equip: in Equipment );
-
- type Convertible is new Car with record
- Top_Up : Boolean := True;
- end record;
-
- function Top_Up ( It: Convertible ) return Boolean;
- procedure Lower_Top( It: in out Convertible );
- procedure Park ( It: in out Convertible );
- procedure Raise_Top( It: in out Convertible );
- procedure TC_Check ( It: in Convertible; To_Equip: in Equipment );
-
- type Jeep is new Convertible with record
- Windshield_Up : Boolean := True;
- end record;
-
- function Windshield_Up ( It: Jeep ) return Boolean;
- procedure Lower_Windshield( It: in out Jeep );
- procedure Park ( It: in out Jeep );
- procedure Raise_Windshield( It: in out Jeep );
- procedure TC_Check ( It: in Jeep; To_Equip: in Equipment );
-
-end C390004_1;
-
-with Report;
-package body C390004_1 is
-
- procedure Set_Wheels( It: in out Vehicle; To_Count: in Natural ) is
- begin
- It.Wheels := To_Count;
- end Set_Wheels;
-
- function Wheels( It: Vehicle ) return Natural is
- begin
- return It.Wheels;
- end Wheels;
-
- procedure Park ( It: in out Vehicle ) is
- begin
- It.Parked := True;
- end Park;
-
- procedure UnPark ( It: in out Vehicle ) is
- begin
- It.Parked := False;
- end UnPark;
-
- procedure TC_Check ( It: in Vehicle; To_Equip: in Equipment ) is
- begin
- if To_Equip /= T_Veh then
- Report.Failed ("Failed, called Vehicle for "
- & Equipment'Image(To_Equip));
- end if;
- end TC_Check;
-
- procedure TC_Check ( It: in Car; To_Equip: in Equipment ) is
- begin
- if To_Equip /= T_Car then
- Report.Failed ("Failed, called Car for "
- & Equipment'Image(To_Equip));
- end if;
- end TC_Check;
-
- procedure TC_Check ( It: in Convertible; To_Equip: in Equipment ) is
- begin
- if To_Equip /= T_Con then
- Report.Failed ("Failed, called Convertible for "
- & Equipment'Image(To_Equip));
- end if;
- end TC_Check;
-
- procedure TC_Check ( It: in Jeep; To_Equip: in Equipment ) is
- begin
- if To_Equip /= T_Jep then
- Report.Failed ("Failed, called Jeep for "
- & Equipment'Image(To_Equip));
- end if;
- end TC_Check;
-
- procedure Load_Passengers( It: in out Car; To_Count: in Natural ) is
- begin
- It.Passengers := To_Count;
- UnPark( It );
- end Load_Passengers;
-
- procedure Park( It: in out Car ) is
- begin
- It.Passengers := 0;
- Park( Vehicle( It ) );
- end Park;
-
- function Passengers( It: Car ) return Natural is
- begin
- return It.Passengers;
- end Passengers;
-
- procedure Raise_Top( It: in out Convertible ) is
- begin
- It.Top_Up := True;
- end Raise_Top;
-
- procedure Lower_Top( It: in out Convertible ) is
- begin
- It.Top_Up := False;
- end Lower_Top;
-
- function Top_Up ( It: Convertible ) return Boolean is
- begin
- return It.Top_Up;
- end Top_Up;
-
- procedure Park ( It: in out Convertible ) is
- begin
- It.Top_Up := True;
- Park( Car( It ) );
- end Park;
-
- procedure Raise_Windshield( It: in out Jeep ) is
- begin
- It.Windshield_Up := True;
- end Raise_Windshield;
-
- procedure Lower_Windshield( It: in out Jeep ) is
- begin
- It.Windshield_Up := False;
- end Lower_Windshield;
-
- function Windshield_Up( It: Jeep ) return Boolean is
- begin
- return It.Windshield_Up;
- end Windshield_Up;
-
- procedure Park( It: in out Jeep ) is
- begin
- It.Windshield_Up := True;
- Park( Convertible( It ) );
- end Park;
-end C390004_1;
-
-with Report;
-with Ada.Tags;
-with C390004_1;
-procedure C390004 is
- package DMV renames C390004_1;
-
- The_Vehicle : aliased DMV.Vehicle;
- The_Car : aliased DMV.Car;
- The_Convertible : aliased DMV.Convertible;
- The_Jeep : aliased DMV.Jeep;
-
- type C_Reference is access all DMV.Car'Class;
- type V_Reference is access all DMV.Vehicle'Class;
-
- Designator : V_Reference;
- Storage : Natural;
-
- procedure Valet( It: in out DMV.Vehicle'Class ) is
- begin
- DMV.Park( It );
- end Valet;
-
- procedure TC_Match( Object: DMV.Vehicle'Class;
- Taglet: Ada.Tags.Tag;
- Where : String ) is
- use Ada.Tags;
- begin
- if Object'Tag /= Taglet then
- Report.Failed("Tag mismatch: " & Where);
- end if;
- end TC_Match;
-
- procedure Parking_Validation( It: DMV.Vehicle; TC_Message: String ) is
- begin
- if DMV.Wheels( It ) /= 1 or not It.Parked then
- Report.Failed ("Failed Vehicle " & TC_Message);
- end if;
- end Parking_Validation;
-
- procedure Parking_Validation( It: DMV.Car; TC_Message: String ) is
- begin
- if DMV.Wheels( It ) /= 2 or DMV.Passengers( It ) /= 0
- or not It.Parked then
- Report.Failed ("Failed Car " & TC_Message);
- end if;
- end Parking_Validation;
-
- procedure Parking_Validation( It: DMV.Convertible;
- TC_Message: String ) is
- begin
- if DMV.Wheels( It ) /= 3 or DMV.Passengers( It ) /= 0
- or not DMV.Top_Up( It ) or not It.Parked then
- Report.Failed ("Failed Convertible " & TC_Message);
- end if;
- end Parking_Validation;
-
- procedure Parking_Validation( It: DMV.Jeep; TC_Message: String ) is
- begin
- if DMV.Wheels( It ) /= 4 or DMV.Passengers( It ) /= 0
- or not DMV.Top_Up( It ) or not DMV.Windshield_Up( It )
- or not It.Parked then
- Report.Failed ("Failed Jeep " & TC_Message);
- end if;
- end Parking_Validation;
-
- function Wash( It: V_Reference; TC_Expect : Ada.Tags.Tag )
- return DMV.Vehicle'Class is
- This_Machine : DMV.Vehicle'Class := It.all;
- begin
- TC_Match( It.all, TC_Expect, "Class-wide object in Wash" );
- Storage := DMV.Wheels( This_Machine );
- return This_Machine;
- end Wash;
-
- function Wash( It: C_Reference; TC_Expect : Ada.Tags.Tag )
- return DMV.Car'Class is
- This_Machine : DMV.Car'Class := It.all;
- begin
- TC_Match( It.all, TC_Expect, "Class-wide object in Wash" );
- Storage := DMV.Wheels( This_Machine );
- return This_Machine;
- end Wash;
-
-begin
-
- Report.Test( "C390004", "Check that the tags of allocated objects "
- & "correctly identify the type of the allocated "
- & "object. Check that tags resulting from "
- & "normal and view conversions. Check tags of "
- & "accessed values designating aliased objects. "
- & "Check function result tags" );
-
- DMV.Set_Wheels( The_Vehicle, 1 );
- DMV.Set_Wheels( The_Car, 2 );
- DMV.Set_Wheels( The_Convertible, 3 );
- DMV.Set_Wheels( The_Jeep, 4 );
-
- Valet( The_Vehicle );
- Valet( The_Car );
- Valet( The_Convertible );
- Valet( The_Jeep );
-
- Parking_Validation( The_Vehicle, "setup" );
- Parking_Validation( The_Car, "setup" );
- Parking_Validation( The_Convertible, "setup" );
- Parking_Validation( The_Jeep, "setup" );
-
--- Check that the tags of allocated objects correctly identify the type
--- of the allocated object.
-
- Designator := new DMV.Vehicle;
- DMV.TC_Check( Designator.all, DMV.T_Veh );
- TC_Match( Designator.all, DMV.Vehicle'Tag, "allocated Vehicle" );
-
- Designator := new DMV.Car;
- DMV.TC_Check( Designator.all, DMV.T_Car );
- TC_Match( Designator.all, DMV.Car'Tag, "allocated Car");
-
- Designator := new DMV.Convertible;
- DMV.TC_Check( Designator.all, DMV.T_Con );
- TC_Match( Designator.all, DMV.Convertible'Tag, "allocated Convertible" );
-
- Designator := new DMV.Jeep;
- DMV.TC_Check( Designator.all, DMV.T_Jep );
- TC_Match( Designator.all, DMV.Jeep'Tag, "allocated Jeep" );
-
--- Check that view conversion causes the correct dispatch
- DMV.TC_Check( DMV.Vehicle( The_Jeep ), DMV.T_Veh );
- DMV.TC_Check( DMV.Car( The_Jeep ), DMV.T_Car );
- DMV.TC_Check( DMV.Convertible( The_Jeep ), DMV.T_Con );
-
--- And that view conversion does not change the tag
- TC_Match( DMV.Vehicle( The_Jeep ), DMV.Jeep'Tag, "View Conv Veh" );
- TC_Match( DMV.Car( The_Jeep ), DMV.Jeep'Tag, "View Conv Car" );
- TC_Match( DMV.Convertible( The_Jeep ), DMV.Jeep'Tag, "View Conv Jep" );
-
--- Check that the tags of accessed values designating aliased objects
--- correctly identify the type of the object.
- Designator := The_Vehicle'Access;
- DMV.TC_Check( Designator.all, DMV.T_Veh );
- TC_Match( Designator.all, DMV.Vehicle'Tag, "aliased Vehicle" );
-
- Designator := The_Car'Access;
- DMV.TC_Check( Designator.all, DMV.T_Car );
- TC_Match( Designator.all, DMV.Car'Tag, "aliased Car" );
-
- Designator := The_Convertible'Access;
- DMV.TC_Check( Designator.all, DMV.T_Con );
- TC_Match( Designator.all, DMV.Convertible'Tag, "aliased Convertible" );
-
- Designator := The_Jeep'Access;
- DMV.TC_Check( Designator.all, DMV.T_Jep );
- TC_Match( Designator.all, DMV.Jeep'Tag, "aliased Jeep" );
-
--- Check that the tag of a function result correctly evaluates.
--- Check this for class-wide functions. The tag of a class-wide
--- function result should be the tag appropriate to the actual value
--- returned, not the tag of the ancestor type.
- Function_Check: declare
- A_Vehicle : V_Reference := new DMV.Vehicle'( The_Vehicle );
- A_Car : C_Reference := new DMV.Car'( The_Car );
- A_Convertible : C_Reference := new DMV.Convertible'( The_Convertible );
- A_Jeep : C_Reference := new DMV.Jeep'( The_Jeep );
- begin
- DMV.Unpark( A_Vehicle.all );
- DMV.Load_Passengers( A_Car.all, 5 );
- DMV.Load_Passengers( A_Convertible.all, 6 );
- DMV.Load_Passengers( A_Jeep.all, 7 );
- DMV.Lower_Top( DMV.Convertible(A_Convertible.all) );
- DMV.Lower_Top( DMV.Jeep(A_Jeep.all) );
- DMV.Lower_Windshield( DMV.Jeep(A_Jeep.all) );
-
- if DMV.Wheels( Wash( A_Jeep, DMV.Jeep'Tag ) ) /= 4
- or Storage /= 4 then
- Report.Failed("Did not correctly wash Jeep");
- end if;
-
- if DMV.Wheels( Wash( A_Convertible, DMV.Convertible'Tag ) ) /= 3
- or Storage /= 3 then
- Report.Failed("Did not correctly wash Convertible");
- end if;
-
- if DMV.Wheels( Wash( A_Car, DMV.Car'Tag ) ) /= 2
- or Storage /= 2 then
- Report.Failed("Did not correctly wash Car");
- end if;
-
- if DMV.Wheels( Wash( A_Vehicle, DMV.Vehicle'Tag ) ) /= 1
- or Storage /= 1 then
- Report.Failed("Did not correctly wash Vehicle");
- end if;
-
- end Function_Check;
-
- Report.Result;
-end C390004;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3900050.a b/gcc/testsuite/ada/acats/tests/c3/c3900050.a
deleted file mode 100644
index 8a00b265654..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3900050.a
+++ /dev/null
@@ -1,157 +0,0 @@
--- C3900050.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See C3900053.AM.
---
--- TEST DESCRIPTION:
--- See C3900053.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- => C3900050.A
--- C3900051.A
--- C3900052.A
--- C3900053.AM
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 May 96 SAIC ACVC 2.1: Modified prologue. Added pragma Elaborate
--- for Ada.Calendar.
---
---!
-
-with Ada.Calendar;
-pragma Elaborate (Ada.Calendar);
-
-package C3900050 is -- Alert system abstraction.
-
- -- Declarations used by component Arrival_Time.
-
- Default_Time : constant Ada.Calendar.Time :=
- Ada.Calendar.Time_Of (1901, 1, 1);
- Alert_Time : constant Ada.Calendar.Time :=
- Ada.Calendar.Time_Of (1991, 6, 15);
-
-
- -- Declarations used by component Display_On and procedure Display.
-
- type Device_Enum is (Null_Device, Teletype, Console, Big_Screen);
- type Display_Counters is array (Device_Enum) of Natural;
-
- Display_Count_For : Display_Counters := (others => 0);
-
-
-
- type Alert_Type is tagged private; -- Root tagged type.
-
- procedure Set_Display (A : in out Alert_Type; -- To be inherited by
- D : in Device_Enum); -- all derivatives.
-
- procedure Display (A : in Alert_Type); -- To be inherited by
- -- all derivatives.
-
- procedure Handle (A : in out Alert_Type); -- To be overridden by
- -- all derivatives.
-
-
- -- The following functions are needed to verify the values of the
- -- root tagged type's private components.
-
- function Get_Time (A: Alert_Type) return Ada.Calendar.Time;
-
- function Get_Display (A: Alert_Type) return Device_Enum;
-
- function Initial_Values_Okay (A : in Alert_Type)
- return Boolean;
-
- function Bad_Final_Values (A : in Alert_Type)
- return Boolean;
-
-private
-
- type Alert_Type is tagged record -- Root tagged type.
- Arrival_Time : Ada.Calendar.Time := Default_Time;
- Display_On : Device_Enum := Null_Device;
- end record;
-
-
-end C3900050;
-
-
- --==================================================================--
-
-
-package body C3900050 is -- Alert system abstraction.
-
-
- procedure Set_Display (A : in out Alert_Type;
- D : in Device_Enum) is
- begin
- A.Display_On := D;
- end Set_Display;
-
-
- procedure Display (A : in Alert_Type) is
- begin
- Display_Count_For (A.Display_On) := Display_Count_For (A.Display_On) + 1;
- end Display;
-
-
- procedure Handle (A : in out Alert_Type) is
- begin
- A.Arrival_Time := Alert_Time;
- Display (A);
- end Handle;
-
-
- function Get_Time (A: Alert_Type) return Ada.Calendar.Time is
- begin
- return A.Arrival_Time;
- end Get_Time;
-
-
- function Get_Display (A: Alert_Type) return Device_Enum is
- begin
- return A.Display_On;
- end Get_Display;
-
-
- function Initial_Values_Okay (A : in Alert_Type) return Boolean is
- begin
- return (A = (Arrival_Time => Default_Time, -- Check "=" operator
- Display_On => Null_Device)); -- availability.
- end Initial_Values_Okay; -- Aggregate with
- -- named associations.
-
- function Bad_Final_Values (A : in Alert_Type) return Boolean is
- begin
- return (A /= (Alert_Time, Null_Device)); -- Check "/=" operator
- -- availability.
- end Bad_Final_Values; -- Aggregate with
- -- positional assoc.
-
-end C3900050;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3900051.a b/gcc/testsuite/ada/acats/tests/c3/c3900051.a
deleted file mode 100644
index d23a62bff45..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3900051.a
+++ /dev/null
@@ -1,137 +0,0 @@
--- C3900051.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See C3900053.AM.
---
--- TEST DESCRIPTION:
--- See C3900053.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- C3900050.A
--- => C3900051.A
--- C3900052.A
--- C3900053.AM
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 May 96 SAIC ACVC 2.1: Modified prologue. Added pragma Elaborate
--- for Ada.Calendar.
---
---!
-
-with C3900050; -- Alert system abstraction.
-package C3900051 is -- Extended alert system abstraction.
-
-
- type Low_Alert_Type is new C3900050.Alert_Type
- with private; -- Private extension of
- -- root tagged type.
-
- -- Inherits procedure Display from Alert_Type.
-
- procedure Handle (LA : in out Low_Alert_Type); -- Override parent's
- -- primitive subprog.
-
- procedure Set_Level (LA : in out Low_Alert_Type; -- To be inherited by
- L : in Integer); -- all derivatives.
-
-
- -- The following functions are needed to verify the values of the
- -- extension's private components.
-
- function Get_Level (LA: Low_Alert_Type) return Integer;
-
- function Initial_Values_Okay (LA : in Low_Alert_Type)
- return Boolean; -- Override parent's
- -- primitive subprog.
-
- function Bad_Final_Values (LA : in Low_Alert_Type) -- Override parent's
- return Boolean; -- primitive subprog.
-
-
-private
-
- type Low_Alert_Type is new C3900050.Alert_Type with record
- Level : Integer := 0;
- end record;
-
-end C3900051;
-
-
- --==================================================================--
-
-
-with Ada.Calendar;
-pragma Elaborate (Ada.Calendar);
-
-package body C3900051 is -- Extended alert system abstraction.
-
- use C3900050; -- Alert system abstraction.
-
-
- procedure Set_Level (LA : in out Low_Alert_Type;
- L : in Integer) is
- begin
- LA.Level := L;
- end Set_Level;
-
-
- procedure Handle (LA : in out Low_Alert_Type) is
- begin
- Handle (Alert_Type (LA)); -- Call parent's operation (type conversion).
- Set_Level (LA, 1); -- Call newly declared operation.
- Set_Display (Alert_Type(LA),
- Teletype); -- Call parent's operation (type conversion).
- Display (LA);
- end Handle;
-
-
- function Get_Level (LA: Low_Alert_Type) return Integer is
- begin
- return LA.Level;
- end Get_Level;
-
-
- function Initial_Values_Okay (LA : in Low_Alert_Type) return Boolean is
- begin
- -- Call parent's operation (type conversion).
- return (Initial_Values_Okay (Alert_Type (LA)) and
- LA.Level = 0);
- end Initial_Values_Okay;
-
-
- function Bad_Final_Values (LA : in Low_Alert_Type) return Boolean is
- use type Ada.Calendar.Time;
- begin
- return (Get_Time(LA) /= Alert_Time or
- Get_Display(LA) /= Teletype or
- LA.Level /= 1);
- end Bad_Final_Values;
-
-
-end C3900051;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3900052.a b/gcc/testsuite/ada/acats/tests/c3/c3900052.a
deleted file mode 100644
index 11d26db4a2d..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3900052.a
+++ /dev/null
@@ -1,138 +0,0 @@
--- C3900052.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See C3900053.AM.
---
--- TEST DESCRIPTION:
--- See C3900053.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- C3900050.A
--- C3900051.A
--- => C3900052.A
--- C3900053.AM
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 May 96 SAIC ACVC 2.1: Modified prologue. Added pragma Elaborate
--- for Ada.Calendar.
---
---!
-
-with C3900051; -- Extended alert system abstraction.
-package C3900052 is -- Further extended alert system abstraction.
-
-
- -- Declarations used by component Action_Officer;
-
- type Person_Enum is (Nobody, Duty_Officer,
- Watch_Commander, Commanding_Officer);
-
-
- type Medium_Alert_Type is new C3900051.Low_Alert_Type
- with private; -- Private extension of
- -- private extension.
-
- -- Inherits (inherited) procedure Display from Low_Alert_Type.
- -- Inherits function Level_Of from Low_Alert_Type.
-
- procedure Handle (MA : in out Medium_Alert_Type); -- Override parent's
- -- primitive subprog.
-
- procedure Assign_Officer (MA : in out Medium_Alert_Type;
- To : in Person_Enum);
-
-
- -- The following functions are needed to verify the values of the
- -- extension's private components.
-
- function Initial_Values_Okay (MA : in Medium_Alert_Type)
- return Boolean; -- Override parent's
- -- primitive subprog.
-
- function Bad_Final_Values (MA: in Medium_Alert_Type) -- Override parent's
- return Boolean; -- primitive subprog.
-
-private
-
- type Medium_Alert_Type is new C3900051.Low_Alert_Type with record
- Action_Officer : Person_Enum := Nobody;
- end record;
-
-end C3900052;
-
-
- --==================================================================--
-
-
-with C3900050; -- Basic alert abstraction.
-with Ada.Calendar;
-pragma Elaborate (Ada.Calendar);
-
-package body C3900052 is -- Further extended alert system abstraction.
-
- use C3900050; -- Enumeration values directly visible.
- use C3900051; -- Extended alert system abstraction.
-
-
- procedure Assign_Officer (MA : in out Medium_Alert_Type;
- To : in Person_Enum) is
- begin
- MA.Action_Officer := To;
- end Assign_Officer;
-
-
- procedure Handle (MA : in out Medium_Alert_Type) is
- begin
- Handle (Low_Alert_Type (MA)); -- Call parent's op (type conversion).
- Set_Level (MA, 2); -- Call inherited operation.
- Assign_Officer (MA, Duty_Officer); -- Call newly declared operation.
- Set_Display (MA, Console); -- Call inherited operation.
- Display (MA); -- Call doubly inherited operation.
- end Handle;
-
-
- function Initial_Values_Okay (MA : in Medium_Alert_Type) return Boolean is
- begin
- -- Call parent's operation (type conversion).
- return (Initial_Values_Okay (Low_Alert_Type (MA)) and
- MA.Action_Officer = Nobody);
- end Initial_Values_Okay;
-
-
- function Bad_Final_Values (MA : in Medium_Alert_Type) return Boolean is
- use type Ada.Calendar.Time;
- begin
- return (Get_Time(MA) /= Alert_Time or
- Get_Display(MA) /= Console or
- Get_Level(MA) /= 2 or
- MA.Action_Officer /= Duty_Officer);
- end Bad_Final_Values;
-
-
-end C3900052;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3900060.a b/gcc/testsuite/ada/acats/tests/c3/c3900060.a
deleted file mode 100644
index b77219c5758..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3900060.a
+++ /dev/null
@@ -1,159 +0,0 @@
--- C3900060.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See C3900063.AM.
---
--- TEST DESCRIPTION:
--- See C3900063.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- => C3900060.A
--- C3900061.A
--- C3900062.A
--- C3900063.AM
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 04 Jun 96 SAIC ACVC 2.1: Modified prologue. Added pragma Elaborate
--- for Ada.Calendar.
---
---!
-
-with Ada.Calendar;
-pragma Elaborate (Ada.Calendar);
-
-package C3900060 is -- Alert system abstraction.
-
-
- -- Declarations used by component Arrival_Time.
-
- Default_Time : constant Ada.Calendar.Time :=
- Ada.Calendar.Time_Of (1901, 1, 1);
- Alert_Time : constant Ada.Calendar.Time :=
- Ada.Calendar.Time_Of (1991, 6, 15);
-
-
- -- Declarations used by component Display_On and procedure Display.
-
- type Device_Enum is (Null_Device, Teletype, Console, Big_Screen);
- type Display_Counters is array (Device_Enum) of Natural;
-
- Display_Count_For : Display_Counters := (others => 0);
-
-
-
- type Alert_Type is tagged private; -- Root tagged type.
-
- procedure Set_Display (A : in out Alert_Type; -- To be inherited by
- D : in Device_Enum); -- all derivatives.
-
- procedure Display (A : in Alert_Type); -- To be inherited by
- -- all derivatives.
-
- procedure Handle (A : in out Alert_Type); -- To be overridden by
- -- all derivatives.
-
-
- -- The following functions are needed to verify the values of the
- -- root tagged type's private components.
-
- function Get_Time (A: Alert_Type) return Ada.Calendar.Time;
-
- function Get_Display (A: Alert_Type) return Device_Enum;
-
- function Initial_Values_Okay (A : in Alert_Type)
- return Boolean;
-
- function Bad_Final_Values (A : in Alert_Type)
- return Boolean;
-
-private
-
- type Alert_Type is tagged record -- Root tagged type.
- Arrival_Time : Ada.Calendar.Time := Default_Time;
- Display_On : Device_Enum := Null_Device;
- end record;
-
-
-end C3900060;
-
-
- --==================================================================--
-
-
-package body C3900060 is
-
-
- procedure Set_Display (A : in out Alert_Type;
- D : in Device_Enum) is
- begin
- A.Display_On := D;
- end Set_Display;
-
-
- procedure Display (A : in Alert_Type) is
- begin
- Display_Count_For (A.Display_On) := Display_Count_For (A.Display_On) + 1;
- end Display;
-
-
- procedure Handle (A : in out Alert_Type) is
- begin
- A.Arrival_Time := Alert_Time;
- Display (A);
- end Handle;
-
-
- function Get_Time (A: Alert_Type) return Ada.Calendar.Time is
- begin
- return A.Arrival_Time;
- end Get_Time;
-
-
- function Get_Display (A: Alert_Type) return Device_Enum is
- begin
- return A.Display_On;
- end Get_Display;
-
-
- function Initial_Values_Okay (A : in Alert_Type) return Boolean is
- begin
- return (A = (Arrival_Time => Default_Time, -- Check "=" operator
- Display_On => Null_Device)); -- availability.
- end Initial_Values_Okay; -- Aggregate with
- -- named associations.
-
- function Bad_Final_Values (A : in Alert_Type) return Boolean is
- begin
- return (A /= (Alert_Time, Null_Device)); -- Check "/=" operator
- -- availability.
- end Bad_Final_Values; -- Aggregate with
- -- positional assoc.
-
-end C3900060;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3900061.a b/gcc/testsuite/ada/acats/tests/c3/c3900061.a
deleted file mode 100644
index f776dcdb8ac..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3900061.a
+++ /dev/null
@@ -1,138 +0,0 @@
--- C3900061.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See C3900063.AM.
---
--- TEST DESCRIPTION:
--- See C3900063.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- C3900060.A
--- => C3900061.A
--- C3900062.A
--- C3900063.AM
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 04 Jun 96 SAIC ACVC 2.1: Modified prologue. Added pragma Elaborate
--- for Ada.Calendar.
---
---!
-
-with C3900060; -- Alert system abstraction.
-package C3900061 is -- Extended alert abstraction.
-
-
- type Low_Alert_Type is new C3900060.Alert_Type
- with private; -- Private extension of
- -- root tagged type.
-
- -- Inherits procedure Display from Alert_Type.
-
- procedure Handle (LA : in out Low_Alert_Type); -- Override parent's
- -- primitive subprog.
-
- procedure Set_Level (LA : in out Low_Alert_Type; -- To be inherited by
- L : in Integer); -- all derivatives.
-
-
- -- The following functions are needed to verify the values of the
- -- extension's private components.
-
- function Get_Level (LA: Low_Alert_Type) return Integer;
-
- function Initial_Values_Okay (LA : in Low_Alert_Type)
- return Boolean; -- Override parent's
- -- primitive subprog.
-
- function Bad_Final_Values (LA : in Low_Alert_Type) -- Override parent's
- return Boolean; -- primitive subprog.
-
-
-private
-
- type Low_Alert_Type is new C3900060.Alert_Type with record
- Level : Integer := 0;
- end record;
-
-end C3900061;
-
-
- --==================================================================--
-
-
-with Ada.Calendar;
-pragma Elaborate (Ada.Calendar);
-
-package body C3900061 is
-
- use C3900060; -- Alert system abstraction.
-
-
- procedure Set_Level (LA : in out Low_Alert_Type;
- L : in Integer) is
- begin
- LA.Level := L;
- end Set_Level;
-
-
- procedure Handle (LA : in out Low_Alert_Type) is
- begin
- Handle (Alert_Type (LA)); -- Call parent's operation (type conversion).
- Set_Level (LA, 1); -- Call newly declared operation.
- Set_Display (Alert_Type(LA),
- Teletype); -- Call parent's operation (type conversion).
- Display (LA); -- Call inherited operation.
- end Handle;
-
-
- function Get_Level (LA: Low_Alert_Type) return Integer is
- begin
- return LA.Level;
- end Get_Level;
-
-
- function Initial_Values_Okay (LA : in Low_Alert_Type) return Boolean is
- begin
- -- Call parent's operation (type conversion).
- return (Initial_Values_Okay (Alert_Type (LA)) and
- LA.Level = 0);
- end Initial_Values_Okay;
-
-
- function Bad_Final_Values (LA : in Low_Alert_Type) return Boolean is
- use type Ada.Calendar.Time;
- begin
- return (Get_Time(LA) /= Alert_Time or
- Get_Display(LA) /= Teletype or
- LA.Level /= 1);
- end Bad_Final_Values;
-
-
-end C3900061;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3900062.a b/gcc/testsuite/ada/acats/tests/c3/c3900062.a
deleted file mode 100644
index 87a1cd5a340..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3900062.a
+++ /dev/null
@@ -1,137 +0,0 @@
--- C3900062.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See C3900063.AM.
---
--- TEST DESCRIPTION:
--- See C3900063.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- C3900060.A
--- C3900061.A
--- => C3900062.A
--- C3900063.AM
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 04 Jun 96 SAIC ACVC 2.1: Modified prologue. Added pragma Elaborate
--- for Ada.Calendar.
---
---!
-
-with C3900061; -- Extended alert system abstraction.
-package C3900062 is -- Further extended alert system abstraction.
-
-
- -- Declarations used by component Action_Officer;
-
- type Person_Enum is (Nobody, Duty_Officer,
- Watch_Commander, Commanding_Officer);
-
-
- type Medium_Alert_Type is new C3900061.Low_Alert_Type
- with record -- Record extension of
- Action_Officer : Person_Enum := Nobody; -- private extension.
- end record;
-
-
- -- Inherits (inherited) procedure Display from Low_Alert_Type.
- -- Inherits function Level_Of from Low_Alert_Type.
-
- procedure Handle (MA : in out Medium_Alert_Type); -- Override parent's
- -- primitive subprog.
-
- procedure Assign_Officer (MA : in out Medium_Alert_Type;
- To : in Person_Enum);
-
-
- -- The following functions are needed to verify the values of the
- -- extension's private components.
-
- function Initial_Values_Okay (MA : in Medium_Alert_Type)
- return Boolean; -- Override parent's
- -- primitive subprog.
-
- function Bad_Final_Values (MA: in Medium_Alert_Type) -- Override parent's
- return Boolean; -- primitive subprog.
-
-
-end C3900062;
-
-
- --==================================================================--
-
-
-with C3900060; -- Basic alert abstraction.
-
-with Ada.Calendar;
-pragma Elaborate (Ada.Calendar);
-
-package body C3900062 is
-
- use C3900060; -- Enumeration values directly visible.
- use C3900061; -- Extended alert system abstraction.
-
-
- procedure Assign_Officer (MA : in out Medium_Alert_Type;
- To : in Person_Enum) is
- begin
- MA.Action_Officer := To;
- end Assign_Officer;
-
-
- procedure Handle (MA : in out Medium_Alert_Type) is
- begin
- Handle (Low_Alert_Type (MA)); -- Call parent's op (type conversion).
- Set_Level (MA, 2); -- Call inherited operation.
- Assign_Officer (MA, Duty_Officer); -- Call newly declared operation.
- Set_Display (MA, Console); -- Call inherited operation.
- Display (MA); -- Call doubly inherited operation.
- end Handle;
-
-
- function Initial_Values_Okay (MA : in Medium_Alert_Type) return Boolean is
- begin
- -- Call parent's operation (type conversion).
- return (Initial_Values_Okay (Low_Alert_Type (MA)) and
- MA.Action_Officer = Nobody);
- end Initial_Values_Okay;
-
-
- function Bad_Final_Values (MA : in Medium_Alert_Type) return Boolean is
- use type Ada.Calendar.Time;
- begin
- return (Get_Time(MA) /= Alert_Time or
- Get_Display(MA) /= Console or
- Get_Level(MA) /= 2 or
- MA.Action_Officer /= Duty_Officer);
- end Bad_Final_Values;
-
-
-end C3900062;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c390007.a b/gcc/testsuite/ada/acats/tests/c3/c390007.a
deleted file mode 100644
index 46f59f66c56..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c390007.a
+++ /dev/null
@@ -1,374 +0,0 @@
--- C390007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the tag of an object of a tagged type is preserved by
--- type conversion and parameter passing.
---
--- TEST DESCRIPTION:
--- The fact that the tag of an object is not changed is verified by
--- making dispatching calls to primitive operations, and confirming that
--- the proper body is executed. Objects of both specific and class-wide
--- types are checked.
---
--- The dispatching calls are made in two contexts. The first is a
--- straightforward dispatching call made from within a class-wide
--- operation. The second is a redispatch from within a primitive
--- operation.
---
--- For the parameter passing case, the initial class-wide and specific
--- objects are passed directly in calls to the class-wide and primitive
--- operations. The redispatch is accomplished by initializing a local
--- class-wide object in the primitive operation to the value of the
--- formal parameter, and using the local object as the actual in the
--- (re)dispatching call.
---
--- For the type conversion case, the initial class-wide object is assigned
--- a view conversion of an object of a specific type:
---
--- type T is tagged ...
--- type DT is new T with ...
---
--- A : DT;
--- B : T'Class := T(A); -- Despite conversion, tag of B is that of DT.
---
--- The class-wide object is then passed directly in calls to the
--- class-wide and primitive operations. For the initial object of a
--- specific type, however, a view conversion of the object is passed,
--- forcing a non-dispatching call in the primitive operation case. Within
--- the primitive operation, a view conversion of the formal parameter to
--- a class-wide type is then used to force a (re)dispatching call.
---
--- For the type conversion and parameter passing case, a combining of
--- view conversion and parameter passing of initial specific objects are
--- called directly to the class-wide and primitive operations.
---
---
--- CHANGE HISTORY:
--- 28 Jun 95 SAIC Initial prerelease version.
--- 23 Apr 96 SAIC Added use C390007_0 in the main.
---
---!
-
-package C390007_0 is
-
- type Call_ID_Kind is (None, Parent_Outer, Parent_Inner,
- Derived_Outer, Derived_Inner);
-
- type Root_Type is abstract tagged null record;
-
- procedure Outer_Proc (X : in out Root_Type) is abstract;
- procedure Inner_Proc (X : in out Root_Type) is abstract;
-
- procedure ClassWide_Proc (X : in out Root_Type'Class);
-
-end C390007_0;
-
-
- --==================================================================--
-
-
-package body C390007_0 is
-
- procedure ClassWide_Proc (X : in out Root_Type'Class) is
- begin
- Inner_Proc (X);
- end ClassWide_Proc;
-
-end C390007_0;
-
-
- --==================================================================--
-
-
-package C390007_0.C390007_1 is
-
- type Param_Parent_Type is new Root_Type with record
- Last_Call : Call_ID_Kind := None;
- end record;
-
- procedure Outer_Proc (X : in out Param_Parent_Type);
- procedure Inner_Proc (X : in out Param_Parent_Type);
-
-end C390007_0.C390007_1;
-
-
- --==================================================================--
-
-
-package body C390007_0.C390007_1 is
-
- procedure Outer_Proc (X : in out Param_Parent_Type) is
- begin
- X.Last_Call := Parent_Outer;
- end Outer_Proc;
-
- procedure Inner_Proc (X : in out Param_Parent_Type) is
- begin
- X.Last_Call := Parent_Inner;
- end Inner_Proc;
-
-end C390007_0.C390007_1;
-
-
- --==================================================================--
-
-
-package C390007_0.C390007_1.C390007_2 is
-
- type Param_Derived_Type is new Param_Parent_Type with null record;
-
- procedure Outer_Proc (X : in out Param_Derived_Type);
- procedure Inner_Proc (X : in out Param_Derived_Type);
-
-end C390007_0.C390007_1.C390007_2;
-
-
- --==================================================================--
-
-
-package body C390007_0.C390007_1.C390007_2 is
-
- procedure Outer_Proc (X : in out Param_Derived_Type) is
- Y : Root_Type'Class := X;
- begin
- Inner_Proc (Y); -- Redispatch.
- Root_Type'Class (X) := Y;
- end Outer_Proc;
-
- procedure Inner_Proc (X : in out Param_Derived_Type) is
- begin
- X.Last_Call := Derived_Inner;
- end Inner_Proc;
-
-end C390007_0.C390007_1.C390007_2;
-
-
- --==================================================================--
-
-
-package C390007_0.C390007_3 is
-
- type Convert_Parent_Type is new Root_Type with record
- First_Call : Call_ID_Kind := None;
- Second_Call : Call_ID_Kind := None;
- end record;
-
- procedure Outer_Proc (X : in out Convert_Parent_Type);
- procedure Inner_Proc (X : in out Convert_Parent_Type);
-
-end C390007_0.C390007_3;
-
-
- --==================================================================--
-
-
-package body C390007_0.C390007_3 is
-
- procedure Outer_Proc (X : in out Convert_Parent_Type) is
- begin
- X.First_Call := Parent_Outer;
- Inner_Proc (Root_Type'Class(X)); -- Redispatch.
- end Outer_Proc;
-
- procedure Inner_Proc (X : in out Convert_Parent_Type) is
- begin
- X.Second_Call := Parent_Inner;
- end Inner_Proc;
-
-end C390007_0.C390007_3;
-
-
- --==================================================================--
-
-
-package C390007_0.C390007_3.C390007_4 is
-
- type Convert_Derived_Type is new Convert_Parent_Type with null record;
-
- procedure Outer_Proc (X : in out Convert_Derived_Type);
- procedure Inner_Proc (X : in out Convert_Derived_Type);
-
-end C390007_0.C390007_3.C390007_4;
-
-
- --==================================================================--
-
-
-package body C390007_0.C390007_3.C390007_4 is
-
- procedure Outer_Proc (X : in out Convert_Derived_Type) is
- begin
- X.First_Call := Derived_Outer;
- Inner_Proc (Root_Type'Class(X)); -- Redispatch.
- end Outer_Proc;
-
- procedure Inner_Proc (X : in out Convert_Derived_Type) is
- begin
- X.Second_Call := Derived_Inner;
- end Inner_Proc;
-
-end C390007_0.C390007_3.C390007_4;
-
-
- --==================================================================--
-
-
-with C390007_0.C390007_1.C390007_2;
-with C390007_0.C390007_3.C390007_4;
-use C390007_0;
-
-with Report;
-procedure C390007 is
-begin
- Report.Test ("C390007", "Check that the tag of an object of a tagged " &
- "type is preserved by type conversion and parameter passing");
-
-
- --
- -- Check that tags are preserved by parameter passing:
- --
-
- Parameter_Passing_Subtest:
- declare
- Specific_A : C390007_0.C390007_1.C390007_2.Param_Derived_Type;
- Specific_B : C390007_0.C390007_1.C390007_2.Param_Derived_Type;
-
- ClassWide_A : C390007_0.C390007_1.Param_Parent_Type'Class := Specific_A;
- ClassWide_B : C390007_0.C390007_1.Param_Parent_Type'Class := Specific_B;
-
- use C390007_0.C390007_1;
- use C390007_0.C390007_1.C390007_2;
- begin
-
- Outer_Proc (Specific_A);
- if Specific_A.Last_Call /= Derived_Inner then
- Report.Failed ("Parameter passing: tag not preserved in call to " &
- "primitive operation with specific operand");
- end if;
-
- C390007_0.ClassWide_Proc (Specific_B);
- if Specific_B.Last_Call /= Derived_Inner then
- Report.Failed ("Parameter passing: tag not preserved in call to " &
- "class-wide operation with specific operand");
- end if;
-
- Outer_Proc (ClassWide_A);
- if ClassWide_A.Last_Call /= Derived_Inner then
- Report.Failed ("Parameter passing: tag not preserved in call to " &
- "primitive operation with class-wide operand");
- end if;
-
- C390007_0.ClassWide_Proc (ClassWide_B);
- if ClassWide_B.Last_Call /= Derived_Inner then
- Report.Failed ("Parameter passing: tag not preserved in call to " &
- "class-wide operation with class-wide operand");
- end if;
-
- end Parameter_Passing_Subtest;
-
-
- --
- -- Check that tags are preserved by type conversion:
- --
-
- Type_Conversion_Subtest:
- declare
- Specific_A : C390007_0.C390007_3.C390007_4.Convert_Derived_Type;
- Specific_B : C390007_0.C390007_3.C390007_4.Convert_Derived_Type;
-
- ClassWide_A : C390007_0.C390007_3.Convert_Parent_Type'Class :=
- C390007_0.C390007_3.Convert_Parent_Type(Specific_A);
- ClassWide_B : C390007_0.C390007_3.Convert_Parent_Type'Class :=
- C390007_0.C390007_3.Convert_Parent_Type(Specific_B);
-
- use C390007_0.C390007_3;
- use C390007_0.C390007_3.C390007_4;
- begin
-
- Outer_Proc (Convert_Parent_Type(Specific_A));
- if (Specific_A.First_Call /= Parent_Outer) or
- (Specific_A.Second_Call /= Derived_Inner)
- then
- Report.Failed ("Type conversion: tag not preserved in call to " &
- "primitive operation with specific operand");
- end if;
-
- Outer_Proc (ClassWide_A);
- if (ClassWide_A.First_Call /= Derived_Outer) or
- (ClassWide_A.Second_Call /= Derived_Inner)
- then
- Report.Failed ("Type conversion: tag not preserved in call to " &
- "primitive operation with class-wide operand");
- end if;
-
- C390007_0.ClassWide_Proc (Convert_Parent_Type(Specific_B));
- if (Specific_B.Second_Call /= Derived_Inner) then
- Report.Failed ("Type conversion: tag not preserved in call to " &
- "class-wide operation with specific operand");
- end if;
-
- C390007_0.ClassWide_Proc (ClassWide_B);
- if (ClassWide_A.Second_Call /= Derived_Inner) then
- Report.Failed ("Type conversion: tag not preserved in call to " &
- "class-wide operation with class-wide operand");
- end if;
-
- end Type_Conversion_Subtest;
-
-
- --
- -- Check that tags are preserved by type conversion and parameter passing:
- --
-
- Type_Conversion_And_Parameter_Passing_Subtest:
- declare
- Specific_A : C390007_0.C390007_1.C390007_2.Param_Derived_Type;
- Specific_B : C390007_0.C390007_1.C390007_2.Param_Derived_Type;
-
- use C390007_0.C390007_1;
- use C390007_0.C390007_1.C390007_2;
- begin
-
- Outer_Proc (Param_Parent_Type (Specific_A));
- if Specific_A.Last_Call /= Parent_Outer then
- Report.Failed ("Type conversion and parameter passing: tag not " &
- "preserved in call to primitive operation with " &
- "specific operand");
- end if;
-
- C390007_0.ClassWide_Proc (Param_Parent_Type (Specific_B));
- if Specific_B.Last_Call /= Derived_Inner then
- Report.Failed ("Type conversion and parameter passing: tag not " &
- "preserved in call to class-wide operation with " &
- "specific operand");
- end if;
-
- end Type_Conversion_And_Parameter_Passing_Subtest;
-
-
- Report.Result;
-
-end C390007;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c390010.a b/gcc/testsuite/ada/acats/tests/c3/c390010.a
deleted file mode 100644
index 1590e5027ab..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c390010.a
+++ /dev/null
@@ -1,216 +0,0 @@
--- C390010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if S is a subtype of a tagged type T, and if S is
--- constrained, then the allowable values of S'Class are only those
--- that, when converted to T, belong to S.
---
--- TEST DESCRIPTION:
--- This test defines a small tagged hierarchy of discriminated tagged
--- records, and constrained subtypes of those tagged record types.
--- It then uses access to the classwide of the constrained subtype
--- to check the objective.
---
---
--- CHANGE HISTORY:
--- 09 APR 96 SAIC Initial version
--- 03 NOV 96 SAIC Revised for 2.1 release
--- 31 DEC 97 EDS Restored use of intermediate access variable
--- to eliminate raising of Program_Error
--- 13 SEP 99 RLB Repaired previous change to avoid premature
--- subtype check.
--- 28 JUN 02 RLB Added pragma Elaborate_All (Report);.
---!
-
------------------------------------------------------------------ C390010_0
-
-with Report; pragma Elaborate_All (Report);
-package C390010_0 is
-
- -- the defined subprograms will allow checking the placement of
- -- constraint_checks
-
- -- define a discriminated tagged type, and a constrained subtype of
- -- that type:
-
- type Discr_Tag_Record( Disc: Boolean ) is tagged record
- FieldA : Character := 'A';
- case Disc is
- when True => FieldB : Character := 'B';
- when False => FieldC : Character := 'C';
- end case;
- end record;
-
- procedure Dispatching_Op( DTO : in out Discr_Tag_Record );
-
- Authentic : Boolean := Report.Ident_Bool( True );
-
- subtype True_Record is Discr_Tag_Record( Authentic );
-
-
- -- derive a type, "passing through" one discriminant, adding one
- -- discriminant, and a constrained subtype of THAT type:
-
- type Derived_Record( Disc1, Disc2: Boolean ) is
- new Discr_Tag_Record( Disc1 ) with record
- FieldD : Character := 'D';
- case Disc2 is
- when True => FieldE : Character := 'E';
- when False => FieldF : Character := 'F';
- end case;
- end record;
-
- procedure Dispatching_Op( DR : in out Derived_Record );
-
- subtype True_True_Derived is Derived_Record( Authentic, Authentic );
-
-
- -- now, define an access to classwide type, using the classwide from the
- -- constrained subtype of the root (or parent) type:
-
- type Subtype_Parent_Class_Access is access all True_Record'Class;
- type Parent_Class_Access is access all Discr_Tag_Record'Class;
-
- procedure PCW_Op( SPCA : in Subtype_Parent_Class_Access );
-
-end C390010_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- C390010_0
-
-with Report;
-with TCTouch;
-package body C390010_0 is
-
- procedure Dispatching_Op( DTO : in out Discr_Tag_Record ) is
- begin
- TCTouch.Touch('1'); --------------------------------------------------- 1
- if DTO.Disc then
- TCTouch.Touch(DTO.FieldB); ------------------------------------------ B
- else
- TCTouch.Touch(DTO.FieldC); ------------------------------------------ C
- end if;
- end Dispatching_Op;
-
-
- procedure Dispatching_Op( DR : in out Derived_Record ) is
- begin
- TCTouch.Touch('2'); --------------------------------------------------- 2
- if DR.Disc1 then
- TCTouch.Touch(DR.FieldB); ------------------------------------------ B
- else
- TCTouch.Touch(DR.FieldC); ------------------------------------------ C
- end if;
- if DR.Disc2 then
- TCTouch.Touch(DR.FieldE); ------------------------------------------ E
- else
- TCTouch.Touch(DR.FieldF); ------------------------------------------ F
- end if;
- end Dispatching_Op;
-
- procedure PCW_Op( SPCA : in Subtype_Parent_Class_Access ) is
- begin
-
- -- the following line is the "heart" of this test, objects of all types
- -- covered by the classwide type will be passed to this subprogram in
- -- the execution of the test.
- if SPCA.Disc then
- TCTouch.Touch(SPCA.FieldB); ------------------------------------------ B
- else
- TCTouch.Touch(SPCA.FieldC); ------------------------------------------ C
- end if;
-
- Dispatching_Op( SPCA.all ); -- check that this dispatches correctly,
- -- with discriminants correctly represented
-
- end PCW_Op;
-
-end C390010_0;
-
-------------------------------------------------------------------- C390010
-
-with Report;
-with TCTouch;
-with C390010_0;
-procedure C390010 is
-
- package CP renames C390010_0;
-
- procedure Check_Element( Item : access CP.Discr_Tag_Record'Class ) is
- begin
-
- -- the implicit conversion from the general access parameter to the more
- -- constrained subtype access type in the following call should cause
- -- Constraint_Error in the cases where the object is not correctly
- -- constrained
-
- CP.PCW_Op( Item.all'Access );
-
- exception
- when Constraint_Error => TCTouch.Touch('X'); -------------------------- X
- when others => Report.Failed("Unanticipated exception in Check_Element");
-
- end Check_Element;
-
- An_Item : CP.Parent_Class_Access;
-
-begin -- Main test procedure.
-
- Report.Test ("C390010", "Check that if S is a subtype of a tagged type " &
- "T, and if S is constrained, then the allowable " &
- "values of S'Class are only those that, when " &
- "converted to T, belong to S" );
-
- An_Item := new CP.Discr_Tag_Record(True);
- Check_Element( An_Item );
- TCTouch.Validate("B1B","Case 1");
-
- An_Item := new CP.Discr_Tag_Record(False);
- Check_Element( An_Item );
- TCTouch.Validate("X","Case 2");
-
- An_Item := new CP.True_Record;
- Check_Element( An_Item );
- TCTouch.Validate("B1B","Case 3");
-
- An_Item := new CP.Derived_Record(False, False);
- Check_Element( An_Item );
- TCTouch.Validate("X","Case 4");
-
- An_Item := new CP.Derived_Record(False, True);
- Check_Element( An_Item );
- TCTouch.Validate("X","Case 5");
-
- An_Item := new CP.Derived_Record(True, False);
- Check_Element( An_Item );
- TCTouch.Validate("B2BF","Case 6");
-
- An_Item := new CP.True_True_Derived;
- Check_Element( An_Item );
- TCTouch.Validate("B2BE","Case 7");
-
- Report.Result;
-
-end C390010;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c390011.a b/gcc/testsuite/ada/acats/tests/c3/c390011.a
deleted file mode 100644
index 74cf0eb0468..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c390011.a
+++ /dev/null
@@ -1,250 +0,0 @@
--- C390011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that tagged types declared within generic package declarations
--- generate distinct tags for each instance of the generic.
---
--- TEST DESCRIPTION:
--- This test defines a very simple generic package (with the expectation
--- that it should be easily be shared), and a few instances of that
--- package. In true user-like fashion, two of the instances are identical
--- (to wit: IIO is new Integer_IO(Integer)). The tags generated for each
--- of them are placed into a list. The last action of the test is to
--- check that everything in the list is unique.
---
--- Almost as an aside, this test defines functions that return T'Base and
--- T'Class, and then exercises these functions.
---
--- (JPR) persistent objects really need a function like:
--- function Get_Object return T'class;
---
---
--- CHANGE HISTORY:
--- 20 OCT 95 SAIC Initial version
--- 23 APR 96 SAIC Commentary Corrections 2.1
---
---!
-
------------------------------------------------------------------ C390011_0
-
-with Ada.Tags;
-package C390011_0 is
-
- procedure Add_Tag_To_List( T : Ada.Tags.Tag; X_Name, X_Tag: String );
-
- procedure Check_List_For_Duplicates;
-
-end C390011_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body C390011_0 is
-
- use type Ada.Tags.Tag;
- type SP is access String;
-
- type List_Item;
- type List_P is access List_Item;
- type List_Item is record
- The_Tag : Ada.Tags.Tag;
- Exp_Name : SP;
- Ext_Tag : SP;
- Next : List_P;
- end record;
-
- The_List : List_P;
-
- procedure Add_Tag_To_List ( T : Ada.Tags.Tag; X_Name, X_Tag: String ) is
- begin -- prepend the tag information to the list
- The_List := new List_Item'( The_Tag => T,
- Exp_Name => new String'(X_Name),
- Ext_Tag => new String'(X_Tag),
- Next => The_List );
- end Add_Tag_To_List;
-
- procedure Check_List_For_Duplicates is
- Finger : List_P;
- Thumb : List_P := The_List;
- begin --
- while Thumb /= null loop
- Finger := Thumb.Next;
- while Finger /= null loop
- -- Check that the tag is unique
- if Finger.The_Tag = Thumb.The_Tag then
- Report.Failed("Duplicate Tag");
- end if;
-
- -- Check that the Expanded name is unique
- if Finger.Exp_Name.all = Thumb.Exp_Name.all then
- Report.Failed("Tag name " & Finger.Exp_Name.all & " repeats");
- end if;
-
- -- Check that the External Tag is unique
-
- if Finger.Ext_Tag.all = Thumb.Ext_Tag.all then
- Report.Failed("External Tag " & Finger.Ext_Tag.all & " repeats");
- end if;
- Finger := Finger.Next;
- end loop;
- Thumb := Thumb.Next;
- end loop;
- end Check_List_For_Duplicates;
-
-begin
- -- some things I just don't trust...
- if The_List /= null then
- Report.Failed("Implicit default for The_List not null");
- end if;
-end C390011_0;
-
------------------------------------------------------------------ C390011_1
-
-generic
- type Index is (<>);
- type Item is private;
-package C390011_1 is
-
- type List is array(Index range <>) of Item;
- type ListP is access all List;
-
- type Table is tagged record
- Data: ListP;
- end record;
-
- function Sort( T: in Table'Class ) return Table'Class;
-
- function Stable_Table return Table'Class;
-
- function Table_End( T: Table ) return Index'Base;
-
-end C390011_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-package body C390011_1 is
-
- -- In a user program this package would DO something
-
- function Sort( T: in Table'Class ) return Table'Class is
- begin
- return T;
- end Sort;
-
- Empty : Table'Class := Table'( Data => null );
-
- function Stable_Table return Table'Class is
- begin
- return Empty;
- end Stable_Table;
-
- function Table_End( T: Table ) return Index'Base is
- begin
- return Index'Base( T.Data.all'Last );
- end Table_End;
-
-end C390011_1;
-
------------------------------------------------------------------ C390011_2
-
-with C390011_1;
-package C390011_2 is new C390011_1( Index => Character, Item => Float );
-
------------------------------------------------------------------ C390011_3
-
-with C390011_1;
-package C390011_3 is new C390011_1( Index => Character, Item => Float );
-
------------------------------------------------------------------ C390011_4
-
-with C390011_1;
-package C390011_4 is new C390011_1( Index => Integer, Item => Character );
-
------------------------------------------------------------------ C390011_5
-
-with C390011_3;
-with C390011_4;
-package C390011_5 is
-
- type Table_3 is new C390011_3.Table with record
- Serial_Number : Integer;
- end record;
-
- type Table_4 is new C390011_4.Table with record
- Serial_Number : Integer;
- end record;
-
-end C390011_5;
-
--- no package body C390011_5 required
-
-------------------------------------------------------------------- C390011
-
-with Report;
-with C390011_0;
-with C390011_2;
-with C390011_3;
-with C390011_4;
-with C390011_5;
-with Ada.Tags;
-procedure C390011 is
-
-begin -- Main test procedure.
-
- Report.Test ("C390011", "Check that tagged types declared within " &
- "generic package declarations generate distinct " &
- "tags for each instance of the generic. " &
- "Check that 'Base may be used as a subtype mark. " &
- "Check that T'Base and T'Class are allowed as " &
- "the subtype mark in a function result" );
-
- -- build the tag information table
- C390011_0.Add_Tag_To_List(T => C390011_2.Table'Tag,
- X_Name => Ada.Tags.Expanded_Name(C390011_2.Table'Tag),
- X_Tag => Ada.Tags.External_Tag(C390011_2.Table'Tag) );
-
- C390011_0.Add_Tag_To_List(T => C390011_3.Table'Tag,
- X_Name => Ada.Tags.Expanded_Name(C390011_3.Table'Tag),
- X_Tag => Ada.Tags.External_Tag(C390011_3.Table'Tag) );
-
- C390011_0.Add_Tag_To_List(T => C390011_4.Table'Tag,
- X_Name => Ada.Tags.Expanded_Name(C390011_4.Table'Tag),
- X_Tag => Ada.Tags.External_Tag(C390011_4.Table'Tag) );
-
- C390011_0.Add_Tag_To_List(T => C390011_5.Table_3'Tag,
- X_Name => Ada.Tags.Expanded_Name(C390011_5.Table_3'Tag),
- X_Tag => Ada.Tags.External_Tag(C390011_5.Table_3'Tag) );
-
- C390011_0.Add_Tag_To_List(T => C390011_5.Table_4'Tag,
- X_Name => Ada.Tags.Expanded_Name(C390011_5.Table_4'Tag),
- X_Tag => Ada.Tags.External_Tag(C390011_5.Table_4'Tag) );
-
- -- preform the check for distinct tags
- C390011_0.Check_List_For_Duplicates;
-
- Report.Result;
-
-end C390011;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c390a010.a b/gcc/testsuite/ada/acats/tests/c3/c390a010.a
deleted file mode 100644
index 18016de0999..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c390a010.a
+++ /dev/null
@@ -1,127 +0,0 @@
--- C390A010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See C390A011.AM.
---
--- TEST DESCRIPTION:
--- See C390A011.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- F390A00.A
--- => C390A010.A
--- C390A011.AM
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 04 Jun 96 SAIC ACVC 2.1: Modified prologue.
---
---!
-
-with F390A00; -- Alert system abstraction.
-package C390A010 is
-
-
- type Low_Alert_Type is new F390A00.Alert_Type with record
- Level : Integer := 0; -- Record extension of
- end record; -- root tagged type.
-
- -- Inherits procedure Display from Alert_Type.
-
- procedure Handle (LA : in out Low_Alert_Type); -- Override parent's
- -- primitive subprog.
-
- function Level_Of (LA : in Low_Alert_Type) -- To be inherited by
- return Integer; -- all derivatives.
-
-
-
- -- Declarations required for component Action_Officer;
-
- type Person_Enum is (Nobody, Duty_Officer,
- Watch_Commander, Commanding_Officer);
-
-
- type Medium_Alert_Type is new Low_Alert_Type with record
- Action_Officer : Person_Enum := Nobody; -- Record extension of
- end record; -- record extension.
-
- -- Inherits (inherited) procedure Display from Low_Alert_Type.
- -- Inherits function Level_Of from Low_Alert_Type.
-
- procedure Handle (MA : in out Medium_Alert_Type); -- Override parent's
- -- primitive subprog.
-
- procedure Assign_Officer (MA : in out Medium_Alert_Type;
- To : in Person_Enum);
-
-
-end C390A010;
-
-
- --==================================================================--
-
-
-package body C390A010 is
-
- use F390A00; -- Alert system abstraction.
-
-
- function Level_Of (LA : in Low_Alert_Type) return Integer is
- begin
- return (LA.Level + 1);
- end Level_Of;
-
-
- procedure Handle (LA : in out Low_Alert_Type) is
- begin
- Handle (Alert_Type (LA)); -- Call parent's op (type conversion).
- LA.Level := Level_Of (LA); -- Call newly declared operation.
- LA.Display_On := Teletype;
- Display (LA); -- Call inherited operation.
- end Handle;
-
-
- procedure Assign_Officer (MA : in out Medium_Alert_Type;
- To : in Person_Enum) is
- begin
- MA.Action_Officer := To;
- end Assign_Officer;
-
-
- procedure Handle (MA : in out Medium_Alert_Type) is
- begin
- Handle (Low_Alert_Type (MA)); -- Call parent's op (type conversion).
- MA.Level := Level_Of (MA); -- Call inherited operation.
- Assign_Officer (MA, Duty_Officer); -- Call newly declared operation.
- MA.Display_On := Console;
- Display (MA); -- Call twice-inherited operation.
- end Handle;
-
-
-end C390A010;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c390a020.a b/gcc/testsuite/ada/acats/tests/c3/c390a020.a
deleted file mode 100644
index 29cd3ca9786..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c390a020.a
+++ /dev/null
@@ -1,90 +0,0 @@
--- C390A020.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See C390A022.AM.
---
--- TEST DESCRIPTION:
--- See C390A022.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- F390A00.A
--- => C390A020.A
--- C390A021.A
--- C390A022.AM
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 04 Jun 96 SAIC ACVC 2.1: Modified prologue.
---
---!
-
-with F390A00; -- Alert system abstraction.
-package C390A020 is
-
-
- type Low_Alert_Type is new F390A00.Alert_Type with record
- Level : Integer := 0; -- Record extension of
- end record; -- root tagged type.
-
- -- Inherits procedure Display from Alert_Type.
-
- procedure Handle (LA : in out Low_Alert_Type); -- Override parent's
- -- primitive subprog.
-
- function Level_Of (LA : in Low_Alert_Type) -- To be inherited by
- return Integer; -- all derivatives.
-
-
-end C390A020;
-
-
- --==================================================================--
-
-
-package body C390A020 is
-
- use F390A00; -- Alert system abstraction.
-
-
- function Level_Of (LA : in Low_Alert_Type) return Integer is
- begin
- return (LA.Level + 1);
- end Level_Of;
-
-
- procedure Handle (LA : in out Low_Alert_Type) is
- begin
- Handle (Alert_Type (LA)); -- Call parent's oper. (type conversion).
- LA.Level := Level_Of (LA); -- Call newly declared operation.
- LA.Display_On := Teletype;
- Display (LA); -- Call inherited operation.
- end Handle;
-
-
-end C390A020;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c390a021.a b/gcc/testsuite/ada/acats/tests/c3/c390a021.a
deleted file mode 100644
index 5d099f3704c..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c390a021.a
+++ /dev/null
@@ -1,133 +0,0 @@
--- C390A021.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See C390A022.AM.
---
--- TEST DESCRIPTION:
--- See C390A022.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- F390A00.A
--- C390A020.A
--- => C390A021.A
--- C390A022.AM
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 04 Jun 96 SAIC ACVC 2.1: Modified prologue.
---
---!
-
-with C390A020; -- Extended alert abstraction.
-package C390A021 is
-
-
- -- Declarations used by component Action_Officer;
-
- type Person_Enum is (Nobody, Duty_Officer,
- Watch_Commander, Commanding_Officer);
-
-
- type Medium_Alert_Type is new C390A020.Low_Alert_Type
- with private; -- Private extension of
- -- record extension.
-
- -- Inherits (inherited) procedure Display from Low_Alert_Type.
- -- Inherits function Level_Of from Low_Alert_Type.
-
- procedure Handle (MA : in out Medium_Alert_Type); -- Override parent's
- -- primitive subprog.
-
- procedure Assign_Officer (MA : in out Medium_Alert_Type;
- To : in Person_Enum);
-
-
- -- The following two functions are needed to verify the values of the
- -- extension's private components.
-
- function Initial_Values_Okay (MA : in Medium_Alert_Type)
- return Boolean;
-
- function Bad_Final_Values (MA : in Medium_Alert_Type)
- return Boolean;
-
-
-private
-
- type Medium_Alert_Type is new C390A020.Low_Alert_Type with record
- Action_Officer : Person_Enum := Nobody;
- end record;
-
-end C390A021;
-
-
- --==================================================================--
-
-
-with F390A00; -- Basic alert abstraction.
-use F390A00;
-package body C390A021 is
-
- use C390A020; -- Extended alert abstraction.
-
-
- procedure Assign_Officer (MA : in out Medium_Alert_Type;
- To : in Person_Enum) is
- begin
- MA.Action_Officer := To;
- end Assign_Officer;
-
-
- procedure Handle (MA : in out Medium_Alert_Type) is
- begin
- Handle (Low_Alert_Type (MA)); -- Call parent's op (type conversion).
- MA.Level := Level_Of (MA); -- Call inherited operation.
- Assign_Officer (MA, Duty_Officer); -- Call newly declared operation.
- MA.Display_On := Console;
- Display (MA); -- Call twice-inherited operation.
- end Handle;
-
-
- function Initial_Values_Okay (MA : in Medium_Alert_Type) return Boolean is
- begin
- return (MA = (Arrival_Time => Default_Time, -- Check "=" operator
- Display_On => Null_Device, -- availability.
- Level => 0, -- Aggregate with
- Action_Officer => Nobody)); -- named associations.
- end Initial_Values_Okay;
-
-
- function Bad_Final_Values (MA : in Medium_Alert_Type) return Boolean is
- begin
- return (MA /= (Alert_Time, Console, -- Check "/=" operator
- 2 , Duty_Officer)); -- availability.
- end Bad_Final_Values; -- Aggregate with
- -- positional assoc.
-
-end C390A021;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c390a030.a b/gcc/testsuite/ada/acats/tests/c3/c390a030.a
deleted file mode 100644
index 51554a49adc..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c390a030.a
+++ /dev/null
@@ -1,188 +0,0 @@
--- C390A030.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See C390A031.AM.
---
--- TEST DESCRIPTION:
--- See C390A031.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- F390A00.A
--- => C390A030.A
--- C390A031.AM
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 04 Jun 96 SAIC ACVC 2.1: Modified prologue.
---
---!
-
-with F390A00; -- Alert system abstraction.
-package C390A030 is
-
-
- type Low_Alert_Type is new F390A00.Alert_Type -- Private extension of
- with private; -- root tagged type.
-
- -- Inherits procedure Display from Alert_Type.
-
- procedure Handle (LA : in out Low_Alert_Type); -- Override parent's
- -- primitive subprog.
-
- function Level_Of (LA : in Low_Alert_Type) -- To be inherited by
- return Integer; -- all derivatives.
-
-
- -- The following two functions are needed to verify the values of the
- -- extension's private components.
-
- function Initial_Values_Okay (LA : in Low_Alert_Type)
- return Boolean;
-
- function Bad_Final_Values (LA : in Low_Alert_Type)
- return Boolean;
-
-
- -- Declarations used by private extension component.
-
- type Person_Enum is (Nobody, Duty_Officer,
- Watch_Commander, Commanding_Officer);
-
-
- type Medium_Alert_Type is new Low_Alert_Type -- Private extension of
- with private; -- private extension.
-
- -- Inherits (inherited) procedure Display from Low_Alert_Type.
- -- Inherits function Level_Of from Low_Alert_Type.
-
- procedure Handle (MA : in out Medium_Alert_Type); -- Override parent's
- -- primitive subprog.
-
- procedure Assign_Officer (MA : in out Medium_Alert_Type;
- To : in Person_Enum);
-
-
- -- The following two functions are needed to verify the values of the
- -- extension's private components.
-
- function Initial_Values_Okay (MA : in Medium_Alert_Type)
- return Boolean; -- Override parent's
- -- operation.
-
- function Bad_Final_Values (MA : in Medium_Alert_Type)
- return Boolean; -- Override parent's
- -- operation.
-
-private
-
- type Low_Alert_Type is new F390A00.Alert_Type with record
- Level : Integer := 0;
- end record;
-
-
- type Medium_Alert_Type is new Low_Alert_Type with record
- Action_Officer : Person_Enum := Nobody;
- end record;
-
-end C390A030;
-
-
- --==================================================================--
-
-
-package body C390A030 is
-
- use F390A00; -- Alert system abstraction.
-
-
- function Level_Of (LA : in Low_Alert_Type) return Integer is
- begin
- return (LA.Level + 1);
- end Level_Of;
-
-
- procedure Handle (LA : in out Low_Alert_Type) is
- begin
- Handle (Alert_Type (LA)); -- Call parent's operation (type conversion).
- LA.Level := Level_Of (LA); -- Call newly declared operation.
- LA.Display_On := Teletype;
- Display (LA); -- Call inherited operation.
- end Handle;
-
-
- function Initial_Values_Okay (LA : in Low_Alert_Type) return Boolean is
- begin
- return (LA = (Arrival_Time => Default_Time, -- Check "=" operator
- Display_On => Null_Device, -- availability.
- Level => 0)); -- Aggregate with
- end Initial_Values_Okay; -- named associations.
-
-
- function Bad_Final_Values (LA : in Low_Alert_Type) return Boolean is
- begin
- return (LA /= (Alert_Time, Teletype, 1)); -- Check "/=" operator
- -- availability.
- end Bad_Final_Values; -- Aggregate with
- -- positional assoc.
-
- procedure Assign_Officer (MA : in out Medium_Alert_Type;
- To : in Person_Enum) is
- begin
- MA.Action_Officer := To;
- end Assign_Officer;
-
-
- procedure Handle (MA : in out Medium_Alert_Type) is
- begin
- Handle (Low_Alert_Type (MA)); -- Call parent's op (type conversion).
- MA.Level := Level_Of (MA); -- Call inherited operation.
- Assign_Officer (MA, Duty_Officer); -- Call newly declared operation.
- MA.Display_On := Console;
- Display (MA); -- Call twice-inherited operation.
- end Handle;
-
-
- function Initial_Values_Okay (MA : in Medium_Alert_Type) return Boolean is
- begin
- -- Call parent's operation (type conversion).
- return (Initial_Values_Okay (Low_Alert_Type (MA)) and
- MA.Action_Officer = Nobody);
- end Initial_Values_Okay;
-
-
- function Bad_Final_Values (MA : in Medium_Alert_Type) return Boolean is
- begin
- return not (MA = (Arrival_Time => Alert_Time, -- Check "=" operator
- Display_On => Console, -- availability.
- Level => 2, -- Aggregate with
- Action_Officer => Duty_Officer));-- named associations.
- end Bad_Final_Values;
-
-
-end C390A030;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c391001.a b/gcc/testsuite/ada/acats/tests/c3/c391001.a
deleted file mode 100644
index bca7525765f..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c391001.a
+++ /dev/null
@@ -1,329 +0,0 @@
--- C391001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that structures nesting discriminated records as
--- components in record extension are correctly supported. Check
--- for this using limited private structures.
--- Check that record extensions inherit all the visible components
--- of their ancestor types.
--- Check that discriminants are correctly inherited.
---
--- TEST DESCRIPTION:
--- This test defines a textbook object, a serial number plaque.
--- This object is used in each of several other structures modeled
--- after those used in an existing antenna modeling software system.
--- Record types discriminated and undiscriminated are nested to
--- produce a layered design. Some parametrization is programmatic;
--- some parametrization is data-driven.
---
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Removed RM references from objective text.
--- 19 Apr 95 SAIC Added "limited" to full type def of "Object"
---
---!
-
- package C391001_1 is
- type Object is tagged limited private;
- -- Constructor operation
- procedure Create( The_Plaque : in out Object );
- -- Selector operations
- function "="( Left_Plaque,Right_Plaque : Object ) return Boolean;
- function TC_Match( Left_Plaque : Object; Right_Natural : Natural )
- return Boolean;
- function Serial_Number( A_Plaque : Object ) return Natural;
- Unserialized : exception; -- Serial_Number called before Create
- Reserialized : exception; -- Create called twice
- private
- type Object is tagged limited record
- Serial_Number : Natural := 0;
- end record;
- end C391001_1;
-
- package body C391001_1 is
- Counter : Natural := 0;
- procedure Create( The_Plaque : in out Object ) is
- begin
- if The_Plaque.Serial_Number = 0 then
- Counter := Counter +1;
- The_Plaque.Serial_Number := Counter;
- else
- raise Reserialized;
- end if;
- end Create;
-
- function "="( Left_Plaque,Right_Plaque : Object ) return Boolean is
- begin
- return (Left_Plaque.Serial_Number = Right_Plaque.Serial_Number)
- and then -- two uninitialized plates are unequal
- (Left_Plaque.Serial_Number /= 0);
- end "=";
-
- function TC_Match( Left_Plaque : Object; Right_Natural : Natural )
- return Boolean is
- begin
- return (Left_Plaque.Serial_Number = Right_Natural);
- end TC_Match;
-
- function Serial_Number( A_Plaque : Object ) return Natural is
- begin
- if A_Plaque.Serial_Number = 0 then
- raise Unserialized;
- end if;
- return A_Plaque.Serial_Number;
- end Serial_Number;
- end C391001_1;
-
- with C391001_1;
- package C391001_2 is -- package Boards is
-
- package Plaque renames C391001_1;
-
- type Modes is (Receiving, Transmitting, Standby);
- type Link(Mode: Modes := Standby) is record
- case Mode is
- when Receiving => TC_R : Integer := 100;
- when Transmitting => TC_T : Integer := 200;
- when Standby => TC_S : Integer := 300; -- TGA, TSA, SSA
- end case;
- end record;
-
- type Data_Formats is (S_Band, KU_Band, UHF);
-
-
- type Transceiver(Band: Data_Formats) is tagged limited record
- ID : Plaque.Object;
- The_Link: Link;
- case Band is
- when S_Band => TC_S_Band_Data : Integer := 1; -- TGA, SSA
- when KU_Band => TC_KU_Band_Data : Integer := 2; -- TSA
- when UHF => TC_UHF_Data : Integer := 3;
- end case;
- end record;
- end C391001_2;
-
- with C391001_1;
- with C391001_2;
- package C391001_3 is -- package Modules
- package Plaque renames C391001_1;
- package Boards renames C391001_2;
- use type Boards.Modes;
- use type Boards.Data_Formats;
-
- type Command_Formats is ( Set_Compression_Code,
- Set_Data_Rate,
- Set_Power_State );
-
- type Electronics_Module(EBand : Boards.Data_Formats;
- The_Command_Format: Command_Formats)
- is new Boards.Transceiver(EBand) with record
- case The_Command_Format is
- when Set_Compression_Code => TC_SCC : Integer := 10; -- SSA
- when Set_Data_Rate => TC_SDR : Integer := 20; -- TGA
- when Set_Power_State => TC_SPS : Integer := 30; -- TSA
- end case;
- end record;
- end C391001_3;
-
- with Report;
- with C391001_1;
- with C391001_2;
- with C391001_3;
- procedure C391001 is
- package Plaque renames C391001_1;
- package Boards renames C391001_2;
- package Modules renames C391001_3;
- use type Boards.Modes;
- use type Boards.Data_Formats;
- use type Modules.Command_Formats;
-
- type Azimuth is range 0..359;
-
- type Ground_Antenna(The_Band : Boards.Data_Formats;
- The_Command_Format: Modules.Command_Formats) is
- record
- ID : Plaque.Object;
- Electronics : Modules.Electronics_Module(The_Band,The_Command_Format);
- Pointing : Azimuth;
- end record;
-
- type Space_Antenna(The_Band : Boards.Data_Formats := Boards.KU_Band;
- The_Command : Modules.Command_Formats
- := Modules.Set_Power_State)
- is
- record
- ID : Plaque.Object;
- Electronics : Modules.Electronics_Module(The_Band,The_Command);
- end record;
-
- The_Ground_Antenna : Ground_Antenna (Boards.S_Band,
- Modules.Set_Data_Rate);
- The_Space_Antenna : Space_Antenna;
- Space_Station_Antenna : Space_Antenna (Boards.S_Band,
- Modules.Set_Compression_Code);
-
-
- procedure Validate( Condition : Boolean; Message: String ) is
- begin
- if not Condition then
- Report.Failed("Failed " & Message );
- end if;
- end Validate;
-
- begin
- Report.Test("C391001", "Check nested tagged discriminated "
- & "record structures");
-
- Plaque.Create( The_Ground_Antenna.ID ); -- 1
- Plaque.Create( The_Ground_Antenna.Electronics.ID ); -- 2
- Plaque.Create( The_Space_Antenna.ID ); -- 3
- Plaque.Create( The_Space_Antenna.Electronics.ID ); -- 4
- Plaque.Create( Space_Station_Antenna.ID ); -- 5
- Plaque.Create( Space_Station_Antenna.Electronics.ID );-- 6
-
- The_Ground_Antenna.Pointing := 180;
- Validate( The_Ground_Antenna.The_Band = Boards.S_Band, "TGA discr 1" );
- Validate( The_Ground_Antenna.The_Command_Format = Modules.Set_Data_Rate,
- "TGA discr 2" );
- Validate( Plaque.TC_Match(The_Ground_Antenna.ID,1), "TGA comp 1" );
- Validate( The_Ground_Antenna.Electronics.EBand = Boards.S_Band,
- "TGA comp 2.discr 1" );
- Validate( The_Ground_Antenna.Electronics.The_Command_Format
- = Modules.Set_Data_Rate, "TGA comp 2.discr 2" );
- Validate( The_Ground_Antenna.Electronics.TC_SDR = 20,
- "TGA comp 2.1" );
- Validate( Plaque.TC_Match( The_Ground_Antenna.Electronics.ID, 2 ),
- "TGA comp 2.inher.1" );
- Validate( The_Ground_Antenna.Electronics.The_Link.Mode = Boards.Standby,
- "TGA comp 2.inher.2.discr" );
- Validate( The_Ground_Antenna.Electronics.The_Link.TC_S = 300,
- "TGA comp 2.inher.2.1" );
- Validate( The_Ground_Antenna.Electronics.TC_S_Band_Data = 1,
- "TGA comp 2.inher.3" );
- Validate( The_Ground_Antenna.Pointing = 180, "TGA comp 3" );
-
- Validate( The_Space_Antenna.The_Band = Boards.KU_Band, "TSA discr 1");
- Validate( The_Space_Antenna.The_Command = Modules.Set_Power_State,
- "TSA discr 2");
- Validate( Plaque.TC_Match(The_Space_Antenna.ID,3),
- "TSA comp 1");
- Validate( The_Space_Antenna.Electronics.EBand = Boards.KU_Band,
- "TSA comp 2.discr 1");
- Validate( The_Space_Antenna.Electronics.The_Command_Format
- = Modules.Set_Power_State, "TSA comp 2.discr 2");
- Validate( Plaque.TC_Match(The_Space_Antenna.Electronics.ID,4),
- "TSA comp 2.inher.1");
- Validate( The_Space_Antenna.Electronics.The_Link.Mode = Boards.Standby,
- "TSA comp 2.inher.2.discr");
- Validate( The_Space_Antenna.Electronics.The_Link.TC_S = 300,
- "TSA comp 2.inher.2.1");
- Validate( The_Space_Antenna.Electronics.TC_KU_Band_Data = 2,
- "TSA comp 2.inher.3");
- Validate( The_Space_Antenna.Electronics.TC_SPS = 30,
- "TSA comp 2.1");
-
- Validate( Space_Station_Antenna.The_Band = Boards.S_Band, "SSA discr 1");
- Validate( Space_Station_Antenna.The_Command = Modules.Set_Compression_Code,
- "SSA discr 2");
- Validate( Plaque.TC_Match(Space_Station_Antenna.ID,5),
- "SSA comp 1");
- Validate( Space_Station_Antenna.Electronics.EBand = Boards.S_Band,
- "SSA comp 2.discr 1");
- Validate( Space_Station_Antenna.Electronics.The_Command_Format
- = Modules.Set_Compression_Code, "SSA comp 2.discr 2");
- Validate( Plaque.TC_Match(Space_Station_Antenna.Electronics.ID,6),
- "SSA comp 2.inher.1");
- Validate( Space_Station_Antenna.Electronics.The_Link.Mode = Boards.Standby,
- "SSA comp 2.inher.2.discr");
- Validate( Space_Station_Antenna.Electronics.The_Link.TC_S = 300,
- "SSA comp 2.inher.2.1");
- Validate( Space_Station_Antenna.Electronics.TC_S_Band_Data = 1,
- "SSA comp 2.inher.3");
- Validate( Space_Station_Antenna.Electronics.TC_SCC = 10,
- "SSA comp 2.1");
-
- The_Ground_Antenna.Electronics.TC_SDR := 1001;
- The_Ground_Antenna.Electronics.The_Link :=
-(Boards.Transmitting,2001);
- The_Ground_Antenna.Electronics.TC_S_Band_Data := 3001;
- The_Ground_Antenna.Pointing := 41;
-
- The_Space_Antenna.Electronics.The_Link := (Boards.Receiving,1010);
- The_Space_Antenna.Electronics.TC_KU_Band_Data := 2020;
- The_Space_Antenna.Electronics.TC_SPS := 3030;
-
- Space_Station_Antenna.Electronics.The_Link
- := The_Space_Antenna.Electronics.The_Link;
- Space_Station_Antenna.Electronics.The_Link.TC_R := 111;
- Space_Station_Antenna.Electronics.TC_S_Band_Data := 222;
- Space_Station_Antenna.Electronics.TC_SCC := 333;
-
- ----------------------------------------------------------------------
- begin -- should fail discriminant check
- The_Ground_Antenna.Electronics.TC_SCC := 909;
- Report.Failed("Discriminant check, no exception");
- exception
- when Constraint_Error => null;
- when others =>
- Report.Failed("Discriminant check, wrong exception");
- end;
-
- Validate( The_Ground_Antenna.Electronics.TC_SDR = 1001,
- "assigned value 1");
- Validate( The_Ground_Antenna.Electronics.The_Link.Mode
- = Boards.Transmitting,
- "assigned value 2.1");
- Validate( The_Ground_Antenna.Electronics.The_Link.TC_T = 2001,
- "assigned value 2.2");
- Validate( The_Ground_Antenna.Electronics.TC_S_Band_Data = 3001,
- "assigned value 3");
- Validate( The_Ground_Antenna.Pointing = 41,
- "assigned value 4");
-
- Validate( The_Space_Antenna.Electronics.The_Link.Mode = Boards.Receiving,
- "assigned value 5.1");
- Validate( The_Space_Antenna.Electronics.The_Link.TC_R = 1010,
- "assigned value 5.2");
- Validate( The_Space_Antenna.Electronics.TC_KU_Band_Data = 2020,
- "assigned value 6");
- Validate( The_Space_Antenna.Electronics.TC_SPS = 3030,
- "assigned value 7");
-
- Validate( Space_Station_Antenna.Electronics.The_Link.Mode
- = Boards.Receiving,
- "assigned value 8.1");
- Validate( Space_Station_Antenna.Electronics.The_Link.TC_R = 111,
- "assigned value 8.2");
- Validate( Space_Station_Antenna.Electronics.TC_S_Band_Data = 222,
- "assigned value 9");
- Validate( Space_Station_Antenna.Electronics.TC_SCC = 333,
- "assigned value 10");
-
- Report.Result;
-
-end C391001;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c391002.a b/gcc/testsuite/ada/acats/tests/c3/c391002.a
deleted file mode 100644
index 77fbfb32816..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c391002.a
+++ /dev/null
@@ -1,493 +0,0 @@
--- C391002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that structures nesting discriminated records as
--- components in record extension are correctly supported.
--- Check that record extensions inherit all the visible components
--- of their ancestor types.
--- Check that discriminants are correctly inherited.
---
--- TEST DESCRIPTION:
--- This test defines a simple class hierarchy, where the final
--- derivations exercise the different possible "permissions" available
--- to a designer. Extension aggregates for discriminated types are used
--- to set values of these final types. The key difference between
--- this test and C391001 is that the types are visible, and allow the
--- creation of complex discriminated extension aggregates. Another
--- layer of derivation is present to more robustly check that the
--- inheritance is correctly supported.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 16 Dec 94 SAIC Removed offending parenthesis in aggregate
--- extensions, corrected typo: TC_MC SB TC_PC,
--- corrected visibility errors for literals,
--- added qualification for aggregate expressions
--- used in extension aggregates, corrected parameter
--- order in call to Communications.Creator
--- 01 MAY 95 SAIC Removed "limited" from the definition of Mil_Comm
--- 14 OCT 95 SAIC Fixed some value bugs for ACVC 2.0.1
--- 04 MAR 96 SAIC Altered 3 overambitious extension aggregates
--- 11 APR 96 SAIC Updated documentation for 2.1
--- 27 FEB 97 PWB.CTA Deleted extra (illegal) component association
---!
-
------------------------------------------------------------------ C391002_1
-
-package C391002_1 is
-
- type Object is tagged private;
-
- -- Constructor operation
- procedure Create( The_Plaque : in out Object );
-
- -- Selector operations
- function TC_Match( Left_Plaque : Object; Right_Natural : Natural )
- return Boolean;
-
- function Serial_Number( A_Plaque : Object ) return Natural;
-
- Unserialized : exception; -- Serial_Number called before Create
- Reserialized : exception; -- Create called twice
-
-private
- type Object is tagged record
- Serial_Number : Natural := 0;
- end record;
-end C391002_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-package body C391002_1 is
-
- Counter : Natural := 0;
-
- procedure Create( The_Plaque : in out Object ) is
- begin
- if The_Plaque.Serial_Number = 0 then
- Counter := Counter +1;
- The_Plaque.Serial_Number := Counter;
- else
- raise Reserialized;
- end if;
- end Create;
-
- function TC_Match( Left_Plaque : Object; Right_Natural : Natural )
- return Boolean is
- begin
- return (Left_Plaque.Serial_Number = Right_Natural);
- end TC_Match;
-
- function Serial_Number( A_Plaque : Object ) return Natural is
- begin
- if A_Plaque.Serial_Number = 0 then
- raise Unserialized;
- end if;
- return A_Plaque.Serial_Number;
- end Serial_Number;
-end C391002_1;
-
------------------------------------------------------------------ C391002_2
-
-with C391002_1;
-package C391002_2 is -- package Boards is
-
- package Plaque renames C391002_1;
-
- type Modes is (Receiving, Transmitting, Standby);
- type Link(Mode: Modes := Standby) is record
- case Mode is
- when Receiving => TC_R : Integer := 100;
- when Transmitting => TC_T : Integer := 200;
- when Standby => TC_S : Integer := 300; -- TGA, TSA, SSA
- end case;
- end record;
-
- type Data_Formats is (S_Band, KU_Band, UHF);
-
- type Transceiver(Band: Data_Formats) is tagged record
- ID : Plaque.Object;
- The_Link: Link;
- case Band is
- when S_Band => TC_S_Band_Data : Integer := 1; -- TGA, SSA, Milnet
- when KU_Band => TC_KU_Band_Data : Integer := 2; -- TSA, Usenet
- when UHF => TC_UHF_Data : Integer := 3; -- Gossip
- end case;
- end record;
-end C391002_2;
-
------------------------------------------------------------------ C391002_3
-
-with C391002_1;
-with C391002_2;
-package C391002_3 is -- package Modules
-
- package Plaque renames C391002_1;
- package Boards renames C391002_2;
- use type Boards.Modes;
- use type Boards.Data_Formats;
-
- type Command_Formats is ( Set_Compression_Code,
- Set_Data_Rate,
- Set_Power_State );
-
- type Electronics_Module(EBand : Boards.Data_Formats;
- The_Command : Command_Formats)
- is new Boards.Transceiver(EBand) with record
- case The_Command is
- when Set_Compression_Code => TC_SCC : Integer := 10; -- SSA, Gossip
- when Set_Data_Rate => TC_SDR : Integer := 20; -- TGA, Usenet
- when Set_Power_State => TC_SPS : Integer := 30; -- TSA, Milnet
- end case;
- end record;
-end C391002_3;
-
------------------------------------------------------------------ C391002_4
-
-with C391002_3;
-package C391002_4 is -- Communications
- package Modules renames C391002_3;
-
- type Public_Comm is new Modules.Electronics_Module with
- record
- TC_VC : Integer;
- end record;
-
- type Private_Comm is new Modules.Electronics_Module with private;
-
- type Mil_Comm is new Modules.Electronics_Module with private;
-
- procedure Creator( Plugs : in Modules.Electronics_Module;
- Gives : out Mil_Comm);
-
- function Creator( Key : Integer; Plugs : in Modules.Electronics_Module )
- return Private_Comm;
-
- procedure Setup( It : in out Public_Comm; Value : in Integer );
- procedure Setup( It : in out Private_Comm; Value : in Integer );
- procedure Setup( It : in out Mil_Comm; Value : in Integer );
-
- function Selector( It : Public_Comm ) return Integer;
- function Selector( It : Private_Comm ) return Integer;
- function Selector( It : Mil_Comm ) return Integer;
-
-private
- type Private_Comm is new Modules.Electronics_Module with
- record
- TC_PC : Integer;
- end record;
-
- type Mil_Comm is new Modules.Electronics_Module with
- record
- TC_MC : Integer;
- end record;
-end C391002_4; -- Communications
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-with TCTouch;
-package body C391002_4 is -- Communications
-
- procedure Creator( Plugs : in Modules.Electronics_Module;
- Gives : out Mil_Comm) is
- begin
- Gives := ( Plugs with TC_MC => -1 );
- end Creator;
-
- function Creator( Key : Integer; Plugs : in Modules.Electronics_Module )
- return Private_Comm is
- begin
- return ( Plugs with TC_PC => Key );
- end Creator;
-
- procedure Setup( It : in out Public_Comm; Value : in Integer ) is
- begin
- It.TC_VC := Value;
- TCTouch.Assert( Value = 1, "Public_Comm");
- end Setup;
-
- procedure Setup( It : in out Private_Comm; Value : in Integer ) is
- begin
- It.TC_PC := Value;
- TCTouch.Assert( Value = 2, "Private_Comm");
- end Setup;
-
- procedure Setup( It : in out Mil_Comm; Value : in Integer ) is
- begin
- It.TC_MC := Value;
- TCTouch.Assert( Value = 3, "Private_Comm");
- end Setup;
-
- function Selector( It : Public_Comm ) return Integer is
- begin
- return It.TC_VC;
- end Selector;
-
- function Selector( It : Private_Comm ) return Integer is
- begin
- return It.TC_PC;
- end Selector;
-
- function Selector( It : Mil_Comm ) return Integer is
- begin
- return It.TC_MC;
- end Selector;
-
-end C391002_4; -- Communications
-
-------------------------------------------------------------------- C391002
-
-with Report;
-with TCTouch;
-with C391002_1;
-with C391002_2;
-with C391002_3;
-with C391002_4;
-procedure C391002 is
-
- package Plaque renames C391002_1;
- package Boards renames C391002_2;
- package Modules renames C391002_3;
- package Communications renames C391002_4;
-
- procedure Assert( Condition: Boolean; Message: String )
- renames TCTouch.Assert;
-
- use type Boards.Modes;
- use type Boards.Data_Formats;
- use type Modules.Command_Formats;
-
- type Azimuth is range 0..359;
-
- type Ground_Antenna(The_Band : Boards.Data_Formats;
- The_Command : Modules.Command_Formats) is
- record
- ID : Plaque.Object;
- Electronics : Modules.Electronics_Module(The_Band,The_Command);
- Pointing : Azimuth;
- end record;
-
- type Space_Antenna(The_Band : Boards.Data_Formats := Boards.KU_Band;
- The_Command : Modules.Command_Formats
- := Modules.Set_Power_State)
- is
- record
- ID : Plaque.Object;
- Electronics : Modules.Electronics_Module(The_Band,The_Command);
- end record;
-
- The_Ground_Antenna : Ground_Antenna (Boards.S_Band,
- Modules.Set_Data_Rate);
- The_Space_Antenna : Space_Antenna;
- Space_Station_Antenna : Space_Antenna (Boards.UHF,
- Modules.Set_Compression_Code);
-
- Gossip : Communications.Public_Comm (Boards.UHF,
- Modules.Set_Compression_Code);
- Usenet : Communications.Private_Comm (Boards.KU_Band,
- Modules.Set_Data_Rate);
- Milnet : Communications.Mil_Comm (Boards.S_Band,
- Modules.Set_Power_State);
-
-
-begin
-
- Report.Test("C391002", "Check nested tagged discriminated"
- & " record structures");
-
- Plaque.Create( The_Ground_Antenna.ID ); -- 1
- Plaque.Create( The_Ground_Antenna.Electronics.ID ); -- 2
- Plaque.Create( The_Space_Antenna.ID ); -- 3
- Plaque.Create( The_Space_Antenna.Electronics.ID ); -- 4
- Plaque.Create( Space_Station_Antenna.ID ); -- 5
- Plaque.Create( Space_Station_Antenna.Electronics.ID );-- 6
-
- The_Ground_Antenna := ( The_Band => Boards.S_Band,
- The_Command => Modules.Set_Data_Rate,
- ID => The_Ground_Antenna.ID,
- Electronics =>
- ( Boards.Transceiver'(
- Band => Boards.S_Band,
- ID => The_Ground_Antenna.Electronics.ID,
- The_Link => ( Mode => Boards.Transmitting,
- TC_T => 222 ),
- TC_S_Band_Data => 8 )
- with EBand => Boards.S_Band,
- The_Command => Modules.Set_Data_Rate,
- TC_SDR => 11 ),
- Pointing => 270 );
-
- The_Space_Antenna := ( The_Band => Boards.S_Band,
- The_Command => Modules.Set_Data_Rate,
- ID => The_Space_Antenna.ID,
- Electronics =>
- ( Boards.Transceiver'(
- Band => Boards.S_Band,
- ID => The_Space_Antenna.Electronics.ID,
- The_Link => ( Mode => Boards.Transmitting,
- TC_T => 456 ),
- TC_S_Band_Data => 88 )
- with
- EBand => Boards.S_Band,
- The_Command => Modules.Set_Data_Rate,
- TC_SDR => 42
- ) );
-
- Space_Station_Antenna := ( Boards.UHF, Modules.Set_Compression_Code,
- Space_Station_Antenna.ID,
- ( Boards.Transceiver'(
- Boards.UHF,
- Space_Station_Antenna.Electronics.ID,
- ( Boards.Transmitting, 202 ),
- 42 )
- with Boards.UHF,
- Modules.Set_Compression_Code,
- TC_SCC => 101
- ) );
-
- Assert( The_Ground_Antenna.The_Band = Boards.S_Band, "TGA disc 1" );
- Assert( The_Ground_Antenna.The_Command = Modules.Set_Data_Rate,
- "TGA disc 2" );
- Assert( Plaque.TC_Match(The_Ground_Antenna.ID,1), "TGA comp 3" );
- Assert( The_Ground_Antenna.Electronics.EBand = Boards.S_Band,
- "TGA comp 2.disc 1" );
- Assert( The_Ground_Antenna.Electronics.The_Command
- = Modules.Set_Data_Rate,
- "TGA comp 2.disc 2" );
- Assert( The_Ground_Antenna.Electronics.TC_SDR = 11,
- "TGA comp 2.1" );
- Assert( Plaque.TC_Match( The_Ground_Antenna.Electronics.ID, 2 ),
- "TGA comp 2.inher.1" );
- Assert( The_Ground_Antenna.Electronics.The_Link.Mode = Boards.Transmitting,
- "TGA comp 2.inher.2.disc" );
- Assert( The_Ground_Antenna.Electronics.The_Link.TC_T = 222,
- "TGA comp 2.inher.2.1" );
- Assert( The_Ground_Antenna.Electronics.TC_S_Band_Data = 8,
- "TGA comp 2.inher.3" );
- Assert( The_Ground_Antenna.Pointing = 270, "TGA comp 3" );
-
- Assert( The_Space_Antenna.The_Band = Boards.S_Band, "TSA disc 1");
- Assert( The_Space_Antenna.The_Command = Modules.Set_Data_Rate,
- "TSA disc 2");
- Assert( Plaque.TC_Match(The_Space_Antenna.ID,3),
- "TSA comp 1");
- Assert( The_Space_Antenna.Electronics.EBand = Boards.S_Band,
- "TSA comp 2.disc 1");
- Assert( The_Space_Antenna.Electronics.The_Command = Modules.Set_Data_Rate,
- "TSA comp 2.disc 2");
- Assert( The_Space_Antenna.Electronics.TC_SDR = 42,
- "TSA comp 2.1");
- Assert( Plaque.TC_Match(The_Space_Antenna.Electronics.ID,4),
- "TSA comp 2.inher.1");
- Assert( The_Space_Antenna.Electronics.The_Link.Mode = Boards.Transmitting,
- "TSA comp 2.inher.2.disc");
- Assert( The_Space_Antenna.Electronics.The_Link.TC_T = 456,
- "TSA comp 2.inher.2.1");
- Assert( The_Space_Antenna.Electronics.TC_S_Band_Data = 88,
- "TSA comp 2.inher.3");
-
- Assert( Space_Station_Antenna.The_Band = Boards.UHF, "SSA disc 1");
- Assert( Space_Station_Antenna.The_Command = Modules.Set_Compression_Code,
- "SSA disc 2");
- Assert( Plaque.TC_Match(Space_Station_Antenna.ID,5),
- "SSA comp 1");
- Assert( Space_Station_Antenna.Electronics.EBand = Boards.UHF,
- "SSA comp 2.disc 1");
- Assert( Space_Station_Antenna.Electronics.The_Command
- = Modules.Set_Compression_Code,
- "SSA comp 2.disc 2");
- Assert( Space_Station_Antenna.Electronics.TC_SCC = 101,
- "SSA comp 2.1");
- Assert( Plaque.TC_Match(Space_Station_Antenna.Electronics.ID,6),
- "SSA comp 2.inher.1");
- Assert( Space_Station_Antenna.Electronics.The_Link.Mode
- = Boards.Transmitting,
- "SSA comp 2.inher.2.disc");
- Assert( Space_Station_Antenna.Electronics.The_Link.TC_T = 202,
- "SSA comp 2.inher.2.1");
- Assert( Space_Station_Antenna.Electronics.TC_UHF_Data = 42,
- "SSA comp 2.inher.3");
-
-
- The_Space_Antenna := ( The_Band => Boards.S_Band,
- The_Command => Modules.Set_Power_State,
- ID => The_Space_Antenna.ID,
- Electronics =>
- ( Boards.Transceiver'(
- Band => Boards.S_Band,
- ID => The_Space_Antenna.Electronics.ID,
- The_Link => ( Mode => Boards.Transmitting,
- TC_T => 1 ),
- TC_S_Band_Data => 5 )
- with
- EBand => Boards.S_Band,
- The_Command => Modules.Set_Power_State,
- TC_SPS => 101
- ) );
-
- Communications.Creator( The_Space_Antenna.Electronics, Milnet );
- Assert( Communications.Selector( Milnet ) = -1, "Milnet creator" );
-
- Usenet := Communications.Creator( -2,
- ( Boards.Transceiver'(
- Band => Boards.KU_Band,
- ID => The_Space_Antenna.Electronics.ID,
- The_Link => ( Boards.Transmitting, TC_T => 101 ),
- TC_KU_Band_Data => 395 )
- with Boards.KU_Band, Modules.Set_Data_Rate, 66 ) );
-
- Assert( Communications.Selector( Usenet ) = -2, "Usenet creator" );
-
- Gossip := (
- Modules.Electronics_Module'(
- Boards.Transceiver'(
- Band => Boards.UHF,
- ID => The_Space_Antenna.Electronics.ID,
- The_Link => ( Boards.Transmitting, TC_T => 101 ),
- TC_UHF_Data => 395 )
- with
- Boards.UHF, Modules.Set_Compression_Code, 66 )
- with
- TC_VC => -3 );
-
- Assert( Gossip.TC_VC = -3, "Gossip Aggregate" );
-
- Communications.Setup( Gossip, 1 ); -- (Boards.UHF,
- -- Modules.Set_Compression_Code)
- Communications.Setup( Usenet, 2 ); -- (Boards.KU_Band,
- -- Modules.Set_Data_Rate)
- Communications.Setup( Milnet, 3 ); -- (Boards.S_Band,
- -- Modules.Set_Power_State)
-
- Assert( Communications.Selector( Gossip ) = 1, "Gossip Setup" );
- Assert( Communications.Selector( Usenet ) = 2, "Usenet Setup" );
- Assert( Communications.Selector( Milnet ) = 3, "Milnet Setup" );
-
- Report.Result;
-
-end C391002;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392002.a b/gcc/testsuite/ada/acats/tests/c3/c392002.a
deleted file mode 100644
index 41493c22779..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392002.a
+++ /dev/null
@@ -1,349 +0,0 @@
--- C392002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the use of a class-wide formal parameter allows for the
--- proper dispatching of objects to the appropriate implementation of
--- a primitive operation. Check this in the case where the root tagged
--- type is defined in a generic package, and the type derived from it is
--- defined in that same generic package.
---
--- TEST DESCRIPTION:
--- Declare a root tagged type, and some associated primitive operations.
--- Extend the root type, and override one or more primitive operations,
--- inheriting the other primitive operations from the root type.
--- Derive from the extended type, again overriding some primitive
--- operations and inheriting others (including some that the parent
--- inherited).
--- Define a subprogram with a class-wide parameter, inside of which is a
--- call on a dispatching primitive operation. These primitive operations
--- modify global variables (the class-wide parameter has mode IN).
---
--- The following hierarchy of tagged types and primitive operations is
--- utilized in this test:
---
---
--- type Vehicle (root)
--- |
--- type Motorcycle
--- |
--- | Operations
--- | Engine_Size
--- | Catalytic_Converter
--- | Emissions_Produced
--- |
--- type Automobile (extended from Motorcycle)
--- |
--- | Operations
--- | (Engine_Size) (inherited)
--- | Catalytic_Converter (overridden)
--- | Emissions_Produced (overridden)
--- |
--- type Truck (extended from Automobile)
--- |
--- | Operations
--- | (Engine_Size) (inherited twice - Motorcycle)
--- | (Catalytic_Converter) (inherited - Automobile)
--- | Emissions_Produced (overridden)
---
---
--- In this test, we are concerned with the following selection of dispatching
--- calls, accomplished with the use of a Vehicle'Class IN procedure
--- parameter :
---
--- \ Type
--- Prim. Op \ Motorcycle Automobile Truck
--- \------------------------------------------------
--- Engine_Size | X X X
--- Catalytic_Converter | X X X
--- Emissions_Produced | X X X
---
---
---
--- The location of the declaration and derivation of the root and extended
--- types will be varied over a series of tests. Locations of declaration
--- and derivation for a particular test are marked with an asterisk (*).
---
--- Root type:
---
--- Declared in package.
--- * Declared in generic package.
---
--- Extended types:
---
--- * Derived in parent location.
--- Derived in a nested package.
--- Derived in a nested subprogram.
--- Derived in a nested generic package.
--- Derived in a separate package.
--- Derived in a separate visible child package.
--- Derived in a separate private child package.
---
--- Primitive Operations:
---
--- * Procedures with same parameter profile.
--- Procedures with different parameter profile.
--- * Functions with same parameter profile.
--- Functions with different parameter profile.
--- * Mixture of Procedures and Functions.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 09 May 96 SAIC Made single-file for 2.1
---
---!
-
-------------------------------------------------------------------- C392002_0
-
--- Declare the root and extended types, along with their primitive
--- operations in a generic package.
-
-generic
-
- type Cubic_Inches is range <>;
- type Emission_Measure is digits <>;
- Emissions_per_Engine_Cubic_Inch : Emission_Measure;
-
-package C392002_0 is -- package Vehicle_Simulation
-
- --
- -- Equipment types and their primitive operations.
- --
-
- -- Root type.
-
- type Vehicle is abstract tagged
- record
- Weight : Integer;
- Wheels : Positive;
- end record;
-
- -- Abstract operations of type Vehicle.
- function Engine_Size (V : in Vehicle) return Cubic_Inches
- is abstract;
- function Catalytic_Converter (V : in Vehicle) return Boolean
- is abstract;
- function Emissions_Produced (V : in Vehicle) return Emission_Measure
- is abstract;
-
- --
-
- type Motorcycle is new Vehicle with
- record
- Size_Of_Engine : Cubic_Inches;
- end record;
-
- -- Primitive operations of type Motorcycle.
- function Engine_Size (V : in Motorcycle) return Cubic_Inches;
- function Catalytic_Converter (V : in Motorcycle) return Boolean;
- function Emissions_Produced (V : in Motorcycle) return Emission_Measure;
-
- --
-
- type Automobile is new Motorcycle with
- record
- Passenger_Capacity : Integer;
- end record;
-
- -- Function Engine_Size inherited from parent (Motorcycle).
- -- Primitive operations (Overridden).
- function Catalytic_Converter (V : in Automobile) return Boolean;
- function Emissions_Produced (V : in Automobile) return Emission_Measure;
-
- --
-
- type Truck is new Automobile with
- record
- Hauling_Capacity : Natural;
- end record;
-
- -- Function Engine_Size inherited twice.
- -- Function Catalytic_Converter inherited from parent (Automobile).
- -- Primitive operation (Overridden).
- function Emissions_Produced (V : in Truck) return Emission_Measure;
-
-end C392002_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-package body c392002_0 is
-
- --
- -- Primitive operations for Motorcycle.
- --
-
- function Engine_Size (V : in Motorcycle) return Cubic_Inches is
- begin
- return (V.Size_Of_Engine);
- end Engine_Size;
-
-
- function Catalytic_Converter (V : in Motorcycle) return Boolean is
- begin
- return (False);
- end Catalytic_Converter;
-
-
- function Emissions_Produced (V : in Motorcycle) return Emission_Measure is
- begin
- return 100.00;
- end Emissions_Produced;
-
- --
- -- Overridden operations for Automobile type.
- --
-
- function Catalytic_Converter (V : in Automobile) return Boolean is
- begin
- return (True);
- end Catalytic_Converter;
-
-
- function Emissions_Produced (V : in Automobile) return Emission_Measure is
- begin
- return 200.00;
- end Emissions_Produced;
-
- --
- -- Overridden operation for Truck type.
- --
-
- function Emissions_Produced (V : in Truck) return Emission_Measure is
- begin
- return 300.00;
- end Emissions_Produced;
-
-end C392002_0;
-
---------------------------------------------------------------------- C392002
-
-with C392002_0; -- with Vehicle_Simulation;
-with Report;
-
-procedure C392002 is
-
- type Decade is (c1970, c1980, c1990);
- type Vehicle_Emissions is digits 6;
- type Engine_Emissions_by_Decade is array (Decade) of Vehicle_Emissions;
- subtype Engine_Size is Integer range 100 .. 1000;
-
- Five_Tons : constant Natural := 10000;
- Catalytic_Converter_Offset : constant Vehicle_Emissions := 0.8;
- Truck_Adjustment_Factor : constant Vehicle_Emissions := 1.2;
-
-
- Engine_Emission_Factor : Engine_Emissions_by_Decade := (c1970 => 10.00,
- c1980 => 8.00,
- c1990 => 5.00);
-
- -- Instantiate generic package for 1970 simulation.
-
- package Sim_1970 is new C392002_0
- (Cubic_Inches => Engine_Size,
- Emission_Measure => Vehicle_Emissions,
- Emissions_Per_Engine_Cubic_Inch => Engine_Emission_Factor (c1970));
-
-
- -- Declare and initialize vehicle objects.
-
- Cycle_1970 : Sim_1970.Motorcycle := (Weight => 400,
- Wheels => 2,
- Size_Of_Engine => 100);
-
- Auto_1970 : Sim_1970.Automobile := (2000, 4, 500, 5);
-
- Truck_1970 : Sim_1970.Truck := (Weight => 5000,
- Wheels => 18,
- Size_Of_Engine => 1000,
- Passenger_Capacity => 2,
- Hauling_Capacity => Five_Tons);
-
- -- Function Get_Engine_Size performs a dispatching call on a
- -- primitive operation that has been defined for an ancestor type and
- -- inherited by each type derived from the ancestor.
-
- function Get_Engine_Size (V : in Sim_1970.Vehicle'Class)
- return Engine_Size is
- begin
- return (Sim_1970.Engine_Size (V)); -- Dispatch according to tag.
- end Get_Engine_Size;
-
-
- -- Function Catalytic_Converter_Present performs a dispatching call on
- -- a primitive operation that has been defined for an ancestor type,
- -- overridden in the parent extended type, and inherited by the subsequent
- -- extended type.
-
- function Catalytic_Converter_Present (V : in Sim_1970.Vehicle'Class)
- return Boolean is
- begin
- return (Sim_1970.Catalytic_Converter (V)); -- Dispatch according to tag.
- end Catalytic_Converter_Present;
-
-
- -- Function Air_Quality_Measure performs a dispatching call on
- -- a primitive operation that has been defined for an ancestor type, and
- -- overridden in each subsequent extended type.
-
- function Air_Quality_Measure (V : in Sim_1970.Vehicle'Class)
- return Vehicle_Emissions is
- begin
- return (Sim_1970.Emissions_Produced (V)); -- Dispatch according to tag.
- end Air_Quality_Measure;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-begin -- Main test procedure.
-
- Report.Test ("C392002", "Check that the use of a class-wide parameter "
- & "allows for proper dispatching where root type "
- & "and extended types are declared in the same "
- & "generic package" );
-
- if (Get_Engine_Size (Cycle_1970) /= 100) or
- (Get_Engine_Size (Auto_1970) /= 500) or
- (Get_Engine_Size (Truck_1970) /= 1000)
- then
- Report.Failed ("Failed dispatch to Get_Engine_Size");
- end if;
-
- if Catalytic_Converter_Present (Cycle_1970) or
- not Catalytic_Converter_Present (Auto_1970) or
- not Catalytic_Converter_Present (Truck_1970)
- then
- Report.Failed ("Failed dispatch to Catalytic_Converter_Present");
- end if;
-
- if ((Air_Quality_Measure (Cycle_1970) /= 100.00) or
- (Air_Quality_Measure (Auto_1970) /= 200.00) or
- (Air_Quality_Measure (Truck_1970) /= 300.00))
- then
- Report.Failed ("Failed dispatch to Air_Quality_Measure");
- end if;
-
- Report.Result;
-
-end C392002;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392003.a b/gcc/testsuite/ada/acats/tests/c3/c392003.a
deleted file mode 100644
index d7c5be22867..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392003.a
+++ /dev/null
@@ -1,453 +0,0 @@
--- C392003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the use of a class-wide formal parameter allows for the
--- proper dispatching of objects to the appropriate implementation of
--- a primitive operation. Check this where the root tagged type is
--- defined in a package, and the extended type is defined in a nested
--- package.
---
--- TEST DESCRIPTION:
--- Declare a root tagged type, and some associated primitive operations.
--- Extend the root type, and override one or more primitive operations,
--- inheriting the other primitive operations from the root type.
--- Derive from the extended type, again overriding some primitive
--- operations and inheriting others (including some that the parent
--- inherited).
--- Define a subprogram with a class-wide parameter, inside of which is a
--- call on a dispatching primitive operation. These primitive operations
--- modify global variables (the class-wide parameter has mode IN).
---
---
---
--- The following hierarchy of tagged types and primitive operations is
--- utilized in this test:
---
--- type Bank_Account (root)
--- |
--- | Operations
--- | Increment_Bank_Reserve
--- | Assign_Representative
--- | Increment_Counters
--- | Open
--- |
--- type Savings_Account (extended from Bank_Account)
--- |
--- | Operations
--- | (Increment_Bank_Reserve) (inherited)
--- | Assign_Representative (overridden)
--- | Increment_Counters (overridden)
--- | Open (overridden)
--- |
--- type Preferred_Account (extended from Savings_Account)
--- |
--- | Operations
--- | (Increment_Bank_Reserve) (inherited twice - Bank_Acct.)
--- | (Assign_Representative) (inherited - Savings_Acct.)
--- | Increment_Counters (overridden)
--- | Open (overridden)
---
---
--- In this test, we are concerned with the following selection of dispatching
--- calls, accomplished with the use of a Bank_Account'Class IN procedure
--- parameter :
---
--- \ Type
--- Prim. Op \ Bank_Account Savings_Account Preferred_Account
--- \------------------------------------------------
--- Increment_Bank_Reserve| X X
--- Assign_Representative | X
--- Increment_Counters | X X X
---
---
---
--- The location of the declaration and derivation of the root and extended
--- types will be varied over a series of tests. Locations of declaration
--- and derivation for a particular test are marked with an asterisk (*).
---
--- Root type:
---
--- * Declared in package.
--- Declared in generic package.
---
--- Extended types:
---
--- Derived in parent location.
--- * Derived in a nested package.
--- Derived in a nested subprogram.
--- Derived in a nested generic package.
--- Derived in a separate package.
--- Derived in a separate visible child package.
--- Derived in a separate private child package.
---
--- Primitive Operations:
---
--- * Procedures with same parameter profile.
--- Procedures with different parameter profile.
--- * Functions with same parameter profile.
--- Functions with different parameter profile.
--- * Mixture of Procedures and Functions.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
- with Report;
-
- procedure C392003 is
-
- --
- -- Types and subtypes.
- --
-
- type Dollar_Amount is new float;
- type Interest_Rate is delta 0.001 range 0.000 .. 1.000;
- type Account_Types is (Bank, Savings, Preferred, Total);
- type Account_Counter is array (Account_Types) of integer;
- type Account_Rep is (President, Manager, New_Account_Manager, Teller);
-
- --
- -- Constants.
- --
-
- Opening_Balance : constant Dollar_Amount := 100.00;
- Current_Rate : constant Interest_Rate := 0.030;
- Preferred_Minimum_Balance : constant Dollar_Amount := 1000.00;
-
- --
- -- Global Variables
- --
-
- Bank_Reserve : Dollar_Amount := 0.00;
- Daily_Representative : Account_Rep := New_Account_Manager;
- Number_Of_Accounts : Account_Counter := (Bank => 0,
- Savings => 0,
- Preferred => 0,
- Total => 0);
-
- -- Root tagged type and primitive operations declared in internal
- -- package (Accounts).
- -- Extended types (and primitive operations) derived in nested packages.
-
- --=================================================================--
-
- package Accounts is
-
- --
- -- Root account type and primitive operations.
- --
-
- -- Root type.
-
- type Bank_Account is tagged
- record
- Balance : Dollar_Amount;
- end record;
-
- -- Primitive operations of Bank_Account.
-
- function Increment_Bank_Reserve (Acct : in Bank_Account)
- return Dollar_Amount;
- function Assign_Representative (Acct : in Bank_Account)
- return Account_Rep;
- procedure Increment_Counters (Acct : in Bank_Account);
- procedure Open (Acct : in out Bank_Account);
-
- --=================================================================--
-
- package S_And_L is
-
- -- Declare extended type in a nested package.
-
- type Savings_Account is new Bank_Account with
- record
- Rate : Interest_Rate;
- end record;
-
- -- Function Increment_Bank_Reserve inherited from
- -- parent (Bank_Account).
-
- -- Primitive operations (Overridden).
- function Assign_Representative (Acct : in Savings_Account)
- return Account_Rep;
- procedure Increment_Counters (Acct : in Savings_Account);
- procedure Open (Acct : in out Savings_Account);
-
-
- --=================================================================--
-
- package Premium is
-
- -- Declare further extended type in a nested package.
-
- type Preferred_Account is new Savings_Account with
- record
- Minimum_Balance : Dollar_Amount;
- end record;
-
- -- Function Increment_Bank_Reserve inherited twice.
- -- Function Assign_Representative inherited from parent
- -- (Savings_Account).
-
- -- Primitive operation (Overridden).
- procedure Increment_Counters (Acct : in Preferred_Account);
- procedure Open (Acct : in out Preferred_Account);
-
- -- Function used to verify Open operation for Preferred_Account
- -- objects.
- function Verify_Open (Acct : in Preferred_Account) return Boolean;
-
- end Premium;
-
- end S_And_L;
-
- end Accounts;
-
- --=================================================================--
-
- package body Accounts is
-
- --
- -- Primitive operations for Bank_Account.
- --
-
- function Increment_Bank_Reserve (Acct : in Bank_Account)
- return Dollar_Amount is
- begin
- return (Bank_Reserve + Acct.Balance);
- end Increment_Bank_Reserve;
-
- function Assign_Representative (Acct : in Bank_Account)
- return Account_Rep is
- begin
- return Account_Rep'(Teller);
- end Assign_Representative;
-
- procedure Increment_Counters (Acct : in Bank_Account) is
- begin
- Number_Of_Accounts (Bank) := Number_Of_Accounts (Bank) + 1;
- Number_Of_Accounts (Total) := Number_Of_Accounts (Total) + 1;
- end Increment_Counters;
-
- procedure Open (Acct : in out Bank_Account) is
- begin
- Acct.Balance := Opening_Balance;
- end Open;
-
- --=================================================================--
-
- package body S_And_L is
-
- --
- -- Overridden operations for Savings_Account type.
- --
-
- function Assign_Representative (Acct : in Savings_Account)
- return Account_Rep is
- begin
- return (Manager);
- end Assign_Representative;
-
- procedure Increment_Counters (Acct : in Savings_Account) is
- begin
- Number_Of_Accounts (Savings) := Number_Of_Accounts (Savings) + 1;
- Number_Of_Accounts (Total) := Number_Of_Accounts (Total) + 1;
- end Increment_Counters;
-
- procedure Open (Acct : in out Savings_Account) is
- begin
- Open (Bank_Account(Acct));
- Acct.Rate := Current_Rate;
- Acct.Balance := 2.0 * Opening_Balance;
- end Open;
-
- --=================================================================--
-
- package body Premium is
-
- --
- -- Overridden operations for Preferred_Account type.
- --
-
- procedure Increment_Counters (Acct : in Preferred_Account) is
- begin
- Number_Of_Accounts (Preferred) :=
- Number_Of_Accounts (Preferred) + 1;
- Number_Of_Accounts (Total) :=
- Number_Of_Accounts (Total) + 1;
- end Increment_Counters;
-
- procedure Open (Acct : in out Preferred_Account) is
- begin
- Open (Savings_Account(Acct));
- Acct.Minimum_Balance := Preferred_Minimum_Balance;
- Acct.Balance := Acct.Minimum_Balance;
- end Open;
-
- --
- -- Function used to verify Open operation for Preferred_Account
- -- objects.
- --
-
- function Verify_Open (Acct : in Preferred_Account)
- return Boolean is
- begin
- return (Acct.Balance = Preferred_Minimum_Balance and
- Acct.Rate = Current_Rate and
- Acct.Minimum_Balance = Preferred_Minimum_Balance);
- end Verify_Open;
-
- end Premium;
-
- end S_And_L;
-
- end Accounts;
-
- --=================================================================--
-
- -- Declare account objects.
-
- B_Account : Accounts.Bank_Account;
- S_Account : Accounts.S_And_L.Savings_Account;
- P_Account : Accounts.S_And_L.Premium.Preferred_Account;
-
- -- Procedures to operate on accounts.
- -- Each uses a class-wide IN parameter, as well as a call to a
- -- dispatching operation.
-
- -- Function Tabulate_Account performs a dispatching call on a primitive
- -- operation that has been overridden for each of the extended types.
-
- procedure Tabulate_Account (Acct : in Accounts.Bank_Account'Class) is
- begin
- Accounts.Increment_Counters (Acct); -- Dispatch according to tag.
- end Tabulate_Account;
-
- -- Function Accumulate_Reserve performs a dispatching call on a
- -- primitive operation that has been defined for the root type and
- -- inherited by each derived type.
-
- function Accumulate_Reserve (Acct : in Accounts.Bank_Account'Class)
- return Dollar_Amount is
- begin
- -- Dispatch according to tag.
- return (Accounts.Increment_Bank_Reserve (Acct));
- end Accumulate_Reserve;
-
- -- Procedure Resolve_Dispute performs a dispatching call on a primitive
- -- operation that has been defined in the root type, overridden in the
- -- first derived extended type, and inherited by the subsequent extended
- -- type.
-
- procedure Resolve_Dispute (Acct : in Accounts.Bank_Account'Class) is
- begin
- -- Dispatch according to tag.
- Daily_Representative := Accounts.Assign_Representative (Acct);
- end Resolve_Dispute;
-
- --=================================================================--
-
- begin -- Main test procedure.
-
- Report.Test ("C392003", "Check that the use of a class-wide parameter " &
- "allows for proper dispatching where root type " &
- "is declared in a nested package, and " &
- "subsequent extended types are derived in " &
- "further nested packages" );
-
- Bank_Account_Subtest:
- begin
- Accounts.Open (B_Account);
-
- -- Demonstrate class-wide parameter allowing dispatch by a primitive
- -- operation that has been defined for this specific type.
- Bank_Reserve := Accumulate_Reserve (Acct => B_Account);
- Tabulate_Account (B_Account);
-
- if (Bank_Reserve /= Opening_Balance) or
- (Number_Of_Accounts (Bank) /= 1) or
- (Number_Of_Accounts (Total) /= 1)
- then
- Report.Failed ("Failed in Bank_Account_Subtest");
- end if;
-
- end Bank_Account_Subtest;
-
-
- Savings_Account_Subtest:
- begin
- Accounts.S_And_L.Open (Acct => S_Account);
-
- -- Demonstrate class-wide parameter allowing dispatch by a primitive
- -- operation that has been overridden for this extended type.
- Resolve_Dispute (Acct => S_Account);
- Tabulate_Account (S_Account);
-
- if (Daily_Representative /= Manager) or
- (Number_Of_Accounts (Savings) /= 1) or
- (Number_Of_Accounts (Total) /= 2)
- then
- Report.Failed ("Failed in Savings_Account_Subtest");
- end if;
-
- end Savings_Account_Subtest;
-
-
-
- Preferred_Account_Subtest:
- begin
- Accounts.S_And_L.Premium.Open (P_Account);
-
- -- Verify that the correct implementation of Open (overridden) was
- -- used for the Preferred_Account object.
- if not Accounts.S_And_L.Premium.Verify_Open (P_Account) then
- Report.Failed ("Incorrect values for init. Preferred Acct object");
- end if;
-
- -- Demonstrate class-wide parameter allowing dispatch by a primitive
- -- operation that has been twice inherited by this extended type.
- Bank_Reserve := Accumulate_Reserve (Acct => P_Account);
-
- -- Demonstrate class-wide parameter allowing dispatch by a primitive
- -- operation that has been overridden for this extended type (the
- -- operation was overridden by its parent type as well).
- Tabulate_Account (P_Account);
-
- if Bank_Reserve /= 1100.00 or
- Number_Of_Accounts (Preferred) /= 1 or
- Number_Of_Accounts (Total) /= 3
- then
- Report.Failed ("Failed in Preferred_Account_Subtest");
- end if;
-
- end Preferred_Account_Subtest;
-
- Report.Result;
-
- end C392003;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392004.a b/gcc/testsuite/ada/acats/tests/c3/c392004.a
deleted file mode 100644
index 0851db1d287..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392004.a
+++ /dev/null
@@ -1,189 +0,0 @@
--- C392004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that subprograms inherited from tagged derivations, which are
--- subsequently redefined for the derived type, are available to the
--- package defining the new class via view conversion. Check
--- that operations performed on objects using view conversion do not
--- affect the extended fields. Check that visible operations not masked
--- by the deriving package remain available to the client, and do not
--- affect the extended fields.
---
--- TEST DESCRIPTION:
--- This test declares a tagged type, with a constructor operation,
--- derives a type from that tagged type, and declares a constructor
--- operation which masks the inherited operation. It then tests
--- that the correct constructor is called, and that the extended
--- part of the derived type remains untouched as appropriate.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Removed RM references from objective text.
--- 04 Jan 94 SAIC Fixed objective typo, removed dead code.
---
---!
-
-with Report;
-
-package C392004_1 is
-
- type Vehicle is tagged private;
-
- procedure Create ( The_Vehicle : out Vehicle; TC_Flag : Natural );
- procedure Start ( The_Vehicle : in out Vehicle );
-
-private
-
- type Vehicle is tagged record
- Engine_On : Boolean;
- end record;
-
-end C392004_1;
-
-package body C392004_1 is
- procedure Create ( The_Vehicle : out Vehicle; TC_Flag : Natural ) is
- begin
- case TC_Flag is
- when 1 => null; -- expected flag for this subprogram
- when others =>
- Report.Failed ("Called Vehicle Create");
- end case;
- The_Vehicle := (Engine_On => False);
- end Create;
-
- procedure Start ( The_Vehicle : in out Vehicle ) is
- begin
- The_Vehicle.Engine_On := True;
- end Start;
-
-end C392004_1;
-
-----------------------------------------------------------------------------
-
-with C392004_1;
-package C392004_2 is
-
- type Car is new C392004_1.Vehicle with record
- Convertible : Boolean;
- end record;
-
- -- masking definition
- procedure Create( The_Car : out Car; TC_Flag : Natural );
-
- type Limo is new Car with null record;
-
- procedure Create( The_Limo : out Limo; TC_Flag : Natural );
-
-end C392004_2;
-
-----------------------------------------------------------------------------
-
-with Report;
-package body C392004_2 is
-
- procedure Create( The_Car : out Car; TC_Flag : Natural ) is
- begin
- case TC_Flag is
- when 2 => null; -- expected flag for this subprogram
- when others => Report.Failed ("Called Car Create");
- end case;
- C392004_1.Create( C392004_1.Vehicle(The_Car), 1);
- The_Car.Convertible := False;
- end Create;
-
- procedure Create( The_Limo : out Limo; TC_Flag : Natural ) is
- begin
- case TC_Flag is
- when 3 => null; -- expected flag for this subprogram
- when others => Report.Failed ("Called Limo Create");
- end case;
- C392004_1.Create( C392004_1.Vehicle(The_Limo), 1);
- The_Limo.Convertible := True;
- end Create;
-
-end C392004_2;
-
-----------------------------------------------------------------------------
-
-with Report;
-with C392004_1; use C392004_1;
-with C392004_2; use C392004_2;
-procedure C392004 is
-
- My_Car : Car;
- Your_Car : Limo;
-
- procedure TC_Assert( Is_True : Boolean; Message : String ) is
- begin
- if not Is_True then
- Report.Failed (Message);
- end if;
- end TC_Assert;
-
-begin -- Main test procedure.
-
- Report.Test ("C392004", "Check subprogram inheritance & visibility " &
- "for derived tagged types" );
-
- My_Car.Convertible := False;
- Create( Vehicle( My_Car ), 1 );
- TC_Assert( not My_Car.Convertible, "Altered descendent component 1");
-
- Create( Your_Car, 3 );
- TC_Assert( Your_Car.Convertible, "Did not set inherited component 2");
-
- My_Car.Convertible := True;
- Create( Vehicle( My_Car ), 1 );
- TC_Assert( My_Car.Convertible, "Altered descendent component 3");
-
- Create( My_Car, 2 );
- TC_Assert( not My_Car.Convertible, "Did not set extending component 4");
-
- My_Car.Convertible := False;
- Start( Vehicle( My_Car ) );
- TC_Assert( not My_Car.Convertible , "Altered descendent component 5");
-
- Start( My_Car );
- TC_Assert( not My_Car.Convertible, "Altered unreferenced component 6");
-
- Your_Car.Convertible := False;
- Start( Vehicle( Your_Car ) );
- TC_Assert( not Your_Car.Convertible , "Altered descendent component 7");
-
- Start( Your_Car );
- TC_Assert( not Your_Car.Convertible, "Altered unreferenced component 8");
-
- My_Car.Convertible := True;
- Start( Vehicle( My_Car ) );
- TC_Assert( My_Car.Convertible, "Altered descendent component 9");
-
- Start( My_Car );
- TC_Assert( My_Car.Convertible, "Altered unreferenced component 10");
-
- Report.Result;
-
-end C392004;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392005.a b/gcc/testsuite/ada/acats/tests/c3/c392005.a
deleted file mode 100644
index be49cd48b75..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392005.a
+++ /dev/null
@@ -1,367 +0,0 @@
--- C392005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for an implicitly declared dispatching operation that is
--- overridden, the body executed is the body for the overriding
--- subprogram, even if the overriding occurs in a private part.
---
--- Check for the case where the overriding operations are declared in a
--- public child unit of the package declaring the parent type, and the
--- descendant type is a private extension.
---
--- Check for both dispatching and nondispatching calls.
---
---
--- TEST DESCRIPTION:
--- Consider:
---
--- package Parent is
--- type Root is tagged ...
--- procedure Vis_Op (P: Root);
--- private
--- procedure Pri_Op (P: Root);
--- end Parent;
---
--- package Parent.Child is
--- type Derived is new Root with private;
--- -- Implicit Vis_Op (P: Derived) declared here.
---
--- procedure Pri_Op (P: Derived); -- (A)
--- ...
--- private
--- type Derived is new Root with record...
--- -- Implicit Pri_Op (P: Derived) declared here.
-
--- procedure Vis_Op (P: Derived); -- (B)
--- ...
--- end Parent.Child;
---
--- Type Derived inherits both Vis_Op and Pri_Op from the ancestor type
--- Root. Note, however, that Vis_Op is implicitly declared in the visible
--- part, whereas Pri_Op is implicitly declared in the private part
--- (inherited subprograms for a private extension are implicitly declared
--- after the private_extension_declaration if the corresponding
--- declaration from the ancestor is visible at that place; otherwise the
--- inherited subprogram is not declared for the private extension,
--- although it might be for the full type).
---
--- Even though Root's version of Pri_Op hasn't been implicitly declared
--- for Derived at the time Derived's version of Pri_Op has been
--- explicitly declared, the explicit Pri_Op still overrides the implicit
--- version.
--- Also, even though the explicit Vis_Op for Derived is declared in the
--- private part it still overrides the implicit version declared in the
--- visible part. Calls with tag Derived will execute (A) and (B).
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 26 Nov 96 SAIC Improved for ACVC 2.1
---
---!
-
-package C392005_0 is
-
- type Remote_Camera is tagged private;
-
- type Depth_Of_Field is range 5 .. 100;
- type Shutter_Speed is (One, Two_Fifty, Four_Hundred, Thousand);
- type Aperture is (Eight, Sixteen, Thirty_Two);
-
- -- ...Other declarations.
-
- procedure Focus (Cam : in out Remote_Camera;
- Depth : in Depth_Of_Field);
-
- procedure Self_Test (C: in out Remote_Camera'Class);
-
- -- ...Other operations.
-
- function TC_Get_Depth (C: Remote_Camera) return Depth_Of_Field;
- function TC_Get_Speed (C: Remote_Camera) return Shutter_Speed;
-
-private
-
- type Remote_Camera is tagged record
- DOF : Depth_Of_Field := 10;
- Shutter: Shutter_Speed := One;
- FStop : Aperture := Eight;
- end record;
-
- procedure Set_Shutter_Speed (C : in out Remote_Camera;
- Speed : in Shutter_Speed);
-
- -- For the basic remote camera, shutter speed might be set as a function of
- -- focus perhaps, thus it is declared as a private operation (usable
- -- only internally within the abstraction).
-
- function Set_Aperture (C : Remote_Camera) return Aperture;
-
-end C392005_0;
-
-
- --==================================================================--
-
-
-package body C392005_0 is
-
- procedure Focus (Cam : in out Remote_Camera;
- Depth : in Depth_Of_Field) is
- begin
- -- Artificial for testing purposes.
- Cam.DOF := 46;
- end Focus;
-
- -----------------------------------------------------------
- procedure Set_Shutter_Speed (C : in out Remote_Camera;
- Speed : in Shutter_Speed) is
- begin
- -- Artificial for testing purposes.
- C.Shutter := Thousand;
- end Set_Shutter_Speed;
-
- -----------------------------------------------------------
- function Set_Aperture (C : Remote_Camera) return Aperture is
- begin
- -- Artificial for testing purposes.
- return Thirty_Two;
- end Set_Aperture;
-
- -----------------------------------------------------------
- procedure Self_Test (C: in out Remote_Camera'Class) is
- TC_Dummy_Depth : constant Depth_Of_Field := 23;
- TC_Dummy_Speed : constant Shutter_Speed := Four_Hundred;
- begin
-
- -- Test focus at various depths:
- Focus(C, TC_Dummy_Depth);
- -- ...Additional calls to Focus.
-
- -- Test various shutter speeds:
- Set_Shutter_Speed(C, TC_Dummy_Speed);
- -- ...Additional calls to Set_Shutter_Speed.
-
- end Self_Test;
-
- -----------------------------------------------------------
- function TC_Get_Depth (C: Remote_Camera) return Depth_Of_Field is
- begin
- return C.DOF;
- end TC_Get_Depth;
-
- -----------------------------------------------------------
- function TC_Get_Speed (C: Remote_Camera) return Shutter_Speed is
- begin
- return C.Shutter;
- end TC_Get_Speed;
-
-end C392005_0;
-
- --==================================================================--
-
-
-package C392005_0.C392005_1 is
-
- type Auto_Speed is new Remote_Camera with private;
-
-
- -- procedure Focus (C : in out Auto_Speed; -- Implicitly declared
- -- Depth : in Depth_Of_Field) -- here.
-
- -- For the improved remote camera, shutter speed can be set manually,
- -- so it is declared as a public operation.
-
- -- The order of declarations for Set_Aperture and Set_Shutter_Speed are
- -- reversed from the original declarations to trap potential compiler
- -- problems related to subprogram ordering.
-
- function Set_Aperture (C : Auto_Speed) return Aperture; -- Overrides
- -- inherited op.
-
- procedure Set_Shutter_Speed (C : in out Auto_Speed; -- Overrides
- Speed : in Shutter_Speed);-- inherited op.
-
- -- Set_Shutter_Speed and Set_Aperture override the operations inherited
- -- from the parent, even though the inherited operations are not implicitly
- -- declared until the private part below.
-
- type New_Camera is private;
-
- function TC_Get_Aper (C: New_Camera) return Aperture;
-
- -- ...Other operations.
-
-private
- type Film_Speed is (One_Hundred, Two_Hundred, Four_Hundred);
-
- type Auto_Speed is new Remote_Camera with record
- ASA : Film_Speed;
- end record;
-
- -- procedure Set_Shutter_Speed (C : in out Auto_Speed; -- Implicitly
- -- Speed : in Shutter_Speed) -- declared
- -- here.
-
- -- function Set_Aperture (C : Auto_Speed) return Aperture; -- Implicitly
- -- declared.
-
- procedure Focus (C : in out Auto_Speed; -- Overrides
- Depth : in Depth_Of_Field); -- inherited op.
-
- -- For the improved remote camera, perhaps the focusing algorithm is
- -- different, so the original Focus operation is overridden here.
-
- Auto_Camera : Auto_Speed;
-
- type New_Camera is record
- Aper : Aperture := Set_Aperture (Auto_Camera); -- Calls the overridden,
- end record; -- not the inherited op.
-
-end C392005_0.C392005_1;
-
-
- --==================================================================--
-
-
-package body C392005_0.C392005_1 is
-
- procedure Focus (C : in out Auto_Speed;
- Depth : in Depth_Of_Field) is
- begin
- -- Artificial for testing purposes.
- C.DOF := 57;
- end Focus;
-
- ---------------------------------------------------------------
- procedure Set_Shutter_Speed (C : in out Auto_Speed;
- Speed : in Shutter_Speed) is
- begin
- -- Artificial for testing purposes.
- C.Shutter := Two_Fifty;
- end Set_Shutter_Speed;
-
- -----------------------------------------------------------
- function Set_Aperture (C : Auto_Speed) return Aperture is
- begin
- -- Artificial for testing purposes.
- return Sixteen;
- end Set_Aperture;
-
- -----------------------------------------------------------
- function TC_Get_Aper (C: New_Camera) return Aperture is
- begin
- return C.Aper;
- end TC_Get_Aper;
-
-end C392005_0.C392005_1;
-
-
- --==================================================================--
-
-
-with C392005_0.C392005_1;
-
-with Report;
-
-procedure C392005 is
- Basic_Camera : C392005_0.Remote_Camera;
- Auto_Camera1 : C392005_0.C392005_1.Auto_Speed;
- Auto_Camera2 : C392005_0.C392005_1.Auto_Speed;
- Auto_Depth : C392005_0.Depth_Of_Field := 67;
- New_Camera1 : C392005_0.C392005_1.New_Camera;
- TC_Expected_Basic_Depth : constant C392005_0.Depth_Of_Field := 46;
- TC_Expected_Auto_Depth : constant C392005_0.Depth_Of_Field := 57;
- TC_Expected_Basic_Speed : constant C392005_0.Shutter_Speed
- := C392005_0.Thousand;
- TC_Expected_Auto_Speed : constant C392005_0.Shutter_Speed
- := C392005_0.Two_Fifty;
- TC_Expected_New_Aper : constant C392005_0.Aperture
- := C392005_0.Sixteen;
-
- use type C392005_0.Depth_Of_Field;
- use type C392005_0.Shutter_Speed;
- use type C392005_0.Aperture;
-
-begin
- Report.Test ("C392005", "Dispatching for overridden primitive " &
- "subprograms: private extension declared in child unit, " &
- "parent is tagged private whose full view is tagged record");
-
--- Call the class-wide operation for Remote_Camera'Class, which itself makes
--- dispatching calls to Focus and Set_Shutter_Speed:
-
-
- -- For an object of type Remote_Camera, the dispatching calls should
- -- dispatch to the bodies declared for the root type:
-
- C392005_0.Self_Test(Basic_Camera);
-
- if C392005_0.TC_Get_Depth (Basic_Camera) /= TC_Expected_Basic_Depth
- or else C392005_0.TC_Get_Speed (Basic_Camera) /= TC_Expected_Basic_Speed
- then
- Report.Failed ("Calls dispatched incorrectly for root type");
- end if;
-
-
- -- For an object of type Auto_Speed, the dispatching calls should
- -- dispatch to the bodies declared for the derived type:
-
- C392005_0.Self_Test(Auto_Camera1);
-
- if C392005_0.C392005_1.TC_Get_Depth(Auto_Camera1) /= TC_Expected_Auto_Depth
-
- or
- C392005_0.C392005_1.TC_Get_Speed(Auto_Camera1) /= TC_Expected_Auto_Speed
- then
- Report.Failed ("Calls dispatched incorrectly for derived type");
- end if;
-
- -- For an object of type Auto_Speed, a non-dispatching call to Focus should
-
- -- execute the body declared for the derived type (even through it is
- -- declared in the private part).
-
- C392005_0.C392005_1.Focus (Auto_Camera2, Auto_Depth);
-
- if C392005_0.C392005_1.TC_Get_Depth(Auto_Camera2) /= TC_Expected_Auto_Depth
-
- then
- Report.Failed ("Non-dispatching call to privately overriding " &
- "subprogram executed the wrong body");
- end if;
-
- -- For an object of type New_Camera, the initialization using Set_Ap
- -- should execute the overridden body, not the inherited one.
-
- if C392005_0.C392005_1.TC_Get_Aper (New_Camera1) /= TC_Expected_New_Aper
- then
- Report.Failed ("Non-dispatching call to visible overriding " &
- "subprogram executed the wrong body");
- end if;
-
- Report.Result;
-
-end C392005;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392008.a b/gcc/testsuite/ada/acats/tests/c3/c392008.a
deleted file mode 100644
index 27b4e2a8644..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392008.a
+++ /dev/null
@@ -1,401 +0,0 @@
--- C392008.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the use of a class-wide formal parameter allows for the
--- proper dispatching of objects to the appropriate implementation of
--- a primitive operation. Check this for the case where the root tagged
--- type is defined in a package and the extended type is defined in a
--- dependent package.
---
--- TEST DESCRIPTION:
--- Declare a root tagged type, and some associated primitive operations,
--- in a visible library package.
--- Extend the root type in another visible library package, and override
--- one or more primitive operations, inheriting the other primitive
--- operations from the root type.
--- Derive from the extended type in yet another visible library package,
--- again overriding some primitive operations and inheriting others
--- (including some that the parent inherited).
--- Define subprograms with class-wide parameters, inside of which is a
--- call on a dispatching primitive operation. These primitive
--- operations modify the objects of the specific class passed as actuals
--- to the class-wide formal parameter (class-wide formal parameter has
--- mode IN OUT).
---
--- The following hierarchy of tagged types and primitive operations is
--- utilized in this test:
---
--- package Bank
--- type Account (root)
--- |
--- | Operations
--- | proc Deposit
--- | proc Withdrawal
--- | func Balance
--- | proc Service_Charge
--- | proc Add_Interest
--- | proc Open
--- |
--- package Checking
--- type Account (extended from Bank.Account)
--- |
--- | Operations
--- | proc Deposit (inherited)
--- | proc Withdrawal (inherited)
--- | func Balance (inherited)
--- | proc Service_Charge (inherited)
--- | proc Add_Interest (inherited)
--- | proc Open (overridden)
--- |
--- package Interest_Checking
--- type Account (extended from Checking.Account)
--- |
--- | Operations
--- | proc Deposit (inherited twice - Bank.Acct.)
--- | proc Withdrawal (inherited twice - Bank.Acct.)
--- | func Balance (inherited twice - Bank.Acct.)
--- | proc Service_Charge (inherited twice - Bank.Acct.)
--- | proc Add_Interest (overridden)
--- | proc Open (overridden)
--- |
---
--- In this test, we are concerned with the following selection of dispatching
--- calls, accomplished with the use of a Bank.Account'Class IN OUT formal
--- parameter :
---
--- \ Type
--- Prim. Op \ Bank.Account Checking.Account Interest_Checking.Account
--- \---------------------------------------------------------
-
--- Service_Charge | X X X
--- Add_Interest | X X X
--- Open | X X X
---
---
---
--- The location of the declaration of the root and derivation of extended
--- types will be varied over a series of tests. Locations of declaration
--- and derivation for a particular test are marked with an asterisk (*).
---
--- Root type:
---
--- * Declared in package.
--- Declared in generic package.
---
--- Extended types:
---
--- Derived in parent location.
--- Derived in a nested package.
--- Derived in a nested subprogram.
--- Derived in a nested generic package.
--- * Derived in a separate package.
--- Derived in a separate visible child package.
--- Derived in a separate private child package.
---
--- Primitive Operations:
---
--- * Procedures with same parameter profile.
--- Procedures with different parameter profile.
--- Functions with same parameter profile.
--- Functions with different parameter profile.
--- Mixture of Procedures and Functions.
---
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- C392008_0.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 20 Nov 95 SAIC C392B04 became C392008 for ACVC 2.0.1
---
---!
-
------------------------------------------------------------------ C392008_0
-
-package C392008_0 is -- package Bank
-
- type Dollar_Amount is range -30_000..30_000;
-
- type Account is tagged
- record
- Current_Balance: Dollar_Amount;
- end record;
-
- -- Primitive operations.
-
- procedure Deposit (A : in out Account;
- X : in Dollar_Amount);
- procedure Withdrawal (A : in out Account;
- X : in Dollar_Amount);
- function Balance (A : in Account) return Dollar_Amount;
- procedure Service_Charge (A : in out Account);
- procedure Add_Interest (A : in out Account);
- procedure Open (A : in out Account);
-
-end C392008_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-package body C392008_0 is
-
- -- Primitive operations for type Account.
-
- procedure Deposit (A : in out Account;
- X : in Dollar_Amount) is
- begin
- A.Current_Balance := A.Current_Balance + X;
- end Deposit;
-
- procedure Withdrawal(A : in out Account;
- X : in Dollar_Amount) is
- begin
- A.Current_Balance := A.Current_Balance - X;
- end Withdrawal;
-
- function Balance (A : in Account) return Dollar_Amount is
- begin
- return (A.Current_Balance);
- end Balance;
-
- procedure Service_Charge (A : in out Account) is
- begin
- A.Current_Balance := A.Current_Balance - 5_00;
- end Service_Charge;
-
- procedure Add_Interest (A : in out Account) is
- Interest_On_Account : Dollar_Amount := 0_00;
- begin
- A.Current_Balance := A.Current_Balance + Interest_On_Account;
- end Add_Interest;
-
- procedure Open (A : in out Account) is
- Initial_Deposit : Dollar_Amount := 10_00;
- begin
- A.Current_Balance := Initial_Deposit;
- end Open;
-
-end C392008_0;
-
------------------------------------------------------------------ C392008_1
-
-with C392008_0; -- package Bank
-
-package C392008_1 is -- package Checking
-
- package Bank renames C392008_0;
-
- type Account is new Bank.Account with
- record
- Overdraft_Fee : Bank.Dollar_Amount;
- end record;
-
- -- Overridden primitive operation.
-
- procedure Open (A : in out Account);
-
- -- Inherited primitive operations.
- -- procedure Deposit (A : in out Account;
- -- X : in Bank.Dollar_Amount);
- -- procedure Withdrawal (A : in out Account;
- -- X : in Bank.Dollar_Amount);
- -- function Balance (A : in Account) return Bank.Dollar_Amount;
- -- procedure Service_Charge (A : in out Account);
- -- procedure Add_Interest (A : in out Account);
-
-end C392008_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-package body C392008_1 is
-
- -- Overridden primitive operation.
-
- procedure Open (A : in out Account) is
- Check_Guarantee : Bank.Dollar_Amount := 10_00;
- Initial_Deposit : Bank.Dollar_Amount := 20_00;
- begin
- A.Current_Balance := Initial_Deposit;
- A.Overdraft_Fee := Check_Guarantee;
- end Open;
-
-end C392008_1;
-
------------------------------------------------------------------ C392008_2
-
-with C392008_0; -- with Bank;
-with C392008_1; -- with Checking;
-
-package C392008_2 is -- package Interest_Checking
-
- package Bank renames C392008_0;
- package Checking renames C392008_1;
-
- subtype Interest_Rate is Bank.Dollar_Amount range 0..100; -- was digits 4;
-
- Current_Rate : Interest_Rate := 0_02;
-
- type Account is new Checking.Account with
- record
- Rate : Interest_Rate;
- end record;
-
- -- Overridden primitive operations.
-
- procedure Add_Interest (A : in out Account);
- procedure Open (A : in out Account);
-
- -- "Twice" inherited primitive operations (from Bank.Account)
- -- procedure Deposit (A : in out Account;
- -- X : in Bank.Dollar_Amount);
- -- procedure Withdrawal (A : in out Account;
- -- X : in Bank.Dollar_Amount);
- -- function Balance (A : in Account) return Bank.Dollar_Amount;
- -- procedure Service_Charge (A : in out Account);
-
-end C392008_2;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-package body C392008_2 is
-
- -- Overridden primitive operations.
-
- procedure Add_Interest (A : in out Account) is
- Interest_On_Account : Bank.Dollar_Amount
- := Bank.Dollar_Amount( Bank."*"( A.Current_Balance, A.Rate ));
- begin
- A.Current_Balance := Bank."+"( A.Current_Balance, Interest_On_Account);
- end Add_Interest;
-
- procedure Open (A : in out Account) is
- Initial_Deposit : Bank.Dollar_Amount := 30_00;
- begin
- Checking.Open (Checking.Account (A));
- A.Current_Balance := Initial_Deposit;
- A.Rate := Current_Rate;
- end Open;
-
-end C392008_2;
-
-------------------------------------------------------------------- C392008
-
-with C392008_0; use C392008_0; -- package Bank
-with C392008_1; use C392008_1; -- package Checking;
-with C392008_2; use C392008_2; -- package Interest_Checking;
-with Report;
-
-procedure C392008 is
-
- package Bank renames C392008_0;
- package Checking renames C392008_1;
- package Interest_Checking renames C392008_2;
-
- B_Acct : Bank.Account;
- C_Acct : Checking.Account;
- IC_Acct : Interest_Checking.Account;
-
- --
- -- Define procedures with class-wide formal parameters of mode IN OUT.
- --
-
- -- This procedure will perform a dispatching call on the
- -- overridden primitive operation Open.
-
- procedure New_Account (Acct : in out Bank.Account'Class) is
- begin
- Open (Acct); -- Dispatch according to tag of class-wide parameter.
- end New_Account;
-
- -- This procedure will perform a dispatching call on the inherited
- -- primitive operation (for all types derived from the root Bank.Account)
- -- Service_Charge.
-
- procedure Apply_Service_Charge (Acct: in out Bank.Account'Class) is
- begin
- Service_Charge (Acct); -- Dispatch according to tag of class-wide parm.
- end Apply_Service_Charge;
-
- -- This procedure will perform a dispatching call on the
- -- inherited/overridden primitive operation Add_Interest.
-
- procedure Annual_Interest (Acct: in out Bank.Account'Class) is
- begin
- Add_Interest (Acct); -- Dispatch according to tag of class-wide parm.
- end Annual_Interest;
-
-begin
-
- Report.Test ("C392008", "Check that the use of a class-wide formal " &
- "parameter allows for the proper dispatching " &
- "of objects to the appropriate implementation " &
- "of a primitive operation");
-
- -- Check the dispatch to primitive operations overridden for each
- -- extended type.
- New_Account (B_Acct);
- New_Account (C_Acct);
- New_Account (IC_Acct);
-
- if (B_Acct.Current_Balance /= 10_00) or
- (C_Acct.Current_Balance /= 20_00) or
- (IC_Acct.Current_Balance /= 30_00)
- then
- Report.Failed ("Failed dispatch to multiply overridden prim. oper.");
- end if;
-
-
- Annual_Interest (B_Acct);
- Annual_Interest (C_Acct);
- Annual_Interest (IC_Acct); -- Check the dispatch to primitive operation
- -- overridden from a parent type which inherited
- -- the operation from the root type.
- if (B_Acct.Current_Balance /= 10_00) or
- (C_Acct.Current_Balance /= 20_00) or
- (IC_Acct.Current_Balance /= 90_00)
- then
- Report.Failed ("Failed dispatch to overridden primitive operation");
- end if;
-
-
- Apply_Service_Charge (Acct => B_Acct);
- Apply_Service_Charge (Acct => C_Acct);
- Apply_Service_Charge (Acct => IC_Acct); -- Check the dispatch to a
- -- primitive operation twice
- -- inherited from the root
- -- tagged type.
- if (B_Acct.Current_Balance /= 5_00) or
- (C_Acct.Current_Balance /= 15_00) or
- (IC_Acct.Current_Balance /= 85_00)
- then
- Report.Failed ("Failed dispatch to Apply_Service_Charge");
- end if;
-
- Report.Result;
-
-end C392008;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392010.a b/gcc/testsuite/ada/acats/tests/c3/c392010.a
deleted file mode 100644
index ec168780cbf..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392010.a
+++ /dev/null
@@ -1,512 +0,0 @@
--- C392010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a subprogram dispatches correctly with a controlling
--- access parameter. Check that a subprogram dispatches correctly
--- when it has access parameters that are not controlling.
--- Check with and without default expressions.
---
--- TEST DESCRIPTION:
--- The three packages define layers of tagged types. The root tagged
--- type contains a character value used to check that the right object
--- got passed to the right routine. Each subprogram has a unique
--- TCTouch tag, upper case values are used for subprograms, lower case
--- values are used for object values.
---
--- Notes on style: the "tagged" comment lines --I and --A represent
--- commentary about what gets inherited and what becomes abstract,
--- respectively. The author felt these to be necessary with this test
--- to reduce some of the additional complexities.
---
---3.9.2(16,17,18,20);6.0
---
--- CHANGE HISTORY:
--- 22 SEP 95 SAIC Initial version
--- 22 APR 96 SAIC Revised for 2.1
--- 05 JAN 98 EDS Change return type of C392010_2.Func_W_Non to make
--- it override.
--- 21 JUN 00 RLB Changed expected result to reflect the appropriate
--- value of the default expression.
--- 20 JUL 00 RLB Removed entire call pending resolution by the ARG.
-
---!
-
------------------------------------------------------------------ C392010_0
-
-package C392010_0 is
-
- -- define a root tagged type
- type Tagtype_Level_0 is tagged record
- Ch_Item : Character;
- end record;
-
- type Access_Procedure is access procedure( P: Tagtype_Level_0 );
-
- procedure Proc_1( P: Tagtype_Level_0 );
-
- procedure Proc_2( P: Tagtype_Level_0 );
-
- function A_Default_Value return Tagtype_Level_0;
-
- procedure Proc_w_Ap_and_Cp( AP : Access_Procedure;
- Cp : Tagtype_Level_0 );
- -- has both access procedure and controlling parameter
-
- procedure Proc_w_Ap_and_Cp_w_Def( AP : Access_Procedure := Proc_2'Access;
- Cp : Tagtype_Level_0
- := A_Default_Value ); ------------ z
- -- has both access procedure and controlling parameter with defaults
-
- -- for the objective:
--- Check that access parameters may be controlling.
-
- procedure Proc_w_Cp_Ap( Cp_Ap : access Tagtype_Level_0 );
- -- has access parameter that is controlling
-
- function Func_w_Cp_Ap_and_Cr( Cp_Ap : access Tagtype_Level_0 )
- return Tagtype_Level_0;
- -- has access parameter that is controlling, and controlling result
-
- Level_0_Global_Object : aliased Tagtype_Level_0
- := ( Ch_Item => 'a' ); ---------------------------- a
-
-end C392010_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-package body C392010_0 is
-
- procedure Proc_1( P: Tagtype_Level_0 ) is
- begin
- TCTouch.Touch('A'); --------------------------------------------------- A
- TCTouch.Touch(P.Ch_Item); -- depends on the value passed -------------- ?
- end Proc_1;
-
- procedure Proc_2( P: Tagtype_Level_0 ) is
- begin
- TCTouch.Touch('B'); --------------------------------------------------- B
- TCTouch.Touch(P.Ch_Item); -- depends on the value passed -------------- ?
- end Proc_2;
-
- function A_Default_Value return Tagtype_Level_0 is
- begin
- return (Ch_Item => 'z'); ---------------------------------------------- z
- end A_Default_Value;
-
- procedure Proc_w_Ap_and_Cp( Ap : Access_Procedure;
- Cp : Tagtype_Level_0 ) is
- begin
- TCTouch.Touch('C'); --------------------------------------------------- C
- Ap.all( Cp );
- end Proc_w_Ap_and_Cp;
-
- procedure Proc_w_Ap_and_Cp_w_Def( AP : Access_Procedure := Proc_2'Access;
- Cp : Tagtype_Level_0
- := A_Default_Value ) is
- begin
- TCTouch.Touch('D'); --------------------------------------------------- D
- Ap.all( Cp );
- end Proc_w_Ap_and_Cp_w_Def;
-
- procedure Proc_w_Cp_Ap( Cp_Ap : access Tagtype_Level_0 ) is
- begin
- TCTouch.Touch('E'); --------------------------------------------------- E
- TCTouch.Touch(Cp_Ap.Ch_Item); -- depends on the value passed ---------- ?
- end Proc_w_Cp_Ap;
-
- function Func_w_Cp_Ap_and_Cr( Cp_Ap : access Tagtype_Level_0 )
- return Tagtype_Level_0 is
- begin
- TCTouch.Touch('F'); --------------------------------------------------- F
- TCTouch.Touch(Cp_Ap.Ch_Item); -- depends on the value passed ---------- ?
- return ( Ch_Item => 'b' ); -------------------------------------------- b
- end Func_w_Cp_Ap_and_Cr;
-
-end C392010_0;
-
------------------------------------------------------------------ C392010_1
-
-with C392010_0;
-package C392010_1 is
-
- type Tagtype_Level_1 is new C392010_0.Tagtype_Level_0 with record
- Int_Item : Integer;
- end record;
-
- type Access_Tagtype_Level_1 is access all Tagtype_Level_1'Class;
-
- -- the following procedures are inherited by the above declaration:
- --I procedure Proc_1( P: Tagtype_Level_1 );
- --I
- --I procedure Proc_2( P: Tagtype_Level_1 );
- --I
- --I procedure Proc_w_Ap_and_Cp( AP : C392010_0.Access_Procedure;
- --I Cp : Tagtype_Level_1 );
- --I
- --I procedure Proc_w_Ap_and_Cp_w_Def
- --I ( AP : C392010_0.Access_Procedure := Proc_2'Access;
- --I Cp : Tagtype_Level_1 := A_Default_Value );
- --I
- --I procedure Proc_w_Cp_Ap( Cp_Ap : access Tagtype_Level_1 );
- --I
-
- -- the following functions become abstract due to the above declaration:
- --A function A_Default_Value return Tagtype_Level_1;
- --A
- --A function Func_w_Cp_Ap_and_Cr( Cp_Ap : access Tagtype_Level_1 )
- --A return Tagtype_Level_1;
-
- -- so, in the interest of testing dispatching, we override them all:
- -- except Proc_1 and Proc_2
-
- procedure Proc_w_Ap_and_Cp( AP : C392010_0.Access_Procedure;
- Cp : Tagtype_Level_1 );
-
- function A_Default_Value return Tagtype_Level_1;
-
- procedure Proc_w_Ap_and_Cp_w_Def(
- AP : C392010_0.Access_Procedure := C392010_0.Proc_2'Access;
- Cp : Tagtype_Level_1 := A_Default_Value );
-
- procedure Proc_w_Cp_Ap( Cp_Ap : access Tagtype_Level_1 );
-
- function Func_w_Cp_Ap_and_Cr( Cp_Ap : access Tagtype_Level_1 )
- return Tagtype_Level_1;
-
- -- to test the objective:
--- Check that a subprogram dispatches correctly when it has
--- access parameters that are not controlling.
-
- procedure Proc_w_Non( Cp_Ap : access Tagtype_Level_1;
- NonCp_Ap : access C392010_0.Tagtype_Level_0
- := C392010_0.Level_0_Global_Object'Access );
-
- function Func_w_Non( Cp_Ap : access Tagtype_Level_1;
- NonCp_Ap : access C392010_0.Tagtype_Level_0
- := C392010_0.Level_0_Global_Object'Access )
- return Access_Tagtype_Level_1;
-
- Level_1_Global_Object : aliased Tagtype_Level_1
- := ( Int_Item => 0,
- Ch_Item => 'c' ); --------------------------- c
-
-end C392010_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-package body C392010_1 is
-
- procedure Proc_w_Ap_and_Cp( AP : C392010_0.Access_Procedure;
- Cp : Tagtype_Level_1 ) is
- begin
- TCTouch.Touch('G'); --------------------------------------------------- G
- Ap.All( C392010_0.Tagtype_Level_0( Cp ) );
- end Proc_w_Ap_and_Cp;
-
- procedure Proc_w_Ap_and_Cp_w_Def(
- AP : C392010_0.Access_Procedure := C392010_0.Proc_2'Access;
- Cp : Tagtype_Level_1 := A_Default_Value )
- is
- begin
- TCTouch.Touch('H'); --------------------------------------------------- H
- Ap.All( C392010_0.Tagtype_Level_0( Cp ) );
- end Proc_w_Ap_and_Cp_w_Def;
-
- procedure Proc_w_Cp_Ap( Cp_Ap : access Tagtype_Level_1 ) is
- begin
- TCTouch.Touch('I'); --------------------------------------------------- I
- TCTouch.Touch(Cp_Ap.Ch_Item); -- depends on the value passed ---------- ?
- end Proc_w_Cp_Ap;
-
- function A_Default_Value return Tagtype_Level_1 is
- begin
- return ( Int_Item => 0, Ch_Item => 'y' ); ---------------------------- y
- end A_Default_Value;
-
- function Func_w_Cp_Ap_and_Cr( Cp_Ap : access Tagtype_Level_1 )
- return Tagtype_Level_1 is
- begin
- TCTouch.Touch('J'); --------------------------------------------------- J
- TCTouch.Touch(Cp_Ap.Ch_Item); -- depends on the value passed ---------- ?
- return ( Int_Item => 2, Ch_Item => 'd' ); ----------------------------- d
- end Func_w_Cp_Ap_and_Cr;
-
- procedure Proc_w_Non( Cp_Ap : access Tagtype_Level_1;
- NonCp_Ap : access C392010_0.Tagtype_Level_0
- := C392010_0.Level_0_Global_Object'Access ) is
- begin
- TCTouch.Touch('K'); --------------------------------------------------- K
- TCTouch.Touch(Cp_Ap.Ch_Item); ----- depends on the value passed ------- ?
- TCTouch.Touch(NonCp_Ap.Ch_Item); -- depends on the value passed ------- ?
- end Proc_w_Non;
-
- Own_Item : aliased Tagtype_Level_1 := ( Int_Item => 3, Ch_Item => 'e' );
-
- function Func_w_Non( Cp_Ap : access Tagtype_Level_1;
- NonCp_Ap : access C392010_0.Tagtype_Level_0
- := C392010_0.Level_0_Global_Object'Access )
- return Access_Tagtype_Level_1 is
- begin
- TCTouch.Touch('L'); --------------------------------------------------- L
- TCTouch.Touch(Cp_Ap.Ch_Item); ----- depends on the value passed ------- ?
- TCTouch.Touch(NonCp_Ap.Ch_Item); -- depends on the value passed ------- ?
- return Own_Item'Access; ----------------------------------------------- e
- end Func_w_Non;
-
-end C392010_1;
-
-
-
------------------------------------------------------------------ C392010_2
-
-with C392010_0;
-with C392010_1;
-package C392010_2 is
-
- Lev2_Level_0_Global_Object : aliased C392010_0.Tagtype_Level_0
- := ( Ch_Item => 'f' ); ---------------------------- f
-
- type Tagtype_Level_2 is new C392010_1.Tagtype_Level_1 with record
- Another_Int_Item : Integer;
- end record;
-
- type Access_Tagtype_Level_2 is access all Tagtype_Level_2;
-
- -- the following procedures are inherited by the above declaration:
- --I procedure Proc_1( P: Tagtype_Level_2 );
- --I
- --I procedure Proc_2( P: Tagtype_Level_2 );
- --I
- --I procedure Proc_w_Ap_and_Cp( AP : C392010_0.Access_Procedure;
- --I Cp : Tagtype_Level_2 );
- --I
- --I procedure Proc_w_Ap_and_Cp_w_Def
- --I (AP: C392010_0.Access_Procedure := C392010_0. Proc_2'Access;
- --I CP: Tagtype_Level_2 := A_Default_Value );
- --I
- --I procedure Proc_w_Cp_Ap( Cp_Ap : access Tagtype_Level_2 );
- --I
- --I procedure Proc_w_Non( Cp_Ap : access Tagtype_Level_2;
- --I NonCp_Ap : access C392010_0.Tagtype_Level_0
- --I := C392010_0.Level_0_Global_Object'Access );
-
- -- the following functions become abstract due to the above declaration:
- --A function Func_w_Cp_Ap_and_Cr( Cp_Ap : access Tagtype_Level_2 )
- --A return Tagtype_Level_2;
- --A
- --A function A_Default_Value
- --A return Access_Tagtype_Level_2;
-
- -- so we override the interesting ones to check the objective:
--- Check that a subprogram with parameters of distinct tagged types may
--- be primitive for only one type (i.e. the other tagged types must be
--- declared in other packages). Check that the subprogram does not
--- dispatch for the other type(s).
-
- procedure Proc_w_Non( Cp_Ap : access Tagtype_Level_2;
- NonCp_Ap : access C392010_0.Tagtype_Level_0
- := Lev2_Level_0_Global_Object'Access );
-
- function Func_w_Non( Cp_Ap : access Tagtype_Level_2;
- NonCp_Ap : access C392010_0.Tagtype_Level_0
- := Lev2_Level_0_Global_Object'Access )
- return C392010_1.Access_Tagtype_Level_1;
-
- -- and override the other abstract functions
- function Func_w_Cp_Ap_and_Cr( Cp_Ap : access Tagtype_Level_2 )
- return Tagtype_Level_2;
-
- function A_Default_Value return Tagtype_Level_2;
-
-end C392010_2;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-with Report;
-package body C392010_2 is
-
- procedure Proc_w_Non( Cp_Ap : access Tagtype_Level_2;
- NonCp_Ap : access C392010_0.Tagtype_Level_0
- := Lev2_Level_0_Global_Object'Access ) is
- begin
- TCTouch.Touch('M'); --------------------------------------------------- M
- TCTouch.Touch(Cp_Ap.Ch_Item); ----- depends on the value passed ------- ?
- TCTouch.Touch(NonCp_Ap.Ch_Item); -- depends on the value passed ------- ?
- end Proc_w_Non;
-
- function A_Default_Value return Tagtype_Level_2 is
- begin
- return ( Another_Int_Item | Int_Item => 0, Ch_Item => 'x' ); -------- x
- end A_Default_Value;
-
- Own : aliased Tagtype_Level_2
- := ( Another_Int_Item | Int_Item => 4, Ch_Item => 'g' );
-
- function Func_w_Non( Cp_Ap : access Tagtype_Level_2;
- NonCp_Ap : access C392010_0.Tagtype_Level_0
- := Lev2_Level_0_Global_Object'Access )
- return C392010_1.Access_Tagtype_Level_1 is
- begin
- TCTouch.Touch('N'); --------------------------------------------------- N
- TCTouch.Touch(Cp_Ap.Ch_Item); ----- depends on the value passed ------- ?
- TCTouch.Touch(NonCp_Ap.Ch_Item); -- depends on the value passed ------- ?
- return Own'Access; ---------------------------------------------------- g
- end Func_w_Non;
-
- function Func_w_Cp_Ap_and_Cr( Cp_Ap : access Tagtype_Level_2 )
- return Tagtype_Level_2 is
- begin
- TCTouch.Touch('P'); --------------------------------------------------- P
- TCTouch.Touch(Cp_Ap.Ch_Item); ----- depends on the value passed ------- ?
- return ( Another_Int_Item | Int_Item => 5, Ch_Item => 'h' ); ---------- h
- end Func_w_Cp_Ap_and_Cr;
-
-end C392010_2;
-
-
-
-------------------------------------------------------------------- C392010
-
-with Report;
-with TCTouch;
-with C392010_0, C392010_1, C392010_2;
-
-procedure C392010 is
-
- type Access_Class_0 is access all C392010_0.Tagtype_Level_0'Class;
-
- -- define an array of class-wide pointers:
- type Zero_Dispatch_List is array(Natural range <>) of Access_Class_0;
-
- Item_0 : aliased C392010_0.Tagtype_Level_0 := ( Ch_Item => 'k' ); ------ k
- Item_1 : aliased C392010_1.Tagtype_Level_1 := ( Ch_Item => 'm', ------ m
- Int_Item => 1 );
- Item_2 : aliased C392010_2.Tagtype_Level_2 := ( Ch_Item => 'n', ------ n
- Int_Item => 1,
- Another_Int_Item => 1 );
-
- Z: Zero_Dispatch_List(1..3) := (Item_0'Access,Item_1'Access,Item_2'Access);
-
- procedure Subtest_1( Items: Zero_Dispatch_List ) is
- -- there is little difference between the actions for _1 and _2 in
- -- this subtest due to the nature of _2 inheriting most operations
- --
- -- this subtest checks operations available to Level_0'Class
- begin
- for I in Items'Range loop
-
- C392010_0.Proc_w_Ap_and_Cp( C392010_0.Proc_1'Access, Items(I).all );
- -- CAk, GAm, GAn
- -- actual is class-wide, operation should dispatch
-
- case I is -- use defaults
- when 1 => C392010_0.Proc_w_Ap_and_Cp_w_Def;
- -- DBz
- when 2 => C392010_1.Proc_w_Ap_and_Cp_w_Def;
- -- HBy
- when 3 => null; -- Removed following pending resolution by ARG
- -- (see AI-00239):
- -- C392010_2.Proc_w_Ap_and_Cp_w_Def;
- -- HBx
- when others => Report.Failed("Unexpected loop value");
- end case;
-
- C392010_0.Proc_w_Ap_and_Cp_w_Def -- override defaults
- ( C392010_0.Proc_1'Access, Items(I).all );
- -- DAk, HAm, HAn
-
- C392010_0.Proc_w_Cp_Ap( Items(I) );
- -- Ek, Im, In
-
- -- function return value is controlling for procedure call
- C392010_0.Proc_w_Ap_and_Cp_w_Def( C392010_0.Proc_1'Access,
- C392010_0.Func_w_Cp_Ap_and_Cr( Items(I) ) );
- -- FkDAb, JmHAd, PnHAh
- -- note that the function evaluates first
-
- end loop;
- end Subtest_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- type Access_Class_1 is access all C392010_1.Tagtype_Level_1'Class;
-
- type One_Dispatch_List is array(Natural range <>) of Access_Class_1;
-
- Object_1 : aliased C392010_1.Tagtype_Level_1 := ( Ch_Item => 'p', ----- p
- Int_Item => 1 );
- Object_2 : aliased C392010_2.Tagtype_Level_2 := ( Ch_Item => 'q', ----- q
- Int_Item => 1,
- Another_Int_Item => 1 );
-
- D: One_Dispatch_List(1..2) := (Object_1'Access, Object_2'Access);
-
- procedure Subtest_2( Items: One_Dispatch_List ) is
- -- this subtest checks operations available to Level_1'Class,
- -- specifically those operations that are not testable in subtest_1,
- -- the operations with parameters of the two tagged type objects.
- begin
- for I in Items'Range loop
-
- C392010_1.Proc_w_Non( -- t_1, t_2
- C392010_1.Func_w_Non( Items(I),
- C392010_0.Tagtype_Level_0(Z(I).all)'Access ), -- Lpk Nqm
- C392010_0.Tagtype_Level_0(Z(I+1).all)'Access ); -- Kem Mgn
-
- end loop;
- end Subtest_2;
-
-begin -- Main test procedure.
-
- Report.Test ("C392010", "Check that a subprogram dispatches correctly " &
- "with a controlling access parameter. " &
- "Check that a subprogram dispatches correctly " &
- "when it has access parameters that are not " &
- "controlling. Check with and without default " &
- "expressions" );
-
- Subtest_1( Z );
-
- -- Original result:
- --TCTouch.Validate( "CAkDBzDAkEkFkDAb"
- -- & "GAmHByHAmImJmHAd"
- -- & "GAnHBxHAnInPnHAh", "Subtest 1" );
-
- -- Result pending resultion of AI-239:
- TCTouch.Validate( "CAkDBzDAkEkFkDAb"
- & "GAmHByHAmImJmHAd"
- & "GAnHAnInPnHAh", "Subtest 1" );
-
- Subtest_2( D );
-
- TCTouch.Validate( "LpkKem" & "NqmMgn", "Subtest 2" );
-
- Report.Result;
-
-end C392010;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392011.a b/gcc/testsuite/ada/acats/tests/c3/c392011.a
deleted file mode 100644
index c32ec77c0d0..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392011.a
+++ /dev/null
@@ -1,299 +0,0 @@
--- C392011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if a function call with a controlling result is itself
--- a controlling operand of an enclosing call on a dispatching operation,
--- then its controlling tag value is determined by the controlling tag
--- value of the enclosing call.
---
--- TEST DESCRIPTION:
--- The test builds and traverses a "ragged" list; a linked list which
--- contains data elements of three different types (all rooted at
--- Level_0'Class). The traversal of this list checks the objective
--- by calling the dispatching operation "Check" using an item from the
--- list, and calling the function create; thus causing the controlling
--- result of the function to be determined by evaluating the value of
--- the other controlling parameter to the two-parameter Check.
---
---
--- CHANGE HISTORY:
--- 22 SEP 95 SAIC Initial version
--- 23 APR 96 SAIC Corrected commentary, differentiated integer.
---
---!
-
------------------------------------------------------------------ C392011_0
-
-package C392011_0 is
-
- type Level_0 is tagged record
- Ch_Item : Character;
- end record;
-
- function Create return Level_0;
- -- primitive dispatching function
-
- procedure Check( Left, Right: in Level_0 );
- -- has controlling parameters
-
-end C392011_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-with TCTouch;
-package body C392011_0 is
-
- The_Character : Character := 'A';
-
- function Create return Level_0 is
- Created_Item_0 : constant Level_0 := ( Ch_Item => The_Character );
- begin
- The_Character := Character'Succ(The_Character);
- TCTouch.Touch('A'); -- --- ---- ----- ---- --- -- --- ---- ----- ---- -- A
- return Created_Item_0;
- end Create;
-
- procedure Check( Left, Right: in Level_0 ) is
- begin
- TCTouch.Touch('B'); -- --- ---- ----- ---- --- -- --- ---- ----- ---- -- B
- end Check;
-
-end C392011_0;
-
------------------------------------------------------------------ C392011_1
-
-with C392011_0;
-package C392011_1 is
-
- type Level_1 is new C392011_0.Level_0 with record
- Int_Item : Integer;
- end record;
-
- -- note that Create becomes abstract upon this derivation hence:
-
- function Create return Level_1;
-
- procedure Check( Left, Right: in Level_1 );
-
-end C392011_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-package body C392011_1 is
-
- Integer_1 : Integer := 0;
-
- function Create return Level_1 is
- Created_Item_1 : constant Level_1
- := ( C392011_0.Create with Int_Item => Integer_1 );
- -- note call to ^--------------^ -- A
- begin
- Integer_1 := Integer'Succ(Integer_1);
- TCTouch.Touch('C'); -- --- ---- ----- ---- --- -- --- ---- ----- ---- -- C
- return Created_Item_1;
- end Create;
-
- procedure Check( Left, Right: in Level_1 ) is
- begin
- TCTouch.Touch('D'); -- --- ---- ----- ---- --- -- --- ---- ----- ---- -- D
- end Check;
-
-end C392011_1;
-
------------------------------------------------------------------ C392011_2
-
-with C392011_1;
-package C392011_2 is
-
- type Level_2 is new C392011_1.Level_1 with record
- Another_Int_Item : Integer;
- end record;
-
- -- note that Create becomes abstract upon this derivation hence:
-
- function Create return Level_2;
-
- procedure Check( Left, Right: in Level_2 );
-
-end C392011_2;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-package body C392011_2 is
-
- Integer_2 : Integer := 100;
-
- function Create return Level_2 is
- Created_Item_2 : constant Level_2
- := ( C392011_1.Create with Another_Int_Item => Integer_2 );
- -- note call to ^--------------^ -- AC
- begin
- Integer_2 := Integer'Succ(Integer_2);
- TCTouch.Touch('E'); -- --- ---- ----- ---- --- -- --- ---- ----- ---- -- E
- return Created_Item_2;
- end Create;
-
- procedure Check( Left, Right: in Level_2 ) is
- begin
- TCTouch.Touch('F'); -- --- ---- ----- ---- --- -- --- ---- ----- ---- -- F
- end Check;
-
-end C392011_2;
-
-------------------------------------------------------- C392011_2.C392011_3
-
-with C392011_0;
-package C392011_2.C392011_3 is
-
- type Wide_Reference is access all C392011_0.Level_0'Class;
-
- type Ragged_Element;
-
- type List_Pointer is access Ragged_Element;
-
- type Ragged_Element is record
- Data : Wide_Reference;
- Next : List_Pointer;
- end record;
-
- procedure Build_List;
-
- procedure Traverse_List;
-
-end C392011_2.C392011_3;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-package body C392011_2.C392011_3 is
-
- The_List : List_Pointer;
-
- procedure Build_List is
- begin
-
- -- build a list that looks like:
- -- Level_2, Level_1, Level_2, Level_1, Level_0
- --
- -- the mechanism is to create each object, "pushing" the existing list
- -- onto the end: cons( new_item, car, cdr )
-
- The_List :=
- new Ragged_Element'( new C392011_0.Level_0'(C392011_0.Create), null );
- -- Level_0 >> A
-
- The_List :=
- new Ragged_Element'( new C392011_1.Level_1'(C392011_1.Create), The_List );
- -- Level_1 -> Level_0 >> AC
-
- The_List :=
- new Ragged_Element'( new C392011_2.Level_2'(C392011_2.Create), The_List );
- -- Level_2 -> Level_1 -> Level_0 >> ACE
-
- The_List :=
- new Ragged_Element'( new C392011_1.Level_1'(C392011_1.Create), The_List );
- -- Level_1 -> Level_2 -> Level_1 -> Level_0 >> AC
-
- The_List :=
- new Ragged_Element'( new C392011_2.Level_2'(C392011_2.Create), The_List );
- -- Level_2 -> Level_1 -> Level_2 -> Level_1 -> Level_0 >> ACE
-
- end Build_List;
-
- procedure Traverse_List is
-
- Next_Item : List_Pointer := The_List;
-
- -- Check that if a function call with a controlling result is itself
- -- a controlling operand of an enclosing call on a dispatching operation,
- -- then its controlling tag value is determined by the controlling tag
- -- value of the enclosing call.
-
- -- Level_2 -> Level_1 -> Level_2 -> Level_1 -> Level_0
-
- begin
-
- while Next_Item /= null loop -- here we go!
- -- these calls better dispatch according to the value in the particular
- -- list item; causing the call to create to dispatch accordingly.
- -- why do it twice? To make sure order makes no difference
-
- C392011_0.Check(Next_Item.Data.all, C392011_0.Create);
- -- Create will touch first, then Check touches
-
- C392011_0.Check(C392011_0.Create, Next_Item.Data.all);
-
- -- Here's what's s'pos'd to 'appen:
- -- Check( Lev_2, Create ) >> ACEF
- -- Check( Create, Lev_2 ) >> ACEF
- -- Check( Lev_1, Create ) >> ACD
- -- Check( Create, Lev_1 ) >> ACD
- -- Check( Lev_2, Create ) >> ACEF
- -- Check( Create, Lev_2 ) >> ACEF
- -- Check( Lev_1, Create ) >> ACD
- -- Check( Create, Lev_1 ) >> ACD
- -- Check( Lev_0, Create ) >> AB
- -- Check( Create, Lev_0 ) >> AB
-
- Next_Item := Next_Item.Next;
- end loop;
- end Traverse_List;
-
-end C392011_2.C392011_3;
-
-------------------------------------------------------------------- C392011
-
-with Report;
-with TCTouch;
-with C392011_2.C392011_3;
-
-procedure C392011 is
-
-begin -- Main test procedure.
-
- Report.Test ("C392011", "Check that if a function call with a " &
- "controlling result is itself a controlling " &
- "operand of an enclosing call on a dispatching " &
- "operation, then its controlling tag value is " &
- "determined by the controlling tag value of " &
- "the enclosing call" );
-
- C392011_2.C392011_3.Build_List;
- TCTouch.Validate( "A" & "AC" & "ACE" & "AC" & "ACE", "Build List" );
-
- C392011_2.C392011_3.Traverse_List;
- TCTouch.Validate( "ACEFACEF" &
- "ACDACD" &
- "ACEFACEF" &
- "ACDACD" &
- "ABAB",
- "Traverse List" );
-
- Report.Result;
-
-end C392011;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392013.a b/gcc/testsuite/ada/acats/tests/c3/c392013.a
deleted file mode 100644
index 3873d9e62d5..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392013.a
+++ /dev/null
@@ -1,179 +0,0 @@
--- C392013.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the "/=" implicitly declared with the declaration of "=" for
--- a tagged type is legal and can be used in a dispatching call.
--- (Defect Report 8652/0010, as reflected in Technical Corrigendum 1).
---
--- CHANGE HISTORY:
--- 23 JAN 2001 PHL Initial version.
--- 16 MAR 2001 RLB Readied for release; added identity and negative
--- result cases.
--- 24 MAY 2001 RLB Corrected the result for the 9 vs. 9 case.
---!
-with Report;
-use Report;
-procedure C392013 is
-
- package P1 is
- type T is tagged
- record
- C1 : Integer;
- end record;
- function "=" (L, R : T) return Boolean;
- end P1;
-
- package P2 is
- type T is new P1.T with private;
- function Make (Ancestor : P1.T; X : Float) return T;
- private
- type T is new P1.T with
- record
- C2 : Float;
- end record;
- function "=" (L, R : T) return Boolean;
- end P2;
-
- package P3 is
- type T is new P2.T with
- record
- C3 : Character;
- end record;
- private
- function "=" (L, R : T) return Boolean;
- function Make (Ancestor : P1.T; X : Float) return T;
- end P3;
-
-
- package body P1 is separate;
- package body P2 is separate;
- package body P3 is separate;
-
-
- type Cwat is access P1.T'Class;
- type Cwat_Array is array (Positive range <>) of Cwat;
-
- A : constant Cwat_Array :=
- (1 => new P1.T'(C1 => Ident_Int (3)),
- 2 => new P2.T'(P2.Make (Ancestor => (C1 => Ident_Int (5)), X => 4.0)),
- 3 => new P2.T'(P2.Make (Ancestor => (C1 => Ident_Int (-5)), X => 4.2)),
- 4 => new P1.T'(C1 => Ident_Int (-3)),
- 5 => new P2.T'(P2.Make (Ancestor => (C1 => Ident_Int (5)), X => 3.6)),
- 6 => new P1.T'(C1 => Ident_Int (4)),
- 7 => new P3.T'(P2.Make
- (Ancestor => (C1 => Ident_Int (4)), X => 1.2) with
- Ident_Char ('a')),
- 8 => new P3.T'(P2.Make
- (Ancestor => (C1 => Ident_Int (-4)), X => 1.3) with
- Ident_Char ('A')),
- 9 => new P3.T'(P2.Make
- (Ancestor => (C1 => Ident_Int (4)), X => 1.0) with
- Ident_Char ('B')));
-
- type Truth is ('F', 'T');
- type Truth_Table is array (Positive range <>, Positive range <>) of Truth;
-
- Equality : constant Truth_Table (A'Range, A'Range) := ("TFFTFFFFF",
- "FTTFTFFFF",
- "FTTFFFFFF",
- "TFFTFFFFF",
- "FTFFTFFFF",
- "FFFFFTFFF",
- "FFFFFFTTF",
- "FFFFFFTTF",
- "FFFFFFFFT");
-
-begin
- Test ("C392013", "Check that the ""/="" implicitly declared " &
- "with the declaration of ""="" for a tagged " &
- "type is legal and can be used in a dispatching call");
-
- for I in A'Range loop
- for J in A'Range loop
- -- Test identity:
- if P1."=" (A (I).all, A (J).all) /=
- (not P1."/=" (A (I).all, A (J).all)) then
- Failed ("Incorrect identity comparing objects" &
- Positive'Image (I) & " and" & Positive'Image (J));
- end if;
- -- Test the result of "/=":
- if Equality (I, J) = 'T' then
- if P1."/=" (A (I).all, A (J).all) then
- Failed ("Incorrect result comparing objects" &
- Positive'Image (I) & " and" & Positive'Image (J) & " - T");
- end if;
- else
- if not P1."/=" (A (I).all, A (J).all) then
- Failed ("Incorrect result comparing objects" &
- Positive'Image (I) & " and" & Positive'Image (J) & " - F");
- end if;
- end if;
- end loop;
- end loop;
-
- Result;
-end C392013;
-separate (C392013)
-package body P1 is
-
- function "=" (L, R : T) return Boolean is
- begin
- return abs L.C1 = abs R.C1;
- end "=";
-
-end P1;
-separate (C392013)
-package body P2 is
-
- function "=" (L, R : T) return Boolean is
- begin
- return P1."=" (P1.T (L), P1.T (R)) and then abs (L.C2 - R.C2) <= 0.5;
- end "=";
-
-
- function Make (Ancestor : P1.T; X : Float) return T is
- begin
- return (Ancestor with X);
- end Make;
-
-end P2;
-with Ada.Characters.Handling;
-separate (C392013)
-package body P3 is
-
- function "=" (L, R : T) return Boolean is
- begin
- return P2."=" (P2.T (L), P2.T (R)) and then
- Ada.Characters.Handling.To_Upper (L.C3) =
- Ada.Characters.Handling.To_Upper (R.C3);
- end "=";
-
- function Make (Ancestor : P1.T; X : Float) return T is
- begin
- return (P2.Make (Ancestor, X) with ' ');
- end Make;
-
-end P3;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392014.a b/gcc/testsuite/ada/acats/tests/c3/c392014.a
deleted file mode 100644
index 89d403eaad3..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392014.a
+++ /dev/null
@@ -1,225 +0,0 @@
--- C392014.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that objects designated by X'Access (where X is of a class-wide
--- type) and new T'Class'(...) are dynamically tagged and can be used in
--- dispatching calls. (Defect Report 8652/0010).
---
--- CHANGE HISTORY:
--- 18 JAN 2001 PHL Initial version
--- 15 MAR 2001 RLB Readied for release.
-
---!
-package C392014_0 is
-
- type T (D : Integer) is abstract tagged private;
-
- procedure P (X : access T) is abstract;
- function Create (X : Integer) return T'Class;
-
- Result : Natural := 0;
-
-private
- type T (D : Integer) is abstract tagged null record;
-end C392014_0;
-
-with C392014_0;
-package C392014_1 is
- type T is new C392014_0.T with private;
- function Create (X : Integer) return T'Class;
-private
- type T is new C392014_0.T with
- record
- C1 : Integer;
- end record;
- procedure P (X : access T);
-end C392014_1;
-
-package C392014_1.Child is
- type T is new C392014_1.T with private;
- procedure P (X : access T);
- function Create (X : Integer) return T'Class;
-private
- type T is new C392014_1.T with
- record
- C1C : Integer;
- end record;
-end C392014_1.Child;
-
-with Report;
-use Report;
-with C392014_1.Child;
-package body C392014_1 is
-
- procedure P (X : access T) is
- begin
- C392014_0.Result := C392014_0.Result + X.D + X.C1;
- end P;
-
- function Create (X : Integer) return T'Class is
- begin
- case X mod Ident_Int (2) is
- when 0 =>
- return C392014_1.Child.Create (X / Ident_Int (2));
- when 1 =>
- declare
- Y : T (D => (X / Ident_Int (2)) mod Ident_Int (20));
- begin
- Y.C1 := X / Ident_Int (40);
- return T'Class (Y);
- end;
- when others =>
- null;
- end case;
- end Create;
-
-end C392014_1;
-
-with C392014_0;
-with C392014_1;
-package C392014_2 is
- type T is new C392014_0.T with private;
- function Create (X : Integer) return T'Class;
-private
- type T is new C392014_1.T with
- record
- C2 : Integer;
- end record;
- procedure P (X : access T);
-end C392014_2;
-
-with Report;
-use Report;
-with C392014_1.Child;
-with C392014_2;
-package body C392014_0 is
-
- function Create (X : Integer) return T'Class is
- begin
- case X mod 3 is
- when 0 =>
- return C392014_1.Create (X / Ident_Int (3));
- when 1 =>
- return C392014_1.Child.Create (X / Ident_Int (3));
- when 2 =>
- return C392014_2.Create (X / Ident_Int (3));
- when others =>
- null;
- end case;
- end Create;
-
-end C392014_0;
-
-with Report;
-use Report;
-with C392014_0;
-package body C392014_1.Child is
-
- procedure P (X : access T) is
- begin
- C392014_0.Result := C392014_0.Result + X.D + X.C1 + X.C1C;
- end P;
-
- function Create (X : Integer) return T'Class is
- Y : T (D => X mod Ident_Int (20));
- begin
- Y.C1 := (X / Ident_Int (20)) mod Ident_Int (20);
- Y.C1C := X / Ident_Int (400);
- return T'Class (Y);
- end Create;
-
-end C392014_1.Child;
-
-with Report;
-use Report;
-package body C392014_2 is
-
- procedure P (X : access T) is
- begin
- C392014_0.Result := C392014_0.Result + X.D + X.C2;
- end P;
-
- function Create (X : Integer) return T'Class is
- Y : T (D => X mod Ident_Int (20));
- begin
- Y.C2 := X / Ident_Int (600);
- return T'Class (Y);
- end Create;
-
-end C392014_2;
-
-with Report;
-use Report;
-with C392014_0;
-with C392014_1.Child;
-with C392014_2;
-procedure C392014 is
-
- subtype S0 is C392014_0.T'Class (D => Ident_Int (17));
- subtype S1 is C392014_1.T'Class;
-
- X0 : aliased C392014_0.T'Class := C392014_0.Create (Ident_Int (5218));
- X1 : aliased C392014_1.T'Class := C392014_1.Create (Ident_Int (8253));
-
- Y0 : aliased S0 := C392014_0.Create (Ident_Int (2693));
- Y1 : aliased S1 := C392014_1.Create (Ident_Int (5622));
-
- procedure TC_Check (Subtest : String; Expected : Integer) is
- begin
- if C392014_0.Result = Expected then
- Comment ("Subtest " & Subtest & " Passed");
- else
- Failed ("Subtest " & Subtest & " Failed");
- end if;
- C392014_0.Result := Ident_Int (0);
- end TC_Check;
-
-begin
- Test ("C392014",
- "Check that objects designated by X'Access " &
- "(where X is of a class-wide type) and New T'Class'(...) " &
- "are dynamically tagged and can be used in dispatching " &
- "calls");
-
- C392014_0.P (X0'Access);
- TC_Check ("X0'Access", Ident_Int (29));
- C392014_0.P (new C392014_0.T'Class'(C392014_0.Create (Ident_Int (12850))));
- TC_Check ("New C392014_0.T'Class", Ident_Int (27));
- C392014_1.P (X1'Access);
- TC_Check ("X1'Access", Ident_Int (212));
- C392014_1.P (new C392014_1.T'Class'(C392014_1.Create (Ident_Int (2031))));
- TC_Check ("New C392014_1.T'Class", Ident_Int (65));
- C392014_0.P (Y0'Access);
- TC_Check ("Y0'Access", Ident_Int (18));
- C392014_0.P (new S0'(C392014_0.Create (Ident_Int (6893))));
- TC_Check ("New S0", Ident_Int (20));
- C392014_1.P (Y1'Access);
- TC_Check ("Y1'Access", Ident_Int (18));
- C392014_1.P (new S1'(C392014_1.Create (Ident_Int (1861))));
- TC_Check ("New S1", Ident_Int (56));
-
- Result;
-end C392014;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392a01.a b/gcc/testsuite/ada/acats/tests/c3/c392a01.a
deleted file mode 100644
index 8ad78914231..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392a01.a
+++ /dev/null
@@ -1,265 +0,0 @@
--- C392A01.A
- --
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
- --
- -- OBJECTIVE:
- -- Check that the use of a class-wide formal parameter allows for the
- -- proper dispatching of objects to the appropriate implementation of
- -- a primitive operation. Check this for the root tagged type defined
- -- in a package, and the extended type is defined in that same package.
- --
- -- TEST DESCRIPTION:
- -- Declare a root tagged type, and some associated primitive operations.
- -- Extend the root type, and override one or more primitive operations,
- -- inheriting the other primitive operations from the root type.
- -- Derive from the extended type, again overriding some primitive
- -- operations and inheriting others (including some that the parent
- -- inherited).
- -- Define a subprogram with a class-wide parameter, inside of which is a
- -- call on a dispatching primitive operation. These primitive operations
- -- modify global variables (the class-wide parameter has mode IN).
- --
- --
- --
- -- The following hierarchy of tagged types and primitive operations is
- -- utilized in this test:
- --
- -- type Bank_Account (root)
- -- |
- -- | Operations
- -- | Increment_Bank_Reserve
- -- | Assign_Representative
- -- | Increment_Counters
- -- | Open
- -- |
- -- type Savings_Account (extended from Bank_Account)
- -- |
- -- | Operations
- -- | (Increment_Bank_Reserve) (inherited)
- -- | Assign_Representative (overridden)
- -- | Increment_Counters (overridden)
- -- | Open (overridden)
- -- |
- -- type Preferred_Account (extended from Savings_Account)
- -- |
- -- | Operations
- -- | (Increment_Bank_Reserve) (inherited twice - Bank_Acct.)
- -- | (Assign_Representative) (inherited - Savings_Acct.)
- -- | Increment_Counters (overridden)
- -- | Open (overridden)
- --
- --
- -- In this test, we are concerned with the following selection of dispatching
- -- calls, accomplished with the use of a Bank_Account'Class IN procedure
- -- parameter :
- --
- -- \ Type
- -- Prim. Op \ Bank_Account Savings_Account Preferred_Account
- -- \------------------------------------------------
- -- Increment_Bank_Reserve| X X X
- -- Assign_Representative | X
- -- Increment_Counters | X X X
- --
- --
- --
- -- The location of the declaration and derivation of the root and extended
- -- types will be varied over a series of tests. Locations of declaration
- -- and derivation for a particular test are marked with an asterisk (*).
- --
- -- Root type:
- --
- -- * Declared in package.
- -- Declared in generic package.
- --
- -- Extended types:
- --
- -- * Derived in parent location.
- -- Derived in a nested package.
- -- Derived in a nested subprogram.
- -- Derived in a nested generic package.
- -- Derived in a separate package.
- -- Derived in a separate visible child package.
- -- Derived in a separate private child package.
- --
- -- Primitive Operations:
- --
- -- * Procedures with same parameter profile.
- -- Procedures with different parameter profile.
- -- Functions with same parameter profile.
- -- Functions with different parameter profile.
- -- Mixture of Procedures and Functions.
- --
- --
- -- TEST FILES:
- -- This test depends on the following foundation code:
- --
- -- F392A00.A
- --
- -- The following files comprise this test:
- --
- -- => C392A01.A
- --
- --
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
- --!
-
- with F392A00; -- package Accounts
- with Report;
-
- procedure C392A01 is
-
- package Accounts renames F392A00;
-
- -- Declare account objects.
-
- B_Account : Accounts.Bank_Account;
- S_Account : Accounts.Savings_Account;
- P_Account : Accounts.Preferred_Account;
-
- -- Procedures to operate on accounts.
- -- Each uses a class-wide IN parameter, as well as a call to a
- -- dispatching operation.
-
- -- Procedure Tabulate_Account performs a dispatching call on a primitive
- -- operation that has been overridden for each of the extended types.
-
- procedure Tabulate_Account (Acct : in Accounts.Bank_Account'Class) is
- begin
- Accounts.Increment_Counters (Acct); -- Dispatch according to tag.
- end Tabulate_Account;
-
-
- -- Procedure Accumulate_Reserve performs a dispatching call on a
- -- primitive operation that has been defined for the root type and
- -- inherited by each derived type.
-
- procedure Accumulate_Reserve (Acct : in Accounts.Bank_Account'Class) is
- begin
- Accounts.Increment_Bank_Reserve (Acct); -- Dispatch according to tag.
- end Accumulate_Reserve;
-
-
- -- Procedure Resolve_Dispute performs a dispatching call on a primitive
- -- operation that has been defined in the root type, overridden in the
- -- first derived extended type, and inherited by the subsequent extended
- -- type.
-
- procedure Resolve_Dispute (Acct : in Accounts.Bank_Account'Class) is
- begin
- Accounts.Assign_Representative (Acct); -- Dispatch according to tag.
- end Resolve_Dispute;
-
-
-
- begin -- Main test procedure.
-
- Report.Test ("C392A01", "Check that the use of a class-wide parameter " &
- "allows for proper dispatching where root type " &
- "and extended types are declared in the same " &
- "package" );
-
- Bank_Account_Subtest:
- declare
- use Accounts;
- begin
- Accounts.Open (B_Account);
-
- -- Demonstrate class-wide parameter allowing dispatch by a primitive
- -- operation that has been defined for this specific type.
- Accumulate_Reserve (Acct => B_Account);
- Tabulate_Account (B_Account);
-
- if (Accounts.Bank_Reserve /= Accounts.Opening_Balance) or
- (Accounts.Number_Of_Accounts (Bank) /= 1) or
- (Accounts.Number_Of_Accounts (Total) /= 1)
- then
- Report.Failed ("Failed in Bank_Account_Subtest");
- end if;
-
- end Bank_Account_Subtest;
-
-
- Savings_Account_Subtest:
- declare
- use Accounts;
- begin
- Accounts.Open (Acct => S_Account);
-
- -- Demonstrate class-wide parameter allowing dispatch by a primitive
- -- operation that has been inherited by this extended type.
- Accumulate_Reserve (Acct => S_Account);
-
- -- Demonstrate class-wide parameter allowing dispatch by a primitive
- -- operation that has been overridden for this extended type.
- Resolve_Dispute (Acct => S_Account);
- Tabulate_Account (S_Account);
-
- if Accounts.Bank_Reserve /= (3.0 * Accounts.Opening_Balance) or
- Accounts.Daily_Representative /= Accounts.Manager or
- Accounts.Number_Of_Accounts (Savings) /= 1 or
- Accounts.Number_Of_Accounts (Total) /= 2
- then
- Report.Failed ("Failed in Savings_Account_Subtest");
- end if;
-
- end Savings_Account_Subtest;
-
-
- Preferred_Account_Subtest:
- declare
- use Accounts;
- begin
- Accounts.Open (P_Account);
-
- -- Verify that the correct implementation of Open (overridden) was
- -- used for the Preferred_Account object.
- if not Accounts.Verify_Open (P_Account) then
- Report.Failed ("Incorrect values for init. Preferred Acct object");
- end if;
-
- -- Demonstrate class-wide parameter allowing dispatch by a primitive
- -- operation that has been twice inherited by this extended type.
- Accumulate_Reserve (Acct => P_Account);
-
- -- Demonstrate class-wide parameter allowing dispatch by a primitive
- -- operation that has been overridden for this extended type (the
- -- operation was overridden by its parent type as well).
- Tabulate_Account (P_Account);
-
- if Accounts.Bank_Reserve /= 1300.00 or
- Accounts.Number_Of_Accounts (Preferred) /= 1 or
- Accounts.Number_Of_Accounts (Total) /= 3
- then
- Report.Failed ("Failed in Preferred_Account_Subtest");
- end if;
-
- end Preferred_Account_Subtest;
-
-
- Report.Result;
-
- end C392A01;
-
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392c05.a b/gcc/testsuite/ada/acats/tests/c3/c392c05.a
deleted file mode 100644
index 6bd3cece77e..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392c05.a
+++ /dev/null
@@ -1,164 +0,0 @@
--- C392C05.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that for a call to a dispatching subprogram the subprogram
--- body which is executed is determined by the controlling tag for
--- the case where the call has statically tagged controlling operands
--- of the type T. Check this for various operands of tagged types:
--- objects (declared or allocated), formal parameters, view conversions,
--- function calls (both primitive and non-primitive).
---
--- TEST DESCRIPTION:
--- This test uses foundation F392C00 to test the usages of statically
--- tagged objects and values. The calls to Validate indicate the
--- expected sequence of procedure calls since the previous call to
--- Validate. Static tags can be determined at compile time, and
--- hence this is a test of correct overload resolution for tagged types.
--- A clever compiler which unrolls loops and does path analysis on
--- access values will be able to perform the same kind of determination
--- for all of the code in this test.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F392C00.A (foundation code)
--- C392C05.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Removed RM references from objective text.
--- 24 Oct 95 SAIC Updated for ACVC 2.0.1
--- 13 Feb 97 PWB.CTA Corrected assumption that "or" operands are
--- evaluated in textual order.
---!
-
-with Report;
-with TCTouch;
-with F392C00_1;
-procedure C392C05 is -- Hardware_Store
-
- package Switch renames F392C00_1;
-
- subtype Switch_Class is Switch.Toggle'Class;
-
- type Reference is access all Switch_Class;
-
- A_Switch : aliased Switch.Toggle;
- A_Dimmer : aliased Switch.Dimmer;
- An_Autodim : aliased Switch.Auto_Dimmer;
-
- type Light_Bank is array(Positive range <>) of Reference;
-
- Lamps : Light_Bank(1..3);
-
-begin -- Main test procedure.
-
- Report.Test ("C392C05", "Check that a dispatching subprogram call is "
- & "determined by the controlling tag for statically "
- & "tagged controlling operands" );
-
--- Check use of static tagged declared objects,
--- and static tagged formal parameters
--- Must call correct version of flip based on type of controlling op.
-
--- Turn on the lights!
-
- Switch.Flip( A_Switch );
- TCTouch.Validate( "A", "Declared Toggle" );
-
- Switch.Flip( A_Dimmer );
- TCTouch.Validate( "GBA", "Declared Dimmer" );
-
- Switch.Flip( An_Autodim );
- TCTouch.Validate( "KGBA", "Declared Auto_Dimmer" );
-
- Lamps(1) := new Switch.Toggle;
- Lamps(2) := new Switch.Dimmer;
- Lamps(3) := new Switch.Auto_Dimmer;
-
--- Check use of static tagged allocated objects,
--- and static tagged formal parameters in a loop which may dynamically
--- dispatch. If an optimizer unrolls the loop, it may then be statically
--- determined, and no dispatching will occur. Either interpretation is
--- correct.
- for Knob in Lamps'Range loop
- Switch.Flip( Lamps(Knob).all );
- end loop;
- TCTouch.Validate( "AGBAKGBA", "Allocated Objects" );
-
--- Check use of static tagged declared objects,
--- calling non-primitive functions.
- if not Switch.TC_Non_Disp( A_Switch ) then
- Report.Failed( "Bad Value 1" );
- end if;
- TCTouch.Validate( "X", "Nonprimitive Function" );
-
- if not Switch.TC_Non_Disp( A_Dimmer ) then
- Report.Failed( "Bad Value 2" );
- end if;
- TCTouch.Validate( "Y", "Nonprimitive Function" );
-
- if not Switch.TC_Non_Disp( An_Autodim ) then
- Report.Failed( "Bad Value 3" );
- end if;
- TCTouch.Validate( "Z", "Nonprimitive Function" );
-
- A_Switch := Switch.Create;
- A_Dimmer := Switch.Create;
- An_Autodim := Switch.Create;
- TCTouch.Validate( "123", "Primitive Function" );
-
--- View conversions
- Switch.Brighten( An_Autodim, 50 );
-
- Switch.Flip( Switch.Toggle( A_Switch ) );
- Switch.Flip( Switch.Toggle( A_Dimmer ) );
- Switch.Flip( Switch.Dimmer( An_Autodim ) );
- TCTouch.Validate( "DAAGBA", "View Conversions" );
-
--- statically tagged controlling operands (specific types) provided to
--- class-wide functions
- if Switch.On( A_Switch )
- or Switch.On( A_Dimmer )
- or Switch.On( An_Autodim ) then
- Report.Failed( "Bad Value 4" );
- end if;
- TCTouch.Validate( "BBB", "Class-wide" );
-
--- statically tagged controlling operands qualified expressions provided to
--- primitive functions, also using context to determine call to a
--- class-wide function.
- if Switch.Off( Switch.Toggle'( Switch.Create ) )
- or else Switch.Off( Switch.Dimmer'( Switch.Create ) )
- or else Switch.Off( Switch.Auto_Dimmer'( Switch.Create ) ) then
- Report.Failed( "Bad Value 5" );
- end if;
- TCTouch.Validate( "1C2C3C", "Qualified Expression/Class-Wide" );
-
- Report.Result;
-
-end C392C05;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392c07.a b/gcc/testsuite/ada/acats/tests/c3/c392c07.a
deleted file mode 100644
index f13cc0b01a0..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392c07.a
+++ /dev/null
@@ -1,190 +0,0 @@
--- C392C07.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that for a call to a dispatching subprogram the subprogram
--- body which is executed is determined by the controlling tag for
--- the case where the call has dynamic tagged controlling operands
--- of the type T. Check for calls to these same subprograms where
--- the operands are of specific statically tagged types:
--- objects (declared or allocated), formal parameters, view
--- conversions, and function calls (both primitive and non-primitive).
---
--- TEST DESCRIPTION:
--- This test uses foundation F392C00 to test the usages of statically
--- tagged objects and values. This test is derived in part from
--- C392C05.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 24 Oct 95 SAIC Updated for ACVC 2.0.1
---
---!
-
-with Report;
-with TCTouch;
-with F392C00_1;
-procedure C392C07 is -- Hardware_Store
- package Switch renames F392C00_1;
-
- subtype Switch_Class is Switch.Toggle'Class;
-
- type Reference is access all Switch_Class;
-
- A_Switch : aliased Switch.Toggle;
- A_Dimmer : aliased Switch.Dimmer;
- An_Autodim : aliased Switch.Auto_Dimmer;
-
- type Light_Bank is array(Positive range <>) of Reference;
-
- Lamps : Light_Bank(1..3);
-
--- dynamically tagged controlling operands : class wide formal parameters
- procedure Clamp( Device : in out Switch_Class; On : Boolean := False ) is
- begin
- if Switch.On( Device ) /= On then
- Switch.Flip( Device );
- end if;
- end Clamp;
- function Class_Item(Bank_Pos: Positive) return Switch_Class is
- begin
- return Lamps(Bank_Pos).all;
- end Class_Item;
-
-begin -- Main test procedure.
- Report.Test ("C392C07", "Check that a dispatching subprogram call is "
- & "determined by the controlling tag for "
- & "dynamically tagged controlling operands" );
-
- Lamps := ( A_Switch'Access, A_Dimmer'Access, An_Autodim'Access );
-
--- dynamically tagged operands referring to
--- statically tagged declared objects
- for Knob in Lamps'Range loop
- Clamp( Lamps(Knob).all, On => True );
- end loop;
- TCTouch.Validate( "BABGBABKGBA", "Clamping On Lamps" );
-
- Lamps(1) := new Switch.Toggle;
- Lamps(2) := new Switch.Dimmer;
- Lamps(3) := new Switch.Auto_Dimmer;
-
--- turn the full bank of switches ON
--- dynamically tagged allocated objects
- for Knob in Lamps'Range loop
- Clamp( Lamps(Knob).all, On => True );
- end loop;
- TCTouch.Validate( "BABGBABKGBA", "Dynamic Allocated");
-
--- Double check execution correctness
- if Switch.Off( Lamps(1).all )
- or Switch.Off( Lamps(2).all )
- or Switch.Off( Lamps(3).all ) then
- Report.Failed( "Bad Value" );
- end if;
- TCTouch.Validate( "CCC", "Class-wide");
-
--- turn the full bank of switches OFF
- for Knob in Lamps'Range loop
- Switch.Flip( Lamps(Knob).all );
- end loop;
- TCTouch.Validate( "AGBAKGBA", "Dynamic Allocated, Primitive Ops");
-
--- check switches for OFF
--- a few function calls as operands
- for Knob in Lamps'Range loop
- if not Switch.Off( Class_Item(Knob) ) then
- Report.Failed("At function tests, Switch not OFF");
- end if;
- end loop;
- TCTouch.Validate( "CCC",
- "Using function returning class-wide type");
-
--- Switches are all OFF now.
--- dynamically tagged view conversion
- Clamp( Switch_Class( A_Switch ) );
- Clamp( Switch_Class( A_Dimmer ) );
- Clamp( Switch_Class( An_Autodim ) );
- TCTouch.Validate( "BABGBABKGBA", "View Conversions" );
-
--- dynamically tagged controlling operands : declared class wide objects
--- calling primitive functions
- declare
- Dine_O_Might : Switch_Class := Switch.TC_CW_TI( 't' );
- begin
- Switch.Flip( Dine_O_Might );
- if Switch.On( Dine_O_Might ) then
- Report.Failed( "Exploded at Dine_O_Might" );
- end if;
- TCTouch.Validate( "WAB", "Dispatching function 1" );
- end;
-
- declare
- Dyne_A_Mite : Switch_Class := Switch.TC_CW_TI( 'd' );
- begin
- Switch.Flip( Dyne_A_Mite );
- if Switch.On( Dyne_A_Mite ) then
- Report.Failed( "Exploded at Dyne_A_Mite" );
- end if;
- TCTouch.Validate( "WGBAB", "Dispatching function 2" );
- end;
-
- declare
- Din_Um_Out : Switch_Class := Switch.TC_CW_TI( 'a' );
- begin
- Switch.Flip( Din_Um_Out );
- if Switch.Off( Din_Um_Out ) then
- Report.Failed( "Exploded at Din_Um_Out" );
- end if;
- TCTouch.Validate( "WKCC", "Dispatching function 3" );
-
--- Non-dispatching function calls.
- if not Switch.TC_Non_Disp( Switch.Toggle( Din_Um_Out ) ) then
- Report.Failed( "Non primitive, via view conversion" );
- end if;
- TCTouch.Validate( "X", "View Conversion 1" );
-
- if not Switch.TC_Non_Disp( Switch.Dimmer( Din_Um_Out ) ) then
- Report.Failed( "Non primitive, via view conversion" );
- end if;
- TCTouch.Validate( "Y", "View Conversion 2" );
- end;
-
- -- a few more function calls as operands (oops)
- if not Switch.On( Switch.Toggle'( Switch.Create ) ) then
- Report.Failed("Toggle did not create ""On""");
- end if;
-
- if Switch.Off( Switch.Dimmer'( Switch.Create ) ) then
- Report.Failed("Dimmer created ""Off""");
- end if;
-
- if Switch.Off( Switch.Auto_Dimmer'( Switch.Create ) ) then
- Report.Failed("Auto_Dimmer created ""Off""");
- end if;
-
- Report.Result;
-end C392C07;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392d01.a b/gcc/testsuite/ada/acats/tests/c3/c392d01.a
deleted file mode 100644
index bb6e192028c..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392d01.a
+++ /dev/null
@@ -1,324 +0,0 @@
--- C392D01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for an implicitly declared dispatching operation that is
--- overridden, the body executed is the body for the overriding
--- subprogram, even if the overriding occurs in a private part.
--- Check that, for an implicitly declared dispatching operation that is
--- NOT overridden, the body executed is the body of the corresponding
--- subprogram of the parent type.
---
--- Check for the case where the overriding (and non-overriding) operations
--- are declared for a private extension (and its full type) in a public
--- child unit of the package declaring the ancestor type, and the ancestor
--- type is a tagged private type whose full view is itself a derived type.
---
--- TEST DESCRIPTION:
--- Consider:
---
--- package Parent is
--- type Root is tagged ...
--- procedure Vis_Op (P: Root);
--- private
--- procedure Pri_Op (P: Root); -- (A)
--- end Parent;
---
--- package Intermediate is
--- type Mid is tagged private;
--- private
--- type Mid is new Parent.Root with record ...
--- -- Implicit Vis_Op (P: Mid) declared here.
---
--- procedure Vis_Op (P: Mid); -- (B)
--- end Intermediate;
---
--- package Intermediate.Child is
--- type Derived is new Mid with private;
---
--- procedure Pri_Op (P: Derived); -- (C)
--- ...
---
--- private
--- type Derived is new Mid with record...
--- -- Implicit Vis_Op (P: Derived) declared here.
--- ...
--- end Intermediate.Child;
---
--- Type Derived inherits Vis_Op from the parent type Mid. Note, however,
--- that it is implicitly declared in the private part (inherited
--- subprograms for a derived_type_definition -- in this case, the full
--- type -- are implicitly declared at the earliest place within the
--- immediate scope of the type_declaration where the corresponding
--- declaration from the parent is visible).
---
--- Because Parent.Pri_Op is never visible within the immediate scope
--- of Mid, it is not implicitly declared for Mid. Thus, it is also not
--- implicitly declared for Derived. As a result, the version of Pri_Op
--- declared at (C) above does not override an inherited version of
--- Parent.Pri_Op and is totally unrelated to it.
---
--- Dispatching calls with tag Mid will execute (A) and (B). Dispatching
--- calls with tag Derived from Parent will execute the bodies of (B)
--- and (A). Dispatching calls with tag Derived from Parent.Child
--- will execute the bodies of (B) and (C).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F392D00.A
--- C392D01.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with F392D00;
-package C392D01_0 is
-
- type Zoom_Camera is tagged private;
-
- procedure Self_Test (C : in out Zoom_Camera'Class);
-
- -- ...Additional operations.
-
-
- function TC_Correct_Result (C : Zoom_Camera;
- D : F392D00.Depth_Of_Field;
- S : F392D00.Shutter_Speed) return Boolean;
-
-private
-
- type Magnification is (Low, Medium, High);
-
- type Zoom_Camera is new F392D00.Remote_Camera with record
- Mag : Magnification;
- end record;
-
- -- procedure Focus (C : in out Zoom_Camera; -- Implicitly
- -- Depth : in Depth_Of_Field) -- declared
- -- here.
-
- procedure Focus (C : in out Zoom_Camera; -- Overrides
- Depth : in F392D00.Depth_Of_Field); -- inherited op.
-
- -- For the remote zoom camera, perhaps the focusing algorithm is different
- -- in some way, so the original Focus operation is overridden here.
-
- -- Since the partial view is not an extension, the overriding operation
- -- must be declared after the full type. This version of Focus, although
- -- not visible for type Zoom_Camera from outside the package, can still be
- -- dispatched to.
-
-
- -- Note: F392D00.Set_Shutter_Speed is inherited by Zoom_Camera from
- -- F392D00.Remote_Camera, but since the operation never becomes visible
- -- within the immediate scope of Zoom_Camera, it is never implicitly
- -- declared.
-
-end C392D01_0;
-
-
- --==================================================================--
-
-
-package body C392D01_0 is
-
- procedure Focus (C : in out Zoom_Camera;
- Depth : in F392D00.Depth_Of_Field) is
- begin
- -- Artificial for testing purposes.
- C.DOF := 83;
- end Focus;
-
- -----------------------------------------------------------
- -- Indirect call to F392D00.Self_Test since the main does not know
- -- that Zoom_Camera is a private extension of F392D00.Basic_Camera.
- procedure Self_Test (C : in out Zoom_Camera'Class) is
- begin
- F392D00.Self_Test (C);
- -- ...Additional self-testing.
- end Self_Test;
-
- -----------------------------------------------------------
- function TC_Correct_Result (C : Zoom_Camera;
- D : F392D00.Depth_Of_Field;
- S : F392D00.Shutter_Speed) return Boolean is
- use type F392D00.Depth_Of_Field;
- use type F392D00.Shutter_Speed;
- begin
- return (C.DOF = D and C.Shutter = S);
- end TC_Correct_Result;
-
-end C392D01_0;
-
-
- --==================================================================--
-
-
-with F392D00;
-package C392D01_0.C392D01_1 is
-
- type Film_Speed is private;
-
- type Auto_Speed is new Zoom_Camera with private;
-
- -- Implicit function TC_Correct_Result (Auto_Speed) declared here.
-
- procedure Set_Shutter_Speed (C : in out Auto_Speed;
- Speed : in F392D00.Shutter_Speed);
-
- -- This version of Set_Shutter_Speed does NOT override the operation
- -- inherited from Zoom_Camera, because the inherited operation is never
- -- visible (and thus, is never implicitly declared) within the immediate
- -- scope of type Auto_Speed.
-
- procedure Self_Test (C : in out Auto_Speed'Class);
-
- -- ...Other operations.
-
-private
- type Film_Speed is (One_Hundred, Two_Hundred, Four_Hundred);
-
- type Auto_Speed is new Zoom_Camera with record
- ASA : Film_Speed;
- end record;
-
- -- procedure Focus (C : in out Auto_Speed; -- Implicitly
- -- Depth : in F392D00.Depth_Of_Field); -- declared
- -- here.
-
-end C392D01_0.C392D01_1;
-
-
- --==================================================================--
-
-
-package body C392D01_0.C392D01_1 is
-
- procedure Set_Shutter_Speed (C : in out Auto_Speed;
- Speed : in F392D00.Shutter_Speed) is
- begin
- -- Artificial for testing purposes.
- C.Shutter := F392D00.Two_Fifty;
- end Set_Shutter_Speed;
-
- -------------------------------------------------------
- procedure Self_Test (C : in out Auto_Speed'Class) is
- begin
- -- Artificial for testing purposes.
- Set_Shutter_Speed (C, F392D00.Thousand);
- Focus (C, 27);
- end Self_Test;
-
-end C392D01_0.C392D01_1;
-
-
- --==================================================================--
-
-
-with F392D00;
-with C392D01_0.C392D01_1;
-
-with Report;
-
-procedure C392D01 is
- Zooming_Camera : C392D01_0.Zoom_Camera;
- Auto_Camera1 : C392D01_0.C392D01_1.Auto_Speed;
- Auto_Camera2 : C392D01_0.C392D01_1.Auto_Speed;
-
- TC_Expected_Zoom_Depth : constant F392D00.Depth_Of_Field := 83;
- TC_Expected_Auto_Depth : constant F392D00.Depth_Of_Field := 83;
- TC_Expected_Depth : constant F392D00.Depth_Of_Field := 83;
- TC_Expected_Zoom_Speed : constant F392D00.Shutter_Speed
- := F392D00.Thousand;
- TC_Expected_Auto_Speed : constant F392D00.Shutter_Speed
- := F392D00.Thousand;
- TC_Expected_Speed : constant F392D00.Shutter_Speed
- := F392D00.Two_Fifty;
-
- use type F392D00.Depth_Of_Field;
- use type F392D00.Shutter_Speed;
-
-begin
- Report.Test ("C392D01", "Dispatching for overridden and non-overridden " &
- "primitive subprograms: private extension declared in child " &
- "unit, parent is tagged private whose full view is derived " &
- "type");
-
-
-
--- Call the class-wide operation (Self_Test) for Zoom_Camera'Class, which
--- itself calls the class-wide operation for Remote_Camera'Class, which
--- in turn makes dispatching calls to Focus and Set_Shutter_Speed:
-
-
- -- For an object of type Zoom_Camera, the dispatching call to Focus should
- -- dispatch to the body explicitly declared for Zoom_Camera. The dispatching
- -- to Set_Shutter_Speed should dispatch to the body declared for
- -- Remote_Camera:
-
- C392D01_0.Self_Test(Zooming_Camera);
-
- if not C392D01_0.TC_Correct_Result (Zooming_Camera,
- TC_Expected_Zoom_Depth,
- TC_Expected_Zoom_Speed)
- then
- Report.Failed ("Calls dispatched incorrectly for tagged private type");
- end if;
-
- -- For an object of type Auto_Speed, the dispatching call to Focus should
- -- dispatch to the body explicitly declared for Zoom_Camera. The dispatching
- -- call to Set_Shutter_Speed should dispatch to the body explicitly declared
- -- for Remote_Camera:
-
- C392D01_0.Self_Test(Auto_Camera1);
-
- if not C392D01_0.C392D01_1.TC_Correct_Result (Auto_Camera1,
- TC_Expected_Auto_Depth,
- TC_Expected_Auto_Speed)
- then
- Report.Failed ("Calls dispatched incorrectly for private extension");
- end if;
-
- -- Call to Self_Test from C392D01_0.C392D01_1 invokes the dispatching call
- -- to Focus which should dispatch to the body explicitly declared for
- -- Zoom_Camera. The dispatching call to Set_Shutter_Speed should dispatch
- -- to the body explicitly declared for Auto_Speed:
-
- C392D01_0.C392D01_1.Self_Test(Auto_Camera2);
-
- if not C392D01_0.C392D01_1.TC_Correct_Result (Auto_Camera2,
- TC_Expected_Depth,
- TC_Expected_Speed)
- then
- Report.Failed ("Call to explicit subprogram executed the wrong body");
- end if;
-
- Report.Result;
-
-end C392D01;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392d02.a b/gcc/testsuite/ada/acats/tests/c3/c392d02.a
deleted file mode 100644
index d8e012cbe2d..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392d02.a
+++ /dev/null
@@ -1,185 +0,0 @@
--- C392D02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a primitive procedure declared in a private part is not
--- overridden by a procedure explicitly declared at a place where the
--- primitive procedure in question is not visible.
---
--- Check for the case where the non-overriding operation is declared in a
--- separate (non-child) package from that declaring the parent type, and
--- the descendant type is a record extension.
---
--- TEST DESCRIPTION:
--- Consider:
---
--- package P is
--- type Root is tagged ...
--- private
--- procedure Pri_Op (A: Root);
--- end P;
---
--- with P;
--- package Q is
--- type Derived is new P.Root with record...
--- procedure Pri_Op (A: Derived); -- Does NOT override parent's Op.
--- ...
--- end Q;
---
--- Type Derived inherits Pri_Op from the parent type Root. However,
--- because P.Pri_Op is never visible within the immediate scope of
--- Derived, it is not implicitly declared for Derived. As a result,
--- the explicit Q.Pri_Op does not override P.Pri_Op and is totally
--- unrelated to it.
---
--- Dispatching calls to P.Pri_Op with operands of tag Derived will
--- not dispatch to Q.Pri_Op; the body executed will be that of P.Pri_Op.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F392D00.A
--- C392D02.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with F392D00;
-package C392D02_0 is
-
- type Aperture is (Eight, Sixteen);
-
- type Auto_Speed is new F392D00.Remote_Camera with record
- -- ...
- FStop : Aperture;
- end record;
-
-
- procedure Set_Shutter_Speed (C : in out Auto_Speed;
- Speed : in F392D00.Shutter_Speed);
- -- Does NOT override.
-
- -- This version of Set_Shutter_Speed does NOT override the operation
- -- inherited from the parent, because the inherited operation is never
- -- visible (and thus, is never implicitly declared) within the immediate
- -- scope of type Auto_Speed.
-
- procedure Self_Test (C : in out Auto_Speed'Class);
-
- -- ...Other operations.
-
-end C392D02_0;
-
-
- --==================================================================--
-
-
-package body C392D02_0 is
-
- procedure Set_Shutter_Speed (C : in out Auto_Speed;
- Speed : in F392D00.Shutter_Speed) is
- begin
- -- Artificial for testing purposes.
- C.Shutter := F392D00.Four_Hundred;
- end Set_Shutter_Speed;
-
- ----------------------------------------------------
- procedure Self_Test (C : in out Auto_Speed'Class) is
- begin
- -- Should dispatch to the Set_Shutter_Speed explicitly declared
- -- for Auto_Speed.
- Set_Shutter_Speed (C, F392D00.Two_Fifty);
- end Self_Test;
-
-end C392D02_0;
-
-
- --==================================================================--
-
-
-with F392D00;
-with C392D02_0;
-
-with Report;
-
-procedure C392D02 is
- Basic_Camera : F392D00.Remote_Camera;
- Auto_Camera1 : C392D02_0.Auto_Speed;
- Auto_Camera2 : C392D02_0.Auto_Speed;
-
- TC_Expected_Basic_Speed : constant F392D00.Shutter_Speed
- := F392D00.Thousand;
- TC_Expected_Speed : constant F392D00.Shutter_Speed
- := F392D00.Four_Hundred;
-
- use type F392D00.Shutter_Speed;
-
-begin
- Report.Test ("C392D02", "Dispatching for non-overridden primitive " &
- "subprograms: record extension declared in non-child " &
- "package, parent is tagged record");
-
--- Call the class-wide operation for Remote_Camera'Class, which dispatches
--- to Set_Shutter_Speed:
-
- -- For an object of type Remote_Camera, the dispatching call should
- -- dispatch to the body declared for the root type:
-
- F392D00.Self_Test(Basic_Camera);
-
- if Basic_Camera.Shutter /= TC_Expected_Basic_Speed then
- Report.Failed ("Call dispatched incorrectly for root type");
- end if;
-
-
- -- C392D02_0.Set_Shutter_Speed should never be called by F392D00.Self_Test,
- -- since C392D02_0.Set_Shutter_Speed does not override
- -- F392D00.Set_Shutter_Speed.
-
- -- For an object of type Auto_Speed, the dispatching call should
- -- also dispatch to the body declared for the root type:
-
- F392D00.Self_Test(Auto_Camera1);
-
- if Auto_Camera1.Shutter /= TC_Expected_Basic_Speed then
- Report.Failed ("Call dispatched incorrectly for derived type");
- end if;
-
- -- Call to Self_Test from C392D02_0 invokes the dispatching call to
- -- Set_Shutter_Speed which should dispatch to the body explicitly declared
- -- for Auto_Speed:
-
- C392D02_0.Self_Test(Auto_Camera2);
-
- if Auto_Camera2.Shutter /= TC_Expected_Speed then
- Report.Failed ("Call to explicit subprogram executed the wrong body");
- end if;
-
- Report.Result;
-
-end C392D02;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c392d03.a b/gcc/testsuite/ada/acats/tests/c3/c392d03.a
deleted file mode 100644
index 3a488952e96..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c392d03.a
+++ /dev/null
@@ -1,248 +0,0 @@
--- C392D03.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for an inherited dispatching operation that is overridden,
--- the body executed is the body of the overriding subprogram, even if
--- the overriding occurs in a private part.
---
--- Check for the case where the overriding operation is declared in a
--- separate (non-child) package from that declaring the parent type, and
--- the descendant type is a record extension.
---
--- Check for both dispatching and nondispatching calls.
---
--- TEST DESCRIPTION:
--- Consider:
---
--- package P is
--- type Root is tagged ...
--- procedure Op (A: Root);
--- end P;
---
--- with P;
--- package Q is
--- type Derived1 is new P.Root with record...
--- -- Implicit procedure Op (A: Derived1) declared here.
--- type Derived2 is new P.Root with private...
--- -- Implicit procedure Op (A: Derived2) declared here.
--- type New_Derived is new Derived1 with private...
--- -- Implicit procedure Op (A: New_Derived) declared here.
--- private
--- procedure Op (A: Derived1); -- Overrides parent's Op.
--- type Derived2 is new P.Root with record...
--- procedure Op (A: Derived2); -- Overrides parent's Op.
--- type New_Derived is new Derived1 with record...
--- ...
--- end Q;
---
--- Both type Derived1 and Derived2 inherit Op from the parent type Root.
--- Type New_Derived inherits (inherited) Op from Derived1. The inherited
--- operation is implicitly declared immediately after the type extension.
--- The inherited operation is overridden by an explicit declaration in
--- the private part. Even though the overriding operation is private,
--- calls to Op with an operand of tag Derived1, Derived2, or New_Derived
--- will execute the body of the overriding operation.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F392D00.A
--- C392D03.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with F392D00;
-package C392D03_0 is
-
- type Aperture is (Eight, Sixteen);
-
- type Auto_Focus is new F392D00.Remote_Camera with record
- -- ...
- FStop : Aperture;
- end record;
-
- -- Implicit procedure Focus (C : in out Auto_Focus;
- -- Depth : in Depth_Of_Field) declared here.
-
- type Auto_Flashing is new F392D00.Remote_Camera with private;
-
- -- Implicit procedure Focus (C : in out Auto_Flashing;
- -- Depth : in Depth_Of_Field) declared here.
-
- type Special_Focus is new Auto_Focus with private;
-
- -- Implicit procedure Focus (C : in out Special_Focus;
- -- Depth : in Depth_Of_Field) declared here.
-
- -- ...Other operations.
-
-private
-
- procedure Focus (C : in out Auto_Focus; -- Overrides
- Depth : in F392D00.Depth_Of_Field); -- parent's op.
-
- -- For the improved remote camera, focus is set automatically, so it is
- -- declared as a private operation.
-
- type Auto_Flashing is new F392D00.Remote_Camera with null record;
-
- procedure Focus (C : in out Auto_Flashing; -- Overrides
- Depth : in F392D00.Depth_Of_Field); -- parent's op.
-
- type Special_Focus is new Auto_Focus with null record;
-
-end C392D03_0;
-
-
- --==================================================================--
-
-
-package body C392D03_0 is
-
- procedure Focus (C : in out Auto_Focus;
- Depth : in F392D00.Depth_Of_Field) is
- begin
- -- Artificial for testing purposes.
- C.DOF := 52;
- end Focus;
-
- -----------------------------------------------------------
- procedure Focus (C : in out Auto_Flashing;
- Depth : in F392D00.Depth_Of_Field) is
- begin
- -- Artificial for testing purposes.
- C.DOF := 91;
- end Focus;
-
-end C392D03_0;
-
-
- --==================================================================--
-
-
-with F392D00;
-with C392D03_0;
-
-with Report;
-
-procedure C392D03 is
-
- type Focus_Ptr is access procedure
- (P1 : in out C392D03_0.Auto_Focus;
- P2 : in F392D00.Depth_Of_Field);
-
- Basic_Camera : F392D00.Remote_Camera;
- Auto_Camera1 : C392D03_0.Auto_Focus;
- Auto_Camera2 : C392D03_0.Auto_Focus;
- Flash_Camera1 : C392D03_0.Auto_Flashing;
- Flash_Camera2 : C392D03_0.Auto_Flashing;
- Special_Camera : C392D03_0.Special_Focus;
- Auto_Depth : F392D00.Depth_Of_Field := 78;
-
- TC_Expected_Basic_Depth : constant F392D00.Depth_Of_Field := 46;
- TC_Expected_Auto_Depth : constant F392D00.Depth_Of_Field := 52;
- TC_Expected_Depth : constant F392D00.Depth_Of_Field := 91;
-
- FP : Focus_Ptr := C392D03_0.Focus'Access;
-
- use type F392D00.Depth_Of_Field;
-
-begin
- Report.Test ("C392D03", "Dispatching for overridden primitive " &
- "subprograms: record extension declared in non-child " &
- "package, parent is tagged record");
-
-
--- Call the class-wide operation for Remote_Camera'Class, which itself makes
--- a dispatching call to Focus:
-
- -- For an object of type Remote_Camera, the dispatching call should
- -- dispatch to the body declared for the root type:
-
- F392D00.Self_Test(Basic_Camera);
-
- if Basic_Camera.DOF /= TC_Expected_Basic_Depth then
- Report.Failed ("Call dispatched incorrectly for root type");
- end if;
-
-
- -- For an object of type Auto_Focus, the dispatching call should
- -- dispatch to the body declared for the derived type:
-
- F392D00.Self_Test(Auto_Camera1);
-
- if Auto_Camera1.DOF /= TC_Expected_Auto_Depth then
- Report.Failed ("Call dispatched incorrectly for Auto_Focus type");
- end if;
-
-
- -- For an object of type Auto_Flash, the dispatching call should
- -- also dispatch to the body declared for the derived type:
-
- F392D00.Self_Test(Flash_Camera1);
-
- if Flash_Camera1.DOF /= TC_Expected_Depth then
- Report.Failed ("Call dispatched incorrectly for Auto_Flash type");
- end if;
-
- -- For an object of Auto_Flash type, a non-dispatching call to Focus should
- -- execute the body declared for the derived type (even through it is
- -- declared in the private part).
-
- C392D03_0.Focus (Flash_Camera2, Auto_Depth);
-
- if Flash_Camera2.DOF /= TC_Expected_Depth then
- Report.Failed ("Non-dispatching call to privately overriding " &
- "subprogram executed the wrong body");
- end if;
-
- -- For an object of Auto_Focus type, a non-dispatching call to Focus should
- -- execute the body declared for the derived type (even through it is
- -- declared in the private part).
-
- FP.all (Auto_Camera2, Auto_Depth);
-
- if Auto_Camera2.DOF /= TC_Expected_Auto_Depth then
- Report.Failed ("Non-dispatching call by using access to overriding " &
- "subprogram executed the wrong body");
- end if;
-
- -- For an object of type Special_Camera, the dispatching call should
- -- also dispatch to the body declared for the derived type:
-
- F392D00.Self_Test(Special_Camera);
-
- if Special_Camera.DOF /= TC_Expected_Auto_Depth then
- Report.Failed ("Call dispatched incorrectly for Special_Camera type");
- end if;
-
- Report.Result;
-
-end C392D03;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393001.a b/gcc/testsuite/ada/acats/tests/c3/c393001.a
deleted file mode 100644
index 9d6f85c6392..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393001.a
+++ /dev/null
@@ -1,407 +0,0 @@
--- C393001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an abstract type can be declared, and in turn concrete
--- types can be derived from it. Check that the definition of
--- actual subprograms associated with the derived types dispatch
--- correctly.
---
--- TEST DESCRIPTION:
--- This test declares an abstract type Breaker in a package, and
--- then derives from it. The type Basic_Breaker defines the least
--- possible in order to not be abstract. The type Ground_Fault is
--- defined to inherit as much as possible, whereas type Special_Breaker
--- overrides everything it can. The type Special_Breaker also includes
--- an embedded Basic_Breaker object. The main program then utilizes
--- each of the three types of breaker, and to ascertain that the
--- overloading and tagging resolution are correct, each "Create"
--- procedure is called with a unique value. The diagram below
--- illustrates the relationships. This test is derived from C3A2001.
---
--- Abstract type: Breaker
--- |
--- Basic_Breaker (Short)
--- / \
--- (Sharp) Ground_Fault Special_Breaker (Shock)
---
--- Test structure is an array of class-wide objects, modeling a circuit
--- as a list of components. The test then creates some values, and
--- traverses the list to determine correct operation.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 13 Nov 95 SAIC Revised for 2.0.1
---
---!
-
------------------------------------------------------------------ C393001_1
-
-with Report;
-package C393001_1 is
-
- type Breaker is abstract tagged private;
- type Status is ( Power_Off, Power_On, Tripped, Failed );
-
- procedure Flip ( The_Breaker : in out Breaker ) is abstract;
- procedure Trip ( The_Breaker : in out Breaker ) is abstract;
- procedure Reset( The_Breaker : in out Breaker ) is abstract;
- procedure Fail ( The_Breaker : in out Breaker );
-
- procedure Set ( The_Breaker : in out Breaker'Class; To_State : Status );
-
- function Status_Of( The_Breaker : Breaker ) return Status;
-
-private
- type Breaker is abstract tagged record
- State : Status := Power_Off;
- end record;
-end C393001_1;
-
-with TCTouch;
-package body C393001_1 is
- procedure Fail( The_Breaker : in out Breaker ) is ------------------- a
- begin
- TCTouch.Touch( 'a' );
- The_Breaker.State := Failed;
- end Fail;
-
- procedure Set( The_Breaker : in out Breaker'Class; To_State : Status ) is
- begin
- The_Breaker.State := To_State;
- end Set;
-
- function Status_Of( The_Breaker : Breaker ) return Status is ------- b
- begin
- TCTouch.Touch( 'b' );
- return The_Breaker.State;
- end Status_Of;
-end C393001_1;
-
------------------------------------------------------------------ C393001_2
-
-with C393001_1;
-package C393001_2 is
-
- type Basic_Breaker is new C393001_1.Breaker with private;
-
- type Voltages is ( V12, V110, V220, V440 );
- type Amps is ( A1, A5, A10, A25, A100 );
-
- function Construct( Voltage : Voltages; Amperage : Amps )
- return Basic_Breaker;
-
- procedure Flip ( The_Breaker : in out Basic_Breaker );
- procedure Trip ( The_Breaker : in out Basic_Breaker );
- procedure Reset( The_Breaker : in out Basic_Breaker );
-private
- type Basic_Breaker is new C393001_1.Breaker with record
- Voltage_Level : Voltages := V110;
- Amperage : Amps;
- end record;
-end C393001_2;
-
-with TCTouch;
-package body C393001_2 is
- function Construct( Voltage : Voltages; Amperage : Amps ) ----------- c
- return Basic_Breaker is
- It : Basic_Breaker;
- begin
- TCTouch.Touch( 'c' );
- It.Amperage := Amperage;
- It.Voltage_Level := Voltage;
- C393001_1.Set( It, C393001_1.Power_Off );
- return It;
- end Construct;
-
- procedure Flip ( The_Breaker : in out Basic_Breaker ) is ------------ d
- begin
- TCTouch.Touch( 'd' );
- case Status_Of( The_Breaker ) is
- when C393001_1.Power_Off =>
- C393001_1.Set( The_Breaker, C393001_1.Power_On );
- when C393001_1.Power_On =>
- C393001_1.Set( The_Breaker, C393001_1.Power_Off );
- when C393001_1.Tripped | C393001_1.Failed => null;
- end case;
- end Flip;
-
- procedure Trip ( The_Breaker : in out Basic_Breaker ) is ------------ e
- begin
- TCTouch.Touch( 'e' );
- C393001_1.Set( The_Breaker, C393001_1.Tripped );
- end Trip;
-
- procedure Reset( The_Breaker : in out Basic_Breaker ) is ------------ f
- begin
- TCTouch.Touch( 'f' );
- case Status_Of( The_Breaker ) is
- when C393001_1.Power_Off | C393001_1.Tripped =>
- C393001_1.Set( The_Breaker, C393001_1.Power_On );
- when C393001_1.Power_On | C393001_1.Failed => null;
- end case;
- end Reset;
-
-end C393001_2;
-
-with C393001_1,C393001_2;
-package C393001_3 is
-
- type Ground_Fault is new C393001_2.Basic_Breaker with private;
-
- function Construct( Voltage : C393001_2.Voltages; Amperage : C393001_2.Amps
-)
- return Ground_Fault;
-
- procedure Set_Trip( The_Breaker : in out Ground_Fault;
- Capacitance : in Integer );
-
-private
- type Ground_Fault is new C393001_2.Basic_Breaker with record
- Capacitance : Integer;
- end record;
-end C393001_3;
-
------------------------------------------------------------------ C393001_3
-
-with TCTouch;
-package body C393001_3 is
-
- function Construct( Voltage : C393001_2.Voltages; ------------------ g
- Amperage : C393001_2.Amps )
- return Ground_Fault is
-
- It : Ground_Fault;
-
- procedure Set_Root( It: in out C393001_2.Basic_Breaker ) is
- begin
- It := C393001_2.Construct( Voltage, Amperage );
- end Set_Root;
-
- begin
- TCTouch.Touch( 'g' );
- Set_Root( C393001_2.Basic_Breaker( It ) );
- It.Capacitance := 0;
- return It;
- end Construct;
-
- procedure Set_Trip( The_Breaker : in out Ground_Fault; -------------- h
- Capacitance : in Integer ) is
- begin
- TCTouch.Touch( 'h' );
- The_Breaker.Capacitance := Capacitance;
- end Set_Trip;
-
-end C393001_3;
-
------------------------------------------------------------------ C393001_4
-
-with C393001_1, C393001_2;
-package C393001_4 is
-
- type Special_Breaker is new C393001_2.Basic_Breaker with private;
-
- function Construct( Voltage : C393001_2.Voltages;
- Amperage : C393001_2.Amps )
- return Special_Breaker;
-
- procedure Flip ( The_Breaker : in out Special_Breaker );
- procedure Trip ( The_Breaker : in out Special_Breaker );
- procedure Reset( The_Breaker : in out Special_Breaker );
- procedure Fail ( The_Breaker : in out Special_Breaker );
-
- function Status_Of( The_Breaker : Special_Breaker ) return C393001_1.Status;
- function On_Backup( The_Breaker : Special_Breaker ) return Boolean;
-
-private
- type Special_Breaker is new C393001_2.Basic_Breaker with record
- Backup : C393001_2.Basic_Breaker;
- end record;
-end C393001_4;
-
-with TCTouch;
-package body C393001_4 is
-
- function Construct( Voltage : C393001_2.Voltages; --------------- i
- Amperage : C393001_2.Amps )
- return Special_Breaker is
- It: Special_Breaker;
- procedure Set_Root( It: in out C393001_2.Basic_Breaker ) is
- begin
- It := C393001_2.Construct( Voltage, Amperage );
- end Set_Root;
- begin
- TCTouch.Touch( 'i' );
- Set_Root( C393001_2.Basic_Breaker( It ) );
- Set_Root( It.Backup );
- return It;
- end Construct;
-
- function Status_Of( It: C393001_1.Breaker ) return C393001_1.Status
- renames C393001_1.Status_Of;
-
- procedure Flip ( The_Breaker : in out Special_Breaker ) is ---------- j
- begin
- TCTouch.Touch( 'j' );
- case Status_Of( C393001_1.Breaker( The_Breaker )) is
- when C393001_1.Power_Off | C393001_1.Power_On =>
- C393001_2.Flip( C393001_2.Basic_Breaker( The_Breaker ) );
- when others =>
- C393001_2.Flip( The_Breaker.Backup );
- end case;
- end Flip;
-
- procedure Trip ( The_Breaker : in out Special_Breaker ) is ---------- k
- begin
- TCTouch.Touch( 'k' );
- case Status_Of( C393001_1.Breaker( The_Breaker )) is
- when C393001_1.Power_Off => null;
- when C393001_1.Power_On =>
- C393001_2.Reset( The_Breaker.Backup );
- C393001_2.Trip( C393001_2.Basic_Breaker( The_Breaker ) );
- when others =>
- C393001_2.Trip( The_Breaker.Backup );
- end case;
- end Trip;
-
- procedure Reset( The_Breaker : in out Special_Breaker ) is ---------- l
- begin
- TCTouch.Touch( 'l' );
- case Status_Of( C393001_1.Breaker( The_Breaker )) is
- when C393001_1.Tripped =>
- C393001_2.Reset( C393001_2.Basic_Breaker( The_Breaker ));
- when C393001_1.Failed =>
- C393001_2.Reset( The_Breaker.Backup );
- when C393001_1.Power_On | C393001_1.Power_Off =>
- null;
- end case;
- end Reset;
-
- procedure Fail ( The_Breaker : in out Special_Breaker ) is ---------- m
- begin
- TCTouch.Touch( 'm' );
- case Status_Of( C393001_1.Breaker( The_Breaker )) is
- when C393001_1.Failed =>
- C393001_2.Fail( The_Breaker.Backup );
- when others =>
- C393001_2.Fail( C393001_2.Basic_Breaker( The_Breaker ));
- C393001_2.Reset( The_Breaker.Backup );
- end case;
- end Fail;
-
- function Status_Of( The_Breaker : Special_Breaker ) ----------------- n
- return C393001_1.Status is
- begin
- TCTouch.Touch( 'n' );
- case Status_Of( C393001_1.Breaker( The_Breaker )) is
- when C393001_1.Power_On => return C393001_1.Power_On;
- when C393001_1.Power_Off => return C393001_1.Power_Off;
- when others =>
- return C393001_2.Status_Of( The_Breaker.Backup );
- end case;
- end Status_Of;
-
- function On_Backup( The_Breaker : Special_Breaker ) return Boolean is
- use C393001_2;
- use type C393001_1.Status;
- begin
- return Status_Of(Basic_Breaker(The_Breaker)) = C393001_1.Tripped
- or Status_Of(Basic_Breaker(The_Breaker)) = C393001_1.Failed;
- end On_Backup;
-
-end C393001_4;
-
-------------------------------------------------------------------- C393001
-
-with Report, TCTouch;
-with C393001_1, C393001_2, C393001_3, C393001_4;
-procedure C393001 is
-
- procedure Flipper( The_Circuit : in out C393001_1.Breaker'Class ) is
- begin
- C393001_1.Flip( The_Circuit );
- end Flipper;
-
- procedure Tripper( The_Circuit : in out C393001_1.Breaker'Class ) is
- begin
- C393001_1.Trip( The_Circuit );
- end Tripper;
-
- procedure Restore( The_Circuit : in out C393001_1.Breaker'Class ) is
- begin
- C393001_1.Reset( The_Circuit );
- end Restore;
-
- procedure Failure( The_Circuit : in out C393001_1.Breaker'Class ) is
- begin
- C393001_1.Fail( The_Circuit );
- end Failure;
-
- Short : C393001_1.Breaker'Class -- Basic_Breaker
- := C393001_2.Construct( C393001_2.V440, C393001_2.A5 );
- Sharp : C393001_1.Breaker'Class -- Ground_Fault
- := C393001_3.Construct( C393001_2.V110, C393001_2.A1 );
- Shock : C393001_1.Breaker'Class -- Special_Breaker
- := C393001_4.Construct( C393001_2.V12, C393001_2.A100 );
-
-begin -- Main test procedure.
-
- Report.Test ("C393001", "Check that an abstract type can be declared " &
- "and used. Check actual subprograms dispatch correctly" );
-
- TCTouch.Validate( "cgcicc", "Declaration" );
-
- Flipper( Short );
- TCTouch.Validate( "db", "Flipping Short" );
- Flipper( Sharp );
- TCTouch.Validate( "db", "Flipping Sharp" );
- Flipper( Shock );
- TCTouch.Validate( "jbdb", "Flipping Shock" );
-
- Tripper( Short );
- TCTouch.Validate( "e", "Tripping Short" );
- Tripper( Sharp );
- TCTouch.Validate( "e", "Tripping Sharp" );
- Tripper( Shock );
- TCTouch.Validate( "kbfbe", "Tripping Shock" );
-
- Restore( Short );
- TCTouch.Validate( "fb", "Restoring Short" );
- Restore( Sharp );
- TCTouch.Validate( "fb", "Restoring Sharp" );
- Restore( Shock );
- TCTouch.Validate( "lbfb", "Restoring Shock" );
-
- Failure( Short );
- TCTouch.Validate( "a", "Shock Failing" );
- Failure( Sharp );
- TCTouch.Validate( "a", "Shock Failing" );
- Failure( Shock );
- TCTouch.Validate( "mbafb", "Shock Failing" );
-
- Report.Result;
-
-end C393001;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393007.a b/gcc/testsuite/ada/acats/tests/c3/c393007.a
deleted file mode 100644
index 93458eeffb8..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393007.a
+++ /dev/null
@@ -1,157 +0,0 @@
--- C393007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that an extended type can be derived from an abstract type,
--- where the abstract type is defined in a package, and the type derived
--- from it is defined in a distinct library package.
---
--- TEST DESCRIPTION:
--- Declare an private (abstract) type; declare two primitive operations
--- of the type that are explicitly abstract.
--- Derive an extended type from the (private) abstract type, overriding
--- both of the primitive operations.
--- This test also checks to see that name overloading between abstract
--- and non-abstract functions is resolved correctly.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
- package C393007_0 is
- -- Alert_System
-
- type DT_Type is new Integer;
-
- type Alert_Type is abstract tagged record
- Time_Of_Arrival : DT_Type;
- end record;
-
- type Log_File_Type is range 0 .. 100;
-
- Procedure Handle (A : in out Alert_type) is abstract;
-
- procedure Log (A : Alert_Type;
- L : in out Log_File_Type) is abstract;
-
- procedure Set_Time (A : in out Alert_Type);
-
- function Correct_Time_Stamp (A : Alert_Type) return Boolean;
-
- Day_Time : DT_Type := 100;
-
- end C393007_0;
- -- Alert_System;
-
- --=======================================================================--
-
- package body C393007_0 is
- -- Alert_System
-
- function Time_Stamp return DT_Type is
- begin
- Day_Time := Day_Time + 1;
- return Day_Time;
- end Time_Stamp;
-
- procedure Set_Time (A : in out Alert_Type) is
- begin
- A.Time_Of_Arrival := Time_Stamp;
- end Set_time;
-
- function Correct_Time_Stamp ( A : Alert_Type) return Boolean is
- begin
- return (A.Time_Of_Arrival = Day_Time);
- end Correct_Time_Stamp;
-
- end C393007_0;
- -- Alert_System;
-
- --=======================================================================--
-
- with Report;
- with C393007_0;
- -- Alert_system;
-
- package C393007_1 is
-
- type Normal_Alert_Type is
- new C393007_0.Alert_Type
- with null record;
-
- Log_File: C393007_0.Log_File_Type := C393007_0.Log_File_Type'First;
-
- procedure Handle (A : in out Normal_Alert_Type); -- Override is required
-
- procedure Log (A : Normal_Alert_Type; -- Override is required
- L : in out C393007_0.Log_File_Type);
- end C393007_1;
-
- package body C393007_1 is
- use type C393007_0.Log_File_Type;
-
- procedure Handle (A : in out Normal_Alert_Type) is
- begin
- Set_Time (A);
- Log (A, Log_File);
- end Handle;
-
- procedure Log (A : Normal_Alert_Type;
- L : in out C393007_0.Log_File_Type) is
- begin
- L := C393007_0."+"(L, 1);
- end Log;
-
- end C393007_1;
-
- with Report;
- with C393007_0;
- with C393007_1;
- -- Alert_system;
-
- procedure C393007 is
- use C393007_0;
- use C393007_1;
-
- Alert_One : C393007_1.Normal_Alert_Type;
-
- begin
- Report.Test ("C393007", "Check that an extended type can be derived " &
- "from an abstract type");
-
- Handle (Alert_One);
- if not Correct_Time_Stamp (Alert_One) then
- Report.Failed ("Wrong results from procedure Handle");
- end if;
-
- if Log_File /=1 then
- Report.Failed ("Wrong results");
- end if;
-
- Report.Result;
-
- end C393007;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393008.a b/gcc/testsuite/ada/acats/tests/c3/c393008.a
deleted file mode 100644
index d2d2aefed92..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393008.a
+++ /dev/null
@@ -1,204 +0,0 @@
--- C393008.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that an extended type can be derived from an abstract type.
---
--- TEST DESCRIPTION:
--- Declare a tagged record; declare an abstract
--- primitive operation and a non-abstract primitive operation of the
--- type. Derive an extended type from it, including a new component.
--- Use the derived type, the overriding operation and the inherited
--- operation to instantiate a generic package. The overriding operation
--- calls a new primitive operation and an inherited operation [so the
--- instantiation must get this sorted out correctly].
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-with TCTouch;
-procedure C393008 is
-
-package C393008_0 is
-
- type Status_Enum is (No_Status, Handled, Unhandled, Pending);
-
- type Alert_Type is abstract tagged record
- Status : Status_Enum;
- Reply : Boolean;
- Urgent : Boolean;
- end record;
-
- subtype Serial_Number is Integer range 0..Integer'last;
- Serial_Num : Serial_Number := 0;
-
- procedure Handle (A : in out Alert_Type) is abstract;
- -- abstract primitive operation
-
- -- the procedure Init would be _nice_ have this procedure be non_abstract
- -- and create a "base" object with a "null" constraint. The language
- -- will not allow this due to the restriction that an object of an
- -- abstract type cannot be created. Hence Init must be abstract,
- -- requiring any type derived directly from Alert_Type to declare
- -- an Init.
- --
- -- In light of this, I have changed init to a function to more closely
- -- model the typical usage of OO features...
-
- function Init return Alert_Type is abstract;
-
- procedure No_Reply (A : in out Alert_Type);
-
-end C393008_0;
-
---=======================================================================--
-
-package body C393008_0 is
-
- procedure No_Reply (A : in out Alert_Type) is
- begin -- primitive operation, not abstract
- TCTouch.Touch('A'); ------------------------------------------------- A
- if A.Status = Handled then
- A.Reply := False;
- end if;
- end No_Reply;
-
-end C393008_0;
-
---=======================================================================--
-
- generic
- -- pass in the Alert_Type object, including its
- -- operations
- type Data_Type is new C393008_0.Alert_Type with private;
- -- note that Alert_Type is abstract, so it may not be
- -- used as an actual parameter
- with procedure Update (P : in out Data_Type) is <>; -- generic formal
- with function Initialize return Data_Type is <>; -- generic formal
-
- package C393008_1 is
- -- Utilities
-
- procedure Modify (Item : in out Data_Type);
-
- end C393008_1;
- -- Utilities
-
---=======================================================================--
-
- package body C393008_1 is
- -- Utilities
-
- procedure Modify (Item : in out Data_Type) is
- begin
- TCTouch.Touch('B'); --------------------------------------------- B
- Item := Initialize;
- Update (Item);
- end Modify;
-
- end C393008_1;
-
---=======================================================================--
-
- package C393008_2 is
-
- type Low_Alert_Type is new C393008_0.Alert_Type with record
- Serial : C393008_0.Serial_Number;
- end record;
-
- procedure Serialize (LA : in out Low_Alert_Type);
-
- -- inherit No_Reply
-
- procedure Handle (LA : in out Low_Alert_Type);
-
- function Init return Low_Alert_Type;
- end C393008_2;
-
- package body C393008_2 is
- procedure Serialize (LA : in out Low_Alert_Type) is
- begin -- new primitive operation
- TCTouch.Touch('C'); ------------------------------------------------- C
- C393008_0.Serial_Num := C393008_0.Serial_Num + 1;
- LA.Serial := C393008_0.Serial_Num;
- end Serialize;
-
- -- inherit No_Reply
-
- function Init return Low_Alert_Type is
- TA: Low_Alert_Type;
- begin
- TCTouch.Touch('D'); ------------------------------------------------- D
- Serialize( TA );
- TA.Status := C393008_0.No_Status;
- return TA;
- end Init;
-
- procedure Handle (LA : in out Low_Alert_Type) is
- begin -- overrides abstract inherited Handle
- TCTouch.Touch('E'); ------------------------------------------------- E
- Serialize (LA);
- LA.Reply := False;
- LA.Status := C393008_0.Handled;
- No_Reply (LA);
- end Handle;
-
- end C393008_2;
-
- use C393008_2;
-
- package Alert_Utilities is new
- C393008_1 (Data_Type => Low_Alert_Type,
- Update => Handle, -- Low_Alert's Handle
- Initialize => Init); -- inherited from Alert
-
- Item : Low_Alert_Type;
-
- use type C393008_0.Status_Enum;
-
-begin
-
- Report.Test ("C393008", "Check that an extended type can be derived "&
- "from an abstract type");
-
- Item := Init;
- if (Item.Status /= C393008_0.No_Status) or (Item.Serial /=1) then
- Report.Failed ("Wrong initialization");
- end if;
- TCTouch.Validate("DC", "Initialization Call");
-
- Alert_Utilities.Modify (Item);
- if (Item.Status /= C393008_0.Handled) or (Item.Serial /= 3) then
- Report.Failed ("Wrong results from Modify");
- end if;
- TCTouch.Validate("BDCECA", "Generic Instance Call");
-
- Report.Result;
-
-end C393008;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393009.a b/gcc/testsuite/ada/acats/tests/c3/c393009.a
deleted file mode 100644
index 1353f9c37d4..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393009.a
+++ /dev/null
@@ -1,170 +0,0 @@
--- C393009.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that an extended type can be derived from an abstract type.
---
--- TEST DESCRIPTION:
--- Declare an abstract type in the specification of a generic package.
--- Instantiate the package and derive an extended type from the abstract
--- (instantiated) type; override all abstract operations; use all
--- inherited operations;
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 14 Oct 95 SAIC Fixed for ACVC 2.0.1
---
---!
-
-with Report;
-procedure C393009 is
-
- package Display_Devices is
-
- type Display_Device_Enum is (None, TTY, Console, Big_Screen);
- Display : Display_Device_Enum := None;
-
- end Display_Devices;
-
---=======================================================================--
-
- generic
-
- type Generic_Status is (<>);
-
- type Serial_Type is (<>);
-
- package Alert_System is
-
- type Alert_Type (Serial : Serial_Type) is abstract tagged record
- Status : Generic_Status;
- end record;
-
- Next_Serial_Number : Serial_Type := Serial_Type'First;
-
- procedure Handle (A : in out Alert_Type) is abstract;
- -- abstract operation - must be overridden after instantiation
-
- procedure Display ( A : Alert_Type;
- On : Display_Devices.Display_Device_Enum);
- -- primitive operation of Alert_Type
- -- not required to be overridden
-
- function Get_Serial_Number (A : Alert_Type) return Serial_Type;
- -- primitive operation of Alert_Type
- -- not required to be overridden
-
- end Alert_System;
-
---=======================================================================--
-
- package body Alert_System is
-
- procedure Display ( A : in Alert_Type;
- On : Display_Devices.Display_Device_Enum) is
- begin
- Display_Devices.Display := On;
- end Display;
-
- function Get_Serial_Number (A : Alert_Type)
- return Serial_Type is
- begin
- return A.Serial;
- end Get_Serial_Number;
-
- end Alert_System;
-
---=======================================================================--
-
- package NCC_1701 is
-
- type Status_Kind is (Green, Yellow, Red);
- type Serial_Number_Type is new Integer range 1..Integer'Last;
-
- subtype Msg_Str is String (1..16);
- Alert_Msg : Msg_Str := "C393009 passed.";
- -- 123456789A123456
-
- package Alert_Pkg is new Alert_System (Status_Kind, Serial_Number_Type);
-
- type New_Alert_Type(Serial : Serial_Number_Type) is
- new Alert_Pkg.Alert_Type(Serial) with record
- Message : Msg_Str;
- end record;
-
- -- procedure Display is inherited by New_Alert_Type
-
- -- function Get_Serial_Number is inherited by New_Alert_Type
- procedure Handle (NA : in out New_Alert_Type); -- must be overridden
- procedure Init (NA : in out New_Alert_Type); -- new primitive
-
- NA : New_Alert_Type(Alert_Pkg.Next_Serial_Number);
- -- New_Alert_Type is not abstract, so an object of that
- -- type may be declared
-
- end NCC_1701;
-
- package body NCC_1701 is
-
- procedure Handle (NA : in out New_Alert_Type) is
- begin
- NA.Message := Alert_Msg;
- Display (NA, On => Display_Devices.TTY);
- end Handle;
-
- procedure Init (NA : in out New_Alert_Type) is -- new primitive operation
- begin -- for New_Alert_Type
- NA := (Serial=> NA.Serial, Status => Green, Message => (others => ' '));
- end Init;
-
- end NCC_1701;
-
- use NCC_1701;
- use type Display_Devices.Display_Device_Enum;
-
-begin
-
- Report.Test ("C393009", "Check that an extended type can be derived " &
- "from an abstract type");
-
- Init (NA);
- if (Get_Serial_Number (NA) /= 1)
- or (NA.Status /= Green)
- or (Display_Devices.Display /= Display_Devices.None) then
- Report.Failed ("Wrong Initialization");
- end if;
-
- Handle (NA);
- if (Get_Serial_Number (NA) /= 1)
- or (NA.Status /= Green)
- or (NA.Message /= Alert_Msg)
- or (Display_Devices.Display /= Display_Devices.TTY) then
- Report.Failed ("Wrong results from Handle");
- end if;
-
- Report.Result;
-
-end C393009;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393010.a b/gcc/testsuite/ada/acats/tests/c3/c393010.a
deleted file mode 100644
index 6a52cf889a2..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393010.a
+++ /dev/null
@@ -1,306 +0,0 @@
--- C393010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that an extended type can be derived from an abstract type and
--- that a call on an abstract operation is a dispatching operation.
--- Check that such a call can dispatch to an overriding operation
--- declared in the private part of a package.
---
--- TEST DESCRIPTION:
--- Taking from a classroom example of a typical usage: declare a basic
--- abstract type containing data germane to the entire class structure,
--- derive from that a type with specific data, and derive from that
--- another type merely providing a "secret" override. The abstract type
--- provides a concrete procedure that itself "redispatches" to an
--- abstract procedure; the abstract procedure must be provided by one or
--- more of the concrete types derived from the abstract type, and hence
--- upon re-evaluating the actual type of the operand should dispatch
--- accordingly.
---
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 Mar 96 SAIC ACVC 2.1
---
---!
-
------------------------------------------------------------------ C393010_0
-
-package C393010_0 is
-
- type Ticket is abstract tagged record
- Flight : Natural;
- Serial_Number : Natural;
- end record;
-
- function Issue return Ticket is abstract;
- procedure Label( T: Ticket ) is abstract;
-
- procedure Print( T: Ticket );
-
-end C393010_0;
-
-with TCTouch;
-package body C393010_0 is
-
- procedure Print( T: Ticket ) is
- begin
- -- Check that a call on an abstract operation is a dispatching operation
- Label( Ticket'Class( T ) );
- -- Appropriate_IO.Put( T.Flight & T.Serial_Number );
- TCTouch.Touch('P'); -------------------------------------------------- P
- end Print;
-
-end C393010_0;
-
------------------------------------------------------------------ C393010_1
-
-with C393010_0;
-package C393010_1 is
-
- type Service_Classes is (First, Business, Coach);
-
- type Menu is (Steak, Lobster, Fowl, Vegan);
-
- -- Check that an extended type can be derived from an abstract type.
- type Passenger_Ticket(Service : Service_Classes) is
- new C393010_0.Ticket with record
- Row_Seat : String(1..3);
- case Service is
- when First | Business => Meal : Menu;
- when Coach => null;
- end case;
- end record;
-
- function Issue return Passenger_Ticket;
- function Issue( Service : Service_Classes;
- Flight : Natural;
- Seat : String;
- Meal : Menu := Fowl ) return Passenger_Ticket;
-
- procedure Label( T: Passenger_Ticket );
-
- procedure Print( T: Passenger_Ticket );
-
-end C393010_1;
-
-with TCTouch;
-package body C393010_1 is
-
- procedure Label( T: Passenger_Ticket ) is
- begin
- -- Appropriate_IO.Put( T.Service );
- TCTouch.Touch('L'); -------------------------------------------------- L
- end Label;
-
- procedure Print( T: Passenger_Ticket ) is
- begin
- -- call parent print:
- C393010_0.Print( C393010_0.Ticket( T ) );
- case T.Service is
- when First => -- Appropriate_IO.Put( Meal );
- TCTouch.Touch('F'); ---------------------------------------------- F
- when Business => -- Appropriate_IO.Put( Meal );
- TCTouch.Touch('B'); ---------------------------------------------- B
- when Coach => -- Appropriate_IO.Put( "BYO" & " peanuts" );
- TCTouch.Touch('C'); ---------------------------------------------- C
- end case;
- end Print;
-
- Num : Natural := 1000;
-
- function Issue( Service : Service_Classes;
- Flight : Natural;
- Seat : String;
- Meal : Menu := Fowl ) return Passenger_Ticket is
- begin
- Num := Num +1;
- case Service is
- when First =>
- return Passenger_Ticket'(Service => First, Flight => Flight,
- Row_Seat => Seat, Meal => Meal, Serial_Number => Num );
- when Business =>
- return Passenger_Ticket'(Service => Business, Flight => Flight,
- Row_Seat => Seat, Meal => Meal, Serial_Number => Num );
- when Coach =>
- return Passenger_Ticket'(Service => Coach, Flight => Flight,
- Row_Seat => Seat, Serial_Number => Num );
- end case;
- end Issue;
-
- function Issue return Passenger_Ticket is
- begin
- return Issue( Coach, 0, "non" );
- end Issue;
-
-end C393010_1;
-
------------------------------------------------------------------ C393010_1
-
-with C393010_1;
-package C393010_2 is
-
- type Charter is new C393010_1.Passenger_Ticket( C393010_1.Coach )
- with private;
-
- function Issue return Charter;
-
- -- procedure Print( T: Passenger_Ticket );
-
-private
- type Charter is new C393010_1.Passenger_Ticket( C393010_1.Coach )
- with null record;
-
- -- Check that the dispatching call to the abstract operation will dispatch
- -- to a procedure defined in the private part of a package.
- procedure Label( T: Charter );
-
- -- an example of a required function the users shouldn't see:
- function Issue( Service : C393010_1.Service_Classes;
- Flight : Natural;
- Seat : String;
- Meal : C393010_1.Menu ) return Charter;
-
-end C393010_2;
-
-with TCTouch;
-package body C393010_2 is
-
- procedure Label( T: Charter ) is
- begin
- -- Appropriate_IO.Put( "Excursion Fare" );
- TCTouch.Touch('X'); -------------------------------------------------- X
- end Label;
-
- Num : Natural := 4000;
-
- function Issue return Charter is
- begin
- Num := Num +1;
- return Charter'(Service => C393010_1.Coach, Flight => 1001,
- Row_Seat => "OPN", Serial_Number => Num );
- end Issue;
-
- function Issue( Service : C393010_1.Service_Classes;
- Flight : Natural;
- Seat : String;
- Meal : C393010_1.Menu ) return Charter is
- begin
- return Issue;
- end Issue;
-
-end C393010_2;
-
------------------------------------------------------------------ C393010_1
-
-with Report;
-with TCTouch;
-with C393010_0;
-with C393010_1;
-with C393010_2; -- Charter Tours
-
-procedure C393010 is
-
- type Agents_Handle is access all C393010_0.Ticket'Class;
-
- type Itinerary;
-
- type Next_Leg is access Itinerary;
-
- type Itinerary is record
- Leg : Agents_Handle;
- Next : Next_Leg;
- end record;
-
- function Travel_Agent_1 return Next_Leg is
- begin
- -- ORL -> JFK -> LAX -> SAN -> DFW -> ORL
- return new Itinerary'(
- -- ORL -> JFK 01 12 2A First, Lobster
- new C393010_1.Passenger_Ticket'(
- C393010_1.Issue(C393010_1.First, 12, " 2A", C393010_1.Lobster )),
- new Itinerary'(
- -- JFK -> LAX 02 18 2B First, Steak
- new C393010_1.Passenger_Ticket'(
- C393010_1.Issue(C393010_1.First, 18, " 2B", C393010_1.Steak )),
- new Itinerary'(
- -- LAX -> SAN 03 5225 34H Coach
- new C393010_1.Passenger_Ticket'(
- C393010_1.Issue(C393010_1.Coach, 5225, "34H")),
- new Itinerary'(
- -- SAN -> DFW 04 25 13A Business, Fowl
- new C393010_1.Passenger_Ticket'(
- C393010_1.Issue(C393010_1.Business, 25, "13A")),
- new Itinerary'(
- -- DFW -> ORL 05 15 1D First, Lobster
- new C393010_1.Passenger_Ticket'(
- C393010_1.Issue(C393010_1.First, 15, " 1D", C393010_1.Lobster )),
- null )))));
- end Travel_Agent_1;
-
- function Travel_Agent_2 return Next_Leg is
- begin
- -- LAX -> NRT -> SYD -> LAX
- return new Itinerary'(
- new C393010_2.Charter'( C393010_2.Issue ),
- new Itinerary'(
- new C393010_2.Charter'( C393010_2.Issue ),
- new Itinerary'(
- new C393010_2.Charter'( C393010_2.Issue ),
- new Itinerary'(
- new C393010_2.Charter'( C393010_2.Issue ),
- null ))));
- end Travel_Agent_2;
-
- procedure Traveler( Pax_Tix : in Next_Leg ) is
- Fly_Me : Next_Leg := Pax_Tix;
- begin
- -- a particularly consumptive process...
- while Fly_Me /= null loop
- C393010_0.Print( Fly_Me.Leg.all ); -- herein lies the test.
- Fly_Me := Fly_Me.Next;
- end loop;
- end Traveler;
-
-begin
-
- Report.Test ("C393010", "Check that an extended type can be derived from "
- & "an abstract type and that a call on an abstract "
- & "operation is a dispatching operation. Check "
- & "that such a call can dispatch to an overriding "
- & "operation declared in the private part of a "
- & "package" );
-
- Traveler( Travel_Agent_1 );
- TCTouch.Validate("LPFLPFLPCLPBLPF","First Trip");
-
- Traveler( Travel_Agent_2 );
- TCTouch.Validate("XPCXPCXPCXPC","Second Trip");
-
- Report.Result;
-
-end C393010;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393011.a b/gcc/testsuite/ada/acats/tests/c3/c393011.a
deleted file mode 100644
index 8741e87c1c4..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393011.a
+++ /dev/null
@@ -1,220 +0,0 @@
--- C393011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that an abstract extended type can be derived from an abstract
--- type, and that a a non-abstract type may then be derived from the
--- second abstract type.
---
--- TEST DESCRIPTION:
--- Define an abstract type with three primitive operations, two of them
--- abstract. Derive an extended type from it, inheriting the non-
--- abstract operation, overriding one of the abstract operations with
--- a non-abstract operation, and overriding the other abstract operation
--- with an abstract operation. The extended type is therefore abstract;
--- derive an extended type from it. Override the abstract operation with
--- a non-abstract operation; inherit one operation from the original
--- abstract type, and inherit one operation from the intermediate
--- abstract type.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
- Package C393011_0 is
- -- Definitions
-
- type Status_Enum is (None, Unhandled, Pending, Handled);
- type Serial_Type is new Integer range 0 .. Integer'Last;
- subtype Priority_Type is Integer range 0..10;
-
- type Display_Enum is (Bit_Bucket, TTY, Console, Big_Screen);
-
- Next : Serial_Type := 1;
- Display_Device : Display_Enum := Bit_Bucket;
-
- end C393011_0;
- -- Definitions;
-
- --=======================================================================--
-
- with C393011_0;
- -- Definitions
-
- Package C393011_1 is
- -- Alert
-
- package Definitions renames C393011_0;
-
- type Alert_Type is abstract tagged record
- Status : Definitions.Status_Enum := Definitions.None;
- Serial_Num : Definitions.Serial_Type := 0;
- Priority : Definitions.Priority_Type;
- end record;
- -- Alert_Type is an abstract type with
- -- two operations to be overridden
-
- procedure Set_Status ( A : in out Alert_Type; -- not abstract
- To : Definitions.Status_Enum);
-
- procedure Set_Serial ( A : in out Alert_Type) is abstract;
- procedure Display ( A : Alert_Type) is abstract;
-
- end C393011_1;
- -- Alert
-
- --=======================================================================--
-
- with C393011_0;
- package body C393011_1 is
- -- Alert
- procedure Set_Status ( A : in out Alert_Type;
- To : Definitions.Status_Enum) is
- begin
- A.Status := To;
- end Set_Status;
-
- end C393011_1;
- -- Alert;
-
- --=======================================================================--
-
- with C393011_0,
- -- Definitions,
- C393011_1,
- -- Alert,
- Calendar;
-
- Package C393011_3 is
- -- New_Alert
-
- type New_Alert_Type is abstract new C393011_1.Alert_Type with record
- Display_Dev : C393011_0.Display_Enum := C393011_0.TTY;
- end record;
-
- -- procedure Set_Status is inherited
-
- procedure Set_Serial ( A : in out New_Alert_Type); -- override/see body
-
- procedure Display ( A : New_Alert_Type) is abstract;
- -- override is abstract
- -- still can't declare objects of New_Alert_Type
-
- end C393011_3;
- -- New_Alert
-
- --=======================================================================--
-
- with C393011_0;
- Package Body C393011_3 is
- -- New_Alert
-
- package Definitions renames C393011_0;
-
- procedure Set_Serial (A : in out New_Alert_Type) is
- use type Definitions.Serial_Type;
- begin
- A.Serial_Num := Definitions.Next;
- Definitions.Next := Definitions."+"( Definitions.Next, 1);
- end Set_Serial;
-
- End C393011_3;
- -- New_Alert;
-
- --=======================================================================--
-
- with C393011_0,
- -- Definitions
- C393011_3;
- -- New_Alert -- package Alert is not visible
- package C393011_4 is
-
- package New_Alert renames C393011_3;
- package Definitions renames C393011_0;
-
- type Final_Alert_Type is new New_Alert.New_Alert_Type with null record;
- -- inherits Set_Status including body
- -- inherits Set_Serial including body
- -- must override Display since inherited Display is abstract
- procedure Display(FA : in Final_Alert_Type);
- procedure Handle (FA : in out Final_Alert_Type);
-
- end C393011_4;
-
- package body C393011_4 is
-
- procedure Display (FA : in Final_Alert_Type) is
- begin
- Definitions.Display_Device := FA.Display_Dev;
- end Display;
-
- procedure Handle (FA : in out Final_Alert_Type) is
- begin
- Set_Status (FA, Definitions.Handled);
- Set_Serial (FA);
- Display (FA);
- end Handle;
- end C393011_4;
-
- with C393011_0,
- -- Definitions
- C393011_3;
- -- New_Alert -- package Alert is not visible
- with C393011_4;
- with Report;
- procedure C393011 is
- use C393011_4;
- use Definitions;
-
- FA : Final_Alert_Type;
-
- begin
-
- Report.Test ("C393011", "Check that an extended type can be derived " &
- "from an abstract type");
-
- if (Definitions.Display_Device /= Definitions.Bit_Bucket)
- or (Definitions.Next /= 1)
- or (FA.Status /= Definitions.None)
- or (FA.Serial_Num /= 0)
- or (FA.Display_Dev /= TTY) then
- Report.Failed ("Incorrect initial conditions");
- end if;
-
- Handle (FA);
- if (Definitions.Display_Device /= Definitions.TTY)
- or (Definitions.Next /= 2)
- or (FA.Status /= Definitions.Handled)
- or (FA.Serial_Num /= 1)
- or (FA.Display_Dev /= TTY) then
- Report.Failed ("Incorrect results from Handle");
- end if;
-
- Report.Result;
-
- end C393011;
-
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393012.a b/gcc/testsuite/ada/acats/tests/c3/c393012.a
deleted file mode 100644
index 16bf6ddccf8..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393012.a
+++ /dev/null
@@ -1,221 +0,0 @@
--- C393012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a non-abstract subprogram of an abstract type can be
--- called with a controlling operand that is a type conversion to
--- the abstract type.
---
--- Check that converting to the class-wide type of an abstract type
--- inside an operation of that type causes a "redispatch" of the
--- called operation.
---
--- TEST DESCRIPTION:
--- This test defines an abstract type, and further derives types from it.
--- The key feature of this test is in the "Display" procedures where
--- the bodies of these procedures convert an object to the class-wide
--- type of the root abstract type, causing a "redispatch".
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 16 Dec 94 SAIC Add allocation to the object initializations
---
---!
-
-package C393012_0 is
-
- subtype Row_Number is Positive range 1..120;
- subtype Seat_Letter is Character range 'A'..'M';
-
- type Ticket is abstract tagged
- record
- Flight : Natural;
- Row : Row_Number;
- Seat : Seat_Letter;
- end record;
-
- function Display( T: Ticket ) return String;
- function Service( T: Ticket ) return String is abstract;
-
-end C393012_0;
-
-with TCTouch;
-package body C393012_0 is
- function Display( T: Ticket ) return String is
- begin
- TCTouch.Touch('T'); --------------------------------------------------- T
- return "Fl:" & Natural'Image(T.Flight)
- & Service( Ticket'Class( T ) )
- & " Seat:" & Row_Number'Image(T.Row) & T.Seat;
- end Display;
-end C393012_0;
-
-with C393012_0;
-package C393012_1 is
- type Economy is new C393012_0.Ticket with null record;
- function Display( T: Economy ) return String;
- function Service( T: Economy ) return String;
-
- type Meal_Designator is ( B, L, D, V, SN );
-
- type First is new C393012_0.Ticket with
- record
- Meal : Meal_Designator;
- end record;
- function Display( T: First ) return String;
- function Service( T: First ) return String;
- procedure Set_Meal( T: in out First; To_Meal : Meal_Designator );
-
-end C393012_1;
-
-with TCTouch;
-package body C393012_1 is
- function Display( T: Economy ) return String is
- begin
- TCTouch.Touch('E'); --------------------------------------------------- E
- return C393012_0.Display( C393012_0.Ticket( T ) );
- end Display; -- conversion to abstract type
-
- function Service( T: Economy ) return String is
- begin
- TCTouch.Touch('e'); --------------------------------------------------- e
- return " K";
- end Service;
-
- function Display( T: First ) return String is
- begin
- TCTouch.Touch('F'); --------------------------------------------------- F
- return C393012_0.Display( C393012_0.Ticket( T ) );
- end Display; -- conversion to abstract type
-
- function Service( T: First ) return String is
- begin
- TCTouch.Touch('f'); --------------------------------------------------- f
- return " F" & Meal_Designator'Image(T.Meal);
- end Service;
-
- procedure Set_Meal( T: in out First; To_Meal : Meal_Designator ) is
- begin
- T.Meal := To_Meal;
- end Set_Meal;
-
-end C393012_1;
-
-with Report;
-with TCTouch;
-with C393012_0;
-with C393012_1;
-procedure C393012 is
-
- package Rt renames C393012_0;
- package Tx renames C393012_1;
-
- type Tix is access Rt.Ticket'Class;
- type Itinerary is array(Positive range 1..3) of Tix;
-
--- Outbound and Inbound itineraries provide different orderings of mixtures
--- of Economy and First_Class. Not that that should make any difference...
-
- Outbound : Itinerary := ( 1 => new Tx.Economy'( 5335, 5, 'B' ),
- 2 => new Tx.First' ( 67, 1, 'J', Tx.L ),
- 3 => new Tx.Economy'( 345, 37, 'C' ) );
-
- Inbound : Itinerary := ( 1 => new Tx.First' ( 456, 4, 'F', Tx.SN ),
- 2 => new Tx.Economy'( 68, 12, 'D' ),
- 3 => new Tx.Economy'( 5336, 6, 'A' ) );
-
--- Each call to Display uses a parameter that is a type conversion
--- to the abstract type Ticket.
-
- procedure TC_Convert( I: Itinerary; Leg1,Leg2,Leg3: String ) is
- begin
- if Rt.Display( Rt.Ticket( I(1).all ) ) /= Leg1 then
- Report.Failed( Rt.Display( Rt.Ticket( I(1).all ) ) & " /= " & Leg1 );
- end if;
- if Rt.Display( Rt.Ticket( I(2).all ) ) /= Leg2 then
- Report.Failed( Rt.Display( Rt.Ticket( I(2).all ) ) & " /= " & Leg2 );
- end if;
- if Rt.Display( Rt.Ticket( I(3).all ) ) /= Leg3 then
- Report.Failed( Rt.Display( Rt.Ticket( I(3).all ) ) & " /= " & Leg3 );
- end if;
- end TC_Convert;
-
--- Each call to Display uses a parameter that is not a type conversion
-
- procedure TC_Match( I: Itinerary; Leg1,Leg2,Leg3: String ) is
- begin
- if Rt.Display( I(1).all ) /= Leg1 then
- Report.Failed( Rt.Display( I(1).all ) & " /= " & Leg1 );
- end if;
- if Rt.Display( I(2).all ) /= Leg2 then
- Report.Failed( Rt.Display( I(2).all ) & " /= " & Leg2 );
- end if;
- if Rt.Display( I(3).all ) /= Leg3 then
- Report.Failed( Rt.Display( I(3).all ) & " /= " & Leg3 );
- end if;
- end TC_Match;
-
-begin -- Main test procedure.
-
- Report.Test ("C393012", "Check that a non-abstract subprogram of an "
- & "abstract type can be called with a "
- & "controlling operand that is a type "
- & "conversion to the abstract type. "
- & "Check that converting to the class-wide type "
- & "of an abstract type inside an operation of "
- & "that type causes a redispatch" );
-
- -- Test conversions to abstract type
-
- TC_Convert( Outbound, "Fl: 5335 K Seat: 5B",
- "Fl: 67 FL Seat: 1J",
- "Fl: 345 K Seat: 37C" );
-
- TCTouch.Validate( "TeTfTe", "Outbound flight (converted)" );
-
- TC_Convert( Inbound, "Fl: 456 FSN Seat: 4F",
- "Fl: 68 K Seat: 12D",
- "Fl: 5336 K Seat: 6A" );
-
- TCTouch.Validate( "TfTeTe", "Inbound flight (converted)" );
-
- -- Test without conversions to abstract type
-
- TC_Match( Outbound, "Fl: 5335 K Seat: 5B",
- "Fl: 67 FL Seat: 1J",
- "Fl: 345 K Seat: 37C" );
-
- TCTouch.Validate( "ETeFTfETe", "Outbound flight" );
-
- TC_Match( Inbound, "Fl: 456 FSN Seat: 4F",
- "Fl: 68 K Seat: 12D",
- "Fl: 5336 K Seat: 6A" );
-
- TCTouch.Validate( "FTfETeETe", "Inbound flight" );
-
- Report.Result;
-
-end C393012;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393a02.a b/gcc/testsuite/ada/acats/tests/c3/c393a02.a
deleted file mode 100644
index 177bd34b87e..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393a02.a
+++ /dev/null
@@ -1,213 +0,0 @@
--- C393A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a dispatching call to an abstract subprogram invokes
--- the correct subprogram body of a descendant type according to
--- the controlling tag.
--- Check that a subprogram can be declared with formal parameters
--- and result that are of an abstract type's associated class-wide
--- type and that such subprograms can be called. 3.4.1(4)
---
--- TEST DESCRIPTION:
--- This test declares several objects of types derived from the
--- abstract type as defined in the foundation F393A00. It then calls
--- various dispatching and class-wide subprograms using those objects.
--- The packages in F393A00 are instrumented to trace the flow of
--- execution.
--- The test checks for the correct order of execution, as expected
--- by the various calls.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F393A00.A (foundation code)
--- C393A02.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Removed RM references from objective text.
--- 05 APR 96 SAIC Update RM references for 2.1
---
---!
-
-with Report;
-with F393A00_0;
-with F393A00_1;
-with F393A00_2;
-with F393A00_3;
-with F393A00_4;
-procedure C393A02 is
-
- A_Windmill : F393A00_2.Windmill;
- A_Pump : F393A00_3.Pump;
- A_Mill : F393A00_4.Mill;
-
- A_Windmill_2 : F393A00_2.Windmill;
- A_Pump_2 : F393A00_3.Pump;
- A_Mill_2 : F393A00_4.Mill;
-
- B_Windmill : F393A00_2.Windmill;
- B_Pump : F393A00_3.Pump;
- B_Mill : F393A00_4.Mill;
-
- procedure Swapem( A,B: in out F393A00_2.Windmill'Class ) is
- begin
- F393A00_0.TC_Touch('x');
- F393A00_2.Swap( A,B );
- end Swapem;
-
- function Zephyr( A: F393A00_2.Windmill'Class )
- return F393A00_2.Windmill'Class is
- Item : F393A00_2.Windmill'Class := A;
- begin
- F393A00_0.TC_Touch('y');
- if not F393A00_1.Initialized( Item ) then -- b
- F393A00_2.Initialize( Item ); -- a
- end if;
- F393A00_2.Stop( Item ); -- f / mff
- F393A00_2.Add_Spin( Item, 10 ); -- e
- return Item;
- end Zephyr;
-
- function Gale( It: F393A00_2.Windmill ) return F393A00_2.Windmill'Class is
- Item : F393A00_2.Windmill'Class := It;
- begin
- F393A00_2.Stop( Item ); -- f
- F393A00_2.Add_Spin( Item, 40 ); -- e
- return Item;
- end Gale;
-
- function Gale( It: F393A00_3.Pump ) return F393A00_2.Windmill'Class is
- Item : F393A00_2.Windmill'Class := It;
- begin
- F393A00_2.Stop( Item ); -- f
- F393A00_2.Add_Spin( Item, 50 ); -- e
- return Item;
- end Gale;
-
- function Gale( It: F393A00_4.Mill ) return F393A00_2.Windmill'Class is
- Item : F393A00_2.Windmill'Class := It;
- begin
- F393A00_2.Stop( Item ); -- mff
- F393A00_2.Add_Spin( Item, 60 ); -- e
- return Item;
- end Gale;
-
-begin -- Main test procedure.
-
- Report.Test ("C393A02", "Check that a dispatching call to an abstract "
- & "subprogram invokes the correct subprogram body. "
- & "Check that a subprogram declared with formal "
- & "parameters/result of an abstract type's "
- & "associated class-wide can be called" );
-
- F393A00_0.TC_Validate( "hhh", "Mill declarations" );
- A_Windmill := F393A00_2.Create;
- F393A00_0.TC_Validate( "d", "Create A_Windmill" );
-
- A_Pump := F393A00_3.Create;
- F393A00_0.TC_Validate( "h", "Create A_Pump" );
-
- A_Mill := F393A00_4.Create;
- F393A00_0.TC_Validate( "hl", "Create A_Mill" );
-
- --------------
-
- Swapem( A_Windmill, A_Windmill_2 );
- F393A00_0.TC_Validate( "xc", "Windmill Swap" );
-
- Swapem( A_Pump, A_Pump_2 );
- F393A00_0.TC_Validate( "xc", "Pump Swap" );
-
- Swapem( A_Mill, A_Mill_2 );
- F393A00_0.TC_Validate( "xk", "Pump Swap" );
-
- F393A00_2.Initialize( A_Windmill_2 );
- F393A00_3.Initialize( A_Pump_2 );
- F393A00_4.Initialize( A_Mill_2 );
- B_Windmill := A_Windmill_2;
- B_Pump := A_Pump_2;
- B_Mill := A_Mill_2;
- F393A00_2.Add_Spin( B_Windmill, 123 );
- F393A00_3.Set_Rate( B_Pump, 12.34 );
- F393A00_4.Add_Spin( B_Mill, 321 );
- F393A00_0.TC_Validate( "aaaeie", "Setting Values" );
-
- declare
- It : F393A00_2.Windmill'Class := Zephyr( B_Windmill ); -- ybfe
- XX : F393A00_2.Windmill'Class := Gale( B_Windmill ); -- fe
- use type F393A00_2.Rotational_Measurement;
- begin
- if not F393A00_1.Initialized( It ) or not F393A00_1.Initialized( XX )
-then
- Report.Failed( "Copy to class-wide variable" );
- end if; -- bb
- if F393A00_2.Spin( It ) /= 10 -- g
- or F393A00_2.Spin( XX ) /= 40 then -- g
- Report.Failed( "Call to class-wide operation" );
- end if;
-
- F393A00_0.TC_Validate( "ybfefebbgg", "Windmill Zephyr" );
- end;
-
- declare
- It : F393A00_2.Windmill'Class := Zephyr( B_Pump ); -- ybfe
- XX : F393A00_2.Windmill'Class := Gale( B_Pump ); -- fe
- use type F393A00_2.Rotational_Measurement;
- begin
- if not F393A00_1.Initialized( It ) or not F393A00_1.Initialized( XX )
-then
- Report.Failed( "Bad copy to class-wide variable" );
- end if; -- bb
- if F393A00_2.Spin( It ) /= 10 -- g
- or F393A00_2.Spin( XX ) /= 50 then -- g
- Report.Failed( "Call to class-wide operation" );
- end if;
-
- F393A00_0.TC_Validate( "ybfefebbgg", "Pump Zephyr" );
- end;
-
- declare
- It : F393A00_2.Windmill'Class := Zephyr( B_Mill ); -- ybmffe
- XX : F393A00_2.Windmill'Class := Gale( B_Mill ); -- mffe
- use type F393A00_2.Rotational_Measurement;
- begin
- if not F393A00_1.Initialized( It ) or not F393A00_1.Initialized( XX )
-then
- Report.Failed( "Bad copy to class-wide variable" );
- end if; -- bb
- if F393A00_2.Spin( It ) /= 10 -- g
- or F393A00_2.Spin( XX ) /= 60 then -- g
- Report.Failed( "Call to class-wide operation" );
- end if;
-
- F393A00_0.TC_Validate( "ybmffemffebbgg", "Mill Zephyr" );
- end;
-
- Report.Result;
-
-end C393A02;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393a03.a b/gcc/testsuite/ada/acats/tests/c3/c393a03.a
deleted file mode 100644
index 90106f4bf44..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393a03.a
+++ /dev/null
@@ -1,242 +0,0 @@
--- C393A03.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a non-abstract primitive subprogram of an abstract
--- type can be called as a dispatching operation and that the body
--- of this subprogram can make a dispatching call to an abstract
--- operation of the corresponding abstract type.
---
--- TEST DESCRIPTION:
--- This test expands on the class family defined in foundation F393A00
--- by deriving a new abstract type from the root abstract type "Object".
--- The subprograms defined for the new abstract type are then
--- appropriately overridden, and the test ultimately calls various
--- mixtures of these subprograms to check that the dispatching occurs
--- correctly.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F393A00.A (foundation code)
--- C393A03.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Removed ARM references from objective text.
--- 23 Oct 95 SAIC Fixed bugs for ACVC 2.0.1
---
---!
-
-------------------------------------------------------------------- C393A03_0
-
-with F393A00_1;
-package C393A03_0 is
-
- type Counting_Object is abstract new F393A00_1.Object with private;
- -- inherits Initialize, Swap (abstract) and Create (abstract)
-
- procedure Bump ( A_Counter: in out Counting_Object );
- procedure Clear( A_Counter: in out Counting_Object ) is abstract;
- procedure Zero ( A_Counter: in out Counting_Object );
- function Value( A_Counter: Counting_Object'Class ) return Natural;
-
-private
-
- type Counting_Object is abstract new F393A00_1.Object with
- record
- Tally : Natural :=0;
- end record;
-
-end C393A03_0;
-
------------------------------------------------------------------------------
-
-with F393A00_0;
-package body C393A03_0 is
-
- procedure Bump ( A_Counter: in out Counting_Object ) is
- begin
- F393A00_0.TC_Touch('A');
- A_Counter.Tally := A_Counter.Tally +1;
- end Bump;
-
- procedure Zero ( A_Counter: in out Counting_Object ) is
- begin
- F393A00_0.TC_Touch('B');
-
- -- dispatching call to abstract operation of Counting_Object
- Clear( Counting_Object'Class(A_Counter) );
-
- A_Counter.Tally := 0;
-
- end Zero;
-
- function Value( A_Counter: Counting_Object'Class ) return Natural is
- begin
- F393A00_0.TC_Touch('C');
- return A_Counter.Tally;
- end Value;
-
-end C393A03_0;
-
-------------------------------------------------------------------- C393A03_1
-
-with C393A03_0;
-package C393A03_1 is
-
- type Modular_Object is new C393A03_0.Counting_Object with private;
- -- inherits Initialize, Bump, Zero and Value,
- -- inherits abstract Swap, Create and Clear
-
- procedure Swap( A,B: in out Modular_Object );
- procedure Clear( It: in out Modular_Object );
- procedure Set_Max( It : in out Modular_Object; Value : Natural );
- function Create return Modular_Object;
-
-private
-
- type Modular_Object is new C393A03_0.Counting_Object with
- record
- Max_Value : Natural;
- end record;
-
-end C393A03_1;
-
------------------------------------------------------------------------------
-
-with F393A00_0;
-package body C393A03_1 is
-
- procedure Swap( A,B: in out Modular_Object ) is
- T : constant Modular_Object := B;
- begin
- F393A00_0.TC_Touch('1');
- B := A;
- A := T;
- end Swap;
-
- procedure Clear( It: in out Modular_Object ) is
- begin
- F393A00_0.TC_Touch('2');
- null;
- end Clear;
-
- procedure Set_Max( It : in out Modular_Object; Value : Natural ) is
- begin
- F393A00_0.TC_Touch('3');
- It.Max_Value := Value;
- end Set_Max;
-
- function Create return Modular_Object is
- AMO : Modular_Object;
- begin
- F393A00_0.TC_Touch('4');
- AMO.Max_Value := Natural'Last;
- return AMO;
- end Create;
-
-end C393A03_1;
-
---------------------------------------------------------------------- C393A03
-
-with Report;
-with F393A00_0;
-with F393A00_1;
-with C393A03_0;
-with C393A03_1;
-procedure C393A03 is
-
- A_Thing : C393A03_1.Modular_Object;
- Another_Thing : C393A03_1.Modular_Object;
-
- procedure Initialize( It: in out C393A03_0.Counting_Object'Class ) is
- begin
- C393A03_0.Initialize( It ); -- dispatch to inherited procedure
- end Initialize;
-
- procedure Bump( It: in out C393A03_0.Counting_Object'Class ) is
- begin
- C393A03_0.Bump( It ); -- dispatch to non-abstract procedure
- end Bump;
-
- procedure Set_Max( It : in out C393A03_1.Modular_Object'Class;
- Val : Natural) is
- begin
- C393A03_1.Set_Max( It, Val ); -- dispatch to non-abstract procedure
- end Set_Max;
-
- procedure Swap( A, B : in out C393A03_0.Counting_Object'Class ) is
- begin
- C393A03_0.Swap( A, B ); -- dispatch to inherited abstract procedure
- end Swap;
-
- procedure Zero( It: in out C393A03_0.Counting_Object'Class ) is
- begin
- C393A03_0.Zero( It ); -- dispatch to non-abstract procedure
- end Zero;
-
-begin -- Main test procedure.
-
- Report.Test ("C393A03", "Check that a non-abstract primitive subprogram "
- & "of an abstract type can be called as a "
- & "dispatching operation and that the body of this "
- & "subprogram can make a dispatching call to an "
- & "abstract operation of the corresponding "
- & "abstract type" );
-
- A_Thing := C393A03_1.Create; -- Max_Value = Natural'Last
- F393A00_0.TC_Validate( "4", "Overridden primitive layer 2");
-
- Initialize( A_Thing );
- Initialize( Another_Thing );
- F393A00_0.TC_Validate( "aa", "Non-abstract primitive layer 0");
-
- Bump( A_Thing ); -- Tally = 1
- F393A00_0.TC_Validate( "A", "Non-abstract primitive layer 1");
-
- Set_Max( A_Thing, 42 ); -- Max_Value = 42
- F393A00_0.TC_Validate( "3", "Non-abstract normal layer 2");
-
- if not F393A00_1.Initialized( A_Thing ) then
- Report.Failed("Initialize didn't");
- end if;
- F393A00_0.TC_Validate( "b", "Class-wide layer 0");
-
- Swap( A_Thing, Another_Thing );
- F393A00_0.TC_Validate( "1", "Overridden abstract layer 2");
-
- Zero( A_Thing );
- F393A00_0.TC_Validate( "B2", "Non-abstract layer 0, calls dispatch");
-
- if C393A03_0.Value( A_Thing ) /= 0 then
- Report.Failed("Zero didn't");
- end if;
- F393A00_0.TC_Validate( "C", "Class-wide normal layer 2");
-
- Report.Result;
-
-end C393A03;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393a05.a b/gcc/testsuite/ada/acats/tests/c3/c393a05.a
deleted file mode 100644
index b404559cc83..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393a05.a
+++ /dev/null
@@ -1,166 +0,0 @@
--- C393A05.A
- --
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
- --
- -- OBJECTIVE:
- -- Check that for a nonabstract private extension, any inherited
- -- abstract subprograms can be overridden in the private part of
- -- the immediately enclosing package and that calls can be made to
- -- private dispatching operations.
- --
- -- TEST DESCRIPTION:
- -- This test builds an additional layer upon the foundation code to
- -- provide the required "hidden" dispatching operation. The procedure
- -- Swap, a private subprogram, should be called by dispatch.
- --
- -- TEST FILES:
- -- The following files comprise this test:
- --
- -- F393A00.A (foundation code)
- -- C393A05.A
- --
- --
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
- --!
-
- with F393A00_4;
- package C393A05_0 is
- type Grinder is new F393A00_4.Mill with private;
- type Coarseness is (Whole_Bean, Coarse, Medium, Fine, Espresso);
-
- procedure Set_Grind( It: in out Grinder; The_Grind: Coarseness );
- function Grind( It: Grinder ) return Coarseness;
-
- function Create return Grinder;
- private
- procedure Swap( A,B: in out Grinder );
- type Grinder is new F393A00_4.Mill with
- record
- Grind : Coarseness := Whole_Bean;
- end record;
- end C393A05_0;
-
- with F393A00_0;
- package body C393A05_0 is
- procedure Set_Grind( It: in out Grinder; The_Grind: Coarseness ) is
- begin
- F393A00_0.TC_Touch( 'A' );
- It.Grind := The_Grind;
- end Set_Grind;
-
- function Grind( It: Grinder ) return Coarseness is
- begin
- F393A00_0.TC_Touch( 'B' );
- return It.Grind;
- end Grind;
-
- procedure Swap( A,B: in out Grinder ) is
- T : constant Grinder := A;
- begin
- F393A00_0.TC_Touch( 'C' );
- A := B;
- B := T;
- end Swap;
-
- function Create return Grinder is
- One: Grinder;
- begin
- F393A00_0.TC_Touch( 'D' );
- F393A00_4.Initialize( F393A00_4.Mill( One ) );
- One.Grind := Fine;
- return One;
- end Create;
- end C393A05_0;
-
- with Report;
- with F393A00_0;
- with C393A05_0;
- procedure C393A05 is
-
- package Tracer renames F393A00_0;
- package Coffee renames C393A05_0;
- use type Coffee.Coarseness;
-
- Morning : Coffee.Grinder;
- Afternoon : Coffee.Grinder;
-
- Gritty : Coffee.Coarseness;
-
- procedure Class_Swap( A, B: in out Coffee.Grinder'Class ) is
- begin
- Coffee.Swap( A, B ); -- dispatch
- end Class_Swap;
-
- begin -- Main test procedure.
-
- Report.Test ("C393A05", "Check that nonabstract private extensions, "
- & "inherited abstract subprograms overridden "
- & "in the private part can be dispatched from "
- & "outside the package" );
-
- Tracer.TC_Validate( "hh", "Declarations" );
-
- Morning := Coffee.Create;
- Tracer.TC_Validate( "hDa", "Creating Morning Coffee" );
- Gritty := Coffee.Grind( Morning );
- Tracer.TC_Validate( "B", "Finding Morning Grind" );
-
- Afternoon := Coffee.Create;
- Tracer.TC_Validate( "hDa", "Creating Afternoon Coffee" );
- Coffee.Set_Grind( Afternoon, Coffee.Medium );
- Tracer.TC_Validate( "A", "Setting Afternoon Grind" );
-
- Coffee.Swap( Morning, Afternoon );
- Tracer.TC_Validate( "C", "Dispatching Swapping Coffees" );
-
- if Gritty /= Coffee.Grind( Afternoon )
- or Coffee.Grind ( Afternoon ) /= Coffee.Fine then
- Report.Failed ("Result of Swap");
- end if;
- Tracer.TC_Validate( "BB", "Finding Afternoon Grind" );
-
- Sunset: declare
- Evening : Coffee.Grinder'Class := Coffee.Create;
- begin
- Tracer.TC_Validate( "hDa", "Creating Evening Coffee" );
-
- Coffee.Set_Grind( Evening, Coffee.Espresso );
- Tracer.TC_Validate( "A", "Setting Evening Grind" );
-
- Morning := Coffee.Grinder( Evening );
- Class_Swap( Morning, Evening );
- Tracer.TC_Validate( "C", "Swapping Coffees" );
- if Coffee.Grind( Morning ) /= Coffee.Espresso then
- Report.Failed ("Result of Assignment");
- end if;
- end Sunset;
-
- Report.Result;
-
- end C393A05;
-
-
-
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393a06.a b/gcc/testsuite/ada/acats/tests/c3/c393a06.a
deleted file mode 100644
index c257d5fa0a0..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393a06.a
+++ /dev/null
@@ -1,201 +0,0 @@
--- C393A06.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a type that inherits abstract operations but
--- overrides each of these operations is not required to be
--- abstract, and that objects of the type and its class-wide type
--- may be declared and passed in calls to the overriding
--- subprograms.
---
--- TEST DESCRIPTION:
--- This test derives a type from the root abstract type available
--- in foundation F393A00. It declares subprograms as required by
--- the language to override the abstract subprograms, allowing the
--- derived type itself to be not abstract. It also declares
--- operations on the new type, as well as on the associated class-
--- wide type. The main program then uses two objects of the type
--- and two objects of the class-wide type as parameters for each of
--- the subprograms. Correct execution is determined by path
--- analysis and value checking.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F393A00.A (foundation code)
--- C393A06.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Removed RM references from objective text.
---
---!
-
- with F393A00_1;
- package C393A06_0 is
- type Organism is new F393A00_1.Object with private;
- type Kingdoms is ( Animal, Vegetable, Unspecified );
-
- procedure Swap( A,B: in out Organism );
- function Create return Organism;
-
- procedure Initialize( The_Entity : in out Organism;
- In_The_Kingdom : Kingdoms );
- function Kingdom( Of_The_Entity : Organism ) return Kingdoms;
-
- procedure TC_Check( An_Entity : Organism'Class;
- In_Kingdom : Kingdoms;
- Initialized : Boolean );
-
- Incompatible : exception;
-
- private
- type Organism is new F393A00_1.Object with
- record
- In_Kingdom : Kingdoms;
- end record;
- end C393A06_0;
-
- with F393A00_0;
- package body C393A06_0 is
-
- procedure Swap( A,B: in out Organism ) is
- begin
- F393A00_0.TC_Touch( 'A' ); ------------------------------------------- A
- if A.In_Kingdom /= B.In_Kingdom then
- F393A00_0.TC_Touch( 'X' );
- raise Incompatible;
- else
- declare
- T: constant Organism := A;
- begin
- A := B;
- B := T;
- end;
- end if;
- end Swap;
-
- function Create return Organism is
- Widget : Organism;
- begin
- F393A00_0.TC_Touch( 'B' ); ------------------------------------------- B
- Initialize( Widget );
- Widget.In_Kingdom := Unspecified;
- return Widget;
- end Create;
-
- procedure Initialize( The_Entity : in out Organism;
- In_The_Kingdom : Kingdoms ) is
- begin
- F393A00_0.TC_Touch( 'C' ); ------------------------------------------- C
- F393A00_1.Initialize( F393A00_1.Object( The_Entity ) );
- The_Entity.In_Kingdom := In_The_Kingdom;
- end Initialize;
-
- function Kingdom( Of_The_Entity : Organism ) return Kingdoms is
- begin
- F393A00_0.TC_Touch( 'D' ); ------------------------------------------- D
- return Of_The_Entity.In_Kingdom;
- end Kingdom;
-
- procedure TC_Check( An_Entity : Organism'Class;
- In_Kingdom : Kingdoms;
- Initialized : Boolean ) is
- begin
- if F393A00_1.Initialized( An_Entity ) /= Initialized then
- F393A00_0.TC_Touch( '-' ); ------------------------------------------- -
- elsif An_Entity.In_Kingdom /= In_Kingdom then
- F393A00_0.TC_Touch( '!' ); ------------------------------------------- !
- else
- F393A00_0.TC_Touch( '+' ); ------------------------------------------- +
- end if;
- end TC_Check;
-
- end C393A06_0;
-
- with Report;
-
- with C393A06_0;
- with F393A00_0;
- with F393A00_1;
- procedure C393A06 is
-
- package Darwin renames C393A06_0;
- package Tagger renames F393A00_0;
- package Objects renames F393A00_1;
-
- Lion : Darwin.Organism;
- Tigerlily : Darwin.Organism;
- Bear : Darwin.Organism'Class := Darwin.Create;
- Sunflower : Darwin.Organism'Class := Darwin.Create;
-
- use type Darwin.Kingdoms;
-
- begin -- Main test procedure.
-
- Report.Test ("C393A06", "Check that a type that inherits abstract "
- & "operations but overrides each of these "
- & "operations is not required to be abstract. "
- & "Check that objects of the type and its "
- & "class-wide type may be declared and passed "
- & "in calls to the overriding subprograms" );
-
- Tagger.TC_Validate( "BaBa", "Declaration Initializations" );
-
- Darwin.Initialize( Lion, Darwin.Animal );
- Darwin.Initialize( Tigerlily, Darwin.Vegetable );
- Darwin.Initialize( Bear, Darwin.Animal );
- Darwin.Initialize( Sunflower, Darwin.Vegetable );
-
- Tagger.TC_Validate( "CaCaCaCa", "Initialization sequence" );
-
- Oh_My: begin
- Darwin.Swap( Lion, Darwin.Organism( Bear ) );
- Darwin.Swap( Lion, Tigerlily );
- Report.Failed("Exception not raised");
- exception
- when Darwin.Incompatible => null;
- end Oh_My;
-
- Tagger.TC_Validate( "AAX", "Swap sequence" );
-
- if Darwin.Kingdom( Darwin.Create ) = Darwin.Unspecified then
- Darwin.Swap( Sunflower, Darwin.Organism'Class( Tigerlily ) );
- end if;
-
- Tagger.TC_Validate( "BaDA", "Vegetable swap sequence" );
-
- Darwin.TC_Check( Lion, Darwin.Animal, True );
- Darwin.TC_Check( Tigerlily, Darwin.Vegetable, True );
- Darwin.TC_Check( Bear, Darwin.Animal, True );
- Darwin.TC_Check( Sunflower, Darwin.Vegetable, True );
-
- Tagger.TC_Validate( "b+b+b+b+", "Final sequence" );
-
- Report.Result;
-
- end C393A06;
-
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393b12.a b/gcc/testsuite/ada/acats/tests/c3/c393b12.a
deleted file mode 100644
index 5d1b46daa74..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393b12.a
+++ /dev/null
@@ -1,131 +0,0 @@
--- C393B12.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that an extended type can be derived in the specification of a
--- generic package when the parent is an abstract type in a library
--- package.
---
--- TEST DESCRIPTION:
--- Extend an abstract type in the visible part of a generic package.
--- Make all of the procedures which override abstract procedures
--- available as part of the generic interface. Instantiate the generic.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- F393B00.A Package Alert_Foundation
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 14 Oct 95 SAIC Update and repair for ACVC 2.0.1
--- 27 Feb 97 PWB.CTA Add pragma Elaborate for C393B12_0.
---!
-
------------------------------------------------------------------ C393B12_0
-
-with F393B00;
- -- Alert_Foundation
-generic
- type Generic_Status_Enum is (<>);
-
-package C393B12_0 is
- -- Alert_Functions
-
- type Generic_Alert_Type is new F393B00.Alert with record
- Status : Generic_Status_Enum := Generic_Status_Enum'First;
- end record;
- -- extension of an abstract type
-
- procedure Handle (GA : in out Generic_Alert_Type);
- -- override of abstract procedure
-
- function Query_Status (GA : Generic_Alert_Type)
- return Generic_Status_Enum; -- new primitive operation for
- -- Generic_Alert_Type
-end C393B12_0;
- -- Alert_Functions
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-package body C393B12_0 is
- -- Alert_Functions
-
- procedure Handle (GA : in out Generic_Alert_Type) is
- begin
- GA.Status := Generic_Status_Enum'Last;
- end Handle;
-
- function Query_Status (GA : Generic_Alert_Type)
- return Generic_Status_Enum is
- begin
- return GA.Status;
- end Query_Status;
-
-end C393B12_0;
-
------------------------------------------------------------------ C393B12_1
-
-package C393B12_1 is
- type Status is (Low, Medium, High);
-end C393B12_1;
-
-------------------------------------------------------- C393B12_1.C393B12_2
-
-with C393B12_0;
-pragma Elaborate (C393B12_0);
-package C393B12_1.C393B12_2 is new C393B12_0
- -- Alert_Functions
- (Generic_Status_Enum => Status);
-
-------------------------------------------------------------------- C393B12
-
-with C393B12_1.C393B12_2;
-with Report;
-procedure C393B12 is
-
- use type C393B12_1.Status;
-
- package Alt_Alert renames C393B12_1.C393B12_2;
-
- GA : Alt_Alert.Generic_Alert_Type;
-
-begin
- Report.Test ("C393B12", "Check that an extended type can be derived " &
- "from an abstract type");
-
- if Alt_Alert.Query_Status (GA) /= C393B12_1.Low then
- Report.Failed ("Wrong initialization");
- end if;
-
- Alt_Alert.Handle (GA);
- if Alt_Alert.Query_Status (GA) /= C393B12_1.High then
- Report.Failed ("Wrong results from Handle");
- end if;
-
- Report.Result;
-
-end C393B12;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393b13.a b/gcc/testsuite/ada/acats/tests/c3/c393b13.a
deleted file mode 100644
index c533badbe04..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393b13.a
+++ /dev/null
@@ -1,105 +0,0 @@
--- C393B13.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that an extended type can be derived from an abstract type
--- when that derivation is declared in a child package.
---
--- TEST DESCRIPTION:
--- Add a visible child to Alert_Foundation. Using the abstract type
--- Alert as parent, declare an extended type with discriminant and new
--- record components. Override the Handle procedure.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- F393B00.A Package Alert_Foundation
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 Oct 95 SAIC Fixed bugs for ACVC 2.0.1
---
---!
-
-package F393B00.C393B13_0 is
- -- Alert_Foundation.Public_Child
-
- subtype Msg_Length_Range is integer range 0 .. 240;
- Max_Msg_Length : constant Msg_Length_Range := 80;
- Message : String := "Test Passed";
-
- type Child_Alert (Length : Msg_Length_Range)
- is new Alert with record -- abstract type is in parent package
- Times_Handled : Natural := 0;
- Msg : String (1..Length);
- end record;
-
- procedure Handle (CA : in out Child_Alert); -- required override
-
-end F393B00.C393B13_0;
- -- Alert_Foundation.Public_Child;
-
---=======================================================================--
-
-package body F393B00.C393B13_0 is
- -- Alert_Foundation.Public_Child
-
- procedure Handle (CA : in out Child_Alert) is
- begin
- CA.Msg(1..Message'Length) := Message;
- CA.Times_Handled := CA.Times_Handled + 1;
- end;
-
-end F393B00.C393B13_0;
- -- Alert_Foundation.Public_Child
-
---=======================================================================--
-
-with Report;
-with F393B00.C393B13_0;
- -- Alert_foundation.Public_Child;
-procedure C393B13 is
- package Child renames F393B00.C393B13_0;
- CA : Child.Child_Alert(Child.Message'Length);
-
-begin
-
- Report.Test ("C393B13", "Check that an extended type can be derived " &
- "from an abstract type");
-
- if CA.Times_Handled /= 0 then
- Report.Failed ("Wrong initialization");
- end if;
-
- Child.Handle (CA);
- if (CA.Times_Handled /= 1)
- or (CA.Msg /= Child.Message) then
- Report.Failed ("Wrong results from Handle");
- end if;
-
- Report.Result;
-
-end C393B13;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c393b14.a b/gcc/testsuite/ada/acats/tests/c3/c393b14.a
deleted file mode 100644
index f100377aa04..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c393b14.a
+++ /dev/null
@@ -1,147 +0,0 @@
--- C393B14.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that an extended type can be derived in a private child package
--- from an abstract type defined in a library package.
---
--- TEST DESCRIPTION:
--- Add a private child package to Alert_Foundation. Using Private_Alert
--- as parent type, declare an extended type adding a new record component.
--- Override procedure Handle. Declare an object of the new type in the
--- child specification. Use type definitions from the private part of the
--- parent in the body of the child.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- F393B00.A Package Alert_Foundation
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-private package F393B00.C393B14_0 is
- -- Alert_Foundation.Private_Child
-
- type Implementation_Specific_Alert_Type is new Private_Alert with record
- New_Private_Field : Implementation_Detail
- := Implementation_Detail'Last;
- end record;
-
- procedure Handle (PA : in out Implementation_Specific_Alert_Type);
- -- overrides abstract Handle, as required
- PA : Implementation_Specific_Alert_Type;
-
-end F393B00.C393B14_0;
- -- Alert_Foundation.Private_Child
-
---=======================================================================--
-
-package body F393B00.C393B14_0 is
- -- Alert_Foundation.Private_Child
-
- procedure Handle (PA : in out Implementation_Specific_Alert_Type) is
- begin
- PA.Private_Field := 1;
- PA.New_Private_Field := PA.Private_Field + 1;
- end;
-
-end F393B00.C393B14_0;
- -- Alert_Foundation.Private_Child
-
---=======================================================================--
-
-package F393B00.C393B14_1 is
- -- Alert_Foundation.Public_Child
-
- type Timing is (Before, After);
- procedure Init;
- procedure Modify;
- function Check_Before return Boolean;
- function Check_After return Boolean;
-
-end F393B00.C393B14_1;
- -- Alert_Foundation.Public_Child
-
---=======================================================================--
-
-with F393B00.C393B14_0; -- private sibling is visible in the
- -- Alert_Foundation.Private_Child -- body of a public sibling
-package body F393B00.C393B14_1 is
- -- Alert_Foundation.Public_Child
- package Priv renames F393B00.C393B14_0;
-
- procedure Init is
- begin
- Priv.PA.Private_Field := 5;
- Priv.PA.New_Private_Field := 10;
- end Init;
-
- procedure Modify is
- begin
- Priv.Handle (Priv.PA);
- end Modify;
-
- function Check_Before return Boolean is
- begin
- return ((Priv.PA.Private_Field = 5)
- and (Priv.PA.New_Private_Field =10));
- end Check_Before;
-
- function Check_After return Boolean is
- begin
- return ((Priv.PA.Private_Field = 1)
- and (Priv.PA.New_Private_Field = 2));
- end Check_After;
-
-end F393B00.C393B14_1;
- -- Alert_Foundation.Public_Child
-
---=======================================================================--
-
-with Report;
-with F393B00.C393B14_1;
-procedure C393B14 is
- -- Alert_Foundation.Public_Child;
-
-begin
- Report.Test ("C393B14", "Check that an extended type can be derived " &
- "from an abstract type");
-
- F393B00.C393B14_1.Init;
- if not F393B00.C393B14_1.Check_Before then
- Report.Failed ("Wrong initialization");
- end if;
-
- F393B00.C393B14_1.Modify;
- if not F393B00.C393B14_1.Check_After then
- Report.Failed ("Wrong results from Handle");
- end if;
-
- Report.Result;
-end C393B14;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0001.a b/gcc/testsuite/ada/acats/tests/c3/c3a0001.a
deleted file mode 100644
index f8a0681e78f..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0001.a
+++ /dev/null
@@ -1,138 +0,0 @@
--- C3A0001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that access to subprogram type can be used to select and
--- invoke functions with appropriate arguments dynamically.
---
--- TEST DESCRIPTION:
--- Declare an access to function type in a package specification.
--- Declare three different sine functions that can be referred to by
--- the access to function type.
---
--- In the main program, call each function indirectly by dereferencing
--- the access value.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C3A0001_0 is
-
- TC_Call_Tag : Natural := 0;
-
- -- Type accesses to any sine function
- type Sine_Function_Ptr is access function
- (Angle : in Float) return Float;
-
--- Three 'Sine' functions that model an application situation in which
--- one function might be chosen when speed is important, another (using
--- a different algorithm) might be chosen when accuracy is important,
--- and so on.
-
- function Sine_Calc_Fast (Angle : in Float) return Float;
-
- function Sine_Calc_Acc (Angle : in Float) return Float;
-
- function Sine_Calc_Table (Angle : in Float) return Float;
-
-end C3A0001_0;
-
-
------------------------------------------------------------------------------
-
-
-package body C3A0001_0 is
-
- function Sine_Calc_Fast (Angle : in Float) return Float is
- begin
- TC_Call_Tag := 1;
- return 1.0;
- end Sine_Calc_Fast;
-
-
- function Sine_Calc_Acc (Angle : in Float) return Float is
- begin
- TC_Call_Tag := 2;
- return 0.0;
- end Sine_Calc_Acc;
-
-
- function Sine_Calc_Table (Angle : in Float) return Float is
- begin
- TC_Call_Tag := 3;
- return -1.0;
- end Sine_Calc_Table;
-
-end C3A0001_0;
-
------------------------------------------------------------------------------
-
-with Report;
-with C3A0001_0;
-
-procedure C3A0001 is
-
- Sine_Access : C3A0001_0.Sine_Function_Ptr;
- X, Theta : Float := 0.0;
-
-begin
-
- Report.Test ("C3A0001", "Check that access to subprogram can be " &
- "used to select and invoke an operation with " &
- "appropriate arguments dynamically");
-
- Sine_Access := C3A0001_0.Sine_Calc_Fast'Access;
-
- -- Invoking Sine function designated by access value
- X := Sine_Access(Theta);
-
- If C3A0001_0.TC_Call_Tag /= 1 then
- Report.Failed ("Incorrect Sine_Calc_Fast result");
- end if;
-
- Sine_Access := C3A0001_0.Sine_Calc_Acc'Access;
-
- -- Invoking Sine function designated by access value
- X := Sine_Access(Theta);
-
- If C3A0001_0.TC_Call_Tag /= 2 then
- Report.Failed ("Incorrect Sine_Calc_Acc result");
- end if;
-
- Sine_Access := C3A0001_0.Sine_Calc_Table'Access;
-
- -- Invoking Sine function designated by access value
- X := Sine_Access(Theta);
-
- If C3A0001_0.TC_Call_Tag /= 3 then
- Report.Failed ("Incorrect Sine_Calc_Table result");
- end if;
-
- Report.Result;
-
-end C3A0001;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0002.a b/gcc/testsuite/ada/acats/tests/c3/c3a0002.a
deleted file mode 100644
index 5c05d43fb6a..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0002.a
+++ /dev/null
@@ -1,142 +0,0 @@
--- C3A0002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that access to subprogram type can be used to select and
--- invoke procedures with appropriate arguments dynamically.
---
--- TEST DESCRIPTION:
--- Declare an access to procedure type in a package specification.
--- Declare three different log procedures that can be referred to by
--- the access to procedure type.
---
--- In the main program, call each procedure indirectly by dereferencing
--- the access value.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 05 APR 96 SAIC RM reference change for 2.1
---
---
---!
-
-
-package C3A0002_0 is
-
- TC_Call_Tag : Natural := 0;
-
- Return_Num : Float := 0.0;
-
- -- Type accesses to any log procedure
- type Log_Procedure_Ptr is access procedure
- (Angle : in Float);
-
- procedure Log_Calc_Fast (Angle : in Float);
-
- procedure Log_Calc_Acc (Angle : in Float);
-
- procedure Log_Calc_Table (Angle : in Float);
-
-end C3A0002_0;
-
-
------------------------------------------------------------------------------
-
-
-package body C3A0002_0 is
-
- procedure Log_Calc_Fast (Angle : in Float) is
- begin
- TC_Call_Tag := 1;
- Return_Num := Angle;
- end Log_Calc_Fast;
-
-
- procedure Log_Calc_Acc (Angle : in Float) is
- begin
- TC_Call_Tag := 2;
- Return_Num := Angle;
- end Log_Calc_Acc;
-
-
- procedure Log_Calc_Table (Angle : in Float) is
- begin
- TC_Call_Tag := 3;
- Return_Num := Angle;
- end Log_Calc_Table;
-
-end C3A0002_0;
-
------------------------------------------------------------------------------
-
-with Report;
-with C3A0002_0;
-
-procedure C3A0002 is
-
- Log_Access : C3A0002_0.Log_Procedure_Ptr;
- Theta : Float := 0.0;
-
-begin
-
- Report.Test ("C3A0002", "Check that access to subprogram type can be "
- & "used to select and invoke procedures with "
- & "appropriate arguments dynamically" );
-
- Log_Access := C3A0002_0.Log_Calc_Fast'Access;
-
- -- Invoking Log procedure designated by access value
- Log_Access (Theta);
-
- If C3A0002_0.TC_Call_Tag /= 1 or C3A0002_0.Return_Num /= 0.0 then
- Report.Failed ("Incorrect Log_Calc_Fast result");
- end if;
-
- Theta := 1.0;
-
- Log_Access := C3A0002_0.Log_Calc_Acc'Access;
-
- -- Invoking Log procedure designated by access value
- Log_Access (Theta);
-
- If C3A0002_0.TC_Call_Tag /= 2 or C3A0002_0.Return_Num /= 1.0 then
- Report.Failed ("Incorrect Log_Calc_Acc result");
- end if;
-
- Theta := -1.0;
-
- Log_Access := C3A0002_0.Log_Calc_Table'Access;
-
- -- Invoking Log procedure designated by access value
- Log_Access (Theta);
-
- If C3A0002_0.TC_Call_Tag /= 3 or C3A0002_0.Return_Num /= -1.0 then
- Report.Failed ("Incorrect Log_Calc_Table result");
- end if;
-
- Report.Result;
-
-end C3A0002;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0003.a b/gcc/testsuite/ada/acats/tests/c3/c3a0003.a
deleted file mode 100644
index 4f9fdbe29f8..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0003.a
+++ /dev/null
@@ -1,144 +0,0 @@
--- C3A0003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a function in a generic instance can be called using
--- an access-to-subprogram value.
---
--- TEST DESCRIPTION:
--- Declare a numeric type in the visible part of a generic package.
--- Declare an access to function type. Declare three different sine
--- functions that can be referred to by the access to function type.
---
--- In the main program, instantiate the generic. Call each function
--- indirectly by dereferencing the access value.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-generic
- type Real_Num is digits <>;
-
-package C3A0003_0 is
-
- TC_Call_Tag : Natural := 0;
-
- -- Type accesses to any sine function
- type Sine_Function_Ptr is access function
- (Angle : in Real_Num) return Real_Num;
-
- function Sine_Calc_Fast (Angle : in Real_Num) return Real_Num;
-
- function Sine_Calc_Acc (Angle : in Real_Num) return Real_Num;
-
- function Sine_Calc_Table (Angle : in Real_Num) return Real_Num;
-
-end C3A0003_0;
-
-
------------------------------------------------------------------------------
-
-
-package body C3A0003_0 is
-
- function Sine_Calc_Fast (Angle : in Real_Num) return Real_Num is
- Sine_Num : Real_Num := 1.0;
- begin
- TC_Call_Tag := 1;
- return Sine_Num;
- end Sine_Calc_Fast;
-
-
- function Sine_Calc_Acc (Angle : in Real_Num) return Real_Num is
- Sine_Num : Real_Num := 0.0;
- begin
- TC_Call_Tag := 2;
- return Sine_Num;
- end Sine_Calc_Acc;
-
-
- function Sine_Calc_Table (Angle : in Real_Num) return Real_Num is
- Sine_Num : Real_Num := -1.0;
- begin
- TC_Call_Tag := 3;
- return Sine_Num;
- end Sine_Calc_Table;
-
-end C3A0003_0;
-
------------------------------------------------------------------------------
-
-with Report;
-with C3A0003_0;
-
-procedure C3A0003 is
-
- type Real is digits 5;
-
- Subtype Trig_Float is Real range -1.0 .. 1.0;
-
- package Trig is new C3A0003_0 (Real_Num => Trig_Float);
-
- Sine_Access : Trig.Sine_Function_Ptr;
- X, Theta : Trig_Float := 0.0;
-
-begin
-
- Report.Test ("C3A0003", "Check that a function in a generic instance can "
- & "be called using an access-to-subprogram value");
-
- Sine_Access := Trig.Sine_Calc_Fast'Access;
-
- -- Invoking Sine function designated by access value
- X := Sine_Access.all(Theta);
-
- If Trig.TC_Call_Tag /= 1 then
- Report.Failed ("Incorrect Sine_Calc_Fast result");
- end if;
-
- Sine_Access := Trig.Sine_Calc_Acc'Access;
-
- -- Invoking Sine function designated by access value
- X := Sine_Access.all(Theta);
-
- If Trig.TC_Call_Tag /= 2 then
- Report.Failed ("Incorrect Sine_Calc_Acc result");
- end if;
-
- Sine_Access := Trig.Sine_Calc_Table'Access;
-
- -- Invoking Sine function designated by access value
- X := Sine_Access.all(Theta);
-
- If Trig.TC_Call_Tag /= 3 then
- Report.Failed ("Incorrect Sine_Calc_Table result");
- end if;
-
- Report.Result;
-
-end C3A0003;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0004.a b/gcc/testsuite/ada/acats/tests/c3/c3a0004.a
deleted file mode 100644
index 2557546c2e4..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0004.a
+++ /dev/null
@@ -1,115 +0,0 @@
--- C3A0004.A
- --
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
- --
- -- OBJECTIVE:
- -- Check that access to subprogram may be stored within array
- -- objects, and that the access to subprogram can subsequently
- -- be called.
- --
- -- TEST DESCRIPTION:
- -- Declare an access to procedure type in a package specification.
- -- Declare an array of the access type. Declare three different
- -- procedures that can be referred to by the access to procedure type.
- --
- -- In the main program, build the array by dereferencing the access
- -- value.
- --
- --
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
- --!
-
- with Report;
-
- procedure C3A0004 is
-
- Left_Turn : Integer := 1;
-
- Right_Turn : Integer := 1;
-
- Center_Turn : Integer := 1;
-
- -- Type accesses to any procedure
- type Action_Ptr is access procedure;
-
- -- Array of access to procedure
- type Action_Array is array (Integer range <>) of Action_Ptr;
-
-
- procedure Rotate_Left is
- begin
- Left_Turn := 2;
- end Rotate_Left;
-
-
- procedure Rotate_Right is
- begin
- Right_Turn := 3;
- end Rotate_Right;
-
-
- procedure Center is
- begin
- Center_Turn := 0;
- end Center;
-
-
- begin
-
- Report.Test ("C3A0004", "Check that access to subprogram may be "
- & "stored within data structures, and that the "
- & "access to subprogram can subsequently be called");
-
- ------------------------------------------------------------------------
-
- declare
- Total_Actions : constant := 3;
- Action_Sequence : Action_Array (1 .. Total_Actions);
-
- begin
-
- -- Build the action sequence
- Action_Sequence := (Rotate_Left'Access, Center'Access,
- Rotate_Right'Access);
-
- -- Assign actions by invoking subprogram designated by access value
- for I in Action_Sequence'Range loop
- Action_Sequence(I).all;
- end loop;
-
- If Left_Turn /= 2 or Right_Turn /= 3
- or Center_Turn /= 0 then
- Report.Failed ("Incorrect Action sequence result");
- end if;
-
- end;
-
- ------------------------------------------------------------------------
-
- Report.Result;
-
- end C3A0004;
-
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0005.a b/gcc/testsuite/ada/acats/tests/c3/c3a0005.a
deleted file mode 100644
index 1f23689579f..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0005.a
+++ /dev/null
@@ -1,147 +0,0 @@
--- C3A0005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that access to subprogram may be stored within record
--- objects, and that the access to subprogram can subsequently
--- be called.
---
--- TEST DESCRIPTION:
--- Declare an access to procedure type in a package specification.
--- Declare two different procedures that can be referred to by the
--- access to procedure type. Declare a record with the access to
--- procedure type as a component. Use the access to procedure type to
--- initialize the component of a record.
---
--- In the main program, declare an operation. An access value
--- designating this operation is passed as a parameter to be
--- stored in the record.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C3A0005_0 is
-
- Default_Call : Boolean := False;
-
- type Button;
-
-
- -- Type accesses to procedures Push and Default_Response
- type Button_Response_Ptr is access procedure
- (B : access Button);
-
- procedure Push (B : access Button);
-
- procedure Set_Response (B : access Button;
- R : in Button_Response_Ptr);
-
- procedure Default_Response (B : access Button);
-
- Emergency_Call : Boolean := False;
-
- procedure Emergency (B : access C3A0005_0.Button);
-
- type Button is
- record
- Response : Button_Response_Ptr
- := Default_Response'Access;
- end record;
-
-end C3A0005_0;
-
-
------------------------------------------------------------------------------
-
-with TCTouch;
-package body C3A0005_0 is
-
- procedure Push (B : access Button) is
- begin
- TCTouch.Touch( 'P' ); --------------------------------------------- P
- -- Invoking subprogram designated by access value
- B.Response (B);
- end Push;
-
-
- procedure Set_Response (B : access Button;
- R : in Button_Response_Ptr) is
- begin
- TCTouch.Touch( 'S' ); --------------------------------------------- S
- -- Set procedure value in record
- B.Response := R;
- end Set_Response;
-
-
- procedure Default_Response (B : access Button) is
- begin
- TCTouch.Touch( 'D' ); --------------------------------------------- D
- Default_Call := True;
- end Default_Response;
-
-
- procedure Emergency (B : access C3A0005_0.Button) is
- begin
- TCTouch.Touch( 'E' ); --------------------------------------------- E
- Emergency_Call := True;
- end Emergency;
-
-end C3A0005_0;
-
-
------------------------------------------------------------------------------
-
-with TCTouch;
-with Report;
-
-with C3A0005_0;
-
-procedure C3A0005 is
-
- Big_Red_Button : aliased C3A0005_0.Button;
-
-begin
-
- Report.Test ("C3A0005", "Check that access to subprogram may be "
- & "stored within data structures, and that the "
- & "access to subprogram can subsequently be called");
-
- C3A0005_0.Push (Big_Red_Button'Access);
- TCTouch.Validate("PD", "Using default value");
- TCTouch.Assert( C3A0005_0.Default_Call, "Default Call" );
-
- -- set Emergency value in Button.Response
- C3A0005_0.Set_Response(Big_Red_Button'Access, C3A0005_0.Emergency'Access);
-
- C3A0005_0.Push (Big_Red_Button'Access);
- TCTouch.Validate("SPE", "After set to Emergency value");
- TCTouch.Assert( C3A0005_0.Emergency_Call, "Emergency Call");
-
- Report.Result;
-
-end C3A0005;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0006.a b/gcc/testsuite/ada/acats/tests/c3/c3a0006.a
deleted file mode 100644
index effab346581..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0006.a
+++ /dev/null
@@ -1,163 +0,0 @@
--- C3A0006.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that access to subprogram may be stored within data
--- structures, and that the access to subprogram can subsequently
--- be called.
---
--- TEST DESCRIPTION:
--- Declare an access to function type in a package specification.
--- Declare an array of the access type. Declare three different
--- functions that can be referred to by the access to function type.
---
--- In the main program, declare a key function that builds the array
--- by calling each function indirectly through the access value.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-package C3A0006_0 is
-
- TC_Sine_Call : Integer := 0;
- TC_Cos_Call : Integer := 0;
- TC_Tan_Call : Integer := 0;
-
- Sine_Value : Float := 4.0;
- Cos_Value : Float := 8.0;
- Tan_Value : Float := 10.0;
-
- -- Type accesses to any function
- type Trig_Function_Ptr is access function
- (Angle : in Float) return Float;
-
- function Sine (Angle : in Float) return Float;
-
- function Cos (Angle : in Float) return Float;
-
- function Tan (Angle : in Float) return Float;
-
-end C3A0006_0;
-
-
------------------------------------------------------------------------------
-
-
-package body C3A0006_0 is
-
- function Sine (Angle : in Float) return Float is
- begin
- TC_Sine_Call := TC_Sine_Call + 1;
- Sine_Value := Sine_Value + Angle;
- return Sine_Value;
- end Sine;
-
-
- function Cos (Angle: in Float) return Float is
- begin
- TC_Cos_Call := TC_Cos_Call + 1;
- Cos_Value := Cos_Value - Angle;
- return Cos_Value;
- end Cos;
-
-
- function Tan (Angle : in Float) return Float is
- begin
- TC_Tan_Call := TC_Tan_Call + 1;
- Tan_Value := (Tan_Value + (Tan_Value * Angle));
- return Tan_Value;
- end Tan;
-
-
-end C3A0006_0;
-
------------------------------------------------------------------------------
-
-
-with Report;
-
-with C3A0006_0;
-
-procedure C3A0006 is
-
- Trig_Value, Theta : Float := 0.0;
-
- Total_Routines : constant := 3;
-
- Sine_Total : constant := 7.0;
- Cos_Total : constant := 5.0;
- Tan_Total : constant := 75.0;
-
- Trig_Table : array (1 .. Total_Routines) of C3A0006_0.Trig_Function_Ptr;
-
-
- -- Key function to build the table
- function Call_Trig_Func (Func : C3A0006_0.Trig_Function_Ptr;
- Operand : Float) return Float is
- begin
- return (Func(Operand));
- end Call_Trig_Func;
-
-
-begin
-
- Report.Test ("C3A0006", "Check that access to subprogram may be " &
- "stored within data structures, and that the access " &
- "to subprogram can subsequently be called");
-
- Trig_Table := (C3A0006_0.Sine'Access, C3A0006_0.Cos'Access,
- C3A0006_0.Tan'Access);
-
- -- increase the value of Theta to build the table
- for I in 1 .. Total_Routines loop
- Theta := Theta + 0.5;
- for J in 1 .. Total_Routines loop
- Trig_Value := Call_Trig_Func (Trig_Table(J), Theta);
- end loop;
- end loop;
-
- if C3A0006_0.TC_Sine_Call /= Total_Routines
- or C3A0006_0.TC_Cos_Call /= Total_Routines
- or C3A0006_0.TC_Tan_Call /= Total_Routines then
- Report.Failed ("Incorrect subprograms result");
- end if;
-
- if C3A0006_0.Sine_Value /= Sine_Total
- or C3A0006_0.Cos_Value /= Cos_Total
- or C3A0006_0.Tan_Value /= Tan_Total then
- Report.Failed ("Incorrect values returned from subprograms");
- end if;
-
- if Trig_Value /= Tan_Total then
- Report.Failed ("Incorrect call order.");
- end if;
-
- Report.Result;
-
-end C3A0006;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0007.a b/gcc/testsuite/ada/acats/tests/c3/c3a0007.a
deleted file mode 100644
index ff18d2f9e1d..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0007.a
+++ /dev/null
@@ -1,234 +0,0 @@
--- C3A0007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a call to a subprogram via an access-to-subprogram value
--- stored in a data structure will correctly dispatch according to the
--- tag of the class-wide parameter passed via that call.
---
--- TEST DESCRIPTION:
--- Declare an access to procedure type in a package specification.
--- Declare a root tagged type with the access to procedure type as a
--- component. Declare three primitive procedures for the type that
--- can be referred to by the access to procedure type. Use the access
--- to procedure type to initialize the component of a record.
---
--- Extend the root type with a record extension in another package
--- specification. Declare a new primitive procedure for the extension
--- (in addition to its three inherited subprograms).
---
--- In the main program, declare an operation for the root tagged type
--- which can be passed as an access value to change the initial value
--- of the component. Call the inherited operation indirectly by
--- dereferencing the access value to check on the initial value of the
--- extension. Call inherited operations indirectly by dereferencing
--- the access value to replace the initial value. Call the primitive
--- procedure indirectly by dereferencing the access value to modify the
--- extension.
---
--- type Button
--- procedure Push(Button)
--- procedure Set_Response(Button,Button_Response_Ptr)
--- procedure Default_Response(Button)
---
--- type Priority_Button (new Button)
--- procedures Push, Set_Response inherited
--- procedure Default_Response
--- procedure Set_Priority
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C3A0007_0 is
-
- Default_Call : Boolean := False;
-
- type Button is tagged private;
-
- type Button_Response_Ptr is access procedure
- (B : in out Button'Class);
-
- procedure Push (B : in out Button); -- to be inherited
-
- procedure Set_Response (B : in out Button; -- to be inherited
- R : in Button_Response_Ptr);
-
- procedure Response (B : in out Button); -- to be inherited
-
-private
- procedure Default_Response(B: in out Button'Class);
- type Button is tagged -- root tagged type
- record
- Action : Button_Response_Ptr
- := Default_Response'Access;
- end record;
-end C3A0007_0;
-
-with C3A0007_0;
-package C3A0007_1 is
-
- type Priority_Button is new C3A0007_0.Button
- with record
- Priority : Integer := 0;
- end record;
-
- -- Inherits procedure Push from Button
- -- Inherits procedure Set_Response from Button
-
- -- Override procedure Response from Button
- procedure Response (B : in out Priority_Button);
-
- -- Primitive operation of the extension
- procedure Set_Priority (B : in out Priority_Button);
-
-end C3A0007_1;
-
-with C3A0007_0;
-package C3A0007_2 is
-
- Emergency_Call : Boolean := False;
-
- procedure Emergency (B : in out C3A0007_0.Button'Class);
-end C3A0007_2;
-
------------------------------------------------------------------------------
-
-with TCTouch;
-package body C3A0007_0 is
-
- procedure Push (B : in out Button) is
- begin
- TCTouch.Touch( 'P' ); --------------------------------------------- P
- -- Invoking subprogram designated by access value
- B.Action (B);
- end Push;
-
-
- procedure Set_Response (B : in out Button;
- R : in Button_Response_Ptr) is
- begin
- TCTouch.Touch( 'S' ); --------------------------------------------- S
- -- Set procedure value in record
- B.Action := R;
- end Set_Response;
-
-
- procedure Response (B : in out Button) is
- begin
- TCTouch.Touch( 'D' ); --------------------------------------------- D
- Default_Call := True;
- end Response;
-
- procedure Default_Response (B : in out Button'Class) is
- begin
- TCTouch.Touch( 'C' ); --------------------------------------------- C
- Response(B);
- end Default_Response;
-
-end C3A0007_0;
-
-with TCTouch;
-package body C3A0007_1 is
-
- procedure Set_Priority (B : in out Priority_Button) is
- begin
- TCTouch.Touch( 's' ); --------------------------------------------- s
- B.Priority := 1;
- end Set_Priority;
-
- procedure Response (B : in out Priority_Button) is
- begin
- TCTouch.Touch( 'd' ); --------------------------------------------- d
- end Response;
-
-end C3A0007_1;
-
-with TCTouch;
-package body C3A0007_2 is
- procedure Emergency (B : in out C3A0007_0.Button'Class) is
- begin
- TCTouch.Touch( 'E' ); ------------------------------------------- E
- Emergency_Call := True;
- end Emergency;
-end C3A0007_2;
-
------------------------------------------------------------------------------
-
-with Report;
-with TCTouch;
-
-with C3A0007_0;
-with C3A0007_1;
-with C3A0007_2;
-procedure C3A0007 is
-
- Pink_Button : C3A0007_0.Button;
- Green_Button : C3A0007_1.Priority_Button;
-
-begin
-
- Report.Test ("C3A0007", "Check that a call to a subprogram via an "
- & "access-to-subprogram value stored in a data "
- & "structure will correctly dispatch according to "
- & "the tag of the class-wide parameter passed "
- & "via that call" );
-
- -- Call inherited operation Push to set Default_Response value
- -- in the extension.
-
- C3A0007_1.Push (Green_Button);
- TCTouch.Validate("PCd", "First Green Button Push");
-
- TCTouch.Assert_Not(C3A0007_0.Default_Call,
- "Incorrect Green Default_Response");
-
- C3A0007_0.Push (Pink_Button);
- TCTouch.Validate("PCD", "First Pink Button Push");
-
- -- Call inherited operations Set_Response and Push to set
- -- Emergency value in the extension.
- C3A0007_1.Set_Response (Green_Button, C3A0007_2.Emergency'Access);
- C3A0007_1.Push (Green_Button);
- TCTouch.Validate("SPE", "Second Green Button Push");
-
- TCTouch.Assert(C3A0007_2.Emergency_Call, "Incorrect Green Emergency");
-
- C3A0007_0.Set_Response (Pink_Button, C3A0007_2.Emergency'Access);
- C3A0007_0.Push (Pink_Button);
- TCTouch.Validate("SPE", "Second Pink Button Push");
-
- -- Call primitive operation to set priority value
- -- in the extension.
- C3A0007_1.Set_Priority (Green_Button);
- TCTouch.Validate("s", "Green Button Priority");
-
- TCTouch.Assert(Green_Button.Priority = 1, "Incorrect Set_Priority");
-
- Report.Result;
-
-end C3A0007;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0008.a b/gcc/testsuite/ada/acats/tests/c3/c3a0008.a
deleted file mode 100644
index 6cd9ce3ddf0..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0008.a
+++ /dev/null
@@ -1,150 +0,0 @@
--- C3A0008.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that subprogram references may be passed as parameters using
--- access-to-subprogram types. Check that the passed subprograms may
--- be invoked from within the called subprogram.
---
--- TEST DESCRIPTION:
--- Declare an access to function type in a package specification.
--- Declare three different trig functions that can be referred to by
--- the access to function type.
---
--- In the main program, call each function indirectly by passing the
--- access to subprogram value as parameter.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-package Integrate_Lookup is
-
- TC_Log_Call : Boolean := False;
-
- TC_Cos_Call : Boolean := False;
-
- TC_Sine_Call : Boolean := False;
-
- -- Type accesses to functions Log, Sine, or Cos
- type Integrand_Ptr is access function
- (Angle : Float) return Float;
-
- function Log (Angle : in Float) return Float;
-
- function Sine (Angle : in Float) return Float;
-
- function Cos (Angle : in Float) return Float;
-
- function Integrate (Func : Integrand_Ptr; From, To: Float)
- return Float;
-
-end Integrate_Lookup;
-
-
------------------------------------------------------------------------------
-
-
-package body Integrate_Lookup is
-
-
- function Log (Angle : in Float) return Float is
- begin
- TC_Log_Call := True;
- return 0.1;
- end Log;
-
-
- function Sine (Angle : in Float) return Float is
- begin
- TC_Sine_Call := True;
- return 0.0;
- end Sine;
-
-
- function Cos (Angle : in Float) return Float is
- begin
- TC_Cos_Call := True;
- return 1.0;
- end Cos;
-
-
- function Integrate (Func : Integrand_Ptr; From, To: Float)
- return Float is
- Theta : Float;
- begin
- -- calls the actual subprogram passed as parameter
- Theta := Func (From) + Func (To);
- return Theta;
- end Integrate;
-
-end Integrate_Lookup;
-
-
------------------------------------------------------------------------------
-
-
-with Report;
-
-with Integrate_Lookup;
-
-procedure C3A0008 is
-
- Area : Float := 0.0;
-
-begin
-
- Report.Test ("C3A0008", "Check that subprogram references may be passed "
- & "as parameters using access-to-subprogram types. "
- & "Check that the passed subprograms may be invoked "
- & "from within the called subprogram");
-
- Area := Integrate_Lookup.Integrate
- (Integrate_Lookup.Log'Access, 1.0, 2.0);
-
- If not Integrate_Lookup.TC_Log_Call or Area /= 0.2 then
- Report.Failed ("Incorrect Log result");
- end if;
-
- Area := Integrate_Lookup.Integrate
- (Integrate_Lookup.Sine'Access, 1.0, 2.0);
-
- If not Integrate_Lookup.TC_Sine_Call or Area /= 0.0 then
- Report.Failed ("Incorrect Sine result");
- end if;
-
- Area := Integrate_Lookup.Integrate
- (Integrate_Lookup.Cos'Access, 1.0, 2.0);
-
- If not Integrate_Lookup.TC_Cos_Call or Area /= 2.0 then
- Report.Failed ("Incorrect Cos result");
- end if;
-
- Report.Result;
-
-end C3A0008;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0009.a b/gcc/testsuite/ada/acats/tests/c3/c3a0009.a
deleted file mode 100644
index ba3f2f6e1e7..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0009.a
+++ /dev/null
@@ -1,219 +0,0 @@
--- C3A0009.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that subprogram references may be passed as parameters using
--- access-to-subprogram types. Check that the passed subprograms may
--- be invoked from within the called subprogram.
---
--- TEST DESCRIPTION:
--- Declare an access to procedure type in a package specification.
--- Declare a root tagged type with the access to procedure type as a
--- component. Declare three primitive procedures for the type that
--- can be referred to by the access to procedure type. Use the access
--- to procedure type to initialize the component of a record.
---
--- Extend the root type with a private extension in the same package
--- specification. Declare two new primitive subprograms for the extension
--- (in addition to its three inherited subprograms).
---
--- In the main program, declare an operation for the root tagged type
--- which can be passed as an access value to change the initial value
--- of the component. Call the inherited operations indirectly by
--- de-referencing the access value to set value in the extension.
--- Call the primitive function to modify the extension by passing
--- the access value designating the primitive procedure as a parameter.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C3A0009_0 is -- Push_Buttons
-
- type Button is tagged private;
-
- -- Type accesses to procedures Push and Default_Response
- type Button_Response_Ptr is access procedure
- (B : in out Button);
-
- procedure Push (B : in out Button); -- to be inherited
-
- procedure Set_Response (B : in out Button; -- to be inherited
- R : in Button_Response_Ptr);
-
- procedure Default_Response (B : in out Button); -- to be inherited
-
- type Alert_Button is new Button with private; -- private extension of
- -- root tagged type
- -- Inherits procedure Push from Button
- -- Inherits procedure Set_Response from Button
- -- Inherits procedure Default_Response from Button
-
- procedure Replace_Action( B: in out Alert_Button );
-
- -- type accesses to procedure Default_Action
- type Button_Action_Ptr is access procedure;
-
- -- The following function is needed to set value in the
- -- extension's private component.
- function Alert (B : in Alert_Button) return Button_Action_Ptr;
-
-private
-
- type Button is tagged -- root tagged type
- record
- Response : Button_Response_Ptr
- := Default_Response'Access;
- end record;
-
- procedure Default_Action;
-
- type Alert_Button is new Button with record
- Action : Button_Action_Ptr
- := Default_Action'Access;
- end record;
-
-end C3A0009_0;
-
-
------------------------------------------------------------------------------
-
-
-with TCTouch;
-package body C3A0009_0 is
-
- procedure Push (B : in out Button) is
- begin
- TCTouch.Touch( 'P' ); --------------------------------------------- P
- -- Invoking subprogram designated by access value
- B.Response (B);
- end Push;
-
-
- procedure Set_Response (B : in out Button;
- R : in Button_Response_Ptr) is
- begin
- TCTouch.Touch( 'S' ); --------------------------------------------- S
- -- Set procedure value in record
- B.Response := R;
- end Set_Response;
-
-
- procedure Default_Response (B : in out Button) is
- begin
- TCTouch.Touch( 'D' ); --------------------------------------------- D
- end Default_Response;
-
-
- procedure Default_Action is
- begin
- TCTouch.Touch( 'd' ); --------------------------------------------- d
- end Default_Action;
-
- procedure Replacement_Action is
- begin
- TCTouch.Touch( 'r' ); --------------------------------------------- r
- end Replacement_Action;
-
- procedure Replace_Action( B: in out Alert_Button ) is
- begin
- TCTouch.Touch( 'R' ); --------------------------------------------- R
- B.Action := Replacement_Action'Access;
- end Replace_Action;
-
- function Alert (B : in Alert_Button) return Button_Action_Ptr is
- begin
- TCTouch.Touch( 'A' ); --------------------------------------------- A
- return (B.Action);
- end Alert;
-
-end C3A0009_0;
-
------------------------------------------------------------------------------
-
-with C3A0009_0;
-package C3A0009_1 is -- Emergency_Items
- package Push_Buttons renames C3A0009_0;
-
- procedure Emergency (B : in out Push_Buttons.Button);
-end C3A0009_1;
-
-with TCTouch;
-package body C3A0009_1 is -- Emergency_Items
- procedure Emergency (B : in out Push_Buttons.Button) is
- begin
- TCTouch.Touch( 'E' ); ------------------------------------------- E
- end Emergency;
-end C3A0009_1;
------------------------------------------------------------------------------
-
-with Report;
-
-with C3A0009_0, C3A0009_1;
-with TCTouch;
-procedure C3A0009 is
-
- package Push_Buttons renames C3A0009_0;
- package Emergency_Items renames C3A0009_1;
-
- Black_Button : Push_Buttons.Alert_Button;
- Alert_Ptr : Push_Buttons.Button_Action_Ptr;
-
-begin
-
- Report.Test ("C3A0009", "Check that subprogram references may be passed "
- & "as parameters using access-to-subprogram types. "
- & "Check that the passed subprograms may be "
- & "invoked from within the called subprogram");
-
-
- Push_Buttons.Push( Black_Button );
- Push_Buttons.Alert( Black_Button ).all;
-
- TCTouch.Validate( "PDAd", "Default operation set" );
-
- -- Call inherited operations Set_Response and Push to set
- -- Emergency value in the extension.
- Push_Buttons.Set_Response (Black_Button, Emergency_Items.Emergency'Access);
-
-
- Push_Buttons.Push( Black_Button );
- Push_Buttons.Alert( Black_Button ).all;
-
- TCTouch.Validate( "SPEAd", "Altered Response set" );
-
- -- Call primitive operation to set action value in the extension.
- Push_Buttons.Replace_Action( Black_Button );
-
-
- Push_Buttons.Push( Black_Button );
- Push_Buttons.Alert( Black_Button ).all;
-
- TCTouch.Validate( "RPEAr", "Altered Action set" );
-
- Report.Result;
-end C3A0009;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0010.a b/gcc/testsuite/ada/acats/tests/c3/c3a0010.a
deleted file mode 100644
index 5628c9518de..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0010.a
+++ /dev/null
@@ -1,158 +0,0 @@
--- C3A0010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an access-to-subprogram type in a generic instance may be
--- used to declare access-to-subprogram objects which invoke subprograms
--- in the instance.
---
--- TEST DESCRIPTION:
--- Declare a numeric type in the visible part of a generic package.
--- Declare two different math procedures that can be referred to by
--- the access to procedure type.
---
--- In the main program, instantiate the generic. Declare an access
--- to procedure type. Call each procedure indirectly by dereferencing
--- the access value.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 05 APR 96 SAIC Header correction for 2.1
---
---!
-
-generic
- type Real_Num is digits <>;
-
-package C3A0010_0 is
-
- -- Type accesses to any math procedure
- type Math_Procedure_Ptr is access procedure
- (First_Num, Second_Num : in Real_Num;
- Result_Num : out Real_Num);
-
- procedure Add (First_Num, Second_Num : in Real_Num;
- Result_Num : out Real_Num);
-
- procedure Subtract (First_Num, Second_Num : in Real_Num;
- Result_Num : out Real_Num);
-
-end C3A0010_0;
-
-
------------------------------------------------------------------------------
-
-
-package body C3A0010_0 is
-
- procedure Add (First_Num, Second_Num : in Real_Num;
- Result_Num : out Real_Num) is
- begin
- Result_Num := First_Num + Second_Num;
- end Add;
-
-
- procedure Subtract (First_Num, Second_Num : in Real_Num;
- Result_Num : out Real_Num) is
- begin
- Result_Num := First_Num - Second_Num;
- end Subtract;
-
-end C3A0010_0;
-
------------------------------------------------------------------------------
-
-with Report;
-with C3A0010_0;
-
-procedure C3A0010 is
-
- type Real is digits 2;
-
- subtype Math_Float is Real range -10.0 .. 10.0;
-
- package Math_Pk is new C3A0010_0 (Real_Num => Math_Float);
-
- Math_Access : Math_Pk.Math_Procedure_Ptr;
-
- Total_Num : Math_Float := 0.0;
- First_Num : Math_Float := 1.0;
- Second_Num : Math_Float := 2.0;
-
- procedure Max( A_Num, B_Num: in Math_Float; Result : out Math_Float ) is
- begin
- if A_Num > B_Num then
- Result := A_Num;
- else
- Result := B_Num;
- end if;
- end Max;
-
- procedure Due_Process( Process: Math_Pk.Math_Procedure_Ptr ) is
- begin
- Process(First_Num, Second_Num, Total_Num);
- end Due_Process;
-
-begin
-
- Report.Test ("C3A0010", "Check that an access-to-subprogram type in a "
- & "generic instance may be used to declare "
- & "access-to-subprogram objects which invoke "
- & "subprograms in the instance");
-
--- Check for correct defaulting
- if Math_Pk."/="( Math_Access, null) then
- Report.Failed("subprogram access type object not initialized to null");
- end if;
-
- Math_Access := Math_Pk.Add'Access;
-
- -- Invoking Add procedure designated by access value
- Due_Process( Math_Access );
-
- If Total_Num /= 3.0 then
- Report.Failed ("Incorrect Add result");
- end if;
-
- Math_Access := Math_Pk.Subtract'Access;
-
- Due_Process( Math_Access );
-
- If Total_Num /= -1.0 then
- Report.Failed ("Incorrect Subtract result");
- end if;
-
- Math_Access := Max'Access;
-
- Due_Process( Math_Access );
-
- If Total_Num /= 2.0 then
- Report.Failed ("Incorrect Max result");
- end if;
-
- Report.Result;
-
-end C3A0010;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0011.a b/gcc/testsuite/ada/acats/tests/c3/c3a0011.a
deleted file mode 100644
index 985080659a1..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0011.a
+++ /dev/null
@@ -1,186 +0,0 @@
--- C3A0011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an access-to-subprogram object whose type is declared in a
--- parent package, may be used to invoke subprograms in a child package.
--- Check that such access objects may be stored in a data structure and
--- that subprograms may be called by walking the data structure.
---
--- TEST DESCRIPTION:
--- In the package, declare an access to procedure type. Declare an
--- array of the access type. Declare three different procedures that
--- can be referred to by the access to procedure type.
---
--- In the visible child package, declare two procedures that can be
--- referred to by the access to procedure type of the parent. Build
--- the array by calling each procedure indirectly through the access
--- value.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 16 Dec 94 SAIC Improved visibility of "/=" in main body
---
---!
-
-package C3A0011_0 is -- Interpreter
-
- type Compass_Point is mod 360;
-
- function Heading return Compass_Point;
-
- -- Type accesses to any procedure
- type Action_Ptr is access procedure;
-
- -- Array of access to procedure
- type Action_Array is array (Natural range <>) of Action_Ptr;
-
- procedure Rotate_Left;
-
- procedure Rotate_Right;
-
- procedure Center;
-
-private
- The_Heading : Compass_Point := Compass_Point'First;
-
-end C3A0011_0;
-
-
------------------------------------------------------------------------------
-
-
-package body C3A0011_0 is
-
- function Heading return Compass_Point is
- begin
- return The_Heading;
- end Heading;
-
- procedure Rotate_Left is
- begin
- The_Heading := The_Heading - 90;
- end Rotate_Left;
-
-
- procedure Rotate_Right is
- begin
- The_Heading := The_Heading + 90;
- end Rotate_Right;
-
-
- procedure Center is
- begin
- The_Heading := 0;
- end Center;
-
-end C3A0011_0;
-
-
------------------------------------------------------------------------------
-
-
-package C3A0011_0.Action is
-
- procedure Rotate_Front;
-
- procedure Rotate_Back;
-
-end C3A0011_0.Action;
-
-
------------------------------------------------------------------------------
-
-
-package body C3A0011_0.Action is
-
- procedure Rotate_Front is
- begin
- The_Heading := The_Heading + 5;
- end Rotate_Front;
-
-
- procedure Rotate_Back is
- begin
- The_Heading := The_Heading - 5;
- end Rotate_Back;
-
-end C3A0011_0.Action;
-
-
------------------------------------------------------------------------------
-
-
-with C3A0011_0.Action;
-
-with Report;
-
-procedure C3A0011 is
-
- Total_Actions : constant := 6;
-
- Action_Sequence : C3A0011_0.Action_Array (1 .. Total_Actions);
-
- type Result_Array is array (Natural range <>) of C3A0011_0.Compass_Point;
-
- Action_Results : Result_Array(1 .. Total_Actions);
-
- package IA renames C3A0011_0.Action;
-
-begin
-
- Report.Test ("C3A0011", "Check that an access-to-subprogram object whose "
- & "type is declared in a parent package, may be "
- & "used to invoke subprograms in a child package. "
- & "Check that such access objects may be stored in "
- & "a data structure and that subprograms may be "
- & "called by walking the data structure");
-
- -- Build the action sequence
- Action_Sequence := (C3A0011_0.Rotate_Left'Access,
- C3A0011_0.Center'Access,
- C3A0011_0.Rotate_Right'Access,
- IA.Rotate_Front'Access,
- C3A0011_0.Center'Access,
- IA.Rotate_Back'Access);
-
- -- Build the expected result
- Action_Results := ( 270, 0, 90, 95, 0, 355 );
-
- -- Assign actions by invoking subprogram designated by access value
- for I in Action_Sequence'Range loop
- Action_Sequence(I).all;
- if C3A0011_0."/="( C3A0011_0.Heading, Action_Results(I) ) then
- Report.Failed ("Expecting "
- & C3A0011_0.Compass_Point'Image(Action_Results(I))
- & " Got"
- & C3A0011_0.Compass_Point'Image(C3A0011_0.Heading));
- end if;
- end loop;
-
- Report.Result;
-
-end C3A0011;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a00120.a b/gcc/testsuite/ada/acats/tests/c3/c3a00120.a
deleted file mode 100644
index 5ce7b6175d5..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a00120.a
+++ /dev/null
@@ -1,83 +0,0 @@
--- C3A00120.A
- --
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
- --
- -- OBJECTIVE:
- -- See file C3A00122.AM
- --
- -- TEST DESCRIPTION:
- -- See file C3A00122.AM
- --
- -- TEST FILES:
- -- The following files comprise this test:
- --
- -- => C3A00120.A
- -- C3A00121.A
- -- C3A00122.AM
- --
- --
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
- --!
-
- package C3A0012_0 is
-
- type Call_Kind is (No_Call_Made, Fast_Call, Accurate_Call,
- Table_Lookup_Call);
-
- Log_Result : Float := 0.0;
-
- -- Type accesses to any log procedure
- type Log_Procedure_Ptr is access procedure
- (Angle : in Float; Log_Call : out Call_Kind);
-
- procedure Log_Calc_Fast (Angle : in Float;
- Method : out Call_Kind);
-
- procedure Log_Calc_Acc (Angle : in Float;
- Method : out Call_Kind);
-
- procedure Log_Calc_Table (Angle : in Float;
- Method : out Call_Kind);
-
- end C3A0012_0;
-
-
- --=======================================================================--
-
-
- package body C3A0012_0 is
-
- procedure Log_Calc_Fast (Angle : in Float;
- Method : out Call_Kind) is separate;
-
- procedure Log_Calc_Acc (Angle : in Float;
- Method : out Call_Kind) is separate;
-
- procedure Log_Calc_Table (Angle : in Float;
- Method : out Call_Kind) is separate;
-
- end C3A0012_0;
-
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a00121.a b/gcc/testsuite/ada/acats/tests/c3/c3a00121.a
deleted file mode 100644
index acb1dab99aa..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a00121.a
+++ /dev/null
@@ -1,76 +0,0 @@
--- C3A00121.A
- --
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
- --
- -- OBJECTIVE:
- -- See file C3A00122.AM
- --
- -- TEST DESCRIPTION:
- -- See file C3A00122.AM
- --
- -- TEST FILES:
- -- The following files comprise this test:
- --
- -- C3A00120.A
- -- => C3A00121.A
- -- C3A00122.AM
- --
- --
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
- --!
-
- Separate (C3A0012_0)
- procedure Log_Calc_Fast (Angle : in Float;
- Method : out Call_Kind) is
- begin
- C3A0012_0.Log_Result := Angle;
- Method := Fast_Call;
- end Log_Calc_Fast;
-
-
- --=======================================================================--
-
-
- Separate (C3A0012_0)
- procedure Log_Calc_Acc (Angle : in Float;
- Method : out Call_Kind) is
- begin
- C3A0012_0.Log_Result := Angle;
- Method := Accurate_Call;
- end Log_Calc_Acc;
-
-
- --=======================================================================--
-
-
- Separate (C3A0012_0)
- procedure Log_Calc_Table (Angle : in Float;
- Method : out Call_Kind) is
- begin
- C3A0012_0.Log_Result := Angle;
- Method := Table_Lookup_Call;
- end Log_Calc_Table;
-
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0013.a b/gcc/testsuite/ada/acats/tests/c3/c3a0013.a
deleted file mode 100644
index b23d4ee1151..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0013.a
+++ /dev/null
@@ -1,347 +0,0 @@
--- C3A0013.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a general access type object may reference allocated
--- pool objects as well as aliased objects. (3,4)
--- Check that formal parameters of tagged types are implicitly
--- defined as aliased; check that the 'Access of these formal
--- parameters designates the correct object with the correct
--- tag. (5)
--- Check that the current instance of a limited type is defined as
--- aliased. (5)
---
--- TEST DESCRIPTION:
--- This test takes from the hierarchy defined in C390003; making
--- the root type Vehicle limited private. It also shifts the
--- abstraction to include the notion of a transmission, an object
--- which is contained within any vehicle. Using an access
--- discriminant, any subprogram which operates on a transmission
--- may also reference the vehicle in which it is installed.
---
--- Class Hierarchy:
--- Vehicle Transmission
--- / \
--- Truck Car
---
--- Contains:
--- Vehicle( Transmission )
---
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 16 Dec 94 SAIC Fixed accessibility problems
---
---!
-
-package C3A0013_1 is
- type Vehicle is tagged limited private;
- type Vehicle_ID is access all Vehicle'Class;
-
- -- Constructors
- procedure Create ( It : in out Vehicle;
- Wheels : Natural := 4 );
- -- Modifiers
- procedure Accelerate ( It : in out Vehicle );
- procedure Decelerate ( It : in out Vehicle );
- procedure Up_Shift ( It : in out Vehicle );
- procedure Stop ( It : in out Vehicle );
-
- -- Selectors
- function Speed ( It : Vehicle ) return Natural;
- function Wheels ( It : Vehicle ) return Natural;
- function Gear_Factor( It : Vehicle ) return Natural;
-
- -- TC_Ops
- procedure TC_Validate( It : in out Vehicle; Speed_Trap : Natural );
-
- -- dispatching procedure used to check tag correctness
- procedure TC_Validate( It : Vehicle;
- TC_ID : Character);
-
-private
-
- type Transmission(Within: access Vehicle'Class) is limited record
- Engaged : Boolean := False;
- Gear : Integer range -1..5 := 0;
- end record;
-
- -- Current instance of a limited type is defined as aliased
-
- type Vehicle is tagged limited record
- Wheels: Natural;
- Speed : Natural;
- Power_Train: Transmission( Vehicle'Access );
- end record;
-end C3A0013_1;
-
-with C3A0013_1;
-package C3A0013_2 is
- type Car is new C3A0013_1.Vehicle with private;
- procedure TC_Validate( It : Car;
- TC_ID : Character);
- function Gear_Factor( It : Car ) return Natural;
-private
- type Car is new C3A0013_1.Vehicle with record
- Displacement : Natural;
- end record;
-end C3A0013_2;
-
-with C3A0013_1;
-package C3A0013_3 is
- type Truck is new C3A0013_1.Vehicle with private;
- procedure TC_Validate( It : Truck;
- TC_ID : Character);
- function Gear_Factor( It : Truck ) return Natural;
-private
- type Truck is new C3A0013_1.Vehicle with record
- Displacement : Natural;
- end record;
-end C3A0013_3;
-
-with Report;
-package body C3A0013_1 is
-
- procedure Create ( It : in out Vehicle;
- Wheels : Natural := 4 ) is
- begin
- It.Wheels := Wheels;
- It.Speed := 0;
- end Create;
-
- procedure Accelerate( It : in out Vehicle ) is
- begin
- It.Speed := It.Speed + Gear_Factor( It.Power_Train.Within.all );
- end Accelerate;
-
- procedure Decelerate( It : in out Vehicle ) is
- begin
- It.Speed := It.Speed - Gear_Factor( It.Power_Train.Within.all );
- end Decelerate;
-
- procedure Stop ( It : in out Vehicle ) is
- begin
- It.Speed := 0;
- It.Power_Train.Engaged := False;
- end Stop;
-
- function Gear_Factor( It : Vehicle ) return Natural is
- begin
- return It.Power_Train.Gear;
- end Gear_Factor;
-
- function Speed ( It : Vehicle ) return Natural is
- begin
- return It.Speed;
- end Speed;
-
- function Wheels ( It : Vehicle ) return Natural is
- begin
- return It.Wheels;
- end Wheels;
-
- -- formal tagged parameters are implicitly aliased
-
- procedure TC_Validate( It : in out Vehicle; Speed_Trap : Natural ) is
- License: Vehicle_ID := It'Unchecked_Access;
- begin
- if Speed( License.all ) /= Speed_Trap then
- Report.Failed("Speed Trap: expected: " & Natural'Image(Speed_Trap));
- end if;
- end TC_Validate;
-
- procedure TC_Validate( It : Vehicle;
- TC_ID : Character) is
- begin
- if TC_ID /= 'V' then
- Report.Failed("Dispatched to Vehicle");
- end if;
- if Wheels( It ) /= 1 then
- Report.Failed("Not a Vehicle");
- end if;
- end TC_Validate;
-
- procedure Up_Shift( It: in out Vehicle ) is
- begin
- It.Power_Train.Gear := It.Power_Train.Gear +1;
- It.Power_Train.Engaged := True;
- Accelerate( It );
- end Up_Shift;
-end C3A0013_1;
-
-with Report;
-package body C3A0013_2 is
-
- procedure TC_Validate( It : Car;
- TC_ID : Character ) is
- begin
- if TC_ID /= 'C' then
- Report.Failed("Dispatched to Car");
- end if;
- if Wheels( It ) /= 4 then
- Report.Failed("Not a Car");
- end if;
- end TC_Validate;
-
- function Gear_Factor( It : Car ) return Natural is
- begin
- return C3A0013_1.Gear_Factor( C3A0013_1.Vehicle( It ) )*2;
- end Gear_Factor;
-
-end C3A0013_2;
-
-with Report;
-package body C3A0013_3 is
-
- procedure TC_Validate( It : Truck;
- TC_ID : Character) is
- begin
- if TC_ID /= 'T' then
- Report.Failed("Dispatched to Truck");
- end if;
- if Wheels( It ) /= 3 then
- Report.Failed("Not a Truck");
- end if;
- end TC_Validate;
-
- function Gear_Factor( It : Truck ) return Natural is
- begin
- return C3A0013_1.Gear_Factor( C3A0013_1.Vehicle( It ) )*3;
- end Gear_Factor;
-
-end C3A0013_3;
-
-package C3A0013_4 is
- procedure Perform_Tests;
-end C3A0013_4;
-
-with Report;
-with C3A0013_1;
-with C3A0013_2;
-with C3A0013_3;
-package body C3A0013_4 is
- package Root renames C3A0013_1;
- package Cars renames C3A0013_2;
- package Trucks renames C3A0013_3;
-
- type Car_Pool is array(1..4) of aliased Cars.Car;
- Commuters : Car_Pool;
-
- My_Car : aliased Cars.Car;
- Company_Car : Root.Vehicle_ID;
- Repair_Shop : Root.Vehicle_ID;
-
- The_Vehicle : Root.Vehicle;
- The_Car : Cars.Car;
- The_Truck : Trucks.Truck;
-
- procedure TC_Dispatch( Ptr : Root.Vehicle_ID;
- Char : Character ) is
- begin
- Root.TC_Validate( Ptr.all, Char );
- end TC_Dispatch;
-
- procedure TC_Check_Formal_Access( Item: in out Root.Vehicle'Class;
- Char: Character) is
- begin
- TC_Dispatch( Item'Unchecked_Access, Char );
- end TC_Check_Formal_Access;
-
- procedure Perform_Tests is
- begin -- Main test procedure.
-
- for Lane in Commuters'Range loop
- Cars.Create( Commuters(Lane) );
- for Excitement in 1..Lane loop
- Cars.Up_Shift( Commuters(Lane) );
- end loop;
- end loop;
-
- Cars.Create( My_Car );
- Cars.Up_Shift( My_Car );
- Cars.TC_Validate( My_Car, 2 );
-
- Root.Create( The_Vehicle, 1 );
- Cars.Create( The_Car , 4 );
- Trucks.Create( The_Truck, 3 );
-
- TC_Check_Formal_Access( The_Vehicle, 'V' );
- TC_Check_Formal_Access( The_Car, 'C' );
- TC_Check_Formal_Access( The_Truck, 'T' );
-
- Root.Up_Shift( The_Vehicle );
- Cars.Up_Shift( The_Car );
- Trucks.Up_Shift( The_Truck );
-
- Root.TC_Validate( The_Vehicle, 1 );
- Cars.TC_Validate( The_Car, 2 );
- Trucks.TC_Validate( The_Truck, 3 );
-
- -- general access type may reference allocated objects
-
- Company_Car := new Cars.Car;
- Root.Create( Company_Car.all );
- Root.Up_Shift( Company_Car.all );
- Root.Up_Shift( Company_Car.all );
- Root.TC_Validate( Company_Car.all, 6 );
-
- -- general access type may reference aliased objects
-
- Repair_Shop := My_Car'Access;
- Root.TC_Validate( Repair_Shop.all, 2 );
-
- -- general access type may reference aliased objects
-
- Construction: declare
- type Speed_List is array(Commuters'Range) of Natural;
- Accelerations : constant Speed_List := (2, 6, 12, 20);
- begin
- for Rotation in Commuters'Range loop
- Repair_Shop := Commuters(Rotation)'Access;
- Root.TC_Validate( Repair_Shop.all, Accelerations(Rotation) );
- end loop;
- end Construction;
-
-end Perform_Tests;
-
-end C3A0013_4;
-
-with C3A0013_4;
-with Report;
-procedure C3A0013 is
-begin
-
- Report.Test ("C3A0013", "Check general access types. Check aliased "
- & "nature of formal tagged type parameters. "
- & "Check aliased nature of the current "
- & "instance of a limited type. Check the "
- & "constraining of actual subtypes for "
- & "discriminated objects" );
-
- C3A0013_4.Perform_Tests;
-
- Report.Result;
-end C3A0013;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0014.a b/gcc/testsuite/ada/acats/tests/c3/c3a0014.a
deleted file mode 100644
index c83ab4f5e28..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0014.a
+++ /dev/null
@@ -1,453 +0,0 @@
--- C3A0014.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the view defined by an object declaration is aliased,
--- and the type of the object has discriminants, then the object is
--- constrained by its initial value even if its nominal subtype is
--- unconstrained.
---
--- Check that the attribute A'Constrained returns True if A is a formal
--- out or in out parameter, or dereference thereof, and A denotes an
--- aliased view of an object.
---
--- TEST DESCRIPTION:
--- These rules apply to objects of a record type with defaulted
--- discriminants, which may be unconstrained variables. If such a
--- variable is declared to be aliased, then it is constrained by its
--- initial value, and the value of the discriminant cannot be changed
--- for the life of the variable.
---
--- The rules do not apply to aliased component types because if such
--- types are discriminated they must be constrained.
---
--- A'Constrained returns True if A denotes a constant, value, or
--- constrained variable. Since aliased objects are constrained, it must
--- return True if the actual parameter corresponding to a formal
--- parameter A is an aliased object. The objective only mentions formal
--- parameters of mode out and in out, since parameters of mode in are
--- by definition constant, and would result in True anyway.
---
--- This test declares aliased objects of a nominally unconstrained
--- record subtype, both with and without initialization expressions.
--- It also declares access values which point to such objects. It then
--- checks that Constraint_Error is raised if an attempt is made to
--- change the discriminant value of an aliased object, either directly
--- or via a dereference of an access value. For aliased objects, this
--- check is also performed for subprogram parameters of mode out.
---
--- The test also passes aliased objects and access values which point
--- to such objects as actuals to subprograms and verifies, for parameter
--- modes out and in out, that P'Constrained returns true if P is the
--- corresponding formal parameter or a dereference thereof.
---
--- Additionally, the test declares a generic package which declares a
--- an aliased object of a formal derived unconstrained type, which is
--- is initialized with the value of a formal object of that type.
--- procedure declared within the generic assigns a value to the object
--- which has the same discriminant value as the formal derived type's
--- ancestor type. The generic is instantiated with various actuals
--- for the formal object, and the procedure is called. The test verifies
--- that Constraint_Error is raised if the discriminant values of the
--- actual corresponding to the formal object and the value assigned
--- by the procedure are not equal.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 16 Nov 95 SAIC ACVC 2.0.1 fixes: Corrected numerous errors.
---
---!
-
-package C3A0014_0 is
-
- subtype Reasonable is Integer range 1..10;
- -- Unconstrained (sub)type.
- type UC (D: Reasonable := 2) is record -- Discriminant default.
- S: String (1 .. D) := "Hi"; -- Default value.
- end record;
-
- type AUC is access all UC;
-
- -- Nominal subtype is unconstrained for the following:
-
- Obj0 : UC; -- An unconstrained object.
-
- Obj1 : UC := (5, "Hello"); -- Non-aliased with initialization,
- -- an unconstrained object.
-
- Obj2 : aliased UC := (5, "Hello"); -- Aliased with initialization,
- -- a constrained object.
-
- Obj3 : UC renames Obj2; -- Aliased (renaming of aliased view),
- -- a constrained object.
- Obj4 : aliased UC; -- Aliased without initialization, Obj4
- -- constrained here to initial value
- -- taken from default for type.
-
- Ptr1 : AUC := new UC'(Obj1);
- Ptr2 : AUC := new UC;
- Ptr3 : AUC := Obj3'Access;
- Ptr4 : AUC := Obj4'Access;
-
-
- procedure NP_Proc (A: out UC);
- procedure NP_Cons (A: in out UC; B: out Boolean);
- procedure P_Cons (A: out AUC; B: out Boolean);
-
-
- generic
- type FT is new UC;
- FObj : in out FT;
- package Gen is
- F : aliased FT := FObj; -- Constrained if FT has discriminants.
- procedure Proc;
- end Gen;
-
-
- procedure Avoid_Optimization_and_Fail ( P : UC; Msg : String );
-
-
-end C3A0014_0;
-
-
- --=======================================================================--
-
-with Report;
-
-package body C3A0014_0 is
-
- procedure NP_Proc (A: out UC) is
- begin
- A := (3, "Bye");
- end NP_Proc;
-
- procedure NP_Cons (A: in out UC; B: out Boolean) is
- begin
- B := A'Constrained;
- end NP_Cons;
-
- procedure P_Cons (A: out AUC; B: out Boolean) is
- begin
- B := A.all'Constrained;
- end P_Cons;
-
-
- package body Gen is
-
- procedure Proc is
- begin
- F := (2, "Fi");
- end Proc;
-
- end Gen;
-
-
- procedure Avoid_Optimization_and_Fail ( P : UC; Msg : String ) is
- Default : UC := (1, "!"); -- Unique value.
- begin
- if P = Default then -- Both If branches can't do the same thing.
- Report.Failed (Msg & ": Constraint_Error not raised");
- else -- Subtests should always select this path.
- Report.Failed ("Constraint_Error not raised " & Msg);
- end if;
- end Avoid_Optimization_and_Fail;
-
-
-end C3A0014_0;
-
-
- --=======================================================================--
-
-
-with C3A0014_0; use C3A0014_0;
-with Report;
-
-procedure C3A0014 is
-begin
-
- Report.Test("C3A0014", "Check that if the view defined by an object " &
- "declaration is aliased, and the type of the " &
- "object has discriminants, then the object is " &
- "constrained by its initial value even if its " &
- "nominal subtype is unconstrained. Check that " &
- "the attribute A'Constrained returns True if A " &
- "is a formal out or in out parameter, or " &
- "dereference thereof, and A denotes an aliased " &
- "view of an object");
-
- Non_Pointer_Block:
- begin
-
- begin
- Obj0 := (3, "Bye"); -- OK: Obj0 not constrained.
- if Obj0 /= (3, "Bye") then
- Report.Failed
- ("Wrong value after aggregate assignment - Subtest 1");
- end if;
- exception
- when others =>
- Report.Failed ("Unexpected exception raised - Subtest 1");
- end;
-
-
- begin
- Obj1 := (3, "Bye"); -- OK: Obj1 not constrained.
- if Obj1 /= (3, "Bye") then
- Report.Failed
- ("Wrong value after aggregate assignment - Subtest 2");
- end if;
- exception
- when others =>
- Report.Failed ("Unexpected exception raised - Subtest 2");
- end;
-
-
- begin
- Obj2 := (3, "Bye"); -- C_E: Obj2 is constrained (D=>5).
- Avoid_Optimization_and_Fail (Obj2, "Subtest 3");
- exception
- when Constraint_Error => null; -- Exception is expected.
- end;
-
-
- begin
- Obj3 := (3, "Bye"); -- C_E: Obj3 is constrained (D=>5).
- Avoid_Optimization_and_Fail (Obj3, "Subtest 4");
- exception
- when Constraint_Error => null; -- Exception is expected.
- end;
-
-
- begin
- Obj4 := (3, "Bye"); -- C_E: Obj4 is constrained (D=>2).
- Avoid_Optimization_and_Fail (Obj4, "Subtest 5");
- exception
- when Constraint_Error => null; -- Exception is expected.
- end;
-
- exception
- when others => Report.Failed("Unexpected exception: Non_Pointer_Block");
- end Non_Pointer_Block;
-
-
- Pointer_Block:
- begin
-
- begin
- Ptr1.all := (3, "Bye"); -- C_E: Ptr1.all is constrained (D=>5).
- Avoid_Optimization_and_Fail (Ptr1.all, "Subtest 6");
- exception
- when Constraint_Error => null; -- Exception is expected.
- end;
-
-
- begin
- Ptr2.all := (3, "Bye"); -- C_E: Ptr2.all is constrained (D=>2).
- Avoid_Optimization_and_Fail (Ptr2.all, "Subtest 7");
- exception
- when Constraint_Error => null; -- Exception is expected.
- end;
-
-
- begin
- Ptr3.all := (3, "Bye"); -- C_E: Ptr3.all is constrained (D=>5).
- Avoid_Optimization_and_Fail (Ptr3.all, "Subtest 8");
- exception
- when Constraint_Error => null; -- Exception is expected.
- end;
-
-
- begin
- Ptr4.all := (3, "Bye"); -- C_E: Ptr4.all is constrained (D=>2).
- Avoid_Optimization_and_Fail (Ptr4.all, "Subtest 9");
- exception
- when Constraint_Error => null; -- Exception is expected.
- end;
-
- exception
- when others => Report.Failed("Unexpected exception: Pointer_Block");
- end Pointer_Block;
-
-
- Subprogram_Block:
- declare
- Is_Constrained : Boolean;
- begin
-
- begin
- NP_Proc (Obj0); -- OK: Obj0 not constrained, can
- if Obj0 /= (3, "Bye") then -- change discriminant value.
- Report.Failed
- ("Wrong value after aggregate assignment - Subtest 10");
- end if;
- exception
- when others =>
- Report.Failed ("Unexpected exception raised - Subtest 10");
- end;
-
-
- begin
- NP_Proc (Obj2); -- C_E: Obj2 is constrained (D=>5).
- Avoid_Optimization_and_Fail (Obj2, "Subtest 11");
- exception
- when Constraint_Error => null; -- Exception is expected.
- end;
-
-
- begin
- NP_Proc (Obj3); -- C_E: Obj3 is constrained (D=>5).
- Avoid_Optimization_and_Fail (Obj3, "Subtest 12");
- exception
- when Constraint_Error => null; -- Exception is expected.
- end;
-
-
- begin
- NP_Proc (Obj4); -- C_E: Obj4 is constrained (D=>2).
- Avoid_Optimization_and_Fail (Obj4, "Subtest 13");
- exception
- when Constraint_Error => null; -- Exception is expected.
- end;
-
-
-
- begin
- Is_Constrained := True;
- NP_Cons (Obj1, Is_Constrained); -- Should return False, since Obj1
- if Is_Constrained then -- is not constrained.
- Report.Failed ("Wrong result from 'Constrained - Subtest 14");
- end if;
- exception
- when others =>
- Report.Failed ("Unexpected exception raised - Subtest 14");
- end;
-
-
- begin
- Is_Constrained := False;
- NP_Cons (Obj2, Is_Constrained); -- Should return True, Obj2 is
- if not Is_Constrained then -- constrained.
- Report.Failed ("Wrong result from 'Constrained - Subtest 15");
- end if;
- exception
- when others =>
- Report.Failed ("Unexpected exception raised - Subtest 15");
- end;
-
-
-
-
- begin
- Is_Constrained := False;
- P_Cons (Ptr2, Is_Constrained); -- Should return True, Ptr2.all
- if not Is_Constrained then -- is constrained.
- Report.Failed ("Wrong result from 'Constrained - Subtest 16");
- end if;
- exception
- when others =>
- Report.Failed ("Unexpected exception raised - Subtest 16");
- end;
-
-
- begin
- Is_Constrained := False;
- P_Cons (Ptr3, Is_Constrained); -- Should return True, Ptr3.all
- if not Is_Constrained then -- is constrained.
- Report.Failed ("Wrong result from 'Constrained - Subtest 17");
- end if;
- exception
- when others =>
- Report.Failed ("Unexpected exception raised - Subtest 17");
- end;
-
-
- exception
- when others => Report.Failed("Exception raised in Subprogram_Block");
- end Subprogram_Block;
-
-
- Generic_Block:
- declare
-
- type NUC is new UC;
-
- Obj : NUC;
-
-
- package Instance_A is new Gen (NUC, Obj);
- package Instance_B is new Gen (UC, Obj2);
- package Instance_C is new Gen (UC, Obj3);
- package Instance_D is new Gen (UC, Obj4);
-
- begin
-
- begin
- Instance_A.Proc; -- OK: Obj.D = 2.
- if Instance_A.F /= (2, "Fi") then
- Report.Failed
- ("Wrong value after aggregate assignment - Subtest 18");
- end if;
- exception
- when others =>
- Report.Failed ("Unexpected exception raised - Subtest 18");
- end;
-
-
- begin
- Instance_B.Proc; -- C_E: Obj2.D = 5.
- Avoid_Optimization_and_Fail (Obj2, "Subtest 19");
- exception
- when Constraint_Error => null; -- Exception is expected.
- end;
-
-
- begin
- Instance_C.Proc; -- C_E: Obj3.D = 5.
- Avoid_Optimization_and_Fail (Obj3, "Subtest 20");
- exception
- when Constraint_Error => null; -- Exception is expected.
- end;
-
-
- begin
- Instance_D.Proc; -- OK: Obj4.D = 2.
- if Instance_D.F /= (2, "Fi") then
- Report.Failed
- ("Wrong value after aggregate assignment - Subtest 21");
- end if;
- exception
- when others =>
- Report.Failed ("Unexpected exception raised - Subtest 21");
- end;
-
- exception
- when others => Report.Failed("Exception raised in Generic_Block");
- end Generic_Block;
-
-
- Report.Result;
-
-end C3A0014;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a0015.a b/gcc/testsuite/ada/acats/tests/c3/c3a0015.a
deleted file mode 100644
index 856c910f92d..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a0015.a
+++ /dev/null
@@ -1,267 +0,0 @@
--- C3A0015.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a derived access type has the same storage pool as its
--- parent. (Defect Report 8652/0012, Technical Corrigendum 3.10(7/1)).
---
--- CHANGE HISTORY:
--- 24 JAN 2001 PHL Initial version.
--- 29 JUN 2001 RLB Reformatted for ACATS.
---
---!
-with System.Storage_Elements;
-use System.Storage_Elements;
-with System.Storage_Pools;
-use System.Storage_Pools;
-package C3A0015_0 is
-
- type Pool (Storage_Size : Storage_Count) is new Root_Storage_Pool with
- record
- First_Free : Storage_Count := 1;
- Contents : Storage_Array (1 .. Storage_Size);
- end record;
-
- procedure Allocate (Pool : in out C3A0015_0.Pool;
- Storage_Address : out System.Address;
- Size_In_Storage_Elements : in Storage_Count;
- Alignment : in Storage_Count);
-
- procedure Deallocate (Pool : in out C3A0015_0.Pool;
- Storage_Address : in System.Address;
- Size_In_Storage_Elements : in Storage_Count;
- Alignment : in Storage_Count);
-
- function Storage_Size (Pool : in C3A0015_0.Pool) return Storage_Count;
-
-end C3A0015_0;
-
-package body C3A0015_0 is
-
- use System;
-
- procedure Allocate (Pool : in out C3A0015_0.Pool;
- Storage_Address : out System.Address;
- Size_In_Storage_Elements : in Storage_Count;
- Alignment : in Storage_Count) is
- Unaligned_Address : constant System.Address :=
- Pool.Contents (Pool.First_Free)'Address;
- Unalignment : Storage_Count;
- begin
- Unalignment := Unaligned_Address mod Alignment;
- if Unalignment = 0 then
- Storage_Address := Unaligned_Address;
- Pool.First_Free := Pool.First_Free + Size_In_Storage_Elements;
- else
- Storage_Address :=
- Pool.Contents (Pool.First_Free + Alignment - Unalignment)'
- Address;
- Pool.First_Free := Pool.First_Free + Size_In_Storage_Elements +
- Alignment - Unalignment;
- end if;
- end Allocate;
-
- procedure Deallocate (Pool : in out C3A0015_0.Pool;
- Storage_Address : in System.Address;
- Size_In_Storage_Elements : in Storage_Count;
- Alignment : in Storage_Count) is
- begin
- if Storage_Address + Size_In_Storage_Elements =
- Pool.Contents (Pool.First_Free)'Address then
- -- Only deallocate if the block is at the end.
- Pool.First_Free := Pool.First_Free - Size_In_Storage_Elements;
- end if;
- end Deallocate;
-
- function Storage_Size (Pool : in C3A0015_0.Pool) return Storage_Count is
- begin
- return Pool.Storage_Size;
- end Storage_Size;
-
-end C3A0015_0;
-
-with Ada.Exceptions;
-use Ada.Exceptions;
-with Ada.Unchecked_Deallocation;
-with Report;
-use Report;
-with System.Storage_Elements;
-use System.Storage_Elements;
-with C3A0015_0;
-procedure C3A0015 is
-
- type Standard_Pool is access Float;
- type Derived_Standard_Pool is new Standard_Pool;
- type Derived_Derived_Standard_Pool is new Derived_Standard_Pool;
-
- type User_Defined_Pool is access Integer;
- type Derived_User_Defined_Pool is new User_Defined_Pool;
- type Derived_Derived_User_Defined_Pool is new Derived_User_Defined_Pool;
-
- My_Pool : C3A0015_0.Pool (1024);
- for User_Defined_Pool'Storage_Pool use My_Pool;
-
- generic
- type Designated is private;
- Value : Designated;
- type Acc is access Designated;
- type Derived_Acc is new Acc;
- procedure Check (Subtest : String; User_Defined_Pool : Boolean);
-
- procedure Check (Subtest : String; User_Defined_Pool : Boolean) is
-
- procedure Deallocate is
- new Ada.Unchecked_Deallocation (Object => Designated,
- Name => Acc);
- procedure Deallocate is
- new Ada.Unchecked_Deallocation (Object => Designated,
- Name => Derived_Acc);
-
- First_Free : Storage_Count;
- X : Acc;
- Y : Derived_Acc;
- begin
- if User_Defined_Pool then
- First_Free := My_Pool.First_Free;
- end if;
- X := new Designated'(Value);
- if User_Defined_Pool and then First_Free >= My_Pool.First_Free then
- Failed (Subtest &
- " - Allocation didn't consume storage in the pool - 1");
- else
- First_Free := My_Pool.First_Free;
- end if;
-
- Y := Derived_Acc (X);
- if User_Defined_Pool and then First_Free /= My_Pool.First_Free then
- Failed (Subtest &
- " - Conversion did consume storage in the pool - 1");
- end if;
- if Y.all /= Value then
- Failed (Subtest &
- " - Incorrect allocation/conversion of access values - 1");
- end if;
-
- Deallocate (Y);
- if User_Defined_Pool and then First_Free <= My_Pool.First_Free then
- Failed (Subtest &
- " - Deallocation didn't release storage from the pool - 1");
- else
- First_Free := My_Pool.First_Free;
- end if;
-
- Y := new Designated'(Value);
- if User_Defined_Pool and then First_Free >= My_Pool.First_Free then
- Failed (Subtest &
- " - Allocation didn't consume storage in the pool - 2");
- else
- First_Free := My_Pool.First_Free;
- end if;
-
- X := Acc (Y);
- if User_Defined_Pool and then First_Free /= My_Pool.First_Free then
- Failed (Subtest &
- " - Conversion did consume storage in the pool - 2");
- end if;
- if X.all /= Value then
- Failed (Subtest &
- " - Incorrect allocation/conversion of access values - 2");
- end if;
-
- Deallocate (X);
- if User_Defined_Pool and then First_Free <= My_Pool.First_Free then
- Failed (Subtest &
- " - Deallocation didn't release storage from the pool - 2");
- end if;
- exception
- when E: others =>
- Failed (Subtest & " - Exception " & Exception_Name (E) &
- " raised - " & Exception_Message (E));
- end Check;
-
-
-begin
- Test ("C3A0015", "Check that a dervied access type has the same " &
- "storage pool as its parent");
-
- Comment ("Access types using the standard storage pool");
-
- Std:
- declare
- procedure Check1 is
- new Check (Designated => Float,
- Value => 3.0,
- Acc => Standard_Pool,
- Derived_Acc => Derived_Standard_Pool);
- procedure Check2 is
- new Check (Designated => Float,
- Value => 4.0,
- Acc => Standard_Pool,
- Derived_Acc => Derived_Derived_Standard_Pool);
- procedure Check3 is
- new Check (Designated => Float,
- Value => 5.0,
- Acc => Derived_Standard_Pool,
- Derived_Acc => Derived_Derived_Standard_Pool);
- begin
- Check1 ("Standard_Pool/Derived_Standard_Pool",
- User_Defined_Pool => False);
- Check2 ("Standard_Pool/Derived_Derived_Standard_Pool",
- User_Defined_Pool => False);
- Check3 ("Derived_Standard_Pool/Derived_Derived_Standard_Pool",
- User_Defined_Pool => False);
- end Std;
-
- Comment ("Access types using a user-defined storage pool");
-
- User:
- declare
- procedure Check1 is
- new Check (Designated => Integer,
- Value => 17,
- Acc => User_Defined_Pool,
- Derived_Acc => Derived_User_Defined_Pool);
- procedure Check2 is
- new Check (Designated => Integer,
- Value => 18,
- Acc => User_Defined_Pool,
- Derived_Acc => Derived_Derived_User_Defined_Pool);
- procedure Check3 is
- new Check (Designated => Integer,
- Value => 19,
- Acc => Derived_User_Defined_Pool,
- Derived_Acc => Derived_Derived_User_Defined_Pool);
- begin
- Check1 ("User_Defined_Pool/Derived_User_Defined_Pool",
- User_Defined_Pool => True);
- Check2 ("User_Defined_Pool/Derived_Derived_User_Defined_Pool",
- User_Defined_Pool => True);
- Check3
- ("Derived_User_Defined_Pool/Derived_Derived_User_Defined_Pool",
- User_Defined_Pool => True);
- end User;
-
- Result;
-end C3A0015;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a1001.a b/gcc/testsuite/ada/acats/tests/c3/c3a1001.a
deleted file mode 100644
index 9b05b5da254..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a1001.a
+++ /dev/null
@@ -1,315 +0,0 @@
--- C3A1001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the full type completing a type with no discriminant part
--- or an unknown discriminant part may have explicitly declared or
--- inherited discriminants.
--- Check for cases where the types are records and protected types.
---
--- TEST DESCRIPTION:
--- Declare two groups of incomplete types: one group with no discriminant
--- part and one group with unknown discriminant part. Both groups of
--- incomplete types are completed with both explicit and inherited
--- discriminants. Discriminants for record and protected types are
--- declared with default and non default values.
--- In the main program, verify that objects of both groups of incomplete
--- types can be created by default values or by assignments.
---
---
--- CHANGE HISTORY:
--- 11 Oct 95 SAIC Initial prerelease version.
--- 11 Nov 96 SAIC Revised for version 2.1.
---
---!
-
-package C3A1001_0 is
-
- type Incomplete1 (<>); -- unknown discriminant
-
- type Incomplete2; -- no discriminant
-
- type Incomplete3 (<>); -- unknown discriminant
-
- type Incomplete4; -- no discriminant
-
- type Incomplete5 (<>); -- unknown discriminant
-
- type Incomplete6; -- no discriminant
-
- type Incomplete8; -- no discriminant
-
- subtype Small_Int is Integer range 1 .. 10;
-
- type Enu_Type is (M, F);
-
- type Incomplete1 (Disc : Enu_Type) is -- unknown discriminant/
- record -- explicit discriminant
- case Disc is
- when M => MInteger : Small_Int := 3;
- when F => FInteger : Small_Int := 8;
- end case;
- end record;
-
- type Incomplete2 (Disc : Small_Int := 8) is -- no discriminant/
- record -- explicit discriminant
- ID : String (1 .. Disc) := "Plymouth";
- end record;
-
- type Incomplete3 is new Incomplete2; -- unknown discriminant/
- -- inherited discriminant
-
- type Incomplete4 is new Incomplete2; -- no discriminant/
- -- inherited discriminant
-
- protected type Incomplete5 -- unknown discriminant/
- (Disc : Enu_Type) is -- explicit discriminant
- function Get_Priv_Val return Enu_Type;
- private
- Enu_Obj : Enu_Type := Disc;
- end Incomplete5;
-
- protected type Incomplete6 -- no discriminant/
- (Disc : Small_Int := 1) is -- explicit discriminant
- function Get_Priv_Val return Small_Int; -- with default
- private
- Num : Small_Int := Disc;
- end Incomplete6;
-
- type Incomplete8 (Disc : Small_Int) is -- no discriminant/
- record -- explicit discriminant
- Str : String (1 .. Disc); -- no default
- end record;
-
- type Incomplete9 is new Incomplete8;
-
- function Return_String (S : String) return String;
-
-end C3A1001_0;
-
- --==================================================================--
-
-with Report;
-
-package body C3A1001_0 is
-
- protected body Incomplete5 is
-
- function Get_Priv_Val return Enu_Type is
- begin
- return Enu_Obj;
- end Get_Priv_Val;
-
- end Incomplete5;
-
- ----------------------------------------------------------------------
- protected body Incomplete6 is
-
- function Get_Priv_Val return Small_Int is
- begin
- return Num;
- end Get_Priv_Val;
-
- end Incomplete6;
-
- ----------------------------------------------------------------------
- function Return_String (S : String) return String is
- begin
- if Report.Ident_Bool(True) = True then
- return S;
- end if;
-
- return S;
- end Return_String;
-
-end C3A1001_0;
-
- --==================================================================--
-
-with Report;
-
-with C3A1001_0;
-use C3A1001_0;
-
-procedure C3A1001 is
-
- -- Discriminant value comes from default.
-
- Incomplete2_Obj_1 : Incomplete2;
-
- Incomplete4_Obj_1 : Incomplete4;
-
- Incomplete6_Obj_1 : Incomplete6;
-
- -- Discriminant value comes from explicit constraint.
-
- Incomplete1_Obj_1 : Incomplete1 (F);
-
- Incomplete5_Obj_1 : Incomplete5 (M);
-
- Incomplete6_Obj_2 : Incomplete6 (2);
-
- -- Discriminant value comes from assignment.
-
- Incomplete3_Obj_1 : Incomplete3 := (Disc => 6, ID => "Sentra");
-
- Incomplete1_Obj_2 : Incomplete1 := (Disc => M, MInteger => 9);
-
- Incomplete2_Obj_2 : Incomplete2 := (Disc => 5, ID => "Buick");
-
-begin
-
- Report.Test ("C3A1001", "Check that the full type completing a type " &
- "with no discriminant part or an unknown discriminant " &
- "part may have explicitly declared or inherited " &
- "discriminants. Check for cases where the types are " &
- "records and protected types");
-
- -- Check the initial values.
-
- if (Incomplete2_Obj_1.Disc /= 8) or
- (Incomplete2_Obj_1.ID /= "Plymouth") then
- Report.Failed ("Wrong initial values for Incomplete2_Obj_1");
- end if;
-
- if (Incomplete4_Obj_1.Disc /= 8) or
- (Incomplete4_Obj_1.ID /= "Plymouth") then
- Report.Failed ("Wrong initial values for Incomplete4_Obj_1");
- end if;
-
- if (Incomplete6_Obj_1.Disc /= 1) or
- (Incomplete6_Obj_1.Get_Priv_Val /= 1) then
- Report.Failed ("Wrong initial value for Incomplete6_Obj_1");
- end if;
-
- -- Check the explicit values.
-
- if (Incomplete1_Obj_1.Disc /= F) or
- (Incomplete1_Obj_1.FInteger /= 8) then
- Report.Failed ("Wrong values for Incomplete1_Obj_1");
- end if;
-
- if (Incomplete5_Obj_1.Disc /= M) or
- (Incomplete5_Obj_1.Get_Priv_Val /= M) then
- Report.Failed ("Wrong value for Incomplete5_Obj_1");
- end if;
-
- if (Incomplete6_Obj_2.Disc /= 2) or
- (Incomplete6_Obj_2.Get_Priv_Val /= 2) then
- Report.Failed ("Wrong value for Incomplete6_Obj_2");
- end if;
-
- -- Check the assigned values.
-
- if (Incomplete3_Obj_1.Disc /= 6) or
- (Incomplete3_Obj_1.ID /= "Sentra") then
- Report.Failed ("Wrong values for Incomplete3_Obj_1");
- end if;
-
- if (Incomplete1_Obj_2.Disc /= M) or
- (Incomplete1_Obj_2.MInteger /= 9) then
- Report.Failed ("Wrong values for Incomplete1_Obj_2");
- end if;
-
- if (Incomplete2_Obj_2.Disc /= 5) or
- (Incomplete2_Obj_2.ID /= "Buick") then
- Report.Failed ("Wrong values for Incomplete2_Obj_2");
- end if;
-
- -- Make sure that assignments work without problems.
-
- Incomplete1_Obj_1.FInteger := 1;
-
- -- Avoid optimization (dead variable removal of FInteger):
-
- if Incomplete1_Obj_1.FInteger /= Report.Ident_Int(1)
- then
- Report.Failed ("Wrong value stored in Incomplete1_Obj_1.FInteger");
- end if;
-
- Incomplete2_Obj_1.ID := Return_String ("12345678");
-
- -- Avoid optimization (dead variable removal of ID)
-
- if Incomplete2_Obj_1.ID /= Return_String ("12345678")
- then
- Report.Failed ("Wrong values for Incomplete8_Obj_1.ID");
- end if;
-
- Incomplete4_Obj_1.ID := Return_String ("87654321");
-
- -- Avoid optimization (dead variable removal of ID)
-
- if Incomplete4_Obj_1.ID /= Return_String ("87654321")
- then
- Report.Failed ("Wrong values for Incomplete4_Obj_1.ID");
- end if;
-
-
- Test1:
- declare
-
- Incomplete8_Obj_1 : Incomplete8 (10);
-
- begin
- Incomplete8_Obj_1.Str := "Merry Xmas";
-
- -- Avoid optimization (dead variable removal of Str):
-
- if Return_String (Incomplete8_Obj_1.Str) /= "Merry Xmas"
- then
- Report.Failed ("Wrong values for Incomplete8_Obj_1.Str");
- end if;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Incomplete8_Obj_1");
-
- end Test1;
-
- Test2:
- declare
-
- Incomplete8_Obj_2 : Incomplete8 (5);
-
- begin
- Incomplete8_Obj_2.Str := "Happy";
-
- -- Avoid optimization (dead variable removal of Str):
-
- if Return_String (Incomplete8_Obj_2.Str) /= "Happy"
- then
- Report.Failed ("Wrong values for Incomplete8_Obj_1.Str");
- end if;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Incomplete8_Obj_2");
-
- end Test2;
-
- Report.Result;
-
-end C3A1001;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a1002.a b/gcc/testsuite/ada/acats/tests/c3/c3a1002.a
deleted file mode 100644
index 27d1f843c30..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a1002.a
+++ /dev/null
@@ -1,251 +0,0 @@
--- C3A1002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the full type completing a type with no discriminant part
--- or an unknown discriminant part may have explicitly declared or
--- inherited discriminants.
--- Check for cases where the types are tagged records and task types.
---
--- TEST DESCRIPTION:
--- Declare two groups of incomplete types: one group with no discriminant
--- part and one group with unknown discriminant part. Both groups of
--- incomplete types are completed with both explicit and inherited
--- discriminants. Discriminants for task types are declared with both
--- default and non default values. Discriminants for tagged types are
--- only declared without default values.
--- In the main program, verify that objects of both groups of incomplete
--- types can be created by default values or by assignments.
---
---
--- CHANGE HISTORY:
--- 23 Oct 95 SAIC Initial prerelease version.
--- 19 Oct 96 SAIC ACVC 2.1: modified test description. Initialized
--- Int_Val.
---
---!
-
-package C3A1002_0 is
-
- subtype Small_Int is Integer range 1 .. 15;
-
- type Enu_Type is (M, F);
-
- type Tag_Type is tagged
- record
- I : Small_Int := 1;
- end record;
-
- type NTag_Type (D : Small_Int) is new Tag_Type with
- record
- S : String (1 .. D) := "Aloha";
- end record;
-
- type Incomplete1; -- no discriminant
-
- type Incomplete2 (<>); -- unknown discriminant
-
- type Incomplete3; -- no discriminant
-
- type Incomplete4 (<>); -- unknown discriminant
-
- type Incomplete5; -- no discriminant
-
- type Incomplete6 (<>); -- unknown discriminant
-
- type Incomplete1 (D1 : Enu_Type) is tagged -- no discriminant/
- record -- explicit discriminant
- case D1 is
- when M => MInteger : Small_Int := 9;
- when F => FInteger : Small_Int := 8;
- end case;
- end record;
-
- type Incomplete2 (D2 : Small_Int) is new -- unknown discriminant/
- Incomplete1 (D1 => F) with record -- explicit discriminant
- ID : String (1 .. D2) := "ACVC95";
- end record;
-
- type Incomplete3 is new -- no discriminant/
- NTag_Type with record -- inherited discriminant
- E : Enu_Type := M;
- end record;
-
- type Incomplete4 is new -- unknown discriminant/
- NTag_Type (D => 3) with record -- inherited discriminant
- E : Enu_Type := F;
- end record;
-
- task type Incomplete5 (D5 : Enu_Type) is -- no discriminant/
- entry Read_Disc (P : out Enu_Type); -- explicit discriminant
- end Incomplete5;
-
- task type Incomplete6
- (D6 : Small_Int := 4) is -- unknown discriminant/
- entry Read_Int (P : out Small_Int); -- explicit discriminant
- end Incomplete6;
-
-end C3A1002_0;
-
- --==================================================================--
-
-package body C3A1002_0 is
-
- task body Incomplete5 is
- begin
- select
- accept Read_Disc (P : out Enu_Type) do
- P := D5;
- end Read_Disc;
- or
- terminate;
- end select;
-
- end Incomplete5;
-
- ----------------------------------------------------------------------
- task body Incomplete6 is
- begin
- select
- accept Read_Int (P : out Small_Int) do
- P := D6;
- end Read_Int;
- or
- terminate;
- end select;
-
- end Incomplete6;
-
-end C3A1002_0;
-
- --==================================================================--
-
-with Report;
-
-with C3A1002_0;
-use C3A1002_0;
-
-procedure C3A1002 is
-
- Enum_Val : Enu_Type := M;
-
- Int_Val : Small_Int := 15;
-
- -- Discriminant value comes from default.
-
- Incomplete6_Obj_1 : Incomplete6;
-
- -- Discriminant value comes from explicit constraint.
-
- Incomplete1_Obj_1 : Incomplete1 (M);
-
- Incomplete2_Obj_1 : Incomplete2 (6);
-
- Incomplete5_Obj_1 : Incomplete5 (F);
-
- Incomplete6_Obj_2 : Incomplete6 (7);
-
- -- Discriminant value comes from assignment.
-
- Incomplete1_Obj_2 : Incomplete1
- := (F, 12);
-
- Incomplete3_Obj_1 : Incomplete3
- := (D => 2, S => "Hi", I => 10, E => F);
-
- Incomplete4_Obj_1 : Incomplete4
- := (E => M, D => 3, S => "Bye", I => 14);
-
-begin
-
- Report.Test ("C3A1002", "Check that the full type completing a type " &
- "with no discriminant part or an unknown discriminant " &
- "part may have explicitly declared or inherited " &
- "discriminants. Check for cases where the types are " &
- "tagged records and task types");
-
- -- Check the initial values.
-
- if (Incomplete6_Obj_1.D6 /= 4) then
- Report.Failed ("Wrong initial value for Incomplete6_Obj_1");
- end if;
-
- -- Check the explicit values.
-
- if (Incomplete1_Obj_1.D1 /= M) or
- (Incomplete1_Obj_1.MInteger /= 9) then
- Report.Failed ("Wrong values for Incomplete1_Obj_1");
- end if;
-
- if (Incomplete2_Obj_1.D2 /= 6) or
- (Incomplete2_Obj_1.FInteger /= 8) or
- (Incomplete2_Obj_1.ID /= "ACVC95") then
- Report.Failed ("Wrong values for Incomplete2_Obj_1");
- end if;
-
- if (Incomplete5_Obj_1.D5 /= F) then
- Report.Failed ("Wrong value for Incomplete5_Obj_1");
- end if;
-
- Incomplete5_Obj_1.Read_Disc (Enum_Val);
-
- if (Enum_Val /= F) then
- Report.Failed ("Wrong value for Enum_Val");
- end if;
-
- if (Incomplete6_Obj_2.D6 /= 7) then
- Report.Failed ("Wrong value for Incomplete6_Obj_2");
- end if;
-
- Incomplete6_Obj_1.Read_Int (Int_Val);
-
- if (Int_Val /= 4) then
- Report.Failed ("Wrong value for Int_Val");
- end if;
-
- -- Check the assigned values.
-
- if (Incomplete1_Obj_2.D1 /= F) or
- (Incomplete1_Obj_2.FInteger /= 12) then
- Report.Failed ("Wrong values for Incomplete1_Obj_2");
- end if;
-
- if (Incomplete3_Obj_1.D /= 2 ) or
- (Incomplete3_Obj_1.I /= 10) or
- (Incomplete3_Obj_1.E /= F ) or
- (Incomplete3_Obj_1.S /= "Hi") then
- Report.Failed ("Wrong values for Incomplete3_Obj_1");
- end if;
-
- if (Incomplete4_Obj_1.E /= M ) or
- (Incomplete4_Obj_1.D /= 3) or
- (Incomplete4_Obj_1.S /= "Bye") or
- (Incomplete4_Obj_1.I /= 14) then
- Report.Failed ("Wrong values for Incomplete4_Obj_1");
- end if;
-
- Report.Result;
-
-end C3A1002;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a2001.a b/gcc/testsuite/ada/acats/tests/c3/c3a2001.a
deleted file mode 100644
index c3c7f441062..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a2001.a
+++ /dev/null
@@ -1,460 +0,0 @@
--- C3A2001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an access type may be defined to designate the
--- class-wide type of an abstract type. Check that the access type
--- may then be used subsequently with types derived from the abstract
--- type. Check that dispatching operations dispatch correctly, when
--- called using values designated by objects of the access type.
---
--- TEST DESCRIPTION:
--- This test declares an abstract type Breaker in a package, and
--- then derives from it. The type Basic_Breaker defines the least
--- possible in order to not be abstract. The type Ground_Fault is
--- defined to inherit as much as possible, whereas type Special_Breaker
--- overrides everything it can. The type Special_Breaker also includes
--- an embedded Basic_Breaker object. The main program then utilizes
--- each of the three types of breaker, and to ascertain that the
--- overloading and tagging resolution are correct, each "Create"
--- procedure is called with a unique value. The diagram below
--- illustrates the relationships.
---
--- Abstract type: Breaker(1)
--- |
--- Basic_Breaker(2)
--- / \
--- Ground_Fault(3) Special_Breaker(4)
---
--- Test structure is a polymorphic linked list, modeling a circuit
--- as a list of components. The type component is the access type
--- defined to designate Breaker'Class values. The test then creates
--- some values, and traverses the list to determine correct operation.
--- This test is instrumented with a the trace facility found in
--- foundation F392C00 to simplify the verification process.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Nov 95 SAIC Checked compilation for ACVC 2.0.1
--- 23 APR 96 SAIC Added pragma Elaborate_All
--- 26 NOV 96 SAIC Elaborate_Body changed to Elaborate_All
---
---!
-
-with Report;
-with TCTouch;
-package C3A2001_1 is
-
- type Breaker is abstract tagged private;
- type Status is ( Power_Off, Power_On, Tripped, Failed );
-
- procedure Flip ( The_Breaker : in out Breaker ) is abstract;
- procedure Trip ( The_Breaker : in out Breaker ) is abstract;
- procedure Reset( The_Breaker : in out Breaker ) is abstract;
- procedure Fail ( The_Breaker : in out Breaker );
-
- procedure Set ( The_Breaker : in out Breaker'Class; To_State : Status );
-
- function Status_Of( The_Breaker : Breaker ) return Status;
-
-private
- type Breaker is abstract tagged record
- State : Status := Power_Off;
- end record;
-end C3A2001_1;
-
-----------------------------------------------------------------------------
-
-with TCTouch;
-package body C3A2001_1 is
- procedure Fail( The_Breaker : in out Breaker ) is
- begin
- TCTouch.Touch( 'a' ); --------------------------------------------- a
- The_Breaker.State := Failed;
- end Fail;
-
- procedure Set( The_Breaker : in out Breaker'Class; To_State : Status ) is
- begin
- The_Breaker.State := To_State;
- end Set;
-
- function Status_Of( The_Breaker : Breaker ) return Status is
- begin
- TCTouch.Touch( 'b' ); --------------------------------------------- b
- return The_Breaker.State;
- end Status_Of;
-end C3A2001_1;
-
-----------------------------------------------------------------------------
-
-with C3A2001_1;
-package C3A2001_2 is
-
- type Basic_Breaker is new C3A2001_1.Breaker with private;
-
- type Voltages is ( V12, V110, V220, V440 );
- type Amps is ( A1, A5, A10, A25, A100 );
-
- function Construct( Voltage : Voltages; Amperage : Amps )
- return Basic_Breaker;
-
- procedure Flip ( The_Breaker : in out Basic_Breaker );
- procedure Trip ( The_Breaker : in out Basic_Breaker );
- procedure Reset( The_Breaker : in out Basic_Breaker );
-private
- type Basic_Breaker is new C3A2001_1.Breaker with record
- Voltage_Level : Voltages := V110;
- Amperage : Amps;
- end record;
-end C3A2001_2;
-
-----------------------------------------------------------------------------
-
-with TCTouch;
-package body C3A2001_2 is
- function Construct( Voltage : Voltages; Amperage : Amps )
- return Basic_Breaker is
- It : Basic_Breaker;
- begin
- TCTouch.Touch( 'c' ); --------------------------------------------- c
- It.Amperage := Amperage;
- It.Voltage_Level := Voltage;
- C3A2001_1.Set( It, C3A2001_1.Power_Off );
- return It;
- end Construct;
-
- procedure Flip ( The_Breaker : in out Basic_Breaker ) is
- begin
- TCTouch.Touch( 'd' ); --------------------------------------------- d
- case Status_Of( The_Breaker ) is
- when C3A2001_1.Power_Off =>
- C3A2001_1.Set( The_Breaker, C3A2001_1.Power_On );
- when C3A2001_1.Power_On =>
- C3A2001_1.Set( The_Breaker, C3A2001_1.Power_Off );
- when C3A2001_1.Tripped | C3A2001_1.Failed => null;
- end case;
- end Flip;
-
- procedure Trip ( The_Breaker : in out Basic_Breaker ) is
- begin
- TCTouch.Touch( 'e' ); --------------------------------------------- e
- C3A2001_1.Set( The_Breaker, C3A2001_1.Tripped );
- end Trip;
-
- procedure Reset( The_Breaker : in out Basic_Breaker ) is
- begin
- TCTouch.Touch( 'f' ); --------------------------------------------- f
- case Status_Of( The_Breaker ) is
- when C3A2001_1.Power_Off | C3A2001_1.Tripped =>
- C3A2001_1.Set( The_Breaker, C3A2001_1.Power_On );
- when C3A2001_1.Power_On | C3A2001_1.Failed => null;
- end case;
- end Reset;
-
-end C3A2001_2;
-
-----------------------------------------------------------------------------
-
-with C3A2001_1,C3A2001_2;
-package C3A2001_3 is
- use type C3A2001_1.Status;
-
- type Ground_Fault is new C3A2001_2.Basic_Breaker with private;
-
- function Construct( Voltage : C3A2001_2.Voltages;
- Amperage : C3A2001_2.Amps )
- return Ground_Fault;
-
- procedure Set_Trip( The_Breaker : in out Ground_Fault;
- Capacitance : in Integer );
-
-private
- type Ground_Fault is new C3A2001_2.Basic_Breaker with record
- Capacitance : Integer;
- end record;
-end C3A2001_3;
-
-----------------------------------------------------------------------------
-
-with TCTouch;
-package body C3A2001_3 is
-
- function Construct( Voltage : C3A2001_2.Voltages;
- Amperage : C3A2001_2.Amps )
- return Ground_Fault is
- begin
- TCTouch.Touch( 'g' ); --------------------------------------------- g
- return ( C3A2001_2.Construct( Voltage, Amperage )
- with Capacitance => 0 );
- end Construct;
-
-
- procedure Set_Trip( The_Breaker : in out Ground_Fault;
- Capacitance : in Integer ) is
- begin
- TCTouch.Touch( 'h' ); --------------------------------------------- h
- The_Breaker.Capacitance := Capacitance;
- end Set_Trip;
-
-end C3A2001_3;
-
-----------------------------------------------------------------------------
-
-with C3A2001_1, C3A2001_2;
-package C3A2001_4 is
-
- type Special_Breaker is new C3A2001_2.Basic_Breaker with private;
-
- function Construct( Voltage : C3A2001_2.Voltages;
- Amperage : C3A2001_2.Amps )
- return Special_Breaker;
-
- procedure Flip ( The_Breaker : in out Special_Breaker );
- procedure Trip ( The_Breaker : in out Special_Breaker );
- procedure Reset( The_Breaker : in out Special_Breaker );
- procedure Fail ( The_Breaker : in out Special_Breaker );
-
- function Status_Of( The_Breaker : Special_Breaker ) return C3A2001_1.Status;
- function On_Backup( The_Breaker : Special_Breaker ) return Boolean;
-
-private
- type Special_Breaker is new C3A2001_2.Basic_Breaker with record
- Backup : C3A2001_2.Basic_Breaker;
- end record;
-end C3A2001_4;
-
-----------------------------------------------------------------------------
-
-with TCTouch;
-package body C3A2001_4 is
-
- function Construct( Voltage : C3A2001_2.Voltages;
- Amperage : C3A2001_2.Amps )
- return Special_Breaker is
- It: Special_Breaker;
- procedure Set_Root( It: in out C3A2001_2.Basic_Breaker ) is
- begin
- It := C3A2001_2.Construct( Voltage, Amperage );
- end Set_Root;
- begin
- TCTouch.Touch( 'i' ); --------------------------------------------- i
- Set_Root( C3A2001_2.Basic_Breaker( It ) );
- Set_Root( It.Backup );
- return It;
- end Construct;
-
- function Status_Of( It: C3A2001_1.Breaker ) return C3A2001_1.Status
- renames C3A2001_1.Status_Of;
-
- procedure Flip ( The_Breaker : in out Special_Breaker ) is
- begin
- TCTouch.Touch( 'j' ); --------------------------------------------- j
- case Status_Of( C3A2001_1.Breaker( The_Breaker )) is
- when C3A2001_1.Power_Off | C3A2001_1.Power_On =>
- C3A2001_2.Flip( C3A2001_2.Basic_Breaker( The_Breaker ) );
- when others =>
- C3A2001_2.Flip( The_Breaker.Backup );
- end case;
- end Flip;
-
- procedure Trip ( The_Breaker : in out Special_Breaker ) is
- begin
- TCTouch.Touch( 'k' ); --------------------------------------------- k
- case Status_Of( C3A2001_1.Breaker( The_Breaker )) is
- when C3A2001_1.Power_Off => null;
- when C3A2001_1.Power_On =>
- C3A2001_2.Reset( The_Breaker.Backup );
- C3A2001_2.Trip( C3A2001_2.Basic_Breaker( The_Breaker ) );
- when others =>
- C3A2001_2.Trip( The_Breaker.Backup );
- end case;
- end Trip;
-
- procedure Reset( The_Breaker : in out Special_Breaker ) is
- begin
- TCTouch.Touch( 'l' ); --------------------------------------------- l
- case Status_Of( C3A2001_1.Breaker( The_Breaker )) is
- when C3A2001_1.Tripped =>
- C3A2001_2.Reset( C3A2001_2.Basic_Breaker( The_Breaker ));
- when C3A2001_1.Failed =>
- C3A2001_2.Reset( The_Breaker.Backup );
- when C3A2001_1.Power_On | C3A2001_1.Power_Off =>
- null;
- end case;
- end Reset;
-
- procedure Fail ( The_Breaker : in out Special_Breaker ) is
- begin
- TCTouch.Touch( 'm' ); --------------------------------------------- m
- case Status_Of( C3A2001_1.Breaker( The_Breaker )) is
- when C3A2001_1.Failed =>
- C3A2001_2.Fail( The_Breaker.Backup );
- when others =>
- C3A2001_2.Fail( C3A2001_2.Basic_Breaker( The_Breaker ));
- C3A2001_2.Reset( The_Breaker.Backup );
- end case;
- end Fail;
-
- function Status_Of( The_Breaker : Special_Breaker )
- return C3A2001_1.Status is
- begin
- TCTouch.Touch( 'n' ); --------------------------------------------- n
- case Status_Of( C3A2001_1.Breaker( The_Breaker )) is
- when C3A2001_1.Power_On => return C3A2001_1.Power_On;
- when C3A2001_1.Power_Off => return C3A2001_1.Power_Off;
- when others =>
- return C3A2001_2.Status_Of( The_Breaker.Backup );
- end case;
- end Status_Of;
-
- function On_Backup( The_Breaker : Special_Breaker ) return Boolean is
- use C3A2001_2;
- use type C3A2001_1.Status;
- begin
- return Status_Of(Basic_Breaker(The_Breaker)) = C3A2001_1.Tripped
- or Status_Of(Basic_Breaker(The_Breaker)) = C3A2001_1.Failed;
- end On_Backup;
-
-end C3A2001_4;
-
-----------------------------------------------------------------------------
-
-with C3A2001_1;
-package C3A2001_5 is
-
- type Component is access C3A2001_1.Breaker'Class;
-
- type Circuit;
- type Connection is access Circuit;
-
- type Circuit is record
- The_Gadget : Component;
- Next : Connection;
- end record;
-
- procedure Flipper( The_Circuit : Connection );
- procedure Tripper( The_Circuit : Connection );
- procedure Restore( The_Circuit : Connection );
- procedure Failure( The_Circuit : Connection );
-
- Short : Connection := null;
-
-end C3A2001_5;
-
-----------------------------------------------------------------------------
-with Report;
-with TCTouch;
-with C3A2001_1, C3A2001_2, C3A2001_3, C3A2001_4;
-
-pragma Elaborate_All( Report, TCTouch,
- C3A2001_1, C3A2001_2, C3A2001_3, C3A2001_4 );
-
-package body C3A2001_5 is
-
- function Neww( Breaker: in C3A2001_1.Breaker'Class )
- return Component is
- begin
- return new C3A2001_1.Breaker'Class'( Breaker );
- end Neww;
-
- procedure Add( Gadget : in Component;
- To_Circuit : in out Connection) is
- begin
- To_Circuit := new Circuit'(Gadget,To_Circuit);
- end Add;
-
- procedure Flipper( The_Circuit : Connection ) is
- Probe : Connection := The_Circuit;
- begin
- while Probe /= null loop
- C3A2001_1.Flip( Probe.The_Gadget.all );
- Probe := Probe.Next;
- end loop;
- end Flipper;
-
- procedure Tripper( The_Circuit : Connection ) is
- Probe : Connection := The_Circuit;
- begin
- while Probe /= null loop
- C3A2001_1.Trip( Probe.The_Gadget.all );
- Probe := Probe.Next;
- end loop;
- end Tripper;
-
- procedure Restore( The_Circuit : Connection ) is
- Probe : Connection := The_Circuit;
- begin
- while Probe /= null loop
- C3A2001_1.Reset( Probe.The_Gadget.all );
- Probe := Probe.Next;
- end loop;
- end Restore;
-
- procedure Failure( The_Circuit : Connection ) is
- Probe : Connection := The_Circuit;
- begin
- while Probe /= null loop
- C3A2001_1.Fail( Probe.The_Gadget.all );
- Probe := Probe.Next;
- end loop;
- end Failure;
-
-begin
- Add( Neww( C3A2001_2.Construct( C3A2001_2.V440, C3A2001_2.A5 )), Short );
- Add( Neww( C3A2001_3.Construct( C3A2001_2.V110, C3A2001_2.A1 )), Short );
- Add( Neww( C3A2001_4.Construct( C3A2001_2.V12, C3A2001_2.A100 )), Short );
-end C3A2001_5;
-
-----------------------------------------------------------------------------
-
-with Report;
-with TCTouch;
-with C3A2001_5;
-procedure C3A2001 is
-
-begin -- Main test procedure.
-
- Report.Test ("C3A2001", "Check that an abstract type can be declared " &
- "and used. Check actual subprograms dispatch correctly" );
-
- -- This Validate call must be _after_ the call to Report.Test
- TCTouch.Validate( "cgcicc", "Adding" );
-
- C3A2001_5.Flipper( C3A2001_5.Short );
- TCTouch.Validate( "jbdbdbdb", "Flipping" );
-
- C3A2001_5.Tripper( C3A2001_5.Short );
- TCTouch.Validate( "kbfbeee", "Tripping" );
-
- C3A2001_5.Restore( C3A2001_5.Short );
- TCTouch.Validate( "lbfbfbfb", "Restoring" );
-
- C3A2001_5.Failure( C3A2001_5.Short );
- TCTouch.Validate( "mbafbaa", "Circuits Failing" );
-
- Report.Result;
-
-end C3A2001;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a2002.a b/gcc/testsuite/ada/acats/tests/c3/c3a2002.a
deleted file mode 100644
index 63ea7008b66..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a2002.a
+++ /dev/null
@@ -1,295 +0,0 @@
--- C3A2002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for X'Access of a general access type A, Program_Error is
--- raised if the accessibility level of X is deeper than that of A.
--- Check for the case where X denotes a view that is a dereference of an
--- access parameter, or a rename thereof.
---
--- Check for cases where the actual corresponding to X is:
--- (a) An allocator.
--- (b) An expression of a named access type.
--- (c) Obj'Access.
---
--- TEST DESCRIPTION:
--- In order to satisfy accessibility requirements, the designated
--- object X must be at the same or a less deep nesting level than the
--- general access type A -- X must "live" as long as A. Nesting
--- levels are the run-time nestings of masters: block statements;
--- subprogram, task, and entry bodies; and accept statements. Packages
--- are invisible to accessibility rules.
---
--- This test declares subprograms with access parameters, within which
--- 'Access is attempted on a dereference of the access parameter, and
--- assigned to an access object whose type A is declared at some nesting
--- level. The test verifies that Program_Error is raised if the actual
--- corresponding to the access parameter is:
---
--- (1) an allocator, and the accessibility level of the execution
--- of the called subprogram is deeper than that of the access
--- type A.
---
--- (2) an expression of a named access type, and the accessibility
--- level of the named access type is deeper than that of the
--- access type A.
---
--- (3) a reference to the Access attribute (e.g., X'Access), and
--- the accessibility level of X is deeper than that of the
--- access type A.
---
--- Note that the static nesting level of the actual corresponding to the
--- access parameter can be deeper than that of the type A -- it is
--- the run-time nesting that matters for accessibility rules. Consider
--- the case where the access type A is declared within the called
--- subprogram. The accessibility check will never fail, even if the
--- actual happens to have a deeper static nesting level:
---
--- procedure P (X: access T) is
--- type A is access all T; -- Static level = 2, e.g.
--- Acc : A := X.all'Access; -- Check should never fail.
--- begin null; end;
--- . . .
--- declare
--- Actual : aliased T; -- Static level = 3, e.g.
--- begin
--- P (Actual'Access);
--- end;
---
--- For the execution of P, the accessibility level of type A will
--- always be deeper than that of Actual, so there is no danger of a
--- dangling reference arising from the assignment to Acc. Thus,
--- X.all'Access is safe, even though the static nesting level of
--- Actual is deeper than that of A.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C3A2002_0 is
-
- type Desig is array (1 .. 10) of Integer;
-
- X0 : aliased Desig; -- Level = 0.
-
- type Acc_L0 is access all Desig; -- Level = 0.
- A0 : Acc_L0;
-
- type Result_Kind is (OK, P_E, O_E);
-
- procedure A_Is_Level_0 (X: access Desig; R : out Result_Kind);
- procedure Never_Fails (X: access Desig; R : out Result_Kind);
-
-end C3A2002_0;
-
-
- --==================================================================--
-
-package body C3A2002_0 is
-
- procedure A_Is_Level_0 (X : access Desig;
- R : out Result_Kind) is
- begin
- -- The accessibility level of the type of A0 is 0.
- A0 := X.all'Access;
- R := OK;
- exception
- when Program_Error =>
- R := P_E;
- when others =>
- R := O_E;
- end A_Is_Level_0;
-
- -----------------------------------------------
- procedure Never_Fails (X: access Desig;
- R : out Result_Kind) is
- type Acc_Local is access all Desig;
- AL : Acc_Local;
- begin
- -- X.all'Access below will always be safe, since the accessibility
- -- level (although not necessarily the static nesting depth) of the
- -- type of AL will always be deeper than or the same as that of the
- -- actual corresponding to Y.
- AL := X.all'Access;
- R := OK;
- exception
- when Program_Error =>
- R := P_E;
- when others =>
- R := O_E;
- end Never_Fails;
-
-end C3A2002_0;
-
-
- --==================================================================--
-
-
-with C3A2002_0;
-with Report;
-
-procedure C3A2002 is
-
- X1 : aliased C3A2002_0.Desig; -- Level = 1.
-
- type Acc_L1 is access all C3A2002_0.Desig; -- Level = 1.
- A1 : Acc_L1;
-
- Expr_L0 : C3A2002_0.Acc_L0 := C3A2002_0.X0'Access;
- Expr_L1 : Acc_L1 := X1'Access;
-
- Res : C3A2002_0.Result_Kind;
-
- use type C3A2002_0.Result_Kind;
-
- -----------------------------------------------
- procedure A_Is_Level_1 (X : access C3A2002_0.Desig;
- R : out C3A2002_0.Result_Kind) is
- -- Dereference of an access_to_object value is aliased.
- Ren : C3A2002_0.Desig renames X.all; -- Renaming of a dereference
- begin -- of an access parameter.
- -- The accessibility level of the type of A1 is 1.
- A1 := Ren'Access;
- R := C3A2002_0.OK;
- exception
- when Program_Error =>
- R := C3A2002_0.P_E;
- when others =>
- R := C3A2002_0.O_E;
- end A_Is_Level_1;
-
- -----------------------------------------------
- procedure Display_Results (Result : in C3A2002_0.Result_Kind;
- Expected: in C3A2002_0.Result_Kind;
- Message : in String) is
- begin
- if Result /= Expected then
- case Result is
- when C3A2002_0.OK => Report.Failed ("No exception raised: " &
- Message);
- when C3A2002_0.P_E => Report.Failed ("Program_Error raised: " &
- Message);
- when C3A2002_0.O_E => Report.Failed ("Unexpected exception " &
- "raised: " & Message);
- end case;
- end if;
- end Display_Results;
-
-begin -- C3A2002
-
- Report.Test ("C3A2002", "Check that, for X'Access of general access " &
- "type A, Program_Error is raised if the accessibility " &
- "level of X is deeper than that of A: X is an access " &
- "parameter; corresponding actual is an allocator, " &
- "expression of a named access type, Obj'Access, or a " &
- "rename thereof");
-
-
- -- Actual is X'Access:
-
- C3A2002_0.Never_Fails (C3A2002_0.X0'Access, Res);
- Display_Results (Res, C3A2002_0.OK, "X0'Access, local access type");
-
- C3A2002_0.A_Is_Level_0 (C3A2002_0.X0'Access, Res);
- Display_Results (Res, C3A2002_0.OK, "X0'Access, level 0 access type");
-
- C3A2002_0.A_Is_Level_0 (X1'Access, Res);
- Display_Results (Res, C3A2002_0.P_E, "X1'Access, level 0 access type");
-
- A_Is_Level_1 (X1'Access, Res);
- Display_Results (Res, C3A2002_0.OK, "X1'Access, level 1 access type");
-
-
- -- Actual is expression of a named access type:
-
- C3A2002_0.Never_Fails (Expr_L1, Res);
- Display_Results (Res, C3A2002_0.OK, "Expr_L1, local access type");
-
- C3A2002_0.A_Is_Level_0 (Expr_L1, Res);
- Display_Results (Res, C3A2002_0.P_E, "Expr_L1, level 0 access type");
-
- A_Is_Level_1 (Expr_L0, Res);
- Display_Results (Res, C3A2002_0.OK, "Expr_L0, level 1 access type");
-
- A_Is_Level_1 (Expr_L1, Res);
- Display_Results (Res, C3A2002_0.OK, "Expr_L1, level 1 access type");
-
- -- Actual is allocator (level of execution = 2):
-
- C3A2002_0.Never_Fails (new C3A2002_0.Desig, Res);
- Display_Results (Res, C3A2002_0.OK, "Allocator level 2, " &
- "local access type");
-
- -- Since actual is an allocator, its accessibility level is that of
- -- the execution of the called subprogram, i.e., level 2.
-
- C3A2002_0.A_Is_Level_0 (new C3A2002_0.Desig, Res);
- Display_Results (Res, C3A2002_0.P_E, "Allocator level 2, " &
- "level 0 access type");
-
- A_Is_Level_1 (new C3A2002_0.Desig, Res);
- Display_Results (Res, C3A2002_0.P_E, "Allocator level 2, " &
- "level 1 access type");
-
-
- Block_L2:
- declare
- X2 : aliased C3A2002_0.Desig; -- Level = 2.
- type Acc_L2 is access all C3A2002_0.Desig; -- Level = 2.
- Expr_L2 : Acc_L2 := X1'Access;
- begin
-
- -- Actual is X'Access:
-
- C3A2002_0.Never_Fails (X2'Access, Res);
- Display_Results (Res, C3A2002_0.OK, "X2'Access, local access type");
-
- C3A2002_0.A_Is_Level_0 (X2'Access, Res);
- Display_Results (Res, C3A2002_0.P_E, "X2'Access, level 0 access type");
-
-
- -- Actual is expression of a named access type:
-
- A_Is_Level_1 (Expr_L2, Res);
- Display_Results (Res, C3A2002_0.P_E, "Expr_L2, level 1 access type");
-
-
- -- Actual is allocator (level of execution = 3):
-
- C3A2002_0.Never_Fails (new C3A2002_0.Desig, Res);
- Display_Results (Res, C3A2002_0.OK, "Allocator level 3, " &
- "local access type");
-
- A_Is_Level_1 (new C3A2002_0.Desig, Res);
- Display_Results (Res, C3A2002_0.P_E, "Allocator level 3, " &
- "level 1 access type");
-
- end Block_L2;
-
- Report.Result;
-
-end C3A2002;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a2003.a b/gcc/testsuite/ada/acats/tests/c3/c3a2003.a
deleted file mode 100644
index deb92f1a8c5..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a2003.a
+++ /dev/null
@@ -1,329 +0,0 @@
--- C3A2003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for X'Access of a general access type A, Program_Error is
--- raised if the accessibility level of X is deeper than that of A.
--- Check for the case where X denotes a view that is a dereference of an
--- access parameter, or a rename thereof. Check for the case where X is
--- an access parameter and the corresponding actual is another access
--- parameter.
---
--- TEST DESCRIPTION:
--- In order to satisfy accessibility requirements, the designated
--- object X must be at the same or a less deep nesting level than the
--- general access type A -- X must "live" as long as A. Nesting
--- levels are the run-time nestings of masters: block statements;
--- subprogram, task, and entry bodies; and accept statements. Packages
--- are invisible to accessibility rules.
---
--- This test declares subprograms with access parameters, within which
--- 'Access is attempted on a dereference of an access parameter, and
--- assigned to an access object whose type A is declared at some nesting
--- level. The test verifies that Program_Error is raised if the actual
--- corresponding to the access parameter is another access parameter,
--- and the actual corresponding to this second access parameter is:
---
--- (1) an expression of a named access type, and the accessibility
--- level of the named access type is deeper than that of the
--- access type A.
---
--- (2) a reference to the Access attribute (e.g., X'Access), and
--- the accessibility level of X is deeper than that of the
--- access type A.
---
--- Note that the static nesting level of the actual corresponding to the
--- access parameter can be deeper than that of the type A -- it is
--- the run-time nesting that matters for accessibility rules. Consider
--- the case where the access type A is declared within the called
--- subprogram. The accessibility check will never fail, even if the
--- actual happens to have a deeper static nesting level:
---
--- procedure P (X: access T) is
--- type A is access all T; -- Static level = 2, e.g.
--- Acc : A := X.all'Access; -- Check should never fail.
--- begin null; end;
--- . . .
--- procedure Q (Y: access T) is
--- begin
--- P(Y);
--- end;
--- . . .
--- declare
--- Actual : aliased T; -- Static level = 3, e.g.
--- begin
--- Q (Actual'Access);
--- end;
---
--- For the execution of Q (and hence P), the accessibility level of
--- type A will always be deeper than that of Actual, so there is no
--- danger of a dangling reference arising from the assignment to
--- Acc. Thus, X.all'Access is safe, even though the static nesting
--- level of Actual is deeper than that of A.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 Jul 98 EDS Avoid optimization.
--- 28 Jun 02 RLB Added pragma Elaborate_All (Report);.
---!
-
-with report; use report; pragma Elaborate_All (report);
-package C3A2003_0 is
-
- type Desig is array (1 .. 10) of Integer;
-
- X0 : aliased Desig := (Desig'Range => Ident_Int(3)); -- Level = 0.
-
- type Acc_L0 is access all Desig; -- Level = 0.
- A0 : Acc_L0;
-
- type Result_Kind is (OK, P_E, O_E);
-
- procedure Target_Is_Level_0_Nest (Y: access Desig; S: out Result_Kind);
- procedure Never_Fails_Nest (Y: access Desig; S: out Result_Kind);
- procedure Never_Fails_Same (Y: access Desig; S: out Result_Kind);
-
-end C3A2003_0;
-
-
- --==================================================================--
-
-
-package body C3A2003_0 is
-
- procedure Target_Is_Level_0_Nest (Y: access Desig; S: out Result_Kind) is
-
-
- -- This procedure utilizes 'Access on a dereference of an access
- -- parameter, and assigned to an access object whose type A is
- -- declared at some nesting level. Program_Error is raised if
- -- the accessibility level of the operand type is deeper than that
- -- of the target type.
-
- procedure Nested (X: access Desig; R: out Result_Kind) is
- -- Dereference of an access_to_object value is aliased.
- Ren : Desig renames X.all; -- Renaming of a dereference
- begin -- of an access parameter.
- -- The accessibility level of type A0 is 0.
- A0 := Ren'Access;
- R := OK;
- exception
- when Program_Error =>
- R := P_E;
- when others =>
- R := O_E;
- end Nested;
-
- begin -- Target_Is_Level_0_Nest
- Nested (Y, S);
- end Target_Is_Level_0_Nest;
-
- ------------------------------------------------------------------
-
- procedure Never_Fails_Nest (Y: access Desig; S: out Result_Kind) is
-
- type Acc_Deeper is access all Desig;
- AD : Acc_Deeper;
-
- function Nested (X: access Desig) return Result_Kind is
- begin
- -- X.all'Access below will always be safe, since the accessibility
- -- level (although not necessarily the static nesting depth) of the
- -- type of AD will always be deeper than or the same as that of the
- -- actual corresponding to Y.
- AD := X.all'Access;
- if Ident_Int (AD(4)) /= 3 then --Avoid Optimization of AD
- FAILED ("Initial Values not correct.");
- end if;
- return OK;
- exception
- when Program_Error =>
- return P_E;
- when others =>
- return O_E;
- end Nested;
-
- begin -- Never_Fails_Nest
- S := Nested (Y);
- end Never_Fails_Nest;
-
- ------------------------------------------------------------------
-
- procedure Called_By_Never_Fails_Same
- (X: access Desig; R: out Result_Kind) is
- type Acc_Local is access all Desig;
- AL : Acc_Local;
-
- -- Dereference of an access_to_object value is aliased.
- Ren : Desig renames X.all; -- Renaming of a dereference
- begin -- of an access parameter.
- -- Ren'Access below will always be safe, since the accessibility
- -- level (although not necessarily the static nesting depth) of
- -- type of AL will always be deeper than or the same as that of the
- -- actual corresponding to Y.
- AL := Ren'Access;
- if Ident_Int (AL(4)) /= 3 then --Avoid Optimization of AL
- FAILED ("Initial Values not correct.");
- end if;
- R := OK;
- exception
- when Program_Error =>
- R := P_E;
- when others =>
- R := O_E;
- end Called_By_Never_Fails_Same;
-
- ------------------------------------------------------------------
-
- procedure Never_Fails_Same (Y: access Desig; S: out Result_Kind) is
- begin
- Called_By_Never_Fails_Same (Y, S);
- end Never_Fails_Same;
-
-end C3A2003_0;
-
-
- --==================================================================--
-
-
-with C3A2003_0;
-use C3A2003_0;
-
-with Report; use report;
-
-procedure C3A2003 is
-
- type Acc_L1 is access all Desig; -- Level = 1.
- A1 : Acc_L1;
- X1 : aliased Desig := (Desig'Range => Ident_Int(3));
- Res : Result_Kind;
-
-
- procedure Called_By_Target_L1 (X: access Desig; R: out Result_Kind) is
- begin
- -- The accessibility level of the type of A1 is 1.
- A1 := X.all'Access;
- if IDENT_INT (A1(4)) /= 3 then --Avoid optimization of A1
- FAILED ("Initial values not correct.");
- end if;
- R := OK;
- exception
- when Program_Error =>
- R := P_E;
- when others =>
- R := O_E;
- end Called_By_Target_L1;
-
- ------------------------------------------------------------------
-
- function Target_Is_Level_1_Same (Y: access Desig) return Result_Kind is
- S : Result_Kind;
- begin
- Called_By_Target_L1 (Y, S);
- return S;
- end Target_Is_Level_1_Same;
-
- ------------------------------------------------------------------
-
- procedure Display_Results (Result : in Result_Kind;
- Expected: in Result_Kind;
- Msg : in String) is
- begin
- if Result /= Expected then
- case Result is
- when OK => Report.Failed ("No exception raised: " & Msg);
- when P_E => Report.Failed ("Program_Error raised: " & Msg);
- when O_E => Report.Failed ("Unexpected exception raised: " & Msg);
- end case;
- end if;
- end Display_Results;
-
-begin -- C3A2003
-
- Report.Test ("C3A2003", "Check that, for X'Access of general access " &
- "type A, Program_Error is raised if the accessibility " &
- "level of X is deeper than that of A: X is an access " &
- "parameter; corresponding actual is another access " &
- "parameter");
-
-
- -- Accessibility level of actual is 0 (actual is X'Access):
-
- Never_Fails_Same (X0'Access, Res);
- Display_Results (Res, OK, "Never_Fails_Same, level 0 actual");
-
- Never_Fails_Nest (X0'Access, Res);
- Display_Results (Res, OK, "Target_L1_Nest, level 0 actual");
-
- Target_Is_Level_0_Nest (X0'Access, Res);
- Display_Results (Res, OK, "Target_L0_Nest, level 0 actual");
-
- Res := Target_Is_Level_1_Same (X0'Access);
- Display_Results (Res, OK, "Target_L1_Same, level 0 actual");
-
-
- -- Accessibility level of actual is 1 (actual is X'Access):
-
- Never_Fails_Same (X1'Access, Res);
- Display_Results (Res, OK, "Never_Fails_Same, level 1 actual");
-
- Never_Fails_Nest (X1'Access, Res);
- Display_Results (Res, OK, "Target_L1_Nest, level 1 actual");
-
- Target_Is_Level_0_Nest (X1'Access, Res);
- Display_Results (Res, P_E, "Target_L0_Nest, level 1 actual");
-
- Res := Target_Is_Level_1_Same (X1'Access);
- Display_Results (Res, OK, "Target_L1_Same, level 1 actual");
-
-
- Block_L2:
- declare
- X2 : aliased Desig := (Desig'Range => Ident_Int(3));
- type Acc_L2 is access all Desig; -- Level = 2.
- Expr_L2 : Acc_L2 := X2'Access;
- begin
-
- -- Accessibility level of actual is 2 (actual is expression of named
- -- access type):
-
- Never_Fails_Same (Expr_L2, Res);
- Display_Results (Res, OK, "Never_Fails_Same, level 2 actual");
-
- Never_Fails_Nest (Expr_L2, Res);
- Display_Results (Res, OK, "Target_L1_Nest, level 2 actual");
-
- Target_Is_Level_0_Nest (Expr_L2, Res);
- Display_Results (Res, P_E, "Target_L0_Nest, level 2 actual");
-
- Res := Target_Is_Level_1_Same (Expr_L2);
- Display_Results (Res, P_E, "Target_L1_Same, level 2 actual");
-
- end Block_L2;
-
- Report.Result;
-
-end C3A2003;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a2a01.a b/gcc/testsuite/ada/acats/tests/c3/c3a2a01.a
deleted file mode 100644
index 8271d486904..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a2a01.a
+++ /dev/null
@@ -1,367 +0,0 @@
--- C3A2A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for X'Access of a general access type A, Program_Error is
--- raised if the accessibility level of X is deeper than that of A.
--- Check for cases where X'Access occurs in an instance body, and A
--- is passed as an actual during instantiation.
---
--- TEST DESCRIPTION:
--- In order to satisfy accessibility requirements, the designated
--- object X must be at the same or a less deep nesting level than the
--- general access type A -- X must "live" as long as A. Nesting
--- levels are the run-time nestings of masters: block statements;
--- subprogram, task, and entry bodies; and accept statements. Packages
--- are invisible to accessibility rules.
---
--- This test declares three generic units, each of which has a formal
--- general access type:
---
--- (1) A generic package, in which X is declared in the specification,
--- and X'Access occurs within the declarative part of the body.
---
--- (2) A generic package, in which X is a formal in out object of a
--- tagged formal derived type, and X'Access occurs in the sequence
--- of statements of a nested subprogram.
---
--- (3) A generic procedure, in which X is a dereference of an access
--- parameter, and X'Access occurs in the sequence of statements.
---
--- The test verifies the following:
---
--- For (1), Program_Error is raised upon instantiation if the generic
--- package is instantiated at a deeper level than that of the general
--- access type passed as an actual. The exception is propagated to the
--- innermost enclosing master.
---
--- For (2), Program_Error is raised when the nested subprogram is
--- called if the object passed as an actual during instantiation of
--- the generic package has an accessibility level deeper than that of
--- the general access type passed as an actual. The exception is
--- handled within the nested subprogram. Also, check that
--- Program_Error is not raised if the level of the actual access type
--- is deeper than that of the actual object.
---
--- For (3), Program_Error is raised when the instance subprogram is
--- called if the object pointed to by the actual corresponding to
--- the access parameter has an accessibility level deeper than that of
--- the general access type passed as an actual during instantiation.
--- The exception is handled within the instance subprogram. Also,
--- check that Program_Error is not raised if the level of the actual
--- access type is deeper than that of the actual corresponding to the
--- access parameter.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F3A2A00.A
--- -> C3A2A01.A
---
---
--- CHANGE HISTORY:
--- 12 May 95 SAIC Initial prerelease version.
--- 10 Jul 95 SAIC Modified code to avoid dead variable optimization.
---
---!
-
-with F3A2A00;
-generic
- type FD is new F3A2A00.Array_Type;
- type FAF is access all FD;
-package C3A2A01_0 is
- X : aliased FD;
-
- procedure Dummy; -- Needed to allow package body.
-end C3A2A01_0;
-
-
- --==================================================================--
-
-
-with Report;
-package body C3A2A01_0 is
- Ptr : FAF := X'Access;
- Index : Integer := F3A2A00.Array_Type'First;
-
- procedure Dummy is
- begin
- null;
- end Dummy;
-begin
- -- Avoid optimization (dead variable removal of Ptr):
-
- if not Report.Equal (Ptr(Index).C, Ptr(Index).C) then -- Always false.
- Report.Failed ("Unexpected error in C3A2A01_0 instance");
- end if;
-end C3A2A01_0;
-
-
- --==================================================================--
-
-
-with F3A2A00;
-generic
- type FD is new F3A2A00.Tagged_Type with private;
- type FAF is access all FD;
- FObj : in out FD;
-package C3A2A01_1 is
- procedure Handle (R: out F3A2A00.TC_Result_Kind);
-end C3A2A01_1;
-
-
- --==================================================================--
-
-
-with Report;
-package body C3A2A01_1 is
-
- procedure Handle (R: out F3A2A00.TC_Result_Kind) is
- Ptr : FAF;
- begin
- Ptr := FObj'Access;
- R := F3A2A00.OK;
-
- -- Avoid optimization (dead variable removal of Ptr):
-
- if not Report.Equal (Ptr.C, Ptr.C) then -- Always false.
- Report.Failed ("Unexpected error in Handle");
- end if;
- exception
- when Program_Error => R := F3A2A00.P_E;
- when others => R := F3A2A00.O_E;
- end Handle;
-
-end C3A2A01_1;
-
-
- --==================================================================--
-
-
-with F3A2A00;
-generic
- type FD is new F3A2A00.Array_Type;
- type FAF is access all FD;
-procedure C3A2A01_2 (P: access FD; R: out F3A2A00.TC_Result_Kind);
-
-
- --==================================================================--
-
-
-with Report;
-procedure C3A2A01_2 (P: access FD; R: out F3A2A00.TC_Result_Kind) is
- Ptr : FAF;
- Index : Integer := F3A2A00.Array_Type'First;
-begin
- Ptr := P.all'Access;
- R := F3A2A00.OK;
-
- -- Avoid optimization (dead variable removal of Ptr):
-
- if not Report.Equal (Ptr(Index).C, Ptr(Index).C) then -- Always false.
- Report.Failed ("Unexpected error in C3A2A01_2 instance");
- end if;
-exception
- when Program_Error => R := F3A2A00.P_E;
- when others => R := F3A2A00.O_E;
-end C3A2A01_2;
-
-
- --==================================================================--
-
-
-with F3A2A00;
-with C3A2A01_0;
-with C3A2A01_1;
-with C3A2A01_2;
-
-with Report;
-procedure C3A2A01 is
-begin -- C3A2A01. -- [ Level = 1 ]
-
- Report.Test ("C3A2A01", "Run-time accessibility checks: instance " &
- "bodies. Type of X'Access is passed as actual to instance");
-
-
- SUBTEST1:
- declare -- [ Level = 2 ]
- Result : F3A2A00.TC_Result_Kind;
- begin -- SUBTEST1.
-
- declare -- [ Level = 3 ]
- type AccArr_L3 is access all F3A2A00.Array_Type;
- begin
- declare -- [ Level = 4 ]
- -- The accessibility level of Pack.X is that of the instantiation
- -- (4). The accessibility level of the actual access type used to
- -- instantiate Pack is 3. Therefore, the X'Access in Pack
- -- propagates Program_Error when the instance body is elaborated:
-
- package Pack is new C3A2A01_0 (F3A2A00.Array_Type, AccArr_L3);
- begin
- Result := F3A2A00.OK;
- end;
- exception
- when Program_Error => Result := F3A2A00.P_E; -- Expected result.
- when others => Result := F3A2A00.O_E;
- end;
-
- F3A2A00.TC_Display_Results (Result, F3A2A00.P_E, "SUBTEST #1");
-
- end SUBTEST1;
-
-
-
- SUBTEST2:
- declare -- [ Level = 2 ]
- Result : F3A2A00.TC_Result_Kind;
- begin -- SUBTEST2.
-
- declare -- [ Level = 3 ]
- -- The instantiation of C3A2A01_1 should NOT result in any
- -- exceptions.
-
- type AccTag_L3 is access all F3A2A00.Tagged_Type;
-
- package Pack_OK is new C3A2A01_1 (F3A2A00.Tagged_Type,
- AccTag_L3,
- F3A2A00.X_L0);
- begin
- -- The accessibility level of the actual object used to instantiate
- -- Pack_OK is 0. The accessibility level of the actual access type
- -- used to instantiate Pack_OK is 3. Therefore, the FObj'Access in
- -- Pack_OK.Handle does not raise an exception when the subprogram is
- -- called. If an exception is (incorrectly) raised, however, it is
- -- handled within the subprogram:
-
- Pack_OK.Handle (Result);
- end;
-
- F3A2A00.TC_Display_Results (Result, F3A2A00.OK, "SUBTEST #2");
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #2: Program_Error incorrectly raised " &
- "during instantiation of generic");
- when others =>
- Report.Failed ("SUBTEST #2: Unexpected exception raised " &
- "during instantiation of generic");
- end SUBTEST2;
-
-
-
- SUBTEST3:
- declare -- [ Level = 2 ]
- Result : F3A2A00.TC_Result_Kind;
- begin -- SUBTEST3.
-
- declare -- [ Level = 3 ]
- -- The instantiation of C3A2A01_1 should NOT result in any
- -- exceptions.
-
- X_L3: F3A2A00.Tagged_Type;
-
- package Pack_PE is new C3A2A01_1 (F3A2A00.Tagged_Type,
- F3A2A00.AccTag_L0,
- X_L3);
- begin
- -- The accessibility level of the actual object used to instantiate
- -- Pack_PE is 3. The accessibility level of the actual access type
- -- used to instantiate Pack_PE is 0. Therefore, the FObj'Access in
- -- Pack_OK.Handle raises Program_Error when the subprogram is
- -- called. The exception is handled within the subprogram:
-
- Pack_PE.Handle (Result);
- end;
-
- F3A2A00.TC_Display_Results (Result, F3A2A00.P_E, "SUBTEST #3");
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #3: Program_Error incorrectly raised " &
- "during instantiation of generic");
- when others =>
- Report.Failed ("SUBTEST #3: Unexpected exception raised " &
- "during instantiation of generic");
- end SUBTEST3;
-
-
-
- SUBTEST4:
- declare -- [ Level = 2 ]
- Result1 : F3A2A00.TC_Result_Kind;
- Result2 : F3A2A00.TC_Result_Kind;
- begin -- SUBTEST4.
-
- declare -- [ Level = 3 ]
- -- The instantiation of C3A2A01_2 should NOT result in any
- -- exceptions.
-
- X_L3: aliased F3A2A00.Array_Type;
- type AccArr_L3 is access all F3A2A00.Array_Type;
-
- procedure Proc is new C3A2A01_2 (F3A2A00.Array_Type, AccArr_L3);
- begin
- -- The accessibility level of Proc.P.all is that of the corresponding
- -- actual during the call (in this case 3). The accessibility level of
- -- the access type used to instantiate Proc is also 3. Therefore, the
- -- P.all'Access in Proc does not raise an exception when the
- -- subprogram is called. If an exception is (incorrectly) raised,
- -- however, it is handled within the subprogram:
-
- Proc (X_L3'Access, Result1);
-
- F3A2A00.TC_Display_Results (Result1, F3A2A00.OK,
- "SUBTEST #4: same levels");
-
- declare -- [ Level = 4 ]
- X_L4: aliased F3A2A00.Array_Type;
- begin
- -- Within this block, the accessibility level of the actual
- -- corresponding to Proc.P.all is 4. Therefore, the P.all'Access
- -- in Proc raises Program_Error when the subprogram is called. The
- -- exception is handled within the subprogram:
-
- Proc (X_L4'Access, Result2);
-
- F3A2A00.TC_Display_Results (Result2, F3A2A00.P_E,
- "SUBTEST #4: object at deeper level");
- end;
-
- end;
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #4: Program_Error incorrectly raised " &
- "during instantiation of generic");
- when others =>
- Report.Failed ("SUBTEST #4: Unexpected exception raised " &
- "during instantiation of generic");
- end SUBTEST4;
-
-
- Report.Result;
-
-end C3A2A01;
diff --git a/gcc/testsuite/ada/acats/tests/c3/c3a2a02.a b/gcc/testsuite/ada/acats/tests/c3/c3a2a02.a
deleted file mode 100644
index 23b2c1c5de8..00000000000
--- a/gcc/testsuite/ada/acats/tests/c3/c3a2a02.a
+++ /dev/null
@@ -1,396 +0,0 @@
--- C3A2A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for X'Access of a general access type A, Program_Error is
--- raised if the accessibility level of X is deeper than that of A.
--- Check for cases where X'Access occurs in an instance body, and A
--- is a type either declared inside the instance, or declared outside
--- the instance but not passed as an actual during instantiation.
---
--- TEST DESCRIPTION:
--- In order to satisfy accessibility requirements, the designated
--- object X must be at the same or a less deep nesting level than the
--- general access type A -- X must "live" as long as A. Nesting
--- levels are the run-time nestings of masters: block statements;
--- subprogram, task, and entry bodies; and accept statements. Packages
--- are invisible to accessibility rules.
---
--- This test declares three generic packages:
---
--- (1) One in which X is of a formal tagged derived type and declared
--- in the body, A is a type declared outside the instance, and
--- X'Access occurs in the declarative part of a nested subprogram.
---
--- (2) One in which X is a formal object of a tagged type, A is a
--- type declared outside the instance, and X'Access occurs in the
--- declarative part of the body.
---
--- (3) One in which there are two X's and two A's. In the first pair,
--- X is a formal in object of a tagged type, A is declared in the
--- specification, and X'Access occurs in the declarative part of
--- the body. In the second pair, X is of a formal derived type,
--- X and A are declared in the specification, and X'Access occurs
--- in the sequence of statements of the body.
---
--- The test verifies the following:
---
--- For (1), Program_Error is raised when the nested subprogram is
--- called, if the generic package is instantiated at a deeper level
--- than that of A. The exception is propagated to the innermost
--- enclosing master. Also, check that Program_Error is not raised
--- if the instantiation is at the same level as that of A.
---
--- For (2), Program_Error is raised upon instantiation if the object
--- passed as an actual during instantiation has an accessibility level
--- deeper than that of A. The exception is propagated to the innermost
--- enclosing master. Also, check that Program_Error is not raised if
--- the level of the actual object is not deeper than that of A.
---
--- For (3), Program_Error is not raised, for actual objects at
--- various accessibility levels (since A will have at least the same
--- accessibility level as X in all cases, no exception should ever
--- be raised).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F3A2A00.A
--- -> C3A2A02.A
---
---
--- CHANGE HISTORY:
--- 12 May 95 SAIC Initial prerelease version.
--- 10 Jul 95 SAIC Modified code to avoid dead variable optimization.
--- 26 Jun 98 EDS Added pragma Elaborate (C3A2A02_0) to package
--- package C3A2A02_3, in order to avoid possible
--- instantiation error.
---!
-
-with F3A2A00;
-generic
- type FD is new F3A2A00.Tagged_Type with private;
-package C3A2A02_0 is
- procedure Proc;
-end C3A2A02_0;
-
-
- --==================================================================--
-
-
-with Report;
-package body C3A2A02_0 is
- X : aliased FD;
-
- procedure Proc is
- Ptr : F3A2A00.AccTagClass_L0 := X'Access;
- begin
- -- Avoid optimization (dead variable removal of Ptr):
-
- if not Report.Equal (Ptr.C, Ptr.C) then -- Always false.
- Report.Failed ("Unexpected error in Proc");
- end if;
- end Proc;
-end C3A2A02_0;
-
-
- --==================================================================--
-
-
-with F3A2A00;
-generic
- FObj : in out F3A2A00.Tagged_Type;
-package C3A2A02_1 is
- procedure Dummy; -- Needed to allow package body.
-end C3A2A02_1;
-
-
- --==================================================================--
-
-
-with Report;
-package body C3A2A02_1 is
- Ptr : F3A2A00.AccTag_L0 := FObj'Access;
-
- procedure Dummy is
- begin
- null;
- end Dummy;
-begin
- -- Avoid optimization (dead variable removal of Ptr):
-
- if not Report.Equal (Ptr.C, Ptr.C) then -- Always false.
- Report.Failed ("Unexpected error in C3A2A02_1 instance");
- end if;
-end C3A2A02_1;
-
-
- --==================================================================--
-
-
-with F3A2A00;
-generic
- type FD is new F3A2A00.Array_Type;
- FObj : in F3A2A00.Tagged_Type;
-package C3A2A02_2 is
- type GAF is access all FD;
- type GAO is access constant F3A2A00.Tagged_Type;
- XG : aliased FD;
- PtrF : GAF;
- Index : Integer := FD'First;
-
- procedure Dummy; -- Needed to allow package body.
-end C3A2A02_2;
-
-
- --==================================================================--
-
-
-with Report;
-package body C3A2A02_2 is
- PtrO : GAO := FObj'Access;
-
- procedure Dummy is
- begin
- null;
- end Dummy;
-begin
- PtrF := XG'Access;
-
- -- Avoid optimization (dead variable removal of PtrO and/or PtrF):
-
- if not Report.Equal (PtrO.C, PtrO.C) then -- Always false.
- Report.Failed ("Unexpected error in C3A2A02_2 instance: PtrO");
- end if;
-
- if not Report.Equal (PtrF(Index).C, PtrF(Index).C) then -- Always false.
- Report.Failed ("Unexpected error in C3A2A02_2 instance: PtrF");
- end if;
-end C3A2A02_2;
-
-
- --==================================================================--
-
-
--- The instantiation of C3A2A02_0 should NOT result in any exceptions.
-
-with F3A2A00;
-with C3A2A02_0;
-pragma Elaborate (C3A2A02_0);
-package C3A2A02_3 is new C3A2A02_0 (F3A2A00.Tagged_Type);
-
-
- --==================================================================--
-
-
-with F3A2A00;
-with C3A2A02_0;
-with C3A2A02_1;
-with C3A2A02_2;
-with C3A2A02_3;
-
-with Report;
-procedure C3A2A02 is
-begin -- C3A2A02. -- [ Level = 1 ]
-
- Report.Test ("C3A2A02", "Run-time accessibility checks: instance " &
- "bodies. Type of X'Access is local or global to instance");
-
-
- SUBTEST1:
- declare -- [ Level = 2 ]
- Result1 : F3A2A00.TC_Result_Kind;
- Result2 : F3A2A00.TC_Result_Kind;
- begin -- SUBTEST1.
-
- declare -- [ Level = 3 ]
- package Pack_Same_Level renames C3A2A02_3;
- begin
- -- The accessibility level of Pack_Same_Level.X is that of the
- -- instance (0), not that of the renaming declaration. The level of
- -- the type of Pack_Same_Level.X'Access (F3A2A00.AccTagClass_L0) is
- -- 0. Therefore, the X'Access in Pack_Same_Level.Proc does not raise
- -- an exception when the subprogram is called. The level of execution
- -- of the subprogram is irrelevant:
-
- Pack_Same_Level.Proc;
- Result1 := F3A2A00.OK; -- Expected result.
- exception
- when Program_Error => Result1 := F3A2A00.P_E;
- when others => Result1 := F3A2A00.O_E;
- end;
-
- F3A2A00.TC_Display_Results (Result1, F3A2A00.OK,
- "SUBTEST #1 (same level)");
-
-
- declare -- [ Level = 3 ]
- -- The instantiation of C3A2A02_0 should NOT result in any
- -- exceptions.
-
- package Pack_Deeper_Level is new C3A2A02_0 (F3A2A00.Tagged_Type);
- begin
- -- The accessibility level of Pack_Deeper_Level.X is that of the
- -- instance (3). The level of the type of Pack_Deeper_Level.X'Access
- -- (F3A2A00.AccTagClass_L0) is 0. Therefore, the X'Access in
- -- Pack_Deeper_Level.Proc propagates Program_Error when the
- -- subprogram is called:
-
- Pack_Deeper_Level.Proc;
- Result2 := F3A2A00.OK;
- exception
- when Program_Error => Result2 := F3A2A00.P_E; -- Expected result.
- when others => Result2 := F3A2A00.O_E;
- end;
-
- F3A2A00.TC_Display_Results (Result2, F3A2A00.P_E,
- "SUBTEST #1: deeper level");
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #1: Program_Error incorrectly raised " &
- "during instantiation of generic");
- when others =>
- Report.Failed ("SUBTEST #1: Unexpected exception raised " &
- "during instantiation of generic");
- end SUBTEST1;
-
-
-
- SUBTEST2:
- declare -- [ Level = 2 ]
- Result1 : F3A2A00.TC_Result_Kind;
- Result2 : F3A2A00.TC_Result_Kind;
- begin -- SUBTEST2.
-
- declare -- [ Level = 3 ]
- X_L3 : F3A2A00.Tagged_Type;
- begin
- declare -- [ Level = 4 ]
- -- The accessibility level of the actual object corresponding to
- -- FObj in Pack_PE is 3. The level of the type of FObj'Access
- -- (F3A2A00.AccTag_L0) is 0. Therefore, the FObj'Access in Pack_PE
- -- propagates Program_Error when the instance body is elaborated:
-
- package Pack_PE is new C3A2A02_1 (X_L3);
- begin
- Result1 := F3A2A00.OK;
- end;
- exception
- when Program_Error => Result1 := F3A2A00.P_E; -- Expected result.
- when others => Result1 := F3A2A00.O_E;
- end;
-
- F3A2A00.TC_Display_Results (Result1, F3A2A00.P_E,
- "SUBTEST #2: deeper level");
-
-
- begin -- [ Level = 3 ]
- declare -- [ Level = 4 ]
- -- The accessibility level of the actual object corresponding to
- -- FObj in Pack_OK is 0. The level of the type of FObj'Access
- -- (F3A2A00.AccTag_L0) is also 0. Therefore, the FObj'Access in
- -- Pack_OK does not raise an exception when the instance body is
- -- elaborated:
-
- package Pack_OK is new C3A2A02_1 (F3A2A00.X_L0);
- begin
- Result2 := F3A2A00.OK; -- Expected result.
- end;
- exception
- when Program_Error => Result2 := F3A2A00.P_E;
- when others => Result2 := F3A2A00.O_E;
- end;
-
- F3A2A00.TC_Display_Results (Result2, F3A2A00.OK,
- "SUBTEST #2: same level");
-
- end SUBTEST2;
-
-
-
- SUBTEST3:
- declare -- [ Level = 2 ]
- Result1 : F3A2A00.TC_Result_Kind;
- Result2 : F3A2A00.TC_Result_Kind;
- begin -- SUBTEST3.
-
- declare -- [ Level = 3 ]
- X_L3 : F3A2A00.Tagged_Type;
- begin
- declare -- [ Level = 4 ]
- -- Since the accessibility level of the type of X'Access in
- -- both cases within Pack_OK1 is that of the instance, and since
- -- X is either passed as an actual (in which case its level will
- -- not be deeper than that of the instance) or is declared within
- -- the instance (in which case its level is the same as that of
- -- the instance), no exception should be raised when the instance
- -- body is elaborated:
-
- package Pack_OK1 is new C3A2A02_2 (F3A2A00.Array_Type, X_L3);
- begin
- Result1 := F3A2A00.OK; -- Expected result.
- end;
- exception
- when Program_Error => Result1 := F3A2A00.P_E;
- when others => Result1 := F3A2A00.O_E;
- end;
-
- F3A2A00.TC_Display_Results (Result1, F3A2A00.OK,
- "SUBTEST #3: 1st okay case");
-
-
- declare -- [ Level = 3 ]
- type My_Array is new F3A2A00.Array_Type;
- begin
- declare -- [ Level = 4 ]
- -- Since the accessibility level of the type of X'Access in
- -- both cases within Pack_OK2 is that of the instance, and since
- -- X is either passed as an actual (in which case its level will
- -- not be deeper than that of the instance) or is declared within
- -- the instance (in which case its level is the same as that of
- -- the instance), no exception should be raised when the instance
- -- body is elaborated:
-
- package Pack_OK2 is new C3A2A02_2 (My_Array, F3A2A00.X_L0);
- begin
- Result2 := F3A2A00.OK; -- Expected result.
- end;
- exception
- when Program_Error => Result2 := F3A2A00.P_E;
- when others => Result2 := F3A2A00.O_E;
- end;
-
- F3A2A00.TC_Display_Results (Result2, F3A2A00.OK,
- "SUBTEST #3: 2nd okay case");
-
-
- end SUBTEST3;
-
-
-
- Report.Result;
-
-end C3A2A02;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c410001.a b/gcc/testsuite/ada/acats/tests/c4/c410001.a
deleted file mode 100644
index 26555531b06..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c410001.a
+++ /dev/null
@@ -1,303 +0,0 @@
--- C410001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that evaluating an access to subprogram variable containing
--- the value null causes the exception Constraint_Error.
--- Check that the default value for objects of access to subprogram
--- types is null.
---
--- TEST DESCRIPTION:
--- This test defines a few simple access_to_subprogram types, and
--- objects of those types. It checks that the default values for
--- these objects is null, and that an attempt to make a subprogram
--- call via one of this objects containing a null value causes the
--- predefined exception Constraint_Error. The check is performed
---- both with the default null value, and with an explicitly assigned
--- null value, after the object has been used to successfully designate
--- and call a subprogram.
---
---
--- CHANGE HISTORY:
--- 05 APR 96 SAIC Initial version
--- 04 NOV 96 SAIC Revised for 2.1 release
--- 26 FEB 97 PWB.CTA Initialized variable before passing to function
---!
-
------------------------------------------------------------------ C410001_0
-
-package C410001_0 is
-
- -- used to "switch state" in the software
- Expect_Exception : Boolean;
-
- -- define a minimal mixture of access_to_subprogram types
-
- type Proc_Ref is access procedure;
-
- type Func_Ref is access function(I:Integer) return Integer;
-
- type Proc_Para_Ref is access procedure(P:Proc_Ref);
-
- type Func_Para_Ref is access function(F:Func_Ref) return Integer;
-
- type Prot_Proc_Ref is access protected procedure;
-
- type Prot_Func_Ref is access protected function return Boolean;
-
- -- define some subprograms for them to reference
-
- procedure Proc;
-
- function Func(I:Integer) return Integer;
-
- procedure Proc_Para( Param : Proc_Ref );
-
- function Func_Para( Param : Func_Ref ) return Integer;
-
- protected Prot_Obj is
- procedure Prot_Proc;
- function Prot_Func return Boolean;
- end Prot_Obj;
-
-end C410001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body C410001_0 is
-
- -- Note that some failing cases will cause duplicate failure messages;
- -- rather than have the procedure/function bodies be null, the error
- -- checking code makes for a reasonable anti-optimization feature.
-
- procedure Proc is
- begin
- if Expect_Exception then
- Report.Failed("Expected exception did not occur: Proc");
- end if;
- end Proc;
-
- function Func(I:Integer) return Integer is
- begin
- if Expect_Exception then
- Report.Failed("Expected exception did not occur: Func");
- end if;
- return Report.Ident_Int(I);
- end Func;
-
- procedure Proc_Para( Param : Proc_Ref ) is
- begin
-
- Param.all; -- call by explicit dereference
-
- if Expect_Exception then
- Report.Failed("Expected exception did not occur: Proc_Para");
- end if;
-
- exception
- when Constraint_Error =>
- if not Expect_Exception then
- Report.Failed("Unexpected Constraint_Error: Proc_Para");
- end if; -- else null; expected the exception
- when others => Report.Failed("Unexpected exception: Proc_Para");
- end Proc_Para;
-
- function Func_Para( Param : Func_Ref ) return Integer is
- begin
-
- return Param(1); -- call by implicit dereference
-
- if Expect_Exception then
- Report.Failed("Expected exception did not occur: Func_Para");
- end if;
- return 1; -- really just to avoid warnings
-
- exception
- when Constraint_Error =>
- if not Expect_Exception then
- Report.Failed("Unexpected Constraint_Error: Func_Para");
- return 0;
- else
- return 1995; -- any value other than this is unexpected
- end if;
- when others => Report.Failed("Unexpected exception: Func_Para");
- return -42;
- end Func_Para;
-
- protected body Prot_Obj is
-
- procedure Prot_Proc is
- begin
- if Expect_Exception then
- Report.Failed("Expected exception did not occur: Prot_Proc");
- end if;
- end Prot_Proc;
-
- function Prot_Func return Boolean is
- begin
- if Expect_Exception then
- Report.Failed("Expected exception did not occur: Prot_Func");
- end if;
- return Report.Ident_Bool( True );
- end Prot_Func;
-
- end Prot_Obj;
-
-end C410001_0;
-
-------------------------------------------------------------------- C410001
-
-with Report;
-with TCTouch;
-with C410001_0;
-procedure C410001 is
-
- Proc_Ref_Var : C410001_0.Proc_Ref;
-
- Func_Ref_Var : C410001_0.Func_Ref;
-
- Proc_Para_Ref_Var : C410001_0.Proc_Para_Ref;
-
- Func_Para_Ref_Var : C410001_0.Func_Para_Ref;
-
- type Enclosure is record
- Prot_Proc_Ref_Var : C410001_0.Prot_Proc_Ref;
- Prot_Func_Ref_Var : C410001_0.Prot_Func_Ref;
- end record;
-
- Enclosed : Enclosure;
-
- Valid_Proc : C410001_0.Proc_Ref := C410001_0.Proc'Access;
-
- Valid_Func : C410001_0.Func_Ref := C410001_0.Func'Access;
-
- procedure Make_Calls( Expecting_Exceptions : Boolean ) is
- type Case_Numbers is range 1..6;
- Some_Integer : Integer := 0;
- begin
- for Cases in Case_Numbers loop
- Catch_Exception : begin
- case Cases is
- when 1 => Proc_Ref_Var.all;
- when 2 => Some_Integer := Func_Ref_Var.all( Some_Integer );
- when 3 => Proc_Para_Ref_Var( Valid_Proc );
- when 4 => Some_Integer := Func_Para_Ref_Var( Valid_Func );
- when 5 => Enclosed.Prot_Proc_Ref_Var.all;
- when 6 => TCTouch.Assert( Enclosed.Prot_Func_Ref_Var.all
- /= Expecting_Exceptions,
- "Case 6");
- end case;
- if Expecting_Exceptions then
- Report.Failed("Exception expected: Case"
- & Case_Numbers'Image(Cases) );
- end if;
- exception
- when Constraint_Error =>
- if not Expecting_Exceptions then
- Report.Failed("Constraint_Error not expected: Case"
- & Case_Numbers'Image(Cases) );
- end if;
- when others =>
- Report.Failed("Wrong/Bad Exception: Case"
- & Case_Numbers'Image(Cases) );
- end Catch_Exception;
- end loop;
- end Make_Calls;
-
-begin -- Main test procedure.
-
- Report.Test ("C410001", "Check that evaluating an access to subprogram " &
- "variable containing the value null causes the " &
- "exception Constraint_Error. Check that the " &
- "default value for objects of access to " &
- "subprogram types is null" );
-
- -- check that the default values are null
- declare
- use C410001_0; -- make all "="'s visible for all types
- begin
- TCTouch.Assert( Proc_Ref_Var = null, "Proc_Ref_Var = null" );
-
- TCTouch.Assert( Func_Ref_Var = null, "Func_Ref_Var = null" );
-
- TCTouch.Assert( Proc_Para_Ref_Var = null, "Proc_Para_Ref_Var = null" );
-
- TCTouch.Assert( Func_Para_Ref_Var = null, "Func_Para_Ref_Var = null" );
-
- TCTouch.Assert( Enclosed.Prot_Proc_Ref_Var = null,
- "Enclosed.Prot_Proc_Ref_Var = null" );
-
- TCTouch.Assert( Enclosed.Prot_Func_Ref_Var = null,
- "Enclosed.Prot_Func_Ref_Var = null" );
- end;
-
- -- check that calls via the default values cause Constraint_Error
-
- C410001_0.Expect_Exception := True;
-
- Make_Calls( Expecting_Exceptions => True );
-
- -- assign non-null values to the objects
-
- Proc_Ref_Var := C410001_0.Proc'Access;
- Func_Ref_Var := C410001_0.Func'Access;
- Proc_Para_Ref_Var := C410001_0.Proc_Para'Access;
- Func_Para_Ref_Var := C410001_0.Func_Para'Access;
- Enclosed := (C410001_0.Prot_Obj.Prot_Proc'Access,
- C410001_0.Prot_Obj.Prot_Func'Access);
-
- -- check that the calls perform normally
-
- C410001_0.Expect_Exception := False;
-
- Make_Calls( Expecting_Exceptions => False );
-
- -- check that a passed null value causes Constraint_Error
-
- C410001_0.Expect_Exception := True;
-
- Proc_Para_Ref_Var( null );
-
- TCTouch.Assert( Func_Para_Ref_Var( null ) = 1995,
- "Func_Para_Ref_Var( null )");
-
- -- assign the null value to the objects
-
- Proc_Ref_Var := null;
- Func_Ref_Var := null;
- Proc_Para_Ref_Var := null;
- Func_Para_Ref_Var := null;
- Enclosed := (null,null);
-
- -- check that calls now again cause Constraint_Error
-
- C410001_0.Expect_Exception := True;
-
- Make_Calls( Expecting_Exceptions => True );
-
- Report.Result;
-
-end C410001;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c420001.a b/gcc/testsuite/ada/acats/tests/c4/c420001.a
deleted file mode 100644
index ae4b4d8fdcd..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c420001.a
+++ /dev/null
@@ -1,110 +0,0 @@
--- C420001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
--- F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
--- software and documentation contained herein. Unlimited rights are
--- defined in DFAR 252.227-7013(a)(19). By making this public release,
--- the Government intends to confer upon all recipients unlimited rights
--- equal to those held by the Government. These rights include rights to
--- use, duplicate, release or disclose the released technical data and
--- computer software in whole or in part, in any manner and for any purpose
--- whatsoever, and to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE
--- Check that if the index subtype of a string type is a modular subtype
--- whose lower bound is zero, then the evaluation of a null string_literal
--- raises Constraint_Error. This was confirmed by AI95-00138.
---
--- TEST DESCRIPTION
--- In this test, we have a generic formal modular type, and we have
--- several null string literals of that type. Because the type is
--- generic formal, the string literals are not static, and therefore
--- the Constraint_Error should be detected at run time.
---
--- CHANGE HISTORY:
--- 29 JUN 1999 RAD Initial Version
--- 23 SEP 1999 RLB Improved comments and messages, renamed, issued.
---
---!
-with Report; use Report; pragma Elaborate_All(Report);
-with System;
-procedure C420001 is
- generic
- type Modular is mod <>;
- package Mod_Test is
- type Str is array(Modular range <>) of Character;
- procedure Test_String_Literal;
- end Mod_Test;
-
- package body Mod_Test is
- procedure Test_String_Literal is
- begin
- begin
- declare
- Null_String: Str := ""; -- Should raise C_E.
- begin
- Comment(String(Null_String)); -- Avoid 11.6 issues.
- end;
- Failed("Null string didn't raise Constraint_Error");
- exception
- when Exc: Constraint_Error =>
- null; -- Comment("Constraint_Error -- OK");
- when Exc2: others =>
- Failed("Null string raised wrong exception");
- end;
- begin
- Failed(String(Str'(""))); -- Should raise C_E, not do Failed.
- Failed("Null string didn't raise Constraint_Error");
- exception
- when Exc: Constraint_Error =>
- null; -- Comment("Constraint_Error -- OK");
- when Exc2: others =>
- Failed("Null string raised wrong exception");
- end;
- end Test_String_Literal;
- begin
- Test_String_Literal;
- end Mod_Test;
-begin
- Test("C420001", "Check that if the index subtype of a string type is a " &
- "modular subtype whose lower bound is zero, then the " &
- "evaluation of a null string_literal raises " &
- "Constraint_Error. ");
- declare
- type M1 is mod 1;
- package Test_M1 is new Mod_Test(M1);
- type M2 is mod 2;
- package Test_M2 is new Mod_Test(M2);
- type M3 is mod 3;
- package Test_M3 is new Mod_Test(M3);
- type M4 is mod 4;
- package Test_M4 is new Mod_Test(M4);
- type M5 is mod 5;
- package Test_M5 is new Mod_Test(M5);
- type M6 is mod 6;
- package Test_M6 is new Mod_Test(M6);
- type M7 is mod 7;
- package Test_M7 is new Mod_Test(M7);
- type M8 is mod 8;
- package Test_M8 is new Mod_Test(M8);
- type M_Max_Binary_Modulus is mod System.Max_Binary_Modulus;
- package Test_M_Max_Binary_Modulus is new Mod_Test(M_Max_Binary_Modulus);
- type M_Max_Nonbinary_Modulus is mod System.Max_Nonbinary_Modulus;
- package Test_M_Max_Nonbinary_Modulus is new Mod_Test(M_Max_Nonbinary_Modulus);
- begin
- null;
- end;
- Result;
-end C420001;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c431001.a b/gcc/testsuite/ada/acats/tests/c4/c431001.a
deleted file mode 100644
index 7d417ce69d9..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c431001.a
+++ /dev/null
@@ -1,464 +0,0 @@
--- C431001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a record aggregate can be given for a nonprivate,
--- nonlimited record extension and that the tag of the aggregate
--- values are initialized to the tag of the record extension.
---
--- TEST DESCRIPTION:
--- From an initial parent tagged type, several type extensions
--- are declared. Each type extension adds components onto
--- the existing record structure.
---
--- In the main procedure, aggregates are declared in two ways.
--- In the declarative part, aggregates are used to supply
--- initial values for objects of specific types. In the executable
--- part, aggregates are used directly as actual parameters to
--- a class-wide formal parameter.
---
--- The abstraction is for a catalog of recordings. A recording
--- can be a CD or a record (vinyl). Additionally, a CD may also
--- be a CD-ROM, containing both music and data. This type is declared
--- as an extension to a type extension, to test that the inclusion
--- of record components is transitive across multiple extensions.
---
--- That the aggregate has the correct tag is verify by feeding
--- it to a dispatching operation and confirming that the
--- expected subprogram is called as a result. To accomplish this,
--- an enumeration type is declared with an enumeration literal
--- representing each of the declared types in the hierarchy. A value
--- of this type is passed as a parameter to the dispatching
--- operation which passes it along to the dispatched subprogram.
--- Each dispatched subprogram verifies that it received the
--- expected enumeration literal.
---
--- Not quite fitting the above abstraction are several test cases
--- for null records. These tests verify that the new syntax for
--- null record aggregates, (null record), is supported. A type is
--- declared which extends a null tagged type and adds components.
--- Aggregates of this type should include associations for the
--- components of the type extension only. Finally, a type is
--- declared that adds a null type extension onto a non-null tagged
--- type. The aggregate associations should remain the same.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Removed RM references from objective text.
---
---!
---
-package C431001_0 is
-
- -- Values of TC_Type_ID are passed through to dispatched subprogram
- -- calls so that it can be verified that the dispatching resulted in
- -- the expected call.
- type TC_Type_ID is (TC_Recording, TC_CD, TC_Vinyl, TC_CD_ROM);
-
- type Genre is (Classical, Country, Jazz, Rap, Rock, World);
-
- type Recording is tagged record
- Artist : String (1..20);
- Category : Genre;
- Length : Duration;
- Selections : Positive;
- end record;
-
- function Summary (R : in Recording;
- TC_Type : in TC_Type_ID) return String;
-
- type Recording_Method is (Audio, Digital);
- type CD is new Recording with record
- Recorded : Recording_Method;
- Mastered : Recording_Method;
- end record;
-
- function Summary (Disc : in CD;
- TC_Type : in TC_Type_ID) return String;
-
- type Playing_Speed is (LP_33, Single_45, Old_78);
- type Vinyl is new Recording with record
- Speed : Playing_Speed;
- end record;
-
- function Summary (Album : in Vinyl;
- TC_Type : in TC_Type_ID) return String;
-
-
- type CD_ROM is new CD with record
- Storage : Positive;
- end record;
-
- function Summary (Disk : in CD_ROM;
- TC_Type : in TC_Type_ID) return String;
-
- function Catalog_Entry (R : in Recording'Class;
- TC_Type : in TC_Type_ID) return String;
-
- procedure Print (S : in String); -- provides somewhere for the
- -- results of Catalog_Entry to
- -- "go", so they don't get
- -- optimized away.
-
- -- The types and procedures declared below are not a continuation
- -- of the Recording abstraction. These types are intended to test
- -- support for null tagged types and type extensions. TC_Check mirrors
- -- the operation of function Summary, above. Similarly, TC_Dispatch
- -- mirrors the operation of Catalog_Entry.
-
- type TC_N_Type_ID is
- (TC_Null_Tagged, TC_Null_Extension,
- TC_Extension_Of_Null, TC_Null_Extension_Of_Nonnull);
-
- type Null_Tagged is tagged null record;
- procedure TC_Check (N : in Null_Tagged;
- TC_Type : in TC_N_Type_ID);
-
- type Null_Extension is new Null_Tagged with null record;
- procedure TC_Check (N : in Null_Extension;
- TC_Type : in TC_N_Type_ID);
-
- type Extension_Of_Null is new Null_Tagged with record
- New_Component1 : Boolean;
- New_Component2 : Natural;
- end record;
- procedure TC_Check (N : in Extension_Of_Null;
- TC_Type : in TC_N_Type_ID);
-
- type Null_Extension_Of_Nonnull is new Extension_Of_Null
- with null record;
- procedure TC_Check (N : in Null_Extension_Of_Nonnull;
- TC_Type : in TC_N_Type_ID);
-
- procedure TC_Dispatch (N : in Null_Tagged'Class;
- TC_Type : in TC_N_Type_ID);
-
-end C431001_0;
-
-with Report;
-package body C431001_0 is
-
- function Summary (R : in Recording;
- TC_Type : in TC_Type_ID) return String is
- begin
-
- if TC_Type /= TC_Recording then
- Report.Failed ("Did not dispatch on tag for tagged parent " &
- "type Recording");
- end if;
-
- return R.Artist (1..10)
- & ' ' & Genre'Image (R.Category) (1..2)
- & ' ' & Duration'Image (R.Length)
- & ' ' & Integer'Image (R.Selections);
-
- end Summary;
-
- function Summary (Disc : in CD;
- TC_Type : in TC_Type_ID) return String is
- begin
-
- if TC_Type /= TC_CD then
- Report.Failed ("Did not dispatch on tag for type extension " &
- "CD");
- end if;
-
- return Summary (Recording (Disc), TC_Type => TC_Recording)
- & ' ' & Recording_Method'Image(Disc.Recorded)(1)
- & Recording_Method'Image(Disc.Mastered)(1);
-
- end Summary;
-
- function Summary (Album : in Vinyl;
- TC_Type : in TC_Type_ID) return String is
- begin
- if TC_Type /= TC_Vinyl then
- Report.Failed ("Did not dispatch on tag for type extension " &
- "Vinyl");
- end if;
-
- case Album.Speed is
- when LP_33 =>
- return Summary (Recording (Album), TC_Type => TC_Recording)
- & " 33";
- when Single_45 =>
- return Summary (Recording (Album), TC_Type => TC_Recording)
- & " 45";
- when Old_78 =>
- return Summary (Recording (Album), TC_Type => TC_Recording)
- & " 78";
- end case;
-
- end Summary;
-
- function Summary (Disk : in CD_ROM;
- TC_Type : in TC_Type_ID) return String is
- begin
- if TC_Type /= TC_CD_ROM then
- Report.Failed ("Did not dispatch on tag for type extension " &
- "CD_ROM. This is an extension of the type " &
- "extension CD");
- end if;
-
- return Summary (Recording(Disk), TC_Type => TC_Recording)
- & ' ' & Integer'Image (Disk.Storage) & 'K';
-
- end Summary;
-
- function Catalog_Entry (R : in Recording'Class;
- TC_Type : in TC_Type_ID) return String is
- begin
- return Summary (R, TC_Type); -- dispatched call
- end Catalog_Entry;
-
- procedure Print (S : in String) is
- T : String (1..S'Length) := Report.Ident_Str (S);
- begin
- -- Ada.Text_IO.Put_Line (S);
- null;
- end Print;
-
- -- Bodies for null type checks
- procedure TC_Check (N : in Null_Tagged;
- TC_Type : in TC_N_Type_ID) is
- begin
- if TC_Type /= TC_Null_Tagged then
- Report.Failed ("Did not dispatch on tag for null tagged " &
- "type Null_Tagged");
- end if;
- end TC_Check;
-
- procedure TC_Check (N : in Null_Extension;
- TC_Type : in TC_N_Type_ID) is
- begin
- if TC_Type /= TC_Null_Extension then
- Report.Failed ("Did not dispatch on tag for null tagged " &
- "type extension Null_Extension");
- end if;
- end TC_Check;
-
- procedure TC_Check (N : in Extension_Of_Null;
- TC_Type : in TC_N_Type_ID) is
- begin
- if TC_Type /= TC_Extension_Of_Null then
- Report.Failed
- ("Did not dispatch on tag for extension of null parent" &
- "type");
- end if;
- end TC_Check;
-
- procedure TC_Check (N : in Null_Extension_Of_Nonnull;
- TC_Type : in TC_N_Type_ID) is
- begin
- if TC_Type /= TC_Null_Extension_Of_Nonnull then
- Report.Failed
- ("Did not dispatch on tag for null extension of nonnull " &
- "parent type");
- end if;
- end TC_Check;
-
- procedure TC_Dispatch (N : in Null_Tagged'Class;
- TC_Type : in TC_N_Type_ID) is
- begin
- TC_Check (N, TC_Type); -- dispatched call
- end TC_Dispatch;
-
-end C431001_0;
-
-
-with C431001_0;
-with Report;
-procedure C431001 is
-
- -- Tagged type
- -- Named component associations
- DAT : C431001_0.Recording :=
- (Artist => "Aerosmith ",
- Category => C431001_0.Rock,
- Length => 48.5,
- Selections => 10);
-
- -- Type extensions
- -- Named component associations
- Disc1 : C431001_0.CD :=
- (Artist => "London Symphony ",
- Category => C431001_0.Classical,
- Length => 55.0,
- Selections => 4,
- Recorded => C431001_0.Digital,
- Mastered => C431001_0.Digital);
-
- -- Named component associations with others
- Disc2 : C431001_0.CD :=
- (Artist => "Pink Floyd ",
- Category => C431001_0.Rock,
- Length => 51.8,
- Selections => 5,
- others => C431001_0.Audio); -- Recorded
- -- Mastered
-
- -- Positional component associations
- Album1 : C431001_0.Vinyl :=
- ("Hammer ", -- Artist
- C431001_0.Rap, -- Category
- 46.2, -- Length
- 9, -- Selections
- C431001_0.LP_33); -- Speed
-
- -- Mixed positional and named component associations
- -- Named component associations out of order
- Album2 : C431001_0.Vinyl :=
- ("Balinese Gamelan ", -- Artist
- C431001_0.World, -- Category
- 42.6, -- Length
- 14, -- Selections
- C431001_0.LP_33); -- Speed
-
- -- Type extension, parent is also type extension
- -- Named notation, components out of order
- Data : C431001_0.CD_ROM :=
- (Storage => 140,
- Mastered => C431001_0.Digital,
- Category => C431001_0.Rock,
- Selections => 10,
- Recorded => C431001_0.Digital,
- Artist => "Black, Clint ",
- Length => 48.5);
-
- -- Null tagged type
- Null_Rec : C431001_0.Null_Tagged := (null record);
-
- -- Null type extension
- Null_Ext : C431001_0.Null_Extension := (null record);
-
- -- Nonnull extension of null parent
- Ext_Of_Null : C431001_0.Extension_Of_Null := (True, 0);
-
- -- Null extension of nonnull parent
- Null_Ext_Of_Nonnull : C431001_0.Null_Extension_Of_Nonnull
- := (False, 1);
-
-begin
-
- Report.Test ("C431001", "Aggregate values for type extensions");
-
- C431001_0.Print (C431001_0.Catalog_Entry (DAT, C431001_0.TC_Recording));
- C431001_0.Print (C431001_0.Catalog_Entry (Disc1, C431001_0.TC_CD));
- C431001_0.Print (C431001_0.Catalog_Entry (Disc2, C431001_0.TC_CD));
- C431001_0.Print (C431001_0.Catalog_Entry (Album1, C431001_0.TC_Vinyl));
- C431001_0.Print (C431001_0.Catalog_Entry (Album2, C431001_0.TC_Vinyl));
- C431001_0.Print (C431001_0.Catalog_Entry (Data, C431001_0.TC_CD_ROM));
-
- C431001_0.TC_Dispatch (Null_Rec, C431001_0.TC_Null_Tagged);
- C431001_0.TC_Dispatch (Null_Ext, C431001_0.TC_Null_Extension);
- C431001_0.TC_Dispatch (Ext_Of_Null, C431001_0.TC_Extension_Of_Null);
- C431001_0.TC_Dispatch
- (Null_Ext_Of_Nonnull, C431001_0.TC_Null_Extension_Of_Nonnull);
-
- -- Tagged type
- -- Named component associations
- C431001_0.Print (C431001_0.Catalog_Entry
- (TC_Type => C431001_0.TC_Recording,
- R => C431001_0.Recording'(Artist => "Zappa, Frank ",
- Category => C431001_0.Rock,
- Length => 70.0,
- Selections => 38)));
-
- -- Type extensions
- -- Named component associations
- C431001_0.Print (C431001_0.Catalog_Entry
- (TC_Type => C431001_0.TC_CD,
- R => C431001_0.CD'(Artist => "Dog, Snoop Doggy ",
- Category => C431001_0.Rap,
- Length => 37.3,
- Selections => 8,
- Recorded => C431001_0.Audio,
- Mastered => C431001_0.Digital)));
-
- -- Named component associations with others
- C431001_0.Print (C431001_0.Catalog_Entry
- (TC_Type => C431001_0.TC_CD,
- R => C431001_0.CD'(Artist => "Judd, Winona ",
- Category => C431001_0.Country,
- Length => 51.2,
- Selections => 11,
- others => C431001_0.Digital))); -- Recorded
- -- Mastered
-
- -- Positional component associations
- C431001_0.Print (C431001_0.Catalog_Entry
- (TC_Type => C431001_0.TC_Vinyl,
- R => C431001_0.Vinyl'("Davis, Miles ", -- Artist
- C431001_0.Jazz, -- Category
- 50.4, -- Length
- 10, -- Selections
- C431001_0.LP_33))); -- Speed
-
- -- Mixed positional and named component associations
- -- Named component associations out of order
- C431001_0.Print (C431001_0.Catalog_Entry
- (TC_Type => C431001_0.TC_Vinyl,
- R => C431001_0.Vinyl'("Zamfir ", -- Artist
- C431001_0.World, -- Category
- Speed => C431001_0.LP_33,
- Selections => 14,
- Length => 56.5)));
-
- -- Type extension, parent is also type extension
- -- Named notation, components out of order
- C431001_0.Print (C431001_0.Catalog_Entry
- (TC_Type => C431001_0.TC_CD_ROM,
- R => C431001_0.CD_ROM'(Storage => 720,
- Category => C431001_0.Classical,
- Recorded => C431001_0.Digital,
- Artist => "Baltimore Symphony ",
- Length => 68.9,
- Mastered => C431001_0.Digital,
- Selections => 5)));
-
- -- Null tagged type
- C431001_0.TC_Dispatch
- (TC_Type => C431001_0.TC_Null_Tagged,
- N => C431001_0.Null_Tagged'(null record));
-
- -- Null type extension
- C431001_0.TC_Dispatch
- (TC_Type => C431001_0.TC_Null_Extension,
- N => C431001_0.Null_Extension'(null record));
-
- -- Nonnull extension of null parent
- C431001_0.TC_Dispatch
- (TC_Type => C431001_0.TC_Extension_Of_Null,
- N => C431001_0.Extension_Of_Null'(True, 3));
-
- -- Null extension of nonnull parent
- C431001_0.TC_Dispatch
- (TC_Type => C431001_0.TC_Extension_Of_Null,
- N => C431001_0.Extension_Of_Null'(False, 4));
-
- Report.Result;
-
-end C431001;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c432001.a b/gcc/testsuite/ada/acats/tests/c4/c432001.a
deleted file mode 100644
index dab75b388f5..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c432001.a
+++ /dev/null
@@ -1,512 +0,0 @@
--- C432001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
---
--- Check that extension aggregates may be used to specify values
--- for types that are record extensions. Check that the
--- type of the ancestor expression may be any nonlimited type that
--- is a record extension, including private types and private
--- extensions. Check that the type for the aggregate is
--- derived from the type of the ancestor expression.
---
--- TEST DESCRIPTION:
---
--- Two progenitor nonlimited record types are declared, one
--- nonprivate and one private. Using these as parent types,
--- all possible combinations of record extensions are declared
--- (Nonprivate record extension of nonprivate type, private
--- extension of nonprivate type, nonprivate record extension of
--- private type, and private extension of private type). Finally,
--- each of these types is extended using nonprivate record
--- extensions.
---
--- Extension of private types is done in packages other than
--- the ones containing the parent declaration. This is done
--- to eliminate errors with extension of the partial view of
--- a type, which is not an objective of this test.
---
--- All components of private types and private extensions are given
--- default values. This eliminates the need for separate subprograms
--- whose sole purpose is to place a value into a private record type.
---
--- Types that have been extended are checked using an object of their
--- parent type as the ancestor expression. For those types that
--- have been extended twice, using only nonprivate record extensions,
--- a check is made using an object of their grandparent type as
--- the ancestor expression.
---
--- For each type, a subprogram is defined which checks the contents
--- of the parameter, which is a value of the record extension.
--- Components of nonprivate record extensions are checked against
--- passed-in parameters of the component type. Components of private
--- extensions are checked to ensure that they maintain their initial
--- values.
---
--- To check that the aggregate's type is derived from its ancestor,
--- each Check subprogram in turn calls the Check subprogram for
--- its parent type. Explicit conversion is used to convert the
--- record extension to the parent type.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-package C432001_0 is
-
- type Eras is (Precambrian, Paleozoic, Mesozoic, Cenozoic);
-
- type N is tagged record
- How_Long_Ago : Natural := Report.Ident_Int(1);
- Era : Eras := Cenozoic;
- end record;
-
- function Check (Rec : in N;
- N : in Natural;
- E : in Eras) return Boolean;
-
- type P is tagged private;
-
- function Check (Rec : in P) return Boolean;
-
-private
-
- type P is tagged record
- How_Long_Ago : Natural := Report.Ident_Int(150);
- Era : Eras := Mesozoic;
- end record;
-
-end C432001_0;
-
-package body C432001_0 is
-
- function Check (Rec : in P) return Boolean is
- begin
- return Rec.How_Long_Ago = 150 and Rec.Era = Mesozoic;
- end Check;
-
- function Check (Rec : in N;
- N : in Natural;
- E : in Eras) return Boolean is
- begin
- return Rec.How_Long_Ago = N and Rec.Era = E;
- end Check;
-
-end C432001_0;
-
-with C432001_0;
-package C432001_1 is
-
- type Periods is
- (Aphebian, Helikian, Hadrynian,
- Cambrian, Ordovician, Silurian, Devonian, Carboniferous, Permian,
- Triassic, Jurassic, Cretaceous,
- Tertiary, Quaternary);
-
- type N_N is new C432001_0.N with record
- Period : Periods := C432001_1.Quaternary;
- end record;
-
- function Check (Rec : in N_N;
- N : in Natural;
- E : in C432001_0.Eras;
- P : in Periods) return Boolean;
-
- type N_P is new C432001_0.N with private;
-
- function Check (Rec : in N_P) return Boolean;
-
- type P_N is new C432001_0.P with record
- Period : Periods := C432001_1.Jurassic;
- end record;
-
- function Check (Rec : in P_N;
- P : in Periods) return Boolean;
-
- type P_P is new C432001_0.P with private;
-
- function Check (Rec : in P_P) return Boolean;
-
- type P_P_Null is new C432001_0.P with null record;
-
-private
-
- type N_P is new C432001_0.N with record
- Period : Periods := C432001_1.Quaternary;
- end record;
-
- type P_P is new C432001_0.P with record
- Period : Periods := C432001_1.Jurassic;
- end record;
-
-end C432001_1;
-
-with Report;
-package body C432001_1 is
-
- function Check (Rec : in N_N;
- N : in Natural;
- E : in C432001_0.Eras;
- P : in Periods) return Boolean is
- begin
- if not C432001_0.Check (C432001_0.N (Rec), N, E) then
- Report.Failed ("Conversion to parent type of " &
- "nonprivate portion of " &
- "nonprivate extension failed");
- end if;
- return Rec.Period = P;
- end Check;
-
-
- function Check (Rec : in N_P) return Boolean is
- begin
- if not C432001_0.Check (C432001_0.N (Rec), 1, C432001_0.Cenozoic) then
- Report.Failed ("Conversion to parent type of " &
- "nonprivate portion of " &
- "private extension failed");
- end if;
- return Rec.Period = C432001_1.Quaternary;
- end Check;
-
- function Check (Rec : in P_N;
- P : in Periods) return Boolean is
- begin
- if not C432001_0.Check (C432001_0.P (Rec)) then
- Report.Failed ("Conversion to parent type of " &
- "private portion of " &
- "nonprivate extension failed");
- end if;
- return Rec.Period = P;
- end Check;
-
- function Check (Rec : in P_P) return Boolean is
- begin
- if not C432001_0.Check (C432001_0.P (Rec)) then
- Report.Failed ("Conversion to parent type of " &
- "private portion of " &
- "private extension failed");
- end if;
- return Rec.Period = C432001_1.Jurassic;
- end Check;
-
-end C432001_1;
-
-with C432001_0;
-with C432001_1;
-package C432001_2 is
-
- -- All types herein are nonprivate extensions, since aggregates
- -- cannot be given for private extensions
-
- type N_N_N is new C432001_1.N_N with record
- Sample_On_Loan : Boolean;
- end record;
-
- function Check (Rec : in N_N_N;
- N : in Natural;
- E : in C432001_0.Eras;
- P : in C432001_1.Periods;
- B : in Boolean) return Boolean;
-
- type N_P_N is new C432001_1.N_P with record
- Sample_On_Loan : Boolean;
- end record;
-
- function Check (Rec : in N_P_N;
- B : Boolean) return Boolean;
-
- type P_N_N is new C432001_1.P_N with record
- Sample_On_Loan : Boolean;
- end record;
-
- function Check (Rec : in P_N_N;
- P : in C432001_1.Periods;
- B : Boolean) return Boolean;
-
- type P_P_N is new C432001_1.P_P with record
- Sample_On_Loan : Boolean;
- end record;
-
- function Check (Rec : in P_P_N;
- B : Boolean) return Boolean;
-
-end C432001_2;
-
-with Report;
-package body C432001_2 is
-
- -- direct access to operator
- use type C432001_1.Periods;
-
-
- function Check (Rec : in N_N_N;
- N : in Natural;
- E : in C432001_0.Eras;
- P : in C432001_1.Periods;
- B : in Boolean) return Boolean is
- begin
- if not C432001_1.Check (C432001_1.N_N (Rec), N, E, P) then
- Report.Failed ("Conversion to parent " &
- "nonprivate type extension " &
- "failed");
- end if;
- return Rec.Sample_On_Loan = B;
- end Check;
-
-
- function Check (Rec : in N_P_N;
- B : Boolean) return Boolean is
- begin
- if not C432001_1.Check (C432001_1.N_P (Rec)) then
- Report.Failed ("Conversion to parent " &
- "private type extension " &
- "failed");
- end if;
- return Rec.Sample_On_Loan = B;
- end Check;
-
- function Check (Rec : in P_N_N;
- P : in C432001_1.Periods;
- B : Boolean) return Boolean is
- begin
- if not C432001_1.Check (C432001_1.P_N (Rec), P) then
- Report.Failed ("Conversion to parent " &
- "nonprivate type extension " &
- "failed");
- end if;
- return Rec.Sample_On_Loan = B;
- end Check;
-
- function Check (Rec : in P_P_N;
- B : Boolean) return Boolean is
- begin
- if not C432001_1.Check (C432001_1.P_P (Rec)) then
- Report.Failed ("Conversion to parent " &
- "private type extension " &
- "failed");
- end if;
- return Rec.Sample_On_Loan = B;
- end Check;
-
-end C432001_2;
-
-
-with C432001_0;
-with C432001_1;
-with C432001_2;
-with Report;
-procedure C432001 is
-
- N_Object : C432001_0.N := (How_Long_Ago => Report.Ident_Int(375),
- Era => C432001_0.Paleozoic);
-
- P_Object : C432001_0.P; -- default value is (150,
- -- C432001_0.Mesozoic)
-
- N_N_Object : C432001_1.N_N :=
- (N_Object with Period => C432001_1.Devonian);
-
- P_N_Object : C432001_1.P_N :=
- (P_Object with Period => C432001_1.Jurassic);
-
- N_P_Object : C432001_1.N_P; -- default is (1,
- -- C432001_0.Cenozoic,
- -- C432001_1.Quaternary)
-
- P_P_Object : C432001_1.P_P; -- default is (150,
- -- C432001_0.Mesozoic,
- -- C432001_1.Jurassic)
-
- P_P_Null_Ob:C432001_1.P_P_Null := (P_Object with null record);
-
- N_N_N_Object : C432001_2.N_N_N :=
- (N_N_Object with Sample_On_Loan => Report.Ident_Bool(True));
-
- N_P_N_Object : C432001_2.N_P_N :=
- (N_P_Object with Sample_On_Loan => Report.Ident_Bool(False));
-
- P_N_N_Object : C432001_2.P_N_N :=
- (P_N_Object with Sample_On_Loan => Report.Ident_Bool(True));
-
- P_P_N_Object : C432001_2.P_P_N :=
- (P_P_Object with Sample_On_Loan => Report.Ident_Bool(False));
-
- P_N_Object_2 : C432001_1.P_N := (C432001_0.P(P_N_N_Object)
- with C432001_1.Carboniferous);
-
- N_N_Object_2 : C432001_1.N_N := (C432001_0.N'(42,C432001_0.Precambrian)
- with C432001_1.Carboniferous);
-
-begin
-
- Report.Test ("C432001", "Extension aggregates");
-
- -- check ultimate ancestor types
-
- if not C432001_0.Check (N_Object,
- 375,
- C432001_0.Paleozoic) then
- Report.Failed ("Object of " &
- "nonprivate type " &
- "failed content check");
- end if;
-
- if not C432001_0.Check (P_Object) then
- Report.Failed ("Object of " &
- "private type " &
- "failed content check");
- end if;
-
- -- check direct type extensions
-
- if not C432001_1.Check (N_N_Object,
- 375,
- C432001_0.Paleozoic,
- C432001_1.Devonian) then
- Report.Failed ("Object of " &
- "nonprivate extension of nonprivate type " &
- "failed content check");
- end if;
-
- if not C432001_1.Check (N_P_Object) then
- Report.Failed ("Object of " &
- "private extension of nonprivate type " &
- "failed content check");
- end if;
-
- if not C432001_1.Check (P_N_Object,
- C432001_1.Jurassic) then
- Report.Failed ("Object of " &
- "nonprivate extension of private type " &
- "failed content check");
- end if;
-
- if not C432001_1.Check (P_P_Object) then
- Report.Failed ("Object of " &
- "private extension of private type " &
- "failed content check");
- end if;
-
- if not C432001_1.Check (P_P_Null_Ob) then
- Report.Failed ("Object of " &
- "private type " &
- "failed content check");
- end if;
-
-
- -- check direct extensions of extensions
-
- if not C432001_2.Check (N_N_N_Object,
- 375,
- C432001_0.Paleozoic,
- C432001_1.Devonian,
- True) then
- Report.Failed ("Object of " &
- "nonprivate extension of nonprivate extension " &
- "(of nonprivate parent) " &
- "failed content check");
- end if;
-
- if not C432001_2.Check (N_P_N_Object, False) then
- Report.Failed ("Object of " &
- "nonprivate extension of private extension " &
- "(of nonprivate parent) " &
- "failed content check");
- end if;
-
- if not C432001_2.Check (P_N_N_Object,
- C432001_1.Jurassic,
- True) then
- Report.Failed ("Object of " &
- "nonprivate extension of nonprivate extension " &
- "(of private parent) " &
- "failed content check");
- end if;
-
- if not C432001_2.Check (P_P_N_Object, False) then
- Report.Failed ("Object of " &
- "nonprivate extension of private extension " &
- "(of private parent) " &
- "failed content check");
- end if;
-
- -- check that the extension aggregate may specify an expression of
- -- a "grandparent" ancestor type
-
- -- types tested are derived through nonprivate extensions only
- -- (extension aggregates are not allowed if the path from the
- -- ancestor type wanders through a private extension)
-
- N_N_N_Object :=
- (N_Object with Period => C432001_1.Devonian,
- Sample_On_Loan => Report.Ident_Bool(True));
-
- if not C432001_2.Check (N_N_N_Object,
- 375,
- C432001_0.Paleozoic,
- C432001_1.Devonian,
- True) then
- Report.Failed ("Object of " &
- "nonprivate extension " &
- "of nonprivate ancestor " &
- "failed content check");
- end if;
-
- P_N_N_Object :=
- (P_Object with Period => C432001_1.Jurassic,
- Sample_On_Loan => Report.Ident_Bool(True));
-
- if not C432001_2.Check (P_N_N_Object,
- C432001_1.Jurassic,
- True) then
- Report.Failed ("Object of " &
- "nonprivate extension " &
- "of private ancestor " &
- "failed content check");
- end if;
-
- -- Check additional cases
- if not C432001_1.Check (P_N_Object_2,
- C432001_1.Carboniferous) then
- Report.Failed ("Additional Object of " &
- "nonprivate extension of private type " &
- "failed content check");
- end if;
-
- if not C432001_1.Check (N_N_Object_2,
- 42,
- C432001_0.Precambrian,
- C432001_1.Carboniferous) then
- Report.Failed ("Additional Object of " &
- "nonprivate extension of nonprivate type " &
- "failed content check");
- end if;
-
- Report.Result;
-
-end C432001;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c432002.a b/gcc/testsuite/ada/acats/tests/c4/c432002.a
deleted file mode 100644
index 5de821b3052..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c432002.a
+++ /dev/null
@@ -1,764 +0,0 @@
--- C432002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if an extension aggregate specifies a value for a record
--- extension and the ancestor expression has discriminants that are
--- inherited by the record extension, then a check is made that each
--- discriminant has the value specified.
---
--- Check that if an extension aggregate specifies a value for a record
--- extension and the ancestor expression has discriminants that are not
--- inherited by the record extension, then a check is made that each
--- such discriminant has the value specified for the corresponding
--- discriminant.
---
--- Check that the corresponding discriminant value may be specified
--- in the record component association list or in the derived type
--- definition for an ancestor.
---
--- Check the case of ancestors that are several generations removed.
--- Check the case where the value of the discriminant(s) in question
--- is supplied several generations removed.
---
--- Check the case of multiple discriminants.
---
--- Check that Constraint_Error is raised if the check fails.
---
--- TEST DESCRIPTION:
--- A hierarchy of tagged types is declared from a discriminated
--- root type. Each level declares two kinds of types: (1) a type
--- extension which constrains the discriminant of its parent to
--- the value of an expression and (2) a type extension that
--- constrains the discriminant of its parent to equal a new discriminant
--- of the type extension (These are the two categories of noninherited
--- discriminants).
---
--- Values for each type are declared within nested blocks. This is
--- done so that the instances that produce Constraint_Error may
--- be dealt with cleanly without forcing the program to exit.
---
--- Success and failure cases (which should raise Constraint_Error)
--- are set up for each kind of type. Additionally, for the first
--- level of the hierarchy, separate tests are done for ancestor
--- expressions specified by aggregates and those specified by
--- variables. Later tests are performed using variables only.
---
--- Additionally, the cases tested consist of the following kinds of
--- types:
---
--- Extensions of extensions, using both the parent and grandparent
--- types for the ancestor expression,
---
--- Ancestor expressions which are several generations removed
--- from the type of the aggregate,
---
--- Extensions of types with multiple discriminants, where the
--- extension declares a new discriminant which corresponds to
--- more than one discriminant of the ancestor types.
---
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Removed RM references from objective text.
--- 20 Dec 94 SAIC Repair confusion WRT overridden discriminants
---
---!
-
-package C432002_0 is
-
- subtype Length is Natural range 0..256;
- type Discriminant (L : Length) is tagged
- record
- S1 : String (1..L);
- end record;
-
- procedure Do_Something (Rec : in out Discriminant);
- -- inherited by all type extensions
-
- -- Aggregates of Discriminant are of the form
- -- (L, S1) where L= S1'Length
-
- -- Discriminant of parent constrained to value of an expression
- type Constrained_Discriminant_Extension is
- new Discriminant (L => 10)
- with record
- S2 : String (1..20);
- end record;
-
- -- Aggregates of Constrained_Discriminant_Extension are of the form
- -- (L, S1, S2), where L = S1'Length = 10, S2'Length = 20
-
- type Once_Removed is new Constrained_Discriminant_Extension
- with record
- S3 : String (1..3);
- end record;
-
- type Twice_Removed is new Once_Removed
- with record
- S4 : String (1..8);
- end record;
-
- -- Aggregates of Twice_Removed are of the form
- -- (L, S1, S2, S3, S4), where L = S1'Length = 10,
- -- S2'Length = 20,
- -- S3'Length = 3,
- -- S4'Length = 8
-
- -- Discriminant of parent constrained to equal new discriminant
- type New_Discriminant_Extension (N : Length) is
- new Discriminant (L => N) with
- record
- S2 : String (1..N);
- end record;
-
- -- Aggregates of New_Discriminant_Extension are of the form
- -- (N, S1, S2), where N = S1'Length = S2'Length
-
- -- Discriminant of parent extension constrained to the value of
- -- an expression
- type Constrained_Extension_Extension is
- new New_Discriminant_Extension (N => 20)
- with record
- S3 : String (1..5);
- end record;
-
- -- Aggregates of Constrained_Extension_Extension are of the form
- -- (N, S1, S2, S3), where N = S1'Length = S2'Length = 20,
- -- S3'Length = 5
-
- -- Discriminant of parent extension constrained to equal a new
- -- discriminant
- type New_Extension_Extension (I : Length) is
- new New_Discriminant_Extension (N => I)
- with record
- S3 : String (1..I);
- end record;
-
- -- Aggregates of New_Extension_Extension are of the form
- -- (I, S1, 2, S3), where
- -- I = S1'Length = S2'Length = S3'Length
-
- type Multiple_Discriminants (A, B : Length) is tagged
- record
- S1 : String (1..A);
- S2 : String (1..B);
- end record;
-
- procedure Do_Something (Rec : in out Multiple_Discriminants);
- -- inherited by type extension
-
- -- Aggregates of Multiple_Discriminants are of the form
- -- (A, B, S1, S2), where A = S1'Length, B = S2'Length
-
- type Multiple_Discriminant_Extension (C : Length) is
- new Multiple_Discriminants (A => C, B => C)
- with record
- S3 : String (1..C);
- end record;
-
- -- Aggregates of Multiple_Discriminant_Extension are of the form
- -- (A, B, S1, S2, C, S3), where
- -- A = B = C = S1'Length = S2'Length = S3'Length
-
-end C432002_0;
-
-with Report;
-package body C432002_0 is
-
- S : String (1..20) := "12345678901234567890";
-
- procedure Do_Something (Rec : in out Discriminant) is
- begin
- Rec.S1 := Report.Ident_Str (S (1..Rec.L));
- end Do_Something;
-
- procedure Do_Something (Rec : in out Multiple_Discriminants) is
- begin
- Rec.S1 := Report.Ident_Str (S (1..Rec.A));
- end Do_Something;
-
-end C432002_0;
-
-
-with C432002_0;
-with Report;
-procedure C432002 is
-
- -- Various different-sized strings for variety
- String_3 : String (1..3) := Report.Ident_Str("123");
- String_5 : String (1..5) := Report.Ident_Str("12345");
- String_8 : String (1..8) := Report.Ident_Str("12345678");
- String_10 : String (1..10) := Report.Ident_Str("1234567890");
- String_11 : String (1..11) := Report.Ident_Str("12345678901");
- String_20 : String (1..20) := Report.Ident_Str("12345678901234567890");
-
-begin
-
- Report.Test ("C432002",
- "Extension aggregates for discriminated types");
-
- --------------------------------------------------------------------
- -- Extension constrains parent's discriminant to value of expression
- --------------------------------------------------------------------
-
- -- Successful cases - value matches corresponding discriminant value
-
- CD_Matched_Aggregate:
- begin
- declare
- CD : C432002_0.Constrained_Discriminant_Extension :=
- (C432002_0.Discriminant'(L => 10,
- S1 => String_10)
- with S2 => String_20);
- begin
- C432002_0.Do_Something(CD); -- success
- end;
- exception
- when Constraint_Error =>
- Report.Comment ("Ancestor expression is an aggregate");
- Report.Failed ("Aggregate of extension " &
- "with discriminant constrained: " &
- "Constraint_Error was incorrectly raised " &
- "for value that matches corresponding " &
- "discriminant");
- end CD_Matched_Aggregate;
-
- CD_Matched_Variable:
- begin
- declare
- D : C432002_0.Discriminant(L => 10) :=
- C432002_0.Discriminant'(L => 10,
- S1 => String_10);
-
- CD : C432002_0.Constrained_Discriminant_Extension :=
- (D with S2 => String_20);
- begin
- C432002_0.Do_Something(CD); -- success
- end;
- exception
- when Constraint_Error =>
- Report.Comment ("Ancestor expression is a variable");
- Report.Failed ("Aggregate of extension " &
- "with discriminant constrained: " &
- "Constraint_Error was incorrectly raised " &
- "for value that matches corresponding " &
- "discriminant");
- end CD_Matched_Variable;
-
-
- -- Unsuccessful cases - value does not match value of corresponding
- -- discriminant. Constraint_Error should be
- -- raised.
-
- CD_Unmatched_Aggregate:
- begin
- declare
- CD : C432002_0.Constrained_Discriminant_Extension :=
- (C432002_0.Discriminant'(L => 5,
- S1 => String_5)
- with S2 => String_20);
- begin
- Report.Comment ("Ancestor expression is an aggregate");
- Report.Failed ("Aggregate of extension " &
- "with discriminant constrained: " &
- "Constraint_Error was not raised " &
- "for discriminant value that does not match " &
- "corresponding discriminant");
- C432002_0.Do_Something(CD); -- disallow unused var optimization
- end;
- exception
- when Constraint_Error =>
- null; -- raise of Constraint_Error is expected
- end CD_Unmatched_Aggregate;
-
- CD_Unmatched_Variable:
- begin
- declare
- D : C432002_0.Discriminant(L => 5) :=
- C432002_0.Discriminant'(L => 5,
- S1 => String_5);
-
- CD : C432002_0.Constrained_Discriminant_Extension :=
- (D with S2 => String_20);
- begin
- Report.Comment ("Ancestor expression is an variable");
- Report.Failed ("Aggregate of extension " &
- "with discriminant constrained: " &
- "Constraint_Error was not raised " &
- "for discriminant value that does not match " &
- "corresponding discriminant");
- C432002_0.Do_Something(CD); -- disallow unused var optimization
- end;
- exception
- when Constraint_Error =>
- null; -- raise of Constraint_Error is expected
- end CD_Unmatched_Variable;
-
- -----------------------------------------------------------------------
- -- Extension constrains parent's discriminant to equal new discriminant
- -----------------------------------------------------------------------
-
- -- Successful cases - value matches corresponding discriminant value
-
- ND_Matched_Aggregate:
- begin
- declare
- ND : C432002_0.New_Discriminant_Extension (N => 8) :=
- (C432002_0.Discriminant'(L => 8,
- S1 => String_8)
- with N => 8,
- S2 => String_8);
- begin
- C432002_0.Do_Something(ND); -- success
- end;
- exception
- when Constraint_Error =>
- Report.Comment ("Ancestor expression is an aggregate");
- Report.Failed ("Aggregate of extension " &
- "with new discriminant: " &
- "Constraint_Error was incorrectly raised " &
- "for value that matches corresponding " &
- "discriminant");
- end ND_Matched_Aggregate;
-
- ND_Matched_Variable:
- begin
- declare
- D : C432002_0.Discriminant(L => 3) :=
- C432002_0.Discriminant'(L => 3,
- S1 => String_3);
-
- ND : C432002_0.New_Discriminant_Extension (N => 3) :=
- (D with N => 3,
- S2 => String_3);
- begin
- C432002_0.Do_Something(ND); -- success
- end;
- exception
- when Constraint_Error =>
- Report.Comment ("Ancestor expression is an variable");
- Report.Failed ("Aggregate of extension " &
- "with new discriminant: " &
- "Constraint_Error was incorrectly raised " &
- "for value that matches corresponding " &
- "discriminant");
- end ND_Matched_Variable;
-
-
- -- Unsuccessful cases - value does not match value of corresponding
- -- discriminant. Constraint_Error should be
- -- raised.
-
- ND_Unmatched_Aggregate:
- begin
- declare
- ND : C432002_0.New_Discriminant_Extension (N => 20) :=
- (C432002_0.Discriminant'(L => 11,
- S1 => String_11)
- with N => 20,
- S2 => String_20);
- begin
- Report.Comment ("Ancestor expression is an aggregate");
- Report.Failed ("Aggregate of extension " &
- "with new discriminant: " &
- "Constraint_Error was not raised " &
- "for discriminant value that does not match " &
- "corresponding discriminant");
- C432002_0.Do_Something(ND); -- disallow unused var optimization
- end;
- exception
- when Constraint_Error =>
- null; -- raise is expected
- end ND_Unmatched_Aggregate;
-
- ND_Unmatched_Variable:
- begin
- declare
- D : C432002_0.Discriminant(L => 5) :=
- C432002_0.Discriminant'(L => 5,
- S1 => String_5);
-
- ND : C432002_0.New_Discriminant_Extension (N => 20) :=
- (D with N => 20,
- S2 => String_20);
- begin
- Report.Comment ("Ancestor expression is an variable");
- Report.Failed ("Aggregate of extension " &
- "with new discriminant: " &
- "Constraint_Error was not raised " &
- "for discriminant value that does not match " &
- "corresponding discriminant");
- C432002_0.Do_Something(ND); -- disallow unused var optimization
- end;
- exception
- when Constraint_Error =>
- null; -- raise is expected
- end ND_Unmatched_Variable;
-
- --------------------------------------------------------------------
- -- Extension constrains parent's discriminant to value of expression
- -- Parent is a discriminant extension
- --------------------------------------------------------------------
-
- -- Successful cases - value matches corresponding discriminant value
-
- CE_Matched_Aggregate:
- begin
- declare
- CE : C432002_0.Constrained_Extension_Extension :=
- (C432002_0.Discriminant'(L => 20,
- S1 => String_20)
- with N => 20,
- S2 => String_20,
- S3 => String_5);
- begin
- C432002_0.Do_Something(CE); -- success
- end;
- exception
- when Constraint_Error =>
- Report.Comment ("Ancestor expression is an aggregate");
- Report.Failed ("Aggregate of extension (of extension) " &
- "with discriminant constrained: " &
- "Constraint_Error was incorrectly raised " &
- "for value that matches corresponding " &
- "discriminant");
- end CE_Matched_Aggregate;
-
- CE_Matched_Variable:
- begin
- declare
- ND : C432002_0.New_Discriminant_Extension (N => 20) :=
- C432002_0.New_Discriminant_Extension'
- (N => 20,
- S1 => String_20,
- S2 => String_20);
-
- CE : C432002_0.Constrained_Extension_Extension :=
- (ND with S3 => String_5);
- begin
- C432002_0.Do_Something(CE); -- success
- end;
- exception
- when Constraint_Error =>
- Report.Comment ("Ancestor expression is a variable");
- Report.Failed ("Aggregate of extension (of extension) " &
- "with discriminant constrained: " &
- "Constraint_Error was incorrectly raised " &
- "for value that matches corresponding " &
- "discriminant");
- end CE_Matched_Variable;
-
-
- -- Unsuccessful cases - value does not match value of corresponding
- -- discriminant. Constraint_Error should be
- -- raised.
-
- CE_Unmatched_Aggregate:
- begin
- declare
- CE : C432002_0.Constrained_Extension_Extension :=
- (C432002_0.New_Discriminant_Extension'
- (N => 11,
- S1 => String_11,
- S2 => String_11)
- with S3 => String_5);
- begin
- Report.Comment ("Ancestor expression is an aggregate");
- Report.Failed ("Aggregate of extension (of extension) " &
- "Constraint_Error was not raised " &
- "with discriminant constrained: " &
- "for discriminant value that does not match " &
- "corresponding discriminant");
- C432002_0.Do_Something(CE); -- disallow unused var optimization
- end;
- exception
- when Constraint_Error =>
- null; -- raise of Constraint_Error is expected
- end CE_Unmatched_Aggregate;
-
- CE_Unmatched_Variable:
- begin
- declare
- D : C432002_0.Discriminant(L => 8) :=
- C432002_0.Discriminant'(L => 8,
- S1 => String_8);
-
- CE : C432002_0.Constrained_Extension_Extension :=
- (D with N => 8,
- S2 => String_8,
- S3 => String_5);
- begin
- Report.Comment ("Ancestor expression is a variable");
- Report.Failed ("Aggregate of extension (of extension) " &
- "with discriminant constrained: " &
- "Constraint_Error was not raised " &
- "for discriminant value that does not match " &
- "corresponding discriminant");
- C432002_0.Do_Something(CE); -- disallow unused var optimization
- end;
- exception
- when Constraint_Error =>
- null; -- raise of Constraint_Error is expected
- end CE_Unmatched_Variable;
-
- -----------------------------------------------------------------------
- -- Extension constrains parent's discriminant to equal new discriminant
- -- Parent is a discriminant extension
- -----------------------------------------------------------------------
-
- -- Successful cases - value matches corresponding discriminant value
-
- NE_Matched_Aggregate:
- begin
- declare
- NE : C432002_0.New_Extension_Extension (I => 8) :=
- (C432002_0.Discriminant'(L => 8,
- S1 => String_8)
- with I => 8,
- S2 => String_8,
- S3 => String_8);
- begin
- C432002_0.Do_Something(NE); -- success
- end;
- exception
- when Constraint_Error =>
- Report.Comment ("Ancestor expression is an aggregate");
- Report.Failed ("Aggregate of extension (of extension) " &
- "with new discriminant: " &
- "Constraint_Error was incorrectly raised " &
- "for value that matches corresponding " &
- "discriminant");
- end NE_Matched_Aggregate;
-
- NE_Matched_Variable:
- begin
- declare
- ND : C432002_0.New_Discriminant_Extension (N => 3) :=
- C432002_0.New_Discriminant_Extension'
- (N => 3,
- S1 => String_3,
- S2 => String_3);
-
- NE : C432002_0.New_Extension_Extension (I => 3) :=
- (ND with I => 3,
- S3 => String_3);
- begin
- C432002_0.Do_Something(NE); -- success
- end;
- exception
- when Constraint_Error =>
- Report.Comment ("Ancestor expression is a variable");
- Report.Failed ("Aggregate of extension (of extension) " &
- "with new discriminant: " &
- "Constraint_Error was incorrectly raised " &
- "for value that matches corresponding " &
- "discriminant");
- end NE_Matched_Variable;
-
-
- -- Unsuccessful cases - value does not match value of corresponding
- -- discriminant. Constraint_Error should be
- -- raised.
-
- NE_Unmatched_Aggregate:
- begin
- declare
- NE : C432002_0.New_Extension_Extension (I => 8) :=
- (C432002_0.New_Discriminant_Extension'
- (C432002_0.Discriminant'(L => 11,
- S1 => String_11)
- with N => 11,
- S2 => String_11)
- with I => 8,
- S3 => String_8);
- begin
- Report.Comment ("Ancestor expression is an extension aggregate");
- Report.Failed ("Aggregate of extension (of extension) " &
- "with new discriminant: " &
- "Constraint_Error was not raised " &
- "for discriminant value that does not match " &
- "corresponding discriminant");
- C432002_0.Do_Something(NE); -- disallow unused var optimization
- end;
- exception
- when Constraint_Error =>
- null; -- raise is expected
- end NE_Unmatched_Aggregate;
-
- NE_Unmatched_Variable:
- begin
- declare
- D : C432002_0.Discriminant(L => 5) :=
- C432002_0.Discriminant'(L => 5,
- S1 => String_5);
-
- NE : C432002_0.New_Extension_Extension (I => 20) :=
- (D with I => 5,
- S2 => String_5,
- S3 => String_20);
- begin
- Report.Comment ("Ancestor expression is a variable");
- Report.Failed ("Aggregate of extension (of extension) " &
- "with new discriminant: " &
- "Constraint_Error was not raised " &
- "for discriminant value that does not match " &
- "corresponding discriminant");
- C432002_0.Do_Something(NE); -- disallow unused var optimization
- end;
- exception
- when Constraint_Error =>
- null; -- raise is expected
- end NE_Unmatched_Variable;
-
- -----------------------------------------------------------------------
- -- Corresponding discriminant is two levels deeper than aggregate
- -----------------------------------------------------------------------
-
- -- Successful case - value matches corresponding discriminant value
-
- TR_Matched_Variable:
- begin
- declare
- D : C432002_0.Discriminant (L => 10) :=
- C432002_0.Discriminant'(L => 10,
- S1 => String_10);
-
- TR : C432002_0.Twice_Removed :=
- C432002_0.Twice_Removed'(D with S2 => String_20,
- S3 => String_3,
- S4 => String_8);
- -- N is constrained to a value in the derived_type_definition
- -- of Constrained_Discriminant_Extension. Its omission from
- -- the above record_component_association_list is allowed by
- -- 4.3.2(6).
-
- begin
- C432002_0.Do_Something(TR); -- success
- end;
- exception
- when Constraint_Error =>
- Report.Failed ("Aggregate of far-removed extension " &
- "with discriminant constrained: " &
- "Constraint_Error was incorrectly raised " &
- "for value that matches corresponding " &
- "discriminant");
- end TR_Matched_Variable;
-
-
- -- Unsuccessful case - value does not match value of corresponding
- -- discriminant. Constraint_Error should be
- -- raised.
-
- TR_Unmatched_Variable:
- begin
- declare
- D : C432002_0.Discriminant (L => 5) :=
- C432002_0.Discriminant'(L => 5,
- S1 => String_5);
-
- TR : C432002_0.Twice_Removed :=
- C432002_0.Twice_Removed'(D with S2 => String_20,
- S3 => String_3,
- S4 => String_8);
-
- begin
- Report.Failed ("Aggregate of far-removed extension " &
- "with discriminant constrained: " &
- "Constraint_Error was not raised " &
- "for discriminant value that does not match " &
- "corresponding discriminant");
- C432002_0.Do_Something(TR); -- disallow unused var optimization
- end;
- exception
- when Constraint_Error =>
- null; -- raise is expected
- end TR_Unmatched_Variable;
-
- ------------------------------------------------------------------------
- -- Parent has multiple discriminants.
- -- Discriminant in extension corresponds to both parental discriminants.
- ------------------------------------------------------------------------
-
- -- Successful case - value matches corresponding discriminant value
-
- MD_Matched_Variable:
- begin
- declare
- MD : C432002_0.Multiple_Discriminants (A => 10, B => 10) :=
- C432002_0.Multiple_Discriminants'(A => 10,
- B => 10,
- S1 => String_10,
- S2 => String_10);
- MDE : C432002_0.Multiple_Discriminant_Extension (C => 10) :=
- (MD with C => 10,
- S3 => String_10);
-
- begin
- C432002_0.Do_Something(MDE); -- success
- end;
- exception
- when Constraint_Error =>
- Report.Failed ("Aggregate of extension " &
- "of multiply-discriminated parent: " &
- "Constraint_Error was incorrectly raised " &
- "for value that matches corresponding " &
- "discriminant");
- end MD_Matched_Variable;
-
-
- -- Unsuccessful case - value does not match value of corresponding
- -- discriminant. Constraint_Error should be
- -- raised.
-
- MD_Unmatched_Variable:
- begin
- declare
- MD : C432002_0.Multiple_Discriminants (A => 10, B => 8) :=
- C432002_0.Multiple_Discriminants'(A => 10,
- B => 8,
- S1 => String_10,
- S2 => String_8);
- MDE : C432002_0.Multiple_Discriminant_Extension (C => 10) :=
- (MD with C => 10,
- S3 => String_10);
-
- begin
- Report.Failed ("Aggregate of extension " &
- "of multiply-discriminated parent: " &
- "Constraint_Error was not raised " &
- "for discriminant value that does not match " &
- "corresponding discriminant");
- C432002_0.Do_Something(MDE); -- disallow unused var optimization
- end;
- exception
- when Constraint_Error =>
- null; -- raise is expected
- end MD_Unmatched_Variable;
-
- Report.Result;
-
-end C432002;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c432003.a b/gcc/testsuite/ada/acats/tests/c4/c432003.a
deleted file mode 100644
index 8988992c4e4..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c432003.a
+++ /dev/null
@@ -1,594 +0,0 @@
--- C432003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the type of the ancestor part of an extension aggregate
--- has discriminants that are not inherited by the type of the aggregate,
--- and the ancestor part is a subtype mark that denotes a constrained
--- subtype, Constraint_Error is raised if: 1) any discriminant of the
--- ancestor has a different value than that specified for a corresponding
--- discriminant in the derived type definition for some ancestor of the
--- type of the aggregate, or 2) the value for the discriminant in the
--- record association list is not the value of the corresponding
--- discriminant. Check that the components of the value of the
--- aggregate not given by the record component association list are
--- initialized by default as for an object of the ancestor type.
---
--- TEST DESCRIPTION:
--- Consider:
---
--- type T (D1: ...) is tagged ...
---
--- type DT is new T with ...
--- subtype ST is DT (D1 => 3); -- Constrained subtype.
---
--- type NT1 (D2: ...) is new DT (D1 => D2) with null record;
--- type NT2 (D2: ...) is new DT (D1 => 6) with null record;
--- type NT3 is new DT (D1 => 6) with null record;
---
--- A: NT1 := (T with D2 => 6); -- OK: T is unconstrained.
--- B: NT1 := (DT with D2 => 6); -- OK: DT is unconstrained.
--- C: NT1 := (ST with D2 => 6); -- NO: ST.D1 /= D2.
---
--- D: NT2 := (T with D2 => 4); -- OK: T is unconstrained.
--- E: NT2 := (DT with D2 => 4); -- OK: DT is unconstrained.
--- F: NT2 := (ST with . . . ); -- NO: ST.D1 /= DT.D1 as specified in NT2.
---
--- G: NT3 := (T with D1 => 6); -- OK: T is unconstrained.
--- H: NT3 := (DT with D1 => 6); -- OK: DT is unconstrained.
--- I: NT3 := (ST with D1 => 6); -- NO: ST.D1 /= DT.D1 as specified in NT3.
---
--- In A, B, D, E, G, and H the ancestor part is the name of an
--- unconstrained subtype, so this rule does not apply. In C, F, and I
--- the ancestor part (ST) is the name of a constrained subtype of DT,
--- which is itself a derived type of a discriminated tagged type T. ST
--- constrains the discriminant of DT (D1) to the value 3; thus, the
--- type of any extension aggregate for which ST is the ancestor part
--- must have an ancestor which also constrained D1 to 3. F and I raise
--- Constraint_Error because NT2 and NT3, respectively, constrain D1 to
--- 6. C raises Constraint_Error because NT1 constrains D1 to the value
--- of D2, which is set to 6 in the record component association list of
--- the aggregate.
---
--- This test verifies each of the three scenarios above:
---
--- (1) Ancestor of type of aggregate constrains discriminant with
--- new discriminant.
--- (2) Ancestor of type of aggregate constrains discriminant with
--- value, and has a new discriminant part.
--- (3) Ancestor of type of aggregate constrains discriminant with
--- value, and has no discriminant part.
---
--- Verification is made for cases where the type of the aggregate is
--- once- and twice-removed from the type of the ancestor part.
---
--- Additionally, a case is included where a new discriminant corresponds
--- to multiple discriminants of the type of the ancestor part.
---
--- To test the portion of the objective concerning "initialization by
--- default," the test verifies that, after a successful aggregate
--- assignment, components not assigned an explicit value by the aggregate
--- contain the default values for the corresponding components of the
--- ancestor type.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 Dec 94 SAIC Removed discriminant defaults from tagged types.
--- 17 Nov 95 SAIC ACVC 2.0.1 fixes: Corrected subtype constraint
--- for component NT_C3.Str2. Added missing component
--- checks. Removed record component update from
--- Avoid_Optimization. Fixed incorrect component
--- checks.
--- 02 Dec 95 SAIC ACVC 2.0.1 fixes: Corrected Failed comment for
--- Q case.
---
---!
-
-package C432003_0 is
-
- Default_String : constant String := "This is a default string"; -- len = 24
- Another_String : constant String := "Another default string"; -- len = 22
-
- subtype Length is Natural range 0..255;
-
- type ROOT (D1 : Length) is tagged
- record
- S1 : String (1..D1) := Default_String(1..D1);
- Acc : Natural := 356;
- end record;
-
- procedure Avoid_Optimization (Rec : in out ROOT); -- Inherited by all type
- -- extensions.
-
- type Unconstrained_Der is new ROOT with
- record
- Str1 : String(1..5) := "abcde";
- end record;
-
- subtype Constrained_Subtype is Unconstrained_Der (D1 => 10);
-
- type NT_A1 (D2 : Length) is new Unconstrained_Der (D1 => D2) with
- record
- S2 : String(1..D2); -- Inherited discrim. constrained by
- end record; -- new discriminant.
-
- type NT_A2 (D3 : Length) is new NT_A1 (D2 => D3) with
- record
- S3 : String(1..D3); -- Inherited discrim. constrained by
- end record; -- new discriminant.
-
-
- type NT_B1 (D2 : Length) is new Unconstrained_Der (D1 => 5) with
- record
- S2 : String(1..D2); -- Inherited discrim. constrained by
- end record; -- explicit value.
-
- type NT_B2 (D3 : Length) is new NT_B1 (D2 => 10) with
- record
- S3 : String(1..D3); -- Inherited discrim. constrained by
- end record; -- explicit value.
-
- type NT_B3 (D2 : Length) is new Unconstrained_Der (D1 => 10) with
- record
- S2 : String(1..D2);
- end record;
-
-
- type NT_C1 is new Unconstrained_Der (D1 => 5) with
- record
- Str2 : String(1..5); -- Inherited discrim. constrained
- end record; -- No new value.
-
- type NT_C2 (D2 : Length) is new NT_C1 with
- record
- S2 : String(1..D2); -- Inherited discrim. not further
- end record; -- constrained, new discriminant.
-
- type NT_C3 is new Unconstrained_Der(D1 => 10) with
- record
- Str2 : String(1..5);
- end record;
-
-
- type MULTI_ROOT (D1 : Length; D2 : Length) is tagged
- record
- S1 : String (1..D1) := Default_String(1..D1);
- S2 : String (1..D2) := Another_String(1..D2);
- end record;
-
- procedure Avoid_Optimization (Rec : in out MULTI_ROOT); -- Inherited by all
- -- type extensions.
-
- type Mult_Unconstr_Der is new MULTI_ROOT with
- record
- Str1 : String(1..8) := "AbCdEfGh"; -- Derived, no constraints.
- end record;
-
- -- Subtypes with constrained discriminants.
- subtype Mult_Constr_Sub1 is Mult_Unconstr_Der(D1 => 15, -- Disc. have
- D2 => 20); -- diff values
-
- subtype Mult_Constr_Sub2 is Mult_Unconstr_Der(D1 => 15, -- Disc. have
- D2 => 15); -- same value
-
- type Mult_NT_A1 (D3 : Length) is
- new Mult_Unconstr_Der (D1 => D3, D2 => D3) with
- record
- S3 : String(1..D3); -- Both inherited discriminants constrained
- end record; -- by new discriminant.
-
-end C432003_0;
-
-
- --=====================================================================--
-
-
-with Report;
-package body C432003_0 is
-
- procedure Avoid_Optimization (Rec : in out ROOT) is
- begin
- Rec.S1 := Report.Ident_Str(Rec.S1);
- end Avoid_Optimization;
-
- procedure Avoid_Optimization (Rec : in out MULTI_ROOT) is
- begin
- Rec.S1 := Report.Ident_Str(Rec.S1);
- end Avoid_Optimization;
-
-end C432003_0;
-
-
- --=====================================================================--
-
-
-with C432003_0;
-with Report;
-procedure C432003 is
-begin
-
- Report.Test("C432003", "Extension aggregates where ancestor part " &
- "is a subtype mark that denotes a constrained " &
- "subtype causing Constraint_Error if any " &
- "discriminant of the ancestor has a different " &
- "value than that specified for a corresponding " &
- "discriminant in the derived type definition " &
- "for some ancestor of the type of the aggregate");
-
- Test_Block:
- declare
-
- -- Variety of string object declarations.
- String2 : String(1..2) := Report.Ident_Str("12");
- String5 : String(1..5) := Report.Ident_Str("12345");
- String8 : String(1..8) := Report.Ident_Str("AbCdEfGh");
- String10 : String(1..10) := Report.Ident_Str("1234567890");
- String15 : String(1..15) := Report.Ident_Str("123456789012345");
- String20 : String(1..20) := Report.Ident_Str("12345678901234567890");
-
- begin
-
-
- begin
- declare
- A : C432003_0.NT_A1 := -- OK
- (C432003_0.ROOT with D2 => 5,
- Str1 => "cdefg",
- S2 => String5);
- begin
- C432003_0.Avoid_Optimization(A);
- if A.Acc /= 356 or
- A.Str1 /= "cdefg" or
- A.S2 /= String5 or
- A.D2 /= 5 or
- A.S1 /= C432003_0.Default_String(1..5)
- then
- Report.Failed("Incorrect object values for Object A");
- end if;
- end;
- exception
- when Constraint_Error =>
- Report.Failed("Constraint_Error raised for Object A");
- end;
-
-
- begin
- declare
- C: C432003_0.NT_A1 := -- OK
- (C432003_0.Constrained_Subtype with D2 => 10,
- S2 => String10);
- begin
- C432003_0.Avoid_Optimization(C);
- if C.D2 /= 10 or C.Acc /= 356 or
- C.Str1 /= "abcde" or C.S2 /= String10 or
- C.S1 /= C432003_0.Default_String(1..10)
- then
- Report.Failed("Incorrect object values for Object C");
- end if;
- end;
- exception
- when Constraint_Error =>
- Report.Failed("Constraint_Error raised for Object C");
- end;
-
-
- begin
- declare
- D: C432003_0.NT_A1 := -- C_E
- (C432003_0.Constrained_Subtype with
- D2 => Report.Ident_Int(5),
- S2 => String5);
- begin
- C432003_0.Avoid_Optimization(D);
- Report.Failed("Constraint_Error not raised for Object D");
- end;
- exception
- when Constraint_Error =>
- null; -- Raise of Constraint_Error is expected.
- end;
-
-
- begin
- declare
- E: C432003_0.NT_A2 := -- OK
- (C432003_0.Constrained_Subtype with D3 => 10,
- S2 => String10,
- S3 => String10);
- begin
- C432003_0.Avoid_Optimization(E);
- if E.D3 /= 10 or E.Acc /= 356 or
- E.Str1 /= "abcde" or E.S2 /= String10 or
- E.S3 /= String10 or
- E.S1 /= C432003_0.Default_String(1..10)
- then
- Report.Failed("Incorrect object values for Object E");
- end if;
- end;
- exception
- when Constraint_Error =>
- Report.Failed("Constraint_Error raised for Object E");
- end;
-
-
- begin
- declare
- F: C432003_0.NT_A2 := -- C_E
- (C432003_0.Constrained_Subtype with
- D3 => Report.Ident_Int(5),
- S2 => String5,
- S3 => String5);
- begin
- C432003_0.Avoid_Optimization(F);
- Report.Failed("Constraint_Error not raised for Object F");
- end;
- exception
- when Constraint_Error =>
- null; -- Raise of Constraint_Error is expected.
- end;
-
-
- begin
- declare
- G: C432003_0.NT_B2 := -- OK
- (C432003_0.ROOT with D3 => 5,
- Str1 => "cdefg",
- S2 => String10,
- S3 => String5);
- begin
- C432003_0.Avoid_Optimization(G);
- if G.D3 /= 5 or G.Acc /= 356 or
- G.Str1 /= "cdefg" or G.S2 /= String10 or
- G.S3 /= String5 or
- G.S1 /= C432003_0.Default_String(1..5)
- then
- Report.Failed("Incorrect object values for Object G");
- end if;
- end;
- exception
- when Constraint_Error =>
- Report.Failed("Constraint_Error raised for Object G");
- end;
-
-
- begin
- declare
- H: C432003_0.NT_B3 := -- OK
- (C432003_0.Unconstrained_Der with D2 => 5,
- S2 => String5);
- begin
- C432003_0.Avoid_Optimization(H);
- if H.D2 /= 5 or H.Acc /= 356 or
- H.Str1 /= "abcde" or H.S2 /= String5 or
- H.S1 /= C432003_0.Default_String(1..10)
- then
- Report.Failed("Incorrect object values for Object H");
- end if;
- end;
- exception
- when Constraint_Error =>
- Report.Failed("Constraint_Error raised for Object H");
- end;
-
-
- begin
- declare
- I: C432003_0.NT_B1 := -- C_E
- (C432003_0.Constrained_Subtype with
- D2 => Report.Ident_Int(10),
- S2 => String10);
- begin
- C432003_0.Avoid_Optimization(I);
- Report.Failed("Constraint_Error not raised for Object I");
- end;
- exception
- when Constraint_Error =>
- null; -- Raise of Constraint_Error is expected.
- end;
-
-
- begin
- declare
- J: C432003_0.NT_B2 := -- C_E
- (C432003_0.Constrained_Subtype with
- D3 => Report.Ident_Int(10),
- S2 => String10,
- S3 => String10);
- begin
- C432003_0.Avoid_Optimization(J);
- Report.Failed("Constraint_Error not raised by Object J");
- end;
- exception
- when Constraint_Error =>
- null; -- Raise of Constraint_Error is expected.
- end;
-
-
- begin
- declare
- K: C432003_0.NT_B3 := -- OK
- (C432003_0.Constrained_Subtype with D2 => 5,
- S2 => String5);
- begin
- C432003_0.Avoid_Optimization(K);
- if K.D2 /= 5 or K.Acc /= 356 or
- K.Str1 /= "abcde" or K.S2 /= String5 or
- K.S1 /= C432003_0.Default_String(1..10)
- then
- Report.Failed("Incorrect object values for Object K");
- end if;
- end;
- exception
- when Constraint_Error =>
- Report.Failed("Constraint_Error raised for Object K");
- end;
-
-
- begin
- declare
- M: C432003_0.NT_C2 := -- OK
- (C432003_0.ROOT with D2 => 10,
- Str1 => "cdefg",
- Str2 => String5,
- S2 => String10);
- begin
- C432003_0.Avoid_Optimization(M);
- if M.D2 /= 10 or M.Acc /= 356 or
- M.Str1 /= "cdefg" or M.S2 /= String10 or
- M.Str2 /= String5 or
- M.S1 /= C432003_0.Default_String(1..5)
- then
- Report.Failed("Incorrect object values for Object M");
- end if;
- end;
- exception
- when Constraint_Error =>
- Report.Failed("Constraint_Error raised for Object M");
- end;
-
-
- begin
- declare
- O: C432003_0.NT_C1 := -- C_E
- (C432003_0.Constrained_Subtype with
- Str2 => Report.Ident_Str(String5));
- begin
- C432003_0.Avoid_Optimization(O);
- Report.Failed("Constraint_Error not raised for Object O");
- end;
- exception
- when Constraint_Error =>
- null; -- Raise of Constraint_Error is expected.
- end;
-
-
- begin
- declare
- P: C432003_0.NT_C2 := -- C_E
- (C432003_0.Constrained_Subtype with
- D2 => Report.Ident_Int(10),
- Str2 => String5,
- S2 => String10);
- begin
- C432003_0.Avoid_Optimization(P);
- Report.Failed("Constraint_Error not raised by Object P");
- end;
- exception
- when Constraint_Error =>
- null; -- Raise of Constraint_Error is expected.
- end;
-
-
- begin
- declare
- Q: C432003_0.NT_C3 :=
- (C432003_0.Constrained_Subtype with Str2 => String5); -- OK
- begin
- C432003_0.Avoid_Optimization(Q);
- if Q.Str2 /= String5 or
- Q.Acc /= 356 or
- Q.Str1 /= "abcde" or
- Q.D1 /= 10 or
- Q.S1 /= C432003_0.Default_String(1..10)
- then
- Report.Failed("Incorrect object values for Object Q");
- end if;
- end;
- exception
- when Constraint_Error =>
- Report.Failed("Constraint_Error raised for Object Q");
- end;
-
-
- -- The following cases test where a new discriminant corresponds
- -- to multiple discriminants of the type of the ancestor part.
-
- begin
- declare
- S: C432003_0.Mult_NT_A1 := -- OK
- (C432003_0.Mult_Unconstr_Der with D3 => 15,
- S3 => String15);
- begin
- C432003_0.Avoid_Optimization(S);
- if S.S1 /= C432003_0.Default_String(1..15) or
- S.Str1 /= String8 or
- S.S2 /= C432003_0.Another_String(1..15) or
- S.S3 /= String15 or
- S.D3 /= 15
- then
- Report.Failed("Incorrect object values for Object S");
- end if;
- end;
- exception
- when Constraint_Error =>
- Report.Failed("Constraint_Error raised for Object S");
- end;
-
-
- begin
- declare
- U: C432003_0.Mult_NT_A1 := -- C_E
- (C432003_0.Mult_Constr_Sub1 with
- D3 => Report.Ident_Int(15),
- S3 => String15);
- begin
- C432003_0.Avoid_Optimization(U);
- Report.Failed("Constraint_Error not raised for Object U");
- end;
- exception
- when Constraint_Error =>
- null; -- Raise of Constraint_Error is expected.
- end;
-
-
- begin
- declare
- V: C432003_0.Mult_NT_A1 := -- OK
- (C432003_0.Mult_Constr_Sub2 with D3 => 15,
- S3 => String15);
- begin
- C432003_0.Avoid_Optimization(V);
- if V.D3 /= 15 or
- V.Str1 /= String8 or
- V.S3 /= String15 or
- V.S1 /= C432003_0.Default_String(1..15) or
- V.S2 /= C432003_0.Another_String(1..15)
- then
- Report.Failed("Incorrect object values for Object V");
- end if;
- end;
- exception
- when Constraint_Error =>
- Report.Failed("Constraint_Error raised for Object V");
- end;
-
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end C432003;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c432004.a b/gcc/testsuite/ada/acats/tests/c4/c432004.a
deleted file mode 100644
index 3a148621115..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c432004.a
+++ /dev/null
@@ -1,319 +0,0 @@
--- C432004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the type of an extension aggregate may be derived from the
--- type of the ancestor part through multiple record extensions. Check
--- for ancestor parts that are subtype marks. Check that the type of the
--- ancestor part may be abstract.
---
--- TEST DESCRIPTION:
--- This test defines the following type hierarchies:
---
--- (A) (F)
--- Abstract Abstract
--- Tagged record Tagged private
--- / \ / \
--- / (C) (G) \
--- (B) Abstract Abstract (H)
--- Record private record Private
--- extension extension extension extension
--- | | | |
--- (D) (E) (I) (J)
--- Record Record Record Record
--- extension extension extension extension
---
--- Extension aggregates for B, D, E, I, and J are constructed using each
--- of its ancestor types as the ancestor part (except for E and J, for
--- which only the immediate ancestor is used, since using A and F,
--- respectively, as the ancestor part would be illegal).
---
--- X1 : B := (A with ...);
--- X2 : D := (A with ...); X5 : I := (F with ...);
--- X3 : D := (B with ...); X6 : I := (G with ...);
--- X4 : E := (C with ...); X7 : J := (H with ...);
---
--- For each assignment of an aggregate, the value of the target object is
--- checked to ensure that the proper values for each component were
--- assigned.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C432004_0 is
-
- type Drawers is record
- Building : natural;
- end record;
-
- type Location is access Drawers;
-
- type Eras is (Precambrian, Paleozoic, Mesozoic, Cenozoic);
-
- type SampleType_A is abstract tagged record
- Era : Eras := Cenozoic;
- Loc : Location;
- end record;
-
- type SampleType_F is abstract tagged private;
-
- -- The following function is needed to verify the values of the
- -- private components.
- function TC_Correct_Result (Rec : SampleType_F'Class;
- E : Eras) return Boolean;
-
-private
- type SampleType_F is abstract tagged record
- Era : Eras := Mesozoic;
- end record;
-
-end C432004_0;
-
- --==================================================================--
-
-package body C432004_0 is
-
- function TC_Correct_Result (Rec : SampleType_F'Class;
- E : Eras) return Boolean is
- begin
- return (Rec.Era = E);
- end TC_Correct_Result;
-
-end C432004_0;
-
- --==================================================================--
-
-with C432004_0;
-package C432004_1 is
-
- type Periods is
- (Aphebian, Helikian, Hadrynian,
- Cambrian, Ordovician, Silurian, Devonian, Carboniferous, Permian,
- Triassic, Jurassic, Cretaceous,
- Tertiary, Quaternary);
-
- type SampleType_B is new C432004_0.SampleType_A with record
- Period : Periods := Quaternary;
- end record;
-
- type SampleType_C is abstract new C432004_0.SampleType_A with private;
-
- -- The following function is needed to verify the values of the
- -- extension's private components.
- function TC_Correct_Result (Rec : SampleType_C'Class;
- P : Periods) return Boolean;
-
- type SampleType_G is abstract new C432004_0.SampleType_F with record
- Period : Periods := Jurassic;
- Loc : C432004_0.Location;
- end record;
-
- type SampleType_H is new C432004_0.SampleType_F with private;
-
- -- The following function is needed to verify the values of the
- -- extension's private components.
- function TC_Correct_Result (Rec : SampleType_H'Class;
- P : Periods;
- E : C432004_0.Eras) return Boolean;
-
-private
- type SampleType_C is abstract new C432004_0.SampleType_A with record
- Period : Periods := Quaternary;
- end record;
-
- type SampleType_H is new C432004_0.SampleType_F with record
- Period : Periods := Jurassic;
- end record;
-
-end C432004_1;
-
- --==================================================================--
-
-package body C432004_1 is
-
- function TC_Correct_Result (Rec : SampleType_C'Class;
- P : Periods) return Boolean is
- begin
- return (Rec.Period = P);
- end TC_Correct_Result;
-
- -------------------------------------------------------------
- function TC_Correct_Result (Rec : SampleType_H'Class;
- P : Periods;
- E : C432004_0.Eras) return Boolean is
- begin
- return (Rec.Period = P) and C432004_0.TC_Correct_Result (Rec, E);
- end TC_Correct_Result;
-
-end C432004_1;
-
- --==================================================================--
-
-with C432004_0;
-with C432004_1;
-package C432004_2 is
-
- -- All types herein are record extensions, since aggregates
- -- cannot be given for private extensions
-
- type SampleType_D is new C432004_1.SampleType_B with record
- Sample_On_Loan : Boolean := False;
- end record;
-
- type SampleType_E is new C432004_1.SampleType_C
- with null record;
-
- type SampleType_I is new C432004_1.SampleType_G with record
- Sample_On_Loan : Boolean := True;
- end record;
-
- type SampleType_J is new C432004_1.SampleType_H with record
- Sample_On_Loan : Boolean := True;
- end record;
-
-end C432004_2;
-
-
- --==================================================================--
-
-with Report;
-with C432004_0;
-with C432004_1;
-with C432004_2;
-use C432004_1;
-use C432004_2;
-
-procedure C432004 is
-
- -- Variety of extension aggregates.
-
- -- Default values for the components of SampleType_A
- -- (Era => Cenozoic, Loc => null).
- Sample_B : SampleType_B
- := (C432004_0.SampleType_A with Period => Devonian);
-
- -- Default values from SampleType_A (Era => Cenozoic, Loc => null).
- Sample_D1 : SampleType_D
- := (C432004_0.SampleType_A with Period => Cambrian,
- Sample_On_Loan => True);
-
- -- Default values from SampleType_A and SampleType_B
- -- (Era => Cenozoic, Loc => null, Period => Quaternary).
- Sample_D2 : SampleType_D
- := (SampleType_B with Sample_On_Loan => True);
-
- -- Default values from SampleType_A and SampleType_C
- -- (Era => Cenozoic, Loc => null, Period => Quaternary).
- Sample_E : SampleType_E
- := (SampleType_C with null record);
-
- -- Default value from SampleType_F (Era => Mesozoic).
- Sample_I1 : SampleType_I
- := (C432004_0.SampleType_F with Period => Tertiary,
- Loc => new C432004_0.Drawers'(Building => 9),
- Sample_On_Loan => False);
-
- -- Default values from SampleType_F and SampleType_G
- -- (Era => Mesozoic, Period => Jurassic, Loc => null).
- Sample_I2 : SampleType_I
- := (SampleType_G with Sample_On_Loan => False);
-
- -- Default values from SampleType_H (Era => Mesozoic, Period => Jurassic).
- Sample_J : SampleType_J
- := (SampleType_H with Sample_On_Loan => False);
-
- use type C432004_0.Eras;
- use type C432004_0.Location;
-
-begin
-
- Report.Test ("C432004", "Check that the type of an extension aggregate " &
- "may be derived from the type of the ancestor part through " &
- "multiple record extensions");
-
- if Sample_B /= (C432004_0.Cenozoic, null, Devonian) then
- Report.Failed ("Object of record extension of abstract ancestor, " &
- "SampleType_B, failed content check");
- end if;
-
- -------------------
- if Sample_D1 /= (Era => C432004_0.Cenozoic, Loc => null,
- Period => Cambrian, Sample_On_Loan => True) then
- Report.Failed ("Object 1 of record extension of record extension, " &
- "of abstract ancestor, SampleType_D, failed content " &
- "check");
- end if;
-
- -------------------
- if Sample_D2 /= (C432004_0.Cenozoic, null, Quaternary, True) then
- Report.Failed ("Object 2 of record extension of record extension, " &
- "of abstract ancestor, SampleType_D, failed content " &
- "check");
- end if;
- -------------------
- if Sample_E.Era /= C432004_0.Cenozoic or
- Sample_E.Loc /= null or
- not TC_Correct_Result (Sample_E, Quaternary) then
- Report.Failed ("Object of record extension of abstract private " &
- "extension of abstract ancestor, SampleType_E, " &
- "failed content check");
- end if;
-
- -------------------
- if not C432004_0.TC_Correct_Result (Sample_I1, C432004_0.Mesozoic) or
- Sample_I1.Period /= Tertiary or
- Sample_I1.Loc.Building /= 9 or
- Sample_I1.Sample_On_Loan /= False then
- Report.Failed ("Object 1 of record extension of abstract record " &
- "extension of abstract private ancestor, " &
- "SampleType_I, failed content check");
- end if;
-
- -------------------
- if not C432004_0.TC_Correct_Result (Sample_I2, C432004_0.Mesozoic) or
- Sample_I2.Period /= Jurassic or
- Sample_I2.Loc /= null or
- Sample_I2.Sample_On_Loan /= False then
- Report.Failed ("Object 2 of record extension of abstract record " &
- "extension of abstract private ancestor, " &
- "SampleType_I, failed content check");
- end if;
-
- -------------------
- if not TC_Correct_Result (Sample_J,
- Jurassic,
- C432004_0.Mesozoic) or
- Sample_J.Sample_On_Loan /= False then
- Report.Failed ("Object of record extension of private extension " &
- "of abstract private ancestor, SampleType_J, " &
- "failed content check");
- end if;
-
- Report.Result;
-
-end C432004;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c433001.a b/gcc/testsuite/ada/acats/tests/c4/c433001.a
deleted file mode 100644
index 613b688c8ca..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c433001.a
+++ /dev/null
@@ -1,302 +0,0 @@
--- C433001.A
-
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE
--- Check that an others choice is allowed in an array aggregate whose
--- applicable index constraint is dynamic. (This was an extension to
--- Ada 83). Check that index choices are within the applicable index
--- constraint for array aggregates with others choices.
---
--- TEST DESCRIPTION
--- In this test, we declare several unconstrained array types, and
--- several dynamic subtypes. We then test a variety of cases of using
--- appropriate aggregates. Some cases expect to raise Constraint_Error.
---
--- HISTORY:
--- 16 DEC 1999 RLB Initial Version.
-
-with Report;
-procedure C433001 is
-
- type Color_Type is (Red, Orange, Yellow, Green, Blue, Indigo, Violet);
-
- type Array_1 is array (Positive range <>) of Integer;
-
- subtype Sub_1_1 is Array_1 (Report.Ident_Int(1) .. Report.Ident_Int(3));
- subtype Sub_1_2 is Array_1 (Report.Ident_Int(3) .. Report.Ident_Int(5));
- subtype Sub_1_3 is Array_1 (Report.Ident_Int(5) .. Report.Ident_Int(9));
-
- type Array_2 is array (Color_Type range <>) of Integer;
-
- subtype Sub_2_1 is Array_2 (Color_Type'Val(Report.Ident_Int(0)) ..
- Color_Type'Val(Report.Ident_Int(2)));
- -- Red .. Yellow
- subtype Sub_2_2 is Array_2 (Color_Type'Val(Report.Ident_Int(3)) ..
- Color_Type'Val(Report.Ident_Int(6)));
- -- Green .. Violet
- type Array_3 is array (Color_Type range <>, Positive range <>) of Integer;
-
- subtype Sub_3_1 is Array_3 (Color_Type'Val(Report.Ident_Int(0)) ..
- Color_Type'Val(Report.Ident_Int(2)),
- Report.Ident_Int(3) .. Report.Ident_Int(5));
- -- Red .. Yellow, 3 .. 5
- subtype Sub_3_2 is Array_3 (Color_Type'Val(Report.Ident_Int(1)) ..
- Color_Type'Val(Report.Ident_Int(3)),
- Report.Ident_Int(6) .. Report.Ident_Int(8));
- -- Orange .. Green, 6 .. 8
-
- procedure Check_1 (Obj : Array_1; Low, High : Integer;
- First_Component, Second_Component,
- Last_Component : Integer;
- Test_Case : Character) is
- begin
- if Obj'First /= Low then
- Report.Failed ("Low bound incorrect (" & Test_Case & ")");
- end if;
- if Obj'Last /= High then
- Report.Failed ("High bound incorrect (" & Test_Case & ")");
- end if;
- if Obj(Low) /= First_Component then
- Report.Failed ("First Component incorrect (" & Test_Case & ")");
- end if;
- if Obj(Low+1) /= Second_Component then
- Report.Failed ("First Component incorrect (" & Test_Case & ")");
- end if;
- if Obj(High) /= Last_Component then
- Report.Failed ("First Component incorrect (" & Test_Case & ")");
- end if;
- end Check_1;
-
- procedure Check_2 (Obj : Array_2; Low, High : Color_Type;
- First_Component, Second_Component,
- Last_Component : Integer;
- Test_Case : Character) is
- begin
- if Obj'First /= Low then
- Report.Failed ("Low bound incorrect (" & Test_Case & ")");
- end if;
- if Obj'Last /= High then
- Report.Failed ("High bound incorrect (" & Test_Case & ")");
- end if;
- if Obj(Low) /= First_Component then
- Report.Failed ("First Component incorrect (" & Test_Case & ")");
- end if;
- if Obj(Color_Type'Succ(Low)) /= Second_Component then
- Report.Failed ("First Component incorrect (" & Test_Case & ")");
- end if;
- if Obj(High) /= Last_Component then
- Report.Failed ("First Component incorrect (" & Test_Case & ")");
- end if;
- end Check_2;
-
- procedure Check_3 (Test_Obj, Check_Obj : Array_3;
- Low_1, High_1 : Color_Type;
- Low_2, High_2 : Integer;
- Test_Case : Character) is
- begin
- if Test_Obj'First(1) /= Low_1 then
- Report.Failed ("Low bound for dimension 1 incorrect (" &
- Test_Case & ")");
- end if;
- if Test_Obj'Last(1) /= High_1 then
- Report.Failed ("High bound for dimension 1 incorrect (" &
- Test_Case & ")");
- end if;
- if Test_Obj'First(2) /= Low_2 then
- Report.Failed ("Low bound for dimension 2 incorrect (" &
- Test_Case & ")");
- end if;
- if Test_Obj'Last(2) /= High_2 then
- Report.Failed ("High bound for dimension 2 incorrect (" &
- Test_Case & ")");
- end if;
- if Test_Obj /= Check_Obj then
- Report.Failed ("Components incorrect (" & Test_Case & ")");
- end if;
- end Check_3;
-
- procedure Subtest_Check_1 (Obj : Sub_1_3;
- First_Component, Second_Component,
- Last_Component : Integer;
- Test_Case : Character) is
- begin
- Check_1 (Obj, 5, 9, First_Component, Second_Component, Last_Component,
- Test_Case);
- end Subtest_Check_1;
-
- procedure Subtest_Check_2 (Obj : Sub_2_2;
- First_Component, Second_Component,
- Last_Component : Integer;
- Test_Case : Character) is
- begin
- Check_2 (Obj, Green, Violet, First_Component, Second_Component,
- Last_Component, Test_Case);
- end Subtest_Check_2;
-
- procedure Subtest_Check_3 (Obj : Sub_3_2;
- Test_Case : Character) is
- begin
- Check_3 (Obj, Obj, Orange, Green, 6, 8, Test_Case);
- end Subtest_Check_3;
-
-begin
-
- Report.Test ("C433001",
- "Check that an others choice is allowed in an array " &
- "aggregate whose applicable index constraint is dynamic. " &
- "Also check index choices are within the applicable index " &
- "constraint for array aggregates with others choices");
-
- -- Check with a qualified expression:
- Check_1 (Sub_1_1'(2, 3, others => 4), Low => 1, High => 3,
- First_Component => 2, Second_Component => 3, Last_Component => 4,
- Test_Case => 'A');
-
- Check_2 (Sub_2_1'(1, others => Report.Ident_Int(6)),
- Low => Red, High => Yellow,
- First_Component => 1, Second_Component => 6, Last_Component => 6,
- Test_Case => 'B');
-
- Check_3 (Sub_3_1'((1, others => 3), others => (2, 4, others => 6)),
- Check_Obj => ((1, 3, 3), (2, 4, 6), (2, 4, 6)),
- Low_1 => Red, High_1 => Yellow, Low_2 => 3, High_2 => 5,
- Test_Case => 'C');
-
- -- Check that the others clause does not need to represent any components:
- Check_1 (Sub_1_2'(5, 6, 8, others => 10), Low => 3, High => 5,
- First_Component => 5, Second_Component => 6, Last_Component => 8,
- Test_Case => 'D');
-
- -- Check named choices are allowed:
- Check_1 (Sub_1_1'(2 => Report.Ident_Int(-1), others => 8),
- Low => 1, High => 3,
- First_Component => 8, Second_Component => -1, Last_Component => 8,
- Test_Case => 'E');
-
- -- Check named choices and formal parameters:
- Subtest_Check_1 ((6 => 4, 8 => 86, others => 1),
- First_Component => 1, Second_Component => 4, Last_Component => 1,
- Test_Case => 'F');
-
- Subtest_Check_2 ((Green => Report.Ident_Int(88), Violet => 89,
- Indigo => Report.Ident_Int(42), Blue => 0, others => -1),
- First_Component => 88, Second_Component => 0, Last_Component => 89,
- Test_Case => 'G');
-
- Subtest_Check_3 ((Yellow => (7 => 0, others => 10), others => (1, 2, 3)),
- Test_Case => 'H');
-
- -- Check object declarations and assignment:
- declare
- Var : Sub_1_2 := (4, 36, others => 86);
- begin
- Check_1 (Var, Low => 3, High => 5,
- First_Component => 4, Second_Component => 36,
- Last_Component => 86,
- Test_Case => 'I');
- Var := (5 => 415, others => Report.Ident_Int(1522));
- Check_1 (Var, Low => 3, High => 5,
- First_Component => 1522, Second_Component => 1522,
- Last_Component => 415,
- Test_Case => 'J');
- end;
-
- -- Check positional aggregates that are too long:
- begin
- Subtest_Check_2 ((Report.Ident_Int(88), 89, 90, 91, 92, others => 93),
- First_Component => 88, Second_Component => 89,
- Last_Component => 91,
- Test_Case => 'K');
- Report.Failed ("Constraint_Error not raised by positional " &
- "aggregate with too many choices (K)");
- exception
- when Constraint_Error => null; -- Expected exception.
- end;
-
- begin
- Subtest_Check_3 (((0, others => 10), (2, 3, others => 4),
- (5, 6, 8, others => 10), (1, 4, 7), others => (1, 2, 3)),
- Test_Case => 'L');
- Report.Failed ("Constraint_Error not raised by positional " &
- "aggregate with too many choices (L)");
- exception
- when Constraint_Error => null; -- Expected exception.
- end;
-
- -- Check named aggregates with choices in the index subtype but not in the
- -- applicable index constraint:
-
- begin
- Subtest_Check_1 ((5 => Report.Ident_Int(88), 8 => 89,
- 10 => 66, -- 10 not in applicable index constraint
- others => 93),
- First_Component => 88, Second_Component => 93,
- Last_Component => 93,
- Test_Case => 'M');
- Report.Failed ("Constraint_Error not raised by aggregate choice " &
- "index outside of applicable index constraint (M)");
- exception
- when Constraint_Error => null; -- Expected exception.
- end;
-
- begin
- Subtest_Check_2 (
- (Yellow => 23, -- Yellow not in applicable index constraint.
- Blue => 16, others => 77),
- First_Component => 77, Second_Component => 16,
- Last_Component => 77,
- Test_Case => 'N');
- Report.Failed ("Constraint_Error not raised by aggregate choice " &
- "index outside of applicable index constraint (N)");
- exception
- when Constraint_Error => null; -- Expected exception.
- end;
-
- begin
- Subtest_Check_3 ((Orange => (0, others => 10),
- Blue => (2, 3, others => 4), -- Blue not in applicable index cons.
- others => (1, 2, 3)),
- Test_Case => 'P');
- Report.Failed ("Constraint_Error not raised by aggregate choice " &
- "index outside of applicable index constraint (P)");
- exception
- when Constraint_Error => null; -- Expected exception.
- end;
-
- begin
- Subtest_Check_3 ((Orange => (6 => 0, others => Report.Ident_Int(10)),
- Green => (8 => 2, 4 => 3, others => 7),
- -- 4 not in applicable index cons.
- others => (1, 2, 3, others => Report.Ident_Int(10))),
- Test_Case => 'Q');
- Report.Failed ("Constraint_Error not raised by aggregate choice " &
- "index outside of applicable index constraint (Q)");
- exception
- when Constraint_Error => null; -- Expected exception.
- end;
-
- Report.Result;
-
-end C433001;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c450001.a b/gcc/testsuite/ada/acats/tests/c4/c450001.a
deleted file mode 100644
index e398ffc6371..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c450001.a
+++ /dev/null
@@ -1,434 +0,0 @@
--- C450001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that operations on modular types perform correctly.
---
--- Check that loops over the range of a modular type do not over or
--- under run the loop.
---
--- TEST DESCRIPTION:
--- Check logical and arithmetic operations.
--- (Attributes are tested elsewhere)
--- Checks to make sure that:
--- for X in Mod_Type loop
--- doesn't do something silly like infinite loop.
---
---
--- CHANGE HISTORY:
--- 20 SEP 95 SAIC Initial version
--- 20 FEB 96 SAIC Added underrun cases for 2.1
---
---!
-
------------------------------------------------------------------ C450001_0
-
-package C450001_0 is
-
- type Unsigned_8_Bit is mod 2**8;
-
- Shy_By_One : constant := 2**8-1;
-
- Heavy_By_Two : constant := 2**8+2;
-
- type Unsigned_Edge_8 is mod Shy_By_One;
-
- type Unsigned_Over_8 is mod Heavy_By_Two;
-
- procedure Loop_Check;
-
- -- embed some calls to Report.Ident_Int:
-
- function ID( U8B: Unsigned_8_Bit ) return Unsigned_8_Bit;
- function ID( UEB: Unsigned_Edge_8 ) return Unsigned_Edge_8;
- function ID( UOB: Unsigned_Over_8 ) return Unsigned_Over_8;
-
-end C450001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body C450001_0 is
-
- procedure Loop_Check is
- Counter_Check : Natural := 0;
- begin
- for Ever in Unsigned_8_Bit loop
- Counter_Check := Report.Ident_Int(Counter_Check) + 1;
- if Counter_Check > 2**8 then
- Report.Failed("Unsigned_8_Bit loop overrun");
- exit;
- end if;
- end loop;
-
- if Counter_Check < 2**8 then
- Report.Failed("Unsigned_8_Bit loop underrun");
- end if;
-
- Counter_Check := 0;
-
- for Never in Unsigned_Edge_8 loop
- Counter_Check := Report.Ident_Int(Counter_Check) + 1;
- if Counter_Check > Shy_By_One then
- Report.Failed("Unsigned_Edge_8 loop overrun");
- exit;
- end if;
- end loop;
-
- if Counter_Check < Shy_By_One then
- Report.Failed("Unsigned_Edge_8 loop underrun");
- end if;
-
- Counter_Check := 0;
-
- for Getful in reverse Unsigned_Over_8 loop
- Counter_Check := Report.Ident_Int(Counter_Check) + 1;
- if Counter_Check > Heavy_By_Two then
- Report.Failed("Unsigned_Over_8 loop overrun");
- exit;
- end if;
- end loop;
-
- if Counter_Check < Heavy_By_Two then
- Report.Failed("Unsigned_Over_8 loop underrun");
- end if;
-
- end Loop_Check;
-
- function ID( U8B: Unsigned_8_Bit ) return Unsigned_8_Bit is
- begin
- return Unsigned_8_Bit(Report.Ident_Int(Integer(U8B)));
- end ID;
-
- function ID( UEB: Unsigned_Edge_8 ) return Unsigned_Edge_8 is
- begin
- return Unsigned_Edge_8(Report.Ident_Int(Integer(UEB)));
- end ID;
-
- function ID( UOB: Unsigned_Over_8 ) return Unsigned_Over_8 is
- begin
- return Unsigned_Over_8(Report.Ident_Int(Integer(UOB)));
- end ID;
-
-end C450001_0;
-
-------------------------------------------------------------------- C450001
-
-with Report;
-with C450001_0;
-with TCTouch;
-procedure C450001 is
- use C450001_0;
-
- BR : constant String := " produced the wrong result";
-
- procedure Is_T(B:Boolean;S:String) renames TCTouch.Assert;
- procedure Is_F(B:Boolean;S:String) renames TCTouch.Assert_Not;
-
- Whole_8_A, Whole_8_B, Whole_8_C : C450001_0.Unsigned_8_Bit;
-
- Short_8_A, Short_8_B, Short_8_C : C450001_0.Unsigned_Edge_8;
-
- Over_8_A, Over_8_B, Over_8_C : C450001_0.Unsigned_Over_8;
-
-begin -- Main test procedure. C450001
-
- Report.Test ("C450001", "Check that operations on modular types " &
- "perform correctly." );
-
-
- -- the cases for the whole 8 bit type are pretty simple
-
- Whole_8_A := 2#00000000#;
- Whole_8_B := 2#11111111#;
-
- Is_T((ID(Whole_8_A) and ID(Whole_8_B)) = 2#00000000#,"8 bit and" & BR);
- Is_T((ID(Whole_8_A) or ID(Whole_8_B)) = 2#11111111#,"8 bit or" & BR);
- Is_T((ID(Whole_8_A) xor ID(Whole_8_B)) = 2#11111111#,"8 bit xor" & BR);
-
- Whole_8_A := 2#00001111#;
- Whole_8_B := 2#11111111#;
-
- Is_T((ID(Whole_8_A) and ID(Whole_8_B)) = 2#00001111#,"8 bit and" & BR);
- Is_T((ID(Whole_8_A) or ID(Whole_8_B)) = 2#11111111#,"8 bit or" & BR);
- Is_T((ID(Whole_8_A) xor ID(Whole_8_B)) = 2#11110000#,"8 bit xor" & BR);
-
- Whole_8_A := 2#10101010#;
- Whole_8_B := 2#11110000#;
-
- Is_T((ID(Whole_8_A) and ID(Whole_8_B)) = 2#10100000#,"8 bit and" & BR);
- Is_T((ID(Whole_8_A) or ID(Whole_8_B)) = 2#11111010#,"8 bit or" & BR);
- Is_T((ID(Whole_8_A) xor ID(Whole_8_B)) = 2#01011010#,"8 bit xor" & BR);
-
- -- the cases for the partial 8 bit type involve subtracting the modulus
- -- from results that exceed the modulus.
- -- hence, any of the following operations that exceed 2#11111110# must
- -- have 2#11111111# subtracted from the result; i.e. where you would
- -- expect to see 2#11111111# as in the above operations, the correct
- -- result will be 2#00000000#. Note that 2#11111111# is not a legal
- -- value of type C450001_0.Unsigned_Edge_8.
-
- Short_8_A := 2#11100101#;
- Short_8_B := 2#00011111#;
-
- Is_T((ID(Short_8_A) and ID(Short_8_B)) = 2#00000101#,"8 short and 1" & BR);
- Is_T((ID(Short_8_A) or ID(Short_8_B)) = 2#00000000#,"8 short or 1" & BR);
- Is_T((ID(Short_8_A) xor ID(Short_8_B)) = 2#11111010#,"8 short xor 1" & BR);
-
- Short_8_A := 2#11110000#;
- Short_8_B := 2#11111110#;
-
- Is_T((ID(Short_8_A) and ID(Short_8_B)) = 2#11110000#,"8 short and 2" & BR);
- Is_T((ID(Short_8_A) or ID(Short_8_B)) = 2#11111110#,"8 short or 2" & BR);
- Is_T((ID(Short_8_A) xor ID(Short_8_B)) = 2#00001110#,"8 short xor 2" & BR);
-
- Short_8_A := 2#10101010#;
- Short_8_B := 2#01010101#;
-
- Is_T((ID(Short_8_A) and ID(Short_8_B)) = 2#00000000#,"8 short and 3" & BR);
- Is_T((ID(Short_8_A) or ID(Short_8_B)) = 2#00000000#,"8 short or 3" & BR);
- Is_T((ID(Short_8_A) xor ID(Short_8_B)) = 2#00000000#,"8 short xor 3" & BR);
-
- Short_8_A := 2#10101010#;
- Short_8_B := 2#11111110#;
-
- Is_T((ID(Short_8_A) and ID(Short_8_B)) = 2#10101010#,"8 short and 4" & BR);
- Is_T((ID(Short_8_A) or ID(Short_8_B)) = 2#11111110#,"8 short or 4" & BR);
- Is_T((ID(Short_8_A) xor ID(Short_8_B)) = 2#01010100#,"8 short xor 4" & BR);
-
- -- the cases for the over 8 bit type have similar issues to the short type
- -- however the bit patterns are a little different. The rule is to subtract
- -- the modulus (258) from any resulting value equal or greater than the
- -- modulus -- note that 258 = 2#100000010#
-
- Over_8_A := 2#100000000#;
- Over_8_B := 2#011111111#;
-
- Is_T((ID(Over_8_A) and ID(Over_8_B)) = 2#000000000#,"8 over and" & BR);
- Is_T((ID(Over_8_A) or ID(Over_8_B)) = 2#011111101#,"8 over or" & BR);
- Is_T((ID(Over_8_A) xor ID(Over_8_B)) = 2#011111101#,"8 over xor" & BR);
-
- Over_8_A := 2#100000001#;
- Over_8_B := 2#011111111#;
-
- Is_T((ID(Over_8_A) and ID(Over_8_B)) = 2#000000001#,"8 over and" & BR);
- Is_T((ID(Over_8_A) or ID(Over_8_B)) = 2#011111101#,"8 over or" & BR);
- Is_T((ID(Over_8_A) xor ID(Over_8_B)) = 2#011111100#,"8 over xor" & BR);
-
-
-
- Whole_8_A := 128;
- Whole_8_B := 255;
-
- Is_T(ID(Whole_8_A) /= ID(Whole_8_B), "8 /=" & BR);
- Is_F(ID(Whole_8_A) = ID(Whole_8_B), "8 =" & BR);
-
- Is_T(ID(Whole_8_A) <= ID(Whole_8_B), "8 <=" & BR);
- Is_T(ID(Whole_8_A) < ID(Whole_8_B), "8 < " & BR);
-
- Is_F(ID(Whole_8_A) >= ID(Whole_8_B), "8 >=" & BR);
- Is_T(ID(Whole_8_A) > ID(Whole_8_B + 7), "8 > " & BR);
-
- Is_T(ID(Whole_8_A) in ID(100)..ID(200), "8 in" & BR);
- Is_F(ID(Whole_8_A) not in ID(100)..ID(200), "8 not in" & BR);
-
- Is_F(ID(Whole_8_A) in ID(200)..ID(250), "8 in" & BR);
- Is_T(ID(Whole_8_A) not in ID(200)..ID(250), "8 not in" & BR);
-
- Short_8_A := 127;
- Short_8_B := 254;
-
- Is_T(ID(Short_8_A) /= ID(Short_8_B), "short 8 /=" & BR);
- Is_F(ID(Short_8_A) = ID(Short_8_B), "short 8 =" & BR);
-
- Is_T(ID(Short_8_A) <= ID(Short_8_B), "short 8 <=" & BR);
- Is_T(ID(Short_8_A) < ID(Short_8_B), "short 8 < " & BR);
-
- Is_F(ID(Short_8_A) >= ID(Short_8_B), "short 8 >=" & BR);
- Is_F(ID(Short_8_A) > ID(Short_8_B), "short 8 > " & BR);
-
- Is_T(ID(Short_8_A) in ID(100)..ID(200), "8 in" & BR);
- Is_F(ID(Short_8_A) not in ID(100)..ID(200), "8 not in" & BR);
-
- Is_F(ID(Short_8_A) in ID(200)..ID(250), "8 in" & BR);
- Is_T(ID(Short_8_A) not in ID(200)..ID(250), "8 not in" & BR);
-
-
- Whole_8_A := 1;
- Whole_8_B := 254;
- Short_8_A := 1;
- Short_8_B := 2;
-
- Whole_8_C := ID(Whole_8_A) + ID(Whole_8_B);
- Is_T(Whole_8_C = C450001_0.Unsigned_8_Bit'Last, "8 binary + 1" & BR);
-
- Whole_8_C := Whole_8_C + ID(Whole_8_A);
- Is_T(Whole_8_C = C450001_0.Unsigned_8_Bit'First, "8 binary + 2" & BR);
-
- Whole_8_C := ID(Whole_8_A) - ID(Whole_8_A);
- Is_T(Whole_8_C = 0, "8 binary -" & BR);
-
- Whole_8_C := Whole_8_C - ID(Whole_8_A);
- Is_T(Whole_8_C = C450001_0.Unsigned_8_Bit'Last, "8 binary + 3" & BR);
-
- Short_8_C := ID(Short_8_A) + ID(C450001_0.Unsigned_Edge_8'Last);
- Is_T(Short_8_C = C450001_0.Unsigned_Edge_8'First, "Short binary + 1" & BR);
-
- Short_8_C := Short_8_A + ID(Short_8_A);
- Is_T(Short_8_C = ID(Short_8_B), "Short binary + 2" & BR);
-
- Short_8_C := ID(Short_8_A) - ID(Short_8_A);
- Is_T(Short_8_C = 0, "Short 8 binary -" & BR);
-
- Short_8_C := Short_8_C - ID(Short_8_A);
- Is_T(Short_8_C = C450001_0.Unsigned_Edge_8'Last, "Short binary + 3" & BR);
-
-
- Whole_8_C := ( + ID(Whole_8_B) );
- Is_T(Whole_8_C = 254, "8 unary +" & BR);
-
- Whole_8_C := ( - ID(Whole_8_A) );
- Is_T(Whole_8_C = C450001_0.Unsigned_8_Bit'Last, "8 unary -" & BR);
-
- Whole_8_C := ( - ID(0) );
- Is_T(Whole_8_C = 0, "8 unary -0" & BR);
-
- Short_8_C := ( + ID(C450001_0.Unsigned_Edge_8'Last) );
- Is_T(Short_8_C = 254, "Short 8 unary +" & BR);
-
- Short_8_C := ( - ID(Short_8_A) );
- Is_T(Short_8_C = C450001_0.Unsigned_Edge_8'Last, "Short 8 unary -" & BR);
-
-
- Whole_8_A := 20;
- Whole_8_B := 255;
-
- Whole_8_C := ID(Whole_8_A) * ID(Whole_8_B); -- 5100 = 19*256 + 236 (256-20)
- Is_T(Whole_8_C = 236, "8 *" & BR);
-
- Short_8_A := 9;
- Short_8_B := 254;
-
- Short_8_C := ID(Short_8_A) * ID(Short_8_B); -- 2286 = 8*255 + 246 (255-9)
- Is_T(Short_8_C = 246, "short 8 *" & BR);
-
- Over_8_A := 12;
- Over_8_B := 86;
-
- Over_8_C := ID(Over_8_A) * ID(Over_8_B); -- 1032 = 4*258 + 0
- Is_T(Over_8_C = 0, "over 8 *" & BR);
-
-
- Whole_8_A := 255;
- Whole_8_B := 4;
-
- Whole_8_C := ID(Whole_8_A) / ID(Whole_8_B);
- Is_T(Whole_8_C = 63, "8 /" & BR);
-
- Short_8_A := 253;
- Short_8_B := 127;
-
- Short_8_C := ID(Short_8_A) / ID(Short_8_B);
- Is_T(Short_8_C = 1, "short 8 / 1" & BR);
-
- Short_8_C := ID(Short_8_A) / ID(126);
- Is_T(Short_8_C = 2, "short 8 / 2" & BR);
-
-
- Whole_8_A := 255;
- Whole_8_B := 254;
-
- Whole_8_C := ID(Whole_8_A) rem ID(Whole_8_B);
- Is_T(Whole_8_C = 1, "8 rem" & BR);
-
- Short_8_A := 222;
- Short_8_B := 111;
-
- Short_8_C := ID(Short_8_A) rem ID(Short_8_B);
- Is_T(Short_8_C = 0, "short 8 rem" & BR);
-
-
- Whole_8_A := 99;
- Whole_8_B := 9;
-
- Whole_8_C := ID(Whole_8_A) mod ID(Whole_8_B);
- Is_T(Whole_8_C = 0, "8 mod" & BR);
-
- Short_8_A := 254;
- Short_8_B := 250;
-
- Short_8_C := ID(Short_8_A) mod ID(Short_8_B);
- Is_T(Short_8_C = 4, "short 8 mod" & BR);
-
-
- Whole_8_A := 99;
-
- Whole_8_C := abs Whole_8_A;
- Is_T(Whole_8_C = ID(99), "8 abs" & BR);
-
- Short_8_A := 254;
-
- Short_8_C := ID( abs Short_8_A );
- Is_T(Short_8_C = 254, "short 8 abs" & BR);
-
-
- Whole_8_B := 2#00001111#;
-
- Whole_8_C := not Whole_8_B;
- Is_T(Whole_8_C = ID(2#11110000#), "8 not" & BR);
-
- Short_8_B := 2#00001111#; -- 15
-
- Short_8_C := ID( not Short_8_B ); -- 254 - 15
- Is_T(Short_8_C = 2#11101111#, "short 8 not" & BR); -- 239
-
-
- Whole_8_A := 2;
-
- Whole_8_C := Whole_8_A ** 7;
- Is_T(Whole_8_C = ID(128), "2 ** 7, whole 8" & BR);
-
- Whole_8_C := Whole_8_A ** 9;
- Is_T(Whole_8_C = ID(0), "2 ** 9, whole 8" & BR);
-
- Short_8_A := 4;
-
- Short_8_C := ID( Short_8_A ) ** 4;
- Is_T(Short_8_C = 1, "4 ** 4, short" & BR);
-
- Over_8_A := 4;
-
- Over_8_C := ID( Over_8_A ) ** 4;
- Is_T(Over_8_C = 256, "4 ** 4, over" & BR);
-
- Over_8_C := ID( Over_8_A ) ** 5; -- 1024 = 3*258 + 250
- Is_T(Over_8_C = 250, "4 ** 5, over" & BR);
-
-
- C450001_0.Loop_Check;
-
- Report.Result;
-
-end C450001;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c452001.a b/gcc/testsuite/ada/acats/tests/c4/c452001.a
deleted file mode 100644
index ec78cd2a5a0..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c452001.a
+++ /dev/null
@@ -1,707 +0,0 @@
--- C452001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- For a type extension, check that predefined equality is defined in
--- terms of the primitive equals operator of the parent type and any
--- tagged components of the extension part.
---
--- For other composite types, check that the primitive equality operator
--- of any matching tagged components is used to determine equality of the
--- enclosing type.
---
--- For private types, check that predefined equality is defined in
--- terms of the user-defined (primitive) operator of the full type if
--- the full type is tagged. The partial view of the type may be
--- tagged or untagged. Check that predefined equality for a private
--- type whose full view is untagged is defined in terms of the
--- predefined equality operator of its full type.
---
--- TEST DESCRIPTION:
--- Tagged types are declared and used as components in several
--- differing composite type declarations, both tagged and untagged.
--- To differentiate between predefined and primitive equality
--- operations, user-defined equality operators are declared for
--- each component type that is to contribute to the equality
--- operator of the composite type that houses it. All user-defined
--- equality operations are designed to yield the opposite result
--- from the predefined operator, given the same component values.
---
--- For cases where primitive equality is to be incorporated into
--- equality for the enclosing composite type, values are assigned
--- to the component type so that user-defined equality will return
--- True. If predefined equality is to be used instead, then the
--- same strategy results in the equality operator returning False.
---
--- When equality for a type incorporates the user-defined equality
--- operator of one of its component types, the resulting operator
--- is considered to be the predefined operator of the composite type.
--- This case is confirmed by defining an tagged component of an
--- untagged composite type, then using the resulting untagged type
--- as a component of another composite type. The user-defined operator
--- for the lowest level should still be called.
---
--- Three cases are set up to test private types:
---
--- Case 1 Case 2 Case 3
--- partial view: tagged untagged untagged
--- full view: tagged tagged untagged
---
--- Types are declared for each of the above cases and user-defined
--- (primitive) operators are declared following the full type
--- declaration of each type (i.e., in the private part).
---
--- Values are assigned into objects of these types using the same
--- strategy outlined above. Cases 1 and 2 should execute the
--- user-defined operator. Case 3 should ignore the user-defined
--- operator and user predefined equality for the type.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Removed RM references from objective text.
--- 15 Nov 95 SAIC Fixed for 2.0.1
--- 04 NOV 96 SAIC Typographical revision
---
---!
-
-package c452001_0 is
-
- type Point is
- record
- X : Integer := 0;
- Y : Integer := 0;
- end record;
-
- type Circle is tagged
- record
- Center : Point;
- Radius : Integer;
- end record;
-
- function "=" (L, R : Circle) return Boolean;
-
- type Colors is (Red, Orange, Yellow, Green, Blue, Purple, Black, White);
-
- type Colored_Circle is new Circle
- with record
- Color : Colors := White;
- end record;
-
- function "=" (L, R : Colored_Circle) return Boolean;
- -- Override predefined equality for this tagged type. Predefined
- -- equality should incorporate user-defined (primitive) equality
- -- from type Circle. See C340001 for a test of that feature.
-
- -- Equality is overridden to ensure that predefined equality
- -- incorporates this user-defined function for
- -- any composite type with Colored_Circle as a component type.
- -- (i.e., the type extension is recognized as a tagged type for
- -- the purpose of defining predefined equality for the composite type).
-
-end C452001_0;
-
-package body c452001_0 is
-
- function "=" (L, R : Circle) return Boolean is
- begin
- return L.Radius = R.Radius; -- circles are same size
- end "=";
-
- function "=" (L, R : Colored_Circle) return Boolean is
- begin
- return Circle(L) = Circle(R);
- end "=";
-
-end C452001_0;
-
-with C452001_0;
-package C452001_1 is
-
- type Planet is tagged record
- Name : String (1..15);
- Representation : C452001_0.Colored_Circle;
- end record;
-
- -- Type Planet will be used to check that predefined equality
- -- for a tagged type with a tagged component incorporates
- -- user-defined equality for the component type.
-
- type TC_Planet is new Planet with null record;
-
- -- A "copy" of Planet. Used to create a type extension. An "="
- -- operator will be defined for this type that should be
- -- incorporated by the type extension.
-
- function "=" (Arg1, Arg2 : in TC_Planet) return Boolean;
-
- type Craters is array (1..3) of C452001_0.Colored_Circle;
-
- -- An array type (untagged) with tagged components
-
- type Moon is new TC_Planet
- with record
- Crater : Craters;
- end record;
-
- -- A tagged record type. Extended component type is untagged,
- -- but its predefined equality operator should incorporate
- -- the user-defined operator of its tagged component type.
-
-end C452001_1;
-
-package body C452001_1 is
-
- function "=" (Arg1, Arg2 : in TC_Planet) return Boolean is
- begin
- return Arg1.Name = Arg2.Name;
- end "=";
-
-end C452001_1;
-
-package C452001_2 is
-
- -- Untagged record types
- -- Equality should not be incorporated
-
- type Spacecraft_Design is (Mariner, Pioneer, Viking, Voyager);
- type Spacecraft is record
- Design : Spacecraft_Design;
- Operational : Boolean;
- end record;
-
- function "=" (L : in Spacecraft; R : in Spacecraft) return Boolean;
-
- type Mission is record
- Craft : Spacecraft;
- Launch_Date : Natural;
- end record;
-
- type Inventory is array (Positive range <>) of Spacecraft;
-
-end C452001_2;
-
-package body C452001_2 is
-
- function "=" (L : in Spacecraft; R : in Spacecraft) return Boolean is
- begin
- return L.Design = R.Design;
- end "=";
-
-end C452001_2;
-
-package C452001_3 is
-
- type Tagged_Partial_Tagged_Full is tagged private;
- procedure Change (Object : in out Tagged_Partial_Tagged_Full;
- Value : in Boolean);
-
- type Untagged_Partial_Tagged_Full is private;
- procedure Change (Object : in out Untagged_Partial_Tagged_Full;
- Value : in Integer);
-
- type Untagged_Partial_Untagged_Full is private;
- procedure Change (Object : in out Untagged_Partial_Untagged_Full;
- Value : in Duration);
-
-private
-
- type Tagged_Partial_Tagged_Full is
- tagged record
- B : Boolean := True;
- C : Character := ' ';
- end record;
- -- predefined equality checks that all components are equal
-
- function "=" (L, R : in Tagged_Partial_Tagged_Full) return Boolean;
- -- primitive equality checks that records equate in component C only
-
- type Untagged_Partial_Tagged_Full is
- tagged record
- I : Integer := 0;
- P : Positive := 1;
- end record;
- -- predefined equality checks that all components are equal
-
- function "=" (L, R : in Untagged_Partial_Tagged_Full) return Boolean;
- -- primitive equality checks that records equate in component P only
-
- type Untagged_Partial_Untagged_Full is
- record
- D : Duration := 0.0;
- S : String (1..12) := "Ada 9X rules";
- end record;
- -- predefined equality checks that all components are equal
-
- function "=" (L, R : in Untagged_Partial_Untagged_Full) return Boolean;
- -- primitive equality checks that records equate in component S only
-
-end C452001_3;
-
-with Report;
-package body C452001_3 is
-
- procedure Change (Object : in out Tagged_Partial_Tagged_Full;
- Value : in Boolean) is
- begin
- Object := (Report.Ident_Bool(Value), Object.C);
- end Change;
-
- procedure Change (Object : in out Untagged_Partial_Tagged_Full;
- Value : in Integer) is
- begin
- Object := (Report.Ident_Int(Value), Object.P);
- end Change;
-
- procedure Change (Object : in out Untagged_Partial_Untagged_Full;
- Value : in Duration) is
- begin
- Object := (Value, Report.Ident_Str(Object.S));
- end Change;
-
- function "=" (L, R : in Tagged_Partial_Tagged_Full) return Boolean is
- begin
- return L.C = R.C;
- end "=";
-
- function "=" (L, R : in Untagged_Partial_Tagged_Full) return Boolean is
- begin
- return L.P = R.P;
- end "=";
-
- function "=" (L, R : in Untagged_Partial_Untagged_Full) return Boolean is
- begin
- return R.S = L.S;
- end "=";
-
-end C452001_3;
-
-
-with C452001_0;
-with C452001_1;
-with C452001_2;
-with C452001_3;
-with Report;
-procedure C452001 is
-
- Mars_Aphelion : C452001_1.Planet :=
- (Name => "Mars ",
- Representation => (Center => (Report.Ident_Int(20),
- Report.Ident_Int(0)),
- Radius => Report.Ident_Int(4),
- Color => C452001_0.Red));
-
- Mars_Perihelion : C452001_1.Planet :=
- (Name => "Mars ",
- Representation => (Center => (Report.Ident_Int(-20),
- Report.Ident_Int(0)),
- Radius => Report.Ident_Int(4),
- Color => C452001_0.Red));
-
- -- Mars_Perihelion = Mars_Aphelion if user-defined equality from
- -- the tagged type Colored_Circle was incorporated into
- -- predefined equality for the tagged type Planet. User-defined
- -- equality for Colored_Circle checks only that the Radii are equal.
-
- Blue_Mars : C452001_1.Planet :=
- (Name => "Mars ",
- Representation => (Center => (Report.Ident_Int(10),
- Report.Ident_Int(10)),
- Radius => Report.Ident_Int(4),
- Color => C452001_0.Blue));
-
- -- Blue_Mars should equal Mars_Perihelion, because Names and
- -- Radii are equal (all other components are not).
-
- Green_Mars : C452001_1.Planet :=
- (Name => "Mars ",
- Representation => (Center => (Report.Ident_Int(10),
- Report.Ident_Int(10)),
- Radius => Report.Ident_Int(4),
- Color => C452001_0.Green));
-
- -- Blue_Mars should equal Green_Mars. They differ only in the
- -- Color component. All user-defined equality operations return
- -- True, but records are not equal by predefined equality.
-
- -- Blue_Mars should equal Mars_Perihelion, because Names and
- -- Radii are equal (all other components are not).
-
- Moon_Craters : C452001_1.Craters :=
- ((Center => (Report.Ident_Int(9), Report.Ident_Int(11)),
- Radius => Report.Ident_Int(1),
- Color => C452001_0.Black),
- (Center => (Report.Ident_Int(10), Report.Ident_Int(10)),
- Radius => Report.Ident_Int(1),
- Color => C452001_0.Black),
- (Center => (Report.Ident_Int(11), Report.Ident_Int(9)),
- Radius => Report.Ident_Int(1),
- Color => C452001_0.Black));
-
- Alternate_Moon_Craters : C452001_1.Craters :=
- ((Center => (Report.Ident_Int(9), Report.Ident_Int(9)),
- Radius => Report.Ident_Int(1),
- Color => C452001_0.Yellow),
- (Center => (Report.Ident_Int(10), Report.Ident_Int(10)),
- Radius => Report.Ident_Int(1),
- Color => C452001_0.Purple),
- (Center => (Report.Ident_Int(11), Report.Ident_Int(11)),
- Radius => Report.Ident_Int(1),
- Color => C452001_0.Purple));
-
- -- Moon_Craters = Alternate_Moon_Craters if user-defined equality from
- -- the tagged type Colored_Circle was incorporated into
- -- predefined equality for the untagged type Craters. User-defined
- -- equality checks only that the Radii are equal.
-
- New_Moon : C452001_1.Moon :=
- (Name => "Moon ",
- Representation => (Center => (Report.Ident_Int(10),
- Report.Ident_Int(8)),
- Radius => Report.Ident_Int(3),
- Color => C452001_0.Black),
- Crater => Moon_Craters);
-
- Full_Moon : C452001_1.Moon :=
- (Name => "Moon ",
- Representation => (Center => (Report.Ident_Int(10),
- Report.Ident_Int(8)),
- Radius => Report.Ident_Int(3),
- Color => C452001_0.Black),
- Crater => Alternate_Moon_Craters);
-
- -- New_Moon = Full_Moon if user-defined equality from
- -- the tagged type Colored_Circle was incorporated into
- -- predefined equality for the untagged type Craters. This
- -- equality test should call user-defined equality for type
- -- TC_Planet (checks that Names are equal), then predefined
- -- equality for Craters (ultimately calls user-defined equality
- -- for type Circle, checking that Radii of craters are equal).
-
- Mars_Moon : C452001_1.Moon :=
- (Name => "Phobos ",
- Representation => (Center => (Report.Ident_Int(10),
- Report.Ident_Int(8)),
- Radius => Report.Ident_Int(3),
- Color => C452001_0.Black),
- Crater => Alternate_Moon_Craters);
-
- -- Mars_Moon /= Full_Moon since the Names differ.
-
- Alternate_Moon_Craters_2 : C452001_1.Craters :=
- ((Center => (Report.Ident_Int(10), Report.Ident_Int(10)),
- Radius => Report.Ident_Int(1),
- Color => C452001_0.Red),
- (Center => (Report.Ident_Int(9), Report.Ident_Int(9)),
- Radius => Report.Ident_Int(1),
- Color => C452001_0.Red),
- (Center => (Report.Ident_Int(10), Report.Ident_Int(9)),
- Radius => Report.Ident_Int(1),
- Color => C452001_0.Red));
-
- Harvest_Moon : C452001_1.Moon :=
- (Name => "Moon ",
- Representation => (Center => (Report.Ident_Int(11),
- Report.Ident_Int(7)),
- Radius => Report.Ident_Int(4),
- Color => C452001_0.Orange),
- Crater => Alternate_Moon_Craters_2);
-
- -- Only the fields that are employed by the user-defined equality
- -- operators are the same. Everything else differs. Equality should
- -- still return True.
-
- Viking_1_Orbiter : C452001_2.Mission :=
- (Craft => (Design => C452001_2.Viking,
- Operational => Report.Ident_Bool(False)),
- Launch_Date => 1975);
-
- Viking_1_Lander : C452001_2.Mission :=
- (Craft => (Design => C452001_2.Viking,
- Operational => Report.Ident_Bool(True)),
- Launch_Date => 1975);
-
- -- Viking_1_Orbiter /= Viking_1_Lander if predefined equality
- -- from the untagged type Spacecraft is used for equality
- -- of matching components in type Mission. If user-defined
- -- equality for type Spacecraft is incorporated, which it
- -- should not be by 4.5.2(21), then Viking_1_Orbiter = Viking_1_Lander.
-
- Voyagers : C452001_2.Inventory (1..2):=
- ((C452001_2.Voyager, Operational => Report.Ident_Bool(True)),
- (C452001_2.Voyager, Operational => Report.Ident_Bool(False)));
-
- Jupiter_Craft : C452001_2.Inventory (1..2):=
- ((C452001_2.Voyager, Operational => Report.Ident_Bool(True)),
- (C452001_2.Voyager, Operational => Report.Ident_Bool(True)));
-
- -- Voyagers /= Jupiter_Craft if predefined equality
- -- from the untagged type Spacecraft is used for equality
- -- of matching components in type Inventory. If user-defined
- -- equality for type Spacecraft is incorporated, which it
- -- should not be by 4.5.2(21), then Voyagers = Jupiter_Craft.
-
- TPTF_1 : C452001_3.Tagged_Partial_Tagged_Full;
- TPTF_2 : C452001_3.Tagged_Partial_Tagged_Full;
-
- -- With differing values for Boolean component, user-defined
- -- (primitive) equality returns True, predefined equality
- -- returns False. Since full type is tagged, primitive equality
- -- should be used.
-
- UPTF_1 : C452001_3.Untagged_Partial_Tagged_Full;
- UPTF_2 : C452001_3.Untagged_Partial_Tagged_Full;
-
- -- With differing values for Boolean component, user-defined
- -- (primitive) equality returns True, predefined equality
- -- returns False. Since full type is tagged, primitive equality
- -- should be used.
-
- UPUF_1 : C452001_3.Untagged_Partial_Untagged_Full;
- UPUF_2 : C452001_3.Untagged_Partial_Untagged_Full;
-
- -- With differing values for Duration component, user-defined
- -- (primitive) equality returns True, predefined equality
- -- returns False. Since full type is untagged, predefined equality
- -- should be used.
-
- -- Use type clauses make "=" and "/=" operators directly visible
- use type C452001_1.Planet;
- use type C452001_1.Craters;
- use type C452001_1.Moon;
- use type C452001_2.Mission;
- use type C452001_2.Inventory;
- use type C452001_3.Tagged_Partial_Tagged_Full;
- use type C452001_3.Untagged_Partial_Tagged_Full;
- use type C452001_3.Untagged_Partial_Untagged_Full;
-
-begin
-
- Report.Test ("C452001", "Equality of private types and " &
- "composite types with tagged components");
-
- -------------------------------------------------------------------
- -- Tagged type with tagged component.
- -------------------------------------------------------------------
-
- if not (Mars_Aphelion = Mars_Perihelion) then
- Report.Failed ("User-defined equality for tagged component " &
- "was not incorporated into predefined equality " &
- "for enclosing tagged record type");
- end if;
-
- if Mars_Aphelion /= Mars_Perihelion then
- Report.Failed ("User-defined equality for tagged component " &
- "was not incorporated into predefined inequality " &
- "for enclosing tagged record type");
- end if;
-
- if not (Blue_Mars = Mars_Perihelion) then
- Report.Failed ("Equality test for tagged record type " &
- "incorporates record components " &
- "other than those used by user-defined equality");
- end if;
-
- if Blue_Mars /= Mars_Perihelion then
- Report.Failed ("Inequality test for tagged record type " &
- "incorporates record components " &
- "other than those used by user-defined equality");
- end if;
-
- if Blue_Mars /= Green_Mars then
- Report.Failed ("Records are unequal even though they only differ " &
- "in a component not used by user-defined equality");
- end if;
-
- if not (Blue_Mars = Green_Mars) then
- Report.Failed ("Records are not equal even though they only differ " &
- "in a component not used by user-defined equality");
- end if;
-
- -------------------------------------------------------------------
- -- Untagged (array) type with tagged component.
- -------------------------------------------------------------------
-
- if not (Moon_Craters = Alternate_Moon_Craters) then
- Report.Failed ("User-defined equality for tagged component " &
- "was not incorporated into predefined equality " &
- "for enclosing array type");
- end if;
-
- if Moon_Craters /= Alternate_Moon_Craters then
- Report.Failed ("User-defined equality for tagged component " &
- "was not incorporated into predefined inequality " &
- "for enclosing array type");
- end if;
-
- -------------------------------------------------------------------
- -- Tagged type with untagged composite component. Untagged
- -- component itself has tagged components.
- -------------------------------------------------------------------
- if not (New_Moon = Full_Moon) then
- Report.Failed ("User-defined equality for tagged component " &
- "was not incorporated into predefined equality " &
- "for array component of tagged record type");
- end if;
-
- if New_Moon /= Full_Moon then
- Report.Failed ("User-defined equality for tagged component " &
- "was not incorporated into predefined inequality " &
- "for array component of tagged record type");
- end if;
-
- if Mars_Moon = Full_Moon then
- Report.Failed ("User-defined equality for tagged component " &
- "was not incorporated into predefined equality " &
- "for array component of tagged record type");
- end if;
-
- if not (Mars_Moon /= Full_Moon) then
- Report.Failed ("User-defined equality for tagged component " &
- "was not incorporated into predefined inequality " &
- "for array component of tagged record type");
- end if;
-
- if not (Harvest_Moon = Full_Moon) then
- Report.Failed ("Equality test for record with array of tagged " &
- "components incorporates record components " &
- "other than those used by user-defined equality");
- end if;
-
- if Harvest_Moon /= Full_Moon then
- Report.Failed ("Inequality test for record with array of tagged " &
- "components incorporates record components " &
- "other than those used by user-defined equality");
- end if;
-
- -------------------------------------------------------------------
- -- Untagged types with no tagged components.
- -------------------------------------------------------------------
-
- -- Record type
-
- if Viking_1_Orbiter = Viking_1_Lander then
- Report.Failed ("User-defined equality for untagged composite " &
- "component was incorporated into predefined " &
- "equality for " &
- "untagged record type");
- end if;
-
- if not (Viking_1_Orbiter /= Viking_1_Lander) then
- Report.Failed ("User-defined equality for untagged composite " &
- "component was incorporated into predefined " &
- "inequality for " &
- "untagged record type");
- end if;
-
- -- Array type
-
- if Voyagers = Jupiter_Craft then
- Report.Failed ("User-defined equality for untagged composite " &
- "component was incorporated into predefined " &
- "equality for " &
- "array type");
- end if;
-
- if not (Voyagers /= Jupiter_Craft) then
- Report.Failed ("User-defined equality for untagged composite " &
- "component was incorporated into predefined " &
- "inequality for " &
- "array type");
- end if;
-
- -------------------------------------------------------------------
- -- Private types tests.
- -------------------------------------------------------------------
-
- -- Make objects differ from one another
-
- C452001_3.Change (TPTF_1, False);
- C452001_3.Change (UPTF_1, 999);
- C452001_3.Change (UPUF_1, 40.0);
-
- -------------------------------------------------------------------
- -- Partial type and full type are tagged. (Full type must be tagged
- -- if partial type is tagged)
- -------------------------------------------------------------------
-
- if not (TPTF_1 = TPTF_2) then
- Report.Failed ("Predefined equality for full type " &
- "was used to determine equality of " &
- "tagged private type " &
- "instead of user-defined (primitive) equality");
- end if;
-
- if TPTF_1 /= TPTF_2 then
- Report.Failed ("Predefined equality for full type " &
- "was used to determine inequality of " &
- "tagged private type " &
- "instead of user-defined (primitive) equality");
- end if;
-
- -------------------------------------------------------------------
- -- Partial type untagged, full type tagged.
- -------------------------------------------------------------------
-
- if not (UPTF_1 = UPTF_2) then
- Report.Failed ("Predefined equality for full type " &
- "was used to determine equality of " &
- "private type (untagged partial view, " &
- "tagged full view) " &
- "instead of user-defined (primitive) equality");
- end if;
-
- if UPTF_1 /= UPTF_2 then
- Report.Failed ("Predefined equality for full type " &
- "was used to determine inequality of " &
- "private type (untagged partial view, " &
- "tagged full view) " &
- "instead of user-defined (primitive) equality");
- end if;
-
- -------------------------------------------------------------------
- -- Partial type and full type are both untagged.
- -------------------------------------------------------------------
-
- if UPUF_1 = UPUF_2 then
- Report.Failed ("User-defined (primitive) equality for full type " &
- "was used to determine equality of " &
- "private type (untagged partial view, " &
- "untagged full view) " &
- "instead of predefined equality");
- end if;
-
- if not (UPUF_1 /= UPUF_2) then
- Report.Failed ("User-defined (primitive) equality for full type " &
- "was used to determine inequality of " &
- "private type (untagged partial view, " &
- "untagged full view) " &
- "instead of predefined equality");
- end if;
-
- -------------------------------------------------------------------
- Report.Result;
-
-end C452001;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c455001.a b/gcc/testsuite/ada/acats/tests/c4/c455001.a
deleted file mode 100644
index 8685e1b3381..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c455001.a
+++ /dev/null
@@ -1,164 +0,0 @@
--- C455001.A
-
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
--- F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
--- software and documentation contained herein. Unlimited rights are
--- defined in DFAR 252.227-7013(a)(19). By making this public release,
--- the Government intends to confer upon all recipients unlimited rights
--- equal to those held by the Government. These rights include rights to
--- use, duplicate, release or disclose the released technical data and
--- computer software in whole or in part, in any manner and for any purpose
--- whatsoever, and to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that universal fixed multiplying operators can be used without
--- a conversion in contexts where the result type is determined.
---
--- Note: This is intended to check the changes made to these operators
--- in Ada 95; legacy tests should cover cases from Ada 83.
---
--- CHANGE HISTORY:
--- 18 MAR 99 RLB Initial version
---
---!
-
-with Report; use Report;
-
-procedure C455001 is
-
- type F1 is delta 2.0**(-1) range 0.0 .. 8.0;
-
- type F2 is delta 2.0**(-2) range 0.0 .. 4.0;
-
- type F3 is delta 2.0**(-3) range 0.0 .. 2.0;
-
- A : F1;
- B : F2;
- C : F3;
-
- type Fixed_Record is record
- D : F1;
- E : F2;
- end record;
-
- R : Fixed_Record;
-
- function Ident_Fix (X : F3) return F3 is
- begin
- if Equal(3,3) then
- return X;
- else
- return 0.0;
- end if;
- end Ident_Fix;
-
-begin
- Test ("C455001", "Check that universal fixed multiplying operators " &
- "can be used without a conversion in contexts where " &
- "the result type is determined.");
-
- A := 1.0; B := 1.0;
- C := A * B; -- Assignment context.
-
- if C /= Ident_Fix(1.0) then
- Failed ("Incorrect results for multiplication (1) - result is " &
- F3'Image(C));
- end if;
-
- C := A / B;
-
- if C /= Ident_Fix(1.0) then
- Failed ("Incorrect results for division (1) - result is " &
- F3'Image(C));
- end if;
-
- A := 2.5;
- C := A * 0.25;
-
- if C /= Ident_Fix(0.625) then
- Failed ("Incorrect results for multiplication (2) - result is " &
- F3'Image(C));
- end if;
-
- C := A / 4.0;
-
- if C /= Ident_Fix(0.625) then
- Failed ("Incorrect results for division (2) - result is " &
- F3'Image(C));
- end if;
-
- C := Ident_Fix(0.75);
- C := C * 0.5;
-
- if C /= Ident_Fix(0.375) then
- Failed ("Incorrect results for multiplication (3) - result is " &
- F3'Image(C));
- end if;
-
- C := Ident_Fix(0.75);
- C := C / 0.5;
-
- if C /= Ident_Fix(1.5) then
- Failed ("Incorrect results for division (3) - result is " &
- F3'Image(C));
- end if;
-
- A := 0.5; B := 0.3; -- Function parameter context.
- if Ident_Fix(A * B) not in Ident_Fix(0.125) .. Ident_Fix(0.25) then
- Failed ("Incorrect results for multiplication (4) - result is " &
- F3'Image(A * B)); -- Exact = 0.15
- end if;
-
- B := 0.8;
- if Ident_Fix(A / B) not in Ident_Fix(0.5) .. Ident_Fix(0.75) then
- Failed ("Incorrect results for division (4) - result is " &
- F3'Image(A / B));
- -- Exact = 0.625..., but B is only restricted to the range
- -- 0.75 .. 1.0, so the result can be anywhere in the range
- -- 0.5 .. 0.75.
- end if;
-
- C := 0.875; B := 1.5;
- R := (D => C * 4.0, E => B / 0.5); -- Aggregate context.
-
- if R.D /= 3.5 then
- Failed ("Incorrect results for multiplication (5) - result is " &
- F1'Image(R.D));
- end if;
-
- if R.E /= 3.0 then
- Failed ("Incorrect results for division (5) - result is " &
- F2'Image(R.E));
- end if;
-
- A := 0.5;
- C := A * F1'(B * 2.0); -- Qualified expression context.
-
- if C /= Ident_Fix(1.5) then
- Failed ("Incorrect results for multiplication (6) - result is " &
- F3'Image(C));
- end if;
-
- A := 4.0;
- C := F1'(B / 0.5) / A;
-
- if C /= Ident_Fix(0.75) then
- Failed ("Incorrect results for division (6) - result is " &
- F3'Image(C));
- end if;
-
- Result;
-
-end C455001;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460001.a b/gcc/testsuite/ada/acats/tests/c4/c460001.a
deleted file mode 100644
index 907b8564f6d..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460001.a
+++ /dev/null
@@ -1,300 +0,0 @@
--- C460001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the target type of a type conversion is a general
--- access type, Program_Error is raised if the accessibility level
--- of the operand type is deeper than that of the target type.
--- Check for the case where the operand is an access parameter.
---
--- Check for cases where the actual corresponding to the access
--- parameter is:
--- (a) An allocator.
--- (b) An expression of a named access type.
--- (c) Obj'Access.
---
--- TEST DESCRIPTION:
--- In order to satisfy accessibility requirements, the operand type
--- must be at the same or a less deep nesting level than the target
--- type -- the operand type must "live" as long as the target type.
--- Nesting levels are the run-time nestings of masters: block statements;
--- subprogram, task, and entry bodies; and accept statements. Packages
--- are invisible to accessibility rules.
---
--- This test declares subprograms with access parameters, within which
--- a type conversion is attempted on the access parameter to an access
--- type A declared at some nesting level. The test verifies that
--- Program_Error is raised if the actual corresponding to the access
--- parameter is:
---
--- (1) an allocator, and the accessibility level of the execution
--- of the called subprogram is deeper than that of the access
--- type A.
---
--- (2) an expression of a named access type, and the accessibility
--- level of the named access type is deeper than that of the
--- access type A.
---
--- (3) a reference to the Access attribute (e.g., X'Access), and
--- the accessibility level of X is deeper than that of the
--- access type A.
---
--- Note that the static nesting level of the actual corresponding to the
--- access parameter can be deeper than that of the target type -- it is
--- the run-time nesting that matters for accessibility rules. Consider
--- the case where the access type A is declared within the called
--- subprogram. The accessibility check will never fail, even if the
--- actual happens to have a deeper static nesting level:
---
--- procedure P (X: access T) is
--- type A is access all T; -- Static level = 2, e.g.
--- Acc : A := A(X); -- Check should never fail.
--- begin null; end;
--- . . .
--- declare
--- Actual : aliased T; -- Static level = 3, e.g.
--- begin
--- P (Actual'Access);
--- end;
---
--- For the execution of P, the accessibility level of type A will
--- always be deeper than that of Actual, so there is no danger of a
--- dangling reference arising from the assignment to Acc. Thus, the
--- type conversion is safe, even though the static nesting level of
--- Actual is deeper than that of A.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C460001_0 is
-
- type Desig is array (1 .. 10) of Integer;
-
- X0 : aliased Desig; -- Level = 0.
-
- type Acc_L0 is access all Desig; -- Level = 0.
- A0 : Acc_L0;
-
- type Result_Kind is (OK, P_E, O_E);
-
- procedure Target_Is_Level_0 (X: access Desig; R : out Result_Kind);
- procedure Never_Fails (X: access Desig; R : out Result_Kind);
-
-end C460001_0;
-
-
- --==================================================================--
-
-
-package body C460001_0 is
-
- procedure Target_Is_Level_0 (X : access Desig;
- R : out Result_Kind) is
- begin
- -- The accessibility level of type Acc_L0 is 0.
- A0 := Acc_L0(X);
- R := OK;
- exception
- when Program_Error =>
- R := P_E;
- when others =>
- R := O_E;
- end Target_Is_Level_0;
-
- -----------------------------------------------
- procedure Never_Fails (X: access Desig;
- R : out Result_Kind) is
- type Acc_Local is access all Desig;
- AL : Acc_Local;
- begin
- -- The type conversion below will always be safe, since the
- -- accessibility level (although not necessarily the static nesting
- -- depth) of Acc_Local will always be deeper than or the same as that
- -- of the actual corresponding to X.
- AL := Acc_Local(X);
- R := OK;
- exception
- when Program_Error =>
- R := P_E;
- when others =>
- R := O_E;
- end Never_Fails;
-
-end C460001_0;
-
-
- --==================================================================--
-
-
-with C460001_0;
-with Report;
-
-procedure C460001 is
-
- X1 : aliased C460001_0.Desig; -- Level = 1.
-
- type Acc_L1 is access all C460001_0.Desig; -- Level = 1.
- A1 : Acc_L1;
-
- Expr_L0 : C460001_0.Acc_L0 := C460001_0.X0'Access;
- Expr_L1 : Acc_L1 := X1'Access;
-
- Res : C460001_0.Result_Kind;
-
- use type C460001_0.Result_Kind;
-
- -----------------------------------------------
- procedure Target_Is_Level_1 (X : access C460001_0.Desig;
- R : out C460001_0.Result_Kind) is
- begin
- -- The accessibility level of type Acc_L1 is 1.
- A1 := Acc_L1(X);
- R := C460001_0.OK;
- exception
- when Program_Error =>
- R := C460001_0.P_E;
- when others =>
- R := C460001_0.O_E;
- end Target_Is_Level_1;
-
- -----------------------------------------------
- procedure Display_Results (Result : in C460001_0.Result_Kind;
- Expected: in C460001_0.Result_Kind;
- Message : in String) is
- begin
- if Result /= Expected then
- case Result is
- when C460001_0.OK => Report.Failed ("No exception raised: " &
- Message);
- when C460001_0.P_E => Report.Failed ("Program_Error raised: " &
- Message);
- when C460001_0.O_E => Report.Failed ("Unexpected exception " &
- "raised: " & Message);
- end case;
- end if;
- end Display_Results;
-
-begin -- C460001
-
- Report.Test ("C460001", "Check that if the target type of a type " &
- "conversion is a general access type, Program_Error is " &
- "raised if the accessibility level of the operand type " &
- "is deeper than that of the target type: operand is an " &
- "access parameter; corresponding actual is an allocator, " &
- "expression of a named access type, Obj'Access");
-
-
- -- Actual is X'Access:
-
- C460001_0.Never_Fails (X1'Access, Res);
- Display_Results (Res, C460001_0.OK, "X1'Access, local access type");
-
- C460001_0.Target_Is_Level_0 (X1'Access, Res);
- Display_Results (Res, C460001_0.P_E, "X1'Access, level 0 access type");
-
- Target_Is_Level_1 (C460001_0.X0'Access, Res);
- Display_Results (Res, C460001_0.OK, "X0'Access, level 1 access type");
-
- Target_Is_Level_1 (X1'Access, Res);
- Display_Results (Res, C460001_0.OK, "X1'Access, level 1 access type");
-
- C460001_0.Target_Is_Level_0 (C460001_0.X0'Access, Res);
- Display_Results (Res, C460001_0.OK, "X0'Access, level 0 access type");
-
-
- -- Actual is expression of a named access type:
-
- C460001_0.Never_Fails (Expr_L0, Res);
- Display_Results (Res, C460001_0.OK, "Expr_L0, local access type");
-
- C460001_0.Target_Is_Level_0 (Expr_L0, Res);
- Display_Results (Res, C460001_0.OK, "Expr_L0, level 0 access type");
-
- C460001_0.Target_Is_Level_0 (Expr_L1, Res);
- Display_Results (Res, C460001_0.P_E, "Expr_L1, level 0 access type");
-
- Target_Is_Level_1 (Expr_L1, Res);
- Display_Results (Res, C460001_0.OK, "Expr_L1, level 1 access type");
-
- Target_Is_Level_1 (Expr_L0, Res);
- Display_Results (Res, C460001_0.OK, "Expr_L0, level 1 access type");
-
- -- Actual is allocator (level of execution = 2):
-
- C460001_0.Never_Fails (new C460001_0.Desig, Res);
- Display_Results (Res, C460001_0.OK, "Allocator level 2, " &
- "local access type");
-
- C460001_0.Target_Is_Level_0 (new C460001_0.Desig, Res);
- Display_Results (Res, C460001_0.P_E, "Allocator level 2, " &
- "level 0 access type");
-
- Target_Is_Level_1 (new C460001_0.Desig, Res);
- Display_Results (Res, C460001_0.P_E, "Allocator level 2, " &
- "level 1 access type");
-
-
- Block_L2:
- declare
- X2 : aliased C460001_0.Desig; -- Level = 2.
- type Acc_L2 is access all C460001_0.Desig; -- Level = 2.
- Expr_L2 : Acc_L2 := X1'Access;
- begin
-
- -- Actual is X'Access:
-
- C460001_0.Never_Fails (X2'Access, Res);
- Display_Results (Res, C460001_0.OK, "X2'Access, local access type");
-
- Target_Is_Level_1 (X2'Access, Res);
- Display_Results (Res, C460001_0.P_E, "X2'Access, level 1 access type");
-
- -- Actual is expression of a named access type:
-
- C460001_0.Never_Fails (Expr_L2, Res);
- Display_Results (Res, C460001_0.OK, "Expr_L2, local access type");
-
- C460001_0.Target_Is_Level_0 (Expr_L2, Res);
- Display_Results (Res, C460001_0.P_E, "Expr_L2, level 0 access type");
-
-
- -- Actual is allocator (level of execution = 3):
-
- C460001_0.Never_Fails (new C460001_0.Desig, Res);
- Display_Results (Res, C460001_0.OK, "Allocator level 3, " &
- "local access type");
-
- Target_Is_Level_1 (new C460001_0.Desig, Res);
- Display_Results (Res, C460001_0.P_E, "Allocator level 3, " &
- "level 1 access type");
-
- end Block_L2;
-
- Report.Result;
-
-end C460001;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460002.a b/gcc/testsuite/ada/acats/tests/c4/c460002.a
deleted file mode 100644
index 945dd567720..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460002.a
+++ /dev/null
@@ -1,330 +0,0 @@
--- C460002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the target type of a type conversion is a general
--- access type, Program_Error is raised if the accessibility level
--- of the operand type is deeper than that of the target type.
--- Check for the case where the operand is an access parameter,
--- and the actual corresponding to the access parameter is another
--- access parameter.
---
--- TEST DESCRIPTION:
--- In order to satisfy accessibility requirements, the operand type
--- must be at the same or a less deep nesting level than the target
--- type -- the operand type must "live" as long as the target type.
--- Nesting levels are the run-time nestings of masters: block statements;
--- subprogram, task, and entry bodies; and accept statements. Packages
--- are invisible to accessibility rules.
---
--- This test declares subprograms with access parameters, within which
--- a type conversion is attempted on the access parameter to an access
--- type A declared at some nesting level. The test verifies that
--- Program_Error is raised if the actual corresponding to the access
--- parameter is another access parameter, and the actual corresponding
--- to this second access parameter is:
---
--- (1) an expression of a named access type, and the accessibility
--- level of the named access type is deeper than that of the
--- access type A.
---
--- (2) a reference to the Access attribute (e.g., X'Access), and
--- the accessibility level of X is deeper than that of the
--- access type A.
---
--- Note that the static nesting level of the actual corresponding to the
--- access parameter can be deeper than that of the target type -- it is
--- the run-time nesting that matters for accessibility rules. Consider
--- the case where the access type A is declared within the called
--- subprogram. The accessibility check will never fail, even if the
--- actual happens to have a deeper static nesting level:
---
--- procedure P (X: access T) is
--- type A is access all T; -- Static level = 2, e.g.
--- Acc : A := A(X); -- Check should never fail.
--- begin null; end;
--- . . .
--- procedure Q (Y: access T) is
--- begin
--- P(Y);
--- end;
--- . . .
--- declare
--- Actual : aliased T; -- Static level = 3, e.g.
--- begin
--- Q (Actual'Access);
--- end;
---
--- For the execution of Q (and hence P), the accessibility level of
--- type A will always be deeper than that of Actual, so there is no
--- danger of a dangling reference arising from the assignment to
--- Acc. Thus, the type conversion is safe, even though the static
--- nesting level of Actual is deeper than that of A.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Changed maintenance documentation.
--- 15 Jul 98 EDS Avoid Optimization
--- 28 Jun 02 RLB Added pragma Elaborate_All.
---!
-
-with Report; use Report; pragma Elaborate_All (Report);
-package C460002_0 is
-
- type Component is array (1 .. 10) of Natural;
-
- type Desig is record
- C: Component;
- end record;
-
- X0 : aliased Desig := (C=>(others => Ident_Int(3))); -- Level = 0.
-
- type Acc_L0 is access all Desig; -- Level = 0.
- A0 : Acc_L0;
-
- type Result_Kind is (OK, P_E, O_E);
-
- procedure Target_Is_Level_0_Nest (Y: access Desig; S: out Result_Kind);
- procedure Never_Fails_Nest (Y: access Desig; S: out Result_Kind);
- procedure Never_Fails_Same (Y: access Desig; S: out Result_Kind);
-
-end C460002_0;
-
-
- --==================================================================--
-
-
-package body C460002_0 is
-
- procedure Target_Is_Level_0_Nest (Y: access Desig; S: out Result_Kind) is
-
- procedure Nested (X: access Desig; R: out Result_Kind) is
- -- This procedure attempts a type conversion on the access parameter to
- -- an access type declared at some nesting level. Program_Error is
- -- raised if the accessibility level of the operand type is deeper than
- -- that of the target type.
-
- begin
- -- The accessibility level of type Acc_L0 is 0.
- A0 := Acc_L0(X);
- R := OK;
- exception
- when Program_Error =>
- R := P_E;
- when others =>
- R := O_E;
- end Nested;
-
- begin
- Nested (Y, S);
- end Target_Is_Level_0_Nest;
-
- -------------------------------------------------------------
-
- procedure Never_Fails_Nest (Y: access Desig; S: out Result_Kind) is
-
- type Acc_Deeper is access all Desig;
- AD : Acc_Deeper;
-
- function Nested (X: access Desig) return Result_Kind is
- begin
- -- The type conversion below will always be safe, since the
- -- accessibility level (although not necessarily the static nesting
- -- depth) of Acc_Deeper will always be deeper than or the same as that
- -- of the actual corresponding to Y.
- AD := Acc_Deeper(X);
- if Natural(Ident_Int(AD.C(1))) /= 3 then --Avoid Optimization of AD
- Report.Failed ("Initial Values not correct.");
- end if;
- return OK;
- exception
- when Program_Error =>
- return P_E;
- when others =>
- return O_E;
- end Nested;
-
- begin
- S := Nested (Y);
- end Never_Fails_Nest;
-
- -------------------------------------------------------------
-
- procedure Called_By_Never_Fails_Same
- (X: access Desig; R: out Result_Kind) is
- type Acc_Local is access all Desig;
- AL : Acc_Local;
- begin
- -- The type conversion below will always be safe, since the
- -- accessibility level (although not necessarily the static nesting
- -- depth) of Acc_Local will always be deeper than or the same as that
- -- of the actual corresponding to X.
- AL := Acc_Local(X);
- if Natural(Ident_Int(AL.C(1))) /= 3 then --Avoid Optimization of AL
- Report.Failed ("Initial Values not correct.");
- end if;
- R := OK;
- exception
- when Program_Error =>
- R := P_E;
- when others =>
- R := O_E;
- end Called_By_Never_Fails_Same;
-
- -------------------------------------------------------------
-
- procedure Never_Fails_Same (Y: access Desig; S: out Result_Kind) is
- begin
- Called_By_Never_Fails_Same (Y, S);
- end Never_Fails_Same;
-
-end C460002_0;
-
-
- --==================================================================--
-
-
-with C460002_0;
-use C460002_0;
-
-with Report; use Report;
-
-procedure C460002 is
-
- type Acc_L1 is access all Desig; -- Level = 1.
- A1 : Acc_L1;
- X1 : aliased Desig := (C=>(others => Ident_Int(3)));
- Res : Result_Kind;
-
-
-
- procedure Called_By_Target_L1 (X: access Desig; R: out Result_Kind) is
- begin
- -- The accessibility level of type Acc_L1 is 1.
- A1 := Acc_L1(X);
- if Natural(Ident_Int(A1.C(1))) /= 3 then --Avoid Optimization of A1
- Report.Failed ("Initial Values not correct.");
- end if;
- R := OK;
- exception
- when Program_Error =>
- R := P_E;
- when others =>
- R := O_E;
- end Called_By_Target_L1;
-
- -------------------------------------------------------------
-
- function Target_Is_Level_1_Same (Y: access Desig) return Result_Kind is
- S : Result_Kind;
- begin
- Called_By_Target_L1 (Y, S);
- return S;
- end Target_Is_Level_1_Same;
-
- -------------------------------------------------------------
-
- procedure Display_Results (Result : in Result_Kind;
- Expected: in Result_Kind;
- Msg : in String) is
- begin
- if Result /= Expected then
- case Result is
- when OK => Report.Failed ("No exception raised: " & Msg);
- when P_E => Report.Failed ("Program_Error raised: " & Msg);
- when O_E => Report.Failed ("Unexpected exception raised: " & Msg);
- end case;
- end if;
- end Display_Results;
-
-begin -- C460002.
-
- Report.Test ("C460002", "Check that if the target type of a type " &
- "conversion is a general access type, Program_Error is " &
- "raised if the accessibility level of the operand type " &
- "is deeper than that of the target type: operand is an " &
- "access parameter; corresponding actual is another " &
- "access parameter");
-
-
- -- Accessibility level of actual is 0 (actual is X'Access):
-
- Never_Fails_Same (X0'Access, Res);
- Display_Results (Res, OK, "Never_Fails_Same, level 0 actual");
-
- Never_Fails_Nest (X0'Access, Res);
- Display_Results (Res, OK, "Target_L1_Nest, level 0 actual");
-
- Target_Is_Level_0_Nest (X0'Access, Res);
- Display_Results (Res, OK, "Target_L0_Nest, level 0 actual");
-
- Res := Target_Is_Level_1_Same (X0'Access);
- Display_Results (Res, OK, "Target_L1_Same, level 0 actual");
-
-
- -- Accessibility level of actual is 1 (actual is X'Access):
-
- Never_Fails_Same (X1'Access, Res);
- Display_Results (Res, OK, "Never_Fails_Same, level 1 actual");
-
- Never_Fails_Nest (X1'Access, Res);
- Display_Results (Res, OK, "Target_L1_Nest, level 1 actual");
-
- Target_Is_Level_0_Nest (X1'Access, Res);
- Display_Results (Res, P_E, "Target_L0_Nest, level 1 actual");
-
- Res := Target_Is_Level_1_Same (X1'Access);
- Display_Results (Res, OK, "Target_L1_Same, level 1 actual");
-
-
- Block_L2:
- declare
- X2 : aliased Desig := (C=>(others => Ident_Int(3)));
- type Acc_L2 is access all Desig; -- Level = 2.
- Expr_L2 : Acc_L2 := X2'Access;
- begin
-
- -- Accessibility level of actual is 2 (actual is expression of named
- -- access type):
-
- Never_Fails_Same (Expr_L2, Res);
- Display_Results (Res, OK, "Never_Fails_Same, level 2 actual");
-
- Never_Fails_Nest (Expr_L2, Res);
- Display_Results (Res, OK, "Target_L1_Nest, level 2 actual");
-
- Target_Is_Level_0_Nest (Expr_L2, Res);
- Display_Results (Res, P_E, "Target_L0_Nest, level 2 actual");
-
- Res := Target_Is_Level_1_Same (Expr_L2);
- Display_Results (Res, P_E, "Target_L1_Same, level 2 actual");
-
- end Block_L2;
-
-
- Report.Result;
-
-end C460002;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460004.a b/gcc/testsuite/ada/acats/tests/c4/c460004.a
deleted file mode 100644
index b00428121b8..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460004.a
+++ /dev/null
@@ -1,335 +0,0 @@
--- C460004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the operand type of a type conversion is class-wide,
--- Constraint_Error is raised if the tag of the operand does not
--- identify a specific type that is covered by or descended from the
--- target type.
---
--- TEST DESCRIPTION:
--- View conversions of class-wide operands to specific types are
--- placed on the right and left sides of assignment statements, and
--- conversions of class-wide operands to class-wide types are used
--- as actual parameters to dispatching operations. In all cases, a
--- check is made that Constraint_Error is raised if the tag of the
--- operand does not identify a specific type covered by or descended
--- from the target type, and not raised otherwise.
---
--- A specific type is descended from itself and from those types it is
--- directly or indirectly derived from. A specific type is covered by
--- itself and each class-wide type to whose class it belongs.
---
--- A class-wide type T'Class is descended from T and those types which
--- T is descended from. A class-wide type is covered by each class-wide
--- type to whose class it belongs.
---
---
--- CHANGE HISTORY:
--- 19 Jul 95 SAIC Initial prerelease version.
--- 18 Apr 96 SAIC ACVC 2.1: Added a check for correct tag.
---
---!
-package C460004_0 is
-
- type Tag_Type is tagged record
- C1 : Natural;
- end record;
-
- procedure Proc (X : in out Tag_Type);
-
-
- type DTag_Type is new Tag_Type with record
- C2 : String (1 .. 5);
- end record;
-
- procedure Proc (X : in out DTag_Type);
-
-
- type DDTag_Type is new DTag_Type with record
- C3 : String (1 .. 5);
- end record;
-
- procedure Proc (X : in out DDTag_Type);
-
- procedure NewProc (X : in DDTag_Type);
-
- function CWFunc (X : Tag_Type'Class) return Tag_Type'Class;
-
-end C460004_0;
-
-
- --==================================================================--
-
-with Report;
-package body C460004_0 is
-
- procedure Proc (X : in out Tag_Type) is
- begin
- X.C1 := 25;
- end Proc;
-
- -----------------------------------------
- procedure Proc (X : in out DTag_Type) is
- begin
- Proc ( Tag_Type(X) );
- X.C2 := "Earth";
- end Proc;
-
- -----------------------------------------
- procedure Proc (X : in out DDTag_Type) is
- begin
- Proc ( DTag_Type(X) );
- X.C3 := "Orbit";
- end Proc;
-
- -----------------------------------------
- procedure NewProc (X : in DDTag_Type) is
- Y : DDTag_Type := X;
- begin
- Proc (Y);
- exception
- when others =>
- Report.Failed ("Unexpected exception in NewProc");
- end NewProc;
-
- -----------------------------------------
- function CWFunc (X : Tag_Type'Class) return Tag_Type'Class is
- Y : Tag_Type'Class := X;
- begin
- Proc (Y);
- return Y;
- end CWFunc;
-
-end C460004_0;
-
-
- --==================================================================--
-
-
-with C460004_0;
-use C460004_0;
-
-with Report;
-procedure C460004 is
-
- Tag_Type_Init : constant Tag_Type := (C1 => 0);
- DTag_Type_Init : constant DTag_Type := (Tag_Type_Init with "Hello");
- DDTag_Type_Init : constant DDTag_Type := (DTag_Type_Init with "World");
-
- Tag_Type_Value : constant Tag_Type := (C1 => 25);
- DTag_Type_Value : constant DTag_Type := (Tag_Type_Value with "Earth");
- DDTag_Type_Value : constant DDTag_Type := (DTag_Type_Value with "Orbit");
-
-begin
-
- Report.Test ("C460004", "Check that for a view conversion of a " &
- "class-wide operand, Constraint_Error is raised if the " &
- "tag of the operand does not identify a specific type " &
- "covered by or descended from the target type");
-
---
--- View conversion to specific type:
---
-
- declare
- procedure CW_Proc (P : Tag_Type'Class) is
- Target : Tag_Type := Tag_Type_Init;
- begin
- Target := Tag_Type(P);
- if (Target /= Tag_Type_Value) then
- Report.Failed ("Target has wrong value: #01");
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: #01");
- when others =>
- Report.Failed ("Unexpected exception: #01");
- end CW_Proc;
-
- begin
- CW_Proc (DDTag_Type_Value);
- end;
-
- ----------------------------------------------------------------------
-
- declare
- Target : DTag_Type := DTag_Type_Init;
- begin
- Target := DTag_Type(CWFunc(DDTag_Type_Value));
- if (Target /= DTag_Type_Value) then
- Report.Failed ("Target has wrong value: #02");
- end if;
- exception
- when Constraint_Error => Report.Failed ("Constraint_Error raised: #02");
- when others => Report.Failed ("Unexpected exception: #02");
- end;
-
- ----------------------------------------------------------------------
-
- declare
- Target : DDTag_Type;
- begin
- Target := DDTag_Type(CWFunc(Tag_Type_Value));
- -- CWFunc returns a Tag_Type; its tag is preserved through
- -- the view conversion. Constraint_Error should be raised.
-
- Report.Failed ("Constraint_Error not raised: #03");
-
- exception
- when Constraint_Error => null; -- expected exception
- when others => Report.Failed ("Unexpected exception: #03");
- end;
-
- ----------------------------------------------------------------------
-
- declare
- procedure CW_Proc (P : Tag_Type'Class) is
- begin
- NewProc (DDTag_Type(P));
- Report.Failed ("Constraint_Error not raised: #04");
-
- exception
- when Constraint_Error => null; -- expected exception
- when others => Report.Failed ("Unexpected exception: #04");
- end CW_Proc;
-
- begin
- CW_Proc (DTag_Type_Value);
- end;
-
- ----------------------------------------------------------------------
-
- declare
- procedure CW_Proc (P : Tag_Type'Class) is
- Target : DDTag_Type := DDTag_Type_Init;
- begin
- Target := DDTag_Type(P);
- if (Target /= DDTag_Type_Value) then
- Report.Failed ("Target has wrong value: #05");
- end if;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: #05");
- when others
- => Report.Failed ("Unexpected exception: #05");
- end CW_Proc;
-
- begin
- CW_Proc (DDTag_Type_Value);
- end;
-
-
---
--- View conversion to class-wide type:
---
-
- declare
- procedure CW_Proc (P : Tag_Type'Class) is
- Operand : Tag_Type'Class := P;
- begin
- Proc( DTag_Type'Class(Operand) );
- Report.Failed ("Constraint_Error not raised: #06");
-
- exception
- when Constraint_Error => null; -- expected exception
- when others => Report.Failed ("Unexpected exception: #06");
- end CW_Proc;
-
- begin
- CW_Proc (Tag_Type_Init);
- end;
-
- ----------------------------------------------------------------------
-
- declare
- procedure CW_Proc (P : Tag_Type'Class) is
- Operand : Tag_Type'Class := P;
- begin
- Proc( DDTag_Type'Class(Operand) );
- Report.Failed ("Constraint_Error not raised: #07");
-
- exception
- when Constraint_Error => null; -- expected exception
- when others => Report.Failed ("Unexpected exception: #07");
- end CW_Proc;
-
- begin
- CW_Proc (Tag_Type_Init);
- end;
-
- ----------------------------------------------------------------------
-
- declare
- procedure CW_Proc (P : Tag_Type'Class) is
- Operand : Tag_Type'Class := P;
- begin
- Proc( DTag_Type'Class(Operand) );
- if Operand not in DTag_Type then
- Report.Failed ("Operand has wrong tag: #08");
- elsif (Operand /= Tag_Type'Class (DTag_Type_Value)) then
- Report.Failed ("Operand has wrong value: #08");
- end if;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: #08");
- when others =>
- Report.Failed ("Unexpected exception: #08");
- end CW_Proc;
-
- begin
- CW_Proc (DTag_Type_Init);
- end;
-
- ----------------------------------------------------------------------
-
- declare
- procedure CW_Proc (P : Tag_Type'Class) is
- Operand : Tag_Type'Class := P;
- begin
- Proc( Tag_Type'Class(Operand) );
- if Operand not in DDTag_Type then
- Report.Failed ("Operand has wrong tag: #09");
- elsif (Operand /= Tag_Type'Class (DDTag_Type_Value)) then
- Report.Failed ("Operand has wrong value: #09");
- end if;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: #09");
- when others =>
- Report.Failed ("Unexpected exception: #09");
- end CW_Proc;
-
- begin
- CW_Proc (DDTag_Type_Init);
- end;
-
-
- Report.Result;
-
-end C460004;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460005.a b/gcc/testsuite/ada/acats/tests/c4/c460005.a
deleted file mode 100644
index 95b14a9a20a..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460005.a
+++ /dev/null
@@ -1,260 +0,0 @@
--- C460005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for a view conversion of a tagged type that is the left
--- side of an assignment statement, the assignment assigns to the
--- corresponding part of the object denoted by the operand.
---
--- TEST DESCRIPTION:
--- View conversions of class-wide operands to specific types are
--- placed on the right and left sides of assignment statements, and
--- conversions of class-wide operands to class-wide types are used
--- as actual parameters to dispatching operations. In all cases, a
--- check is made that Constraint_Error is raised if the tag of the
--- operand does not identify a specific type covered by or descended
--- from the target type, and not raised otherwise.
---
--- For the cases where the view conversion is the left side of an
--- assignment statement, and Constraint_Error should not be raised,
--- an additional check is made that only the corresponding portion
--- of the operand is updated by the assignment. For example:
---
--- type T is tagged record
--- C1 : Integer := 0;
--- end record;
---
--- type DT is new T with record
--- C2 : Integer := 0;
--- end record;
---
--- A : T := (C1 => 5);
--- B : DT := (C1 => 0, C2 => 10);
--- CWDT : T'Class := B;
---
--- T(CWDT) := A; -- Updates component C1; C2 remains unchanged.
--- -- Value of CWDT is (C1 => 5, C2 => 10).
---
---
--- CHANGE HISTORY:
--- 31 Jul 95 SAIC Initial prerelease version.
--- 22 Apr 96 SAIC ACVC 2.1: Added a check for correct tag.
--- 08 Sep 96 SAIC ACVC 2.1: Modified Report.Test.
---
---!
-
-package C460005_0 is
-
- type Tag_Type is tagged record
- C1 : Natural;
- end record;
-
- procedure Proc (X : in out Tag_Type);
-
-
- type DTag_Type is new Tag_Type with record
- C2 : String (1 .. 5);
- end record;
-
- procedure Proc (X : in out DTag_Type);
-
-
- type DDTag_Type is new DTag_Type with record
- C3 : String (1 .. 5);
- end record;
-
- procedure Proc (X : in out DDTag_Type);
-
-end C460005_0;
-
-
- --==================================================================--
-
-
-package body C460005_0 is
-
- procedure Proc (X : in out Tag_Type) is
- begin
- X.C1 := 25;
- end Proc;
-
- -----------------------------------------
- procedure Proc (X : in out DTag_Type) is
- begin
- Proc ( Tag_Type(X) );
- X.C2 := "Earth";
- end Proc;
-
- -----------------------------------------
- procedure Proc (X : in out DDTag_Type) is
- begin
- Proc ( DTag_Type(X) );
- X.C3 := "Orbit";
- end Proc;
-
-end C460005_0;
-
-
- --==================================================================--
-
-
-with C460005_0;
-use C460005_0;
-
-with Report;
-procedure C460005 is
-
- Tag_Type_Init : constant Tag_Type := (C1 => 0);
- DTag_Type_Init : constant DTag_Type := (Tag_Type_Init with "Hello");
- DDTag_Type_Init : constant DDTag_Type := (DTag_Type_Init with "World");
-
- Tag_Type_Value : constant Tag_Type := (C1 => 25);
- DTag_Type_Value : constant DTag_Type := (Tag_Type_Value with "Earth");
- DDTag_Type_Value : constant DDTag_Type := (DTag_Type_Value with "Orbit");
-
- Tag_Type_Res : constant Tag_Type := (C1 => 25);
- DTag_Type_Res : constant DTag_Type := (Tag_Type_Res with "Hello");
- DDTag_Type_Res : constant DDTag_Type := (DTag_Type_Res with "World");
-
-begin
-
- Report.Test ("C460005", "Check that, for a view conversion of a tagged " &
- "type that is the left side of an assignment statement, " &
- "the assignment assigns to the corresponding part of the " &
- "object denoted by the operand");
-
-
- declare
- procedure CW_Proc (P : Tag_Type'Class) is
- Operand : Tag_Type'Class := P;
- begin
- Tag_Type(Operand) := Tag_Type_Value;
-
- if (Operand /= Tag_Type'Class (Tag_Type_Value)) then
- Report.Failed ("Operand has wrong value: #01");
- end if;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: #01");
- when others =>
- Report.Failed ("Unexpected exception: #01");
- end CW_Proc;
-
- begin
- CW_Proc (Tag_Type_Init);
- end;
-
- ----------------------------------------------------------------------
-
- declare
- procedure CW_Proc (P : Tag_Type'Class) is
- Operand : Tag_Type'Class := P;
- begin
- DTag_Type(Operand) := DTag_Type_Value;
- Report.Failed ("Constraint_Error not raised: #02");
-
- exception
- when Constraint_Error => null; -- expected exception
- when others => Report.Failed ("Unexpected exception: #02");
- end CW_Proc;
-
- begin
- CW_Proc (Tag_Type_Init);
- end;
-
- ----------------------------------------------------------------------
-
- declare
- procedure CW_Proc (P : Tag_Type'Class) is
- Operand : Tag_Type'Class := P;
- begin
- DDTag_Type(Operand) := DDTag_Type_Value;
- Report.Failed ("Constraint_Error not raised: #03");
-
- exception
- when Constraint_Error => null; -- expected exception
- when others => Report.Failed ("Unexpected exception: #03");
- end CW_Proc;
-
- begin
- CW_Proc (Tag_Type_Init);
- end;
-
- ----------------------------------------------------------------------
-
- declare
- procedure CW_Proc (P : Tag_Type'Class) is
- Operand : Tag_Type'Class := P;
- begin
- Tag_Type(Operand) := Tag_Type_Value;
-
- if Operand not in DTag_Type then
- Report.Failed ("Operand has wrong tag: #04");
- elsif (Operand /= Tag_Type'Class (DTag_Type_Res))
- then -- Check to make
- Report.Failed ("Operand has wrong value: #04"); -- sure that C2 was
- end if; -- not modified.
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: #04");
- when others =>
- Report.Failed ("Unexpected exception: #04");
- end CW_Proc;
-
- begin
- CW_Proc (DTag_Type_Init);
- end;
-
- ----------------------------------------------------------------------
-
- declare
- procedure CW_Proc (P : Tag_Type'Class) is
- Operand : Tag_Type'Class := P;
- begin
- Tag_Type(Operand) := Tag_Type_Value;
-
- if Operand not in DDTag_Type then
- Report.Failed ("Operand has wrong tag: #05");
- elsif (Operand /= Tag_Type'Class (DDTag_Type_Res))
- then -- Check to make
- Report.Failed ("Operand has wrong value: #05"); -- sure that C2, C3
- end if; -- were not changed.
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: #05");
- when others =>
- Report.Failed ("Unexpected exception: #05");
- end CW_Proc;
-
- begin
- CW_Proc (DDTag_Type_Init);
- end;
-
- Report.Result;
-
-end C460005;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460006.a b/gcc/testsuite/ada/acats/tests/c4/c460006.a
deleted file mode 100644
index 99968847b9b..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460006.a
+++ /dev/null
@@ -1,378 +0,0 @@
--- C460006.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a view conversion to a tagged type is permitted in the
--- prefix of a selected component, an object renaming declaration, and
--- (if the operand is a variable) on the left side of an assignment
--- statement. Check that such a renaming or assignment does not change
--- the tag of the operand.
---
--- Check that, for a view conversion of a tagged type, each
--- nondiscriminant component of the new view denotes the matching
--- component of the operand object. Check that reading the value of the
--- view yields the result of converting the value of the operand object
--- to the target subtype.
---
--- TEST DESCRIPTION:
--- The fact that the tag of an object is not changed is verified by
--- making calls to primitive operations which in turn make (re)dispatching
--- calls, and confirming that the proper bodies are executed.
---
--- Selected components are checked in three contexts: as the object name
--- in an object renaming declaration, as the left operand of an inequality
--- operation, and as the left side of an assignment statement.
---
--- View conversions of an object of a 2nd level type extension are
--- renamed as objects of an ancestor type and of a class-wide type. In
--- one case the operand of the conversion is itself a renaming of an
--- object.
---
--- View conversions of an object of a 2nd level type extension are
--- checked for equality with record aggregates of various ancestor types.
--- In one case, the view conversion is to a class-wide type, and it is
--- checked for equality with the result of a class-wide function with
--- the following structure:
---
--- function F return T'Class is
--- A : DDT := Expected_Value;
--- X : T'Class := T(A);
--- begin
--- return X;
---
--- end F;
---
--- ...
---
--- Var : DDT := Expected_Value;
---
--- if (T'Class(Var) /= F) then -- Condition should yield FALSE.
--- FAIL;
--- end if;
---
--- The view conversion to which X is initialized does not affect the
--- value or tag of the operand; the tag of X is that of type DDT (not T),
--- and the components are those of A. The result of this function
--- should equal the value of an object of type DDT initialized to the
--- same value as F.A.
---
--- To check that assignment to a view conversion does not change the tag
--- of the operand, an assignment is made to a conversion of an object,
--- and the object is then passed as an actual to a dispatching operation.
--- Conversions to both specific and class-wide types are checked.
---
---
--- CHANGE HISTORY:
--- 20 Jul 95 SAIC Initial prerelease version.
--- 24 Apr 96 SAIC Added type conversions.
---
---!
-
-package C460006_0 is
-
- type Call_ID_Kind is (None, Parent_Outer, Parent_Inner,
- Child_Outer, Child_Inner,
- Grandchild_Outer, Grandchild_Inner);
-
- type Root_Type is abstract tagged record
- First_Call : Call_ID_Kind := None;
- Second_Call : Call_ID_Kind := None;
- end record;
-
- procedure Inner_Proc (X : in out Root_Type) is abstract;
- procedure Outer_Proc (X : in out Root_Type) is abstract;
-
-end C460006_0;
-
-
- --==================================================================--
-
-
-package C460006_0.C460006_1 is
-
- type Parent_Type is new Root_Type with record
- C1 : Integer := 0;
- end record;
-
- procedure Inner_Proc (X : in out Parent_Type);
- procedure Outer_Proc (X : in out Parent_Type);
-
-end C460006_0.C460006_1;
-
-
- --==================================================================--
-
-
-package body C460006_0.C460006_1 is
-
- procedure Inner_Proc (X : in out Parent_Type) is
- begin
- X.Second_Call := Parent_Inner;
- end Inner_Proc;
-
- -------------------------------------------------
- procedure Outer_Proc (X : in out Parent_Type) is
- begin
- X.First_Call := Parent_Outer;
- Inner_Proc ( Parent_Type'Class(X) );
- end Outer_Proc;
-
-end C460006_0.C460006_1;
-
-
- --==================================================================--
-
-
-package C460006_0.C460006_1.C460006_2 is
-
- type Child_Type is new Parent_Type with record
- C2 : String(1 .. 5) := "-----";
- end record;
-
- procedure Inner_Proc (X : in out Child_Type);
- procedure Outer_Proc (X : in out Child_Type);
-
-end C460006_0.C460006_1.C460006_2;
-
-
- --==================================================================--
-
-
-package body C460006_0.C460006_1.C460006_2 is
-
- procedure Inner_Proc (X : in out Child_Type) is
- begin
- X.Second_Call := Child_Inner;
- end Inner_Proc;
-
- -------------------------------------------------
- procedure Outer_Proc (X : in out Child_Type) is
- begin
- X.First_Call := Child_Outer;
- Inner_Proc ( Parent_Type'Class(X) );
- end Outer_Proc;
-
-end C460006_0.C460006_1.C460006_2;
-
-
- --==================================================================--
-
-
-package C460006_0.C460006_1.C460006_2.C460006_3 is
-
- type Grandchild_Type is new Child_Type with record
- C3: String(1 .. 5) := "-----";
- end record;
-
- procedure Inner_Proc (X : in out Grandchild_Type);
- procedure Outer_Proc (X : in out Grandchild_Type);
-
-
- function ClassWide_Func return Parent_Type'Class;
-
-
- Grandchild_Value : constant Grandchild_Type := (First_Call => None,
- Second_Call => None,
- C1 => 15,
- C2 => "Hello",
- C3 => "World");
-
-end C460006_0.C460006_1.C460006_2.C460006_3;
-
-
- --==================================================================--
-
-
-package body C460006_0.C460006_1.C460006_2.C460006_3 is
-
- procedure Inner_Proc (X : in out Grandchild_Type) is
- begin
- X.Second_Call := Grandchild_Inner;
- end Inner_Proc;
-
- -------------------------------------------------
- procedure Outer_Proc (X : in out Grandchild_Type) is
- begin
- X.First_Call := Grandchild_Outer;
- Inner_Proc ( Parent_Type'Class(X) );
- end Outer_Proc;
-
- -------------------------------------------------
- function ClassWide_Func return Parent_Type'Class is
- A : Grandchild_Type := Grandchild_Value;
- X : Parent_Type'Class := Parent_Type(A); -- Value of X is still that of A.
- begin
- return X;
- end ClassWide_Func;
-
-end C460006_0.C460006_1.C460006_2.C460006_3;
-
-
- --==================================================================--
-
-
-with C460006_0.C460006_1.C460006_2.C460006_3;
-
-with Report;
-procedure C460006 is
-
- package Root_Package renames C460006_0;
- package Parent_Package renames C460006_0.C460006_1;
- package Child_Package renames C460006_0.C460006_1.C460006_2;
- package Grandchild_Package renames C460006_0.C460006_1.C460006_2.C460006_3;
-
-begin
- Report.Test ("C460006", "Check that a view conversion to a tagged type " &
- "is permitted in the prefix of a selected component, an " &
- "object renaming declaration, and (if the operand is a " &
- "variable) on the left side of an assignment statement. " &
- "Check that such a renaming or assignment does not change " &
- " the tag of the operand");
-
-
- --
- -- Check conversion as prefix of selected component:
- --
-
- Selected_Component_Subtest:
- declare
- use Root_Package, Parent_Package, Child_Package, Grandchild_Package;
-
- Var : Grandchild_Type := Grandchild_Value;
- CW_Var : Parent_Type'Class := Var;
-
- Ren : Integer renames Parent_Type(Var).C1;
-
- begin
- if Ren /= 15 then
- Report.Failed ("Wrong value: selected component in renaming");
- end if;
-
- if Child_Type(Var).C2 /= "Hello" then
- Report.Failed ("Wrong value: selected component in IF");
- end if;
-
- Grandchild_Type(CW_Var).C3(2..4) := "eir";
- if CW_Var /= Parent_Type'Class
- (Grandchild_Type'(None, None, 15, "Hello", "Weird"))
- then
- Report.Failed ("Wrong value: selected component in assignment");
- end if;
- end Selected_Component_Subtest;
-
-
- --
- -- Check conversion in object renaming:
- --
-
- Object_Renaming_Subtest:
- declare
- use Root_Package, Parent_Package, Child_Package, Grandchild_Package;
-
- Var : Grandchild_Type := Grandchild_Value;
- Ren1 : Parent_Type renames Parent_Type(Var);
- Ren2 : Child_Type renames Child_Type(Var);
- Ren3 : Parent_Type'Class renames Parent_Type'Class(Var);
- Ren4 : Parent_Type renames Parent_Type(Ren2); -- Rename of rename.
- begin
- Outer_Proc (Ren1);
- if Ren1 /= (Parent_Outer, Grandchild_Inner, 15) then
- Report.Failed ("Value or tag not preserved by object renaming: Ren1");
- end if;
-
- Outer_Proc (Ren2);
- if Ren2 /= (Child_Outer, Grandchild_Inner, 15, "Hello") then
- Report.Failed ("Value or tag not preserved by object renaming: Ren2");
- end if;
-
- Outer_Proc (Ren3);
- if Ren3 /= Parent_Type'Class
- (Grandchild_Type'(Grandchild_Outer,
- Grandchild_Inner,
- 15,
- "Hello",
- "World"))
- then
- Report.Failed ("Value or tag not preserved by object renaming: Ren3");
- end if;
-
- Outer_Proc (Ren4);
- if Ren4 /= (Parent_Outer, Grandchild_Inner, 15) then
- Report.Failed ("Value or tag not preserved by object renaming: Ren4");
- end if;
- end Object_Renaming_Subtest;
-
-
- --
- -- Check reading view conversion, and conversion as left side of assignment:
- --
-
- View_Conversion_Subtest:
- declare
- use Root_Package, Parent_Package, Child_Package, Grandchild_Package;
-
- Var : Grandchild_Type := Grandchild_Value;
- Specific : Child_Type;
- ClassWide : Parent_Type'Class := Var; -- Grandchild_Type tag.
- begin
- if Parent_Type(Var) /= (None, None, 15) then
- Report.Failed ("View has wrong value: #1");
- end if;
-
- if Child_Type(Var) /= (None, None, 15, "Hello") then
- Report.Failed ("View has wrong value: #2");
- end if;
-
- if Parent_Type'Class(Var) /= ClassWide_Func then
- Report.Failed ("Upward view conversion did not preserve " &
- "extension's components");
- end if;
-
-
- Parent_Type(Specific) := (None, None, 26); -- Assign to view.
- Outer_Proc (Specific); -- Call dispatching op.
-
- if Specific /= (Child_Outer, Child_Inner, 26, "-----") then
- Report.Failed ("Value or tag not preserved by assignment: Specific");
- end if;
-
-
- Parent_Type(ClassWide) := (None, None, 44); -- Assign to view.
- Outer_Proc (ClassWide); -- Call dispatching op.
-
- if ClassWide /= Parent_Type'Class
- (Grandchild_Type'(Grandchild_Outer,
- Grandchild_Inner,
- 44,
- "Hello",
- "World"))
- then
- Report.Failed ("Value or tag not preserved by assignment: ClassWide");
- end if;
- end View_Conversion_Subtest;
-
- Report.Result;
-
-end C460006;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460007.a b/gcc/testsuite/ada/acats/tests/c4/c460007.a
deleted file mode 100644
index fdcc1adcc3d..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460007.a
+++ /dev/null
@@ -1,239 +0,0 @@
--- C460007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, in a numeric type conversion, if the target type is an
--- integer type and the operand type is real, the result is rounded
--- to the nearest integer, and away from zero if the result is exactly
--- halfway between two integers. Check for static and non-static type
--- conversions.
---
--- TEST DESCRIPTION:
--- The following cases are considered:
---
--- X.5 X.5 + delta -X.5 + delta
--- -X.5 X.5 - delta -X.5 - delta
---
--- Both zero and non-zero values are used for X. The value of delta is
--- chosen to be a very small increment (on the order of 1.0E-10). For
--- fixed and floating point cases, the value of delta is chosen such that
--- "(-)X.5 +(-) delta" is a multiple of the small, or a machine number,
--- respectively.
---
--- The following type conversions are performed:
---
--- ID Real operand Cases Target integer subtype
--- ------------------------------------------------------------------
--- 1 Real named number X.5 Nonstatic
--- 2 X.5 - delta Nonstatic
--- 3 -X.5 - delta Static
--- 4 Real literal -X.5 Static
--- 5 X.5 + delta Static
--- 6 -X.5 + delta Nonstatic
--- 7 Floating point object -X.5 - delta Nonstatic
--- 8 X.5 - delta Static
--- 9 Fixed point object X.5 Static
--- 10 X.5 + delta Static
--- 11 -X.5 + delta Nonstatic
--- The conversion is either assigned to a variable of the target subtype
--- or passed as a parameter to a subprogram (both nonstatic contexts).
---
--- The subprogram Equal is used to circumvent potential optimizations.
---
---
--- CHANGE HISTORY:
--- 03 Oct 95 SAIC Initial prerelease version.
---
---!
-
-with System;
-package C460007_0 is
-
---
--- Target integer subtype (static):
---
-
- type Static_Integer_Subtype is range -32_000 .. 32_000;
-
- Static_Target : Static_Integer_Subtype;
-
- function Equal (L, R: Static_Integer_Subtype) return Boolean;
-
-
---
--- Named numbers:
---
-
- NN_Half : constant := 0.5000000000;
- NN_Less_Half : constant := 126.4999999999;
- NN_More_Half : constant := -NN_Half - 0.0000000001;
-
-
---
--- Floating point:
---
-
- type My_Float is digits System.Max_Digits;
-
- Flt_Rnd_Toward_Zero : My_Float := My_Float'Pred(NN_Half);
- Flt_Rnd_Away_Zero : constant My_Float := My_Float'Pred(-113.5);
-
-
---
--- Fixed point:
---
-
- type My_Fixed is delta 0.1 range -5.0 .. 5.0;
-
- Fix_Half : My_Fixed := 0.5;
- Fix_Rnd_Away_Zero : My_Fixed := Fix_Half + My_Fixed'Small;
- Fix_Rnd_Toward_Zero : constant My_Fixed := -3.5 + My_Fixed'Small;
-
-end C460007_0;
-
-
- --==================================================================--
-
-
-package body C460007_0 is
-
- function Equal (L, R: Static_Integer_Subtype) return Boolean is
- begin
- return (L = R);
- end Equal;
-
-end C460007_0;
-
-
- --==================================================================--
-
-
-with C460007_0;
-use C460007_0;
-
-with Report;
-procedure C460007 is
-
---
--- Target integer subtype (nonstatic):
---
-
- Limit : Static_Integer_Subtype :=
- Static_Integer_Subtype(Report.Ident_Int(128));
-
- subtype Nonstatic_Integer_Subtype is Static_Integer_Subtype
- range -Limit .. Limit;
-
- Nonstatic_Target : Static_Integer_Subtype;
-
-begin
-
- Report.Test ("C460007", "Rounding for type conversions of real operand " &
- "to integer target");
-
-
- -- --------------------------
- -- Named number/literal cases:
- -- --------------------------
-
- Nonstatic_Target := Nonstatic_Integer_Subtype(NN_Half);
-
- if not Equal(Nonstatic_Target, 1) then -- Case 1.
- Report.Failed ("Wrong result for named number operand" &
- "(case 1), nonstatic target subtype");
- end if;
-
- if not Equal(Nonstatic_Integer_Subtype(NN_Less_Half), 126) then -- Case 2.
- Report.Failed ("Wrong result for named number operand" &
- "(case 2), nonstatic target subtype");
- end if;
-
- Static_Target := Static_Integer_Subtype(NN_More_Half);
-
- if not Equal(Static_Target, -1) then -- Case 3.
- Report.Failed ("Wrong result for named number operand" &
- "(case 3), static target subtype");
- end if;
-
- if not Equal(Static_Integer_Subtype(-0.50), -1) then -- Case 4.
- Report.Failed ("Wrong result for literal operand" &
- "(case 4), static target subtype");
- end if;
-
- if not Equal(Static_Integer_Subtype(29_546.5001), 29_547) then -- Case 5.
- Report.Failed ("Wrong result for literal operand" &
- "(case 5), static target subtype");
- end if;
-
- if not Equal(Nonstatic_Integer_Subtype(-66.499), -66) then -- Case 6.
- Report.Failed ("Wrong result for literal operand" &
- "(case 6), nonstatic target subtype");
- end if;
-
-
- -- --------------------
- -- Floating point cases:
- -- --------------------
-
- Nonstatic_Target := Nonstatic_Integer_Subtype(Flt_Rnd_Away_Zero);
-
- if not Equal(Nonstatic_Target, -114) then -- Case 7.
- Report.Failed ("Wrong result for floating point operand" &
- "(case 7), nonstatic target subtype");
- end if;
- -- Case 8.
- if not Equal(Static_Integer_Subtype(Flt_Rnd_Toward_Zero), 0) then
- Report.Failed ("Wrong result for floating point operand" &
- "(case 8), static target subtype");
- end if;
-
-
- -- -----------------
- -- Fixed point cases:
- -- -----------------
-
- Static_Target := Static_Integer_Subtype(Fix_Half);
-
- if not Equal(Static_Target, 1) then -- Case 9.
- Report.Failed ("Wrong result for fixed point operand" &
- "(case 9), static target subtype");
- end if;
-
- if not Equal(Static_Integer_Subtype(Fix_Rnd_Away_Zero), 1) then -- Case 10.
- Report.Failed ("Wrong result for fixed point operand" &
- "(case 10), static target subtype");
- end if;
-
- Nonstatic_Target := Nonstatic_Integer_Subtype(Fix_Rnd_Toward_Zero);
-
- if not Equal(Nonstatic_Target, -3) then -- Case 11.
- Report.Failed ("Wrong result for fixed point operand" &
- "(case 11), nonstatic target subtype");
- end if;
-
-
- Report.Result;
-
-end C460007;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460008.a b/gcc/testsuite/ada/acats/tests/c4/c460008.a
deleted file mode 100644
index 29d48ecd4c4..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460008.a
+++ /dev/null
@@ -1,286 +0,0 @@
--- C460008.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that conversion to a modular type raises Constraint_Error
--- when the operand value is outside the base range of the modular type.
---
--- TEST DESCRIPTION:
--- Test conversion from integer, float, fixed and decimal types to
--- modular types. Test conversion to mod 255, mod 256 and mod 258
--- to test the boundaries of 8 bit (+/-) unsigned numbers.
--- Test operand values that are negative, the value of the mod,
--- and greater than the value of the mod.
--- Declare a generic test procedure and instantiate it for each of the
--- unsigned types for each operand type.
---
---
--- CHANGE HISTORY:
--- 04 OCT 95 SAIC Initial version
--- 15 MAY 96 SAIC Revised for 2.1
--- 24 NOV 98 RLB Moved decimal cases into new test, C460011, to
--- prevent this test from being inapplicable to
--- implementations not supporting decimal types.
---
---!
-
-------------------------------------------------------------------- C460008
-
-with Report;
-
-procedure C460008 is
-
- Shy_By_One : constant := 2**8-1;
- Heavy_By_Two : constant := 2**8+2;
-
- type Unsigned_Edge_8 is mod Shy_By_One;
- type Unsigned_8_Bit is mod 2**8;
- type Unsigned_Over_8 is mod Heavy_By_Two;
-
- NPC : constant String := " not properly converted";
-
- procedure Assert( Truth: Boolean; Message: String ) is
- begin
- if not Truth then
- Report.Failed(Message);
- end if;
- end Assert;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- generic
- type Source is range <>;
- type Target is mod <>;
- procedure Integer_Conversion_Check( For_The_Value : Source;
- Message : String );
-
- procedure Integer_Conversion_Check( For_The_Value : Source;
- Message : String ) is
-
- Item : Target;
-
- begin
- Item := Target( For_The_Value );
- Report.Failed("Int expected Constraint_Error " & Message);
- -- the call to Comment is to make the otherwise dead assignment to
- -- Item live.
- -- To avoid invoking C_E on a call to 'Image in Report.Failed that
- -- could cause a false pass
- Report.Comment("Value of" & Target'Image(Item) & NPC);
- exception
- when Constraint_Error => null; -- expected case
- when others => Report.Failed("Int Raised wrong exception " & Message);
- end Integer_Conversion_Check;
-
- procedure Int_To_Short is
- new Integer_Conversion_Check( Integer, Unsigned_Edge_8 );
-
- procedure Int_To_Eight is
- new Integer_Conversion_Check( Integer, Unsigned_8_Bit );
-
- procedure Int_To_Wide is
- new Integer_Conversion_Check( Integer, Unsigned_Over_8 );
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- generic
- type Source is digits <>;
- type Target is mod <>;
- procedure Float_Conversion_Check( For_The_Value : Source;
- Message : String );
-
- procedure Float_Conversion_Check( For_The_Value : Source;
- Message : String ) is
-
- Item : Target;
-
- begin
- Item := Target( For_The_Value );
- Report.Failed("Flt expected Constraint_Error " & Message);
- Report.Comment("Value of" & Target'Image(Item) & NPC);
- exception
- when Constraint_Error => null; -- expected case
- when others => Report.Failed("Flt raised wrong exception " & Message);
- end Float_Conversion_Check;
-
- procedure Float_To_Short is
- new Float_Conversion_Check( Float, Unsigned_Edge_8 );
-
- procedure Float_To_Eight is
- new Float_Conversion_Check( Float, Unsigned_8_Bit );
-
- procedure Float_To_Wide is
- new Float_Conversion_Check( Float, Unsigned_Over_8 );
-
- function Identity( Root_Beer: Float ) return Float is
- -- a knockoff of Report.Ident_Int for type Float
- Nothing : constant Float := 0.0;
- begin
- if Report.Ident_Bool( Root_Beer = Nothing ) then
- return Nothing;
- else
- return Root_Beer;
- end if;
- end Identity;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- generic
- type Source is delta <>;
- type Target is mod <>;
- procedure Fixed_Conversion_Check( For_The_Value : Source;
- Message : String );
-
- procedure Fixed_Conversion_Check( For_The_Value : Source;
- Message : String ) is
-
- Item : Target;
-
- begin
- Item := Target( For_The_Value );
- Report.Failed("Fix expected Constraint_Error " & Message);
- Report.Comment("Value of" & Target'Image(Item) & NPC);
- exception
- when Constraint_Error => null; -- expected case
- when others => Report.Failed("Fix raised wrong exception " & Message);
- end Fixed_Conversion_Check;
-
- procedure Fixed_To_Short is
- new Fixed_Conversion_Check( Duration, Unsigned_Edge_8 );
-
- procedure Fixed_To_Eight is
- new Fixed_Conversion_Check( Duration, Unsigned_8_Bit );
-
- procedure Fixed_To_Wide is
- new Fixed_Conversion_Check( Duration, Unsigned_Over_8 );
-
- function Identity( A_Stitch: Duration ) return Duration is
- Threadbare : constant Duration := 0.0;
- begin
- if Report.Ident_Bool( A_Stitch = Threadbare ) then
- return Threadbare;
- else
- return A_Stitch;
- end if;
- end Identity;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-begin -- Main test procedure.
-
- Report.Test ("C460008", "Check that conversion to " &
- "a modular type raises Constraint_Error when " &
- "the operand value is outside the base range " &
- "of the modular type" );
-
-
- -- Integer Error cases
-
- Int_To_Short( Report.Ident_Int( -1 ), "I2S Dynamic, Negative" );
- Int_To_Short( Report.Ident_Int( Shy_By_One ), "I2S Dynamic, At_Mod" );
- Int_To_Short( Report.Ident_Int( Heavy_By_Two+1 ), "I2S Dynamic, Over_Mod" );
-
- Int_To_Eight( -Shy_By_One, "I28 Static, Negative" );
- Int_To_Eight( 2**8, "I28 Static, At_Mod" );
- Int_To_Eight( Heavy_By_Two+1, "I28 Static, Over_Mod" );
-
- Int_To_Wide ( Report.Ident_Int( -(Heavy_By_Two*2) ),
- "I2W Dynamic, Negative" );
- Int_To_Wide ( Heavy_By_Two, "I2W Static, At_Mod" );
- Int_To_Wide ( Report.Ident_Int( Heavy_By_Two*2 ), "I2W Dynamic, Over_Mod" );
-
- -- Float Error cases
-
- Float_To_Short( -13.31, "F2S Static, Negative" );
- Float_To_Short( Identity ( Float(Shy_By_One)), "F2S Dynamic, At_Mod" );
- Float_To_Short( 6378.388, "F2S Static, Over_Mod" );
-
- Float_To_Eight( Identity( -99.3574 ), "F28 Dynamic, Negative" );
- Float_To_Eight( 2.0**8, "F28 Static, At_Mod" );
- Float_To_Eight( 2.0**9, "F28 Static, Over_Mod" );
-
- Float_To_Wide ( -0.54953_93129_81644, "FTW Static, Negative" );
- Float_To_Wide ( Identity( 2.0**8 +2.0 ), "FTW Dynamic, At_Mod" );
- Float_To_Wide ( Identity( 2.0**8 +2.5001 ), "FTW Dynamic, Over_Mod" );
- Float_To_Wide ( Identity( Float'Last ), "FTW Dynamic, Over_Mod" );
-
- -- Fixed Error cases
-
- Fixed_To_Short( Identity( -5.00 ), "D2S Dynamic, Negative" );
- Fixed_To_Short( Shy_By_One * 1.0, "D2S Static, At_Mod" );
- Fixed_To_Short( 1995.9, "D2S Static, Over_Mod" );
-
- Fixed_To_Eight( -0.5, "D28 Static, Negative" );
- Fixed_To_Eight( 2.0*128, "D28 Static, At_Mod" );
- Fixed_To_Eight( Identity( 2001.2 ), "D28 Dynamic, Over_Mod" );
-
- Fixed_To_Wide ( Duration'First, "D2W Static, Negative" );
- Fixed_To_Wide ( Identity( 2*128.0 +2.0 ), "D2W Dynamic, At_Mod" );
- Fixed_To_Wide ( Duration'Last, "D2W Static, Over_Mod" );
-
- -- having made it this far, the rest is downhill...
- -- check a few, correct, edge cases, and we're done
-
- Eye_Dew: declare
- A_Float : Float := 0.0;
- Your_Time : Duration := 0.0;
- Number : Integer := 0;
-
- Little : Unsigned_Edge_8;
- Moderate : Unsigned_8_Bit;
- Big : Unsigned_Over_8;
-
- begin
- Little := Unsigned_Edge_8(A_Float);
- Assert( Little = 0, "Float => Little, 0");
-
-
- Moderate := Unsigned_8_Bit (Your_Time);
- Assert( Moderate = 0, "Your_Time => Moderate, 0");
-
- Big := Unsigned_Over_8 (Number);
- Assert( Big = 0, "Number => Big, 0");
-
- A_Float := 2.0**8-2.0;
- Your_Time := 2.0*128-2.0;
- Number := 2**8;
-
- Little := Unsigned_Edge_8(A_Float);
- Assert( Little = 254, "Float => Little, 254");
-
- Little := Unsigned_Edge_8(Your_Time);
- Assert( Little = 254, "Your_Time => Little, 254");
-
- Big := Unsigned_Over_8 (A_Float + 2.0);
- Assert( Big = 256, "Sense => Big, 256");
-
- Big := Unsigned_Over_8 (Number);
- Assert( Big = 256, "Number => Big, 256");
-
- end Eye_Dew;
-
- Report.Result;
-
-end C460008;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460009.a b/gcc/testsuite/ada/acats/tests/c4/c460009.a
deleted file mode 100644
index 62dbd47c2c7..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460009.a
+++ /dev/null
@@ -1,467 +0,0 @@
--- C460009.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Constraint_Error is raised in cases of null arrays when:
--- 1. an assignment is made to a null array if the length of each
--- dimension of the operand does not match the length of
--- the corresponding dimension of the target subtype.
--- 2. an array actual parameter does not match the length of
--- corresponding dimensions of the formal in out parameter where
--- the actual parameter has the form of a type conversion.
--- 3. an array actual parameter does not match the length of
--- corresponding dimensions of the formal out parameter where
--- the actual parameter has the form of a type conversion.
---
--- TEST DESCRIPTION:
--- This transition test creates examples where array of null ranges
--- raises Constraint_Error if any of the lengths mismatch.
---
--- Inspired by C52103S.ADA, C64105E.ADA, and C64105F.ADA.
---
---
--- CHANGE HISTORY:
--- 21 Mar 96 SAIC Initial version for ACVC 2.1.
--- 21 Sep 96 SAIC ACVC 2.1: Added new case.
---
---!
-
-with Report;
-
-procedure C460009 is
-
- subtype Int is Integer range 1 .. 3;
-
-begin
-
- Report.Test("C460009","Check that Constraint_Error is raised in " &
- "cases of null arrays if any of the lengths mismatch " &
- "in assignments and parameter passing");
-
- ---------------------------------------------------------------------------
- declare
-
- type Arr_Int1 is array (Int range <>) of Integer;
- Arr_Obj1 : Arr_Int1 (2 .. Report.Ident_Int(1)); -- null array object
-
- begin
-
- -- Same lengths, no Constraint_Error raised.
- Arr_Obj1 := (Report.Ident_Int(3) .. 2 => Report.Ident_Int(1));
-
- Report.Comment ("Dead assignment prevention in Arr_Obj1 => " &
- Integer'Image (Arr_Obj1'Last));
-
- exception
-
- when Constraint_Error =>
- Report.Failed ("Arr_Obj1 - Constraint_Error exception raised");
- when others =>
- Report.Failed ("Arr_Obj1 - others exception raised");
-
- end;
-
- ---------------------------------------------------------------------------
- declare
-
- type Arr_Int2 is array (Int range <>, Int range <>) of Integer;
- Arr_Obj2 : Arr_Int2 (1 .. Report.Ident_Int(2),
- Report.Ident_Int(3) .. Report.Ident_Int(2));
- -- null array object
- begin
-
- -- Same lengths, no Constraint_Error raised.
- Arr_Obj2 := Arr_Int2'(Report.Ident_Int(2) .. 3 =>
- (Report.Ident_Int(2) .. Report.Ident_Int(1) =>
- Report.Ident_Int(1)));
-
- Report.Comment ("Dead assignment prevention in Arr_Obj2 => " &
- Integer'Image (Arr_Obj2'Last));
-
- exception
-
- when Constraint_Error =>
- Report.Failed ("Arr_Obj2 - Constraint_Error exception raised");
- when others =>
- Report.Failed ("Arr_Obj2 - others exception raised");
-
- end;
-
- ---------------------------------------------------------------------------
- declare
-
- type Arr_Int3 is array (Int range <>, Int range <>) of Integer;
- Arr_Obj3 : Arr_Int3 (1 .. Report.Ident_Int(2),
- Report.Ident_Int(3) .. Report.Ident_Int(2));
- -- null array object
-
- begin
-
- -- Lengths mismatch, Constraint_Error raised.
- Arr_Obj3 := Arr_Int3'(Report.Ident_Int(3) .. 2 =>
- (Report.Ident_Int(1) .. Report.Ident_Int(3) =>
- Report.Ident_Int(1)));
-
- Report.Comment ("Dead assignment prevention in Arr_Obj3 => " &
- Integer'Image (Arr_Obj3'Last));
-
- Report.Failed ("Constraint_Error not raised in Arr_Obj3");
-
- exception
-
- when Constraint_Error => null; -- exception expected.
- when others =>
- Report.Failed ("Arr_Obj3 - others exception raised");
-
- end;
-
- ---------------------------------------------------------------------------
- declare
-
- type Arr_Int4 is array (Int range <>, Int range <>, Int range <>) of
- Integer;
- Arr_Obj4 : Arr_Int4 (1 .. Report.Ident_Int(2),
- Report.Ident_Int(1) .. Report.Ident_Int(3),
- Report.Ident_Int(3) .. Report.Ident_Int(2));
- -- null array object
- begin
-
- -- Lengths mismatch, Constraint_Error raised.
- Arr_Obj4 := Arr_Int4'(Report.Ident_Int(1) .. 3 =>
- (Report.Ident_Int(1) .. Report.Ident_Int(2) =>
- (Report.Ident_Int(3) .. Report.Ident_Int(2) =>
- Report.Ident_Int(1))));
-
- Report.Comment ("Dead assignment prevention in Arr_Obj4 => " &
- Integer'Image (Arr_Obj4'Last));
-
- Report.Failed ("Constraint_Error not raised in Arr_Obj4");
-
- exception
-
- when Constraint_Error => null; -- exception expected.
- when others =>
- Report.Failed ("Arr_Obj4 - others exception raised");
-
- end;
-
- ---------------------------------------------------------------------------
- declare
-
- type Arr_Int5 is array (Int range <>) of Integer;
- Arr_Obj5 : Arr_Int5 (2 .. Report.Ident_Int(1)); -- null array object
-
- begin
-
- -- Only lengths of two null ranges are different, no Constraint_Error
- -- raised.
- Arr_Obj5 := (Report.Ident_Int(3) .. 1 => Report.Ident_Int(1));
-
- Report.Comment ("Dead assignment prevention in Arr_Obj5 => " &
- Integer'Image (Arr_Obj5'Last));
-
- exception
-
- when Constraint_Error =>
- Report.Failed ("Arr_Obj5 - Constraint_Error exception raised");
- when others =>
- Report.Failed ("Arr_Obj5 - others exception raised");
-
- end;
-
- ---------------------------------------------------------------------------
- declare
- subtype Str is String (Report.Ident_Int(5) .. 4);
- -- null string
- Str_Obj : Str;
-
- begin
-
- -- Same lengths, no Constraint_Error raised.
- Str_Obj := (Report.Ident_Int(1) .. 0 => 'Z');
- Str_Obj(2 .. 1) := "";
- Str_Obj(4 .. 2) := (others => 'X');
- Str_Obj(Report.Ident_Int(6) .. 3) := "";
- Str_Obj(Report.Ident_Int(0) .. Report.Ident_Int(-1)) := (others => 'Y');
-
- exception
-
- when Constraint_Error =>
- Report.Failed ("Str_Obj - Constraint_Error exception raised");
- when others =>
- Report.Failed ("Str_Obj - others exception raised");
-
- end;
-
- ---------------------------------------------------------------------------
- declare
-
- type Arr_Char5 is array (Int range <>, Int range <>) of Character;
- subtype Formal is Arr_Char5
- (Report.Ident_Int(2) .. 0, 1 .. Report.Ident_Int(3));
- Arr_Obj5 : Arr_Char5 (Report.Ident_Int(2) .. Report.Ident_Int(1),
- Report.Ident_Int(1) .. Report.Ident_Int(2))
- := (Report.Ident_Int(2) .. Report.Ident_Int(1) =>
- (Report.Ident_Int(1) .. Report.Ident_Int(2) => ' '));
-
- procedure Proc5 (P : in out Formal) is
- begin
- Report.Failed ("No exception raised in Proc5");
-
- exception
-
- when Constraint_Error =>
- Report.Failed ("Constraint_Error exception raised in Proc5");
- when others =>
- Report.Failed ("Others exception raised in Proc5");
- end;
-
- begin
-
- -- Lengths mismatch in the type conversion, Constraint_Error raised.
- Proc5 (Formal(Arr_Obj5));
-
- Report.Failed ("Constraint_Error not raised in the call Proc5");
-
- exception
-
- when Constraint_Error => null; -- exception expected.
- when others =>
- Report.Failed ("Arr_Obj5 - others exception raised");
-
- end;
-
- ---------------------------------------------------------------------------
- declare
-
- type Formal is array
- (Report.Ident_Int(1) .. 3, 3 .. Report.Ident_Int(1)) of Character;
-
- type Actual is array
- (Report.Ident_Int(5) .. 3, 3 .. Report.Ident_Int(5)) of Character;
-
- Arr_Obj6 : Actual := (5 .. 3 => (3 .. 5 => ' '));
-
- procedure Proc6 (P : in out Formal) is
- begin
- Report.Failed ("No exception raised in Proc6");
-
- exception
-
- when Constraint_Error =>
- Report.Failed ("Constraint_Error exception raised in Proc6");
- when others =>
- Report.Failed ("Others exception raised in Proc6");
- end;
-
- begin
-
- -- Lengths mismatch in the type conversion, Constraint_Error raised.
- Proc6 (Formal(Arr_Obj6));
-
- Report.Failed ("Constraint_Error not raised in the call Proc6");
-
- exception
-
- when Constraint_Error => null; -- exception expected.
- when others =>
- Report.Failed ("Arr_Obj6 - others exception raised");
-
- end;
-
- ---------------------------------------------------------------------------
- declare
-
- type Formal is array (Int range <>, Int range <>) of Character;
- type Actual is array (Positive range 5 .. 2,
- Positive range 1 .. 3) of Character;
-
- Arr_Obj7 : Actual := (5 .. 2 => (1 .. 3 => ' '));
-
- procedure Proc7 (P : in out Formal) is
- begin
- if P'Last /= 2 and P'Last(2) /= 3 then
- Report.Failed ("Wrong bounds passed for Arr_Obj7");
- end if;
-
- -- Lengths mismatch, Constraint_Error raised.
- P := (1 .. 3 => (3 .. 0 => ' '));
-
- Report.Comment ("Dead assignment prevention in Proc7 => " &
- Integer'Image (P'Last));
-
- Report.Failed ("No exception raised in Proc7");
-
- exception
-
- when Constraint_Error => null; -- exception expected.
- when others =>
- Report.Failed ("Others exception raised in Proc7");
- end;
-
- begin
-
- -- Same lengths, no Constraint_Error raised.
- Proc7 (Formal(Arr_Obj7));
-
- if Arr_Obj7'Last /= 2 and Arr_Obj7'Last(2) /= 3 then
- Report.Failed ("Bounds changed for Arr_Obj7");
- end if;
-
- exception
-
- when Constraint_Error =>
- Report.Failed ("Constraint_Error exception raised after call Proc7");
- when others =>
- Report.Failed ("Arr_Obj7 - others exception raised");
-
- end;
-
- ---------------------------------------------------------------------------
- declare
-
- type Arr_Char8 is array (Int range <>, Int range <>) of Character;
- subtype Formal is Arr_Char8
- (Report.Ident_Int(2) .. 0, 1 .. Report.Ident_Int(3));
- Arr_Obj8 : Arr_Char8 (Report.Ident_Int(2) .. Report.Ident_Int(1),
- Report.Ident_Int(1) .. Report.Ident_Int(2));
-
- procedure Proc8 (P : out Formal) is
- begin
- Report.Failed ("No exception raised in Proc8");
-
- exception
-
- when Constraint_Error =>
- Report.Failed ("Constraint_Error exception raised in Proc8");
- when others =>
- Report.Failed ("Others exception raised in Proc8");
- end;
-
- begin
-
- -- Lengths mismatch in the type conversion, Constraint_Error raised.
- Proc8 (Formal(Arr_Obj8));
-
- Report.Failed ("Constraint_Error not raised in the call Proc8");
-
- exception
-
- when Constraint_Error => null; -- exception expected.
- when others =>
- Report.Failed ("Arr_Obj8 - others exception raised");
-
- end;
-
- ---------------------------------------------------------------------------
- declare
-
- type Formal is array
- (Report.Ident_Int(1) .. 3, 3 .. Report.Ident_Int(1)) of Character;
-
- type Actual is array
- (Report.Ident_Int(5) .. 3, 3 .. Report.Ident_Int(5)) of Character;
-
- Arr_Obj9 : Actual;
-
- procedure Proc9 (P : out Formal) is
- begin
- Report.Failed ("No exception raised in Proc9");
-
- exception
-
- when Constraint_Error =>
- Report.Failed ("Constraint_Error exception raised in Proc9");
- when others =>
- Report.Failed ("Others exception raised in Proc9");
- end;
-
- begin
-
- -- Lengths mismatch in the type conversion, Constraint_Error raised.
- Proc9 (Formal(Arr_Obj9));
-
- Report.Failed ("Constraint_Error not raised in the call Proc9");
-
- exception
-
- when Constraint_Error => null; -- exception expected.
- when others =>
- Report.Failed ("Arr_Obj9 - others exception raised");
-
- end;
-
- ---------------------------------------------------------------------------
- declare
-
- type Formal is array (Int range <>, Int range <>) of Character;
- type Actual is array (Positive range 5 .. 2,
- Positive range 1 .. 3) of Character;
-
- Arr_Obj10 : Actual;
-
- procedure Proc10 (P : out Formal) is
- begin
- if P'Last /= 2 and P'Last(2) /= 3 then
- Report.Failed ("Wrong bounds passed for Arr_Obj10");
- end if;
-
- -- Lengths mismatch, Constraint_Error raised.
- P := (1 .. 3 => (3 .. 1 => ' '));
-
- Report.Comment ("Dead assignment prevention in Proc10 => " &
- Integer'Image (P'Last));
-
- Report.Failed ("No exception raised in Proc10");
-
- exception
-
- when Constraint_Error => null; -- exception expected.
- when others =>
- Report.Failed ("Others exception raised in Proc10");
- end;
-
- begin
-
- -- Same lengths, no Constraint_Error raised.
- Proc10 (Formal(Arr_Obj10));
-
- if Arr_Obj10'Last /= 2 and Arr_Obj10'Last(2) /= 3 then
- Report.Failed ("Bounds changed for Arr_Obj10");
- end if;
-
- exception
-
- when Constraint_Error =>
- Report.Failed ("Constraint_Error exception raised after call Proc10");
- when others =>
- Report.Failed ("Arr_Obj10 - others exception raised");
-
- end;
-
- ---------------------------------------------------------------------------
- Report.Result;
-
-end C460009;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460010.a b/gcc/testsuite/ada/acats/tests/c4/c460010.a
deleted file mode 100644
index 790a8c3396c..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460010.a
+++ /dev/null
@@ -1,354 +0,0 @@
--- C460010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for an array aggregate without an others choice assigned
--- to an object of a constrained array subtype, Constraint_Error is not
--- raised if the length of each dimension of the aggregate equals the
--- length of the corresponding dimension of the target object, even if
--- the bounds of the corresponding index ranges do not match.
---
--- TEST DESCRIPTION:
--- The test verifies that sliding of array bounds is performed on array
--- aggregates that are part of a larger aggregate, where the bounds of
--- the corresponding index ranges do not match but the lengths of the
--- corresponding dimensions are the same. Both aggregates containing
--- named associations and positional associations are checked. Cases
--- involving static and nonstatic index constraints, as well as pre-
--- defined and modular integer index subtypes, are included.
---
---
--- CHANGE HISTORY:
--- 15 Apr 96 SAIC Prerelease version for ACVC 2.1.
--- 20 Oct 96 SAIC Removed unnecessary parentheses and type
--- conversions.
---
---!
-
-with Report;
-pragma Elaborate (Report);
-
-package C460010_0 is
-
- type Modular_Type is mod 10; -- Range 0 .. 9.
-
-
- Two : Modular_Type := Modular_Type (Report.Ident_Int(2));
- Four : Modular_Type := Modular_Type (Report.Ident_Int(4));
-
- type Array_Modular_Index is array (Modular_Type range <>) of Integer;
-
- subtype Array_Static_Modular_Constraint is Array_Modular_Index(2..4);
- subtype Array_Nonstatic_Modular_Constraint is Array_Modular_Index(Two..Four);
-
-end C460010_0;
-
-
- --==================================================================--
-
-
-with Report;
-pragma Elaborate (Report);
-
-package C460010_1 is
-
- One : Integer := Report.Ident_Int(1);
- Ten : Integer := Report.Ident_Int(10);
-
- subtype Integer_Subtype is Integer range One .. Ten;
-
-
- Two : Integer := Report.Ident_Int(2);
- Four : Integer := Report.Ident_Int(4);
-
- type Array_Integer_Index is array (Integer_Subtype range <>) of Boolean;
-
- subtype Array_Static_Integer_Constraint is Array_Integer_Index(2..4);
- subtype Array_Nonstatic_Integer_Constraint is Array_Integer_Index(Two..Four);
-
-end C460010_1;
-
-
- --==================================================================--
-
-
--- Generic equality function:
-
-generic
- type Operand_Type is private;
-function C460010_2 (L, R : Operand_Type) return Boolean;
-
-
-function C460010_2 (L, R : Operand_Type) return Boolean is
-begin
- return L = R;
-end C460010_2;
-
-
- --==================================================================--
-
-
-with C460010_0;
-with C460010_1;
-with C460010_2;
-
-with Report;
-
-procedure C460010 is
-
- generic function Generic_Equality renames C460010_2;
-
-begin
- Report.Test ("C460010", "Check that Constraint_Error is not raised if " &
- "an array aggregate without an others choice is assigned " &
- "to an object of a constrained array subtype, and the " &
- "length of each dimension of the aggregate equals the " &
- "length of the corresponding dimension of the target object");
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- declare
- type Arr is array (1..1) of C460010_0.Array_Static_Modular_Constraint;
- function Equals is new Generic_Equality (Arr);
- Target : Arr;
- begin
- ---=---=---=---=---=---=---
- CASE_1:
- begin
- Target := (1 => (1 => 1, 2 => 2, 3 => 3)); -- Named associations.
-
- if not Equals (Target, Target) then
- Report.Failed ("Avoid optimization"); -- Never executed.
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: Case 1");
- when others =>
- Report.Failed ("Unexpected exception raised: Case 1");
- end CASE_1;
-
- ---=---=---=---=---=---=---
-
- CASE_2:
- begin
- Target := (1 => (5, 10, 15)); -- Positional associations.
-
- if not Equals (Target, Target) then
- Report.Failed ("Avoid optimization"); -- Never executed.
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: Case 2");
- when others =>
- Report.Failed ("Unexpected exception raised: Case 2");
- end CASE_2;
-
- ---=---=---=---=---=---=---
- end;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- declare
- type Rec (Disc : C460010_0.Modular_Type := 4) is record
- Arr : C460010_0.Array_Modular_Index(2 .. Disc);
- end record;
-
- function Equals is new Generic_Equality (Rec);
- Target : Rec;
- begin
- ---=---=---=---=---=---=---
- CASE_3:
- begin
- Target := (Disc => 4, Arr => (1 => 1, 2 => 2, 3 => 3)); -- Named.
-
- if not Equals (Target, Target) then
- Report.Failed ("Avoid optimization"); -- Never executed.
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: Case 3");
- when others =>
- Report.Failed ("Unexpected exception raised: Case 3");
- end CASE_3;
-
- ---=---=---=---=---=---=---
-
- CASE_4:
- begin
- Target := (Disc => 4, Arr => (1 ,2, 3)); -- Positional.
-
- if not Equals (Target, Target) then
- Report.Failed ("Avoid optimization"); -- Never executed.
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: Case 4");
- when others =>
- Report.Failed ("Unexpected exception raised: Case 4");
- end CASE_4;
-
- ---=---=---=---=---=---=---
- end;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- declare
- type Arr is array (1..1) of C460010_0.Array_Nonstatic_Modular_Constraint;
- function Equals is new Generic_Equality (Arr);
- Target : Arr;
- begin
- ---=---=---=---=---=---=---
- CASE_5:
- begin
- Target := (1 => (1 => 1, 2 => 2, 3 => 3)); -- Named associations.
-
- if not Equals (Target, Target) then
- Report.Failed ("Avoid optimization"); -- Never executed.
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: Case 5");
- when others =>
- Report.Failed ("Unexpected exception raised: Case 5");
- end CASE_5;
-
- ---=---=---=---=---=---=---
-
- CASE_6:
- begin
- Target := (1 => ((5, 10, 15))); -- Positional associations.
-
- if not Equals (Target, Target) then
- Report.Failed ("Avoid optimization"); -- Never executed.
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: Case 6");
- when others =>
- Report.Failed ("Unexpected exception raised: Case 6");
- end CASE_6;
-
- ---=---=---=---=---=---=---
- end;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- declare
- type Arr is array (1..1) of C460010_1.Array_Static_Integer_Constraint;
- function Equals is new Generic_Equality (Arr);
- Target : Arr;
- begin
- ---=---=---=---=---=---=---
- CASE_7:
- begin
- Target := (1 => (1 => True, 2 => True, 3 => False)); -- Named.
-
- if not Equals (Target, Target) then
- Report.Failed ("Avoid optimization"); -- Never executed.
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: Case 7");
- when others =>
- Report.Failed ("Unexpected exception raised: Case 7");
- end CASE_7;
-
- ---=---=---=---=---=---=---
-
- CASE_8:
- begin
- Target := (1 => ((False, False, True))); -- Positional.
-
- if not Equals (Target, Target) then
- Report.Failed ("Avoid optimization"); -- Never executed.
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: Case 8");
- when others =>
- Report.Failed ("Unexpected exception raised: Case 8");
- end CASE_8;
-
- ---=---=---=---=---=---=---
- end;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- declare
- type Arr is array (1..1) of C460010_1.Array_Nonstatic_Integer_Constraint;
- function Equals is new Generic_Equality (Arr);
- Target : Arr;
- begin
- ---=---=---=---=---=---=---
- CASE_9:
- begin
- Target := (1 => (1 => True, 2 => True, 3 => False)); -- Named.
-
- if not Equals (Target, Target) then
- Report.Failed ("Avoid optimization"); -- Never executed.
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: Case 9");
- when others =>
- Report.Failed ("Unexpected exception raised: Case 9");
- end CASE_9;
-
- ---=---=---=---=---=---=---
-
- CASE_10:
- begin
- Target := (1 => (False, False, True)); -- Positional.
-
- if not Equals (Target, Target) then
- Report.Failed ("Avoid optimization"); -- Never executed.
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised: Case 10");
- when others =>
- Report.Failed ("Unexpected exception raised: Case 10");
- end CASE_10;
-
- ---=---=---=---=---=---=---
- end;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- Report.Result;
-
-end C460010;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460011.a b/gcc/testsuite/ada/acats/tests/c4/c460011.a
deleted file mode 100644
index 56e4c0c4ec2..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460011.a
+++ /dev/null
@@ -1,210 +0,0 @@
--- C460011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
--- F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
--- software and documentation contained herein. Unlimited rights are
--- defined in DFAR 252.227-7013(a)(19). By making this public release,
--- the Government intends to confer upon all recipients unlimited rights
--- equal to those held by the Government. These rights include rights to
--- use, duplicate, release or disclose the released technical data and
--- computer software in whole or in part, in any manner and for any purpose
--- whatsoever, and to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that conversion of a decimal type to a modular type raises
--- Constraint_Error when the operand value is outside the base range
--- of the modular type.
--- Check that a conversion of a decimal type to an integer type
--- rounds correctly.
---
--- TEST DESCRIPTION:
--- Test conversion from decimal types to modular types. Test
--- conversion to mod 255, mod 256 and mod 258 to test the boundaries
--- of 8 bit (+/-) unsigned numbers.
--- Test operand values that are negative, the value of the mod,
--- and greater than the value of the mod.
--- Declare a generic test procedure and instantiate it for each of the
--- unsigned types for each operand type.
--- Check that the the operand is properly rounded during the conversion.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations which support
--- decimal types.
---
--- CHANGE HISTORY:
--- 24 NOV 98 RLB Split decimal cases from C460008 into this
--- test, added conversions to integer types.
--- 18 JAN 99 RLB Repaired errors in test.
---
---!
-
-------------------------------------------------------------------- C460011
-
-with Report;
-
-procedure C460011 is
-
- Shy_By_One : constant := 2**8-1;
- Heavy_By_Two : constant := 2**8+2;
-
- type Unsigned_Edge_8 is mod Shy_By_One;
- type Unsigned_8_Bit is mod 2**8;
- type Unsigned_Over_8 is mod Heavy_By_Two;
-
- type Signed_8_Bit is range -128 .. 127;
- type Signed_Over_8 is range -200 .. 200;
-
- NPC : constant String := " not properly converted";
-
- procedure Assert( Truth: Boolean; Message: String ) is
- begin
- if not Truth then
- Report.Failed(Message);
- end if;
- end Assert;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- type Decim is delta 0.1 digits 5; -- N/A => ERROR.
-
- generic
- type Source is delta <> digits <>;
- type Target is mod <>;
- procedure Decimal_Conversion_Check( For_The_Value : Source;
- Message : String );
-
- procedure Decimal_Conversion_Check( For_The_Value : Source;
- Message : String ) is
-
- Item : Target;
-
- begin
- Item := Target( For_The_Value );
- Report.Failed("Deci expected Constraint_Error " & Message);
- Report.Comment("Value of" & Target'Image(Item) & NPC);
- exception
- when Constraint_Error => null; -- expected case
- when others => Report.Failed("Deci raised wrong exception " & Message);
- end Decimal_Conversion_Check;
-
- procedure Decim_To_Short is
- new Decimal_Conversion_Check( Decim, Unsigned_Edge_8 );
-
- procedure Decim_To_Eight is
- new Decimal_Conversion_Check( Decim, Unsigned_8_Bit );
-
- procedure Decim_To_Wide is
- new Decimal_Conversion_Check( Decim, Unsigned_Over_8 );
-
- function Identity( Launder: Decim ) return Decim is
- Flat_Broke : constant Decim := 0.0;
- begin
- if Report.Ident_Bool( Launder = Flat_Broke ) then
- return Flat_Broke;
- else
- return Launder;
- end if;
- end Identity;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-begin -- Main test procedure.
-
- Report.Test ("C460011", "Check that conversion to " &
- "a modular type raises Constraint_Error when " &
- "the operand value is outside the base range " &
- "of the modular type" );
-
- -- Decimal Error cases
-
- Decim_To_Short( Identity( -5.00 ), "M2S Dynamic, Negative" );
- Decim_To_Short( Shy_By_One * 1.0, "M2S Static, At_Mod" );
- Decim_To_Short( 1995.9, "M2S Static, Over_Mod" );
-
- Decim_To_Eight( -0.5, "M28 Static, Negative" );
- Decim_To_Eight( 2.0*128, "M28 Static, At_Mod" );
- Decim_To_Eight( Identity( 2001.2 ), "M28 Dynamic, Over_Mod" );
-
- Decim_To_Wide ( Decim'First, "M2W Static, Negative" );
- Decim_To_Wide ( Identity( 2*128.0 +2.0 ), "M2W Dynamic, At_Mod" );
- Decim_To_Wide ( Decim'Last, "M2W Static, Over_Mod" );
-
- -- Check a few, correct, edge cases, for modular types.
-
- Eye_Dew: declare
- Sense : Decim := 0.00;
-
- Little : Unsigned_Edge_8;
- Moderate : Unsigned_8_Bit;
- Big : Unsigned_Over_8;
-
- begin
- Moderate := Unsigned_8_Bit (Sense);
- Assert( Moderate = 0, "Sense => Moderate, 0");
-
- Sense := 2*128.0;
-
- Big := Unsigned_Over_8 (Sense);
- Assert( Big = 256, "Sense => Big, 256");
-
- end Eye_Dew;
-
- Rounding: declare
- Easy : Decim := Identity ( 2.0);
- Simple : Decim := Identity ( 2.1);
- Halfway : Decim := Identity ( 2.5);
- Upward : Decim := Identity ( 2.8);
- Chop : Decim := Identity (-2.2);
- Neg_Half : Decim := Identity (-2.5);
- Downward : Decim := Identity (-2.7);
-
- Little : Unsigned_Edge_8;
- Moderate : Unsigned_8_Bit;
- Big : Unsigned_Over_8;
-
- Also_Little:Signed_8_Bit;
- Also_Big : Signed_Over_8;
-
- begin
- Little := Unsigned_Edge_8 (Easy);
- Assert( Little = 2, "Easy => Little, 2");
-
- Moderate := Unsigned_8_Bit (Simple);
- Assert( Moderate = 2, "Simple => Moderate, 2");
-
- Big := Unsigned_Over_8 (Halfway); -- Rounds up by 4.6(33).
- Assert( Big = 3, "Halfway => Big, 3");
-
- Little := Unsigned_Edge_8 (Upward);
- Assert( Little = 3, "Upward => Little, 3");
-
- Also_Big := Signed_Over_8 (Halfway); -- Rounds up by 4.6(33).
- Assert( Also_Big = 3, "Halfway => Also_Big, 3");
-
- Also_Little := Signed_8_Bit (Chop);
- Assert( Also_Little = -2, "Chop => Also_Little, -2");
-
- Also_Big := Signed_Over_8 (Neg_Half); -- Rounds down by 4.6(33).
- Assert( Also_Big = -3, "Halfway => Also_Big, -3");
-
- Also_Little := Signed_8_Bit (Downward);
- Assert( Also_Little = -3, "Downward => Also_Little, -3");
-
- end Rounding;
-
-
- Report.Result;
-
-end C460011;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460012.a b/gcc/testsuite/ada/acats/tests/c4/c460012.a
deleted file mode 100644
index 0fb32060a4c..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460012.a
+++ /dev/null
@@ -1,93 +0,0 @@
--- C460012.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the view created by a view conversion is constrained if the
--- target subtype is indefinite. (Defect Report 8652/0017, Technical
--- Corrigendum 4.6(54/1)).
---
--- CHANGE HISTORY:
--- 25 JAN 2001 PHL Initial version.
--- 29 JUN 2001 RLB Reformatted for ACATS. Added optimization blocking.
--- 02 JUL 2001 RLB Fixed discriminant reference.
---
---!
-with Ada.Exceptions;
-use Ada.Exceptions;
-with Report;
-use Report;
-procedure C460012 is
-
- subtype Index is Positive range 1 .. 10;
-
- type Definite_Parent (D1 : Index := 6) is
- record
- F : String (1 .. D1) := (others => 'a');
- end record;
-
- type Indefinite_Child (D2 : Index) is new Definite_Parent (D1 => D2);
-
- Y : Definite_Parent;
-
- procedure P (X : in out Indefinite_Child) is
- C : Character renames X.F (3);
- begin
- X := (1, "a");
- if C /= 'a' then
- Failed ("No exception raised when changing the " &
- "discriminant of a view conversion, value of C changed");
- elsif X.D2 /= 1 then
- Failed ("No exception raised when changing the " &
- "discriminant of a view conversion, discriminant not " &
- "changed");
- -- This check primarily exists to prevent X from being optimized by
- -- 11.6 permissions, or the Failed call being made before the assignment.
- else
- Failed ("No exception raised when changing the " &
- "discriminant of a view conversion, discriminant changed");
- end if;
- exception
- when Constraint_Error =>
- null;
- when E: others =>
- Failed ("Wrong exception " & Exception_Name (E) & " raised - " &
- Exception_Message (E));
- end P;
-
-begin
- Test ("C460012",
- "Check that the view created by a view conversion " &
- "is constrained if the target subtype is indefinite");
-
- P (Indefinite_Child (Y));
-
- if Y.D1 /= Ident_Int(6) then
- Failed ("Discriminant of indefinite view changed");
- -- This check exists mainly to prevent Y from being optimized away.
- end if;
-
- Result;
-end C460012;
-
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460a01.a b/gcc/testsuite/ada/acats/tests/c4/c460a01.a
deleted file mode 100644
index 2d583706eb9..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460a01.a
+++ /dev/null
@@ -1,408 +0,0 @@
--- C460A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the target type of a type conversion is a general
--- access type, Program_Error is raised if the accessibility level of
--- the operand type is deeper than that of the target type. Check for
--- cases where the type conversion occurs in an instance body, and
--- the operand type is passed as an actual during instantiation.
---
--- TEST DESCRIPTION:
--- In order to satisfy accessibility requirements, the operand type must
--- be at the same or a less deep nesting level than the target type -- the
--- operand type must "live" as long as the target type. Nesting levels
--- are the run-time nestings of masters: block statements; subprogram,
--- task, and entry bodies; and accept statements. Packages are invisible
--- to accessibility rules.
---
--- This test checks for cases where the operand is a subprogram formal
--- parameter.
---
--- The test declares three generic packages, each containing an access
--- type conversion in which the operand type is a formal type:
---
--- (1) One in which the target type is declared within the
--- specification, and the conversion occurs within a nested
--- function.
---
--- (2) One in which the target type is also a formal type, and
--- the conversion occurs within a nested function.
---
--- (3) One in which the target type is declared outside the
--- generic, and the conversion occurs within a nested
--- procedure.
---
--- The test verifies the following:
---
--- For (1), Program_Error is not raised when the nested function is
--- called. Since the actual corresponding to the formal operand type
--- must always have the same or a less deep level than the target
--- type declared within the instance, the access type conversion is
--- always safe.
---
--- For (2), Program_Error is raised when the nested function is
--- called if the operand type passed as an actual during instantiation
--- has an accessibility level deeper than that of the target type
--- passed as an actual, and that no exception is raised otherwise.
--- The exception is propagated to the innermost enclosing master.
---
--- For (3), Program_Error is raised when the nested procedure is
--- called if the operand type passed as an actual during instantiation
--- has an accessibility level deeper than that of the target type.
--- The exception is handled within the nested procedure.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F460A00.A
--- => C460A01.A
---
---
--- CHANGE HISTORY:
--- 09 May 95 SAIC Initial prerelease version.
--- 24 Apr 96 SAIC Added code to avoid dead variable optimization.
--- 13 Feb 97 PWB.CTA Removed 'Class from qual expression at line 342.
---!
-
-generic
- type Designated_Type is tagged private;
- type Operand_Type is access Designated_Type;
-package C460A01_0 is
- type Target_Type is access all Designated_Type;
- function Convert (P : Operand_Type) return Target_Type;
-end C460A01_0;
-
-
- --==================================================================--
-
-
-package body C460A01_0 is
- function Convert (P : Operand_Type) return Target_Type is
- begin
- return Target_Type(P); -- Never fails.
- end Convert;
-end C460A01_0;
-
-
- --==================================================================--
-
-
-generic
- type Designated_Type is tagged private;
- type Operand_Type is access all Designated_Type;
- type Target_Type is access all Designated_Type;
-package C460A01_1 is
- function Convert (P : Operand_Type) return Target_Type;
-end C460A01_1;
-
-
- --==================================================================--
-
-
-package body C460A01_1 is
- function Convert (P : Operand_Type) return Target_Type is
- begin
- return Target_Type(P);
- end Convert;
-end C460A01_1;
-
-
- --==================================================================--
-
-
-with F460A00;
-generic
- type Designated_Type (<>) is new F460A00.Tagged_Type with private;
- type Operand_Type is access Designated_Type;
-package C460A01_2 is
- procedure Proc (P : Operand_Type;
- Res : out F460A00.TC_Result_Kind);
-end C460A01_2;
-
-
- --==================================================================--
-
-with Report;
-package body C460A01_2 is
- procedure Proc (P : Operand_Type;
- Res : out F460A00.TC_Result_Kind) is
- Ptr : F460A00.AccTag_L0;
- begin
- Ptr := F460A00.AccTag_L0(P);
-
- -- Avoid optimization (dead variable removal of Ptr):
- if not Report.Equal (Ptr.C, Ptr.C) then -- Always false.
- Report.Failed ("Unexpected error in C460A01_2 instance");
- end if;
-
- Res := F460A00.OK;
- exception
- when Program_Error => Res := F460A00.PE_Exception;
- when others => Res := F460A00.Others_Exception;
- end Proc;
-end C460A01_2;
-
-
- --==================================================================--
-
-
-with F460A00;
-with C460A01_0;
-with C460A01_1;
-with C460A01_2;
-
-with Report;
-procedure C460A01 is
-begin -- C460A01. -- [ Level = 1 ]
-
- Report.Test ("C460A01", "Run-time accessibility checks: instance " &
- "bodies. Operand type of access type conversion is " &
- "passed as actual to instance");
-
-
- SUBTEST1:
- declare -- [ Level = 2 ]
- type AccTag_L2 is access all F460A00.Tagged_Type;
- Operand: AccTag_L2 := new F460A00.Tagged_Type;
-
- Result : F460A00.TC_Result_Kind := F460A00.UN_Init;
- begin -- SUBTEST1.
-
- declare -- [ Level = 3 ]
- -- The instantiation of C460A01_0 should NOT result in any
- -- exceptions.
-
- package Pack_OK is new C460A01_0 (F460A00.Tagged_Type, AccTag_L2);
- Target : Pack_OK.Target_Type;
- begin
- -- The accessibility level of Pack_OK.Target_Type will always be at
- -- least as deep as the operand type passed as an actual. Thus,
- -- a call to Pack_OK.Convert does not propagate an exception:
-
- Target := Pack_OK.Convert(Operand);
-
- -- Avoid optimization (dead variable removal of Target):
- if not Report.Equal (Target.C, Target.C) then -- Always false.
- Report.Failed ("Unexpected error in SUBTEST #1");
- end if;
-
- Result := F460A00.OK; -- Expected result.
- exception
- when Program_Error => Result := F460A00.PE_Exception;
- when others => Result := F460A00.Others_Exception;
- end;
-
- F460A00.TC_Check_Results (Result, F460A00.OK, "SUBTEST #1");
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #1: Program_Error incorrectly raised");
- when others =>
- Report.Failed ("SUBTEST #1: Unexpected exception raised");
- end SUBTEST1;
-
-
-
- SUBTEST2:
- declare -- [ Level = 2 ]
- type AccTag_L2 is access all F460A00.Tagged_Type;
- Operand : AccTag_L2 := new F460A00.Tagged_Type;
-
- Result : F460A00.TC_Result_Kind := F460A00.UN_Init;
- begin -- SUBTEST2.
-
- declare -- [ Level = 3 ]
-
- type AccTag_L3 is access all F460A00.Tagged_Type;
- Target : AccTag_L3;
-
- -- The instantiation of C460A01_1 should NOT result in any
- -- exceptions.
-
- package Pack_OK is new C460A01_1
- (Designated_Type => F460A00.Tagged_Type,
- Operand_Type => AccTag_L2,
- Target_Type => AccTag_L3);
- begin
- -- The accessibility level of the actual passed as the operand type
- -- in Pack_OK is 2. The accessibility level of the actual passed as
- -- the target type is 3. Therefore, the access type conversion in
- -- Pack_OK.Convert does not raise an exception when the subprogram is
- -- called. If an exception is (incorrectly) raised, it is propagated
- -- to the innermost enclosing master:
-
- Target := Pack_OK.Convert(Operand);
-
- -- Avoid optimization (dead variable removal of Target):
- if not Report.Equal (Target.C, Target.C) then -- Always false.
- Report.Failed ("Unexpected error in SUBTEST #2");
- end if;
-
- Result := F460A00.OK; -- Expected result.
- exception
- when Program_Error => Result := F460A00.PE_Exception;
- when others => Result := F460A00.Others_Exception;
- end;
-
- F460A00.TC_Check_Results (Result, F460A00.OK, "SUBTEST #2");
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #2: Program_Error incorrectly raised");
- when others =>
- Report.Failed ("SUBTEST #2: Unexpected exception raised");
- end SUBTEST2;
-
-
-
- SUBTEST3:
- declare -- [ Level = 2 ]
- type AccTag_L2 is access all F460A00.Tagged_Type;
- Target : AccTag_L2;
-
- Result : F460A00.TC_Result_Kind := F460A00.UN_Init;
- begin -- SUBTEST3.
-
- declare -- [ Level = 3 ]
-
- type AccTag_L3 is access all F460A00.Tagged_Type;
- Operand : AccTag_L3 := new F460A00.Tagged_Type;
-
- -- The instantiation of C460A01_1 should NOT result in any
- -- exceptions.
-
- package Pack_PE is new C460A01_1
- (Designated_Type => F460A00.Tagged_Type,
- Operand_Type => AccTag_L3,
- Target_Type => AccTag_L2);
- begin
- -- The accessibility level of the actual passed as the operand type
- -- in Pack_PE is 3. The accessibility level of the actual passed as
- -- the target type is 2. Therefore, the access type conversion in
- -- Pack_PE.Convert raises Program_Error when the subprogram is
- -- called. The exception is propagated to the innermost enclosing
- -- master:
-
- Target := Pack_PE.Convert(Operand);
-
- -- Avoid optimization (dead variable removal of Target):
- if not Report.Equal (Target.C, Target.C) then -- Always false.
- Report.Failed ("Unexpected error in SUBTEST #3");
- end if;
-
- Result := F460A00.OK;
- exception
- when Program_Error => Result := F460A00.PE_Exception;
- -- Expected result.
- when others => Result := F460A00.Others_Exception;
- end;
-
- F460A00.TC_Check_Results (Result, F460A00.PE_Exception, "SUBTEST #3");
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #3: Program_Error incorrectly raised");
- when others =>
- Report.Failed ("SUBTEST #3: Unexpected exception raised");
- end SUBTEST3;
-
-
-
- SUBTEST4:
- declare -- [ Level = 2 ]
- Result : F460A00.TC_Result_Kind := F460A00.UN_Init;
- begin -- SUBTEST4.
-
- declare -- [ Level = 3 ]
-
- TType : F460A00.Tagged_Type;
- Operand : F460A00.AccTagClass_L0
- := new F460A00.Tagged_Type'(TType);
-
- -- The instantiation of C460A01_2 should NOT result in any
- -- exceptions.
-
- package Pack_OK is new C460A01_2 (F460A00.Tagged_Type'Class,
- F460A00.AccTagClass_L0);
- begin
- -- The accessibility level of the actual passed as the operand type
- -- in Pack_OK is 0. The accessibility level of the target type
- -- (F460A00.AccTag_L0) is also 0. Therefore, the access type
- -- conversion in Pack_OK.Proc does not raise an exception when the
- -- subprogram is called. If an exception is (incorrectly) raised,
- -- it is handled within the subprogram:
-
- Pack_OK.Proc(Operand, Result);
- end;
-
- F460A00.TC_Check_Results (Result, F460A00.OK, "SUBTEST #4");
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #4: Program_Error incorrectly raised");
- when others =>
- Report.Failed ("SUBTEST #4: Unexpected exception raised");
- end SUBTEST4;
-
-
-
- SUBTEST5:
- declare -- [ Level = 2 ]
- Result : F460A00.TC_Result_Kind := F460A00.UN_Init;
- begin -- SUBTEST5.
-
- declare -- [ Level = 3 ]
-
- type AccDerTag_L3 is access all F460A00.Derived_Tagged_Type;
- Operand : AccDerTag_L3 := new F460A00.Derived_Tagged_Type;
-
- -- The instantiation of C460A01_2 should NOT result in any
- -- exceptions.
-
- package Pack_PE is new C460A01_2 (F460A00.Derived_Tagged_Type,
- AccDerTag_L3);
- begin
- -- The accessibility level of the actual passed as the operand type
- -- in Pack_PE is 3. The accessibility level of the target type
- -- (F460A00.AccTag_L0) is 0. Therefore, the access type conversion
- -- in Pack_PE.Proc raises Program_Error when the subprogram is
- -- called. The exception is handled within the subprogram:
-
- Pack_PE.Proc(Operand, Result);
- end;
-
- F460A00.TC_Check_Results (Result, F460A00.PE_Exception, "SUBTEST #5");
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #5: Program_Error incorrectly raised");
- when others =>
- Report.Failed ("SUBTEST #5: Unexpected exception raised");
- end SUBTEST5;
-
- Report.Result;
-
-end C460A01;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c460a02.a b/gcc/testsuite/ada/acats/tests/c4/c460a02.a
deleted file mode 100644
index 1d79d3a614e..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c460a02.a
+++ /dev/null
@@ -1,413 +0,0 @@
--- C460A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the target type of a type conversion is a general
--- access type, Program_Error is raised if the accessibility level of
--- the operand type is deeper than that of the target type. Check for
--- cases where the type conversion occurs in an instance body, and
--- the operand type is declared inside the instance or is the anonymous
--- access type of an access parameter or access discriminant.
---
--- TEST DESCRIPTION:
--- In order to satisfy accessibility requirements, the operand type must
--- be at the same or a less deep nesting level than the target type -- the
--- operand type must "live" as long as the target type. Nesting levels
--- are the run-time nestings of masters: block statements; subprogram,
--- task, and entry bodies; and accept statements. Packages are invisible
--- to accessibility rules.
---
--- This test checks for cases where the operand is a component of a
--- generic formal object, a stand-alone object, and an access parameter.
---
--- The test declares three generic units, each containing an access
--- type conversion in which the target type is a formal type:
---
--- (1) A generic package in which the operand type is the anonymous
--- access type of an access discriminant, and the conversion
--- occurs within the declarative part of the body.
---
--- (2) A generic package in which the operand type is declared within
--- the specification, and the conversion occurs within the
--- sequence of statements of the body.
---
--- (3) A generic procedure in which the operand type is the anonymous
--- access type of an access parameter, and the conversion occurs
--- within the sequence of statements.
---
--- The test verifies the following:
---
--- For (1), Program_Error is raised when the package is instantiated
--- if the actual passed through the formal object has an accessibility
--- level deeper than that of the target type passed as an actual, and
--- that no exception is raised otherwise. The exception is propagated
--- to the innermost enclosing master.
---
--- For (2), Program_Error is raised when the package is instantiated
--- if the package is instantiated at a level deeper than that of the
--- target type passed as an actual, and that no exception is raised
--- otherwise. The exception is handled within the package body.
---
--- For (3), Program_Error is raised when the instance procedure is
--- called if the actual passed through the access parameter has an
--- accessibility level deeper than that of the target type passed as
--- an actual, and that no exception is raised otherwise. The exception
--- is handled within the instance procedure.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F460A00.A
--- => C460A02.A
---
---
--- CHANGE HISTORY:
--- 10 May 95 SAIC Initial prerelease version.
--- 24 Apr 96 SAIC Changed the target type formal to be
--- access-to-constant; Modified code to avoid dead
--- variable optimization.
---
---!
-
-with F460A00;
-generic
- type Target_Type is access all F460A00.Tagged_Type;
- FObj: in out F460A00.Composite_Type;
-package C460A02_0 is
- procedure Dummy; -- Needed to allow package body.
-end C460A02_0;
-
-
- --==================================================================--
-
-with Report;
-package body C460A02_0 is
- Ptr: Target_Type := Target_Type(FObj.D);
-
- procedure Dummy is
- begin
- null;
- end Dummy;
-
-begin
- -- Avoid optimization (dead variable removal of Ptr):
- if not Report.Equal (Ptr.C, Ptr.C) then -- Always false.
- Report.Failed ("Unexpected error in C460A02_0 instance");
- end if;
-
-end C460A02_0;
-
-
- --==================================================================--
-
-
-with F460A00;
-generic
- type Designated_Type is private;
- type Target_Type is access all Designated_Type;
- FObj : in out Target_Type;
- FRes : in out F460A00.TC_Result_Kind;
-package C460A02_1 is
- type Operand_Type is access Designated_Type;
- Ptr : Operand_Type := new Designated_Type;
-
- procedure Dummy; -- Needed to allow package body.
-end C460A02_1;
-
-
- --==================================================================--
-
-
-package body C460A02_1 is
- procedure Dummy is
- begin
- null;
- end Dummy;
-begin
- FRes := F460A00.UN_Init;
- FObj := Target_Type(Ptr);
- FRes := F460A00.OK;
-exception
- when Program_Error => FRes := F460A00.PE_Exception;
- when others => FRes := F460A00.Others_Exception;
-end C460A02_1;
-
-
- --==================================================================--
-
-
-with F460A00;
-generic
- type Designated_Type is new F460A00.Tagged_Type with private;
- type Target_Type is access constant Designated_Type;
-procedure C460A02_2 (P : access Designated_Type'Class;
- Res : out F460A00.TC_Result_Kind);
-
-
- --==================================================================--
-
-
-with Report;
-procedure C460A02_2 (P : access Designated_Type'Class;
- Res : out F460A00.TC_Result_Kind) is
- Ptr : Target_Type;
-begin
- Res := F460A00.UN_Init;
- Ptr := Target_Type(P);
-
- -- Avoid optimization (dead variable removal of Ptr):
- if not Report.Equal (Ptr.C, Ptr.C) then -- Always false.
- Report.Failed ("Unexpected error in C460A02_2 instance");
- end if;
- Res := F460A00.OK;
-exception
- when Program_Error => Res := F460A00.PE_Exception;
- when others => Res := F460A00.Others_Exception;
-end C460A02_2;
-
-
- --==================================================================--
-
-
-with F460A00;
-with C460A02_0;
-with C460A02_1;
-with C460A02_2;
-
-with Report;
-procedure C460A02 is
-begin -- C460A02. -- [ Level = 1 ]
-
- Report.Test ("C460A02", "Run-time accessibility checks: instance " &
- "bodies. Operand type of access type conversion is " &
- "declared inside instance or is anonymous");
-
-
- SUBTEST1:
- declare -- [ Level = 2 ]
- type AccTag_L2 is access all F460A00.Tagged_Type;
- PTag_L2 : AccTag_L2 := new F460A00.Tagged_Type;
- Operand_L2 : F460A00.Composite_Type(PTag_L2);
-
- Result : F460A00.TC_Result_Kind := F460A00.UN_Init;
- begin -- SUBTEST1.
-
- begin -- [ Level = 3 ]
- declare -- [ Level = 4 ]
- -- The accessibility level of the actual passed as the target type
- -- in Pack_OK is 2. The accessibility level of the composite actual
- -- (and thus, the level of the anonymous type of the access
- -- discriminant, which is the same as that of the containing
- -- object) is also 2. Therefore, the access type conversion in
- -- Pack_OK does not raise an exception upon instantiation:
-
- package Pack_OK is new C460A02_0
- (Target_Type => AccTag_L2, FObj => Operand_L2);
- begin
- Result := F460A00.OK; -- Expected result.
- end;
- exception
- when Program_Error => Result := F460A00.PE_Exception;
- when others => Result := F460A00.Others_Exception;
- end;
-
- F460A00.TC_Check_Results (Result, F460A00.OK, "SUBTEST #1");
-
- end SUBTEST1;
-
-
-
- SUBTEST2:
- declare -- [ Level = 2 ]
- type AccTag_L2 is access all F460A00.Tagged_Type;
- PTag_L2 : AccTag_L2 := new F460A00.Tagged_Type;
-
- Result : F460A00.TC_Result_Kind := F460A00.UN_Init;
- begin -- SUBTEST2.
-
- declare -- [ Level = 3 ]
- Operand_L3 : F460A00.Composite_Type(PTag_L2);
- begin
- declare -- [ Level = 4 ]
- -- The accessibility level of the actual passed as the target type
- -- in Pack_PE is 2. The accessibility level of the composite actual
- -- (and thus, the level of the anonymous type of the access
- -- discriminant, which is the same as that of the containing
- -- object) is 3. Therefore, the access type conversion in Pack_PE
- -- propagates Program_Error upon instantiation:
-
- package Pack_PE is new C460A02_0 (AccTag_L2, Operand_L3);
- begin
- Result := F460A00.OK;
- end;
- exception
- when Program_Error => Result := F460A00.PE_Exception;
- -- Expected result.
- when others => Result := F460A00.Others_Exception;
- end;
-
- F460A00.TC_Check_Results (Result, F460A00.PE_Exception, "SUBTEST #2");
-
- end SUBTEST2;
-
-
-
- SUBTEST3:
- declare -- [ Level = 2 ]
- Result : F460A00.TC_Result_Kind := F460A00.UN_Init;
- begin -- SUBTEST3.
-
- declare -- [ Level = 3 ]
- type AccArr_L3 is access all F460A00.Array_Type;
- Target: AccArr_L3;
-
- -- The accessibility level of the actual passed as the target type
- -- in Pack_OK is 3. The accessibility level of the operand type is
- -- that of the instance, which is also 3. Therefore, the access type
- -- conversion in Pack_OK does not raise an exception upon
- -- instantiation. If an exception is (incorrectly) raised, it is
- -- handled within the instance:
-
- package Pack_OK is new C460A02_1
- (Designated_Type => F460A00.Array_Type,
- Target_Type => AccArr_L3,
- FObj => Target,
- FRes => Result);
- begin
- null;
- end;
-
- F460A00.TC_Check_Results (Result, F460A00.OK, "SUBTEST #3");
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #3: Program_Error incorrectly propagated");
- when others =>
- Report.Failed ("SUBTEST #3: Unexpected exception propagated");
- end SUBTEST3;
-
-
-
- SUBTEST4:
- declare -- [ Level = 2 ]
- Result : F460A00.TC_Result_Kind := F460A00.UN_Init;
- begin -- SUBTEST4.
-
- declare -- [ Level = 3 ]
- Target: F460A00.AccArr_L0;
-
- -- The accessibility level of the actual passed as the target type
- -- in Pack_PE is 0. The accessibility level of the operand type is
- -- that of the instance, which is 3. Therefore, the access type
- -- conversion in Pack_PE raises Program_Error upon instantiation.
- -- The exception is handled within the instance:
-
- package Pack_PE is new C460A02_1
- (Designated_Type => F460A00.Array_Type,
- Target_Type => F460A00.AccArr_L0,
- FObj => Target,
- FRes => Result);
- begin
- null;
- end;
-
- F460A00.TC_Check_Results (Result, F460A00.PE_Exception, "SUBTEST #4");
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #4: Program_Error incorrectly raised");
- when others =>
- Report.Failed ("SUBTEST #4: Unexpected exception raised");
- end SUBTEST4;
-
-
-
- SUBTEST5:
- declare -- [ Level = 2 ]
- Result : F460A00.TC_Result_Kind := F460A00.UN_Init;
- begin -- SUBTEST5.
-
- declare -- [ Level = 3 ]
- -- The instantiation of C460A02_2 should NOT result in any
- -- exceptions.
-
- procedure Proc is new C460A02_2 (F460A00.Tagged_Type,
- F460A00.AccTag_L0);
- begin
- -- The accessibility level of the actual passed to Proc is 0. The
- -- accessibility level of the actual passed as the target type is
- -- also 0. Therefore, the access type conversion in Proc does not
- -- raise an exception when the subprogram is called. If an exception
- -- is (incorrectly) raised, it is handled within the subprogram:
-
- Proc (F460A00.PTagClass_L0, Result);
- end;
-
- F460A00.TC_Check_Results (Result, F460A00.OK, "SUBTEST #5");
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #5: Program_Error incorrectly raised");
- when others =>
- Report.Failed ("SUBTEST #5: Unexpected exception raised");
- end SUBTEST5;
-
-
-
- SUBTEST6:
- declare -- [ Level = 2 ]
- Result : F460A00.TC_Result_Kind := F460A00.UN_Init;
- begin -- SUBTEST6.
-
- declare -- [ Level = 3 ]
- -- The instantiation of C460A02_2 should NOT result in any
- -- exceptions.
-
- procedure Proc is new C460A02_2 (F460A00.Tagged_Type,
- F460A00.AccTag_L0);
- begin
- -- In the call to (instantiated) procedure Proc, the first actual
- -- parameter is an allocator. Its accessibility level is that of
- -- the level of execution of Proc, which is 3. The accessibility
- -- level of the actual passed as the target type is 0. Therefore,
- -- the access type conversion in Proc raises Program_Error when the
- -- subprogram is called. The exception is handled within the
- -- subprogram:
-
- Proc (new F460A00.Tagged_Type, Result);
- end;
-
- F460A00.TC_Check_Results (Result, F460A00.PE_Exception, "SUBTEST #6");
-
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #6: Program_Error incorrectly raised");
- when others =>
- Report.Failed ("SUBTEST #6: Unexpected exception raised");
- end SUBTEST6;
-
- Report.Result;
-
-end C460A02;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c490001.a b/gcc/testsuite/ada/acats/tests/c4/c490001.a
deleted file mode 100644
index 19153504cb0..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c490001.a
+++ /dev/null
@@ -1,215 +0,0 @@
--- C490001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for a real static expression that is not part of a larger
--- static expression, and whose expected type T is a floating point type
--- that is not a descendant of a formal scalar type, the value is rounded
--- to the nearest machine number of T if T'Machine_Rounds is true, and is
--- truncated otherwise. Check that if rounding is performed, and the value
--- is exactly halfway between two machine numbers, one of the two machine
--- numbers is used.
---
--- TEST DESCRIPTION:
--- The test obtains a machine number M1 for a floating point subtype S by
--- passing a real literal to S'Machine. It then obtains an adjacent
--- machine number M2 by using S'Succ (or S'Pred). It then constructs
--- values which lie between these two machine numbers: one (A) which is
--- closer to M1, one (B) which is exactly halfway between M1 and M2, and
--- one (C) which is closer to M2. This is done for both positive and
--- negative machine numbers.
---
--- Let M1 be closer to zero than M2. Then if S'Machine_Rounds is true,
--- C must be rounded to M2, A must be rounded to M1, and B must be rounded
--- to either M1 or M2. If S'Machine_Rounds is false, all the values must
--- be truncated to M1.
---
--- A, B, and C are constructed using the following static expressions:
---
--- A: constant S := M1 + (M2 - M1)*Z; -- Z slightly less than 0.5.
--- B: constant S := M1 + (M2 - M1)*Z; -- Z equals 0.5.
--- C: constant S := M1 + (M2 - M1)*Z; -- Z slightly more than 0.5.
---
--- Since these are static expressions, they must be evaluated exactly,
--- and no rounding may occur until the final result is calculated.
---
--- The checks for equality between the members of (A, B, C) and (M1, M2)
--- are performed at run-time within the body of a subprogram.
---
--- The test performs additional checks that the rounding performed on
--- real literals is consistent for a floating point subtype. A literal is
--- assigned to a constant of a floating point subtype S. The same literal
--- is then passed to a subprogram, along with the constant, and an
--- equality check is performed within the body of the subprogram.
---
---
--- CHANGE HISTORY:
--- 25 Sep 95 SAIC Initial prerelease version.
--- 25 May 01 RLB Repaired to work with the repeal of the round away
--- rule by AI-268.
---
---!
-
-with System;
-package C490001_0 is
-
- type My_Flt is digits System.Max_Digits;
-
- procedure Float_Subtest (A, B: in My_Flt; Msg: in String);
-
- procedure Float_Subtest (A, B, C: in My_Flt; Msg: in String);
-
-
---
--- Positive cases:
---
-
- -- |----|-------------|-----------------|-------------------|-----------|
- -- | | | | | |
- -- 0 P_M1 Less_Pos_Than_Half Pos_Exactly_Half More_Pos_Than_Half P_M2
-
-
- Positive_Float : constant My_Flt := 12.440193950021943;
-
- -- The literal value 12.440193950021943 is rounded up or down to the
- -- nearest machine number of My_Flt when Positive_Float is initialized.
- -- The value of Positive_Float should therefore be a machine number, and
- -- the use of 'Machine in the initialization of P_M1 will be redundant for
- -- a correct implementation. It's done anyway to make certain that P_M1 is
- -- a machine number, independent of whether an implementation correctly
- -- performs rounding.
-
- P_M1 : constant My_Flt := My_Flt'Machine(Positive_Float);
- P_M2 : constant My_Flt := My_Flt'Succ(P_M1);
-
- -- P_M1 and P_M2 are adjacent machine numbers. Note that because it is not
- -- certain whether 12.440193950021943 is a machine number, nor whether
- -- 'Machine rounds it up or down, 12.440193950021943 may not lie between
- -- P_M1 and P_M2. The test does not depend on this information, however;
- -- the literal is only used as a "seed" to obtain the machine numbers.
-
-
- -- The following entities are used to verify that rounding is performed
- -- according to the value of 'Machine_Rounds. If language rules are
- -- obeyed, the intermediate expressions in the following static
- -- initialization expressions will not be rounded; all calculations will
- -- be performed exactly. The final result, however, will be rounded to
- -- a machine number (either P_M1 or P_M2, depending on the value of
- -- My_Flt'Machine_Rounds). Thus, the value of each constant below will
- -- equal that of P_M1 or P_M2.
-
- Less_Pos_Than_Half : constant My_Flt := P_M1 + ((P_M2 - P_M1)*2.9/6.0);
- Pos_Exactly_Half : constant My_Flt := P_M1 + ((P_M2 - P_M1)/2.0);
- More_Pos_Than_Half : constant My_Flt := P_M1 + ((P_M2 - P_M1)*4.6/9.0);
-
-
---
--- Negative cases:
---
-
- -- -|-------------|-----------------|-------------------|-----------|----|
- -- | | | | | |
- -- N_M2 More_Neg_Than_Half Neg_Exactly_Half Less_Neg_Than_Half N_M1 0
-
-
- -- The descriptions for the positive cases above apply to the negative
- -- cases below as well. Note that, for N_M2, 'Pred is used rather than
- -- 'Succ. Thus, N_M2 is further from 0.0 (i.e. more negative) than N_M1.
-
- Negative_Float : constant My_Flt := -0.692074550952117;
-
-
- N_M1 : constant My_Flt := My_Flt'Machine(Negative_Float);
- N_M2 : constant My_Flt := My_Flt'Pred(N_M1);
-
- More_Neg_Than_Half : constant My_Flt := N_M1 + ((N_M2 - N_M1)*4.1/8.0);
- Neg_Exactly_Half : constant My_Flt := N_M1 + ((N_M2 - N_M1)/2.0);
- Less_Neg_Than_Half : constant My_Flt := N_M1 + ((N_M2 - N_M1)*2.4/5.0);
-
-end C490001_0;
-
-
- --==================================================================--
-
-
-with TCTouch;
-package body C490001_0 is
-
- procedure Float_Subtest (A, B: in My_Flt; Msg: in String) is
- begin
- TCTouch.Assert (A = B, Msg);
- end Float_Subtest;
-
- procedure Float_Subtest (A, B, C: in My_Flt; Msg: in String) is
- begin
- TCTouch.Assert (A = B or A = C, Msg);
- end Float_Subtest;
-
-end C490001_0;
-
-
- --==================================================================--
-
-
-with C490001_0; -- Floating point support.
-use C490001_0;
-
-with Report;
-procedure C490001 is
-begin
- Report.Test ("C490001", "Rounding of real static expressions: " &
- "floating point subtypes");
-
-
- -- Check that rounding direction is consistent for literals:
-
- Float_Subtest (12.440193950021943, P_M1, "Positive Float: literal");
- Float_Subtest (-0.692074550952117, N_M1, "Negative Float: literal");
-
-
- -- Now check that rounding is performed correctly for values between
- -- machine numbers, according to the value of 'Machine_Rounds:
-
- if My_Flt'Machine_Rounds then
- Float_Subtest (Pos_Exactly_Half, P_M1, P_M2, "Positive Float: = half");
- Float_Subtest (More_Pos_Than_Half, P_M2, "Positive Float: > half");
- Float_Subtest (Less_Pos_Than_Half, P_M1, "Positive Float: < half");
-
- Float_Subtest (Neg_Exactly_Half, N_M1, N_M2, "Negative Float: = half");
- Float_Subtest (More_Neg_Than_Half, N_M2, "Negative Float: > half");
- Float_Subtest (Less_Neg_Than_Half, N_M1, "Negative Float: < half");
- else
- Float_Subtest (Pos_Exactly_Half, P_M1, "Positive Float: = half");
- Float_Subtest (More_Pos_Than_Half, P_M1, "Positive Float: > half");
- Float_Subtest (Less_Pos_Than_Half, P_M1, "Positive Float: < half");
-
- Float_Subtest (Neg_Exactly_Half, N_M1, "Negative Float: = half");
- Float_Subtest (More_Neg_Than_Half, N_M1, "Negative Float: > half");
- Float_Subtest (Less_Neg_Than_Half, N_M1, "Negative Float: < half");
- end if;
-
-
- Report.Result;
-end C490001;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c490002.a b/gcc/testsuite/ada/acats/tests/c4/c490002.a
deleted file mode 100644
index 71169b833e4..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c490002.a
+++ /dev/null
@@ -1,239 +0,0 @@
--- C490002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for a real static expression that is not part of a larger
--- static expression, and whose expected type T is an ordinary fixed
--- point type that is not a descendant of a formal scalar type, the value
--- is rounded to the nearest integral multiple of the small of T if
--- T'Machine_Rounds is true, and is truncated otherwise. Check that if
--- rounding is performed, and the value is exactly halfway between two
--- multiples of the small, one of the two multiples of small is used.
---
--- TEST DESCRIPTION:
--- The test obtains an integral multiple M1 of the small of an ordinary
--- fixed point subtype S by dividing a real literal by S'Small, and then
--- truncating the result using 'Truncation. It then obtains an adjacent
--- multiple M2 of the small by using S'Succ (or S'Pred). It then
--- constructs values which lie between these multiples: one (A) which is
--- closer to M1, one (B) which is exactly halfway between M1 and M2, and
--- one (C) which is closer to M2. This is done for both positive and
--- negative multiples of the small.
---
--- Let M1 be closer to zero than M2. Then if S'Machine_Rounds is true,
--- C must be rounded to M2, A must be rounded to M1, and B must be rounded
--- to either M1 or M2. If S'Machine_Rounds is false, all the values must
--- be truncated to M1.
---
--- A, B, and C are constructed using the following static expressions:
---
--- A: constant S := M1 + (M2 - M1)/Z; -- Z slightly more than 2.0.
--- B: constant S := M1 + (M2 - M1)/Z; -- Z equals 2.0.
--- C: constant S := M1 + (M2 - M1)/Z; -- Z slightly less than 2.0.
---
--- Since these are static expressions, they must be evaluated exactly,
--- and no rounding may occur until the final result is calculated.
---
--- The checks for equality between the members of (A, B, C) and (M1, M2)
--- are performed at run-time within the body of a subprogram.
---
--- The test performs additional checks that the rounding performed on
--- real literals is consistent for ordinary fixed point subtypes. A
--- named number (initialized with a literal) is assigned to a constant of
--- a fixed point subtype S. The same literal is then passed to a
--- subprogram, along with the constant, and an equality check is
--- performed within the body of the subprogram.
---
---
--- CHANGE HISTORY:
--- 26 Sep 95 SAIC Initial prerelease version.
---
---!
-
-package C490002_0 is
-
- type My_Fix is delta 0.0625 range -1000.0 .. 1000.0;
-
- Small : constant := My_Fix'Small; -- Named number.
-
- procedure Fixed_Subtest (A, B: in My_Fix; Msg: in String);
-
- procedure Fixed_Subtest (A, B, C: in My_Fix; Msg: in String);
-
-
---
--- Positive cases:
---
-
- -- |----|-------------|-----------------|-------------------|-----------|
- -- | | | | | |
- -- 0 P_M1 Less_Pos_Than_Half Pos_Exactly_Half More_Pos_Than_Half P_M2
-
-
- Positive_Real : constant := 0.11433; -- Named number.
- Pos_Multiplier : constant := Float'Truncation(Positive_Real/Small);
-
- -- Pos_Multiplier is the number of integral multiples of small contained
- -- in Positive_Real. P_M1 is thus the largest integral multiple of
- -- small less than or equal to Positive_Real. Note that since Positive_Real
- -- is a named number and not a fixed point object, P_M1 is generated
- -- without assuming that rounding is performed correctly for fixed point
- -- subtypes.
-
- Positive_Fixed : constant My_Fix := Positive_Real;
-
- P_M1 : constant My_Fix := Pos_Multiplier * Small;
- P_M2 : constant My_Fix := My_Fix'Succ(P_M1);
-
- -- P_M1 and P_M2 are adjacent multiples of the small of My_Fix. Note that
- -- 0.11433 either equals P_M1 (if it is an integral multiple of the small)
- -- or lies between P_M1 and P_M2 (since truncation was forced in
- -- generating Pos_Multiplier). It is not certain, however, exactly where
- -- it lies between them (halfway, less than halfway, more than halfway).
- -- This fact is irrelevant to the test.
-
-
- -- The following entities are used to verify that rounding is performed
- -- according to the value of 'Machine_Rounds. If language rules are
- -- obeyed, the intermediate expressions in the following static
- -- initialization expressions will not be rounded; all calculations will
- -- be performed exactly. The final result, however, will be rounded to
- -- an integral multiple of the small (either P_M1 or P_M2, depending on the
- -- value of My_Fix'Machine_Rounds). Thus, the value of each constant below
- -- will equal that of P_M1 or P_M2.
-
- Less_Pos_Than_Half : constant My_Fix := P_M1 + ((P_M2 - P_M1)/2.050);
- Pos_Exactly_Half : constant My_Fix := P_M1 + ((P_M2 - P_M1)/2.000);
- More_Pos_Than_Half : constant My_Fix := P_M1 + ((P_M2 - P_M1)/1.975);
-
-
---
--- Negative cases:
---
-
- -- -|-------------|-----------------|-------------------|-----------|----|
- -- | | | | | |
- -- N_M2 More_Neg_Than_Half Neg_Exactly_Half Less_Neg_Than_Half N_M1 0
-
-
- -- The descriptions for the positive cases above apply to the negative
- -- cases below as well. Note that, for N_M2, 'Pred is used rather than
- -- 'Succ. Thus, N_M2 is further from 0.0 (i.e. more negative) than N_M1.
-
- Negative_Real : constant := -467.13988; -- Named number.
- Neg_Multiplier : constant := Float'Truncation(Negative_Real/Small);
-
- Negative_Fixed : constant My_Fix := Negative_Real;
-
- N_M1 : constant My_Fix := Neg_Multiplier * Small;
- N_M2 : constant My_Fix := My_Fix'Pred(N_M1);
-
- More_Neg_Than_Half : constant My_Fix := N_M1 + ((N_M2 - N_M1)/1.980);
- Neg_Exactly_Half : constant My_Fix := N_M1 + ((N_M2 - N_M1)/2.000);
- Less_Neg_Than_Half : constant My_Fix := N_M1 + ((N_M2 - N_M1)/2.033);
-
-end C490002_0;
-
-
- --==================================================================--
-
-
-with TCTouch;
-package body C490002_0 is
-
- procedure Fixed_Subtest (A, B: in My_Fix; Msg: in String) is
- begin
- TCTouch.Assert (A = B, Msg);
- end Fixed_Subtest;
-
- procedure Fixed_Subtest (A, B, C: in My_Fix; Msg: in String) is
- begin
- TCTouch.Assert (A = B or A = C, Msg);
- end Fixed_Subtest;
-
-end C490002_0;
-
-
- --==================================================================--
-
-
-with C490002_0; -- Fixed point support.
-use C490002_0;
-
-with Report;
-procedure C490002 is
-begin
- Report.Test ("C490002", "Rounding of real static expressions: " &
- "ordinary fixed point subtypes");
-
-
- -- Literal cases: If the named numbers used to initialize Positive_Fixed
- -- and Negative_Fixed are rounded to an integral multiple of the small
- -- prior to assignment (as expected), then Positive_Fixed and
- -- Negative_Fixed are already integral multiples of the small, and
- -- equal either P_M1 or P_M2 (resp., N_M1 or N_M2). An equality check
- -- can determine in which direction rounding occurred. For example:
- --
- -- if (Positive_Fixed = P_M1) then -- Rounding was toward 0.0.
- --
- -- Check here that the rounding direction is consistent for literals:
-
- if (Positive_Fixed = P_M1) then
- Fixed_Subtest (0.11433, P_M1, "Positive Fixed: literal");
- else
- Fixed_Subtest (0.11433, P_M2, "Positive Fixed: literal");
- end if;
-
- if (Negative_Fixed = N_M1) then
- Fixed_Subtest (-467.13988, N_M1, "Negative Fixed: literal");
- else
- Fixed_Subtest (-467.13988, N_M2, "Negative Fixed: literal");
- end if;
-
-
- -- Now check that rounding is performed correctly for values between
- -- multiples of the small, according to the value of 'Machine_Rounds:
-
- if My_Fix'Machine_Rounds then
- Fixed_Subtest (Pos_Exactly_Half, P_M1, P_M2, "Positive Fixed: = half");
- Fixed_Subtest (More_Pos_Than_Half, P_M2, "Positive Fixed: > half");
- Fixed_Subtest (Less_Pos_Than_Half, P_M1, "Positive Fixed: < half");
-
- Fixed_Subtest (Neg_Exactly_Half, N_M1, N_M2, "Negative Fixed: = half");
- Fixed_Subtest (More_Neg_Than_Half, N_M2, "Negative Fixed: > half");
- Fixed_Subtest (Less_Neg_Than_Half, N_M1, "Negative Fixed: < half");
- else
- Fixed_Subtest (Pos_Exactly_Half, P_M1, "Positive Fixed: = half");
- Fixed_Subtest (More_Pos_Than_Half, P_M1, "Positive Fixed: > half");
- Fixed_Subtest (Less_Pos_Than_Half, P_M1, "Positive Fixed: < half");
-
- Fixed_Subtest (Neg_Exactly_Half, N_M1, "Negative Fixed: = half");
- Fixed_Subtest (More_Neg_Than_Half, N_M1, "Negative Fixed: > half");
- Fixed_Subtest (Less_Neg_Than_Half, N_M1, "Negative Fixed: < half");
- end if;
-
-
- Report.Result;
-end C490002;
diff --git a/gcc/testsuite/ada/acats/tests/c4/c490003.a b/gcc/testsuite/ada/acats/tests/c4/c490003.a
deleted file mode 100644
index a135b5ac3a2..00000000000
--- a/gcc/testsuite/ada/acats/tests/c4/c490003.a
+++ /dev/null
@@ -1,215 +0,0 @@
--- C490003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a static expression is legal if its evaluation fails
--- no language-defined check other than Overflow_Check. Check that such
--- a static expression is legal if it is part of a larger static
--- expression, even if its value is outside the base range of the
--- expected type.
---
--- Check that if a static expression is part of the right operand of a
--- short circuit control form whose value is determined by its left
--- operand, it is not evaluated.
---
--- Check that a static expression in a non-static context is evaluated
--- exactly.
---
--- TEST DESCRIPTION:
--- The first part of the objective is tested by constructing static
--- expressions which involve predefined operations of integer, floating
--- point, and fixed point subtypes. Intermediate expressions within the
--- static expressions have values outside the base range of the expected
--- type. In one case, the extended-range intermediates are compared as
--- part of a boolean expression. In the remaining two cases, further
--- predefined operations on the intermediates bring the final result
--- within the base range. An implementation which compiles these static
--- expressions satisfies this portion of the objective. A check is
--- performed at run-time to ensure that the static expressions evaluate
--- to values within the base range of their respective expected types.
---
--- The second part of the objective is tested by constructing
--- short-circuit control forms whose left operands have the values
--- shown below:
---
--- (TRUE) or else (...)
--- (FALSE) and then (...)
---
--- In both cases the left operand determines the value of the condition.
--- In the test each right operand involves a division by zero, which will
--- raise Constraint_Error if evaluated. A check is made that no exception
--- is raised when each short-circuit control form is evaluated, and that
--- the value of the condition is that of the left operand.
---
--- The third part of the objective is tested by evaluating static
--- expressions involving many operations in contexts which do not
--- require a static expression, and verifying that the exact
--- mathematical results are calculated.
---
---
--- CHANGE HISTORY:
--- 15 Sep 95 SAIC Initial prerelease version for ACVC 2.1.
--- 20 Oct 96 SAIC Modified expressions in C490003_0 to avoid
--- the use of universal operands.
---
---!
-
-with System;
-package C490003_0 is
-
- type My_Flt is digits System.Max_Digits;
-
- Flt_Range_Diff : My_Flt := (My_Flt'Base'Last - My_Flt'Base'First) -
- (My_Flt'Last - My_Flt'First); -- OK.
-
-
- type My_Fix is delta 0.125 range -128.0 .. 128.0;
-
- Symmetric : Boolean := (My_Fix'Base'Last - My_Fix'Base'First) =
- (My_Fix'Base'Last + My_Fix'Base'Last); -- OK.
-
-
- Center : constant Integer := Integer'Base'Last -
- (Integer'Base'Last -
- Integer'Base'First) / 2; -- OK.
-
-end C490003_0;
-
-
- --==================================================================--
-
-
-with Ada.Numerics;
-package C490003_1 is
-
- Zero : constant := 0.0;
- Pi : constant := Ada.Numerics.Pi;
-
- Two_Pi : constant := 2.0 * Pi;
- Half_Pi : constant := Pi/2.0;
-
- Quarter : constant := 90.0;
- Half : constant := 180.0;
- Full : constant := 360.0;
-
- Deg_To_Rad : constant := Half_Pi/90;
- Rad_To_Deg : constant := 1.0/Deg_To_Rad;
-
-end C490003_1;
-
-
- --==================================================================--
-
-
-with C490003_0;
-with C490003_1;
-
-with Report;
-procedure C490003 is
-begin
- Report.Test ("C490003", "Check that static expressions failing " &
- "Overflow_Check are legal if part of a larger static " &
- "expression. Check that static expressions as right " &
- "operands of short-circuit control forms are not " &
- "evaluated if value of control form is determined by " &
- "left operand. Check that static expressions in non-static " &
- "contexts are evaluated exactly");
-
-
---
--- Static expressions within larger static expressions:
---
-
-
- if C490003_0.Flt_Range_Diff not in C490003_0.My_Flt'Base'Range then
- Report.Failed ("Error evaluating static expression: floating point");
- end if;
-
- if C490003_0.Symmetric not in Boolean'Range then
- Report.Failed ("Error evaluating static expression: fixed point");
- end if;
-
- if C490003_0.Center not in Integer'Base'Range then
- Report.Failed ("Error evaluating static expression: integer");
- end if;
-
-
---
--- Short-circuit control forms:
---
-
- declare
- N : constant := 0.0;
- begin
-
- begin
- if not ( (N = 0.0) or else (1.0/N > 0.5) ) then
- Report.Failed ("Error evaluating OR ELSE");
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Right side of OR ELSE was evaluated");
- when others =>
- Report.Failed ("OR ELSE: unexpected exception raised");
- end;
-
- begin
- if (N /= 0.0) and then (1.0/N <= 0.5) then
- Report.Failed ("Error evaluating AND THEN");
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Right side of AND THEN was evaluated");
- when others =>
- Report.Failed ("AND THEN: unexpected exception raised");
- end;
-
- end;
-
-
---
--- Exact evaluation of static expressions:
---
-
-
- declare
- use C490003_1;
-
- Left : constant := 6.0 + 0.3125*( (Full*0.375) + (Half/2.4) -
- ((Quarter + 36.0)/3.0) )/10.0; -- 11.25
- Right : constant := (Pi/3.0) * 1.2 * (15.0/96.0); -- Pi/16
- begin
- if Deg_To_Rad*Left /= Right then
- Report.Failed ("Static expressions not evaluated exactly: #1");
- end if;
-
- if ((Pi*Rad_To_Deg)*2.0 + 4.0*Quarter)/16.0 /= Rad_To_Deg*(Pi/4.0) then
- Report.Failed ("Static expressions not evaluated exactly: #2");
- end if;
- end;
-
-
- Report.Result;
-end C490003;
diff --git a/gcc/testsuite/ada/acats/tests/c5/c540001.a b/gcc/testsuite/ada/acats/tests/c5/c540001.a
deleted file mode 100644
index b7dbdd6e97f..00000000000
--- a/gcc/testsuite/ada/acats/tests/c5/c540001.a
+++ /dev/null
@@ -1,410 +0,0 @@
--- C540001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an expression in a case statement may be of a generic formal
--- type. Check that a function call may be used as a case statement
--- expression. Check that a call to a generic formal function may be
--- used as a case statement expression. Check that a call to an inherited
--- function may be used as a case statement expression even if its result
--- type does not correspond to any nameable subtype.
---
--- TEST DESCRIPTION:
--- This transition test creates examples where expressions in a case
--- statement can be a generic formal object and a call to a generic formal
--- function. This test also creates examples when either a function call,
--- a renaming of a function, or a call to an inherited function is used
--- in the case expressions, the choices of the case statement only need
--- to cover the values in the result of the function.
---
--- Inspired by B54A08A.ADA.
---
---
--- CHANGE HISTORY:
--- 12 Feb 96 SAIC Initial version for ACVC 2.1.
---
---!
-
-package C540001_0 is
- type Int is range 1 .. 2;
-
-end C540001_0;
-
- --==================================================================--
-
-with C540001_0;
-package C540001_1 is
- type Enum_Type is (Eh, Bee, Sea, Dee); -- Range of Enum_Type'Val is 0..3.
- type Mixed is ('A','B', 'C', None);
- subtype Small_Num is Natural range 0 .. 10;
- type Small_Int is range 1 .. 2;
- function Get_Small_Int (P : Boolean) return Small_Int;
- procedure Assign_Mixed (P1 : in Boolean;
- P2 : out Mixed);
-
- type Tagged_Type is tagged
- record
- C1 : Enum_Type;
- end record;
- function Get_Tagged (P : Tagged_Type) return C540001_0.Int;
-
-end C540001_1;
-
- --==================================================================--
-
-package body C540001_1 is
- function Get_Small_Int (P : Boolean) return Small_Int is
- begin
- if P then
- return Small_Int'First;
- else
- return Small_Int'Last;
- end if;
- end Get_Small_Int;
-
- ---------------------------------------------------------------------
- procedure Assign_Mixed (P1 : in Boolean;
- P2 : out Mixed) is
- begin
- case Get_Small_Int (P1) is -- Function call as expression
- when 1 => P2 := None; -- in case statement.
- when 2 => P2 := 'A';
- -- No others needed.
- end case;
-
- end Assign_Mixed;
-
- ---------------------------------------------------------------------
- function Get_Tagged (P : Tagged_Type) return C540001_0.Int is
- begin
- return C540001_0.Int'Last;
- end Get_Tagged;
-
-end C540001_1;
-
- --==================================================================--
-
-generic
-
- type Formal_Scalar is range <>;
-
- FSO : Formal_Scalar;
-
-package C540001_2 is
-
- type Enum is (Alpha, Beta, Theta);
-
- procedure Assign_Enum (ET : out Enum);
-
-end C540001_2;
-
- --==================================================================--
-
-package body C540001_2 is
-
- procedure Assign_Enum (ET : out Enum) is
- begin
- case FSO is -- Type of expression in case
- when 1 => ET := Alpha; -- statement is generic formal type.
- when 2 => ET := Beta;
- when others => ET := Theta;
- end case;
-
- end Assign_Enum;
-
-end C540001_2;
-
- --==================================================================--
-
-with C540001_1;
-generic
-
- type Formal_Enum_Type is new C540001_1.Enum_Type;
-
- with function Formal_Func (P : C540001_1.Small_Num)
- return Formal_Enum_Type is <>;
-
-function C540001_3 (P : C540001_1.Small_Num) return Formal_Enum_Type;
-
- --==================================================================--
-
-function C540001_3 (P : C540001_1.Small_Num) return Formal_Enum_Type is
-
-begin
- return Formal_Func (P);
-end C540001_3;
-
- --==================================================================--
-
-with C540001_1;
-generic
-
- type Formal_Int_Type is new C540001_1.Small_Int;
-
- with function Formal_Func return Formal_Int_Type;
-
-package C540001_4 is
-
- procedure Gen_Assign_Mixed (P : out C540001_1.Mixed);
-
-end C540001_4;
-
- --==================================================================--
-
-package body C540001_4 is
-
- procedure Gen_Assign_Mixed (P : out C540001_1.Mixed) is
- begin
- case Formal_Func is -- Case expression is
- when 1 => P := C540001_1.'A'; -- generic function.
- when others => P := C540001_1.'B';
- end case;
-
- end Gen_Assign_Mixed;
-
-end C540001_4;
-
- --==================================================================--
-
-with C540001_1;
-package C540001_5 is
- type New_Tagged is new C540001_1.Tagged_Type with
- record
- C2 : C540001_1.Mixed;
- end record;
-
- -- Inherits Get_Tagged (P : New_Tagged) return C540001_0.Int;
- -- Note that the return type of the inherited function is not
- -- nameable here.
-
- procedure Assign_Tagged (P1 : in New_Tagged;
- P2 : out New_Tagged);
-
-end C540001_5;
-
- --==================================================================--
-
-package body C540001_5 is
-
- procedure Assign_Tagged (P1 : in New_Tagged;
- P2 : out New_Tagged) is
- begin
- case Get_Tagged (P1) is -- Case expression is
- -- inherited function.
- when 2 => P2 := (C540001_1.Bee, 'B');
- when others => P2 := (C540001_1.Sea, C540001_1.None);
- end case;
-
- end Assign_Tagged;
-
-end C540001_5;
-
- --==================================================================--
-
-with Report;
-with C540001_1;
-with C540001_2;
-with C540001_3;
-with C540001_4;
-with C540001_5;
-
-procedure C540001 is
- type Value is range 1 .. 5;
-
-begin
- Report.Test ("C540001", "Check that an expression in a case statement " &
- "may be of a generic formal type. Check that a function " &
- "call may be used as a case statement expression. Check " &
- "that a call to a generic formal function may be used as " &
- "a case statement expression. Check that a call to an " &
- "inherited function may be used as a case statement " &
- "expression");
-
- Generic_Formal_Object_Subtest:
- begin
- declare
- One : Value := 1;
- package One_Pck is new C540001_2 (Value, One);
- use One_Pck;
- EObj : Enum;
- begin
- Assign_Enum (EObj);
- if EObj /= Alpha then
- Report.Failed ("Incorrect result for value of one in generic" &
- "formal object subtest");
- end if;
- end;
-
- declare
- Five : Value := 5;
- package Five_Pck is new C540001_2 (Value, Five);
- use Five_Pck;
- EObj : Enum;
- begin
- Assign_Enum (EObj);
- if EObj /= Theta then
- Report.Failed ("Incorrect result for value of five in generic" &
- "formal object subtest");
- end if;
- end;
-
- end Generic_Formal_Object_Subtest;
-
- Instantiated_Generic_Function_Subtest:
- declare
- type New_Enum_Type is new C540001_1.Enum_Type;
-
- function Get_Enum_Value (P : C540001_1.Small_Num)
- return New_Enum_Type is
- begin
- return New_Enum_Type'Val (P);
- end Get_Enum_Value;
-
- function Val_Func is new C540001_3
- (Formal_Enum_Type => New_Enum_Type,
- Formal_Func => Get_Enum_Value);
-
- procedure Assign_Num (P : in out C540001_1.Small_Num) is
- begin
- case Val_Func (P) is -- Case expression is
- -- instantiated generic
- when New_Enum_Type (C540001_1.Eh) | -- function.
- New_Enum_Type (C540001_1.Sea) => P := 4;
- when New_Enum_Type (C540001_1.Bee) => P := 7;
- when others => P := 9;
- end case;
-
- end Assign_Num;
-
- SNObj : C540001_1.Small_Num;
-
- begin
- SNObj := 0;
- Assign_Num (SNObj);
- if SNObj /= 4 then
- Report.Failed ("Incorrect result for value of zero in call to " &
- "generic function subtest");
- end if;
-
- SNObj := 3;
- Assign_Num (SNObj);
- if SNObj /= 9 then
- Report.Failed ("Incorrect result for value of three in call to " &
- "generic function subtest");
- end if;
-
- end Instantiated_Generic_Function_Subtest;
-
- -- When a function call, a renaming of a function, or a call to an
- -- inherited function is used in the case expressions, the choices
- -- of the case statement only need to cover the values in the result
- -- of the function.
-
- Function_Call_Subtest:
- declare
- MObj : C540001_1.Mixed := 'B';
- BObj : Boolean := True;
- use type C540001_1.Mixed;
- begin
- C540001_1.Assign_Mixed (BObj, MObj);
- if MObj /= C540001_1.None then
- Report.Failed ("Incorrect result for value of true in function" &
- "call subtest");
- end if;
-
- BObj := False;
- C540001_1.Assign_Mixed (BObj, MObj);
- if MObj /= C540001_1.'A' then
- Report.Failed ("Incorrect result for value of false in function" &
- "call subtest");
- end if;
-
- end Function_Call_Subtest;
-
- Function_Renaming_Subtest:
- declare
- use C540001_1;
- function Rename_Get_Small_Int (P : Boolean)
- return Small_Int renames Get_Small_Int;
- MObj : Mixed := None;
- BObj : Boolean := False;
- begin
- case Rename_Get_Small_Int (BObj) is
- when 1 => MObj := 'A';
- when 2 => MObj := 'B';
- -- No others needed.
- end case;
-
- if MObj /= 'B' then
- Report.Failed ("Incorrect result for value of false in function" &
- "renaming subtest");
- end if;
-
- end Function_Renaming_Subtest;
-
- Call_To_Generic_Formal_Function_Subtest:
- declare
- type New_Small_Int is new C540001_1.Small_Int;
-
- function Get_Int_Value return New_Small_Int is
- begin
- return New_Small_Int'First;
- end Get_Int_Value;
-
- package Int_Pck is new C540001_4
- (Formal_Int_Type => New_Small_Int,
- Formal_Func => Get_Int_Value);
-
- use type C540001_1.Mixed;
- MObj : C540001_1.Mixed := C540001_1.None;
-
- begin
- Int_Pck.Gen_Assign_Mixed (MObj);
- if MObj /= C540001_1.'A' then
- Report.Failed ("Incorrect result in call to generic formal " &
- "function subtest");
- end if;
-
- end Call_To_Generic_Formal_Function_Subtest;
-
- Call_To_Inherited_Function_Subtest:
- declare
- NTObj1 : C540001_5.New_Tagged := (C1 => C540001_1.Eh,
- C2 => C540001_1.'A');
- NTObj2 : C540001_5.New_Tagged := (C540001_1.Dee, C540001_1.'C');
- use type C540001_1.Mixed;
- use type C540001_1.Enum_Type;
- begin
- C540001_5.Assign_Tagged (NTObj1, NTObj2);
- if NTObj2.C1 /= C540001_1.Bee or
- NTObj2.C2 /= C540001_1.'B' then
- Report.Failed ("Incorrect result in inherited function subtest");
- end if;
-
- end Call_To_Inherited_Function_Subtest;
-
- Report.Result;
-
-end C540001;
diff --git a/gcc/testsuite/ada/acats/tests/c6/c631001.a b/gcc/testsuite/ada/acats/tests/c6/c631001.a
deleted file mode 100644
index f8b0c775b15..00000000000
--- a/gcc/testsuite/ada/acats/tests/c6/c631001.a
+++ /dev/null
@@ -1,134 +0,0 @@
--- C631001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if different forms of a name are used in the default
--- expression of a discriminant part, the selector may be an operator
--- symbol or a character literal.
---
--- TEST DESCRIPTION:
--- This transition test defines private types where their selectors in
--- the default expression of the discriminant parts at the full type
--- declarations are an operator and a literal, respectively.
--- The test also declares procedures that use an operator and a literal
--- as selectors in the formal parts.
---
--- Inspired by B63102A.ADA.
---
---
--- CHANGE HISTORY:
--- 25 Mar 96 SAIC Initial version for ACVC 2.1.
--- 26 Feb 97 PWB.CTA Removed use of function called before elaboration
---!
-
-with Report;
-
-procedure C631001 is
-
- package C631001_0 is
-
- type Int_Type is range 1 .. 100;
- type Enu_Type is ('A', 'B', 'C', 'D');
-
- type Private_Enu (D : Enu_Type := 'B') is private;
-
- function "+" (X, Y : Int_Type) return Int_Type;
-
- procedure Int_Proc (P1 : in Int_Type := "+" (10, 15);
- P2 : out Int_Type);
-
- procedure Enu_Proc (P1 : in Enu_Type := 'C';
- P2 : out Enu_Type);
-
- private
-
- type Private_Enu (D : Enu_Type := C631001_0.'B') is -- OK.
- record
- C2 : Enu_Type := D;
- end record;
-
- -----------------------------------------------------------------
- PE_Obj : C631001_0.Private_Enu;
-
- end C631001_0;
-
- --==================================================================--
-
- package body C631001_0 is
-
- function "+" (X, Y : Int_Type) return Int_Type is
- begin
- return 10;
- end "+";
-
- -----------------------------------------------------------------
- procedure Int_Proc (P1 : in Int_Type := C631001_0."+" (10, 15); -- OK.
- P2 : out Int_Type) is
-
- begin
- P2 := P1;
- end Int_Proc;
-
- -----------------------------------------------------------------
- procedure Enu_Proc (P1 : in Enu_Type := C631001_0.'C'; -- OK.
- P2 : out Enu_Type) is
- begin
- P2 := P1;
- end Enu_Proc;
-
- -----------------------------------------------------------------
-
- end C631001_0;
-
- ---------------------------------------------------------------------------
- Int_Obj : C631001_0.Int_Type := 50;
- Enu_Obj : C631001_0.Enu_Type := C631001_0.'D';
-
- -- Direct visibility to operator symbols
- use type C631001_0.Int_Type;
- use type C631001_0.Enu_Type;
-
-begin -- main
-
- Report.Test ("C631001", "Check that if different forms of a name are " &
- "used in the default expression of a discriminant part, " &
- "the selector may be an operator symbol or a character " &
- "literal");
-
- C631001_0.Int_Proc (P2 => Int_Obj);
-
- if Int_Obj /= 10 then
- Report.Failed ("Wrong result for Int_Obj");
- end if;
-
- C631001_0.Enu_Proc (P2 => Enu_Obj);
-
- if Enu_Obj /= 'C' then
- Report.Failed ("Wrong result for Enu_Obj");
- end if;
-
- Report.Result;
-
-end C631001;
diff --git a/gcc/testsuite/ada/acats/tests/c6/c640001.a b/gcc/testsuite/ada/acats/tests/c6/c640001.a
deleted file mode 100644
index 8e259162e17..00000000000
--- a/gcc/testsuite/ada/acats/tests/c6/c640001.a
+++ /dev/null
@@ -1,334 +0,0 @@
--- C640001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the prefix of a subprogram call with an actual parameter
--- part may be an implicit dereference of an access-to-subprogram value.
--- Check that, for an access-to-subprogram type whose designated profile
--- contains parameters of a tagged generic formal type, an access-to-
--- subprogram value may designate dispatching and non-dispatching
--- operations, and that dereferences of such a value call the appropriate
--- subprogram.
---
--- TEST DESCRIPTION:
--- The test declares a tagged type (Table) with a dispatching operation
--- (Clear), as well as a derivative (Table2) which overrides that
--- operation. A subprogram with the same name and profile as Clear is
--- declared in a separate package -- it is therefore not a dispatching
--- operation of Table. For the purposes of the test, each version of Clear
--- modifies the components of its parameter in a unique way.
---
--- Additionally, an operation (Reset) of type Table is declared which
--- makes a re-dispatching call to Clear, i.e.,
---
--- procedure Reset (A: in out Table) is
--- begin
--- ...
--- Clear (Table'Class(A)); -- Re-dispatch based on tag of actual.
--- ...
--- end Reset;
---
--- An access-to-subprogram type is declared within a generic package,
--- with a designated profile which declares a parameter of a generic
--- formal tagged private type.
---
--- The generic is instantiated with type Table. The instance defines an
--- array of access-to-subprogram values (which represents a table of
--- operations to be performed sequentially on a single operand).
--- Access values designating the dispatching version of Clear, the
--- non-dispatching version of Clear, and Reset (which re-dispatches to
--- Clear) are placed in this array.
---
--- In the instance, each subprogram in the array is called by implicitly
--- dereferencing the corresponding access value. For the dispatching and
--- non-dispatching versions of Clear, the actual parameter passed is of
--- type Table. For Reset, the actual parameter passed is a view conversion
--- of an object of type Table2 to type Table, i.e., Table(Table2_Obj).
--- Since the tag of the operand never changes, the call to Clear within
--- Reset should execute Table2's version of Clear.
---
--- The main program verifies that the appropriate version of Clear is
--- called in each case, by checking that the components of the actual are
--- updated as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C640001_0 is
-
- -- Data type artificial for testing purposes.
-
- Row_Len : constant := 10;
-
- T : constant Boolean := True;
- F : constant Boolean := False;
-
- type Row_Type is array (1 .. Row_Len) of Boolean;
-
- function Is_True (A : in Row_Type) return Boolean;
- function Is_False (A : in Row_Type) return Boolean;
-
-
- Init : constant Row_Type := (T, F, T, F, T, F, T, F, T, F);
-
- type Table is tagged record -- Tagged type.
- Row1 : Row_Type := Init;
- Row2 : Row_Type := Init;
- end record;
-
- procedure Clear (A : in out Table); -- Dispatching operation.
-
- procedure Reset (A : in out Table); -- Re-dispatching operation.
-
- -- ...Other operations.
-
-
- type Table2 is new Table with null record; -- Extension of Table (but
- -- structurally identical).
-
- procedure Clear (A : in out Table2); -- Overrides parent's op.
-
- -- ...Other operations.
-
-
-end C640001_0;
-
-
- --===================================================================--
-
-
-package body C640001_0 is
-
- function Is_True (A : in Row_Type) return Boolean is
- begin
- for I in A'Range loop
- if A(I) /= True then -- Return true if all elements
- return False; -- of A are True.
- end if;
- end loop;
- return True;
- end Is_True;
-
-
- function Is_False (A : in Row_Type) return Boolean is
- begin
- return A = Row_Type'(others => False); -- Return true if all elements
- end Is_False; -- of A are False.
-
-
- procedure Clear (A : in out Table) is
- begin
- for I in Row_Type'Range loop -- This version of Clear sets
- A.Row1(I) := False; -- the elements of Row1 only
- end loop; -- to False.
- end Clear;
-
-
- procedure Reset (A : in out Table) is
- begin
- Clear (Table'Class(A)); -- Redispatch to appropriate
- -- ... Other "reset" activities. -- version of Clear.
- end Reset;
-
-
- procedure Clear (A : in out Table2) is
- begin
- for I in Row_Type'Range loop -- This version of Clear sets
- A.Row1(I) := True; -- the elements of Row1 only
- end loop; -- to True.
- end Clear;
-
-
-end C640001_0;
-
-
- --===================================================================--
-
-
-with C640001_0;
-package C640001_1 is
-
- procedure Clear (T : in out C640001_0.Table); -- Non-dispatching operation.
-
-end C640001_1;
-
-
- --===================================================================--
-
-
-package body C640001_1 is
-
- procedure Clear (T : in out C640001_0.Table) is
- begin
- for I in C640001_0.Row_Type'Range loop -- This version of Clear sets
- T.Row2(I) := True; -- the elements of Row2 only
- end loop; -- to True.
- end Clear;
-
-end C640001_1;
-
-
- --===================================================================--
-
-
--- This unit represents a support package for table-driven processing of
--- data objects. Process_Operand performs a set of operations are performed
--- sequentially on a single operand. Note that parameters are provided to
--- specify which subset of operations in the operations table are to be
--- performed (ordinarily these might be omitted, but the test requires that
--- each operation be called individually for a single operand).
-
-generic
- type Tag is tagged private;
-package C640001_2 is
-
- type Proc_Ptr is access procedure (P: in out Tag);
-
- type Op_List is private;
-
- procedure Add_Op (Op : in Proc_Ptr; -- Add operation to
- List : in out Op_List); -- to list of ops.
-
- procedure Process_Operand (Operand : in out Tag; -- Execute a subset
- List : in Op_List; -- of a list of
- First_Op : in Positive; -- operations using
- Last_Op : in Positive); -- a given operand.
-
- -- ...Other operations.
-
-private
- type Op_Array is array (1 .. 3) of Proc_Ptr;
-
- type Op_List is record
- Top : Natural := 0;
- Ops : Op_Array;
- end record;
-end C640001_2;
-
-
- --===================================================================--
-
-
-package body C640001_2 is
-
- procedure Add_Op (Op : in Proc_Ptr;
- List : in out Op_List) is
- begin
- List.Top := List.Top + 1; -- Artificial; no Constraint_Error protection.
- List.Ops(List.Top) := Op;
- end Add_Op;
-
-
- procedure Process_Operand (Operand : in out Tag;
- List : in Op_List;
- First_Op : in Positive;
- Last_Op : in Positive) is
- begin
- for I in First_Op .. Last_Op loop
- List.Ops(I)(Operand); -- Implicit dereference of an
- end loop; -- access-to-subprogram value.
- end Process_Operand;
-
-end C640001_2;
-
-
- --===================================================================--
-
-
-with C640001_0;
-with C640001_1;
-with C640001_2;
-
-with Report;
-procedure C640001 is
-
- package Table_Support is new C640001_2 (C640001_0.Table);
-
- Sub_Ptr : Table_Support.Proc_Ptr;
- My_List : Table_Support.Op_List;
- My_Table1 : C640001_0.Table; -- Initial values of both Row1 &
- -- Row2 are (T,F,T,F,T,F,T,F,T,F).
- My_Table2 : C640001_0.Table2; -- Initial values of both Row1 &
- -- Row2 are (T,F,T,F,T,F,T,F,T,F).
-begin
- Report.Test ("C640001", "Check that, for an access-to-subprogram type " &
- "whose designated profile contains parameters " &
- "of a tagged generic formal type, an access-" &
- "to-subprogram value may designate dispatching " &
- "and non-dispatching operations");
-
- --
- -- Add subprogram access values to list:
- --
-
- Sub_Ptr := C640001_0.Clear'Access; -- Designates dispatching op.
- Table_Support.Add_Op (Sub_Ptr, My_List); -- (1st operation on My_List).
-
- Sub_Ptr := C640001_1.Clear'Access; -- Designates non-dispatching op.
- Table_Support.Add_Op (Sub_Ptr, My_List); -- (2nd operation on My_List).
-
- Sub_Ptr := C640001_0.Reset'Access; -- Designates re-dispatching op.
- Table_Support.Add_Op (Sub_Ptr, My_List); -- (3rd operation on My_List).
-
-
- --
- -- Call dispatching operation:
- --
-
- Table_Support.Process_Operand (My_Table1, My_List, 1, 1); -- Call 1st op.
-
- if not C640001_0.Is_False (My_Table1.Row1) then
- Report.Failed ("Wrong result after calling dispatching operation");
- end if;
-
-
- --
- -- Call non-dispatching operation:
- --
-
- Table_Support.Process_Operand (My_Table1, My_List, 2, 2); -- Call 2nd op.
-
- if not C640001_0.Is_True (My_Table1.Row2) then
- Report.Failed ("Wrong result after calling non-dispatching operation");
- end if;
-
-
- --
- -- Call re-dispatching operation:
- --
-
- Table_Support.Process_Operand (C640001_0.Table(My_Table2), -- View conv.
- My_List, 3, 3); -- Call 3rd op.
-
- if not C640001_0.Is_True (My_Table2.Row1) then
- Report.Failed ("Wrong result after calling re-dispatching operation");
- end if;
-
-
- Report.Result;
-end C640001;
diff --git a/gcc/testsuite/ada/acats/tests/c6/c641001.a b/gcc/testsuite/ada/acats/tests/c6/c641001.a
deleted file mode 100644
index 84ee58a7ed5..00000000000
--- a/gcc/testsuite/ada/acats/tests/c6/c641001.a
+++ /dev/null
@@ -1,281 +0,0 @@
--- C641001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that actual parameters passed by reference are view converted
--- to the nominal subtype of the formal parameter.
---
--- TEST DESCRIPTION:
--- Check that sliding is allowed for formal parameters, especially
--- check cases that would have caused errors in Ada'83.
--- Check that length check for a formal parameter (esp out mode)
--- is performed before the call, not after.
---
--- notes: 6.2; by reference ::= tagged, task, protected,
--- limited (nonprivate), or composite containing such
--- 4.6; view conversion
---
---
--- CHANGE HISTORY:
--- 26 JAN 96 SAIC Initial version
--- 04 NOV 96 SAIC Commentary revision for release 2.1
--- 27 FEB 97 PWB.CTA Corrected reference to the wrong string
---!
-
------------------------------------------------------------------ C641001_0
-
-package C641001_0 is
-
- subtype String_10 is String(1..10);
-
- procedure Check_String_10( S : out String_10; Start, Stop: Natural );
-
- procedure Check_Illegal_Slice_Reference( Slice_Passed : in out String;
- Index: Natural );
-
- type Tagged_Data(Bound: Natural) is tagged record
- Data_Item : String(1..Bound) := (others => '*');
- end record;
-
- type Tag_List is array(Natural range <>) of Tagged_Data(5);
-
- subtype Tag_List_10 is Tag_List(1..10);
-
- procedure Check_Tag_Slice( TL : in out Tag_List_10 );
-
- procedure Check_Out_Tagged_Data( Formal : out Tagged_Data );
-
-end C641001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-with TCTouch;
-package body C641001_0 is
-
- String_Data : constant String := "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- procedure Check_String_10( S : out String_10; Start, Stop: Natural ) is
- begin
- if S'Length /= 10 then
- Report.Failed("Length check not performed prior to execution");
- end if;
- S := String_Data(Start..Stop);
- exception
- when others => Report.Failed("Exception encountered in Check_String_10");
- end Check_String_10;
-
- procedure Check_Illegal_Slice_Reference( Slice_Passed : in out String;
- Index: Natural ) is
- begin
- -- essentially "do-nothing" for optimization foilage...
- if Slice_Passed(Index) in Character then
- -- Intent is ^^^^^ should raise Constraint_Error
- Report.Failed("Illegal Slice provided legal character");
- else
- Report.Failed("Illegal Slice provided illegal character");
- end if;
- exception
- when Constraint_Error =>
- null; -- expected case
- when others =>
- Report.Failed("Wrong exception in Check_Illegal_Slice_Reference");
- end Check_Illegal_Slice_Reference;
-
- procedure Check_Tag_Slice( TL : in out Tag_List_10 ) is
- -- if the view conversion is not performed, one of the following checks
- -- will fail (given data passed as 0..9 and then 2..11)
- begin
- Check_Under_Index: -- index 0 should raise C_E
- begin
- TCTouch.Assert( TL(Report.Ident_Int(0)).Data_Item = "*****",
- "Index 0 (illegal); bad data" );
- Report.Failed("Index 0 did not raise Constraint_Error");
- exception
- when Constraint_Error =>
- null; -- expected case
- when others =>
- Report.Failed("Wrong exception in Check_Under_Index ");
- end Check_Under_Index;
-
- Check_Over_Index: -- index 11 should raise C_E
- begin
- TCTouch.Assert( TL(Report.Ident_Int(11)).Data_Item = "*****",
- "Index 11 (illegal); bad data" );
- Report.Failed("Index 11 did not raise Constraint_Error");
- exception
- when Constraint_Error =>
- null; -- expected case
- when others =>
- Report.Failed("Wrong exception in Check_Over_Index ");
- end Check_Over_Index;
-
- end Check_Tag_Slice;
-
- procedure Check_Out_Tagged_Data( Formal : out Tagged_Data ) is
- begin
- TCTouch.Assert( Formal.Data_Item = "*****", "out formal data bad" );
- Formal.Data_Item(1) := '!';
- end Check_Out_Tagged_Data;
-
-end C641001_0;
-
-------------------------------------------------------------------- C641001
-
-with Report;
-with TCTouch;
-with C641001_0;
-procedure C641001 is
-
- function II( I: Integer ) return Integer renames Report.Ident_Int;
- -- ^^ name chosen to allow embedding in calls
-
- A_String_10 : C641001_0.String_10;
- Slicable : String(1..40);
- Tag_Slices : C641001_0.Tag_List(0..11);
-
- Global_Data : String(1..26) := "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- procedure Check_Out_Sliding( Lo1, Hi1, Lo2, Hi2 : Natural ) is
-
- subtype One_Constrained_String is String(Lo1..Hi1); -- 1 5
- subtype Two_Constrained_String is String(Lo2..Hi2); -- 6 10
-
- procedure Out_Param( Param : out One_Constrained_String ) is
- begin
- Param := Report.Ident_Str( Global_Data(Lo2..Hi2) );
- end Out_Param;
- Object : Two_Constrained_String;
- begin
- Out_Param( Object );
- if Object /= Report.Ident_Str( Global_Data(Lo2..Hi2) ) then
- Report.Failed("Bad result in Check_Out_Sliding");
- end if;
- exception
- when others => Report.Failed("Exception in Check_Out_Sliding");
- end Check_Out_Sliding;
-
- procedure Check_Dynamic_Subtype_Cases(F_Lower,F_Upper: Natural;
- A_Lower,A_Upper: Natural) is
-
- subtype Dyn_String is String(F_Lower..F_Upper);
-
- procedure Check_Dyn_Subtype_Formal_Out( Param : out Dyn_String ) is
- begin
- Param := Global_Data(11..20);
- end Check_Dyn_Subtype_Formal_Out;
-
- procedure Check_Dyn_Subtype_Formal_In( Param : in Dyn_String ) is
- begin
- if Param /= Global_Data(11..20) then
- Report.Failed("Dynamic case, data mismatch");
- end if;
- end Check_Dyn_Subtype_Formal_In;
-
- Stuff: String(A_Lower..A_Upper);
-
- begin
- Check_Dyn_Subtype_Formal_Out( Stuff );
- Check_Dyn_Subtype_Formal_In( Stuff );
- end Check_Dynamic_Subtype_Cases;
-
-begin -- Main test procedure.
-
- Report.Test ("C641001", "Check that actual parameters passed by " &
- "reference are view converted to the nominal " &
- "subtype of the formal parameter" );
-
- -- non error cases for string slices
-
- C641001_0.Check_String_10( A_String_10, 1, 10 );
- TCTouch.Assert( A_String_10 = "1234567890", "Nominal case" );
-
- C641001_0.Check_String_10( A_String_10, 11, 20 );
- TCTouch.Assert( A_String_10 = "ABCDEFGHIJ", "Sliding to subtype" );
-
- C641001_0.Check_String_10( Slicable(1..10), 1, 10 );
- TCTouch.Assert( Slicable(1..10) = "1234567890", "Slice, no sliding" );
-
- C641001_0.Check_String_10( Slicable(1..10), 21, 30 );
- TCTouch.Assert( Slicable(1..10) = "KLMNOPQRST", "Sliding to slice" );
-
- C641001_0.Check_String_10( Slicable(11..20), 11, 20 );
- TCTouch.Assert( Slicable(11..20) = "ABCDEFGHIJ", "Sliding to same" );
-
- C641001_0.Check_String_10( Slicable(21..30), 11, 20 );
- TCTouch.Assert( Slicable(21..30) = "ABCDEFGHIJ", "Sliding up" );
-
- -- error cases for string slices
-
- C641001_0.Check_Illegal_Slice_Reference( Slicable(21..30), 20 );
-
- C641001_0.Check_Illegal_Slice_Reference( Slicable(1..15), Slicable'Last );
-
- -- checks for view converting actuals to formals
-
- -- catch low bound fault
- C641001_0.Check_Tag_Slice( Tag_Slices(II(0)..9) ); -- II ::= Ident_Int
- TCTouch.Assert( Tag_Slices'First = 0, "Tag_Slices'First = 0" );
- TCTouch.Assert( Tag_Slices'Last = 11, "Tag_Slices'Last = 11" );
-
- -- catch high bound fault
- C641001_0.Check_Tag_Slice( Tag_Slices(2..II(11)) );
- TCTouch.Assert( Tag_Slices'First = 0, "Tag_Slices'First = 0" );
- TCTouch.Assert( Tag_Slices'Last = 11, "Tag_Slices'Last = 11" );
-
- Check_Formal_Association_Check:
- begin
- C641001_0.Check_String_10( Slicable, 1, 10 ); -- catch length fault
- Report.Failed("Exception not raised at Check_Formal_Association_Check");
- exception
- when Constraint_Error =>
- null; -- expected case
- when others =>
- Report.Failed("Wrong exception at Check_Formal_Association_Check");
- end Check_Formal_Association_Check;
-
- -- check for constrained actual, unconstrained formal
- C641001_0.Check_Out_Tagged_Data( Tag_Slices(5) );
- TCTouch.Assert( Tag_Slices(5).Data_Item = "!****",
- "formal out returned bad result" );
-
- -- additional checks for out mode formal parameters, dynamic subtypes
-
- Check_Out_Sliding( II(1),II(5), II(6),II(10) );
-
- Check_Out_Sliding( 21,25, 6,10 );
-
- Check_Dynamic_Subtype_Cases(F_Lower => II(1), F_Upper => II(10),
- A_Lower => II(1), A_Upper => II(10));
-
- Check_Dynamic_Subtype_Cases(F_Lower => II(21), F_Upper => II(30),
- A_Lower => II( 1), A_Upper => II(10));
-
- Check_Dynamic_Subtype_Cases(F_Lower => II( 1), F_Upper => II(10),
- A_Lower => II(21), A_Upper => II(30));
-
- Report.Result;
-
-end C641001;
diff --git a/gcc/testsuite/ada/acats/tests/c6/c650001.a b/gcc/testsuite/ada/acats/tests/c6/c650001.a
deleted file mode 100644
index 595e81dad47..00000000000
--- a/gcc/testsuite/ada/acats/tests/c6/c650001.a
+++ /dev/null
@@ -1,412 +0,0 @@
--- C650001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for a function result type that is a return-by-reference
--- type, Program_Error is raised if the return expression is a name that
--- denotes an object view whose accessibility level is deeper than that
--- of the master that elaborated the function body.
---
--- Check for cases where the result type is:
--- (a) A tagged limited type.
--- (b) A task type.
--- (c) A protected type.
--- (d) A composite type with a subcomponent of a
--- return-by-reference type (task type).
---
--- TEST DESCRIPTION:
--- The accessibility level of the master that elaborates the body of a
--- return-by-reference function will always be less deep than that of
--- the function (which is itself a master).
---
--- Thus, the return object may not be any of the following, since each
--- has an accessibility level at least as deep as that of the function:
---
--- (1) An object declared local to the function.
--- (2) The result of a local function.
--- (3) A parameter of the function.
---
--- Verify that Program_Error is raised within the return-by-reference
--- function if the return object is any of (1)-(3) above, for various
--- subsets of the return types (a)-(d) above. Include cases where (1)-(3)
--- are operands of parenthesized expressions.
---
--- Verify that no exception is raised if the return object is any of the
--- following:
---
--- (4) An object declared at a less deep level than that of the
--- master that elaborated the function body.
--- (5) The result of a function declared at the same level as the
--- original function (assuming the new function is also legal).
--- (6) A parameter of the master that elaborated the function body.
---
--- For (5), pass the new function as an actual via an access-to-
--- subprogram parameter of the original function. Check for cases where
--- the new function does and does not raise an exception.
---
--- Since the functions to be tested cannot be part of an assignment
--- statement (since they return values of a limited type), pass each
--- function result as an actual parameter to a dummy procedure, e.g.,
---
--- Dummy_Proc ( Function_Call );
---
---
--- CHANGE HISTORY:
--- 03 May 95 SAIC Initial prerelease version.
--- 08 Feb 99 RLB Removed subcase with two errors.
---
---!
-
-package C650001_0 is
-
- type Tagged_Limited is tagged limited record
- C: String (1 .. 10);
- end record;
-
- task type Task_Type;
-
- protected type Protected_Type is
- procedure Op;
- end Protected_Type;
-
- type Task_Array is array (1 .. 10) of Task_Type;
-
- type Variant_Record (Toggle: Boolean) is record
- case Toggle is
- when True =>
- T: Task_Type; -- Return-by-reference component.
- when False =>
- I: Integer; -- Non-return-by-reference component.
- end case;
- end record;
-
- -- Limited type even though variant contains no limited components:
- type Non_Task_Variant is new Variant_Record (Toggle => False);
-
-end C650001_0;
-
-
- --==================================================================--
-
-
-package body C650001_0 is
-
- task body Task_Type is
- begin
- null;
- end Task_Type;
-
- protected body Protected_Type is
- procedure Op is
- begin
- null;
- end Op;
- end Protected_Type;
-
-end C650001_0;
-
-
- --==================================================================--
-
-
-with C650001_0;
-package C650001_1 is
-
- type TC_Result_Kind is (OK, P_E, O_E);
-
- procedure TC_Display_Results (Actual : in TC_Result_Kind;
- Expected: in TC_Result_Kind;
- Message : in String);
-
- -- Dummy procedures:
-
- procedure Check_Tagged (P: C650001_0.Tagged_Limited);
- procedure Check_Task (P: C650001_0.Task_Type);
- procedure Check_Protected (P: C650001_0.Protected_Type);
- procedure Check_Composite (P: C650001_0.Non_Task_Variant);
-
-end C650001_1;
-
-
- --==================================================================--
-
-
-with Report;
-package body C650001_1 is
-
- procedure TC_Display_Results (Actual : in TC_Result_Kind;
- Expected: in TC_Result_Kind;
- Message : in String) is
- begin
- if Actual /= Expected then
- case Actual is
- when OK =>
- Report.Failed ("No exception raised: " & Message);
- when P_E =>
- Report.Failed ("Program_Error raised: " & Message);
- when O_E =>
- Report.Failed ("Unexpected exception raised: " & Message);
- end case;
- end if;
- end TC_Display_Results;
-
-
- procedure Check_Tagged (P: C650001_0.Tagged_Limited) is
- begin
- null;
- end;
-
- procedure Check_Task (P: C650001_0.Task_Type) is
- begin
- null;
- end;
-
- procedure Check_Protected (P: C650001_0.Protected_Type) is
- begin
- null;
- end;
-
- procedure Check_Composite (P: C650001_0.Non_Task_Variant) is
- begin
- null;
- end;
-
-end C650001_1;
-
-
-
- --==================================================================--
-
-
-with C650001_0;
-with C650001_1;
-
-with Report;
-procedure C650001 is
-begin
-
- Report.Test ("C650001", "Check that, for a function result type that " &
- "is a return-by-reference type, Program_Error is raised " &
- "if the return expression is a name that denotes an " &
- "object view whose accessibility level is deeper than " &
- "that of the master that elaborated the function body");
-
-
-
- SUBTEST1:
- declare
-
- Result: C650001_1.TC_Result_Kind;
- PO : C650001_0.Protected_Type;
-
- function Return_Prot (P: C650001_0.Protected_Type)
- return C650001_0.Protected_Type is
- begin
- Result := C650001_1.OK;
- return P; -- Formal parameter (3).
- exception
- when Program_Error =>
- Result := C650001_1.P_E; -- Expected result.
- return PO;
- when others =>
- Result := C650001_1.O_E;
- return PO;
- end Return_Prot;
-
- begin -- SUBTEST1.
- C650001_1.Check_Protected ( Return_Prot(PO) );
- C650001_1.TC_Display_Results (Result, C650001_1.P_E, "SUBTEST #1");
- exception
- when others =>
- Report.Failed ("SUBTEST #1: Unexpected exception in outer block");
- end SUBTEST1;
-
-
-
- SUBTEST2:
- declare
-
- Result: C650001_1.TC_Result_Kind;
- Comp : C650001_0.Non_Task_Variant;
-
- function Return_Composite return C650001_0.Non_Task_Variant is
- Local: C650001_0.Non_Task_Variant;
- begin
- Result := C650001_1.OK;
- return (Local); -- Parenthesized local object (1).
- exception
- when Program_Error =>
- Result := C650001_1.P_E; -- Expected result.
- return Comp;
- when others =>
- Result := C650001_1.O_E;
- return Comp;
- end Return_Composite;
-
- begin -- SUBTEST2.
- C650001_1.Check_Composite ( Return_Composite );
- C650001_1.TC_Display_Results (Result, C650001_1.P_E, "SUBTEST #2");
- exception
- when others =>
- Report.Failed ("SUBTEST #2: Unexpected exception in outer block");
- end SUBTEST2;
-
-
-
- SUBTEST3:
- declare
-
- Result: C650001_1.TC_Result_Kind;
- Tsk : C650001_0.Task_Type;
- TskArr: C650001_0.Task_Array;
-
- function Return_Task (P: C650001_0.Task_Array)
- return C650001_0.Task_Type is
-
- function Inner return C650001_0.Task_Type is
- begin
- return P(P'First); -- OK: should not raise exception (6).
- exception
- when Program_Error =>
- Report.Failed ("SUBTEST #3: Program_Error incorrectly " &
- "raised within function Inner");
- return Tsk;
- when others =>
- Report.Failed ("SUBTEST #3: Unexpected exception " &
- "raised within function Inner");
- return Tsk;
- end Inner;
-
- begin -- Return_Task.
- Result := C650001_1.OK;
- return Inner; -- Call to local function (2).
- exception
- when Program_Error =>
- Result := C650001_1.P_E; -- Expected result.
- return Tsk;
- when others =>
- Result := C650001_1.O_E;
- return Tsk;
- end Return_Task;
-
- begin -- SUBTEST3.
- C650001_1.Check_Task ( Return_Task(TskArr) );
- C650001_1.TC_Display_Results (Result, C650001_1.P_E, "SUBTEST #3");
- exception
- when others =>
- Report.Failed ("SUBTEST #3: Unexpected exception in outer block");
- end SUBTEST3;
-
-
-
- SUBTEST4:
- declare
-
- Result: C650001_1.TC_Result_Kind;
- TagLim: C650001_0.Tagged_Limited;
-
- function Return_TagLim (P: C650001_0.Tagged_Limited'Class)
- return C650001_0.Tagged_Limited is
- begin
- Result := C650001_1.OK;
- return C650001_0.Tagged_Limited(P); -- Conversion of formal param (3).
- exception
- when Program_Error =>
- Result := C650001_1.P_E; -- Expected result.
- return TagLim;
- when others =>
- Result := C650001_1.O_E;
- return TagLim;
- end Return_TagLim;
-
- begin -- SUBTEST4.
- C650001_1.Check_Tagged ( Return_TagLim(TagLim) );
- C650001_1.TC_Display_Results (Result, C650001_1.P_E,
- "SUBTEST #4 (root type)");
- exception
- when others =>
- Report.Failed ("SUBTEST #4: Unexpected exception in outer block");
- end SUBTEST4;
-
-
-
- SUBTEST5:
- declare
- Tsk : C650001_0.Task_Type;
- begin -- SUBTEST5.
-
- declare
- Result: C650001_1.TC_Result_Kind;
-
- type AccToFunc is access function return C650001_0.Task_Type;
-
- function Return_Global return C650001_0.Task_Type is
- begin
- return Tsk; -- OK: should not raise exception (4).
- end Return_Global;
-
- function Return_Local return C650001_0.Task_Type is
- Local : C650001_0.Task_Type;
- begin
- return Local; -- Propagate Program_Error.
- end Return_Local;
-
-
- function Return_Func (P: AccToFunc) return C650001_0.Task_Type is
- begin
- Result := C650001_1.OK;
- return P.all; -- Function call (5).
- exception
- when Program_Error =>
- Result := C650001_1.P_E;
- return Tsk;
- when others =>
- Result := C650001_1.O_E;
- return Tsk;
- end Return_Func;
-
- RG : AccToFunc := Return_Global'Access;
- RL : AccToFunc := Return_Local'Access;
-
- begin
- C650001_1.Check_Task ( Return_Func(RG) );
- C650001_1.TC_Display_Results (Result, C650001_1.OK,
- "SUBTEST #5 (global task)");
-
- C650001_1.Check_Task ( Return_Func(RL) );
- C650001_1.TC_Display_Results (Result, C650001_1.P_E,
- "SUBTEST #5 (local task)");
- exception
- when others =>
- Report.Failed ("SUBTEST #5: Unexpected exception in outer block");
- end;
-
- end SUBTEST5;
-
-
-
- Report.Result;
-
-end C650001;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c730001.a b/gcc/testsuite/ada/acats/tests/c7/c730001.a
deleted file mode 100644
index 24cf8e0fdc5..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c730001.a
+++ /dev/null
@@ -1,437 +0,0 @@
--- C730001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the full view of a private extension may be derived
--- indirectly from the ancestor type (i.e., the parent type of the full
--- type may be any descendant of the ancestor type). Check that, for
--- a primitive subprogram of the private extension that is inherited from
--- the ancestor type and not overridden, the formal parameter names and
--- default expressions come from the corresponding primitive subprogram
--- of the ancestor type, while the body comes from that of the parent
--- type. Check both dispatching and non-dispatching cases.
---
--- TEST DESCRIPTION:
--- Consider:
---
--- package P is
--- type Ancestor is tagged ...
--- procedure Op (P1: Ancestor; P2: Boolean := True);
--- end P;
---
--- with P;
--- package Q is
--- type Derived is new P.Ancestor with ...
--- procedure Op (X: Ancestor; Y: Boolean := False);
--- end Q;
---
--- with P, Q;
--- package R is
--- type Priv_Ext is new P.Ancestor with private; -- (A)
--- -- Inherits procedure Op (P1: Priv_Ext; P2: Boolean := True);
--- -- But body executed is that of Q.Op.
--- private
--- type Priv_Ext is new Q.Derived with record ... -- (B)
--- end R;
---
--- The ancestor type in (A) differs from the parent type in (B); the
--- parent of the full type is descended from the ancestor type of the
--- private extension. For a call to Op (from outside the scope of the
--- full view) with an operand of type Priv_Ext, the formal parameter
--- names and default expression come from that of P.Op (the ancestor
--- type's version), but the body executed will be that of
--- Q.Op (the parent type's version)
---
--- One half of the test mirrors the above template, where an inherited
--- subprogram (Set_Display) is called using the formal parameter
--- name (C) and default parameter expression of the ancestor type's
--- version (type Clock), but the version of the body executed is from
--- the parent type.
---
--- The test also includes an examination of the dynamic evaluation
--- case, where correct body associations are required through dispatching
--- calls. As described for the non-dispatching case above, the formal
--- parameter name and default values of the ancestor type's (Phone)
--- version of the inherited subprogram (Answer) are used in the
--- dispatching call, but the body executed is from the parent type.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C730001_0 is
-
- type Display_Kind is (None, Analog, Digital);
- type Illumination_Type is (None, Light, Phosphorescence);
- type Capability_Type is (Available, In_Use, Call_Waiting, Conference);
- type Indicator_Type is (None, Light, Bell, Buzzer, Click, Modem);
-
- type Clock is abstract tagged record -- ancestor type associated
- Display : Display_Kind := None; -- with non-dispatching case.
- Illumination : Illumination_Type := None;
- end record;
-
- type Phone is tagged record -- ancestor type associated
- Status : Capability_Type := Available; -- with dispatching case.
- Indicator : Indicator_Type := None;
- end record;
-
- -- The Set_Display procedure for type Clock implements a basic, no-frills
- -- clock display.
- procedure Set_Display (C : in out Clock;
- Disp: in Display_Kind := Digital);
-
- -- The Answer procedure for type Phone implements a phone status change
- -- operation.
- procedure Answer (The_Phone : in out Phone;
- Ind : in Indicator_Type := Light);
- -- ...Other general clock and/or phone operations (not specified in this
- -- test scenario).
-
-end C730001_0;
-
-
- --==================================================================--
-
-
-package body C730001_0 is
-
- procedure Set_Display (C : in out Clock;
- Disp: in Display_Kind := Digital) is
- begin
- C.Display := Disp;
- C.Illumination := Light;
- end Set_Display;
-
- procedure Answer (The_Phone : in out Phone;
- Ind : in Indicator_Type := Light) is
- begin
- The_Phone.Status := In_Use;
- The_Phone.Indicator := Ind;
- end Answer;
-
-end C730001_0;
-
-
- --==================================================================--
-
-
-with C730001_0; use C730001_0;
-package C730001_1 is
-
- type Power_Supply_Type is (Spring, Battery, AC_Current);
- type Speaker_Type is (None, Present, Adjustable, Stereo);
-
- type Wall_Clock is new Clock with record
- Power_Source : Power_Supply_Type := Spring;
- end record;
-
- type Office_Phone is new Phone with record
- Speaker : Speaker_Type := Present;
- end record;
-
- -- Note: Both procedures below, parameter names and defaults differ from
- -- parent's version.
-
- -- The Set_Display procedure for type Wall_Clock improves upon the
- -- basic Set_Display procedure of type Clock.
-
- procedure Set_Display (WC: in out Wall_Clock;
- D : in Display_Kind := Analog);
-
- procedure Answer (OP : in out Office_Phone;
- OI : in Indicator_Type := Buzzer);
-
- -- ...Other wall clock and/or Office_Phone operations (not specified in
- -- this test scenario).
-
-end C730001_1;
-
-
- --==================================================================--
-
-
-package body C730001_1 is
-
- -- Note: This body is the one that should be executed in the test block
- -- below, not the version of the body corresponding to type Clock.
-
- procedure Set_Display (WC: in out Wall_Clock;
- D : in Display_Kind := Analog) is
- begin
- WC.Display := D;
- WC.Illumination := Phosphorescence;
- end Set_Display;
-
-
- procedure Answer (OP : in out Office_Phone;
- OI : in Indicator_Type := Buzzer) is
- begin
- OP.Status := Call_Waiting;
- OP.Indicator := OI;
- end Answer;
-
-end C730001_1;
-
-
- --==================================================================--
-
-
-with C730001_0; use C730001_0;
-with C730001_1; use C730001_1;
-package C730001_2 is
-
- type Alarm_Type is (Buzzer, Radio, Both);
- type Video_Type is (None, TV_Monitor, Wall_Projection);
-
- type Alarm_Clock is new Clock with private;
- -- Inherits proc Set_Display (C : in out Clock;
- -- Disp: in Display_Kind := Digital); -- (A)
- --
- -- Would also inherit other general clock operations (if present).
-
-
- type Conference_Room_Phone is new Office_Phone with record
- Display : Video_Type := TV_Monitor;
- end record;
-
- procedure Answer (CP : in out Conference_Room_Phone;
- CI : in Indicator_Type := Modem);
-
-
- function TC_Get_Display (C: Alarm_Clock) return Display_Kind;
- function TC_Get_Display_Illumination (C: Alarm_Clock)
- return Illumination_Type;
-
-private
-
- -- ...however, certain of the wall clock's operations (Set_Display, in
- -- this example) improve on the implementations provided for the general
- -- clock. We want to call the improved implementations, so we
- -- derive from Wall_Clock in the private part.
-
- type Alarm_Clock is new Wall_Clock with record
- Alarm : Alarm_Type := Buzzer;
- end record;
-
- -- Inherits proc Set_Display (WC: in out Wall_Clock;
- -- D : in Display_Kind := Analog); -- (B)
-
- -- The implicit Set_Display at (B) overrides the implicit Set_Display at
- -- (A), but only within the scope of the full view.
- --
- -- Outside the scope of the full view, only (A) is visible, so calls
- -- from outside the scope will get the formal parameter names and default
- -- from (A). Both inside and outside the scope, however, the body executed
- -- will be that corresponding to Set_Display of the parent type.
-
-end C730001_2;
-
-
- --==================================================================--
-
-
-package body C730001_2 is
-
- procedure Answer (CP : in out Conference_Room_Phone;
- CI : in Indicator_Type := Modem)is
- begin
- CP.Status := Conference;
- CP.Indicator := CI;
- end Answer;
-
-
- function TC_Get_Display (C: Alarm_Clock) return Display_Kind is
- begin
- return C.Display;
- end TC_Get_Display;
-
-
- function TC_Get_Display_Illumination (C: Alarm_Clock)
- return Illumination_Type is
- begin
- return C.Illumination;
- end TC_Get_Display_Illumination;
-
-end C730001_2;
-
-
- --==================================================================--
-
-
-with C730001_0; use C730001_0;
-with C730001_1; use C730001_1;
-with C730001_2; use C730001_2;
-
-package C730001_3 is
-
- -- Types extended from the ancestor (Phone) type in the specification.
-
- type Secure_Phone_Type is new Phone with private;
- type Auditorium_Phone_Type is new Phone with private;
- -- Inherit versions of Answer from ancestor (Phone).
-
- function TC_Get_Phone_Status (P : Phone'Class) return Capability_Type;
- function TC_Get_Indicator (P : Phone'Class) return Indicator_Type;
-
-private
-
- -- Types extended from descendents of Phone_Type in the private part.
-
- type Secure_Phone_Type is new Office_Phone with record
- Scrambled_Communication : Boolean := True;
- end record;
-
- type Auditorium_Phone_Type is new Conference_Room_Phone with record
- Volume_Control : Boolean := True;
- end record;
-
-end C730001_3;
-
- --==================================================================--
-
-package body C730001_3 is
-
- function TC_Get_Phone_Status (P : Phone'Class) return Capability_Type is
- begin
- return P.Status;
- end TC_Get_Phone_Status;
-
- function TC_Get_Indicator (P : Phone'Class) return Indicator_Type is
- begin
- return P.Indicator;
- end TC_Get_Indicator;
-
-end C730001_3;
-
- --==================================================================--
-
-with C730001_0; use C730001_0;
-with C730001_1; use C730001_1;
-with C730001_2; use C730001_2;
-with C730001_3; use C730001_3;
-
-with Report;
-
-procedure C730001 is
-begin
-
- Report.Test ("C730001","Check that the full view of a private extension " &
- "may be derived indirectly from the ancestor " &
- "type. Check that, for a primitive subprogram " &
- "of the private extension that is inherited from " &
- "the ancestor type and not overridden, the " &
- "formal parameter names and default expressions " &
- "come from the corresponding primitive " &
- "subprogram of the ancestor type, while the body " &
- "comes from that of the parent type");
-
- Test_Block:
- declare
-
- Alarm : Alarm_Clock;
- Hot_Line : Secure_Phone_Type;
- TeleConference_Phone : Auditorium_Phone_Type;
-
- begin
-
- -- Evaluate non-dispatching case:
-
- -- Call Set_Display using formal parameter name from
- -- C730001_0.Set_Display.
- -- Give no 2nd parameter so that default expression must be used.
-
- Set_Display (C => Alarm);
-
- -- The value of the Display component should equal Digital, which is
- -- the default value from the ancestor's version of Set_Display,
- -- and not the default value from the parent's version of Set_Display.
-
- if TC_Get_Display (Alarm) /= Digital then
- Report.Failed ("Default expression for ancestor op not used " &
- "in non-dispatching case");
- end if;
-
- -- However, the value of the Illumination component should equal
- -- Phosphorescence, which is assigned in the parent type's version of
- -- the body of Set_Display.
-
- if TC_Get_Display_Illumination (Alarm) /= Phosphorescence then
- Report.Failed ("Wrong body was executed in non-dispatching case");
- end if;
-
-
- -- Evaluate dispatching case:
- declare
-
- Hot_Line : Secure_Phone_Type;
- TeleConference_Phone : Auditorium_Phone_Type;
-
- procedure Answer_The_Phone (P : in out Phone'Class) is
- begin
- -- Give no 2nd parameter so that default expression must be used.
- Answer (P);
- end Answer_The_Phone;
-
- begin
-
- Answer_The_Phone (Hot_Line);
- Answer_The_Phone (TeleConference_Phone);
-
- -- The value of the Indicator field shold equal "Light", the default
- -- value from the ancestor's version of Answer, and not the default
- -- from either of the parent versions of Answer.
-
- if TC_Get_Indicator(Hot_Line) /= Light or
- TC_Get_Indicator(TeleConference_Phone) /= Light
- then
- Report.Failed("Default expression from ancestor operation " &
- "not used in dispatching case");
- end if;
-
- -- However, the value of the Status component should equal
- -- Call_Waiting or Conference respectively, based on the assignment
- -- in the parent type's version of the body of Answer.
-
- if TC_Get_Phone_Status(Hot_Line) /= Call_Waiting then
- Report.Failed("Wrong body executed in dispatching case - 1");
- end if;
-
- if TC_Get_Phone_Status(TeleConference_Phone) /= Conference then
- Report.Failed("Wrong body executed in dispatching case - 2");
- end if;
-
- end;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end C730001;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c730002.a b/gcc/testsuite/ada/acats/tests/c7/c730002.a
deleted file mode 100644
index 9213a7d92d3..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c730002.a
+++ /dev/null
@@ -1,383 +0,0 @@
--- C730002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the full view of a private extension may be derived
--- indirectly from the ancestor type (i.e., the parent type of the full
--- type may be any descendant of the ancestor type). Check that, for
--- a primitive subprogram of the private extension that is inherited from
--- the ancestor type and not overridden, the formal parameter names and
--- default expressions come from the corresponding primitive subprogram
--- of the ancestor type, while the body comes from that of the parent
--- type.
--- Check for a case where the parent type is derived from the ancestor
--- type through a series of types produced by generic instantiations.
--- Examine both the static and dynamic binding cases.
---
--- TEST DESCRIPTION:
--- Consider:
---
--- package P is
--- type Ancestor is tagged ...
--- procedure Op (P1: Ancestor; P2: Boolean := True);
--- end P;
---
--- with P;
--- generic
--- type T is new P.Ancestor with private;
--- package Gen1 is
--- type Enhanced is new T with private;
--- procedure Op (A: Enhanced; B: Boolean := True);
--- -- other specific procedures...
--- private
--- type Enhanced is new T with ...
--- end Gen1;
---
--- with P, Gen1;
--- package N is new Gen1 (P.Ancestor);
---
--- with N;
--- generic
--- type T is new N.Enhanced with private;
--- package Gen2 is
--- type Enhanced_Again is new T with private;
--- procedure Op (X: Enhanced_Again; Y: Boolean := False);
--- -- other specific procedures...
--- private
--- type Enhanced_Again is new T with ...
--- end Gen2;
---
--- with N, Gen2;
--- package Q is new Gen2 (N.Enhanced);
---
--- with P, Q;
--- package R is
--- type Priv_Ext is new P.Ancestor with private; -- (A)
--- -- Inherits procedure Op (P1: Priv_Ext; P2: Boolean := True);
--- -- But body executed is that of Q.Op.
--- private
--- type Priv_Ext is new Q.Enhanced_Again with record ... -- (B)
--- end R;
---
--- The ancestor type in (A) differs from the parent type in (B); the
--- parent of the full type is descended from the ancestor type of the
--- private extension, in this case through a series of types produced
--- by generic instantiations. Gen1 redefines the implementation of Op
--- for any type that has one. N is an instance of Gen1 for the ancestor
--- type. Gen2 again redefines the implementation of Op for any type that
--- has one. Q is an instance of Gen2 for the extension of the P.Ancestor
--- declared in N. Both N and Q could define other operations which we
--- don't want to be available in R. For a call to Op (from outside the
--- scope of the full view) with an operand of type R.Priv_Ext, the body
--- executed will be that of Q.Op (the parent type's version), but the
--- formal parameter names and default expression come from that of P.Op
--- (the ancestor type's version).
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 27 Feb 97 CTA.PWB Added elaboration pragmas.
---!
-
-package C730002_0 is
-
- type Hours_Type is range 0..1000;
- type Personnel_Type is range 0..10;
- type Specialist_ID is (Manny, Moe, Jack, Curly, Joe, Larry);
-
- type Engine_Type is tagged record
- Ave_Repair_Time : Hours_Type := 0; -- Default init. for
- Personnel_Required : Personnel_Type := 0; -- component fields.
- Specialist : Specialist_ID := Manny;
- end record;
-
- procedure Routine_Maintenance (Engine : in out Engine_Type ;
- Specialist : in Specialist_ID := Moe);
-
- -- The Routine_Maintenance procedure implements the processing required
- -- for an engine.
-
-end C730002_0;
-
- --==================================================================--
-
-package body C730002_0 is
-
- procedure Routine_Maintenance (Engine : in out Engine_Type ;
- Specialist : in Specialist_ID := Moe) is
- begin
- Engine.Ave_Repair_Time := 3;
- Engine.Personnel_Required := 1;
- Engine.Specialist := Specialist;
- end Routine_Maintenance;
-
-end C730002_0;
-
- --==================================================================--
-
-with C730002_0; use C730002_0;
-generic
- type T is new C730002_0.Engine_Type with private;
-package C730002_1 is
-
- -- This generic package contains types/procedures specific to engines
- -- of the diesel variety.
-
- type Repair_Facility_Type is (On_Site, Repair_Shop, Factory);
-
- type Diesel_Series is new T with private;
-
- procedure Routine_Maintenance (Eng : in out Diesel_Series;
- Spec_Req : in Specialist_ID := Jack);
-
- -- Other diesel specific operations... (not required in this test).
-
-private
-
- type Diesel_Series is new T with record
- Repair_Facility_Required : Repair_Facility_Type := On_Site;
- end record;
-
-end C730002_1;
-
- --==================================================================--
-
-package body C730002_1 is
-
- procedure Routine_Maintenance (Eng : in out Diesel_Series;
- Spec_Req : in Specialist_ID := Jack) is
- begin
- Eng.Ave_Repair_Time := 6;
- Eng.Personnel_Required := 2;
- Eng.Specialist := Spec_Req;
- Eng.Repair_Facility_Required := On_Site;
- end Routine_Maintenance;
-
-end C730002_1;
-
- --==================================================================--
-
-with C730002_0;
-with C730002_1;
-pragma Elaborate (C730002_1);
-package C730002_2 is new C730002_1 (C730002_0.Engine_Type);
-
- --==================================================================--
-
-with C730002_0; use C730002_0;
-with C730002_2; use C730002_2;
-generic
- type T is new C730002_2.Diesel_Series with private;
-package C730002_3 is
-
- type Time_Of_Operation_Type is range 0..100_000;
-
- type Electric_Series is new T with private;
-
- procedure Routine_Maintenance (E : in out Electric_Series;
- SR : in Specialist_ID := Curly);
-
- -- Other electric specific operations... (not required in this test).
-
-private
-
- type Electric_Series is new T with record
- Mean_Time_Between_Repair : Time_Of_Operation_Type := 0;
- end record;
-
-end C730002_3;
-
- --==================================================================--
-
-package body C730002_3 is
-
- procedure Routine_Maintenance (E : in out Electric_Series;
- SR : in Specialist_ID := Curly) is
- begin
- E.Ave_Repair_Time := 9;
- E.Personnel_Required := 3;
- E.Specialist := SR;
- E.Mean_Time_Between_Repair := 1000;
- end Routine_Maintenance;
-
-end C730002_3;
-
- --==================================================================--
-
-with C730002_2;
-with C730002_3;
-pragma Elaborate (C730002_3);
-package C730002_4 is new C730002_3 (C730002_2.Diesel_Series);
-
- --==================================================================--
-
-with C730002_0; use C730002_0;
-with C730002_4; use C730002_4;
-
-package C730002_5 is
-
- type Inspection_Type is (AAA, MIL_STD, NRC);
-
- type Nuclear_Series is new Engine_Type with private; -- (A)
-
- -- Inherits procedure Routine_Maintenance from ancestor; does not override.
- -- (Engine : in out Nuclear_Series;
- -- Specialist : in Specialist_ID := Moe);
- -- But body executed will be that of C730002_4.Routine_Maintenance,
- -- the parent type.
-
- function TC_Specialist (E : Nuclear_Series) return Specialist_ID;
- function TC_Personnel_Required (E : Nuclear_Series) return Personnel_Type;
- function TC_Time_Required (E : Nuclear_Series) return Hours_Type;
-
- -- Dispatching subprogram.
- procedure Maintain_The_Engine (The_Engine : in out Engine_Type'Class);
-
-private
-
- type Nuclear_Series is new Electric_Series with record -- (B)
- Inspector_Rep : Inspection_Type := NRC;
- end record;
-
- -- The ancestor type is used in the type extension (A), while the parent
- -- of the full type (B) is a descendent of the ancestor type, through a
- -- series of types produced by generic instantiation.
-
-end C730002_5;
-
- --==================================================================--
-
-package body C730002_5 is
-
- function TC_Specialist (E : Nuclear_Series) return Specialist_ID is
- begin
- return E.Specialist;
- end TC_Specialist;
-
- function TC_Personnel_Required (E : Nuclear_Series)
- return Personnel_Type is
- begin
- return E.Personnel_Required;
- end TC_Personnel_Required;
-
- function TC_Time_Required (E : Nuclear_Series) return Hours_Type is
- begin
- return E.Ave_Repair_Time;
- end TC_Time_Required;
-
- -- Dispatching subprogram.
- procedure Maintain_The_Engine (The_Engine : in out Engine_Type'Class) is
- begin
- Routine_Maintenance (The_Engine);
- end Maintain_The_Engine;
-
-
-end C730002_5;
-
- --==================================================================--
-
-with Report;
-with C730002_0; use C730002_0;
-with C730002_2; use C730002_2;
-with C730002_4; use C730002_4;
-with C730002_5; use C730002_5;
-
-procedure C730002 is
-begin
-
- Report.Test ("C730002", "Check that the full view of a private " &
- "extension may be derived indirectly from " &
- "the ancestor type. Check for a case where " &
- "the parent type is derived from the ancestor " &
- "type through a series of types produced by " &
- "generic instantiations");
-
- Test_Block:
- declare
- Nuclear_Drive : Nuclear_Series;
- Warp_Drive : Nuclear_Series;
- begin
-
- -- Non-Dispatching Case:
- -- Call Routine_Maintenance using formal parameter name from
- -- C730002_0.Routine_Maintenance (ancestor version).
- -- Give no second parameter so that the default expression must be
- -- used.
-
- Routine_Maintenance (Engine => Nuclear_Drive);
-
- -- The value of the Specialist component should equal "Moe",
- -- which is the default value from the ancestor's version of
- -- Routine_Maintenance, and not the default value from the parent's
- -- version of Routine_Maintenance.
-
- if TC_Specialist (Nuclear_Drive) /= Moe then
- Report.Failed
- ("Default expression for ancestor op not used " &
- " - non-dispatching case");
- end if;
-
- -- However the value of the Ave_Repair_Time and Personnel_Required
- -- components should be those assigned in the parent type's version
- -- of the body of Routine_Maintenance.
- -- Note: Only components associated with the ancestor type are
- -- evaluated for the purposes of this test.
-
- if TC_Personnel_Required (Nuclear_Drive) /= 3 or
- TC_Time_Required (Nuclear_Drive) /= 9
- then
- Report.Failed("Wrong body was executed - non-dispatching case");
- end if;
-
- -- Dispatching Case:
- -- Use a dispatching subprogram to ensure that the correct body is
- -- used at runtime.
-
- Maintain_The_Engine (Warp_Drive);
-
- -- The resulting assignments to the fields of the Warp_Drive variable
- -- should be the same as those of the Nuclear_Drive above, indicating
- -- that the body of the parent version of the inherited subprogram
- -- was used.
-
- if TC_Specialist (Warp_Drive) /= Moe then
- Report.Failed
- ("Default expression for ancestor op not used - dispatching case");
- end if;
-
- if TC_Personnel_Required (Nuclear_Drive) /= 3 or
- TC_Time_Required (Nuclear_Drive) /= 9
- then
- Report.Failed("Wrong body was executed - dispatching case");
- end if;
-
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end C730002;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c730003.a b/gcc/testsuite/ada/acats/tests/c7/c730003.a
deleted file mode 100644
index 47002f3aa8b..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c730003.a
+++ /dev/null
@@ -1,283 +0,0 @@
--- C730003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
--- F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
--- software and documentation contained herein. Unlimited rights are
--- defined in DFAR 252.227-7013(a)(19). By making this public release,
--- the Government intends to confer upon all recipients unlimited rights
--- equal to those held by the Government. These rights include rights to
--- use, duplicate, release or disclose the released technical data and
--- computer software in whole or in part, in any manner and for any purpose
--- whatsoever, and to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the characteristics of a type derived from a private
--- extension (outside the scope of the full view) are those defined by
--- the partial view of the private extension.
--- In particular, check that a component of the derived type may be
--- explicitly declared with the same name as a component declared for
--- the full view of the private extension.
--- Check that a component defined in the private extension of a type
--- may be updated through a view conversion of a type derived from
--- the type.
---
--- TEST DESCRIPTION:
--- Consider:
---
--- package Parent is
--- type T is tagged record
--- ...
--- end record;
---
--- type DT is new T with private;
--- procedure Op1 (P: in out DT);
---
--- private
--- type DT is new T with record
--- Y: ...; -- (A)
--- end record;
--- end Parent;
---
--- package body Parent is
--- function Op1 (P: in DT) return ... is
--- begin
--- return P.Y;
--- end Op1;
--- end Parent;
---
--- package Unrelated is
--- type Intermediate is new DT with record
--- Y: ...; -- Note: same name as component of -- (B)
--- -- parent's full view.
--- end record;
--- end Unrelated;
---
--- package Parent.Child is
--- type DDT is new Intermediate with null record;
--- -- Implicit declared Op1 (P.DDT); -- (C)
---
--- procedure Op2 (P: in out DDT);
--- end Parent.Child;
---
--- package body Parent.Child is
--- procedure Op2 (P: in out DDT) is
--- Obj : DT renames DT(P);
--- begin
--- ...
--- P.Y := ...; -- Updates DDT's Y. -- (D)
--- DT(P).Y := ...; -- Updates DT's Y. -- (E)
--- Obj.Y := ...; -- Updates DT's Y. -- (F)
--- end Op2;
--- end Parent.Child;
---
--- Types DT and DDT both declare a component Y at (A) and (B),
--- respectively. The component Y of the full view of DT is not visible
--- at the place where DDT is declared. Therefore, it is invisible for
--- all views of DDT (although it still exists for objects of DDT), and
--- it is legal to declare another component for DDT with the same name.
---
--- DDT inherits the primitive subprogram Op1 from DT at (C). Op1 returns
--- the component Y; for calls with an operand of type DDT, Op1 returns
--- the Y inherited from DT, not the new Y explicitly declared for DDT,
--- even though the inherited Y is not visible for any view of DDT.
---
--- Within the body of Op2, the assignment statement at (D) updates the
--- Y explicitly declared for DDT. At (E) and (F), however, a view
--- conversion denotes a new view of P as an object of type DT, which
--- enables access to the Y from the full view of DT. Thus, the
--- assignment statements at (E) and (F) update the (invisible) Y from DT.
---
--- Note that the above analysis would be wrong if the new component Y
--- were declared directly in Child. In that case, the two same-named
--- components would be illegal -- see AI-150.
---
---
--- CHANGE HISTORY:
--- 06 Dec 1994 SAIC ACVC 2.0
--- 29 JUN 1999 RAD Declare same-named component in an
--- unrelated package -- see AI-150.
---
---!
-
-package C730003_0 is
-
- type Suit_Kind is (Clubs, Diamonds, Hearts, Spades);
- type Face_Kind is (Up, Down);
-
- type Playing_Card is tagged record
- Face: Face_Kind;
- Suit: Suit_Kind;
- end record;
-
- procedure Turn_Over_Card (Card : in out Playing_Card);
-
- type Disp_Card is new Playing_Card with private;
-
- subtype ASCII_Representation is Natural range 1..14;
-
- function Get_Private_View (A_Card : Disp_Card) return ASCII_Representation;
-
-private
-
- type Disp_Card is new Playing_Card with record
- View: ASCII_Representation; -- (A)
- end record;
-
-end C730003_0;
-
---==================================================================--
-
-package body C730003_0 is
-
- procedure Turn_Over_Card (Card: in out Playing_Card) is
- begin
- Card.Face := Up;
- end Turn_Over_Card;
-
- function Get_Private_View (A_Card : Disp_Card)
- return ASCII_Representation is
- begin
- return A_Card.View;
- end Get_Private_View;
-
-end C730003_0;
-
---==================================================================--
-
-with C730003_0; use C730003_0;
-package C730003_1 is
-
- subtype Graphic_Representation is String (1 .. 2);
-
- type Graphic_Card is new Disp_Card with record
- View : Graphic_Representation; -- (B)
- -- "Duplicate" component field name.
- end record;
-
-end C730003_1;
-
---==================================================================--
-
-with C730003_1; use C730003_1;
-package C730003_0.C730003_2 is
-
- Queen_Of_Spades : constant C730003_0.ASCII_Representation := 12;
- Ace_Of_Hearts : constant String := "AH";
- Close_To_The_Vest : constant C730003_0.ASCII_Representation := 14;
- Read_Em_And_Weep : constant String := "AA";
-
- type Graphic_Card is new C730003_1.Graphic_Card with null record;
-
- -- Implicit function Get_Private_View -- (C)
- -- (A_Card : Graphic_Card) return C730003_0.ASCII_Representation;
-
- function Get_View (Card : Graphic_Card) return String;
- procedure Update_View (Card : in out Graphic_Card);
- procedure Hide_From_View (Card : in out Graphic_Card);
-
-end C730003_0.C730003_2;
-
---==================================================================--
-
-package body C730003_0.C730003_2 is
-
- function Get_View (Card : Graphic_Card) return String is
- begin
- return Card.View;
- end Get_View;
-
- procedure Update_View (Card : in out Graphic_Card) is
- ASCII_View : Disp_Card renames Disp_Card(Card); -- View conversion.
- begin
- ASCII_View.View := Queen_Of_Spades; -- (F)
- -- Assignment to "hidden" field.
- Card.View := Ace_Of_Hearts; -- (D)
- -- Assignment to Graphic_Card declared field.
- end Update_View;
-
- procedure Hide_From_View (Card : in out Graphic_Card) is
- begin
- -- Update both of Card's View components.
- Disp_Card(Card).View := Close_To_The_Vest; -- (E)
- -- Assignment to "hidden" field.
- Card.View := Read_Em_And_Weep; -- (D)
- -- Assignment to Graphic_Card declared field.
- end Hide_From_View;
-
-end C730003_0.C730003_2;
-
---==================================================================--
-
-with C730003_0;
-with C730003_0.C730003_2;
-with Report;
-
-procedure C730003 is
-begin
-
- Report.Test ("C730003", "Check that the characteristics of a type " &
- "derived from a private extension (outside " &
- "the scope of the full view) are those " &
- "defined by the partial view of the private " &
- "extension");
-
- Check_Your_Cards:
- declare
- use C730003_0;
- use C730003_0.C730003_2;
-
- Top_Card_On_The_Deck : Graphic_Card;
-
- begin
-
- -- Update value in the components of the card. There are two
- -- component fields named View, although one is not visible for
- -- any view of a Graphic_Card.
-
- Update_View(Top_Card_On_The_Deck);
-
- -- Verify that both "View" components of the card have been updated.
-
- if Get_View(Top_Card_On_The_Deck) /= Ace_Of_Hearts then
- Report.Failed ("Incorrect value in visible component - 1");
- end if;
-
- if Get_Private_View(Top_Card_On_The_Deck) /= Queen_Of_Spades
- then
- Report.Failed ("Incorrect value in non-visible component - 1");
- end if;
-
- -- Again, update the components of the card (to blank values).
-
- Hide_From_View(Top_Card_On_The_Deck);
-
- -- Verify that both components have been updated.
-
- if Get_View(Top_Card_On_The_Deck) /= Read_Em_And_Weep then
- Report.Failed ("Incorrect value in visible component - 2");
- end if;
-
- if Get_Private_View(Top_Card_On_The_Deck) /= Close_To_The_Vest
- then
- Report.Failed ("Incorrect value in non-visible component - 2");
- end if;
-
- exception
- when others => Report.Failed("Exception raised in test block");
- end Check_Your_Cards;
-
- Report.Result;
-
-end C730003;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c730004.a b/gcc/testsuite/ada/acats/tests/c7/c730004.a
deleted file mode 100644
index c2a23230ad2..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c730004.a
+++ /dev/null
@@ -1,327 +0,0 @@
--- C730004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that for a type declared in a package, descendants of the package
--- use the full view of type. Specifically check that full view of the
--- limited type is visible only in private descendants (children) and in
--- the private parts and bodies of public descendants (children).
--- Check that a limited type may be used as an out parameter outside
--- the package that defines the type.
---
--- TEST DESCRIPTION:
--- This test defines a parent package containing limited private type
--- definitions. Children packages are defined (one public, one private)
--- that use the nonlimited full view of the types defined in the private
--- part of the parent specification.
--- The main declares a procedure with an out parameter that was defined
--- as limited in the specification of the parent package.
---
---
--- CHANGE HISTORY:
--- 15 Sep 95 SAIC Initial prerelease version.
--- 23 Apr 96 SAIC Added prefix for parameter in Call_Modify_File.
--- 02 Nov 96 SAIC ACVC 2.1: Modified prologue and Test.Report.
---
---!
-
-package C730004_0 is
-
- -- Full views of File_Descriptor, File_Mode, File_Name, and File_Type are
- -- are nonlimited.
-
- type File_Descriptor is limited private;
-
- type File_Mode is limited private;
-
- Active_Mode : constant File_Mode;
-
- type File_Name is limited private;
-
- type File_Type is limited private;
-
- function Next_Available_File return File_Descriptor;
-
-private
-
- type File_Descriptor is new Integer;
-
- Null_File : constant File_Descriptor := 0;
- First_File : constant File_Descriptor := 1;
-
- type File_Mode is
- (Read_Only, Write_Only, Read_Write, Archived, Corrupt, Lost);
-
- Default_Mode : constant File_Mode := Read_Only;
- Active_Mode : constant File_Mode := Read_Write;
-
- type File_Name is array (1 .. 6) of Character;
-
- Null_String : File_Name := " ";
- String1 : File_Name := "ACVC ";
- String2 : File_Name := " 1995";
-
- type File_Type is
- record
- Descriptor : File_Descriptor := Null_File;
- Mode : File_Mode := Default_Mode;
- Name : File_Name := Null_String;
- end record;
-
-end C730004_0;
-
- --=================================================================--
-
-package body C730004_0 is
-
- File_Count : Integer := 0;
-
- function Next_Available_File return File_Descriptor is
- begin
- File_Count := File_Count + 1;
- return (File_Descriptor(File_Count)); -- Type conversion.
- end Next_Available_File;
-
-end C730004_0;
-
- --=================================================================--
-
-private
-package C730004_0.C730004_1 is -- private child
-
- -- Since full view of the nontagged File_Name is nonlimited in the parent
- -- package, it is not limited in the private child, so concatenation is
- -- available.
-
- System_File_Name : constant File_Name
- := String1(1..4) & String2(5..6);
-
- -- Since full view of the nontagged File_Type is nonlimited in the parent
- -- package, it is not limited in the private child, so a default expression
- -- is available.
-
- function New_File_Validated (File : File_Type
- := (Descriptor => First_File,
- Mode => Active_Mode,
- Name => System_File_Name))
- return Boolean;
-
- -- Since full view of the nontagged File_Type is nonlimited in the parent
- -- package, it is not limited in the private child, so initialization
- -- expression in an object declaration is available.
-
- System_File : File_Type
- := (Null_File, Read_Only, System_File_Name);
-
-
-end C730004_0.C730004_1;
-
- --=================================================================--
-
-package body C730004_0.C730004_1 is
-
- function New_File_Validated (File : File_Type
- := (Descriptor => First_File,
- Mode => Active_Mode,
- Name => System_File_Name))
- return Boolean is
- Result : Boolean := False;
- begin
- if (File.Descriptor > System_File.Descriptor) and
- (File.Mode in Read_Only .. Read_Write) and (File.Name = "ACVC95")
- then
- Result := True;
- end if;
-
- return (Result);
-
- end New_File_Validated;
-
-end C730004_0.C730004_1;
-
- --=================================================================--
-
-package C730004_0.C730004_2 is -- public child
-
- -- File_Type is limited here.
-
- procedure Create_File (File : out File_Type);
-
- procedure Modify_File (File : out File_Type);
-
- type File_Dir is limited private;
-
- -- The following three validation functions provide the capability to
- -- check the limited private types defined in the parent and the
- -- private child package from within the client program.
-
- function Validate_Create (File : in File_Type) return Boolean;
-
- function Validate_Modification (File : in File_Type)
- return Boolean;
-
- function Validate_Dir (Dir : in File_Dir) return Boolean;
-
-private
-
- -- Since full view of the nontagged File_Type is nonlimited in the parent
- -- package, it is not limited in the private part of the public child, so
- -- aggregates are available.
-
- Child_File : File_Type
- := File_Type'(Descriptor => Null_File,
- Mode => Write_Only,
- Name => String2);
-
- -- Since full view of the nontagged component File_Type is nonlimited in
- -- the parent package, it is not limited in the private part of the public
- -- child, so default expressions are available.
-
- type File_Dir is
- record
- Comp : File_Type := Child_File;
- end record;
-
-end C730004_0.C730004_2;
-
- --=================================================================--
-
-with C730004_0.C730004_1;
-
-package body C730004_0.C730004_2 is
-
- procedure Create_File (File : out File_Type) is
- New_File : File_Type;
-
- begin
- New_File.Descriptor := Next_Available_File;
- New_File.Mode := Default_Mode;
- New_File.Name := C730004_0.C730004_1.System_File_Name;
-
- if C730004_0.C730004_1.New_File_Validated (New_File) then
- File := New_File;
- else
- File := (Null_File, Lost, "MISSED");
- end if;
-
- end Create_File;
-
- --------------------------------------------------------------
- procedure Modify_File (File : out File_Type) is
- begin
- File.Descriptor := Next_Available_File;
- File.Mode := Active_Mode;
- File.Name := String1;
- end Modify_File;
-
- --------------------------------------------------------------
- function Validate_Create (File : in File_Type) return Boolean is
- begin
- if ((File.Descriptor /= Child_File.Descriptor) and
- (File.Mode = Read_Only) and (File.Name = "ACVC95"))
- then
- return True;
- else
- return False;
- end if;
- end Validate_Create;
-
- ------------------------------------------------------------------------
- function Validate_Modification (File : in File_Type)
- return Boolean is
- begin
- if ((File.Descriptor /= C730004_0.C730004_1.System_File.Descriptor) and
- (File.Mode = Read_Write) and (File.Name = "ACVC "))
- then
- return True;
- else
- return False;
- end if;
- end Validate_Modification;
-
- ------------------------------------------------------------------------
- function Validate_Dir (Dir : in File_Dir) return Boolean is
- begin
- if ((Dir.Comp.Descriptor = C730004_0.C730004_1.System_File.Descriptor)
- and (Dir.Comp.Mode = Write_Only) and (Dir.Comp.Name = String2))
- then
- return True;
- else
- return False;
- end if;
- end Validate_Dir;
-
-end C730004_0.C730004_2;
-
- --=================================================================--
-
-with C730004_0.C730004_2;
-with Report;
-
-procedure C730004 is
-
- package File renames C730004_0;
- package File_Ops renames C730004_0.C730004_2;
-
- Validation_File : File.File_Type;
-
- Validation_Dir : File_Ops.File_Dir;
-
- ------------------------------------------------------------------------
- -- Limited File_Type is allowed as an out parameter outside package File.
-
- procedure Call_Modify_File (Modified_File : out File.File_Type) is
- begin
- File_Ops.Modify_File (Modified_File);
- end Call_Modify_File;
-
-begin
-
- Report.Test ("C730004", "Check that for a type declared in a package, " &
- "descendants of the package use the full view " &
- "of the type. Specifically check that full " &
- "view of the limited type is visible only in " &
- "private children and in the private parts and " &
- "bodies of public children");
-
- File_Ops.Create_File (Validation_File);
-
- if not File_Ops.Validate_Create (Validation_File) then
- Report.Failed ("Incorrect creation of file");
- end if;
-
- Call_Modify_File (Validation_File);
-
- if not File_Ops.Validate_Modification (Validation_File) then
- Report.Failed ("Incorrect modification of file");
- end if;
-
- if not File_Ops.Validate_Dir (Validation_Dir) then
- Report.Failed ("Incorrect creation of directory");
- end if;
-
- Report.Result;
-
-end C730004;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c730a01.a b/gcc/testsuite/ada/acats/tests/c7/c730a01.a
deleted file mode 100644
index 43f16f92889..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c730a01.a
+++ /dev/null
@@ -1,176 +0,0 @@
--- C730A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a tagged type declared in a package specification
--- may be passed as a generic formal (tagged) private type to a generic
--- package declaration. Check that the formal type may be extended with
--- a private extension in the generic package.
---
--- Check that, in the instance, the private extension inherits the
--- user-defined primitive subprograms of the tagged actual.
---
--- TEST DESCRIPTION:
--- Declare a tagged type and an associated primitive subprogram in a
--- package specification (foundation code). Declare a generic package
--- which takes a tagged type as a formal parameter, and then extends
--- it with a private extension (foundation code).
---
--- Instantiate the generic package with the tagged type from the first
--- package (the "generic" extension should now have inherited
--- the primitive subprogram of the tagged type from the first
--- package).
---
--- In the main program, call the primitive subprogram inherited by the
--- "generic" extension, and verify the correctness of the components.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F730A000.A
--- F730A001.A
--- => C730A01.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-with F730A001; -- Book definitions.
-package C730A01_0 is -- Raw data to be used in creating book elements.
-
-
- Book_Count : constant := 3;
-
- subtype Number_Of_Books is Integer range 1 .. Book_Count;
-
- type Data_List is array (Number_Of_Books) of F730A001.Text_Ptr;
-
- Title_List : Data_List := (new String'("Wuthering Heights"),
- new String'("Heart of Darkness"),
- new String'("Ulysses"));
-
- Author_List : Data_List := (new String'("Bronte, Emily"),
- new String'("Conrad, Joseph"),
- new String'("Joyce, James"));
-
-end C730A01_0;
-
-
- --==================================================================--
-
-
-
-
- --==================================================================--
-
-
--- Library-level instantiation. Actual parameter is tagged record.
-
-with F730A001; -- Book definitions.
-with F730A000; -- Singly-linked list abstraction.
-package C730A01_1 is new F730A000 (Parent_Type => F730A001.Book_Type);
-
-
- --==================================================================--
-
-
-with Report;
-
-with F730A001; -- Book definitions.
-with C730A01_0; -- Raw book data.
-with C730A01_1; -- Instance.
-
-use F730A001; -- Primitive operations of Book_Type directly visible.
-use C730A01_1; -- Operations inherited by Node_Type directly visible.
-
-procedure C730A01 is
-
-
- List_Of_Books : Priv_Node_Ptr := null; -- Head of linked list of books.
-
-
- --========================================================--
-
-
- procedure Create_List (Title, Author : in C730A01_0.Data_List;
- Head : in out Priv_Node_Ptr) is
-
- Book : Priv_Node_Type; -- Object of extended type.
- Book_Ptr : Priv_Node_Ptr;
-
- begin
- for I in C730A01_0.Number_Of_Books loop
- Create_Book (Title (I), Author (I), Book); -- Call inherited
- -- operation.
- Book_Ptr := new Priv_Node_Type'(Book);
- Add (Book_Ptr, Head);
- end loop;
- end Create_List;
-
-
- --========================================================--
-
-
- function Bad_List_Contents return Boolean is
- Book1_Ptr : Priv_Node_Ptr;
- Book2_Ptr : Priv_Node_Ptr;
- Book3_Ptr : Priv_Node_Ptr;
- begin
- Remove (List_Of_Books, Book1_Ptr);
- Remove (List_Of_Books, Book2_Ptr);
- Remove (List_Of_Books, Book3_Ptr);
- return (Book1_Ptr.Title.all /= "Ulysses" or -- Inherited
- Book1_Ptr.Author.all /= "Joyce, James" or -- components
- Book2_Ptr.Title.all /= "Heart of Darkness" or -- should still
- Book2_Ptr.Author.all /= "Conrad, Joseph" or -- be visible in
- Book3_Ptr.Title.all /= "Wuthering Heights" or -- private
- Book3_Ptr.Author.all /= "Bronte, Emily"); -- extension.
-
- end Bad_List_Contents;
-
-
- --========================================================--
-
-
-begin -- Main program.
-
- Report.Test ("C730A01", "Inheritance of primitive operations: private " &
- "extension of formal tagged private type; actual is " &
- "an ultimate ancestor type");
-
- -- Create linked list using inherited operation:
- Create_List (C730A01_0.Title_List, C730A01_0.Author_List, List_Of_Books);
-
- -- Verify results:
- if Bad_List_Contents then
- Report.Failed ("Wrong values after call to inherited operation");
- end if;
-
- Report.Result;
-
-end C730A01;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c730a02.a b/gcc/testsuite/ada/acats/tests/c7/c730a02.a
deleted file mode 100644
index 97d04b6dbc2..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c730a02.a
+++ /dev/null
@@ -1,252 +0,0 @@
--- C730A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a private extension (declared in a package specification) of
--- a tagged type (declared in a different package specification) may be
--- passed as a generic formal (tagged) private type to a generic package
--- declaration. Check that the formal type may be further extended with a
--- private extension in the generic package.
---
--- Check that the (visible) components inherited by the "generic"
--- extension are visible outside the generic package.
---
--- Check that, in the instance, the private extension inherits the
--- user-defined primitive subprograms of the tagged actual, including
--- those inherited by the actual from its parent.
---
--- TEST DESCRIPTION:
--- Declare a tagged type and an associated primitive subprogram in a
--- package specification (foundation code). Declare a private extension
--- of the tagged type and an associated primitive subprogram in a second
--- package specification. Declare a generic package which takes a tagged
--- type as a formal parameter, and then extends it with a private
--- extension (foundation code).
---
--- Instantiate the generic package with the private extension from the
--- second package (the "generic" extension should now have inherited
--- the primitive subprograms of the private extension from the second
--- package).
---
--- In the main program, call the primitive subprograms inherited by the
--- "generic" extension. There are two: (1) Create_Book, declared for
--- the root tagged type in the first package (inherited by the private
--- extension of the second package, and then in turn by the "generic"
--- extension), and (2) Update_Pages, declared for the private extension
--- in the second package. Verify the correctness of the components.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- F730A000.A
--- F730A001.A
--- => C730A02.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with F730A001; -- Book definitions.
-package C730A02_0 is -- Extended book abstraction.
-
-
- type Detailed_Book_Type is new F730A001.Book_Type -- Private ext.
- with private; -- of root tagged
- -- type.
-
- -- Inherits Create_Book from Book_Type.
-
- procedure Update_Pages (Book : in out Detailed_Book_Type; -- Primitive op.
- Pages : in Natural); -- of extension.
-
-
- -- The following function is needed to verify the value of the
- -- extension's private component. It will be inherited by extensions
- -- of Detailed_Book_Type.
-
- function Get_Pages (Book : in Detailed_Book_Type) return Natural;
-
-private
-
- type Detailed_Book_Type is new F730A001.Book_Type with record
- Pages : Natural;
- end record;
-
-end C730A02_0;
-
-
- --==================================================================--
-
-
-package body C730A02_0 is
-
-
- procedure Update_Pages (Book : in out Detailed_Book_Type;
- Pages : in Natural) is
- begin
- Book.Pages := Pages;
- end Update_Pages;
-
-
- function Get_Pages (Book : in Detailed_Book_Type) return Natural is
- begin
- return (Book.Pages);
- end Get_Pages;
-
-
-end C730A02_0;
-
-
- --==================================================================--
-
-
-with F730A001; -- Book definitions.
-package C730A02_1 is -- Raw data to be used in creating book elements.
-
-
- Book_Count : constant := 3;
-
- subtype Number_Of_Books is Integer range 1 .. Book_Count;
-
- type Data_List is array (Number_Of_Books) of F730A001.Text_Ptr;
- type Page_Counts is array (Number_Of_Books) of Natural;
-
- Title_List : Data_List := (new String'("Wuthering Heights"),
- new String'("Heart of Darkness"),
- new String'("Ulysses"));
-
- Author_List : Data_List := (new String'("Bronte, Emily"),
- new String'("Conrad, Joseph"),
- new String'("Joyce, James"));
-
- Page_List : Page_Counts := (237, 215, 456);
-
-end C730A02_1;
-
-
--- No body for C730A02_1.
-
-
- --==================================================================--
-
-
--- Library-level instantiation. Actual parameter is private extension.
-
-with C730A02_0; -- Extended book abstraction.
-with F730A000; -- Singly-linked list abstraction.
-package C730A02_2 is new F730A000
- (Parent_Type => C730A02_0.Detailed_Book_Type);
-
-
- --==================================================================--
-
-
-with Report;
-
-with C730A02_0; -- Extended book abstraction.
-with C730A02_1; -- Raw book data.
-with C730A02_2; -- Instance.
-
-use C730A02_0; -- Primitive operations of Detailed_Book_Type directly visible.
-use C730A02_2; -- Operations inherited by Priv_Node_Type directly visible.
-
-procedure C730A02 is
-
-
- List_Of_Books : Priv_Node_Ptr := null; -- Head of linked list of books.
-
-
- --========================================================--
-
-
- procedure Create_List (Title, Author : in C730A02_1.Data_List;
- Pages : in C730A02_1.Page_Counts;
- Head : in out Priv_Node_Ptr) is
-
- Book : Priv_Node_Type; -- Object of extended type.
- Book_Ptr : Priv_Node_Ptr;
-
- begin
- for I in C730A02_1.Number_Of_Books loop
- Create_Book (Title (I), Author (I), Book); -- Call twice-inherited
- -- operation.
- Update_Pages (Book, Pages (I)); -- Call inherited op.
- Book_Ptr := new Priv_Node_Type'(Book);
- Add (Book_Ptr, Head);
- end loop;
- end Create_List;
-
-
- --========================================================--
-
-
- function Bad_List_Contents return Boolean is
- Book1_Ptr : Priv_Node_Ptr;
- Book2_Ptr : Priv_Node_Ptr;
- Book3_Ptr : Priv_Node_Ptr;
- begin
-
- Remove (List_Of_Books, Book1_Ptr);
- Remove (List_Of_Books, Book2_Ptr);
- Remove (List_Of_Books, Book3_Ptr);
-
- return (Book1_Ptr.Title.all /= "Ulysses" or -- Inherited
- Book1_Ptr.Author.all /= "Joyce, James" or -- components
- Book2_Ptr.Title.all /= "Heart of Darkness" or -- should still
- Book2_Ptr.Author.all /= "Conrad, Joseph" or -- be visible
- Book3_Ptr.Title.all /= "Wuthering Heights" or -- in private
- Book3_Ptr.Author.all /= "Bronte, Emily" or -- "generic"
- -- extension.
- -- Call inherited operations using dereferenced pointers.
- Get_Pages (Book1_Ptr.all) /= 456 or
- Get_Pages (Book2_Ptr.all) /= 215 or
- Get_Pages (Book3_Ptr.all) /= 237);
-
- end Bad_List_Contents;
-
-
- --========================================================--
-
-
-begin -- Main program.
-
- Report.Test ("C730A02", "Inheritance of primitive operations: private " &
- "extension of formal tagged private type; actual is " &
- "a private extension");
-
- -- Create linked list using inherited operation:
- Create_List (C730A02_1.Title_List, C730A02_1.Author_List,
- C730A02_1.Page_List, List_Of_Books);
-
- -- Verify results:
- if Bad_List_Contents then
- Report.Failed ("Wrong values after call to inherited operations");
- end if;
-
- Report.Result;
-
-end C730A02;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c731001.a b/gcc/testsuite/ada/acats/tests/c7/c731001.a
deleted file mode 100644
index 0cfce32bc95..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c731001.a
+++ /dev/null
@@ -1,407 +0,0 @@
--- C731001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
--- F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
--- software and documentation contained herein. Unlimited rights are
--- defined in DFAR 252.227-7013(a)(19). By making this public release,
--- the Government intends to confer upon all recipients unlimited rights
--- equal to those held by the Government. These rights include rights to
--- use, duplicate, release or disclose the released technical data and
--- computer software in whole or in part, in any manner and for any purpose
--- whatsoever, and to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE
--- Check that inherited operations can be overridden, even when they are
--- inherited in a body.
--- The test cases here are inspired by the AARM examples given in
--- the discussion of AARM-7.3.1(7.a-7.v).
--- This discussion was confirmed by AI95-00035.
---
--- TEST DESCRIPTION
--- See AARM-7.3.1.
---
--- CHANGE HISTORY:
--- 29 JUN 1999 RAD Initial Version
--- 23 SEP 1999 RLB Improved comments, renamed, issued.
--- 20 AUG 2001 RLB Corrected 'verbose' flag.
---
---!
-
-with Report; use Report; pragma Elaborate_All(Report);
-package C731001_1 is
- pragma Elaborate_Body;
-private
- procedure Check_String(X, Y: String);
- function Check_String(X, Y: String) return String;
- -- This one is a function, so we can call it in package specs.
-end C731001_1;
-
-package body C731001_1 is
-
- Verbose: Boolean := False;
-
- procedure Check_String(X, Y: String) is
- begin
- if Verbose then
- Comment("""" & X & """ = """ & Y & """?");
- end if;
- if X /= Y then
- Failed("""" & X & """ should be """ & Y & """");
- end if;
- end Check_String;
-
- function Check_String(X, Y: String) return String is
- begin
- Check_String(X, Y);
- return X;
- end Check_String;
-
-end C731001_1;
-
-private package C731001_1.Parent is
-
- procedure Call_Main;
-
- type Root is tagged null record;
- subtype Renames_Root is Root;
- subtype Root_Class is Renames_Root'Class;
- function Make return Root;
- function Op1(X: Root) return String;
- function Call_Op2(X: Root'Class) return String;
-private
- function Op2(X: Root) return String;
-end C731001_1.Parent;
-
-procedure C731001_1.Parent.Main;
-
-with C731001_1.Parent.Main;
-package body C731001_1.Parent is
-
- procedure Call_Main is
- begin
- Main;
- end Call_Main;
-
- function Make return Root is
- Result: Root;
- begin
- return Result;
- end Make;
-
- function Op1(X: Root) return String is
- begin
- return "Parent.Op1 body";
- end Op1;
-
- function Op2(X: Root) return String is
- begin
- return "Parent.Op2 body";
- end Op2;
-
- function Call_Op2(X: Root'Class) return String is
- begin
- return Op2(X);
- end Call_Op2;
-
-begin
-
- Check_String(Op1(Root'(Make)), "Parent.Op1 body");
- Check_String(Op1(Root_Class(Root'(Make))), "Parent.Op1 body");
-
- Check_String(Op2(Root'(Make)), "Parent.Op2 body");
- Check_String(Op2(Root_Class(Root'(Make))), "Parent.Op2 body");
-
-end C731001_1.Parent;
-
-with C731001_1.Parent; use C731001_1.Parent;
-private package C731001_1.Unrelated is
-
- type T2 is new Root with null record;
- subtype T2_Class is T2'Class;
- function Make return T2;
- function Op2(X: T2) return String;
-end C731001_1.Unrelated;
-
-with C731001_1.Parent; use C731001_1.Parent;
- pragma Elaborate(C731001_1.Parent);
-package body C731001_1.Unrelated is
-
- function Make return T2 is
- Result: T2;
- begin
- return Result;
- end Make;
-
- function Op2(X: T2) return String is
- begin
- return "Unrelated.Op2 body";
- end Op2;
-begin
-
- Check_String(Op1(T2'(Make)), "Parent.Op1 body");
- Check_String(Op1(T2_Class(T2'(Make))), "Parent.Op1 body");
- Check_String(Op1(Root_Class(T2'(Make))), "Parent.Op1 body");
-
- Check_String(Op2(T2'(Make)), "Unrelated.Op2 body");
- Check_String(Op2(T2_Class(T2'(Make))), "Unrelated.Op2 body");
- Check_String(Call_Op2(T2'(Make)), "Parent.Op2 body");
- Check_String(Call_Op2(T2_Class(T2'(Make))), "Parent.Op2 body");
- Check_String(Call_Op2(Root_Class(T2'(Make))), "Parent.Op2 body");
-
-end C731001_1.Unrelated;
-
-package C731001_1.Parent.Child is
- pragma Elaborate_Body;
-
- type T3 is new Root with null record;
- subtype T3_Class is T3'Class;
- function Make return T3;
-
- T3_Obj: T3;
- T3_Class_Obj: T3_Class := T3_Obj;
- T3_Root_Class_Obj: Root_Class := T3_Obj;
-
- X3: constant String :=
- Check_String(Op1(T3_Obj), "Parent.Op1 body") &
- Check_String(Op1(T3_Class_Obj), "Parent.Op1 body") &
- Check_String(Op1(T3_Root_Class_Obj), "Parent.Op1 body") &
-
- Check_String(Call_Op2(T3_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T3_Class_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T3_Root_Class_Obj), "Parent.Op2 body");
-
- package Nested is
- type T4 is new Root with null record;
- subtype T4_Class is T4'Class;
- function Make return T4;
-
- T4_Obj: T4;
- T4_Class_Obj: T4_Class := T4_Obj;
- T4_Root_Class_Obj: Root_Class := T4_Obj;
-
- X4: constant String :=
- Check_String(Op1(T4_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Class_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Root_Class_Obj), "Parent.Op1 body") &
-
- Check_String(Call_Op2(T4_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Class_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Root_Class_Obj), "Parent.Op2 body");
-
- private
-
- XX4: constant String :=
- Check_String(Op1(T4_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Class_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Root_Class_Obj), "Parent.Op1 body") &
-
- Check_String(Call_Op2(T4_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Class_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Root_Class_Obj), "Parent.Op2 body");
-
- end Nested;
-
- use Nested;
-
- XXX4: constant String :=
- Check_String(Op1(T4_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Class_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Root_Class_Obj), "Parent.Op1 body") &
-
- Check_String(Call_Op2(T4_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Class_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Root_Class_Obj), "Parent.Op2 body");
-
-private
-
- XX3: constant String :=
- Check_String(Op1(T3_Obj), "Parent.Op1 body") &
- Check_String(Op1(T3_Class_Obj), "Parent.Op1 body") &
- Check_String(Op1(T3_Root_Class_Obj), "Parent.Op1 body") &
-
- Check_String(Call_Op2(T3_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T3_Class_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T3_Root_Class_Obj), "Parent.Op2 body") &
-
- Check_String(Op2(T3_Obj), "Parent.Op2 body") &
- Check_String(Op2(T3_Class_Obj), "Parent.Op2 body") &
- Check_String(Op2(T3_Root_Class_Obj), "Parent.Op2 body");
-
- XXXX4: constant String :=
- Check_String(Op1(T4_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Class_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Root_Class_Obj), "Parent.Op1 body") &
-
- Check_String(Call_Op2(T4_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Class_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Root_Class_Obj), "Parent.Op2 body") &
-
- Check_String(Op2(T4_Root_Class_Obj), "Parent.Op2 body");
-
-end C731001_1.Parent.Child;
-
-with C731001_1.Unrelated; use C731001_1.Unrelated;
- pragma Elaborate(C731001_1.Unrelated);
-package body C731001_1.Parent.Child is
-
- XXX3: constant String :=
- Check_String(Op1(T3_Obj), "Parent.Op1 body") &
- Check_String(Op1(T3_Class_Obj), "Parent.Op1 body") &
- Check_String(Op1(T3_Root_Class_Obj), "Parent.Op1 body") &
-
- Check_String(Call_Op2(T3_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T3_Class_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T3_Root_Class_Obj), "Parent.Op2 body") &
-
- Check_String(Op2(T3_Obj), "Parent.Op2 body") &
- Check_String(Op2(T3_Class_Obj), "Parent.Op2 body") &
- Check_String(Op2(T3_Root_Class_Obj), "Parent.Op2 body");
-
- XXXXX4: constant String :=
- Check_String(Op1(T4_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Class_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Root_Class_Obj), "Parent.Op1 body") &
-
- Check_String(Call_Op2(T4_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Class_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Root_Class_Obj), "Parent.Op2 body") &
-
- Check_String(Op2(T4_Root_Class_Obj), "Parent.Op2 body");
-
- function Make return T3 is
- Result: T3;
- begin
- return Result;
- end Make;
-
- package body Nested is
- function Make return T4 is
- Result: T4;
- begin
- return Result;
- end Make;
-
- XXXXXX4: constant String :=
- Check_String(Op1(T4_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Class_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Root_Class_Obj), "Parent.Op1 body") &
-
- Check_String(Call_Op2(T4_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Class_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Root_Class_Obj), "Parent.Op2 body") &
-
- Check_String(Op2(T4_Obj), "Parent.Op2 body") &
- Check_String(Op2(T4_Class_Obj), "Parent.Op2 body") &
- Check_String(Op2(T4_Root_Class_Obj), "Parent.Op2 body");
-
- end Nested;
-
- type T5 is new T2 with null record;
- subtype T5_Class is T5'Class;
- function Make return T5;
-
- function Make return T5 is
- Result: T5;
- begin
- return Result;
- end Make;
-
- XXXXXXX4: constant String :=
- Check_String(Op1(T4_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Class_Obj), "Parent.Op1 body") &
- Check_String(Op1(T4_Root_Class_Obj), "Parent.Op1 body") &
-
- Check_String(Call_Op2(T4_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Class_Obj), "Parent.Op2 body") &
- Check_String(Call_Op2(T4_Root_Class_Obj), "Parent.Op2 body") &
-
- Check_String(Op2(T4_Root_Class_Obj), "Parent.Op2 body");
-
-end C731001_1.Parent.Child;
-
-procedure C731001_1.Main;
-
-with C731001_1.Parent;
-procedure C731001_1.Main is
-begin
- C731001_1.Parent.Call_Main;
-end C731001_1.Main;
-
-with C731001_1.Parent.Child;
- use C731001_1.Parent;
- use C731001_1.Parent.Child;
- use C731001_1.Parent.Child.Nested;
-with C731001_1.Unrelated; use C731001_1.Unrelated;
-procedure C731001_1.Parent.Main is
-
- Root_Obj: Root := Make;
- Root_Class_Obj: Root_Class := Root'(Make);
-
- T2_Obj: T2 := Make;
- T2_Class_Obj: T2_Class := T2_Obj;
- T2_Root_Class_Obj: Root_Class := T2_Class_Obj;
-
- T3_Obj: T3 := Make;
- T3_Class_Obj: T3_Class := T3_Obj;
- T3_Root_Class_Obj: Root_Class := T3_Obj;
-
- T4_Obj: T4 := Make;
- T4_Class_Obj: T4_Class := T4_Obj;
- T4_Root_Class_Obj: Root_Class := T4_Obj;
-
-begin
- Test("C731001_1", "Check that inherited operations can be overridden, even"
- & " when they are inherited in a body");
-
- Check_String(Op1(Root_Obj), "Parent.Op1 body");
- Check_String(Op1(Root_Class_Obj), "Parent.Op1 body");
-
- Check_String(Call_Op2(Root_Obj), "Parent.Op2 body");
- Check_String(Call_Op2(Root_Class_Obj), "Parent.Op2 body");
-
- Check_String(Op1(T2_Obj), "Parent.Op1 body");
- Check_String(Op1(T2_Class_Obj), "Parent.Op1 body");
- Check_String(Op1(T2_Root_Class_Obj), "Parent.Op1 body");
-
- Check_String(Op2(T2_Obj), "Unrelated.Op2 body");
- Check_String(Op2(T2_Class_Obj), "Unrelated.Op2 body");
- Check_String(Call_Op2(T2_Obj), "Parent.Op2 body");
- Check_String(Call_Op2(T2_Class_Obj), "Parent.Op2 body");
- Check_String(Call_Op2(T2_Root_Class_Obj), "Parent.Op2 body");
-
- Check_String(Op1(T3_Obj), "Parent.Op1 body");
- Check_String(Op1(T3_Class_Obj), "Parent.Op1 body");
- Check_String(Op1(T3_Root_Class_Obj), "Parent.Op1 body");
-
- Check_String(Call_Op2(T3_Obj), "Parent.Op2 body");
- Check_String(Call_Op2(T3_Class_Obj), "Parent.Op2 body");
- Check_String(Call_Op2(T3_Root_Class_Obj), "Parent.Op2 body");
-
- Check_String(Op1(T4_Obj), "Parent.Op1 body");
- Check_String(Op1(T4_Class_Obj), "Parent.Op1 body");
- Check_String(Op1(T4_Root_Class_Obj), "Parent.Op1 body");
-
- Check_String(Call_Op2(T4_Obj), "Parent.Op2 body");
- Check_String(Call_Op2(T4_Class_Obj), "Parent.Op2 body");
- Check_String(Call_Op2(T4_Root_Class_Obj), "Parent.Op2 body");
-
- Result;
-end C731001_1.Parent.Main;
-
-with C731001_1.Main;
-procedure C731001 is
-begin
- C731001_1.Main;
-end C731001;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c760001.a b/gcc/testsuite/ada/acats/tests/c7/c760001.a
deleted file mode 100644
index be9ff81946c..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c760001.a
+++ /dev/null
@@ -1,390 +0,0 @@
--- C760001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Initialize is called for objects and components of
--- a controlled type when the objects and components are not
--- assigned explicit initial values. Check this for "simple" controlled
--- objects, controlled record components and arrays with controlled
--- components.
---
--- Check that if an explicit initial value is assigned to an object
--- or component of a controlled type then Initialize is not called.
---
--- TEST DESCRIPTION:
--- This test derives a type for Ada.Finalization.Controlled, and
--- overrides the Initialize and Adjust operations for the type. The
--- intent of the type is that it should carry incremental values
--- indicating the ordering of events with respect to these (and default
--- initialization) operations. The body of the test uses these values
--- to determine that the implicit calls to these subprograms happen
--- (or don't) at the appropriate times.
---
--- The test further derives types from this "root" type, which are the
--- actual types used in the test. One of the types is "simply" derived
--- from the "root" type, the other contains a component of the first
--- type, thus nesting a controlled object as a record component in
--- controlled objects.
---
--- The main program declares objects of these types and checks the
--- values of the components to ascertain that they have been touched
--- as expected.
---
--- Note that Finalization procedures are provided. This test does not
--- test that the calls to Finalization are made correctly. The
--- Finalization procedures are provided to catch an implementation that
--- calls Finalization at an incorrect time.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Oct 95 SAIC Update and repair for ACVC 2.0.1
---
---!
-
----------------------------------------------------------------- C760001_0
-
-with Ada.Finalization;
-package C760001_0 is
- subtype Unique_ID is Natural;
- function Unique_Value return Unique_ID;
- -- increments each time it's called
-
- function Most_Recent_Unique_Value return Unique_ID;
- -- returns the same value as the most recent call to Unique_Value
-
- type Root_Controlled is new Ada.Finalization.Controlled with record
- My_ID : Unique_ID := Unique_Value;
- My_Init_ID : Unique_ID := Unique_ID'First;
- My_Adj_ID : Unique_ID := Unique_ID'First;
- end record;
-
- procedure Initialize( R: in out Root_Controlled );
- procedure Adjust ( R: in out Root_Controlled );
-
- TC_Initialize_Calls_Is_Failing : Boolean := False;
-
-end C760001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body C760001_0 is
-
- Global_Unique_Counter : Unique_ID := 0;
-
- function Unique_Value return Unique_ID is
- begin
- Global_Unique_Counter := Global_Unique_Counter +1;
- return Global_Unique_Counter;
- end Unique_Value;
-
- function Most_Recent_Unique_Value return Unique_ID is
- begin
- return Global_Unique_Counter;
- end Most_Recent_Unique_Value;
-
- procedure Initialize( R: in out Root_Controlled ) is
- begin
- if TC_Initialize_Calls_Is_Failing then
- Report.Failed("Initialized incorrectly called");
- end if;
- R.My_Init_ID := Unique_Value;
- end Initialize;
-
- procedure Adjust( R: in out Root_Controlled ) is
- begin
- R.My_Adj_ID := Unique_Value;
- end Adjust;
-
-end C760001_0;
-
----------------------------------------------------------------- C760001_1
-
-with Ada.Finalization;
-with C760001_0;
-package C760001_1 is
-
- type Proc_ID is (None, Init, Adj, Fin);
-
- type Test_Controlled is new C760001_0.Root_Controlled with record
- Last_Proc_Called: Proc_ID := None;
- end record;
-
- procedure Initialize( TC: in out Test_Controlled );
- procedure Adjust ( TC: in out Test_Controlled );
- procedure Finalize ( TC: in out Test_Controlled );
-
- type Nested_Controlled is new C760001_0.Root_Controlled with record
- Nested : C760001_0.Root_Controlled;
- Last_Proc_Called: Proc_ID := None;
- end record;
-
- procedure Initialize( TC: in out Nested_Controlled );
- procedure Adjust ( TC: in out Nested_Controlled );
- procedure Finalize ( TC: in out Nested_Controlled );
-
-end C760001_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body C760001_1 is
-
- procedure Initialize( TC: in out Test_Controlled ) is
- begin
- if TC.Last_Proc_Called /= None then
- Report.Failed("Initialize for Test_Controlled");
- end if;
- TC.Last_Proc_Called := Init;
- C760001_0.Initialize(C760001_0.Root_Controlled(TC));
- end Initialize;
-
- procedure Adjust ( TC: in out Test_Controlled ) is
- begin
- TC.Last_Proc_Called := Adj;
- C760001_0.Adjust(C760001_0.Root_Controlled(TC));
- end Adjust;
-
- procedure Finalize ( TC: in out Test_Controlled ) is
- begin
- TC.Last_Proc_Called := Fin;
- end Finalize;
-
- procedure Initialize( TC: in out Nested_Controlled ) is
- begin
- if TC.Last_Proc_Called /= None then
- Report.Failed("Initialize for Nested_Controlled");
- end if;
- TC.Last_Proc_Called := Init;
- C760001_0.Initialize(C760001_0.Root_Controlled(TC));
- end Initialize;
-
- procedure Adjust ( TC: in out Nested_Controlled ) is
- begin
- TC.Last_Proc_Called := Adj;
- C760001_0.Adjust(C760001_0.Root_Controlled(TC));
- end Adjust;
-
- procedure Finalize ( TC: in out Nested_Controlled ) is
- begin
- TC.Last_Proc_Called := Fin;
- end Finalize;
-
-end C760001_1;
-
----------------------------------------------------------------- C760001
-
-with Report;
-with TCTouch;
-with C760001_0;
-with C760001_1;
-with Ada.Finalization;
-procedure C760001 is
-
- use type C760001_1.Proc_ID;
-
- -- in the first test, test the simple case. Check that a controlled object
- -- causes a call to the procedure Initialize.
- -- Also check that assignment causes a call to Adjust.
-
- procedure Check_Simple_Objects is
- S,T : C760001_1.Test_Controlled;
- begin
- TCTouch.Assert(S.My_ID < S.My_Init_ID,"Default before dispatch");
- TCTouch.Assert((S.Last_Proc_Called = C760001_1.Init) and
- (T.Last_Proc_Called = C760001_1.Init),
- "Initialize for simple object");
- S := T;
- TCTouch.Assert((S.Last_Proc_Called = C760001_1.Adj),
- "Adjust for simple object");
- TCTouch.Assert((S.My_ID = T.My_ID),
- "Simple object My_ID's don't match");
- TCTouch.Assert((S.My_Init_ID = T.My_Init_ID),
- "Simple object My_Init_ID's don't match");
- TCTouch.Assert((S.My_Adj_ID > T.My_Adj_ID),
- "Simple object My_Adj_ID's in wrong order");
- end Check_Simple_Objects;
-
- -- in the second test, test a more complex case, check that a controlled
- -- component of a controlled object gets processed correctly
-
- procedure Check_Nested_Objects is
- NO1 : C760001_1.Nested_Controlled;
- begin
- TCTouch.Assert((NO1.My_ID < NO1.My_Init_Id),
- "Default value order incorrect");
- TCTouch.Assert((NO1.My_Init_Id > NO1.Nested.My_Init_ID),
- "Initialization call order incorrect");
- end Check_Nested_Objects;
-
- -- check that objects assigned an initial value at declaration are Adjusted
- -- and NOT Initialized
-
- procedure Check_Objects_With_Initial_Values is
-
- TC_Now : constant C760001_0.Unique_ID := C760001_0.Unique_Value;
-
- A: C760001_1.Test_Controlled :=
- ( Ada.Finalization.Controlled
- with TC_Now,
- TC_Now,
- TC_Now,
- C760001_1.None);
-
- B: C760001_1.Nested_Controlled :=
- ( Ada.Finalization.Controlled
- with TC_Now,
- TC_Now,
- TC_Now,
- C760001_0.Root_Controlled(A),
- C760001_1.None);
-
- begin
- -- the implementation may or may not call Adjust for the values
- -- assigned into A and B,
- -- but should NOT call Initialize.
- -- if the value used in the aggregate is overwritten by Initialize,
- -- this indicates failure
- TCTouch.Assert(A.My_Init_Id = TC_Now,
- "Initialize was called for A with initial value");
- TCTouch.Assert(B.My_Init_Id = TC_Now,
- "Initialize was called for B with initial value");
- TCTouch.Assert(B.Nested.My_Init_ID = TC_Now,
- "Initialize was called for B.Nested initial value");
- end Check_Objects_With_Initial_Values;
-
- procedure Check_Array_Case is
- type Array_Simple is array(1..4) of C760001_1.Test_Controlled;
- type Array_Nested is array(1..4) of C760001_1.Nested_Controlled;
-
- Simple_Array_Default : Array_Simple;
-
- Nested_Array_Default : Array_Nested;
-
- TC_A_Bit_Later : C760001_0.Unique_ID;
-
- begin
- TC_A_Bit_Later := C760001_0.Unique_Value;
- for N in 1..4 loop
- TCTouch.Assert(Simple_Array_Default(N).Last_Proc_Called
- = C760001_1.Init,
- "Initialize for array initial value");
-
- TCTouch.Assert( (Simple_Array_Default(N).My_Init_ID
- > C760001_0.Unique_ID'First)
- and (Simple_Array_Default(N).My_Init_ID
- < TC_A_Bit_Later),
- "Initialize timing for simple array");
-
- TCTouch.Assert( (Nested_Array_Default(N).My_Init_ID
- > C760001_0.Unique_ID'First)
- and (Nested_Array_Default(N).My_Init_ID
- < TC_A_Bit_Later),
- "Initialize timing for container array");
-
- TCTouch.Assert(Nested_Array_Default(N).Last_Proc_Called
- = C760001_1.Init,
- "Initialize for nested array (outer) initial value");
-
- TCTouch.Assert( (Nested_Array_Default(N).Nested.My_Init_ID
- > C760001_0.Unique_ID'First)
- and (Nested_Array_Default(N).Nested.My_Init_ID
- < Nested_Array_Default(N).My_Init_ID),
- "Initialize timing for array content");
- end loop;
- end Check_Array_Case;
-
- procedure Check_Array_Case_With_Initial_Values is
-
- TC_Now : constant C760001_0.Unique_ID := C760001_0.Unique_Value;
-
- type Array_Simple is array(1..4) of C760001_1.Test_Controlled;
- type Array_Nested is array(1..4) of C760001_1.Nested_Controlled;
-
- Simple_Array_Explicit : Array_Simple := ( 1..4 => (
- Ada.Finalization.Controlled
- with TC_Now,
- TC_Now,
- TC_Now,
- C760001_1.None ) );
-
- A : constant C760001_0.Root_Controlled :=
- ( Ada.Finalization.Controlled
- with others => TC_Now);
-
- Nested_Array_Explicit : Array_Nested := ( 1..4 => (
- Ada.Finalization.Controlled
- with TC_Now,
- TC_Now,
- TC_Now,
- A,
- C760001_1.None ) );
-
- begin
- -- the implementation may or may not call Adjust for the values
- -- assigned into Simple_Array_Explicit and Nested_Array_Explicit,
- -- but should NOT call Initialize.
- -- if the value used in the aggregate is overwritten by Initialize,
- -- this indicates failure
- for N in 1..4 loop
- TCTouch.Assert(Simple_Array_Explicit(N).My_Init_ID
- = TC_Now,
- "Initialize was called for array with initial value");
- TCTouch.Assert(Nested_Array_Explicit(N).My_Init_ID
- = TC_Now,
- "Initialize was called for nested array (outer) with initial value");
- TCTouch.Assert(Nested_Array_Explicit(N).Nested.My_Init_ID = TC_Now,
- "Initialize was called for nested array (inner) with initial value");
- end loop;
- end Check_Array_Case_With_Initial_Values;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-begin -- Main test procedure.
-
- Report.Test ("C760001", "Check that Initialize is called for objects " &
- "and components of a controlled type when the " &
- "objects and components are not assigned " &
- "explicit initial values. Check that if an " &
- "explicit initial value is assigned to an " &
- "object or component of a controlled type " &
- "then Initialize is not called" );
-
- Check_Simple_Objects;
-
- Check_Nested_Objects;
-
- Check_Array_Case;
-
- C760001_0.TC_Initialize_Calls_Is_Failing := True;
-
- Check_Objects_With_Initial_Values;
-
- Check_Array_Case_With_Initial_Values;
-
- Report.Result;
-
-end C760001;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c760002.a b/gcc/testsuite/ada/acats/tests/c7/c760002.a
deleted file mode 100644
index 4601873be04..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c760002.a
+++ /dev/null
@@ -1,489 +0,0 @@
--- C760002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that assignment to an object of a (non-limited) controlled
--- type causes the Adjust operation of the type to be called.
--- Check that Adjust is called after copying the value of the
--- source expression to the target object.
---
--- Check that Adjust is called for all controlled components when
--- the containing object is assigned. (Test this for the cases
--- where the type of the containing object is controlled and
--- noncontrolled; test this for initialization as well as
--- assignment statements.)
---
--- Check that for an object of a controlled type with controlled
--- components, Adjust for each of the components is called before
--- the containing object is adjusted.
---
--- Check that an Adjust procedure for a Limited_Controlled type is
--- not called by the implementation.
---
--- TEST DESCRIPTION:
--- This test is loosely "derived" from C760001.
---
--- Visit Tags:
--- D - Default value at declaration
--- d - Default value at declaration, limited root
--- I - initialize at root controlled
--- i - initialize at root limited controlled
--- A - adjust at root controlled
--- X,Y,Z,x,y,z - used in test body
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Correct test assertion logic for Sinister case
---
---!
-
----------------------------------------------------------------- C760002_0
-
-with Ada.Finalization;
-package C760002_0 is
- subtype Unique_ID is Natural;
- function Unique_Value return Unique_ID;
- -- increments each time it's called
-
- function Most_Recent_Unique_Value return Unique_ID;
- -- returns the same value as the most recent call to Unique_Value
-
- type Root is tagged record
- My_ID : Unique_ID := Unique_Value;
- Visit_Tag : Character := 'D'; -- Default
- end record;
-
- procedure Initialize( R: in out Root );
- procedure Adjust ( R: in out Root );
-
- type Root_Controlled is new Ada.Finalization.Controlled with record
- My_ID : Unique_ID := Unique_Value;
- Visit_Tag : Character := 'D'; ---------------------------------------- D
- end record;
-
- procedure Initialize( R: in out Root_Controlled );
- procedure Adjust ( R: in out Root_Controlled );
-
- type Root_Limited_Controlled is
- new Ada.Finalization.Limited_Controlled with record
- My_ID : Unique_ID := Unique_Value;
- Visit_Tag : Character := 'd'; ---------------------------------------- d
- end record;
-
- procedure Initialize( R: in out Root_Limited_Controlled );
- procedure Adjust ( R: in out Root_Limited_Controlled );
-
-end C760002_0;
-
-with Report;
-package body C760002_0 is
-
- Global_Unique_Counter : Unique_ID := 0;
-
- function Unique_Value return Unique_ID is
- begin
- Global_Unique_Counter := Global_Unique_Counter +1;
- return Global_Unique_Counter;
- end Unique_Value;
-
- function Most_Recent_Unique_Value return Unique_ID is
- begin
- return Global_Unique_Counter;
- end Most_Recent_Unique_Value;
-
- procedure Initialize( R: in out Root ) is
- begin
- Report.Failed("Initialize called for Non_Controlled type");
- end Initialize;
-
- procedure Adjust ( R: in out Root ) is
- begin
- Report.Failed("Adjust called for Non_Controlled type");
- end Adjust;
-
- procedure Initialize( R: in out Root_Controlled ) is
- begin
- R.Visit_Tag := 'I'; --------------------------------------------------- I
- end Initialize;
-
- procedure Adjust( R: in out Root_Controlled ) is
- begin
- R.Visit_Tag := 'A'; --------------------------------------------------- A
- end Adjust;
-
- procedure Initialize( R: in out Root_Limited_Controlled ) is
- begin
- R.Visit_Tag := 'i'; --------------------------------------------------- i
- end Initialize;
-
- procedure Adjust( R: in out Root_Limited_Controlled ) is
- begin
- Report.Failed("Adjust called for Limited_Controlled type");
- end Adjust;
-
-end C760002_0;
-
----------------------------------------------------------------- C760002_1
-
-with Ada.Finalization;
-with C760002_0;
-package C760002_1 is
-
- type Proc_ID is (None, Init, Adj, Fin);
-
- type Test_Controlled is new C760002_0.Root_Controlled with record
- Last_Proc_Called: Proc_ID := None;
- end record;
-
- procedure Initialize( TC: in out Test_Controlled );
- procedure Adjust ( TC: in out Test_Controlled );
- procedure Finalize ( TC: in out Test_Controlled );
-
- type Nested_Controlled is new C760002_0.Root_Controlled with record
- Nested : C760002_0.Root_Controlled;
- Last_Proc_Called: Proc_ID := None;
- end record;
-
- procedure Initialize( TC: in out Nested_Controlled );
- procedure Adjust ( TC: in out Nested_Controlled );
- procedure Finalize ( TC: in out Nested_Controlled );
-
- type Test_Limited_Controlled is
- new C760002_0.Root_Limited_Controlled with record
- Last_Proc_Called: Proc_ID := None;
- end record;
-
- procedure Initialize( TC: in out Test_Limited_Controlled );
- procedure Adjust ( TC: in out Test_Limited_Controlled );
- procedure Finalize ( TC: in out Test_Limited_Controlled );
-
- type Nested_Limited_Controlled is
- new C760002_0.Root_Limited_Controlled with record
- Nested : C760002_0.Root_Limited_Controlled;
- Last_Proc_Called: Proc_ID := None;
- end record;
-
- procedure Initialize( TC: in out Nested_Limited_Controlled );
- procedure Adjust ( TC: in out Nested_Limited_Controlled );
- procedure Finalize ( TC: in out Nested_Limited_Controlled );
-
-end C760002_1;
-
-with Report;
-package body C760002_1 is
-
- procedure Initialize( TC: in out Test_Controlled ) is
- begin
- TC.Last_Proc_Called := Init;
- C760002_0.Initialize(C760002_0.Root_Controlled(TC));
- end Initialize;
-
- procedure Adjust ( TC: in out Test_Controlled ) is
- begin
- TC.Last_Proc_Called := Adj;
- C760002_0.Adjust(C760002_0.Root_Controlled(TC));
- end Adjust;
-
- procedure Finalize ( TC: in out Test_Controlled ) is
- begin
- TC.Last_Proc_Called := Fin;
- end Finalize;
-
- procedure Initialize( TC: in out Nested_Controlled ) is
- begin
- TC.Last_Proc_Called := Init;
- C760002_0.Initialize(C760002_0.Root_Controlled(TC));
- end Initialize;
-
- procedure Adjust ( TC: in out Nested_Controlled ) is
- begin
- TC.Last_Proc_Called := Adj;
- C760002_0.Adjust(C760002_0.Root_Controlled(TC));
- end Adjust;
-
- procedure Finalize ( TC: in out Nested_Controlled ) is
- begin
- TC.Last_Proc_Called := Fin;
- end Finalize;
-
- procedure Initialize( TC: in out Test_Limited_Controlled ) is
- begin
- TC.Last_Proc_Called := Init;
- C760002_0.Initialize(C760002_0.Root_Limited_Controlled(TC));
- end Initialize;
-
- procedure Adjust ( TC: in out Test_Limited_Controlled ) is
- begin
- Report.Failed("Adjust called for Test_Limited_Controlled");
- end Adjust;
-
- procedure Finalize ( TC: in out Test_Limited_Controlled ) is
- begin
- TC.Last_Proc_Called := Fin;
- end Finalize;
-
- procedure Initialize( TC: in out Nested_Limited_Controlled ) is
- begin
- TC.Last_Proc_Called := Init;
- C760002_0.Initialize(C760002_0.Root_Limited_Controlled(TC));
- end Initialize;
-
- procedure Adjust ( TC: in out Nested_Limited_Controlled ) is
- begin
- Report.Failed("Adjust called for Nested_Limited_Controlled");
- end Adjust;
-
- procedure Finalize ( TC: in out Nested_Limited_Controlled ) is
- begin
- TC.Last_Proc_Called := Fin;
- end Finalize;
-
-end C760002_1;
-
----------------------------------------------------------------- C760002
-
-with Report;
-with TCTouch;
-with C760002_0;
-with C760002_1;
-with Ada.Finalization;
-procedure C760002 is
-
- use type C760002_1.Proc_ID;
-
- -- in the first test, test the simple cases.
- -- Also check that assignment causes a call to Adjust for a controlled
- -- object. Check that assignment of a non-controlled object does not call
- -- an Adjust procedure.
-
- procedure Check_Simple_Objects is
-
- A,B : C760002_0.Root;
- S,T : C760002_1.Test_Controlled;
- Q : C760002_1.Test_Limited_Controlled; -- Adjust call shouldn't happen
- begin
-
- S := T;
-
- TCTouch.Assert((S.Last_Proc_Called = C760002_1.Adj),
- "Adjust for simple object");
- TCTouch.Assert((S.My_ID = T.My_ID),
- "Assignment failed for simple object");
-
- -- Check that adjust was called
- TCTouch.Assert((S.Visit_Tag = 'A'), "Adjust timing incorrect");
-
- -- Check that Adjust has not been called
- TCTouch.Assert_Not((T.Visit_Tag = 'A'), "Adjust incorrectly called");
-
- -- Check that Adjust does not get called
- A.My_ID := A.My_ID +1;
- B := A; -- see: Adjust: Report.Failed
-
- end Check_Simple_Objects;
-
- -- in the second test, test a more complex case, check that a controlled
- -- component of a controlled object gets processed correctly
-
- procedure Check_Nested_Objects is
- NO1 : C760002_1.Nested_Controlled;
- NO2 : C760002_1.Nested_Controlled := NO1;
-
- begin
-
- -- NO2 should be flagged with adjust markers
- TCTouch.Assert((NO2.Last_Proc_Called = C760002_1.Adj),
- "Adjust not called for NO2 enclosure declaration");
- TCTouch.Assert((NO2.Nested.Visit_Tag = 'A'),
- "Adjust not called for NO2 enclosed declaration");
-
- NO2.Visit_Tag := 'x';
- NO2.Nested.Visit_Tag := 'y';
-
- NO1 := NO2;
-
- -- NO1 should be flagged with adjust markers
- TCTouch.Assert((NO1.Visit_Tag = 'A'),
- "Adjust not called for NO1 enclosure declaration");
- TCTouch.Assert((NO1.Nested.Visit_Tag = 'A'),
- "Adjust not called for NO1 enclosed declaration");
-
- end Check_Nested_Objects;
-
- procedure Check_Array_Case is
- type Array_Simple is array(1..4) of C760002_1.Test_Controlled;
- type Array_Nested is array(1..4) of C760002_1.Nested_Controlled;
-
- Left,Right : Array_Simple;
- Overlap : Array_Simple := Left;
-
- Sinister,Dexter : Array_Nested;
- Underlap : Array_Nested := Sinister;
-
- Now : Natural;
-
- begin
-
- -- get a current unique value since initializations
- Now := C760002_0.Unique_Value;
-
- -- check results of declarations
- for N in 1..4 loop
- TCTouch.Assert(Left(N).My_Id < Now,
- "Initialize for array initial value");
- TCTouch.Assert(Overlap(N).My_Id < Now,
- "Adjust for nested array (outer) initial value");
- TCTouch.Assert(Sinister(N).Nested.My_Id < Now,
- "Initialize for nested array (inner) initial value");
- TCTouch.Assert(Sinister(N).My_Id < Sinister(N).Nested.My_Id,
- "Initialize for enclosure should be after enclosed");
- TCTouch.Assert(Overlap(N).Visit_Tag = 'A',"Adjust at declaration");
- TCTouch.Assert(Underlap(N).Nested.Visit_Tag = 'A',
- "Adjust at declaration, nested object");
- end loop;
-
- -- set visit tags
- for O in 1..4 loop
- Overlap(O).Visit_Tag := 'X';
- Underlap(O).Visit_Tag := 'Y';
- Underlap(O).Nested.Visit_Tag := 'y';
- end loop;
-
- -- check that overlapping assignments don't cause odd grief
- Overlap(1..3) := Overlap(2..4);
- Underlap(2..4) := Underlap(1..3);
-
- for M in 2..3 loop
- TCTouch.Assert(Overlap(M).Last_Proc_Called = C760002_1.Adj,
- "Adjust for overlap");
- TCTouch.Assert(Overlap(M).Visit_Tag = 'A',
- "Adjust for overlap ID");
- TCTouch.Assert(Underlap(M).Last_Proc_Called = C760002_1.Adj,
- "Adjust for Underlap");
- TCTouch.Assert(Underlap(M).Nested.Visit_Tag = 'A',
- "Adjust for Underlaps nested ID");
- end loop;
-
- end Check_Array_Case;
-
- procedure Check_Access_Case is
- type TC_Ref is access C760002_1.Test_Controlled;
- type NC_Ref is access C760002_1.Nested_Controlled;
- type TL_Ref is access C760002_1.Test_Limited_Controlled;
- type NL_Ref is access C760002_1.Nested_Limited_Controlled;
-
- A,B : TC_Ref;
- C,D : NC_Ref;
- E : TL_Ref;
- F : NL_Ref;
-
- begin
-
- A := new C760002_1.Test_Controlled;
- B := new C760002_1.Test_Controlled'( A.all );
-
- C := new C760002_1.Nested_Controlled;
- D := new C760002_1.Nested_Controlled'( C.all );
-
- E := new C760002_1.Test_Limited_Controlled;
- F := new C760002_1.Nested_Limited_Controlled;
-
- TCTouch.Assert(A.Visit_Tag = 'I',"TC Allocation");
- TCTouch.Assert(B.Visit_Tag = 'A',"TC Allocation, with value");
-
- TCTouch.Assert(C.Visit_Tag = 'I',"NC Allocation");
- TCTouch.Assert(C.Nested.Visit_Tag = 'I',"NC Allocation, Nested");
- TCTouch.Assert(D.Visit_Tag = 'A',"NC Allocation, with value");
- TCTouch.Assert(D.Nested.Visit_Tag = 'A',
- "NC Allocation, Nested, with value");
-
- TCTouch.Assert(E.Visit_Tag = 'i',"TL Allocation");
- TCTouch.Assert(F.Visit_Tag = 'i',"NL Allocation");
-
- A.all := B.all;
- C.all := D.all;
-
- TCTouch.Assert(A.Visit_Tag = 'A',"TC Assignment");
- TCTouch.Assert(C.Visit_Tag = 'A',"NC Assignment");
- TCTouch.Assert(C.Nested.Visit_Tag = 'A',"NC Assignment, Nested");
-
- end Check_Access_Case;
-
- procedure Check_Access_Limited_Array_Case is
- type Array_Simple is array(1..4) of C760002_1.Test_Limited_Controlled;
- type AS_Ref is access Array_Simple;
- type Array_Nested is array(1..4) of C760002_1.Nested_Limited_Controlled;
- type AN_Ref is access Array_Nested;
-
- Simple_Array_Limited : AS_Ref;
-
- Nested_Array_Limited : AN_Ref;
-
- begin
-
- Simple_Array_Limited := new Array_Simple;
-
- Nested_Array_Limited := new Array_Nested;
-
- for N in 1..4 loop
- TCTouch.Assert(Simple_Array_Limited(N).Last_Proc_Called
- = C760002_1.Init,
- "Initialize for array initial value");
- TCTouch.Assert(Nested_Array_Limited(N).Last_Proc_Called
- = C760002_1.Init,
- "Initialize for nested array (outer) initial value");
- TCTouch.Assert(Nested_Array_Limited(N).Nested.Visit_Tag = 'i',
- "Initialize for nested array (inner) initial value");
- end loop;
- end Check_Access_Limited_Array_Case;
-
-begin -- Main test procedure.
-
- Report.Test ("C760002", "Check that assignment causes the Adjust " &
- "operation of the type to be called. Check " &
- "that Adjust is called after copying the " &
- "value of the source expression to the target " &
- "object. Check that Adjust is called for all " &
- "controlled components when the containing " &
- "object is assigned. Check that Adjust is " &
- "called for components before the containing " &
- "object is adjusted. Check that Adjust is not " &
- "called for a Limited_Controlled type by the " &
- "implementation" );
-
- Check_Simple_Objects;
-
- Check_Nested_Objects;
-
- Check_Array_Case;
-
- Check_Access_Case;
-
- Check_Access_Limited_Array_Case;
-
- Report.Result;
-
-end C760002;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c760007.a b/gcc/testsuite/ada/acats/tests/c7/c760007.a
deleted file mode 100644
index c1ddfcb9345..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c760007.a
+++ /dev/null
@@ -1,247 +0,0 @@
--- C760007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Adjust is called for the execution of a return
--- statement for a function returning a result of a (non-limited)
--- controlled type.
---
--- Check that Adjust is called when evaluating an aggregate
--- component association for a controlled component.
---
--- Check that Adjust is called for the assignment of the ancestor
--- expression of an extension aggregate when the type of the
--- aggregate is controlled.
---
--- TEST DESCRIPTION:
--- A type is derived from Ada.Finalization.Controlled; the dispatching
--- procedure Adjust is defined for the new type. Structures and
--- subprograms to model the test objectives are used to check that
--- Adjust is called at the right time. For the sake of simplicity,
--- globally accessible data is used to check that the calls are made.
---
---
--- CHANGE HISTORY:
--- 06 DEC 94 SAIC ACVC 2.0
--- 14 OCT 95 SAIC Update and repair for ACVC 2.0.1
--- 05 APR 96 SAIC Add RM reference
--- 06 NOV 96 SAIC Reduce adjust requirement
--- 25 NOV 97 EDS Allowed zero calls to adjust at line 144
---!
-
----------------------------------------------------------------- C760007_0
-
-with Ada.Finalization;
-package C760007_0 is
-
- type Controlled is new Ada.Finalization.Controlled with record
- TC_ID : Natural := Natural'Last;
- end record;
- procedure Adjust( Object: in out Controlled );
-
- type Structure is record
- Controlled_Component : Controlled;
- end record;
-
- type Child is new Controlled with record
- TC_XX : Natural := Natural'Last;
- end record;
- procedure Adjust( Object: in out Child );
-
- Adjust_Count : Natural := 0;
- Child_Adjust_Count : Natural := 0;
-
-end C760007_0;
-
-package body C760007_0 is
-
- procedure Adjust( Object: in out Controlled ) is
- begin
- Adjust_Count := Adjust_Count +1;
- end Adjust;
-
- procedure Adjust( Object: in out Child ) is
- begin
- Child_Adjust_Count := Child_Adjust_Count +1;
- end Adjust;
-
-end C760007_0;
-
------------------------------------------------------------------- C760007
-
-with Report;
-with C760007_0;
-procedure C760007 is
-
- procedure Check_Adjust_Count(Message: String;
- Min: Natural := 1;
- Max: Natural := 2) is
- begin
-
- -- in order to allow for the anonymous objects referred to in
- -- the reference manual, the check for calls to Adjust must be
- -- in a range. This number must then be further adjusted
- -- to allow for the optimization that does not call for an adjust
- -- of an aggregate initial value built directly in the object
-
- if C760007_0.Adjust_Count not in Min..Max then
- Report.Failed(Message
- & " = " & Natural'Image(C760007_0.Adjust_Count));
- end if;
- C760007_0.Adjust_Count := 0;
- end Check_Adjust_Count;
-
- procedure Check_Child_Adjust_Count(Message: String;
- Min: Natural := 1;
- Max: Natural := 2) is
- begin
- -- ditto above
-
- if C760007_0.Child_Adjust_Count not in Min..Max then
- Report.Failed(Message
- & " = " & Natural'Image(C760007_0.Child_Adjust_Count));
- end if;
- C760007_0.Child_Adjust_Count := 0;
- end Check_Child_Adjust_Count;
-
- Object : C760007_0.Controlled;
-
--- Check that Adjust is called for the execution of a return
--- statement for a function returning a result of a (non-limited)
--- controlled type or a result of a noncontrolled type with
--- controlled components.
-
- procedure Subtest_1 is
- function Create return C760007_0.Controlled is
- New_Object : C760007_0.Controlled;
- begin
- return New_Object;
- end Create;
-
- procedure Examine( Thing : in C760007_0.Controlled ) is
- begin
- Check_Adjust_Count("Function call passed as parameter",0);
- end Examine;
-
- begin
- -- this assignment must call Adjust:
- -- 1: on the value resulting from the function
- -- ** unless this is optimized out by building the result directly
- -- in the target object.
- -- 2: on Object once it's been assigned
- -- may call adjust
- -- 1: for a anonymous object created in the evaluation of the function
- -- 2: for a anonymous object created in the assignment operation
-
- Object := Create;
-
- Check_Adjust_Count("Function call",1,4);
-
- Examine( Create );
-
- end Subtest_1;
-
--- Check that Adjust is called when evaluating an aggregate
--- component association for a controlled component.
-
- procedure Subtest_2 is
- S : C760007_0.Structure;
-
- procedure Examine( Thing : in C760007_0.Structure ) is
- begin
- Check_Adjust_Count("Aggregate passed as parameter");
- end Examine;
-
- begin
- -- this assignment must call Adjust:
- -- 1: on the value resulting from the aggregate
- -- ** unless this is optimized out by building the result directly
- -- in the target object.
- -- 2: on Object once it's been assigned
- -- may call adjust
- -- 1: for a anonymous object created in the evaluation of the aggregate
- -- 2: for a anonymous object created in the assignment operation
- S := ( Controlled_Component => Object );
- Check_Adjust_Count("Aggregate and Assignment", 1, 4);
-
- Examine( C760007_0.Structure'(Controlled_Component => Object) );
- end Subtest_2;
-
--- Check that Adjust is called for the assignment of the ancestor
--- expression of an extension aggregate when the type of the
--- aggregate is controlled.
-
- procedure Subtest_3 is
- Bambino : C760007_0.Child;
-
- procedure Examine( Thing : in C760007_0.Child ) is
- begin
- Check_Adjust_Count("Extension aggregate as parameter (ancestor)", 0, 2);
- Check_Child_Adjust_Count("Extension aggregate as parameter", 0, 4);
- end Examine;
-
- begin
- -- implementation permissions make all of the following calls to adjust
- -- optional:
- -- these assignments may call Adjust:
- -- 1: on the value resulting from the aggregate
- -- 2: on Object once it's been assigned
- -- 3: for a anonymous object created in the evaluation of the aggregate
- -- 4: for a anonymous object created in the assignment operation
- Bambino := ( Object with TC_XX => 10 );
- Check_Adjust_Count("Ancestor (expression) part of aggregate", 0, 2);
- Check_Child_Adjust_Count("Child aggregate assignment 1", 0, 4 );
-
- Bambino := ( C760007_0.Controlled with TC_XX => 11 );
- Check_Adjust_Count("Ancestor (subtype_mark) part of aggregate", 0, 2);
- Check_Child_Adjust_Count("Child aggregate assignment 2", 0, 4 );
-
- Examine( ( Object with TC_XX => 21 ) );
-
- Examine( ( C760007_0.Controlled with TC_XX => 37 ) );
-
- end Subtest_3;
-
-begin -- Main test procedure.
-
- Report.Test ("C760007", "Check that Adjust is called for the " &
- "execution of a return statement for a " &
- "function returning a result containing a " &
- "controlled type. Check that Adjust is " &
- "called when evaluating an aggregate " &
- "component association for a controlled " &
- "component. " &
- "Check that Adjust is called for the " &
- "assignment of the ancestor expression of an " &
- "extension aggregate when the type of the " &
- "aggregate is controlled" );
-
- Subtest_1;
- Subtest_2;
- Subtest_3;
-
- Report.Result;
-
-end C760007;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c760009.a b/gcc/testsuite/ada/acats/tests/c7/c760009.a
deleted file mode 100644
index 8c3b80b3625..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c760009.a
+++ /dev/null
@@ -1,533 +0,0 @@
--- C760009.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that for an extension_aggregate whose ancestor_part is a
--- subtype_mark (i.e. Typemark'( Subtype with Field => x, etc.) )
--- Initialize is called on all controlled subcomponents of the
--- ancestor part; if the type of the ancestor part is itself controlled,
--- the Initialize procedure of the ancestor type is called, unless that
--- Initialize procedure is abstract.
---
--- Check that the utilization of a controlled type for a generic actual
--- parameter supports the correct behavior in the instantiated package.
---
--- TEST DESCRIPTION:
--- Declares a generic package instantiated to check that controlled
--- types are not impacted by the "generic boundary."
--- This instance is then used to perform the tests of various
--- aggregate formations of the controlled type. After each operation
--- in the main program that should cause implicit calls, the "state" of
--- the software is checked. The "state" of the software is maintained in
--- several variables which count the calls to the Initialize, Adjust and
--- Finalize procedures in each context. Given the nature of the
--- language rules, the test specifies a minimum number of times that
--- these subprograms should have been called. The test also checks cases
--- where the subprograms should not have been called.
---
--- As per the example in AARM 7.6(11a..d);6.0, the distinctions between
--- the presence/absence of default values is tested.
---
--- DATA STRUCTURES
---
--- C760009_3.Master_Control is derived from
--- C760009_2.Control is derived from
--- Ada.Finalization.Controlled
---
--- C760009_1.Simple_Control is derived from
--- Ada.Finalization.Controlled
---
--- C760009_3.Master_Control contains
--- Standard.Integer
---
--- C760009_2.Control contains
--- C760009_1.Simple_Control (default value)
--- C760009_1.Simple_Control (default initialized)
---
---
--- CHANGE HISTORY:
--- 01 MAY 95 SAIC Initial version
--- 19 FEB 96 SAIC Fixed elaboration Initialize count
--- 14 NOV 96 SAIC Allowed for 7.6(21) optimizations
--- 13 FEB 97 PWB.CTA Initialized counters at lines 127-129
--- 26 JUN 98 EDS Added pragma Elaborate_Body to C760009_0
--- to avoid possible instantiation error
---!
-
----------------------------------------------------------------- C760009_0
-
-with Ada.Finalization;
-generic
-
- type Private_Formal is private;
-
- with procedure TC_Validate( APF: in out Private_Formal );
-
-package C760009_0 is -- Check_1
-
- pragma Elaborate_Body;
- procedure TC_Check_1( APF: in Private_Formal );
- procedure TC_Check_2( APF: out Private_Formal );
- procedure TC_Check_3( APF: in out Private_Formal );
-
-end C760009_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body C760009_0 is -- Check_1
-
- procedure TC_Check_1( APF: in Private_Formal ) is
- Local : Private_Formal;
- begin
- Local := APF;
- TC_Validate( Local );
- end TC_Check_1;
-
- procedure TC_Check_2( APF: out Private_Formal ) is
- Local : Private_Formal; -- initialized by virtue of actual being
- -- Controlled
- begin
- APF := Local;
- TC_Validate( APF );
- end TC_Check_2;
-
- procedure TC_Check_3( APF: in out Private_Formal ) is
- Local : Private_Formal;
- begin
- Local := APF;
- TC_Validate( Local );
- end TC_Check_3;
-
-end C760009_0;
-
----------------------------------------------------------------- C760009_1
-
-with Ada.Finalization;
-package C760009_1 is
-
- Initialize_Called : Natural := 0;
- Adjust_Called : Natural := 0;
- Finalize_Called : Natural := 0;
-
- procedure Reset_Counters;
-
- type Simple_Control is new Ada.Finalization.Controlled with private;
-
- procedure Initialize( AV: in out Simple_Control );
- procedure Adjust ( AV: in out Simple_Control );
- procedure Finalize ( AV: in out Simple_Control );
- procedure Validate ( AV: in out Simple_Control );
-
- function Item( AV: Simple_Control'Class ) return String;
-
- Empty : constant Simple_Control;
-
- procedure TC_Trace( Message: String );
-
-private
- type Simple_Control is new Ada.Finalization.Controlled with record
- Item: Natural;
- end record;
-
- Empty : constant Simple_Control := ( Ada.Finalization.Controlled with 0 );
-
-end C760009_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body C760009_1 is
-
- -- Maintenance_Mode and TC_Trace are for the test writers and compiler
- -- developers to get more information from this test as it executes.
- -- Maintenance_Mode is always False for validation purposes.
-
- Maintenance_Mode : constant Boolean := False;
-
- procedure TC_Trace( Message: String ) is
- begin
- if Maintenance_Mode then
- Report.Comment( Message );
- end if;
- end TC_Trace;
-
- procedure Reset_Counters is
- begin
- Initialize_Called := 0;
- Adjust_Called := 0;
- Finalize_Called := 0;
- end Reset_Counters;
-
- Master_Count : Natural := 100; -- Help distinguish values
-
- procedure Initialize( AV: in out Simple_Control ) is
- begin
- Initialize_Called := Initialize_Called +1;
- AV.Item := Master_Count;
- Master_Count := Master_Count +100;
- TC_Trace( "Initialize _1.Simple_Control" );
- end Initialize;
-
- procedure Adjust ( AV: in out Simple_Control ) is
- begin
- Adjust_Called := Adjust_Called +1;
- AV.Item := AV.Item +1;
- TC_Trace( "Adjust _1.Simple_Control" );
- end Adjust;
-
- procedure Finalize ( AV: in out Simple_Control ) is
- begin
- Finalize_Called := Finalize_Called +1;
- AV.Item := AV.Item +1;
- TC_Trace( "Finalize _1.Simple_Control" );
- end Finalize;
-
- procedure Validate ( AV: in out Simple_Control ) is
- begin
- Report.Failed("Attempt to Validate at Simple_Control level");
- end Validate;
-
- function Item( AV: Simple_Control'Class ) return String is
- begin
- return Natural'Image(AV.Item);
- end Item;
-
-end C760009_1;
-
----------------------------------------------------------------- C760009_2
-
-with C760009_1;
-with Ada.Finalization;
-package C760009_2 is
-
- type Control is new Ada.Finalization.Controlled with record
- Element_1 : C760009_1.Simple_Control;
- Element_2 : C760009_1.Simple_Control := C760009_1.Empty;
- end record;
-
- procedure Initialize( AV: in out Control );
- procedure Finalize ( AV: in out Control );
-
- Initialized : Natural := 0;
- Finalized : Natural := 0;
-
-end C760009_2;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-package body C760009_2 is
-
- procedure Initialize( AV: in out Control ) is
- begin
- Initialized := Initialized +1;
- C760009_1.TC_Trace( "Initialize _2.Control" );
- end Initialize;
-
- procedure Finalize ( AV: in out Control ) is
- begin
- Finalized := Finalized +1;
- C760009_1.TC_Trace( "Finalize _2.Control" );
- end Finalize;
-
-end C760009_2;
-
----------------------------------------------------------------- C760009_3
-
-with C760009_0;
-with C760009_2;
-package C760009_3 is
-
- type Master_Control is new C760009_2.Control with record
- Data: Integer;
- end record;
-
- procedure Initialize( AC: in out Master_Control );
- -- calls C760009_2.Initialize
- -- embedded data causes 1 call to C760009_1.Initialize
-
- -- Adjusting operation will
- -- make 1 call to C760009_2.Adjust
- -- make 2 call to C760009_1.Adjust
-
- -- Finalize operation will
- -- make 1 call to C760009_2.Finalize
- -- make 2 call to C760009_1.Finalize
-
- procedure Validate( AC: in out Master_Control );
-
- package Check_1 is
- new C760009_0(Master_Control, Validate);
-
-end C760009_3;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-with C760009_1;
-package body C760009_3 is
-
- procedure Initialize( AC: in out Master_Control ) is
- begin
- AC.Data := 42;
- C760009_2.Initialize(C760009_2.Control(AC));
- C760009_1.TC_Trace( "Initialize Master_Control" );
- end Initialize;
-
- procedure Validate( AC: in out Master_Control ) is
- begin
- if AC.Data not in 0..1000 then
- Report.Failed("C760009_3.Control did not Initialize" );
- end if;
- end Validate;
-
-end C760009_3;
-
---------------------------------------------------------------------- C760009
-
-with Report;
-with C760009_1;
-with C760009_2;
-with C760009_3;
-procedure C760009 is
-
- -- Comment following declaration indicates expected calls in the order:
- -- Initialize of a C760009_2 value
- -- Finalize of a C760009_2 value
- -- Initialize of a C760009_1 value
- -- Adjust of a C760009_1 value
- -- Finalize of a C760009_1 value
-
- Global_Control : C760009_3.Master_Control;
- -- 1, 0, 1, 1, 0
-
- Parent_Control : C760009_2.Control;
- -- 1, 0, 1, 1, 0
-
- -- Global_Control is a derived tagged type, the parent type
- -- of Master_Control, Control, is derived from Controlled, and contains
- -- two components of a Controlled type, Simple_Control. One of these
- -- components has a default value, the other does not.
-
- procedure Fail( Which: String; Expect, Got: Natural ) is
- begin
- Report.Failed(Which & " Expected" & Natural'Image(Expect)
- & " got" & Natural'Image(Got) );
- end Fail;
-
- procedure Master_Assertion( Layer_2_Inits : Natural;
- Layer_2_Finals : Natural;
- Layer_1_Inits : Natural;
- Layer_1_Adjs : Natural;
- Layer_1_Finals : Natural;
- Failing_Message : String ) is
-
- begin
-
-
-
- if C760009_2.Initialized /= Layer_2_Inits then
- Fail("C760009_2.Initialize " & Failing_Message,
- Layer_2_Inits, C760009_2.Initialized );
- end if;
-
- if C760009_2.Finalized not in Layer_2_Finals..Layer_2_Finals*2 then
- Fail("C760009_2.Finalize " & Failing_Message,
- Layer_2_Finals, C760009_2.Finalized );
- end if;
-
- if C760009_1.Initialize_Called /= Layer_1_Inits then
- Fail("C760009_1.Initialize " & Failing_Message,
- Layer_1_Inits,
- C760009_1.Initialize_Called );
- end if;
-
- if C760009_1.Adjust_Called not in Layer_1_Adjs..Layer_1_Adjs*2 then
- Fail("C760009_1.Adjust " & Failing_Message,
- Layer_1_Adjs, C760009_1.Adjust_Called );
- end if;
-
- if C760009_1.Finalize_Called not in Layer_1_Finals..Layer_1_Finals*2 then
- Fail("C760009_1.Finalize " & Failing_Message,
- Layer_1_Finals, C760009_1.Finalize_Called );
- end if;
-
- C760009_1.Reset_Counters;
- C760009_2.Initialized := 0;
- C760009_2.Finalized := 0;
-
- end Master_Assertion;
-
- procedure Lesser_Assertion( Layer_2_Inits : Natural;
- Layer_2_Finals : Natural;
- Layer_1_Inits : Natural;
- Layer_1_Adjs : Natural;
- Layer_1_Finals : Natural;
- Failing_Message : String ) is
- begin
-
-
- if C760009_2.Initialized > Layer_2_Inits then
- Fail("C760009_2.Initialize " & Failing_Message,
- Layer_2_Inits, C760009_2.Initialized );
- end if;
-
- if C760009_2.Finalized < Layer_2_Inits
- or C760009_2.Finalized > Layer_2_Finals*2 then
- Fail("C760009_2.Finalize " & Failing_Message,
- Layer_2_Finals, C760009_2.Finalized );
- end if;
-
- if C760009_1.Initialize_Called > Layer_1_Inits then
- Fail("C760009_1.Initialize " & Failing_Message,
- Layer_1_Inits,
- C760009_1.Initialize_Called );
- end if;
-
- if C760009_1.Adjust_Called > Layer_1_Adjs*2 then
- Fail("C760009_1.Adjust " & Failing_Message,
- Layer_1_Adjs, C760009_1.Adjust_Called );
- end if;
-
- if C760009_1.Finalize_Called < Layer_1_Inits
- or C760009_1.Finalize_Called > Layer_1_Finals*2 then
- Fail("C760009_1.Finalize " & Failing_Message,
- Layer_1_Finals, C760009_1.Finalize_Called );
- end if;
-
- C760009_1.Reset_Counters;
- C760009_2.Initialized := 0;
- C760009_2.Finalized := 0;
-
- end Lesser_Assertion;
-
-begin -- Main test procedure.
-
- Report.Test ("C760009", "Check that for an extension_aggregate whose " &
- "ancestor_part is a subtype_mark, Initialize " &
- "is called on all controlled subcomponents of " &
- "the ancestor part. Also check that the " &
- "utilization of a controlled type for a generic " &
- "actual parameter supports the correct behavior " &
- "in the instantiated software" );
-
- C760009_1.TC_Trace( "=====> Case 0 <=====" );
-
- C760009_1.Reset_Counters;
- C760009_2.Initialized := 0;
- C760009_2.Finalized := 0;
-
- C760009_3.Validate( Global_Control ); -- check that it Initialized correctly
-
- C760009_1.TC_Trace( "=====> Case 1 <=====" );
-
- C760009_3.Check_1.TC_Check_1( ( C760009_2.Control with Data => 1 ) );
- Lesser_Assertion( 2, 3, 2, 3, 6, "Check_1.TC_Check_1" );
- -- | | | | + Finalize 2 embedded in aggregate
- -- | | | | + Finalize 2 at assignment in TC_Check_1
- -- | | | | + Finalize 2 embedded in local variable
- -- | | | + Adjust 2 caused by assignment in TC_Check_1
- -- | | | + Adjust at declaration in TC_Check_1
- -- | | + Initialize at declaration in TC_Check_1
- -- | | + Initialize of aggregate object
- -- | + Finalize of assignment target
- -- | + Finalize of local variable
- -- | + Finalize of aggregate object
- -- + Initialize of aggregate object
- -- + Initialize of local variable
-
-
- C760009_1.TC_Trace( "=====> Case 2 <=====" );
-
- C760009_3.Check_1.TC_Check_2( Global_Control );
- Master_Assertion( 1, 2, 1, 3, 4, "Check_1.TC_Check_2" );
- -- | | | | + Finalize 2 at assignment in TC_Check_2
- -- | | | | + Finalize 2 embedded in local variable
- -- | | | + Adjust 2 caused by assignment in TC_Check_2
- -- | | | + Adjust at declaration in TC_Check_2
- -- | | + Initialize at declaration in TC_Check_2
- -- | + Finalize of assignment target
- -- | + Finalize of local variable
- -- + Initialize of local variable
-
-
- C760009_1.TC_Trace( "=====> Case 3 <=====" );
-
- Global_Control := ( C760009_2.Control with Data => 2 );
- Lesser_Assertion( 1, 1, 1, 3, 2, "Aggregate -> object" );
- -- | | | | + Finalize 2 by assignment
- -- | | | + Adjust 2 caused by assignment
- -- | | | + Adjust in aggregate creation
- -- | | + Initialize of aggregate object
- -- | + Finalize of assignment target
- -- + Initialize of aggregate object
-
-
- C760009_1.TC_Trace( "=====> Case 4 <=====" );
-
- C760009_3.Check_1.TC_Check_3( Global_Control );
- Master_Assertion( 1, 2, 1, 3, 4, "Check_1.TC_Check_3" );
- -- | | | | + Finalize 2 at assignment in TC_Check_3
- -- | | | | + Finalize 2 embedded in local variable
- -- | | | + Adjust 2 at assignment in TC_Check_3
- -- | | | + Adjust in local variable creation
- -- | | + Initialize of local variable in TC_Check_3
- -- | + Finalize of assignment target
- -- | + Finalize of local variable
- -- + Initialize of local variable
-
-
- C760009_1.TC_Trace( "=====> Case 5 <=====" );
-
- Global_Control := ( Parent_Control with Data => 3 );
- Lesser_Assertion( 1, 1, 1, 3, 2, "Object Aggregate -> object" );
- -- | | | | + Finalize 2 by assignment
- -- | | | + Adjust 2 caused by assignment
- -- | | | + Adjust in aggregate creation
- -- | | + Initialize of aggregate object
- -- | + Finalize of assignment target
- -- + Initialize of aggregate object
-
-
-
- C760009_1.TC_Trace( "=====> Case 6 <=====" );
-
- -- perform this check a second time to make sure nothing is "remembered"
-
- C760009_3.Check_1.TC_Check_3( Global_Control );
- Master_Assertion( 1, 2, 1, 3, 4, "Check_1.TC_Check_3 second time" );
- -- | | | | + Finalize 2 at assignment in TC_Check_3
- -- | | | | + Finalize 2 embedded in local variable
- -- | | | + Adjust 2 at assignment in TC_Check_3
- -- | | | + Adjust in local variable creation
- -- | | + Initialize of local variable in TC_Check_3
- -- | + Finalize of assignment target
- -- | + Finalize of local variable
- -- + Initialize of local variable
-
-
- Report.Result;
-
-end C760009;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c760010.a b/gcc/testsuite/ada/acats/tests/c7/c760010.a
deleted file mode 100644
index 08fe62b9fa4..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c760010.a
+++ /dev/null
@@ -1,418 +0,0 @@
--- C760010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that explicit calls to Initialize, Adjust and Finalize
--- procedures that raise exceptions propagate the exception raised,
--- not Program_Error. Check this for both a user defined exception
--- and a language defined exception. Check that implicit calls to
--- initialize procedures that raise an exception propagate the
--- exception raised, not Program_Error;
---
--- Check that the utilization of a controlled type as the actual for
--- a generic formal tagged private parameter supports the correct
--- behavior in the instantiated software.
---
--- TEST DESCRIPTION:
--- Declares a generic package instantiated to check that controlled
--- types are not impacted by the "generic boundary."
--- This instance is then used to perform the tests of various calls to
--- the procedures. After each operation in the main program that should
--- cause implicit calls where an exception is raised, the program handles
--- Program_Error. After each explicit call, the program handles the
--- Expected_Error. Handlers for the opposite exception are provided to
--- catch the obvious failure modes. The predefined exception
--- Tasking_Error is used to be certain that some other reason has not
--- raised a predefined exception.
---
---
--- DATA STRUCTURES
---
--- C760010_1.Simple_Control is derived from
--- Ada.Finalization.Controlled
---
--- C760010_2.Embedded_Derived is derived from C760010_1.Simple_Control
--- by way of generic instantiation
---
---
--- CHANGE HISTORY:
--- 01 MAY 95 SAIC Initial version
--- 23 APR 96 SAIC Fix visibility problem for 2.1
--- 14 NOV 96 SAIC Revisit for 2.1 release
--- 26 JUN 98 EDS Added pragma Elaborate_Body to
--- package C760010_0.Check_Formal_Tagged
--- to avoid possible instantiation error
---!
-
----------------------------------------------------------------- C760010_0
-
-package C760010_0 is
-
- User_Defined_Exception : exception;
-
- type Actions is ( No_Action,
- Init_Raise_User_Defined, Init_Raise_Standard,
- Adj_Raise_User_Defined, Adj_Raise_Standard,
- Fin_Raise_User_Defined, Fin_Raise_Standard );
-
- Action : Actions := No_Action;
-
- function Unique return Natural;
-
-end C760010_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-package body C760010_0 is
-
- Value : Natural := 101;
-
- function Unique return Natural is
- begin
- Value := Value +1;
- return Value;
- end Unique;
-
-end C760010_0;
-
----------------------------------------------------------------- C760010_0
------------------------------------------------------- Check_Formal_Tagged
-
-generic
-
- type Formal_Tagged is tagged private;
-
-package C760010_0.Check_Formal_Tagged is
-
- pragma Elaborate_Body;
-
- type Embedded_Derived is new Formal_Tagged with record
- TC_Meaningless_Value : Natural := Unique;
- end record;
-
- procedure Initialize( ED: in out Embedded_Derived );
- procedure Adjust ( ED: in out Embedded_Derived );
- procedure Finalize ( ED: in out Embedded_Derived );
-
-end C760010_0.Check_Formal_Tagged;
-
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body C760010_0.Check_Formal_Tagged is
-
-
- procedure Initialize( ED: in out Embedded_Derived ) is
- begin
- ED.TC_Meaningless_Value := Unique;
- case Action is
- when Init_Raise_User_Defined => raise User_Defined_Exception;
- when Init_Raise_Standard => raise Tasking_Error;
- when others => null;
- end case;
- end Initialize;
-
- procedure Adjust ( ED: in out Embedded_Derived ) is
- begin
- ED.TC_Meaningless_Value := Unique;
- case Action is
- when Adj_Raise_User_Defined => raise User_Defined_Exception;
- when Adj_Raise_Standard => raise Tasking_Error;
- when others => null;
- end case;
- end Adjust;
-
- procedure Finalize ( ED: in out Embedded_Derived ) is
- begin
- ED.TC_Meaningless_Value := Unique;
- case Action is
- when Fin_Raise_User_Defined => raise User_Defined_Exception;
- when Fin_Raise_Standard => raise Tasking_Error;
- when others => null;
- end case;
- end Finalize;
-
-end C760010_0.Check_Formal_Tagged;
-
----------------------------------------------------------------- C760010_1
-
-with Ada.Finalization;
-package C760010_1 is
-
- procedure Check_Counters(Init,Adj,Fin : Natural; Message: String);
- procedure Reset_Counters;
-
- type Simple_Control is new Ada.Finalization.Controlled with record
- Item: Integer;
- end record;
- procedure Initialize( AV: in out Simple_Control );
- procedure Adjust ( AV: in out Simple_Control );
- procedure Finalize ( AV: in out Simple_Control );
-
-end C760010_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body C760010_1 is
-
- Initialize_Called : Natural;
- Adjust_Called : Natural;
- Finalize_Called : Natural;
-
- procedure Check_Counters(Init,Adj,Fin : Natural; Message: String) is
- begin
- if Init /= Initialize_Called then
- Report.Failed("Initialize mismatch " & Message);
- end if;
- if Adj /= Adjust_Called then
- Report.Failed("Adjust mismatch " & Message);
- end if;
- if Fin /= Finalize_Called then
- Report.Failed("Finalize mismatch " & Message);
- end if;
- end Check_Counters;
-
- procedure Reset_Counters is
- begin
- Initialize_Called := 0;
- Adjust_Called := 0;
- Finalize_Called := 0;
- end Reset_Counters;
-
- procedure Initialize( AV: in out Simple_Control ) is
- begin
- Initialize_Called := Initialize_Called +1;
- AV.Item := 0;
- end Initialize;
-
- procedure Adjust ( AV: in out Simple_Control ) is
- begin
- Adjust_Called := Adjust_Called +1;
- AV.Item := AV.Item +1;
- end Adjust;
-
- procedure Finalize ( AV: in out Simple_Control ) is
- begin
- Finalize_Called := Finalize_Called +1;
- AV.Item := AV.Item +1;
- end Finalize;
-
-end C760010_1;
-
----------------------------------------------------------------- C760010_2
-
-with C760010_0.Check_Formal_Tagged;
-with C760010_1;
-package C760010_2 is
- new C760010_0.Check_Formal_Tagged(C760010_1.Simple_Control);
-
----------------------------------------------------------------------------
-
-with Report;
-with C760010_0;
-with C760010_1;
-with C760010_2;
-procedure C760010 is
-
- use type C760010_0.Actions;
-
- procedure Case_Failure(Message: String) is
- begin
- Report.Failed(Message & " for case "
- & C760010_0.Actions'Image(C760010_0.Action) );
- end Case_Failure;
-
- procedure Check_Implicit_Initialize is
- Item : C760010_2.Embedded_Derived; -- exception here propagates to
- Gadget : C760010_2.Embedded_Derived; -- caller
- begin
- if C760010_0.Action
- in C760010_0.Init_Raise_User_Defined..C760010_0.Init_Raise_Standard
- then
- Case_Failure("Anticipated exception at implicit init");
- end if;
- begin
- Item := Gadget; -- exception here handled locally
- if C760010_0.Action in C760010_0.Adj_Raise_User_Defined
- .. C760010_0.Fin_Raise_Standard then
- Case_Failure ("Anticipated exception at assignment");
- end if;
- exception
- when Program_Error =>
- if C760010_0.Action not in C760010_0.Adj_Raise_User_Defined
- .. C760010_0.Fin_Raise_Standard then
- Report.Failed("Program_Error in Check_Implicit_Initialize");
- end if;
- when Tasking_Error =>
- Report.Failed("Tasking_Error in Check_Implicit_Initialize");
- when C760010_0.User_Defined_Exception =>
- Report.Failed("User_Error in Check_Implicit_Initialize");
- when others =>
- Report.Failed("Wrong exception Check_Implicit_Initialize");
- end;
- end Check_Implicit_Initialize;
-
----------------------------------------------------------------------------
-
- Global_Item : C760010_2.Embedded_Derived;
-
----------------------------------------------------------------------------
-
- procedure Check_Explicit_Initialize is
- begin
- begin
- C760010_2.Initialize( Global_Item );
- if C760010_0.Action
- in C760010_0.Init_Raise_User_Defined..C760010_0.Init_Raise_Standard
- then
- Case_Failure("Anticipated exception at explicit init");
- end if;
- exception
- when Program_Error =>
- Report.Failed("Program_Error in Check_Explicit_Initialize");
- when Tasking_Error =>
- if C760010_0.Action /= C760010_0.Init_Raise_Standard then
- Report.Failed("Tasking_Error in Check_Explicit_Initialize");
- end if;
- when C760010_0.User_Defined_Exception =>
- if C760010_0.Action /= C760010_0.Init_Raise_User_Defined then
- Report.Failed("User_Error in Check_Explicit_Initialize");
- end if;
- when others =>
- Report.Failed("Wrong exception in Check_Explicit_Initialize");
- end;
- end Check_Explicit_Initialize;
-
----------------------------------------------------------------------------
-
- procedure Check_Explicit_Adjust is
- begin
- begin
- C760010_2.Adjust( Global_Item );
- if C760010_0.Action
- in C760010_0.Adj_Raise_User_Defined..C760010_0.Adj_Raise_Standard
- then
- Case_Failure("Anticipated exception at explicit Adjust");
- end if;
- exception
- when Program_Error =>
- Report.Failed("Program_Error in Check_Explicit_Adjust");
- when Tasking_Error =>
- if C760010_0.Action /= C760010_0.Adj_Raise_Standard then
- Report.Failed("Tasking_Error in Check_Explicit_Adjust");
- end if;
- when C760010_0.User_Defined_Exception =>
- if C760010_0.Action /= C760010_0.Adj_Raise_User_Defined then
- Report.Failed("User_Error in Check_Explicit_Adjust");
- end if;
- when others =>
- Report.Failed("Wrong exception in Check_Explicit_Adjust");
- end;
- end Check_Explicit_Adjust;
-
----------------------------------------------------------------------------
-
- procedure Check_Explicit_Finalize is
- begin
- begin
- C760010_2.Finalize( Global_Item );
- if C760010_0.Action
- in C760010_0.Fin_Raise_User_Defined..C760010_0.Fin_Raise_Standard
- then
- Case_Failure("Anticipated exception at explicit Finalize");
- end if;
- exception
- when Program_Error =>
- Report.Failed("Program_Error in Check_Explicit_Finalize");
- when Tasking_Error =>
- if C760010_0.Action /= C760010_0.Fin_Raise_Standard then
- Report.Failed("Tasking_Error in Check_Explicit_Finalize");
- end if;
- when C760010_0.User_Defined_Exception =>
- if C760010_0.Action /= C760010_0.Fin_Raise_User_Defined then
- Report.Failed("User_Error in Check_Explicit_Finalize");
- end if;
- when others =>
- Report.Failed("Wrong exception in Check_Explicit_Finalize");
- end;
- end Check_Explicit_Finalize;
-
----------------------------------------------------------------------------
-
-begin -- Main test procedure.
-
- Report.Test ("C760010", "Check that explicit calls to finalization " &
- "procedures that raise exceptions propagate " &
- "the exception raised. Check the utilization " &
- "of a controlled type as the actual for a " &
- "generic formal tagged private parameter" );
-
- for Act in C760010_0.Actions loop
- C760010_1.Reset_Counters;
- C760010_0.Action := Act;
-
- begin
- Check_Implicit_Initialize;
- if Act in
- C760010_0.Init_Raise_User_Defined..C760010_0.Init_Raise_Standard then
- Case_Failure("No exception at Check_Implicit_Initialize");
- end if;
- exception
- when Tasking_Error =>
- if Act /= C760010_0.Init_Raise_Standard then
- Case_Failure("Tasking_Error at Check_Implicit_Initialize");
- end if;
- when C760010_0.User_Defined_Exception =>
- if Act /= C760010_0.Init_Raise_User_Defined then
- Case_Failure("User_Error at Check_Implicit_Initialize");
- end if;
- when Program_Error =>
- -- If finalize raises an exception, all other object are finalized
- -- first and Program_Error is raised upon leaving the master scope.
- -- 7.6.1:14
- if Act not in C760010_0.Fin_Raise_User_Defined..
- C760010_0.Fin_Raise_Standard then
- Case_Failure("Program_Error at Check_Implicit_Initialize");
- end if;
- when others =>
- Case_Failure("Wrong exception at Check_Implicit_Initialize");
- end;
-
- Check_Explicit_Initialize;
- Check_Explicit_Adjust;
- Check_Explicit_Finalize;
-
- C760010_1.Check_Counters(0,0,0, C760010_0.Actions'Image(Act));
-
- end loop;
-
- -- Set to No_Action to avoid exception in finalizing Global_Item
- C760010_0.Action := C760010_0.No_Action;
-
- Report.Result;
-
-end C760010;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c760011.a b/gcc/testsuite/ada/acats/tests/c7/c760011.a
deleted file mode 100644
index 8df37fa3c8b..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c760011.a
+++ /dev/null
@@ -1,291 +0,0 @@
--- C760011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the anonymous objects of a controlled type associated with
--- function results and aggregates are finalized no later than the
--- end of the innermost enclosing declarative_item or statement. Also
--- check this for function calls and aggregates of a noncontrolled type
--- with controlled components.
---
--- TEST DESCRIPTION:
--- This test defines a controlled type with a discriminant, the
--- discriminant is use as an index into a global table to indicate that
--- the object has been finalized. The controlled type is used as the
--- component of a non-controlled type, and the non-controlled type is
--- used for the same set of tests. Following is a table of the tests
--- performed and their associated tag character.
---
--- 7.6(21) allows for the optimizations that remove these temporary
--- objects from ever existing. As such this test checks that in the
--- case the object was initialized (the only access we have to
--- determining if it ever existed) it must subsequently be finalized.
---
--- CASE TABLE:
--- A - aggregate test, controlled
--- B - aggregate test, controlled
--- C - aggregate test, non_controlled
--- D - function test, controlled
--- E - function test, non_controlled
--- F - formal parameter function test, controlled
--- G - formal parameter aggregate test, controlled
--- H - formal parameter function test, non_controlled
--- I - formal parameter aggregate test, non_controlled
---
--- X - scratch object, not consequential to the objective
--- Y - scratch object, not consequential to the objective
--- Z - scratch object, not consequential to the objective
---
---
--- CHANGE HISTORY:
--- 22 MAY 95 SAIC Initial version
--- 24 APR 96 SAIC Minor doc fixes, visibility patch
--- 14 NOV 96 SAIC Revised for release 2.1
---
---!
-
-------------------------------------------------------------------- C760011_0
-
-with Ada.Finalization;
-package C760011_0 is
- type Tracking_Array is array(Character range 'A'..'Z') of Boolean;
-
- Initialized : Tracking_Array := (others => False);
- Finalized : Tracking_Array := (others => False);
-
- type Controlled_Type(Tag : Character) is
- new Ada.Finalization.Controlled with record
- TC_Component : String(1..4) := "ACVC";
- end record;
- procedure Initialize( It: in out Controlled_Type );
- procedure Finalize ( It: in out Controlled_Type );
- function Create(With_Tag: Character) return Controlled_Type;
-
- type Non_Controlled(Tag : Character := 'Y') is record
- Controlled_Component : Controlled_Type(Tag);
- end record;
- procedure Initialize( It: in out Non_Controlled );
- procedure Finalize ( It: in out Non_Controlled );
- function Create(With_Tag: Character) return Non_Controlled;
-
- Under_Debug : constant Boolean := False; -- construction lines
-
-end C760011_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body C760011_0 is
-
- procedure Initialize( It: in out Controlled_Type ) is
- begin
- It.TC_Component := (others => It.Tag);
- if It.Tag in Tracking_Array'Range then
- Initialized(It.Tag) := True;
- end if;
- if Under_Debug then
- Report.Comment("Initializing Tag: " & It.Tag );
- end if;
- end Initialize;
-
- procedure Finalize( It: in out Controlled_Type ) is
- begin
- if Under_Debug then
- Report.Comment("Finalizing for Tag: " & It.Tag );
- end if;
- if It.Tag in Finalized'Range then
- Finalized(It.Tag) := True;
- end if;
- end Finalize;
-
- function Create(With_Tag: Character) return Controlled_Type is
- begin
- return Controlled_Type'(Ada.Finalization.Controlled
- with Tag => With_Tag,
- TC_Component => "*CON" );
- end Create;
-
- procedure Initialize( It: in out Non_Controlled ) is
- begin
- Report.Failed("Called Initialize for Non_Controlled");
- end Initialize;
-
- procedure Finalize( It: in out Non_Controlled ) is
- begin
- Report.Failed("Called Finalize for Non_Controlled");
- end Finalize;
-
- function Create(With_Tag: Character) return Non_Controlled is
- begin
- return Non_Controlled'(Tag => With_Tag, Controlled_Component => (
- Ada.Finalization.Controlled
- with Tag => With_Tag,
- TC_Component => "#NON" ) );
- end Create;
-
-end C760011_0;
-
---------------------------------------------------------------------- C760011
-
-with Report;
-with TCTouch;
-with C760011_0;
-with Ada.Finalization; -- needed to be able to create extension aggregates
-procedure C760011 is
-
- use type C760011_0.Controlled_Type;
- use type C760011_0.Controlled_Type'Class;
- use type C760011_0.Non_Controlled;
-
- subtype AFC is Ada.Finalization.Controlled;
-
- procedure Check_Result( Tag : Character; Message : String ) is
- -- make allowance for 7.6(21) optimizations
- begin
- if C760011_0.Initialized(Tag) then
- TCTouch.Assert(C760011_0.Finalized(Tag),Message);
- elsif C760011_0.Under_Debug then
- Report.Comment("Optimized away: " & Tag );
- end if;
- end Check_Result;
-
- procedure Subtest_1 is
-
-
- procedure Subtest_1_Local_1 is
- An_Object : C760011_0.Controlled_Type'Class
- := C760011_0.Controlled_Type'(AFC with 'X', "ONE*");
- -- initialize An_Object
- begin
- if C760011_0.Controlled_Type(An_Object)
- = C760011_0.Controlled_Type'(AFC with 'A', "ONE*") then
- Report.Failed("Comparison bad"); -- A = X !!!
- end if;
- end Subtest_1_Local_1;
- -- An_Object must be Finalized by this point.
-
- procedure Subtest_1_Local_2 is
- An_Object : C760011_0.Controlled_Type('B');
- begin
- An_Object := (AFC with 'B', "TWO!" );
- if Report.Ident_Char(An_Object.Tag) /= 'B' then
- Report.Failed("Subtest_1_Local_2 Optimization Foil: Bad Data!");
- end if;
- exception
- when others => Report.Failed("Bad controlled assignment");
- end Subtest_1_Local_2;
- -- An_Object must be Finalized by this point.
-
- procedure Subtest_1_Local_3 is
- An_Object : C760011_0.Non_Controlled('C');
- begin
- TCTouch.Assert_Not(C760011_0.Finalized('C'),
- "Non_Controlled declaration C");
- An_Object := C760011_0.Non_Controlled'('C', Controlled_Component
- => (AFC with 'C', "TEE!"));
- if Report.Ident_Char(An_Object.Tag) /= 'C' then
- Report.Failed("Subtest_1_Local_3 Optimization Foil: Bad Data!");
- end if;
- end Subtest_1_Local_3;
- -- Only controlled components of An_Object must be finalized; it is an
- -- error to call Finalize for An_Object
-
- begin
- Subtest_1_Local_1;
- Check_Result( 'A', "Aggregate in subprogram 1" );
-
- Subtest_1_Local_2;
- Check_Result( 'B', "Aggregate in subprogram 2" );
-
- Subtest_1_Local_3;
- Check_Result( 'C', "Embedded aggregate in subprogram 3" );
- end Subtest_1;
-
-
- procedure Subtest_2 is
- -- using 'Z' for both evades order issues
- Con_Object : C760011_0.Controlled_Type('Z');
- Non_Object : C760011_0.Non_Controlled('Z');
- begin
- if Report.Ident_Bool( Con_Object = C760011_0.Create('D') ) then
- Report.Failed("Con_Object catastrophe");
- end if;
- -- Controlled function result should be finalized by now
- Check_Result( 'D', "Function Result" );
-
- if Report.Ident_Bool( Non_Object = C760011_0.Create('E') ) then
- Report.Failed("Non_Object catastrophe");
- end if;
- -- Controlled component of function result should be finalized by now
- Check_Result( 'E', "Function Result" );
- end Subtest_2;
-
-
- procedure Subtest_3(Con : in C760011_0.Controlled_Type) is
- begin
- if Con.Tag not in 'F'..'G' then
- Report.Failed("Bad value passed to subtest 3 " & Con.Tag & ' '
- & Report.Ident_Str(Con.TC_Component));
- end if;
- end Subtest_3;
-
-
- procedure Subtest_4(Non : in C760011_0.Non_Controlled) is
- begin
- if Non.Tag not in 'H'..'I' then
- Report.Failed("Bad value passed to subtest 4 "
- & Non.Tag & ' '
- & Report.Ident_Str(Non.Controlled_Component.TC_Component));
- end if;
- end Subtest_4;
-
-
-begin -- Main test procedure.
-
- Report.Test ("C760011", "Check that anonymous objects of controlled " &
- "types or types containing controlled types " &
- "are finalized no later than the end of the " &
- "innermost enclosing declarative_item or " &
- "statement" );
-
- Subtest_1;
-
- Subtest_2;
-
- Subtest_3(C760011_0.Create('F'));
- Check_Result( 'F', "Function as formal F" );
-
- Subtest_3(C760011_0.Controlled_Type'(AFC with 'G',"GIGI"));
- Check_Result( 'G', "Aggregate as formal G" );
-
- Subtest_4(C760011_0.Create('H'));
- Check_Result( 'H', "Function as formal H" );
-
- Subtest_4(C760011_0.Non_Controlled'('I', (AFC with 'I',"IAGO")));
- Check_Result( 'I', "Aggregate as formal I" );
-
- Report.Result;
-
-end C760011;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c760012.a b/gcc/testsuite/ada/acats/tests/c7/c760012.a
deleted file mode 100644
index 08986a838c4..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c760012.a
+++ /dev/null
@@ -1,256 +0,0 @@
--- C760012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that record components that have per-object access discriminant
--- constraints are initialized in the order of their component
--- declarations, and after any components that are not so constrained.
---
--- Check that record components that have per-object access discriminant
--- constraints are finalized in the reverse order of their component
--- declarations, and before any components that are not so constrained.
---
--- TEST DESCRIPTION:
--- The type List_Item is the "container" type. It holds two fields that
--- have per-object access discriminant constraints, and two fields that
--- are not discriminated. These four fields are all controlled types.
--- A fifth field is a pointer used to maintain a linked list of these
--- data objects. Each component is of a unique type which allows for
--- the test to simply track the order of initialization and finalization.
---
--- The types and their purpose are:
--- Constrained_First - a controlled discriminated type
--- Constrained_Second - a controlled discriminated type
--- Simple_First - a controlled type with no discriminant
--- Simple_Second - a controlled type with no discriminant
---
--- The required order of operations:
--- Initialize
--- ( Simple_First | Simple_Second ) -- no "internal order" required
--- Constrained_First
--- Constrained_Second
--- Finalize
--- Constrained_Second
--- Constrained_First
--- ( Simple_First | Simple_Second ) -- must be inverse of init.
---
---
--- CHANGE HISTORY:
--- 23 MAY 95 SAIC Initial version
--- 02 MAY 96 SAIC Reorganized for 2.1
--- 05 DEC 96 SAIC Simplified for 2.1; added init/fin ordering check
--- 31 DEC 97 EDS Remove references to and uses of
--- Initialization_Sequence
---!
-
----------------------------------------------------------------- C760012_0
-
-with Ada.Finalization;
-with Ada.Unchecked_Deallocation;
-package C760012_0 is
-
- type List_Item;
-
- type List is access all List_Item;
-
- package Firsts is -- distinguish first from second
- type Constrained_First(Container : access List_Item) is
- new Ada.Finalization.Limited_Controlled with null record;
- procedure Initialize( T : in out Constrained_First );
- procedure Finalize ( T : in out Constrained_First );
-
- type Simple_First is new Ada.Finalization.Controlled with
- record
- My_Init_Seq_Number : Natural;
- end record;
- procedure Initialize( T : in out Simple_First );
- procedure Finalize ( T : in out Simple_First );
-
- end Firsts;
-
- type Constrained_Second(Container : access List_Item) is
- new Ada.Finalization.Limited_Controlled with null record;
- procedure Initialize( T : in out Constrained_Second );
- procedure Finalize ( T : in out Constrained_Second );
-
- type Simple_Second is new Ada.Finalization.Controlled with
- record
- My_Init_Seq_Number : Natural;
- end record;
- procedure Initialize( T : in out Simple_Second );
- procedure Finalize ( T : in out Simple_Second );
-
- -- by 3.8(18);6.0 the following type contains components constrained
- -- by per-object expressions
-
-
- type List_Item is new Ada.Finalization.Limited_Controlled
- with record
- ContentA : Firsts.Constrained_First( List_Item'Access ); -- C S
- SimpleA : Firsts.Simple_First; -- A T
- SimpleB : Simple_Second; -- A T
- ContentB : Constrained_Second( List_Item'Access ); -- D R
- Next : List; -- | |
- end record; -- | |
- procedure Initialize( L : in out List_Item ); ------------------+ |
- procedure Finalize ( L : in out List_Item ); --------------------+
-
- -- the tags are the same for SimpleA and SimpleB due to the fact that
- -- the language does not specify an ordering with respect to this
- -- component pair. 7.6(12) does specify the rest of the ordering.
-
- procedure Deallocate is new Ada.Unchecked_Deallocation(List_Item,List);
-
-end C760012_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-package body C760012_0 is
-
- package body Firsts is
-
- procedure Initialize( T : in out Constrained_First ) is
- begin
- TCTouch.Touch('C'); ----------------------------------------------- C
- end Initialize;
-
- procedure Finalize ( T : in out Constrained_First ) is
- begin
- TCTouch.Touch('S'); ----------------------------------------------- S
- end Finalize;
-
- procedure Initialize( T : in out Simple_First ) is
- begin
- T.My_Init_Seq_Number := 0;
- TCTouch.Touch('A'); ----------------------------------------------- A
- end Initialize;
-
- procedure Finalize ( T : in out Simple_First ) is
- begin
- TCTouch.Touch('T'); ----------------------------------------------- T
- end Finalize;
-
- end Firsts;
-
- procedure Initialize( T : in out Constrained_Second ) is
- begin
- TCTouch.Touch('D'); ------------------------------------------------- D
- end Initialize;
-
- procedure Finalize ( T : in out Constrained_Second ) is
- begin
- TCTouch.Touch('R'); ------------------------------------------------- R
- end Finalize;
-
-
- procedure Initialize( T : in out Simple_Second ) is
- begin
- T.My_Init_Seq_Number := 0;
- TCTouch.Touch('A'); ------------------------------------------------- A
- end Initialize;
-
- procedure Finalize ( T : in out Simple_Second ) is
- begin
- TCTouch.Touch('T'); ------------------------------------------------- T
- end Finalize;
-
- procedure Initialize( L : in out List_Item ) is
- begin
- TCTouch.Touch('F'); ------------------------------------------------- F
- end Initialize;
-
- procedure Finalize ( L : in out List_Item ) is
- begin
- TCTouch.Touch('Q'); ------------------------------------------------- Q
- end Finalize;
-
-end C760012_0;
-
---------------------------------------------------------------------- C760012
-
-with Report;
-with TCTouch;
-with C760012_0;
-procedure C760012 is
-
- use type C760012_0.List;
-
- procedure Subtest_1 is
- -- by 3.8(18);6.0 One_Of_Them is constrained by per-object constraints
- -- 7.6.1(9);6.0 dictates the order of finalization of the components
-
- One_Of_Them : C760012_0.List_Item;
- begin
- if One_Of_Them.Next /= null then -- just to hold the subtest in place
- Report.Failed("No default value for Next");
- end if;
- end Subtest_1;
-
- List : C760012_0.List;
-
- procedure Subtest_2 is
- begin
-
- List := new C760012_0.List_Item;
-
- List.Next := new C760012_0.List_Item;
-
- end Subtest_2;
-
- procedure Subtest_3 is
- begin
-
- C760012_0.Deallocate( List.Next );
-
- C760012_0.Deallocate( List );
-
- end Subtest_3;
-
-begin -- Main test procedure.
-
- Report.Test ("C760012", "Check that record components that have " &
- "per-object access discriminant constraints " &
- "are initialized in the order of their " &
- "component declarations, and after any " &
- "components that are not so constrained. " &
- "Check that record components that have " &
- "per-object access discriminant constraints " &
- "are finalized in the reverse order of their " &
- "component declarations, and before any " &
- "components that are not so constrained" );
-
- Subtest_1;
- TCTouch.Validate("AACDFQRSTT", "One object");
-
- Subtest_2;
- TCTouch.Validate("AACDFAACDF", "Two objects dynamically allocated");
-
- Subtest_3;
- TCTouch.Validate("QRSTTQRSTT", "Two objects deallocated");
-
- Report.Result;
-
-end C760012;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c760013.a b/gcc/testsuite/ada/acats/tests/c7/c760013.a
deleted file mode 100644
index 6921bf02764..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c760013.a
+++ /dev/null
@@ -1,108 +0,0 @@
--- C760013.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Initialize is not called for default-initialized subcomponents
--- of the ancestor type of an extension aggregate. (Defect Report
--- 8652/0021, Technical Corrigendum 7.6(11/1)).
---
--- CHANGE HISTORY:
--- 25 JAN 2001 PHL Initial version.
--- 29 JUN 2001 RLB Reformatted for ACATS.
---
---!
-with Ada.Finalization;
-use Ada.Finalization;
-package C760013_0 is
-
- type Ctrl1 is new Controlled with
- record
- C : Integer := 0;
- end record;
- type Ctrl2 is new Controlled with
- record
- C : Integer := 0;
- end record;
-
- procedure Initialize (Obj1 : in out Ctrl1);
- procedure Initialize (Obj2 : in out Ctrl2);
-
-end C760013_0;
-
-with Report;
-use Report;
-package body C760013_0 is
-
- procedure Initialize (Obj1 : in out Ctrl1) is
- begin
- Obj1.C := Ident_Int (47);
- end Initialize;
-
- procedure Initialize (Obj2 : in out Ctrl2) is
- begin
- Failed ("Initialize called for type Ctrl2");
- end Initialize;
-
-end C760013_0;
-
-with Ada.Finalization;
-with C760013_0;
-use C760013_0;
-with Report;
-use Report;
-procedure C760013 is
-
- type T is tagged
- record
- C1 : Ctrl1;
- C2 : Ctrl2 := (Ada.Finalization.Controlled with
- C => Ident_Int (23));
- end record;
-
- type Nt is new T with
- record
- C3 : Float;
- end record;
-
- X : Nt;
-
-begin
- Test ("C760013",
- "Check that Initialize is not called for " &
- "default-initialized subcomponents of the ancestor type of an " &
- "extension aggregate");
-
- X := (T with C3 => 5.0);
-
- if X.C1.C /= Ident_Int (47) then
- Failed ("Initialize not called for type Ctrl1");
- end if;
- if X.C2.C /= Ident_Int (23) then
- Failed ("Initial value not assigned for type Ctrl2");
- end if;
-
- Result;
-end C760013;
-
diff --git a/gcc/testsuite/ada/acats/tests/c7/c761001.a b/gcc/testsuite/ada/acats/tests/c7/c761001.a
deleted file mode 100644
index 7be1ee07a93..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c761001.a
+++ /dev/null
@@ -1,117 +0,0 @@
--- C761001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that controlled objects declared immediately within a library
--- package are finalized following the completion of the environment
--- task (and prior to termination of the program).
---
--- TEST DESCRIPTION:
--- This test derives a type from Ada.Finalization.Controlled, and
--- declares an object of that type in the body of a library package.
--- The dispatching procedure Finalize is redefined for the derived
--- type to perform a check that it has been called only once, and in
--- turn calls Report.Result. This test may fail by not calling
--- Report.Result. This test may also fail by calling Report.Result
--- twice, the first call will report a false pass.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 13 Nov 95 SAIC Updated for ACVC 2.0.1
---
---!
-
-with Ada.Finalization;
-package C761001_0 is
-
- type Global is new Ada.Finalization.Controlled with null record;
- procedure Finalize( It: in out Global );
-
-end C761001_0;
-
-package C761001_1 is
-
- task Library_Task is
- entry Never_Called;
- end Library_Task;
-
-end C761001_1;
-
-with Report;
-with C761001_1;
-package body C761001_0 is
-
- My_Object : Global;
-
- Done : Boolean := False;
-
- procedure Finalize( It: in out Global ) is
- begin
- if not C761001_1.Library_Task'Terminated then
- Report.Failed("Library task not terminated before finalize");
- end if;
- if Done then -- checking included "just in case"
- Report.Comment("Test FAILED, even if previously reporting passed");
- Report.Failed("Unwarranted multiple call to finalize");
- end if;
- Report.Result;
- Done := True;
- end Finalize;
-
-end C761001_0;
-
-with Report;
-package body C761001_1 is
-
- task body Library_Task is
- begin
- if Report.Ident_Int( 1 ) /= 1 then
- Report.Failed( "Baseline failure in Library_Task");
- end if;
- end Library_Task;
-
-end C761001_1;
-
-with Report;
-with C761001_0;
-
-procedure C761001 is
-
-begin -- Main test procedure.
-
- Report.Test ("C761001", "Check that controlled objects declared "
- & "immediately within a library package are "
- & "finalized following the completion of the "
- & "environment task (and prior to termination "
- & "of the program)");
-
- -- note that if the test DOES call report twice, the first will report a
- -- false pass, the second call will correctly fail the test.
-
- -- not calling Report.Result;
- -- Result is called as part of the finalization of C761001_0.My_Object.
-
-end C761001;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c761002.a b/gcc/testsuite/ada/acats/tests/c7/c761002.a
deleted file mode 100644
index 5b807bba720..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c761002.a
+++ /dev/null
@@ -1,245 +0,0 @@
--- C761002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that objects of a controlled type that are created
--- by an allocator are finalized at the appropriate time. In
--- particular, check that such objects are not finalized due to
--- completion of the master in which they were allocated if the
--- corresponding access type is declared outside of that master.
---
--- Check that Unchecked_Deallocation of a controlled
--- object causes finalization of that object.
---
--- TEST DESCRIPTION:
--- This test derives a type from Ada.Finalization.Controlled, and
--- declares access types to that type in various scope scenarios.
--- The dispatching procedure Finalize is redefined for the derived
--- type to perform a check that it has been called at the
--- correct time. This is accomplished using a global variable
--- which indicates what state the software is currently
--- executing. The test utilizes the TCTouch facilities to
--- verify that Finalize is called the correct number of times, at
--- the correct times. Several calls are made to validate passing
--- the null string to check that Finalize has NOT been called at
--- that point.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Ada.Finalization;
-package C761002_0 is
- type Global is new Ada.Finalization.Controlled with null record;
- procedure Finalize( It: in out Global );
-
- type Second is new Ada.Finalization.Limited_Controlled with null record;
- procedure Finalize( It: in out Second );
-end C761002_0;
-
-with Report;
-with TCTouch;
-package body C761002_0 is
-
- procedure Finalize( It: in out Global ) is
- begin
- TCTouch.Touch('F'); ------------------------------------------------- F
- end Finalize;
-
- procedure Finalize( It: in out Second ) is
- begin
- TCTouch.Touch('S'); ------------------------------------------------- S
- end Finalize;
-end C761002_0;
-
-with Report;
-with TCTouch;
-with C761002_0;
-with Unchecked_Deallocation;
-procedure C761002 is
-
- -- check the straightforward case
- procedure Subtest_1 is
- type Access_1 is access C761002_0.Global;
- V1 : Access_1;
- procedure Allocate is
- V2 : Access_1;
- begin
- V2 := new C761002_0.Global;
- V1 := V2; -- "dead" assignment must not be optimized away due to
- -- finalization "side effects", many more of these follow
- end Allocate;
- begin
- Allocate;
- -- no calls to Finalize should have occurred at this point
- TCTouch.Validate("","Allocated nested, retained");
- end Subtest_1;
-
- -- check Unchecked_Deallocation
- procedure Subtest_2 is
- type Access_2 is access C761002_0.Global;
- procedure Free is
- new Unchecked_Deallocation(C761002_0.Global, Access_2);
- V1 : Access_2;
- V2 : Access_2;
-
- procedure Allocate is
- begin
- V1 := new C761002_0.Global;
- V2 := new C761002_0.Global;
- end Allocate;
-
- begin
- Allocate;
- -- no calls to Finalize should have occurred at this point.
- TCTouch.Validate("","Allocated nested, non-local");
-
- Free(V1); -- instance of Unchecked_Deallocation
- -- should cause the finalization of V1.all
- TCTouch.Validate("F","Unchecked Deallocation");
- end Subtest_2; -- leaving this scope should cause the finalization of V2.all
-
- -- check various master-exit scenarios
- -- the "Fake" parameters are used to avoid unwanted optimizations
- procedure Subtest_3 is
- procedure With_Local_Block is
- type Access_3 is access C761002_0.Global;
- V1 : Access_3;
- begin
- declare
- V2 : Access_3 := new C761002_0.Global;
- begin
- V1 := V2;
- end;
- TCTouch.Validate("","Local Block, normal exit");
- -- the allocated object should be finalized on leaving this scope
- end With_Local_Block;
-
- procedure With_Local_Block_Return(Fake: Integer) is
- type Access_4 is access C761002_0.Global;
- V1 : Access_4 := new C761002_0.Global;
- begin
- if Fake = 0 then
- declare
- V2 : Access_4;
- begin
- V2 := new C761002_0.Global;
- return; -- the two allocated objects should be finalized
- end; -- upon leaving this scope
- else
- V1 := null;
- end if;
- end With_Local_Block_Return;
-
- procedure With_Goto(Fake: Integer) is
- type Access_5 is access C761002_0.Global;
- V1 : Access_5 := new C761002_0.Global;
- V2 : Access_5;
- V3 : Access_5;
- begin
- if Fake = 0 then
- declare
- type Access_6 is access C761002_0.Second;
- V6 : Access_6;
- begin
- V6 := new C761002_0.Second;
- goto check;
- end;
- else
- V2 := V1;
- end if;
- V3 := V2;
-<<check>>
- TCTouch.Validate("S","goto past master end");
- end With_Goto;
-
- begin
- With_Local_Block;
- TCTouch.Validate("F","Local Block, normal exit, after master");
-
- With_Local_Block_Return( Report.Ident_Int(0) );
- TCTouch.Validate("FF","Local Block, return from block");
-
- With_Goto( Report.Ident_Int(0) );
- TCTouch.Validate("F","With Goto");
-
- end Subtest_3;
-
- procedure Subtest_4 is
-
- Oops : exception;
-
- procedure Alley( Fake: Integer ) is
- type Access_1 is access C761002_0.Global;
- V1 : Access_1;
- begin
- V1 := new C761002_0.Global;
- if Fake = 1 then
- raise Oops;
- end if;
- V1 := null;
- end Alley;
-
- begin
- Catch: begin
- Alley( Report.Ident_Int(1) );
- exception
- when Oops => TCTouch.Validate("F","leaving via exception");
- when others => Report.Failed("Wrong exception");
- end Catch;
- end Subtest_4;
-
-begin -- Main test procedure.
-
- Report.Test ("C761002", "Check that objects of a controlled type created "
- & "by an allocator are finalized appropriately. "
- & "Check that Unchecked_Deallocation of a "
- & "controlled object causes finalization "
- & "of that object" );
-
- Subtest_1;
- -- leaving the scope of the access type should finalize the
- -- collection
- TCTouch.Validate("F","Allocated nested, Subtest 1");
-
- Subtest_2;
- -- Unchecked_Deallocation already finalized one of the two
- -- objects allocated, the other should be the only one finalized
- -- at leaving the scope of the access type.
- TCTouch.Validate("F","Allocated non-local");
-
- Subtest_3;
- -- there should be no remaining finalizations from this subtest
- TCTouch.Validate("","Localized objects");
-
- Subtest_4;
- -- there should be no remaining finalizations from this subtest
- TCTouch.Validate("","Exception testing");
-
- Report.Result;
-
-end C761002;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c761003.a b/gcc/testsuite/ada/acats/tests/c7/c761003.a
deleted file mode 100644
index 77051ee4a93..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c761003.a
+++ /dev/null
@@ -1,447 +0,0 @@
--- C761003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an object of a controlled type is finalized when the
--- enclosing master is complete.
--- Check this for controlled types where the derived type has a
--- discriminant.
--- Check this for subprograms of abstract types derived from the
--- types in Ada.Finalization.
---
--- Check that finalization of controlled objects is
--- performed in the correct order. In particular, check that if
--- multiple objects of controlled types are declared immediately
--- within the same declarative part then type are finalized in the
--- reverse order of their creation.
---
--- TEST DESCRIPTION:
--- This test checks these conditions for subprograms and
--- block statements; both variables and constants of controlled
--- types; cases of a controlled component of a record type, as
--- well as an array with controlled components.
---
--- The base controlled types used for the test are defined
--- with a character discriminant. The initialize procedure for
--- the types will record the order of creation in a globally
--- accessible array, the finalize procedure for the types will call
--- TCTouch with that tag character. The test can then check that
--- the order of finalization is indeed the reverse of the order of
--- creation (assuming that the implementation calls Initialize in
--- the order that the objects are created).
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 02 Nov 95 SAIC ACVC 2.0.1
---
---!
-
------------------------------------------------------------- C761003_Support
-
-package C761003_Support is
-
- function Pick_Char return Character;
- -- successive calls to Pick_Char return distinct characters which may
- -- be assigned to objects to track an order sequence. These characters
- -- are then used in calls to TCTouch.Touch.
-
- procedure Validate(Initcount : Natural;
- Testnumber : Natural;
- Check_Order : Boolean := True);
- -- does a little extra processing prior to calling TCTouch.Validate,
- -- specifically, it reverses the stored string of characters, and checks
- -- for a correct count.
-
- Inits_Order : String(1..255);
- Inits_Called : Natural := 0;
-
-end C761003_Support;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-with TCTouch;
-package body C761003_Support is
- type Pick_Rotation is mod 52;
- type Pick_String is array(Pick_Rotation) of Character;
-
- From : constant Pick_String := "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- & "abcdefghijklmnopqrstuvwxyz";
- Recent_Pick : Pick_Rotation := Pick_Rotation'Last;
-
- function Pick_Char return Character is
- begin
- Recent_Pick := Recent_Pick +1;
- return From(Recent_Pick);
- end Pick_Char;
-
- function Invert(S:String) return String is
- T: String(1..S'Length);
- begin
- for SI in reverse S'Range loop
- T(S'Last - SI + 1) := S(SI);
- end loop;
- return T;
- end Invert;
-
- procedure Validate(Initcount : Natural;
- Testnumber : Natural;
- Check_Order : Boolean := True) is
- Number : constant String := Natural'Image(Testnumber);
- begin
- if Inits_Called /= Initcount then
- Report.Failed("Got" & Natural'Image(Inits_Called) & " inits, expected"
- & Natural'Image(Initcount) & ", Subtest " & Number);
- TCTouch.Flush;
- else
- TCTouch.Validate(
- Invert(Inits_Order(1..Inits_Called)),
- "Subtest " & Number, Order_Meaningful => Check_Order );
- end if;
- Inits_Called := 0; -- reset for the next batch
- end Validate;
-
-end C761003_Support;
-
------------------------------------------------------------------- C761003_0
-
-with Ada.Finalization;
-package C761003_0 is
-
- type Global(Tag: Character) is new Ada.Finalization.Controlled
- with null record;
-
- procedure Initialize( It: in out Global );
- procedure Finalize ( It: in out Global );
-
- Null_Global : Global('1') := (Ada.Finalization.Controlled with Tag => '1');
-
- type Second(Tag: Character) is new Ada.Finalization.Limited_Controlled
- with null record;
-
- procedure Initialize( It: in out Second );
- procedure Finalize ( It: in out Second );
-
-end C761003_0;
-
------------------------------------------------------------------- C761003_1
-
-with Ada.Finalization;
-package C761003_1 is
-
- type Global is abstract new Ada.Finalization.Controlled with record
- Tag: Character;
- end record;
-
- procedure Initialize( It: in out Global );
- procedure Finalize ( It: in out Global );
-
- type Second is abstract new Ada.Finalization.Limited_Controlled with record
- Tag: Character;
- end record;
-
- procedure Initialize( It: in out Second );
- procedure Finalize ( It: in out Second );
-
-end C761003_1;
-
------------------------------------------------------------------- C761003_2
-
-with C761003_1;
-package C761003_2 is
-
- type Global is new C761003_1.Global with null record;
- -- inherits Initialize and Finalize
-
- type Second is new C761003_1.Second with null record;
- -- inherits Initialize and Finalize
-
-end C761003_2;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- C761003_0
-
-with TCTouch;
-with C761003_Support;
-package body C761003_0 is
-
- package Sup renames C761003_Support;
-
- procedure Initialize( It: in out Global ) is
- begin
- Sup.Inits_Called := Sup.Inits_Called +1;
- Sup.Inits_Order(Sup.Inits_Called) := It.Tag;
- end Initialize;
-
- procedure Finalize( It: in out Global ) is
- begin
- TCTouch.Touch(It.Tag); --------------------------------------------- Tag
- end Finalize;
-
- procedure Initialize( It: in out Second ) is
- begin
- Sup.Inits_Called := Sup.Inits_Called +1;
- Sup.Inits_Order(Sup.Inits_Called) := It.Tag;
- end Initialize;
-
- procedure Finalize( It: in out Second ) is
- begin
- TCTouch.Touch(It.Tag); --------------------------------------------- Tag
- end Finalize;
-
-end C761003_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- C761003_1
-
-with TCTouch;
-with C761003_Support;
-package body C761003_1 is
-
- package Sup renames C761003_Support;
-
- procedure Initialize( It: in out Global ) is
- begin
- Sup.Inits_Called := Sup.Inits_Called +1;
- It.Tag := Sup.Pick_Char;
- Sup.Inits_Order(Sup.Inits_Called) := It.Tag;
- end Initialize;
-
- procedure Finalize( It: in out Global ) is
- begin
- TCTouch.Touch(It.Tag); --------------------------------------------- Tag
- end Finalize;
-
- procedure Initialize( It: in out Second ) is
- begin
- Sup.Inits_Called := Sup.Inits_Called +1;
- It.Tag := Sup.Pick_Char;
- Sup.Inits_Order(Sup.Inits_Called) := It.Tag;
- end Initialize;
-
- procedure Finalize( It: in out Second ) is
- begin
- TCTouch.Touch(It.Tag); --------------------------------------------- Tag
- end Finalize;
-
-end C761003_1;
-
--------------------------------------------------------------------- C761003
-
-with Report;
-with TCTouch;
-with C761003_0;
-with C761003_2;
-with C761003_Support;
-procedure C761003 is
-
- package Sup renames C761003_Support;
-
----------------------------------------------------------------- Subtest_1
-
- Subtest_1_Inits_Expected : constant := 5; -- includes 1 previous
-
- procedure Subtest_1 is
-
- -- the constant will take its constraint from the value.
- -- must be declared first to be finalized last (and take the
- -- initialize from before calling subtest_1)
- Item_1 : constant C761003_0.Global := C761003_0.Null_Global;
-
- -- Item_2, declared second, should be finalized second to last.
- Item_2 : C761003_0.Global(Sup.Pick_Char);
-
- -- Item_3 and Item_4 will be created in the order of the
- -- list.
- Item_3, Item_4 : C761003_0.Global(Sup.Pick_Char);
-
- -- Item_5 will be finalized first.
- Item_5 : C761003_0.Second(Sup.Pick_Char);
-
- begin
- if Item_3.Tag >= Item_4.Tag then
- Report.Failed("Controlled objects created by list in wrong order");
- end if;
- -- check that nothing has happened yet!
- TCTouch.Validate("","Subtest 1 body");
- end Subtest_1;
-
----------------------------------------------------------------- Subtest_2
-
- -- These declarations should cause calls to initialize and
- -- finalize. The expected operations are the subprograms associated
- -- with the abstract types. Note that for these objects, the
- -- Initialize and Finalize are visible only by inheritance.
-
- Subtest_2_Inits_Expected : constant := 4;
-
- procedure Subtest_2 is
-
- Item_1 : C761003_2.Global;
- Item_2, Item_3 : C761003_2.Global;
- Item_4 : C761003_2.Second;
-
- begin
- -- check that nothing has happened yet!
- TCTouch.Validate("","Subtest 2 body");
- end Subtest_2;
-
----------------------------------------------------------------- Subtest_3
-
- -- Test for controlled objects embedded in arrays. Using structures
- -- that will cause a checkable order.
-
- Subtest_3_Inits_Expected : constant := 8;
-
- procedure Subtest_3 is
-
- type Global_List is array(Natural range <>)
- of C761003_0.Global(Sup.Pick_Char);
-
- Items : Global_List(1..4); -- components have the same tag
-
- type Second_List is array(Natural range <>)
- of C761003_0.Second(Sup.Pick_Char);
-
- Second_Items : Second_List(1..4); -- components have the same tag,
- -- distinct from the tag used in Items
-
- begin
- -- check that nothing has happened yet!
- TCTouch.Validate("","Subtest 3 body");
- end Subtest_3;
-
----------------------------------------------------------------- Subtest_4
-
- -- These declarations should cause dispatching calls to initialize and
- -- finalize. The expected operations are the subprograms associated
- -- with the abstract types.
-
- Subtest_4_Inits_Expected : constant := 2;
-
- procedure Subtest_4 is
-
- type Global_Rec is record
- Item1: C761003_0.Global(Sup.Pick_Char);
- end record;
-
- type Second_Rec is record
- Item2: C761003_2.Second;
- end record;
-
- G : Global_Rec;
- S : Second_Rec;
-
- begin
- -- check that nothing has happened yet!
- TCTouch.Validate("","Subtest 4 body");
- end Subtest_4;
-
----------------------------------------------------------------- Subtest_5
-
- -- Test for controlled objects embedded in arrays. In these cases, the
- -- order of the finalization of the components is not defined by the
- -- language.
-
- Subtest_5_Inits_Expected : constant := 8;
-
- procedure Subtest_5 is
-
-
- type Another_Global_List is array(Natural range <>)
- of C761003_2.Global;
-
- More_Items : Another_Global_List(1..4);
-
- type Another_Second_List is array(Natural range <>)
- of C761003_2.Second;
-
- Second_More_Items : Another_Second_List(1..4);
-
- begin
- -- check that nothing has happened yet!
- TCTouch.Validate("","Subtest 5 body");
- end Subtest_5;
-
----------------------------------------------------------------- Subtest_6
-
- -- These declarations should cause dispatching calls to initialize and
- -- finalize. The expected operations are the subprograms associated
- -- with the abstract types.
-
- Subtest_6_Inits_Expected : constant := 2;
-
- procedure Subtest_6 is
-
- type Global_Rec is record
- Item2: C761003_2.Global;
- end record;
-
- type Second_Rec is record
- Item1: C761003_0.Second(Sup.Pick_Char);
- end record;
-
- G : Global_Rec;
- S : Second_Rec;
-
- begin
- -- check that nothing has happened yet!
- TCTouch.Validate("","Subtest 6 body");
- end Subtest_6;
-
-begin -- Main test procedure.
-
- Report.Test ("C761003", "Check that an object of a controlled type "
- & "is finalized when the enclosing master is "
- & "complete, left by a transfer of control, "
- & "and performed in the correct order" );
-
- -- adjust for optional adjusts and initializes for C761003_0.Null_Global
- TCTouch.Flush; -- clear the optional adjust
- if Sup.Inits_Called /= 1 then
- -- C761003_0.Null_Global did not get "initialized"
- C761003_0.Initialize(C761003_0.Null_Global); -- prime the pump
- end if;
-
- Subtest_1;
- Sup.Validate(Subtest_1_Inits_Expected, 1);
-
- Subtest_2;
- Sup.Validate(Subtest_2_Inits_Expected, 2);
-
- Subtest_3;
- Sup.Validate(Subtest_3_Inits_Expected, 3);
-
- Subtest_4;
- Sup.Validate(Subtest_4_Inits_Expected, 4);
-
- Subtest_5;
- Sup.Validate(Subtest_5_Inits_Expected, 5, Check_Order => False);
-
- Subtest_6;
- Sup.Validate(Subtest_6_Inits_Expected, 6);
-
- Report.Result;
-
-end C761003;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c761004.a b/gcc/testsuite/ada/acats/tests/c7/c761004.a
deleted file mode 100644
index 9b88382b44f..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c761004.a
+++ /dev/null
@@ -1,305 +0,0 @@
--- C761004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an object of a controlled type is finalized with the
--- enclosing master is complete.
--- Check that finalization occurs in the case where the master is
--- left by a transfer of control.
--- Specifically check for types where the derived types do not have
--- discriminants.
---
--- Check that finalization of controlled objects is
--- performed in the correct order. In particular, check that if
--- multiple objects of controlled types are declared immediately
--- within the same declarative part then they are finalized in the
--- reverse order of their creation.
---
--- TEST DESCRIPTION:
--- This test checks these conditions for subprograms and
--- block statements; both variables and constants of controlled
--- types; cases of a controlled component of a record type, as
--- well as an array with controlled components.
---
--- The base controlled types used for the test are defined
--- with a character discriminant. The initialize procedure for
--- the types will record the order of creation in a globally
--- accessible array, the finalize procedure for the types will call
--- TCTouch with that tag character. The test can then check that
--- the order of finalization is indeed the reverse of the order of
--- creation (assuming that the implementation calls Initialize in
--- the order that the objects are created).
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 04 Nov 95 SAIC Fixed bugs for ACVC 2.0.1
---
---!
-
-package C761004_Support is
-
- function Pick_Char return Character;
- -- successive calls to Pick_Char return distinct characters which may
- -- be assigned to objects to track an order sequence. These characters
- -- are then used in calls to TCTouch.Touch.
-
- procedure Validate(Initcount: Natural; Testnumber:Natural);
- -- does a little extra processing prior to calling TCTouch.Validate,
- -- specifically, it reverses the stored string of characters, and checks
- -- for a correct count.
-
- Inits_Order : String(1..255);
- Inits_Called : Natural := 0;
-
-end C761004_Support;
-
-with Report;
-with TCTouch;
-package body C761004_Support is
- type Pick_Rotation is mod 52;
- type Pick_String is array(Pick_Rotation) of Character;
-
- From : constant Pick_String := "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- & "abcdefghijklmnopqrstuvwxyz";
- Recent_Pick : Pick_Rotation := Pick_Rotation'Last;
-
- function Pick_Char return Character is
- begin
- Recent_Pick := Recent_Pick +1;
- return From(Recent_Pick);
- end Pick_Char;
-
- function Invert(S:String) return String is
- T: String(1..S'Length);
- TI: Positive := 1;
- begin
- for SI in reverse S'Range loop
- T(TI) := S(SI);
- TI := TI +1;
- end loop;
- return T;
- end Invert;
-
- procedure Validate(Initcount: Natural; Testnumber:Natural) is
- Number : constant String := Natural'Image(Testnumber);
- begin
- if Inits_Called /= Initcount then
- Report.Failed("Wrong number of inits, Subtest " & Number);
- TCTouch.Flush;
- else
- TCTouch.Validate(
- Invert(Inits_Order(1..Inits_Called)),
- "Subtest " & Number, True);
- end if;
- end Validate;
-
-end C761004_Support;
-
------------------------------------------------------------------ C761004_0
-
-with Ada.Finalization;
-package C761004_0 is
- type Global is new Ada.Finalization.Controlled with record
- Tag : Character;
- end record;
- procedure Initialize( It: in out Global );
- procedure Finalize ( It: in out Global );
-
- type Second is new Ada.Finalization.Limited_Controlled with record
- Tag : Character;
- end record;
- procedure Initialize( It: in out Second );
- procedure Finalize ( It: in out Second );
-
-end C761004_0;
-
-with TCTouch;
-with C761004_Support;
-package body C761004_0 is
-
- package Sup renames C761004_Support;
-
- procedure Initialize( It: in out Global ) is
- begin
- Sup.Inits_Called := Sup.Inits_Called +1;
- It.Tag := Sup.Pick_Char;
- Sup.Inits_Order(Sup.Inits_Called) := It.Tag;
- end Initialize;
-
- procedure Finalize( It: in out Global ) is
- begin
- TCTouch.Touch(It.Tag); --------------------------------------------- Tag
- end Finalize;
-
- procedure Initialize( It: in out Second ) is
- begin
- Sup.Inits_Called := Sup.Inits_Called +1;
- It.Tag := Sup.Pick_Char;
- Sup.Inits_Order(Sup.Inits_Called) := It.Tag;
- end Initialize;
-
- procedure Finalize( It: in out Second ) is
- begin
- TCTouch.Touch(It.Tag); --------------------------------------------- Tag
- end Finalize;
-end C761004_0;
-
-------------------------------------------------------------------- C761004
-
-with Report;
-with TCTouch;
-with C761004_0;
-with C761004_Support;
-with Ada.Finalization; -- needed to be able to create extension aggregates
-procedure C761004 is
-
- Verbose : constant Boolean := False;
-
- package Sup renames C761004_Support;
-
- -- Subtest 1, general case. Check that several objects declared in a
- -- subprogram are created, and finalized in opposite order.
-
- Subtest_1_Expected_Inits : constant := 3;
-
- procedure Subtest_1 is
- Item_1 : C761004_0.Global;
- Item_2, Item_3 : C761004_0.Global;
- begin
- if Item_2.Tag = Item_3.Tag then -- not germane to the test
- Report.Failed("Duplicate tag");-- but helps prevent code elimination
- end if;
- end Subtest_1;
-
- -- Subtest 2, extension of the general case. Check that several objects
- -- created identically on the stack (via a recursive procedure) are
- -- finalized in the opposite order of their creation.
- Subtest_2_Expected_Inits : constant := 12;
- User_Exception : exception;
-
- procedure Subtest_2 is
-
- Item_1 : C761004_0.Global;
-
- -- combine recursion and exit by exception:
-
- procedure Nested(Recurs: Natural) is
- Item_3 : C761004_0.Global;
- begin
- if Verbose then
- Report.Comment("going in: " & Item_3.Tag);
- end if;
- if Recurs = 1 then
- raise User_Exception;
- else
- Nested(Recurs -1);
- end if;
- end Nested;
-
- Item_2 : C761004_0.Global;
-
- begin
- Nested(10);
- end Subtest_2;
-
- -- subtest 3, check the case of objects embedded in structures:
- -- an array
- -- a record
- Subtest_3_Expected_Inits : constant := 3;
- procedure Subtest_3 is
- type G_List is array(Positive range <>) of C761004_0.Global;
- type Pandoras_Box is record
- G : G_List(1..1);
- end record;
-
- procedure Nested(Recursions: Natural) is
- Merlin : Pandoras_Box;
- begin
- if Recursions > 1 then
- Nested(Recursions-1);
- else
- TCTouch.Validate("","Final Nested call");
- end if;
- end Nested;
-
- begin
- Nested(3);
- end Subtest_3;
-
- -- subtest 4, check the case of objects embedded in structures:
- -- an array
- -- a record
- Subtest_4_Expected_Inits : constant := 3;
- procedure Subtest_4 is
- type S_List is array(Positive range <>) of C761004_0.Second;
- type Pandoras_Box is record
- S : S_List(1..1);
- end record;
-
- procedure Nested(Recursions: Natural) is
- Merlin : Pandoras_Box;
- begin
- if Recursions > 1 then
- Nested(Recursions-1);
- else
- TCTouch.Validate("","Final Nested call");
- end if;
- end Nested;
-
- begin
- Nested(3);
- end Subtest_4;
-
-begin -- Main test procedure.
-
- Report.Test ("C761004", "Check that an object of a controlled type "
- & "is finalized when the enclosing master is "
- & "complete, left by a transfer of control, "
- & "and performed in the correct order" );
-
- Subtest_1;
- Sup.Validate(Subtest_1_Expected_Inits,1);
-
- Subtest_2_Frame: begin
- Sup.Inits_Called := 0;
- Subtest_2;
- exception
- when User_Exception => null;
- when others => Report.Failed("Wrong Exception, Subtest 2");
- end Subtest_2_Frame;
- Sup.Validate(Subtest_2_Expected_Inits,2);
-
- Sup.Inits_Called := 0;
- Subtest_3;
- Sup.Validate(Subtest_3_Expected_Inits,3);
-
- Sup.Inits_Called := 0;
- Subtest_4;
- Sup.Validate(Subtest_4_Expected_Inits,4);
-
- Report.Result;
-
-end C761004;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c761005.a b/gcc/testsuite/ada/acats/tests/c7/c761005.a
deleted file mode 100644
index acac59b48c6..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c761005.a
+++ /dev/null
@@ -1,288 +0,0 @@
--- C761005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that deriving abstract types from the types in Ada.Finalization
--- does not negatively impact the implicit operations.
--- Check that an object of a controlled type is finalized when the
--- enclosing master is complete.
--- Check that finalization occurs in the case where the master is
--- left by a transfer of control.
--- Check this for controlled types where the derived type has a
--- discriminant.
--- Check this for cases where the type is defined as private,
--- and the full type is derived from the types in Ada.Finalization.
---
--- Check that finalization of controlled objects is
--- performed in the correct order. In particular, check that if
--- multiple objects of controlled types are declared immediately
--- within the same declarative part then type are finalized in the
--- reverse order of their creation.
---
--- TEST DESCRIPTION:
--- This test checks these conditions for subprograms and
--- block statements; both variables and constants of controlled
--- types; cases of a controlled component of a record type, as
--- well as an array with controlled components.
---
--- The base controlled types used for the test are defined
--- with a character discriminant. The initialize procedure for
--- the types will record the order of creation in a globally
--- accessible array, the finalize procedure for the types will call
--- TCTouch with that tag character. The test can then check that
--- the order of finalization is indeed the reverse of the order of
--- creation (assuming that the implementation calls Initialize in
--- the order that the objects are created).
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Oct 95 SAIC Fixed bugs for ACVC 2.0.1
---
---!
-
-package C761005_Support is
-
- function Pick_Char return Character;
- procedure Validate(Initcount: Natural; Testnumber:Natural);
-
- Inits_Order : String(1..255);
- Inits_Called : Natural := 0;
-
-end C761005_Support;
-
-with Report;
-with TCTouch;
-package body C761005_Support is
- type Pick_Rotation is mod 52;
- type Pick_String is array(Pick_Rotation) of Character;
-
- From : constant Pick_String := "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- & "abcdefghijklmnopqrstuvwxyz";
- Recent_Pick : Pick_Rotation := Pick_Rotation'Last;
-
- function Pick_Char return Character is
- begin
- Recent_Pick := Recent_Pick +1;
- return From(Recent_Pick);
- end Pick_Char;
-
- function Invert(S:String) return String is
- T: String(1..S'Length);
- TI: Positive := 1;
- begin
- for SI in reverse S'Range loop
- T(TI) := S(SI);
- TI := TI +1;
- end loop;
- return T;
- end Invert;
-
- procedure Validate(Initcount: Natural; Testnumber:Natural) is
- Number : constant String := Natural'Image(Testnumber);
- begin
- if Inits_Called /= Initcount then
- Report.Failed("Wrong number of inits, Subtest " & Number);
- else
- TCTouch.Validate(
- Invert(Inits_Order(1..Inits_Called)),
- "Subtest " & Number, True);
- end if;
- Inits_Called := 0;
- end Validate;
-
-end C761005_Support;
-
------------------------------------------------------------------------------
-with Ada.Finalization;
-package C761005_0 is
- type Final_Root(Tag: Character) is private;
-
- type Ltd_Final_Root(Tag: Character) is limited private;
-
- Inits_Order : String(1..255);
- Inits_Called : Natural := 0;
-private
- type Final_Root(Tag: Character) is new Ada.Finalization.Controlled
- with null record;
- procedure Initialize( It: in out Final_Root );
- procedure Finalize ( It: in out Final_Root );
-
- type Ltd_Final_Root(Tag: Character) is new
-Ada.Finalization.Limited_Controlled
- with null record;
- procedure Initialize( It: in out Ltd_Final_Root );
- procedure Finalize ( It: in out Ltd_Final_Root );
-end C761005_0;
-
------------------------------------------------------------------------------
-with Ada.Finalization;
-package C761005_1 is
- type Final_Abstract is abstract tagged private;
-
- type Ltd_Final_Abstract_Child is abstract tagged limited private;
-
- Inits_Order : String(1..255);
- Inits_Called : Natural := 0;
-
-private
- type Final_Abstract is abstract new Ada.Finalization.Controlled with record
- Tag: Character;
- end record;
- procedure Initialize( It: in out Final_Abstract );
- procedure Finalize ( It: in out Final_Abstract );
-
- type Ltd_Final_Abstract_Child is
- abstract new Ada.Finalization.Limited_Controlled with record
- Tag: Character;
- end record;
- procedure Initialize( It: in out Ltd_Final_Abstract_Child );
- procedure Finalize ( It: in out Ltd_Final_Abstract_Child );
-
-end C761005_1;
-
------------------------------------------------------------------------------
-with C761005_1;
-package C761005_2 is
-
- type Final_Child is new C761005_1.Final_Abstract with null record;
- type Ltd_Final_Child is
- new C761005_1.Ltd_Final_Abstract_Child with null record;
-
-end C761005_2;
-
------------------------------------------------------------------------------
-with Report;
-with TCTouch;
-with C761005_Support;
-package body C761005_0 is
-
- package Sup renames C761005_Support;
-
- procedure Initialize( It: in out Final_Root ) is
- begin
- Sup.Inits_Called := Sup.Inits_Called +1;
- Sup.Inits_Order(Sup.Inits_Called) := It.Tag;
- end Initialize;
-
- procedure Finalize( It: in out Final_Root ) is
- begin
- TCTouch.Touch(It.Tag);
- end Finalize;
-
- procedure Initialize( It: in out Ltd_Final_Root ) is
- begin
- Sup.Inits_Called := Sup.Inits_Called +1;
- Sup.Inits_Order(Sup.Inits_Called) := It.Tag;
- end Initialize;
-
- procedure Finalize( It: in out Ltd_Final_Root ) is
- begin
- TCTouch.Touch(It.Tag);
- end Finalize;
-end C761005_0;
-
------------------------------------------------------------------------------
-with Report;
-with TCTouch;
-with C761005_Support;
-package body C761005_1 is
-
- package Sup renames C761005_Support;
-
- procedure Initialize( It: in out Final_Abstract ) is
- begin
- Sup.Inits_Called := Sup.Inits_Called +1;
- It.Tag := Sup.Pick_Char;
- Sup.Inits_Order(Sup.Inits_Called) := It.Tag;
- end Initialize;
-
- procedure Finalize( It: in out Final_Abstract ) is
- begin
- TCTouch.Touch(It.Tag);
- end Finalize;
-
- procedure Initialize( It: in out Ltd_Final_Abstract_Child ) is
- begin
- Sup.Inits_Called := Sup.Inits_Called +1;
- It.Tag := Sup.Pick_Char;
- Sup.Inits_Order(Sup.Inits_Called) := It.Tag;
- end Initialize;
-
- procedure Finalize( It: in out Ltd_Final_Abstract_Child ) is
- begin
- TCTouch.Touch(It.Tag);
- end Finalize;
-end C761005_1;
-
------------------------------------------------------------------------------
-with Report;
-with TCTouch;
-with C761005_0;
-with C761005_2;
-with C761005_Support;
-procedure C761005 is
-
- package Sup renames C761005_Support;
-
- Subtest_1_Inits_Expected : constant := 4;
- procedure Subtest_1 is
- Item_1 : C761005_0.Final_Root(Sup.Pick_Char);
- Item_2, Item_3 : C761005_0.Final_Root(Sup.Pick_Char);
- Item_4 : C761005_0.Ltd_Final_Root(Sup.Pick_Char);
- begin
- -- check that nothing has happened yet!
- TCTouch.Validate("","Subtest 1 body");
- end Subtest_1;
-
- -- These declarations should cause calls to initialize and
- -- finalize. The expected operations are the subprograms associated
- -- with the abstract types.
- Subtest_2_Inits_Expected : constant := 4;
- procedure Subtest_2 is
- Item_1 : C761005_2.Final_Child;
- Item_2, Item_3 : C761005_2.Final_Child;
- Item_4 : C761005_2.Ltd_Final_Child;
- begin
- -- check that nothing has happened yet!
- TCTouch.Validate("","Subtest 2 body");
- end Subtest_2;
-
-begin -- Main test procedure.
-
- Report.Test ("C761005", "Check that an object of a controlled type "
- & "is finalized when the enclosing master is "
- & "complete, left by a transfer of control, "
- & "and performed in the correct order" );
-
- Subtest_1;
- Sup.Validate(Subtest_1_Inits_Expected,1);
-
- Subtest_2;
- Sup.Validate(Subtest_2_Inits_Expected,2);
-
- Report.Result;
-
-end C761005;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c761006.a b/gcc/testsuite/ada/acats/tests/c7/c761006.a
deleted file mode 100644
index 771e625d10f..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c761006.a
+++ /dev/null
@@ -1,425 +0,0 @@
--- C761006.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Program_Error is raised when:
--- * an exception is raised if Finalize invoked as part of an
--- assignment operation; or
--- * an exception is raised if Adjust invoked as part of an assignment
--- operation, after any other adjustment due to be performed are
--- performed; or
--- * an exception is raised if Finalize invoked as part of a call on
--- Unchecked_Deallocation, after any other finalizations to be
--- performed are performed.
---
--- TEST DESCRIPTION:
--- This test defines these four controlled types:
--- Good
--- Bad_Initialize
--- Bad_Adjust
--- Bad_Finalize
--- The type name conveys the associated failure. The operations in type
--- good will "touch" the boolean array indicating correct path
--- utilization for the purposes of checking "other <operations> are
--- performed", where <operations> ::= initialization, adjusting, and
--- finalization
---
---
---
--- CHANGE HISTORY:
--- 12 APR 94 SAIC Initial version
--- 02 MAY 96 SAIC Visibility fixed for 2.1
--- 13 FEB 97 PWB.CTA Corrected value of Events_Occurring at line 286
--- 01 DEC 97 EDS Made correction wrt RM 7.6(21)
--- 16 MAR 01 RLB Corrected Adjust cases to avoid problems with
--- RM 7.6.1(16/1) from Technical Corrigendum 1.
---
---!
-
-------------------------------------------------------------- C761006_Support
-
-package C761006_Support is
-
- type Events is ( Good_Initialize, Good_Adjust, Good_Finalize );
-
- type Event_Array is array(Events) of Boolean;
-
- Events_Occurring : Event_Array := (others => False);
-
- Propagating_Exception : exception;
-
- procedure Raise_Propagating_Exception(Do_It: Boolean);
-
- function Unique_Value return Natural;
-
-end C761006_Support;
-
-------------------------------------------------------------- C761006_Support
-
-with Report;
-package body C761006_Support is
-
- procedure Raise_Propagating_Exception(Do_It: Boolean) is
- begin
- if Report.Ident_Bool(Do_It) then
- raise Propagating_Exception;
- end if;
- end Raise_Propagating_Exception;
-
- Seed : Natural := 0;
-
- function Unique_Value return Natural is
- begin
- Seed := Seed +1;
- return Seed;
- end Unique_Value;
-
-end C761006_Support;
-
-------------------------------------------------------------------- C761006_0
-
-with Ada.Finalization;
-with C761006_Support;
-package C761006_0 is
-
- type Good is new Ada.Finalization.Controlled
- with record
- Initialized : Boolean := False;
- Adjusted : Boolean := False;
- Unique : Natural := C761006_Support.Unique_Value;
- end record;
-
- procedure Initialize( It: in out Good );
- procedure Adjust ( It: in out Good );
- procedure Finalize ( It: in out Good );
-
- type Bad_Initialize is private;
-
- type Bad_Adjust is private;
-
- type Bad_Finalize is private;
-
- Inits_Order : String(1..255);
- Inits_Called : Natural := 0;
-private
- type Bad_Initialize is new Ada.Finalization.Controlled
- with null record;
- procedure Initialize( It: in out Bad_Initialize );
-
- type Bad_Adjust is new Ada.Finalization.Controlled
- with null record;
- procedure Adjust ( It: in out Bad_Adjust );
-
- type Bad_Finalize is
- new Ada.Finalization.Controlled with null record;
- procedure Finalize ( It: in out Bad_Finalize );
-end C761006_0;
-
-------------------------------------------------------------------- C761006_1
-
-with Ada.Finalization;
-with C761006_0;
-package C761006_1 is
-
- type Init_Check_Root is new Ada.Finalization.Controlled with record
- Good_Component : C761006_0.Good;
- Init_Fails : C761006_0.Bad_Initialize;
- end record;
-
- type Adj_Check_Root is new Ada.Finalization.Controlled with record
- Good_Component : C761006_0.Good;
- Adj_Fails : C761006_0.Bad_Adjust;
- end record;
-
- type Fin_Check_Root is new Ada.Finalization.Controlled with record
- Good_Component : C761006_0.Good;
- Fin_Fails : C761006_0.Bad_Finalize;
- end record;
-
-end C761006_1;
-
-------------------------------------------------------------------- C761006_2
-
-with C761006_1;
-package C761006_2 is
-
- type Init_Check is new C761006_1.Init_Check_Root with null record;
- type Adj_Check is new C761006_1.Adj_Check_Root with null record;
- type Fin_Check is new C761006_1.Fin_Check_Root with null record;
-
-end C761006_2;
-
-------------------------------------------------------------------- C761006_0
-
-with Report;
-with C761006_Support;
-package body C761006_0 is
-
- package Sup renames C761006_Support;
-
- procedure Initialize( It: in out Good ) is
- begin
- Sup.Events_Occurring( Sup.Good_Initialize ) := True;
- It.Initialized := True;
- end Initialize;
-
- procedure Adjust ( It: in out Good ) is
- begin
- Sup.Events_Occurring( Sup.Good_Adjust ) := True;
- It.Adjusted := True;
- It.Unique := C761006_Support.Unique_Value;
- end Adjust;
-
- procedure Finalize ( It: in out Good ) is
- begin
- Sup.Events_Occurring( Sup.Good_Finalize ) := True;
- end Finalize;
-
- procedure Initialize( It: in out Bad_Initialize ) is
- begin
- Sup.Raise_Propagating_Exception(Report.Ident_Bool(True));
- end Initialize;
-
- procedure Adjust( It: in out Bad_Adjust ) is
- begin
- Sup.Raise_Propagating_Exception(Report.Ident_Bool(True));
- end Adjust;
-
- procedure Finalize( It: in out Bad_Finalize ) is
- begin
- Sup.Raise_Propagating_Exception(Report.Ident_Bool(True));
- end Finalize;
-
-end C761006_0;
-
---------------------------------------------------------------------- C761006
-
-with Report;
-with C761006_0;
-with C761006_2;
-with C761006_Support;
-with Ada.Exceptions;
-with Ada.Finalization;
-with Unchecked_Deallocation;
-procedure C761006 is
-
- package Sup renames C761006_Support;
- use type Sup.Event_Array;
-
- type Procedure_Handle is access procedure;
-
- type Test_ID is ( Simple, Initialize, Adjust, Finalize );
-
- Sub_Tests : array(Test_ID) of Procedure_Handle;
-
- procedure Simple_Test is
- A_Good_Object : C761006_0.Good; -- should call Initialize
- begin
- if not A_Good_Object.Initialized then
- Report.Failed("Good object not initialized");
- end if;
-
- -- should call Adjust
- A_Good_Object := ( Ada.Finalization.Controlled
- with Unique => 0, others => False );
- if not A_Good_Object.Adjusted then
- Report.Failed("Good object not adjusted");
- end if;
-
- -- should call Finalize before end of scope
- end Simple_Test;
-
- procedure Initialize_Test is
- begin
- declare
- This_Object_Fails_In_Initialize : C761006_2.Init_Check;
- begin
- Report.Failed("Exception in Initialize did not occur");
- exception
- when others =>
- Report.Failed("Initialize caused exception at wrong lex");
- end;
-
- Report.Failed("Error in execution sequence");
-
- exception
- when Sup.Propagating_Exception => -- this is correct
- if not Sup.Events_Occurring(Sup.Good_Initialize) then
- Report.Failed("Initialization of Good Component did not occur");
- end if;
- end Initialize_Test;
-
- procedure Adjust_Test is
- This_Object_OK : C761006_2.Adj_Check;
- This_Object_Target : C761006_2.Adj_Check;
- begin
-
- Check_Adjust_Due_To_Assignment: begin
- This_Object_Target := This_Object_OK;
- Report.Failed("Adjust did not propagate any exception");
- exception
- when Program_Error => -- expected case
- if not This_Object_Target.Good_Component.Adjusted then
- Report.Failed("other adjustment not performed");
- end if;
- when others =>
- Report.Failed("Adjust propagated wrong exception");
- end Check_Adjust_Due_To_Assignment;
-
- C761006_Support.Events_Occurring := (True, False, False);
-
- Check_Adjust_Due_To_Initial_Assignment: declare
- Another_Target : C761006_2.Adj_Check := This_Object_OK;
- begin
- Report.Failed("Adjust did not propagate any exception");
- exception
- when others => Report.Failed("Adjust caused exception at wrong lex");
- end Check_Adjust_Due_To_Initial_Assignment;
-
- exception
- when Program_Error => -- expected case
- if Sup.Events_Occurring(Sup.Good_Finalize) /=
- Sup.Events_Occurring(Sup.Good_Adjust) then
- -- RM 7.6.1(16/1) says that the good Adjust may or may not
- -- be performed; but if it is, then the Finalize must be
- -- performed; and if it is not, then the Finalize must not
- -- performed.
- if Sup.Events_Occurring(Sup.Good_Finalize) then
- Report.Failed("Good adjust not performed with bad adjust, " &
- "but good finalize was");
- else
- Report.Failed("Good adjust performed with bad adjust, " &
- "but good finalize was not");
- end if;
- end if;
- when others =>
- Report.Failed("Adjust propagated wrong exception");
- end Adjust_Test;
-
- procedure Finalize_Test is
-
- Fin_Not_Perf : constant String := "other finalizations not performed";
-
- procedure Finalize_15 is
- Item : C761006_2.Fin_Check;
- Target : C761006_2.Fin_Check;
- begin
-
- Item := Target;
- -- finalization of Item should cause PE
- -- ARM7.6:21 allows the implementation to omit the assignment of the
- -- value into an anonymous object, which is the point at which Adjust
- -- is normally called. However, this would result in Program_Error's
- -- being raised before the call to Adjust, with the consequence that
- -- Adjust is never called.
-
- exception
- when Program_Error => -- expected case
- if not Sup.Events_Occurring(Sup.Good_Finalize) then
- Report.Failed("Assignment: " & Fin_Not_Perf);
- end if;
- when others =>
- Report.Failed("Other exception in Finalize_15");
-
- -- finalization of Item/Target should cause PE
- end Finalize_15;
-
- -- check failure in finalize due to Unchecked_Deallocation
-
- type Shark is access C761006_2.Fin_Check;
-
- procedure Catch is
- new Unchecked_Deallocation( C761006_2.Fin_Check, Shark );
-
- procedure Finalize_17 is
- White : Shark := new C761006_2.Fin_Check;
- begin
- Catch( White );
- exception
- when Program_Error =>
- if not Sup.Events_Occurring(Sup.Good_Finalize) then
- Report.Failed("Unchecked_Deallocation: " & Fin_Not_Perf);
- end if;
- end Finalize_17;
-
- begin
-
- Exception_In_Finalization: begin
- Finalize_15;
- exception
- when Program_Error => null; -- anticipated
- end Exception_In_Finalization;
-
- Use_Of_Unchecked_Deallocation: begin
- Finalize_17;
- exception
- when others =>
- Report.Failed("Unchecked_Deallocation check, unwanted exception");
- end Use_Of_Unchecked_Deallocation;
-
- end Finalize_Test;
-
-begin -- Main test procedure.
-
- Report.Test ("C761006", "Check that exceptions raised in Initialize, " &
- "Adjust and Finalize are processed correctly" );
-
- Sub_Tests := (Simple_Test'Access, Initialize_Test'Access,
- Adjust_Test'Access, Finalize_Test'Access);
-
- for Test in Sub_Tests'Range loop
- begin
-
- Sup.Events_Occurring := (others => False);
-
- Sub_Tests(Test).all;
-
- case Test is
- when Simple | Adjust =>
- if Sup.Events_Occurring /= Sup.Event_Array ' ( others => True ) then
- Report.Failed ( "Other operation missing in " &
- Test_ID'Image ( Test ) );
- end if;
- when Initialize =>
- null;
- when Finalize =>
- -- Note that for Good_Adjust, we may get either True or False
- if Sup.Events_Occurring ( Sup.Good_Initialize ) = False or
- Sup.Events_Occurring ( Sup.Good_Finalize ) = False
- then
- Report.Failed ( "Other operation missing in " &
- Test_ID'Image ( Test ) );
- end if;
- end case;
-
- exception
- when How: others => Report.Failed( Ada.Exceptions.Exception_Name( How )
- & " from " & Test_ID'Image( Test ) );
- end;
- end loop;
-
- Report.Result;
-
-end C761006;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c761007.a b/gcc/testsuite/ada/acats/tests/c7/c761007.a
deleted file mode 100644
index 7b3dbfb9b6e..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c761007.a
+++ /dev/null
@@ -1,419 +0,0 @@
--- C761007.A
---
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if a finalize procedure invoked by a transfer of control
--- due to selection of a terminate alternative attempts to propagate an
--- exception, the exception is ignored, but any other finalizations due
--- to be performed are performed.
---
---
--- TEST DESCRIPTION:
--- This test declares a nested controlled data type, and embeds an object
--- of that type within a protected type. Objects of the protected type
--- are created and destroyed, and the actions of the embedded controlled
--- object are checked. The container controlled type causes an exception
--- as the last part of it's finalization operation.
---
--- This test utilizes several tasks to accomplish the objective. The
--- tasks contain delays to ensure that the expected order of processing
--- is indeed accomplished.
---
--- Subtest 1:
--- local task object runs to normal completion
---
--- Subtest 2:
--- local task aborts a nested task to cause finalization
---
--- Subtest 3:
--- local task sleeps long enough to allow procedure started
--- asynchronously to go into infinite loop. Procedure is then aborted
--- via ATC, causing finalization of objects.
---
--- Subtest 4:
--- local task object takes terminate alternative, causing finalization
---
---
--- CHANGE HISTORY:
--- 06 JUN 95 SAIC Initial version
--- 05 APR 96 SAIC Documentation changes
--- 03 MAR 97 PWB.CTA Allowed two finalization orders for ATC test
--- 02 DEC 97 EDS Remove duplicate characters from check string.
---!
-
----------------------------------------------------------------- C761007_0
-
-with Ada.Finalization;
-package C761007_0 is
-
- type Internal is new Ada.Finalization.Controlled
- with record
- Effect : Character;
- end record;
-
- procedure Finalize( I: in out Internal );
-
- Side_Effect : String(1..80); -- way bigger than needed
- Side_Effect_Finger : Natural := 0;
-
-end C761007_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-package body C761007_0 is
-
- procedure Finalize( I : in out Internal ) is
- Previous_Side_Effect : Boolean := False;
- begin
- -- look to see if this character has been finalized yet
- for SEI in 1..Side_Effect_Finger loop
- Previous_Side_Effect := Previous_Side_Effect
- or Side_Effect(Side_Effect_Finger) = I.Effect;
- end loop;
-
- -- if not, then tack it on to the string, and touch the character
- if not Previous_Side_Effect then
- Side_Effect_Finger := Side_Effect_Finger +1;
- Side_Effect(Side_Effect_Finger) := I.Effect;
- TCTouch.Touch(I.Effect);
- end if;
-
- end Finalize;
-
-end C761007_0;
-
----------------------------------------------------------------- C761007_1
-
-with C761007_0;
-with Ada.Finalization;
-package C761007_1 is
-
- type Container is new Ada.Finalization.Controlled
- with record
- Effect : Character;
- Content : C761007_0.Internal;
- end record;
-
- procedure Finalize( C: in out Container );
-
- Side_Effect : String(1..80); -- way bigger than needed
- Side_Effect_Finger : Natural := 0;
-
- This_Exception_Is_Supposed_To_Be_Ignored : exception;
-
-end C761007_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-package body C761007_1 is
-
- procedure Finalize( C: in out Container ) is
- Previous_Side_Effect : Boolean := False;
- begin
- -- look to see if this character has been finalized yet
- for SEI in 1..Side_Effect_Finger loop
- Previous_Side_Effect := Previous_Side_Effect
- or Side_Effect(Side_Effect_Finger) = C.Effect;
- end loop;
-
- -- if not, then tack it on to the string, and touch the character
- if not Previous_Side_Effect then
- Side_Effect_Finger := Side_Effect_Finger +1;
- Side_Effect(Side_Effect_Finger) := C.Effect;
- TCTouch.Touch(C.Effect);
- end if;
-
- raise This_Exception_Is_Supposed_To_Be_Ignored;
-
- end Finalize;
-
-end C761007_1;
-
----------------------------------------------------------------- C761007_2
-with C761007_1;
-package C761007_2 is
-
- protected type Prot_W_Fin_Obj is
- procedure Set_Effects( Container, Filling: Character );
- private
- The_Data_Under_Test : C761007_1.Container;
- -- finalization for this will occur when the Prot_W_Fin_Obj object
- -- "goes out of existence" for whatever reason.
- end Prot_W_Fin_Obj;
-
-end C761007_2;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-package body C761007_2 is
-
- protected body Prot_W_Fin_Obj is
- procedure Set_Effects( Container, Filling: Character ) is
- begin
- The_Data_Under_Test.Effect := Container; -- A, etc.
- The_Data_Under_Test.Content.Effect := Filling; -- B, etc.
- end Set_Effects;
- end Prot_W_Fin_Obj;
-
-end C761007_2;
-
------------------------------------------------------------------- C761007
-
-with Report;
-with Impdef;
-with TCTouch;
-with C761007_0;
-with C761007_1;
-with C761007_2;
-procedure C761007 is
-
- task type Subtests( Outer, Inner : Character) is
- entry Ready;
- entry Complete;
- end Subtests;
-
- task body Subtests is
- Local_Prot_W_Fin_Obj : C761007_2.Prot_W_Fin_Obj;
- begin
- Local_Prot_W_Fin_Obj.Set_Effects( Outer, Inner );
-
- accept Ready;
-
- select
- accept Complete;
- or terminate; -- used in Subtest 4
- end select;
- exception
- -- the exception caused by the finalization of Local_Prot_W_Fin_Obj
- -- should never be visible to this scope.
- when others => Report.Failed("Exception in a Subtest object "
- & Outer & Inner);
- end Subtests;
-
- procedure Subtest_1 is
- -- check the case where "nothing special" happens.
-
- This_Subtest : Subtests( 'A', 'B' );
- begin
-
- This_Subtest.Ready;
- This_Subtest.Complete;
-
- while not This_Subtest'Terminated loop -- wait for finalization
- delay Impdef.Clear_Ready_Queue;
- end loop;
-
- -- in the finalization of This_Subtest, the controlled object embedded in
- -- the Prot_W_Fin_Obj will finalize. An exception is raised in the
- -- container object, after "touching" it's tag character.
- -- The finalization of the contained controlled object must be performed.
-
-
- TCTouch.Validate( "AB", "Item embedded in task" );
-
-
- exception
- when others => Report.Failed("Undesirable exception in Subtest_1");
-
- end Subtest_1;
-
- procedure Subtest_2 is
- -- check for explicit abort
-
- task Subtest_Task is
- entry Complete;
- end Subtest_Task;
-
- task body Subtest_Task is
-
- task Nesting;
- task body Nesting is
- Deep_Nesting : Subtests( 'E', 'F' );
- begin
- if Report.Ident_Bool( True ) then
- -- controlled objects have been created in the elaboration of
- -- Deep_Nesting. Deep_Nesting must call the Set_Effects operation
- -- in the Prot_W_Fin_Obj, and then hang waiting for the Complete
- -- entry call.
- Deep_Nesting.Ready;
- abort Deep_Nesting;
- else
- Report.Failed("Dead code in Nesting");
- end if;
- exception
- when others => Report.Failed("Exception in Subtest_Task.Nesting");
- end Nesting;
-
- Local_2 : C761007_2.Prot_W_Fin_Obj;
-
- begin
- -- Nesting has activated at this point, which implies the activation
- -- of Deep_Nesting as well.
-
- Local_2.Set_Effects( 'C', 'D' );
-
- -- wait for Nesting to terminate
-
- while not Nesting'Terminated loop
- delay Impdef.Clear_Ready_Queue;
- end loop;
-
- accept Complete;
-
- exception
- when others => Report.Failed("Exception in Subtest_Task");
- end Subtest_Task;
-
- begin
-
- -- wait for everything in Subtest_Task to happen
- Subtest_Task.Complete;
-
- while not Subtest_Task'Terminated loop -- wait for finalization
- delay Impdef.Clear_Ready_Queue;
- end loop;
-
- TCTouch.Validate( "EFCD", "Aborted nested task" );
-
- exception
- when others => Report.Failed("Undesirable exception in Subtest_2");
- end Subtest_2;
-
- procedure Subtest_3 is
- -- check abort caused by asynchronous transfer of control
-
- task Subtest_3_Task is
- entry Complete;
- end Subtest_3_Task;
-
- procedure Check_Atc_Operation is
- Check_Atc : C761007_2.Prot_W_Fin_Obj;
- begin
-
- Check_Atc.Set_Effects( 'G', 'H' );
-
-
- while Report.Ident_Bool( True ) loop -- wait to be aborted
- if Report.Ident_Bool( True ) then
- Impdef.Exceed_Time_Slice;
- delay Impdef.Switch_To_New_Task;
- else
- Report.Failed("Optimization prevention");
- end if;
- end loop;
-
- Report.Failed("Check_Atc_Operation loop completed");
-
- end Check_Atc_Operation;
-
- task body Subtest_3_Task is
- task Nesting is
- entry Complete;
- end Nesting;
-
- task body Nesting is
- Nesting_3 : C761007_2.Prot_W_Fin_Obj;
- begin
- Nesting_3.Set_Effects( 'G', 'H' );
-
- -- give Check_Atc_Operation sufficient time to perform it's
- -- Set_Effects on it's local Prot_W_Fin_Obj object
- delay Impdef.Clear_Ready_Queue;
-
- accept Complete;
- exception
- when others => Report.Failed("Exception in Subtest_3_Task.Nesting");
- end Nesting;
-
- Local_3 : C761007_2.Prot_W_Fin_Obj;
-
- begin -- Subtest_3_Task
-
- Local_3.Set_Effects( 'I', 'J' );
-
- select
- Nesting.Complete;
- then abort ---------------------------------------------------- cause KL
- Check_ATC_Operation;
- end select;
-
- accept Complete;
-
- exception
- when others => Report.Failed("Exception in Subtest_3_Task");
- end Subtest_3_Task;
-
- begin -- Subtest_3
- Subtest_3_Task.Complete;
-
- while not Subtest_3_Task'Terminated loop -- wait for finalization
- delay Impdef.Clear_Ready_Queue;
- end loop;
-
- TCTouch.Validate( "GHIJ", "Asynchronously aborted operation" );
-
- exception
- when others => Report.Failed("Undesirable exception in Subtest_3");
- end Subtest_3;
-
- procedure Subtest_4 is
- -- check the case where transfer is caused by terminate alternative
- -- highly similar to Subtest_1
-
- This_Subtest : Subtests( 'M', 'N' );
- begin
-
- This_Subtest.Ready;
- -- don't call This_Subtest.Complete;
-
- exception
- when others => Report.Failed("Undesirable exception in Subtest_4");
-
- end Subtest_4;
-
-begin -- Main test procedure.
-
- Report.Test ("C761007", "Check that if a finalize procedure invoked by " &
- "a transfer of control or selection of a " &
- "terminate alternative attempts to propagate " &
- "an exception, the exception is ignored, but " &
- "any other finalizations due to be performed " &
- "are performed" );
-
- Subtest_1; -- checks internal
-
- Subtest_2; -- checks internal
-
- Subtest_3; -- checks internal
-
- Subtest_4;
- TCTouch.Validate( "MN", "transfer due to terminate alternative" );
-
- Report.Result;
-
-end C761007;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c761010.a b/gcc/testsuite/ada/acats/tests/c7/c761010.a
deleted file mode 100644
index 7784c6da517..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c761010.a
+++ /dev/null
@@ -1,447 +0,0 @@
--- C761010.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE
--- Check the requirements of the new 7.6(17.1/1) from Technical
--- Corrigendum 1 (originally discussed as AI95-00083).
--- This new paragraph requires that the initialization of an object with
--- an aggregate does not involve calls to Adjust.
---
--- TEST DESCRIPTION
--- We include several cases of initialization:
--- - Explicit initialization of an object declared by an
--- object declaration.
--- - Explicit initialization of a heap object.
--- - Default initialization of a record component.
--- - Initialization of a formal parameter during a call.
--- - Initialization of a formal parameter during a call with
--- a defaulted parameter.
--- - Lots of nested records, arrays, and pointers.
--- In this test, Initialize should never be called, because we
--- never declare a default-initialized controlled object (although
--- we do declare default-initialized records containing controlled
--- objects, with default expressions for the components).
--- Adjust should never be called, because every initialization
--- is via an aggregate. Finalize is called, because the objects
--- themselves need to be finalized.
--- Thus, Initialize and Adjust call Failed.
--- In some of the cases, these procedures will not yet be elaborated,
--- anyway.
---
--- CHANGE HISTORY:
--- 29 JUN 1999 RAD Initial Version
--- 23 SEP 1999 RLB Improved comments, renamed, issued.
--- 10 APR 2000 RLB Corrected errors in comments and text, fixed
--- discriminant error. Fixed so that Report.Test
--- is called before any Report.Failed call. Added
--- a marker so that the failed subtest can be
--- determined.
--- 26 APR 2000 RAD Try to defeat optimizations.
--- 04 AUG 2000 RLB Corrected error in Check_Equal.
--- 18 AUG 2000 RLB Removed dubious main subprogram renames (see AI-172).
--- 19 JUL 2002 RLB Fixed to avoid calling comment after Report.Result.
---
---!
-
-with Ada; use Ada;
-with Report; use Report; pragma Elaborate_All(Report);
-with Ada.Finalization;
-package C761010_1 is
- pragma Elaborate_Body;
- function Square(X: Integer) return Integer;
-private
- type TC_Control is new Ada.Finalization.Limited_Controlled with null record;
- procedure Initialize (Object : in out TC_Control);
- procedure Finalize (Object : in out TC_Control);
- TC_Finalize_Called : Boolean := False;
-end C761010_1;
-
-package body C761010_1 is
- function Square(X: Integer) return Integer is
- begin
- return X**2;
- end Square;
-
- procedure Initialize (Object : in out TC_Control) is
- begin
- Test("C761010_1",
- "Check that Adjust is not called"
- & " when aggregates are used to initialize objects");
- end Initialize;
-
- procedure Finalize (Object : in out TC_Control) is
- begin
- if not TC_Finalize_Called then
- Failed("Var_Strings Finalize never called");
- end if;
- Result;
- end Finalize;
-
- TC_Test : TC_Control; -- Starts test; finalization ends test.
-end C761010_1;
-
-with Ada.Finalization;
-package C761010_1.Var_Strings is
- type Var_String(<>) is private;
-
- Some_String: constant Var_String;
-
- function "=" (X, Y: Var_String) return Boolean;
-
- procedure Check_Equal(X, Y: Var_String);
- -- Calls to this are used to defeat optimizations
- -- that might otherwise defeat the purpose of the
- -- test. I'm talking about the optimization of removing
- -- unused controlled objects.
-
-private
-
- type String_Ptr is access constant String;
-
- type Var_String(Length: Natural) is new Finalization.Controlled with
- record
- Comp_1: String_Ptr := new String'(2..Square(Length)-1 => 'x');
- Comp_2: String_Ptr(1..Length) := null;
- Comp_3: String(Length..Length) := (others => '.');
- TC_Lab: Character := '1';
- end record;
- procedure Initialize(X: in out Var_String);
- procedure Adjust(X: in out Var_String);
- procedure Finalize(X: in out Var_String);
-
- Some_String: constant Var_String
- := (Finalization.Controlled with Length => 1,
- Comp_1 => null,
- Comp_2 => null,
- Comp_3 => "x",
- TC_Lab => 'A');
-
- Another_String: constant Var_String
- := (Finalization.Controlled with Length => 10,
- Comp_1 => Some_String.Comp_2,
- Comp_2 => new String'("1234567890"),
- Comp_3 => "x",
- TC_Lab => 'B');
-
-end C761010_1.Var_Strings;
-
-package C761010_1.Var_Strings.Types is
-
- type Ptr is access all Var_String;
- Ptr_Const: constant Ptr;
-
- type Ptr_Arr is array(Positive range <>) of Ptr;
- Ptr_Arr_Const: constant Ptr_Arr;
-
- type Ptr_Rec(N_Strings: Natural) is
- record
- Ptrs: Ptr_Arr(1..N_Strings);
- end record;
- Ptr_Rec_Const: constant Ptr_Rec;
-
-private
-
- Ptr_Const: constant Ptr := new Var_String'
- (Finalization.Controlled with
- Length => 1,
- Comp_1 => null,
- Comp_2 => null,
- Comp_3 => (others => ' '),
- TC_Lab => 'C');
-
- Ptr_Arr_Const: constant Ptr_Arr :=
- (1 => new Var_String'
- (Finalization.Controlled with
- Length => 1,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'D'));
-
- Ptr_Rec_Var: Ptr_Rec :=
- (3,
- (1..2 => null,
- 3 => new Var_String'
- (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'E')));
-
- Ptr_Rec_Const: constant Ptr_Rec :=
- (3,
- (1..2 => null,
- 3 => new Var_String'
- (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'F')));
-
- type Arr is array(Positive range <>) of Var_String(Length => 2);
-
- Arr_Var: Arr :=
- (1 => (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'G'));
-
- type Rec(N_Strings: Natural) is
- record
- Ptrs: Ptr_Rec(N_Strings);
- Strings: Arr(1..N_Strings) :=
- (others =>
- (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'H'));
- end record;
-
- Default_Init_Rec_Var: Rec(N_Strings => 10);
- Empty_Default_Init_Rec_Var: Rec(N_Strings => 0);
-
- Rec_Var: Rec(N_Strings => 2) :=
- (N_Strings => 2,
- Ptrs =>
- (2,
- (1..1 => null,
- 2 => new Var_String'
- (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'J'))),
- Strings =>
- (1 =>
- (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'K'),
- others =>
- (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'L')));
-
- procedure Check_Equal(X, Y: Rec);
-
-end C761010_1.Var_Strings.Types;
-
-package body C761010_1.Var_Strings.Types is
-
- -- Check that parameter passing doesn't create new objects,
- -- and therefore doesn't need extra Adjusts or Finalizes.
-
- procedure Check_Equal(X, Y: Rec) is
- -- We assume that the arguments should be equal.
- -- But we cannot assume that pointer values are the same.
- begin
- if X.N_Strings /= Y.N_Strings then
- Failed("Records should be equal (1)");
- else
- for I in 1 .. X.N_Strings loop
- if X.Ptrs.Ptrs(I) /= Y.Ptrs.Ptrs(I) then
- if X.Ptrs.Ptrs(I) = null or else
- Y.Ptrs.Ptrs(I) = null or else
- X.Ptrs.Ptrs(I).all /= Y.Ptrs.Ptrs(I).all then
- Failed("Records should be equal (2)");
- end if;
- end if;
- if X.Strings(I) /= Y.Strings(I) then
- Failed("Records should be equal (3)");
- end if;
- end loop;
- end if;
- end Check_Equal;
-
- procedure My_Check_Equal
- (X: Rec := Rec_Var;
- Y: Rec :=
- (N_Strings => 2,
- Ptrs =>
- (2,
- (1..1 => null,
- 2 => new Var_String'
- (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'M'))),
- Strings =>
- (1 =>
- (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'N'),
- others =>
- (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'O'))))
- renames Check_Equal;
-begin
-
- My_Check_Equal;
-
- Check_Equal(Rec_Var,
- (N_Strings => 2,
- Ptrs =>
- (2,
- (1..1 => null,
- 2 => new Var_String'
- (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'P'))),
- Strings =>
- (1 =>
- (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'Q'),
- others =>
- (Finalization.Controlled with
- Length => 2,
- Comp_1 => new String'("abcdefghij"),
- Comp_2 => null,
- Comp_3 => (2..2 => ' '),
- TC_Lab => 'R'))));
-
- -- Use the objects to avoid optimizations.
-
- Check_Equal(Ptr_Const.all, Ptr_Const.all);
- Check_Equal(Ptr_Arr_Const(1).all, Ptr_Arr_Const(1).all);
- Check_Equal(Ptr_Rec_Const.Ptrs(Ptr_Rec_Const.N_Strings).all,
- Ptr_Rec_Const.Ptrs(Ptr_Rec_Const.N_Strings).all);
- Check_Equal(Ptr_Rec_Var.Ptrs(Ptr_Rec_Var.N_Strings).all,
- Ptr_Rec_Var.Ptrs(Ptr_Rec_Var.N_Strings).all);
-
- if Report.Equal (3, 2) then
- -- Can't get here.
- Check_Equal (Arr_Var(1), Default_Init_Rec_Var.Strings(1));
- Check_Equal (Arr_Var(1), Empty_Default_Init_Rec_Var.Strings(1));
- end if;
-
-end C761010_1.Var_Strings.Types;
-
-with C761010_1.Var_Strings;
-with C761010_1.Var_Strings.Types;
-procedure C761010_1.Main is
-begin
- -- Report.Test is called by the elaboration of C761010_1, and
- -- Report.Result is called by the finalization of C761010_1.
- -- This will happen before any objects are created, and after any
- -- are finalized.
- null;
-end C761010_1.Main;
-
-with C761010_1.Main;
-procedure C761010 is
-begin
- C761010_1.Main;
-end C761010;
-
-package body C761010_1.Var_Strings is
-
- Some_Error: exception;
-
- procedure Initialize(X: in out Var_String) is
- begin
- Failed("Initialize should never be called");
- raise Some_Error;
- end Initialize;
-
- procedure Adjust(X: in out Var_String) is
- begin
- Failed("Adjust should never be called - case " & X.TC_Lab);
- raise Some_Error;
- end Adjust;
-
- procedure Finalize(X: in out Var_String) is
- begin
- Comment("Finalize called - case " & X.TC_Lab);
- C761010_1.TC_Finalize_Called := True;
- end Finalize;
-
- function "=" (X, Y: Var_String) return Boolean is
- -- Don't check the TC_Lab component, but do check the contents of the
- -- access values.
- begin
- if X.Length /= Y.Length then
- return False;
- end if;
- if X.Comp_3 /= Y.Comp_3 then
- return False;
- end if;
- if X.Comp_1 /= Y.Comp_1 then
- -- Still OK if the values are the same.
- if X.Comp_1 = null or else
- Y.Comp_1 = null or else
- X.Comp_1.all /= Y.Comp_1.all then
- return False;
- --else OK.
- end if;
- end if;
- if X.Comp_2 /= Y.Comp_2 then
- -- Still OK if the values are the same.
- if X.Comp_2 = null or else
- Y.Comp_2 = null or else
- X.Comp_2.all /= Y.Comp_2.all then
- return False;
- end if;
- end if;
- return True;
- end "=";
-
- procedure Check_Equal(X, Y: Var_String) is
- begin
- if X /= Y then
- Failed("Check_Equal of Var_String");
- end if;
- end Check_Equal;
-
-begin
- Check_Equal(Another_String, Another_String);
-end C761010_1.Var_Strings;
diff --git a/gcc/testsuite/ada/acats/tests/c7/c761011.a b/gcc/testsuite/ada/acats/tests/c7/c761011.a
deleted file mode 100644
index 1d447c755a9..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c761011.a
+++ /dev/null
@@ -1,410 +0,0 @@
--- C761011.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if a Finalize propagates an exception, other Finalizes due
--- to be performed are performed.
--- Case 1: A Finalize invoked due to the end of execution of
--- a master. (Defect Report 8652/0023, as reflected in Technical
--- Corrigendum 1).
--- Case 2: A Finalize invoked due to finalization of an anonymous
--- object. (Defect Report 8652/0023, as reflected in Technical
--- Corrigendum 1).
--- Case 3: A Finalize invoked due to the transfer of control
--- due to an exit statement.
--- Case 4: A Finalize invoked due to the transfer of control
--- due to a goto statement.
--- Case 5: A Finalize invoked due to the transfer of control
--- due to a return statement.
--- Case 6: A Finalize invoked due to the transfer of control
--- due to raises an exception.
---
---
--- CHANGE HISTORY:
--- 29 JAN 2001 PHL Initial version
--- 15 MAR 2001 RLB Readied for release; added optimization blockers.
--- Added test cases for paragraphs 18 and 19 of the
--- standard (the previous tests were withdrawn).
---
---!
-with Ada.Finalization;
-use Ada.Finalization;
-package C761011_0 is
-
- type Ctrl (D : Boolean) is new Ada.Finalization.Controlled with
- record
- Finalized : Boolean := False;
- case D is
- when False =>
- C1 : Integer;
- when True =>
- C2 : Float;
- end case;
- end record;
-
- function Create (Id : Integer) return Ctrl;
- procedure Finalize (Obj : in out Ctrl);
- function Was_Finalized (Id : Integer) return Boolean;
- procedure Use_It (Obj : in Ctrl);
- -- Use Obj to prevent optimization.
-
-end C761011_0;
-
-with Report;
-use Report;
-package body C761011_0 is
-
- User_Error : exception;
-
- Finalize_Called : array (0 .. 50) of Boolean := (others => False);
-
- function Create (Id : Integer) return Ctrl is
- Obj : Ctrl (Boolean'Val (Id mod Ident_Int (2)));
- begin
- case Obj.D is
- when False =>
- Obj.C1 := Ident_Int (Id);
- when True =>
- Obj.C2 := Float (Ident_Int (Id + Ident_Int (Id)));
- end case;
- return Obj;
- end Create;
-
- procedure Finalize (Obj : in out Ctrl) is
- begin
- if not Obj.Finalized then
- Obj.Finalized := True;
- if Obj.D then
- if Integer (Obj.C2 / 2.0) mod Ident_Int (10) =
- Ident_Int (3) then
- raise User_Error;
- else
- Finalize_Called (Integer (Obj.C2) / 2) := True;
- end if;
- else
- if Obj.C1 mod Ident_Int (10) = Ident_Int (0) then
- raise Tasking_Error;
- else
- Finalize_Called (Obj.C1) := True;
- end if;
- end if;
- end if;
- end Finalize;
-
- function Was_Finalized (Id : Integer) return Boolean is
- begin
- return Finalize_Called (Ident_Int (Id));
- end Was_Finalized;
-
- procedure Use_It (Obj : in Ctrl) is
- -- Use Obj to prevent optimization.
- begin
- case Obj.D is
- when True =>
- if not Equal (Boolean'Pos(Obj.Finalized),
- Boolean'Pos(Obj.Finalized)) then
- Failed ("Identity check - 1");
- end if;
- when False =>
- if not Equal (Obj.C1, Obj.C1) then
- Failed ("Identity check - 2");
- end if;
- end case;
- end Use_It;
-
-end C761011_0;
-
-with Ada.Exceptions;
-use Ada.Exceptions;
-with Ada.Finalization;
-with C761011_0;
-use C761011_0;
-with Report;
-use Report;
-procedure C761011 is
-begin
- Test
- ("C761011",
- " Check that if a finalize propagates an exception, other finalizes " &
- "due to be performed are performed");
-
- Normal: -- Case 1
- begin
- declare
- Obj1 : Ctrl := Create (Ident_Int (1));
- Obj2 : constant Ctrl := (Ada.Finalization.Controlled with
- D => False,
- Finalized => Ident_Bool (False),
- C1 => Ident_Int (2));
- Obj3 : Ctrl :=
- (Ada.Finalization.Controlled with
- D => True,
- Finalized => Ident_Bool (False),
- C2 => 2.0 * Float (Ident_Int
- (3))); -- Finalization: User_Error
- Obj4 : Ctrl := Create (Ident_Int (4));
- begin
- Comment ("Finalization of normal object");
- Use_It (Obj1); -- Prevent optimization of Objects.
- Use_It (Obj2); -- (Critical if AI-147 is adopted.)
- Use_It (Obj3);
- Use_It (Obj4);
- end;
- Failed ("No exception raised by finalization of normal object");
- exception
- when Program_Error =>
- if not Was_Finalized (Ident_Int (1)) or
- not Was_Finalized (Ident_Int (2)) or
- not Was_Finalized (Ident_Int (4)) then
- Failed ("Missing finalizations - 1");
- end if;
- when E: others =>
- Failed ("Exception " & Exception_Name (E) &
- " raised - " & Exception_Message (E) & " - 1");
- end Normal;
-
- Anon: -- Case 2
- begin
- declare
- Obj1 : Ctrl := (Ada.Finalization.Controlled with
- D => True,
- Finalized => Ident_Bool (False),
- C2 => 2.0 * Float (Ident_Int (5)));
- Obj2 : constant Ctrl := (Ada.Finalization.Controlled with
- D => False,
- Finalized => Ident_Bool (False),
- C1 => Ident_Int (6));
- Obj3 : Ctrl := (Ada.Finalization.Controlled with
- D => True,
- Finalized => Ident_Bool (False),
- C2 => 2.0 * Float (Ident_Int (7)));
- Obj4 : Ctrl := Create (Ident_Int (8));
- begin
- Comment ("Finalization of anonymous object");
-
- -- The finalization of the anonymous object below will raise
- -- Tasking_Error.
- if Create (Ident_Int (10)).C1 /= Ident_Int (10) then
- Failed ("Incorrect construction of an anonymous object");
- end if;
- Failed ("Anonymous object not finalized at the end of the " &
- "enclosing statement");
- Use_It (Obj1); -- Prevent optimization of Objects.
- Use_It (Obj2); -- (Critical if AI-147 is adopted.)
- Use_It (Obj3);
- Use_It (Obj4);
- end;
- Failed ("No exception raised by finalization of an anonymous " &
- "object of a function");
- exception
- when Program_Error =>
- if not Was_Finalized (Ident_Int (5)) or
- not Was_Finalized (Ident_Int (6)) or
- not Was_Finalized (Ident_Int (7)) or
- not Was_Finalized (Ident_Int (8)) then
- Failed ("Missing finalizations - 2");
- end if;
- when E: others =>
- Failed ("Exception " & Exception_Name (E) &
- " raised - " & Exception_Message (E) & " - 2");
- end Anon;
-
- An_Exit: -- Case 3
- begin
- for Counter in 1 .. 4 loop
- declare
- Obj1 : Ctrl := Create (Ident_Int (11));
- Obj2 : constant Ctrl := (Ada.Finalization.Controlled with
- D => False,
- Finalized => Ident_Bool (False),
- C1 => Ident_Int (12));
- Obj3 : Ctrl :=
- (Ada.Finalization.Controlled with
- D => True,
- Finalized => Ident_Bool (False),
- C2 => 2.0 * Float (
- Ident_Int(13))); -- Finalization: User_Error
- Obj4 : Ctrl := Create (Ident_Int (14));
- begin
- Comment ("Finalization because of exit of loop");
-
- Use_It (Obj1); -- Prevent optimization of Objects.
- Use_It (Obj2); -- (Critical if AI-147 is adopted.)
- Use_It (Obj3);
- Use_It (Obj4);
-
- exit when not Ident_Bool (Obj2.D);
-
- Failed ("Exit not taken");
- end;
- end loop;
- Failed ("No exception raised by finalization on exit");
- exception
- when Program_Error =>
- if not Was_Finalized (Ident_Int (11)) or
- not Was_Finalized (Ident_Int (12)) or
- not Was_Finalized (Ident_Int (14)) then
- Failed ("Missing finalizations - 3");
- end if;
- when E: others =>
- Failed ("Exception " & Exception_Name (E) &
- " raised - " & Exception_Message (E) & " - 3");
- end An_Exit;
-
- A_Goto: -- Case 4
- begin
- declare
- Obj1 : Ctrl := Create (Ident_Int (15));
- Obj2 : constant Ctrl := (Ada.Finalization.Controlled with
- D => False,
- Finalized => Ident_Bool (False),
- C1 => Ident_Int (0));
- -- Finalization: Tasking_Error
- Obj3 : Ctrl := Create (Ident_Int (16));
- Obj4 : Ctrl := (Ada.Finalization.Controlled with
- D => True,
- Finalized => Ident_Bool (False),
- C2 => 2.0 * Float (Ident_Int (17)));
- begin
- Comment ("Finalization because of goto statement");
-
- Use_It (Obj1); -- Prevent optimization of Objects.
- Use_It (Obj2); -- (Critical if AI-147 is adopted.)
- Use_It (Obj3);
- Use_It (Obj4);
-
- if Ident_Bool (Obj4.D) then
- goto Continue;
- end if;
-
- Failed ("Goto not taken");
- end;
- <<Continue>>
- Failed ("No exception raised by finalization on goto");
- exception
- when Program_Error =>
- if not Was_Finalized (Ident_Int (15)) or
- not Was_Finalized (Ident_Int (16)) or
- not Was_Finalized (Ident_Int (17)) then
- Failed ("Missing finalizations - 4");
- end if;
- when E: others =>
- Failed ("Exception " & Exception_Name (E) &
- " raised - " & Exception_Message (E) & " - 4");
- end A_Goto;
-
- A_Return: -- Case 5
- declare
- procedure Do_Something is
- Obj1 : Ctrl := Create (Ident_Int (18));
- Obj2 : Ctrl := (Ada.Finalization.Controlled with
- D => True,
- Finalized => Ident_Bool (False),
- C2 => 2.0 * Float (Ident_Int (19)));
- Obj3 : constant Ctrl := (Ada.Finalization.Controlled with
- D => False,
- Finalized => Ident_Bool (False),
- C1 => Ident_Int (20));
- -- Finalization: Tasking_Error
- begin
- Comment ("Finalization because of return statement");
-
- Use_It (Obj1); -- Prevent optimization of Objects.
- Use_It (Obj2); -- (Critical if AI-147 is adopted.)
- Use_It (Obj3);
-
- if not Ident_Bool (Obj3.D) then
- return;
- end if;
-
- Failed ("Return not taken");
- end Do_Something;
- begin
- Do_Something;
- Failed ("No exception raised by finalization on return statement");
- exception
- when Program_Error =>
- if not Was_Finalized (Ident_Int (18)) or
- not Was_Finalized (Ident_Int (19)) then
- Failed ("Missing finalizations - 5");
- end if;
- when E: others =>
- Failed ("Exception " & Exception_Name (E) &
- " raised - " & Exception_Message (E) & " - 5");
- end A_Return;
-
- Except: -- Case 6
- declare
- Funky_Error : exception;
-
- procedure Do_Something is
- Obj1 : Ctrl :=
- (Ada.Finalization.Controlled with
- D => True,
- Finalized => Ident_Bool (False),
- C2 => 2.0 * Float (
- Ident_Int(23))); -- Finalization: User_Error
- Obj2 : Ctrl := Create (Ident_Int (24));
- Obj3 : Ctrl := Create (Ident_Int (25));
- Obj4 : constant Ctrl := (Ada.Finalization.Controlled with
- D => False,
- Finalized => Ident_Bool (False),
- C1 => Ident_Int (26));
- begin
- Comment ("Finalization because of exception propagation");
-
- Use_It (Obj1); -- Prevent optimization of Objects.
- Use_It (Obj2); -- (Critical if AI-147 is adopted.)
- Use_It (Obj3);
- Use_It (Obj4);
-
- if not Ident_Bool (Obj4.D) then
- raise Funky_Error;
- end if;
-
- Failed ("Exception not raised");
- end Do_Something;
- begin
- Do_Something;
- Failed ("No exception raised by finalization on exception " &
- "propagation");
- exception
- when Program_Error =>
- if not Was_Finalized (Ident_Int (24)) or
- not Was_Finalized (Ident_Int (25)) or
- not Was_Finalized (Ident_Int (26)) then
- Failed ("Missing finalizations - 6");
- end if;
- when Funky_Error =>
- Failed ("Wrong exception propagated");
- -- Should be Program_Error (7.6.1(19)).
- when E: others =>
- Failed ("Exception " & Exception_Name (E) &
- " raised - " & Exception_Message (E) & " - 6");
- end Except;
-
- Result;
-end C761011;
-
diff --git a/gcc/testsuite/ada/acats/tests/c7/c761012.a b/gcc/testsuite/ada/acats/tests/c7/c761012.a
deleted file mode 100644
index 77b9e2253bf..00000000000
--- a/gcc/testsuite/ada/acats/tests/c7/c761012.a
+++ /dev/null
@@ -1,151 +0,0 @@
--- C761012.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an anonymous object is finalized with its enclosing master if
--- a transfer of control or exception occurs prior to performing its normal
--- finalization. (Defect Report 8652/0023, as reflected in
--- Technical Corrigendum 1, RM95 7.6.1(13.1/1)).
---
--- CHANGE HISTORY:
--- 29 JAN 2001 PHL Initial version.
--- 5 DEC 2001 RLB Reformatted for ACATS.
---
---!
-with Ada.Finalization;
-use Ada.Finalization;
-package C761012_0 is
-
- type Ctrl (D : Boolean) is new Controlled with
- record
- case D is
- when False =>
- C1 : Integer;
- when True =>
- C2 : Float;
- end case;
- end record;
-
- function Create return Ctrl;
- procedure Finalize (Obj : in out Ctrl);
- function Finalize_Was_Called return Boolean;
-
-end C761012_0;
-
-with Report;
-use Report;
-package body C761012_0 is
-
- Finalization_Flag : Boolean := False;
-
- function Create return Ctrl is
- Obj : Ctrl (Ident_Bool (True));
- begin
- Obj.C2 := 3.0;
- return Obj;
- end Create;
-
- procedure Finalize (Obj : in out Ctrl) is
- begin
- Finalization_Flag := True;
- end Finalize;
-
- function Finalize_Was_Called return Boolean is
- begin
- if Finalization_Flag then
- Finalization_Flag := False;
- return True;
- else
- return False;
- end if;
- end Finalize_Was_Called;
-
-end C761012_0;
-
-with Ada.Exceptions;
-use Ada.Exceptions;
-with C761012_0;
-use C761012_0;
-with Report;
-use Report;
-procedure C761012 is
-begin
- Test ("C761012",
- "Check that an anonymous object is finalized with its enclosing " &
- "master if a transfer of control or exception occurs prior to " &
- "performing its normal finalization");
-
- Excep:
- begin
-
- declare
- I : Integer := Create.C1; -- Raises Constraint_Error
- begin
- Failed
- ("Improper component selection did not raise Constraint_Error, I =" &
- Integer'Image (I));
- exception
- when Constraint_Error =>
- Failed ("Constraint_Error caught by the wrong handler");
- end;
-
- Failed ("Transfer of control did not happen correctly");
-
- exception
- when Constraint_Error =>
- if not Finalize_Was_Called then
- Failed ("Finalize wasn't called when the master was left " &
- "- Constraint_Error");
- end if;
- when E: others =>
- Failed ("Exception " & Exception_Name (E) &
- " raised - " & Exception_Information (E));
- end Excep;
-
- Transfer:
- declare
- Finalize_Was_Called_Before_Leaving_Exit : Boolean;
- begin
-
- begin
- loop
- exit when Create.C2 = 3.0;
- end loop;
- Finalize_Was_Called_Before_Leaving_Exit := Finalize_Was_Called;
- if Finalize_Was_Called_Before_Leaving_Exit then
- Comment ("Finalize called before the transfer of control");
- end if;
- end;
-
- if not Finalize_Was_Called and then
- not Finalize_Was_Called_Before_Leaving_Exit then
- Failed ("Finalize wasn't called when the master was left " &
- "- transfer of control");
- end if;
- end Transfer;
-
- Result;
-end C761012;
-
diff --git a/gcc/testsuite/ada/acats/tests/c8/c840001.a b/gcc/testsuite/ada/acats/tests/c8/c840001.a
deleted file mode 100644
index 2a1df16409a..00000000000
--- a/gcc/testsuite/ada/acats/tests/c8/c840001.a
+++ /dev/null
@@ -1,257 +0,0 @@
--- C840001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for the type determined by the subtype mark of a use type
--- clause, the declaration of each primitive operator is use-visible
--- within the scope of the clause, even if explicit operators with the
--- same names as the type's operators are declared for the subtype. Check
--- that a call to such an operator executes the body of the type's
--- operation.
---
--- TEST DESCRIPTION:
--- A type may declare a primitive operator, and a subtype of that type
--- may overload the operator. If a use type clause names the subtype,
--- it is the primitive operator of the type (not the subtype) which
--- is made directly visible, and the primitive operator may be called
--- unambiguously. Such a call executes the body of the type's operation.
---
--- In a package, declare a type for which a predefined operator is
--- overridden. In another package, declare a subtype of the type in the
--- previous package. Declare another version of the predefined operator
--- for the subtype.
---
--- The main program declares objects of both the type and the explicit
--- subtype, and uses the "**" operator for both. In all cases, the
--- operator declared for the 1st subtype should be the one executed,
--- since it is the primitive operators of the *type* that are made
--- visible; the operators which were declared for the explicit subtype
--- are not primitive operators of the type, since they were declared in
--- a separate package from the original type.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 23 Sep 99 RLB Added test case where operator made visible is
--- not visible by selection (as in AI-00122).
---
---!
-
-package C840001_0 is
--- Usage scenario: the predefined operators for a floating point type
--- are overridden in order to take advantage of improved algorithms.
-
- type Precision_Float is new Float range -100.0 .. 100.0;
- -- Implicit: function "**" (Left: Precision_Float; Right: Integer'Base)
- -- return Precision_Float;
-
- function "**" (Left: Precision_Float; Right: Integer'Base)
- return Precision_Float;
- -- Overrides predefined operator.
-
- function "+" (Right: Precision_Float)
- return Precision_Float;
- -- Overrides predefined operator.
-
- -- ... Other overridden operations.
-
- TC_Expected : constant Precision_Float := 68.0;
-
-end C840001_0;
-
-
- --==================================================================--
-
-package body C840001_0 is
-
- function "**" (Left: Precision_Float; Right: Integer'Base)
- return Precision_Float is
- begin
- -- ... Utilize desired algorithm.
- return (TC_Expected); -- Artificial for testing purposes.
- end "**";
-
- function "+" (Right: Precision_Float)
- return Precision_Float is
- -- Overrides predefined operator.
- begin
- return Right*2.0;
- end "+";
-
-end C840001_0;
-
-
- --==================================================================--
-
--- Take advantage of some even better algorithms designed for positive
--- floating point values.
-
-with C840001_0;
-package C840001_1 is
-
- subtype Precision_Pos_Float is C840001_0.Precision_Float
- range 0.0 .. 100.0;
-
--- This is not a new type, so it has no primitives of it own. However, it
--- can declare another version of the operator and call it as long as both it
--- and the corresponding operator of the 1st subtype are not directly visible
--- in the same place.
-
- function "**" (Left: Precision_Pos_Float; Right: Natural'Base)
- return Precision_Pos_Float; -- Accepts only positive exponent.
-
-end C840001_1;
-
-
- --==================================================================--
-
-package body C840001_1 is
-
- function "**" (Left: Precision_Pos_Float; Right: Natural'Base)
- return Precision_Pos_Float is
- begin
- -- ... Utilize some other algorithms.
- return 57.0; -- Artificial for testing purposes.
- end "**";
-
-end C840001_1;
-
-
- --==================================================================--
-
-with Report;
-with C840001_1;
-procedure C840001_2 is
-
- -- Note that C840001_0 and it's contents is not visible in any form here.
-
- TC_Operand : C840001_1.Precision_Pos_Float := 41.0;
-
- TC_Operand2 : C840001_1.Precision_Pos_Float;
-
- use type C840001_1.Precision_Pos_Float;
- -- Makes the operators of its parent type directly visible, even though
- -- the parent type and operators are not otherwise visible at all.
-
-begin
-
- TC_Operand2 := +TC_Operand; -- Overridden operator is visible and called.
-
- if TC_Operand2 /= 82.0 then -- Predefined equality.
- Report.Failed ("3rd test: type's overridden operation not called for " &
- "operand of 1st subtype");
- end if;
- if TC_Operand + 3.0 >= TC_Operand2 - 13.0 then -- Various predefined operators.
- Report.Failed ("3rd test: wrong result from predefined operators");
- end if;
-
-end C840001_2;
-
- --==================================================================--
-
-
-with C840001_0;
-with C840001_1;
-with C840001_2;
-
-with Report;
-
-procedure C840001 is
-
-begin
- Report.Test ("C840001", "Check that, for the type determined by the " &
- "subtype mark of a use type clause, the declaration of " &
- "each primitive operator is use-visible within the scope " &
- "of the clause, even if explicit operators with the same " &
- "names as the type's operators are declared for the subtype");
-
-
- Use_Type_Precision_Pos_Float:
- declare
- TC_Operand : C840001_0.Precision_Float
- := C840001_0.Precision_Float(-2.0);
- TC_Positive_Operand : C840001_1.Precision_Pos_Float := 6.0;
-
- TC_Actual_Type : C840001_0.Precision_Float;
- TC_Actual_Subtype : C840001_1.Precision_Pos_Float;
-
- use type C840001_1.Precision_Pos_Float;
- -- Both calls to "**" should return 68.0 (that is, Precision_Float's
- -- operation should be called).
-
- begin
-
- TC_Actual_Type := TC_Operand**2;
-
- if C840001_0."/="(TC_Actual_Type, C840001_0.TC_Expected) then
- Report.Failed ("1st block: type's operation not called for " &
- "operand of 1st subtype");
- end if;
-
- TC_Actual_Subtype := TC_Positive_Operand**2;
-
- if not (C840001_0."="
- (TC_Actual_Subtype, C840001_0.TC_Expected)) then
- Report.Failed ("1st block: type's operation not called for " &
- "operand of explicit subtype");
- end if;
-
- end Use_Type_Precision_Pos_Float;
-
- Use_Type_Precision_Float:
- declare
- TC_Operand : C840001_0.Precision_Float
- := C840001_0.Precision_Float(4.0);
- TC_Positive_Operand : C840001_1.Precision_Pos_Float := 7.0;
-
- TC_Actual_Type : C840001_0.Precision_Float;
- TC_Actual_Subtype : C840001_1.Precision_Pos_Float;
-
- use type C840001_0.Precision_Float;
- -- Again, both calls to "**" should return 68.0.
-
- begin
-
- TC_Actual_Type := TC_Operand**2;
-
- if C840001_0."/="(TC_Actual_Type, C840001_0.TC_Expected) then
- Report.Failed ("2nd block: type's operation not called for " &
- "operand of 1st subtype");
- end if;
-
- TC_Actual_Subtype := TC_Positive_Operand**2;
-
- if not C840001_0."=" (TC_Actual_Subtype, C840001_0.TC_Expected) then
- Report.Failed ("2nd block: type's operation not called for " &
- "operand of explicit subtype");
- end if;
-
- end Use_Type_Precision_Float;
-
- C840001_2; -- 3rd test.
-
- Report.Result;
-
-end C840001;
diff --git a/gcc/testsuite/ada/acats/tests/c8/c854001.a b/gcc/testsuite/ada/acats/tests/c8/c854001.a
deleted file mode 100644
index 5a128ba69b1..00000000000
--- a/gcc/testsuite/ada/acats/tests/c8/c854001.a
+++ /dev/null
@@ -1,277 +0,0 @@
--- C854001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a subprogram declaration can be completed by a
--- subprogram renaming declaration. In particular, check that such a
--- renaming-as-body can be given in a package body to complete a
--- subprogram declared in the package specification. Check that calls
--- to the subprogram invoke the body of the renamed subprogram. Check
--- that a renaming allows a copy of an inherited or predefined subprogram
--- before overriding it later. Check that renaming a dispatching
--- operation calls the correct body in case of overriding.
---
--- TEST DESCRIPTION:
--- This test declares a record type, an integer type, and a tagged type
--- with a set of operations in a package. A renaming of a predefined
--- equality operation of a tagged type is also defined in this package.
--- The predefined operation is overridden in the private part. In a
--- separate package, a subtype of the record type and integer type
--- are declared. Subset of the full set of operations for the record
--- and types is reexported using renamings-as-bodies. Other operations
--- are given explicit bodies. The test verifies that the appropriate
--- body is executed for each operation on the subtype.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 07 Nov 95 SAIC Update and repair for ACVC 2.0.1
---
---!
-
-package C854001_0 is
-
- type Component is (Op_Of_Type, Op_Of_Subtype, Initial_Value);
-
- type Root is record
- Called : Component := Op_Of_Subtype;
- end record;
-
- procedure Root_Proc (P: in out Root);
- procedure Over_Proc (P: in out Root);
-
- function Root_Func return Root;
- function Over_Func return Root;
-
- type Short_Int is range 1 .. 98;
-
- function "+" (P1, P2 : Short_Int) return Short_Int;
- function Name (P1, P2 : Short_Int) return Short_Int;
-
- type Tag_Type is tagged record
- C : Component := Initial_Value;
- end record;
- -- Inherits predefined operator "=" and others.
-
- function Predefined_Equal (P1, P2 : Tag_Type) return Boolean
- renames "=";
- -- Renames predefined operator "=" before overriding.
-
-private
- function "=" (P1, P2 : Tag_Type)
- return Boolean; -- Overrides predefined operator "=".
-
-
-end C854001_0;
-
-
- --==================================================================--
-
-
-package body C854001_0 is
-
- procedure Root_Proc (P: in out Root) is
- begin
- P.Called := Initial_Value;
- end Root_Proc;
-
- ---------------------------------------
- procedure Over_Proc (P: in out Root) is
- begin
- P.Called := Op_Of_Type;
- end Over_Proc;
-
- ---------------------------------------
- function Root_Func return Root is
- begin
- return (Called => Op_Of_Type);
- end Root_Func;
-
- ---------------------------------------
- function Over_Func return Root is
- begin
- return (Called => Initial_Value);
- end Over_Func;
-
- ---------------------------------------
- function "+" (P1, P2 : Short_Int) return Short_Int is
- begin
- return 15;
- end "+";
-
- ---------------------------------------
- function Name (P1, P2 : Short_Int) return Short_Int is
- begin
- return 47;
- end Name;
-
- ---------------------------------------
- function "=" (P1, P2 : Tag_Type) return Boolean is
- begin
- return False;
- end "=";
-
-end C854001_0;
-
- --==================================================================--
-
-
-with C854001_0;
-package C854001_1 is
-
- subtype Root_Subtype is C854001_0.Root;
- subtype Short_Int_Subtype is C854001_0.Short_Int;
-
- procedure Ren_Proc (P: in out Root_Subtype);
- procedure Same_Proc (P: in out Root_Subtype);
-
- function Ren_Func return Root_Subtype;
- function Same_Func return Root_Subtype;
-
- function Other_Name (P1, P2 : Short_Int_Subtype) return Short_Int_Subtype;
- function "-" (P1, P2 : Short_Int_Subtype) return Short_Int_Subtype;
-
- function User_Defined_Equal (P1, P2 : C854001_0.Tag_Type) return Boolean
- renames C854001_0."="; -- Executes body of the
- -- overriding declaration in
- -- the private part.
-end C854001_1;
-
-
- --==================================================================--
-
-
-with C854001_0;
-package body C854001_1 is
-
- --
- -- Renaming-as-body for procedure:
- --
-
- procedure Ren_Proc (P: in out Root_Subtype)
- renames C854001_0.Root_Proc;
- procedure Same_Proc (P: in out Root_Subtype)
- renames C854001_0.Over_Proc;
-
- --
- -- Renaming-as-body for function:
- --
-
- function Ren_Func return Root_Subtype renames C854001_0.Root_Func;
- function Same_Func return Root_Subtype renames C854001_0.Over_Func;
-
- function Other_Name (P1, P2 : Short_Int_Subtype) return Short_Int_Subtype
- renames C854001_0."+";
- function "-" (P1, P2 : Short_Int_Subtype) return Short_Int_Subtype
- renames C854001_0.Name;
-
-end C854001_1;
-
-
- --==================================================================--
-
-with C854001_0;
-with C854001_1; -- Subtype and associated operations.
-use C854001_1;
-
-with Report;
-
-procedure C854001 is
- Operand1 : Root_Subtype;
- Operand2 : Root_Subtype;
- Operand3 : Root_Subtype;
- Operand4 : Root_Subtype;
- Operand5 : Short_Int_Subtype := 55;
- Operand6 : Short_Int_Subtype := 46;
- Operand7 : Short_Int_Subtype;
- Operand8 : C854001_0.Tag_Type; -- Both Operand8 & Operand9 have
- Operand9 : C854001_0.Tag_Type; -- the same default values.
-
- -- Direct visibility to operator symbols
- use type C854001_0.Component;
- use type C854001_0.Short_Int;
-
-begin
- Report.Test ("C854001", "Check that a renaming-as-body can be given " &
- "in a package body to complete a subprogram " &
- "declared in the package specification. " &
- "Check that calls to the subprogram invoke " &
- "the body of the renamed subprogram");
-
- --
- -- Only operations of the subtype are available.
- --
-
- Ren_Proc (Operand1);
- if Operand1.Called /= C854001_0.Initial_Value then
- Report.Failed ("Error calling procedure Ren_Proc");
- end if;
-
- ---------------------------------------
- Same_Proc (Operand2);
- if Operand2.Called /= C854001_0.Op_Of_Type then
- Report.Failed ("Error calling procedure Same_Proc");
- end if;
-
- ---------------------------------------
- Operand3 := Ren_Func;
- if Operand3.Called /= C854001_0.Op_Of_Type then
- Report.Failed ("Error calling function Ren_Func");
- end if;
-
- ---------------------------------------
- Operand4 := Same_Func;
- if Operand4.Called /= C854001_0.Initial_Value then
- Report.Failed ("Error calling function Same_Func");
- end if;
-
- ---------------------------------------
- Operand7 := C854001_1."-" (Operand5, Operand6);
- if Operand7 /= 47 then
- Report.Failed ("Error calling function & ""-""");
- end if;
-
- ---------------------------------------
- Operand7 := Other_Name (Operand5, Operand6);
- if Operand7 /= 15 then
- Report.Failed ("Error calling function Other_Name");
- end if;
-
- ---------------------------------------
- -- Executes body of the overriding declaration in the private part
- -- of C854001_0.
- if User_Defined_Equal (Operand8, Operand9) then
- Report.Failed ("Error calling function User_Defined_Equal");
- end if;
-
- ---------------------------------------
- -- Executes predefined operation.
- if not C854001_0.Predefined_Equal (Operand8, Operand9) then
- Report.Failed ("Error calling function Predefined_Equal");
- end if;
-
- Report.Result;
-
-end C854001;
diff --git a/gcc/testsuite/ada/acats/tests/c8/c854002.a b/gcc/testsuite/ada/acats/tests/c8/c854002.a
deleted file mode 100644
index 19bca35984e..00000000000
--- a/gcc/testsuite/ada/acats/tests/c8/c854002.a
+++ /dev/null
@@ -1,185 +0,0 @@
--- C854002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
--- F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
--- software and documentation contained herein. Unlimited rights are
--- defined in DFAR 252.227-7013(a)(19). By making this public release,
--- the Government intends to confer upon all recipients unlimited rights
--- equal to those held by the Government. These rights include rights to
--- use, duplicate, release or disclose the released technical data and
--- computer software in whole or in part, in any manner and for any purpose
--- whatsoever, and to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE
--- Check the requirements of the new 8.5.4(8.A) from Technical
--- Corrigendum 1 (originally discussed as AI95-00064).
--- This paragraph requires an elaboration check on renamings-as-body:
--- even if the body of the ultimately-called subprogram has been
--- elaborated, the check should fail if the renaming-as-body
--- itself has not yet been elaborated.
---
--- TEST DESCRIPTION
--- We declare two functions F and G, and ensure that they are
--- elaborated before anything else, by using pragma Pure. Then we
--- declare two renamings-as-body: the renaming of F is direct, and
--- the renaming of G is via an access-to-function object. We call
--- the renamings during elaboration, and check that they raise
--- Program_Error. We then call them again after elaboration; this
--- time, they should work.
---
--- CHANGE HISTORY:
--- 29 JUN 1999 RAD Initial Version
--- 23 SEP 1999 RLB Improved comments, renamed, issued.
--- 28 JUN 2002 RLB Added pragma Elaborate_All for Report.
---!
-
-package C854002_1 is
- pragma Pure;
- -- Empty.
-end C854002_1;
-
-package C854002_1.Pure is
- pragma Pure;
- function F return String;
- function G return String;
-end C854002_1.Pure;
-
-with C854002_1.Pure;
-package C854002_1.Renamings is
-
- F_Result: constant String := C854002_1.Pure.F; -- Make sure we can call F.
- function Renamed_F return String;
-
- G_Result: constant String := C854002_1.Pure.G;
- type String_Function is access function return String;
- G_Pointer: String_Function := null;
- -- Will be set to C854002_1.Pure.G'Access in the body.
- function Renamed_G return String;
-
-end C854002_1.Renamings;
-
-package C854002_1.Caller is
-
- -- These procedures call the renamings; when called during elaboration,
- -- we pass Should_Fail => True, which checks that Program_Error is
- -- raised. Later, we use Should_Fail => False.
-
- procedure Call_Renamed_F(Should_Fail: Boolean);
- procedure Call_Renamed_G(Should_Fail: Boolean);
-
-end C854002_1.Caller;
-
-with Report; use Report; pragma Elaborate_All (Report);
-with C854002_1.Renamings;
-package body C854002_1.Caller is
-
- Some_Error: exception;
-
- procedure Call_Renamed_F(Should_Fail: Boolean) is
- begin
- if Should_Fail then
- begin
- Failed(C854002_1.Renamings.Renamed_F);
- raise Some_Error;
- -- This raise statement is necessary, because the
- -- Report package has a bug -- if Failed is called
- -- before Test, then the failure is ignored, and the
- -- test prints "PASSED".
- -- Presumably, this raise statement will cause the
- -- program to crash, thus avoiding the PASSED message.
- exception
- when Program_Error =>
- Comment("Program_Error -- OK");
- end;
- else
- if C854002_1.Renamings.F_Result /= C854002_1.Renamings.Renamed_F then
- Failed("Bad result from renamed F");
- end if;
- end if;
- end Call_Renamed_F;
-
- procedure Call_Renamed_G(Should_Fail: Boolean) is
- begin
- if Should_Fail then
- begin
- Failed(C854002_1.Renamings.Renamed_G);
- raise Some_Error;
- exception
- when Program_Error =>
- Comment("Program_Error -- OK");
- end;
- else
- if C854002_1.Renamings.G_Result /= C854002_1.Renamings.Renamed_G then
- Failed("Bad result from renamed G");
- end if;
- end if;
- end Call_Renamed_G;
-
-begin
- -- At this point, the bodies of Renamed_F and Renamed_G have not yet
- -- been elaborated, so calling them should raise Program_Error:
- Call_Renamed_F(Should_Fail => True);
- Call_Renamed_G(Should_Fail => True);
-end C854002_1.Caller;
-
-package body C854002_1.Pure is
-
- function F return String is
- begin
- return "This is function F";
- end F;
-
- function G return String is
- begin
- return "This is function G";
- end G;
-
-end C854002_1.Pure;
-
-with C854002_1.Pure;
-with C854002_1.Caller; pragma Elaborate(C854002_1.Caller);
- -- This pragma ensures that this package body (Renamings)
- -- will be elaborated after Caller, so that when Caller calls
- -- the renamings during its elaboration, the renamings will
- -- not have been elaborated (although what the rename have been).
-package body C854002_1.Renamings is
-
- function Renamed_F return String renames C854002_1.Pure.F;
-
- package Dummy is end; -- So we can insert statements here.
- package body Dummy is
- begin
- G_Pointer := C854002_1.Pure.G'Access;
- end Dummy;
-
- function Renamed_G return String renames G_Pointer.all;
-
-end C854002_1.Renamings;
-
-with Report; use Report;
-with C854002_1.Caller;
-procedure C854002 is
-begin
- Test("C854002",
- "An elaboration check is performed for a call to a subprogram"
- & " whose body is given as a renaming-as-body");
-
- -- By the time we get here, all library units have been elaborated,
- -- so the following calls should not raise Program_Error:
- C854002_1.Caller.Call_Renamed_F(Should_Fail => False);
- C854002_1.Caller.Call_Renamed_G(Should_Fail => False);
-
- Result;
-end C854002;
diff --git a/gcc/testsuite/ada/acats/tests/c8/c854003.a b/gcc/testsuite/ada/acats/tests/c8/c854003.a
deleted file mode 100644
index 9ab2364a92c..00000000000
--- a/gcc/testsuite/ada/acats/tests/c8/c854003.a
+++ /dev/null
@@ -1,64 +0,0 @@
--- C854003.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a renaming-as-body used before the subprogram is frozen only
--- requires mode conformance. (Defect Report 8652/0028, as reflected in
--- Technical Corrigendum 1, RM95 8.5.4(5/1)).
---
--- CHANGE HISTORY:
--- 29 JAN 2001 PHL Initial version.
--- 5 DEC 2001 RLB Reformatted for ACATS.
---
---!
-with Report;
-use Report;
-procedure C854003 is
-
- package P is
- type T is private;
- C1 : constant T;
- C2 : constant T;
- private
- type T is new Integer'Base;
- C1 : constant T := T (Ident_Int (1));
- C2 : constant T := T (Ident_Int (1));
- end P;
-
- function Equals (X, Y : P.T) return Boolean;
- function Equals (X, Y : P.T) return Boolean renames P."=";
-
-begin
- Test ("C854003",
- "Check that a renaming-as-body used before the subprogram " &
- "is frozen only requires mode conformance");
-
- if not Equals (P.C1, P.C2) then
- Failed ("Equality returned an unexpected result");
- end if;
-
- Result;
-end C854003;
-
diff --git a/gcc/testsuite/ada/acats/tests/c9/c910001.a b/gcc/testsuite/ada/acats/tests/c9/c910001.a
deleted file mode 100644
index 416e13ca8fb..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c910001.a
+++ /dev/null
@@ -1,224 +0,0 @@
--- C910001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that tasks may have discriminants. Specifically, check where
--- the subtype of the discriminant is a discrete subtype and where it is
--- an access subtype. Check the case where the default values of the
--- discriminants are used.
---
--- TEST DESCRIPTION:
--- A task is defined with two discriminants, one a discrete subtype and
--- another that is an access subtype. Tasks are created with various
--- values for discriminants and code within the task checks that these
--- are passed in correctly. One instance of a default is used. The
--- values passed to the task as the discriminants are taken from an
--- array of test data and the values received are checked against the
--- same array.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-
-procedure C910001 is
-
-
- type App_Priority is range 1..10;
- Default_Priority : App_Priority := 5;
-
- type Message_ID is range 1..10_000;
-
- type TC_Number_of_Messages is range 1..5;
-
- type TC_rec is record
- TC_ID : Message_ID;
- A_Priority : App_Priority;
- TC_Checked : Boolean;
- end record;
-
- -- This table is used to create the messages and to check them
- TC_table : array (1..TC_Number_of_Messages'Last) of TC_Rec :=
- ( ( 10, 6, false ),
- ( 20, 2, false ),
- ( 30, 9, false ),
- ( 40, 1, false ),
- ( 50, Default_Priority, false ) );
-
-begin -- C910001
-
- Report.Test ("C910001", "Check that tasks may have discriminants");
-
-
- declare -- encapsulate the test
-
- type Transaction_Record is
- record
- ID : Message_ID;
- Account_Number : integer := 0;
- Stock_Number : integer := 0;
- Quantity : integer := 0;
- Return_Value : integer := 0;
- end record;
- --
- type acc_Transaction_Record is access Transaction_Record;
-
-
- task type Message_Task
- (In_Message : acc_Transaction_Record := null;
- In_Priority : App_Priority := Default_Priority) is
- entry Start;
- end Message_Task;
- type acc_Message_Task is access Message_Task;
- --
- --
- task body Message_Task is
- This_Message : acc_Transaction_Record := In_Message;
- This_Priority : App_Priority := In_Priority;
- TC_Match_Found : Boolean := false;
- begin
- accept Start;
- -- In the example envisioned this task would then queue itself
- -- upon some Distributor task which would send it off (requeue) to
- -- the message processing tasks according to the priority of the
- -- message and the current load on the system. For the test we
- -- just verify the data passed in as discriminants and exit the task
- --
- -- Check for the special case of default discriminants
- if This_Message = null then
- -- The default In_Message has been passed, check that the
- -- default priority was also passed
- if This_Priority /= Default_Priority then
- Report.Failed ("Incorrect Default Priority");
- end if;
- if TC_Table (TC_Number_of_Messages'Last).TC_Checked then
- Report.Failed ("Duplicate Default messages");
- else
- -- Mark that default has been seen
- TC_Table (TC_Number_of_Messages'Last).TC_Checked := True;
- end if;
- TC_Match_Found := true;
- else
- -- Check the data against the table
- for i in TC_Number_of_Messages loop
- if TC_Table(i).TC_ID = This_Message.ID then
- -- this is the right slot in the table
- if TC_Table(i).TC_checked then
- -- Already checked
- Report.Failed ("Duplicate Data");
- else
- TC_Table(i).TC_checked := true;
- end if;
- TC_Match_Found := true;
- if TC_Table(i).A_Priority /= This_Priority then
- Report.Failed ("ID/Priority mismatch");
- end if;
- exit;
- end if;
- end loop;
- end if;
-
- if not TC_Match_Found then
- Report.Failed ("No ID match in table");
- end if;
-
- -- Allow the task to terminate
-
- end Message_Task;
-
-
- -- The Line Driver task accepts data from an external source and
- -- builds them into a transaction record. It then generates a
- -- message task. This message "contains" the record and is given
- -- a priority according to the contents of the message. The priority
- -- and transaction records are passed to the task as discriminants.
- -- In this test we use a dummy record. Only the ID is of interest
- -- so we pick that and the required priority from an array of
- -- test data. We artificially limit the endless driver-loop to
- -- the number of messages required for the test and add a special
- -- case to check the defaults.
- --
- task Driver_Task;
- --
- task body Driver_Task is
- begin
-
- -- Create all but one of the required tasks
- --
- for i in 1..TC_Number_of_Messages'Last - 1 loop
- declare
- -- Create a record for the next message
- Next_Transaction : acc_Transaction_Record :=
- new Transaction_Record;
- -- Create a task for the next message
- Next_Message_Task : acc_Message_Task :=
- new Message_Task( Next_Transaction,
- TC_Table(i).A_Priority );
-
- begin
- -- Artificially plug the ID with the next from the table
- -- In reality the whole record would be built here
- Next_Transaction.ID := TC_Table(i).TC_ID;
-
- -- Ensure the task does not start executing till the
- -- transaction record is properly constructed
- Next_Message_Task.Start;
-
- end; -- declare
- end loop;
-
- -- For this subtest create one task with the default discriminants
- --
- declare
-
- -- Create the task
- Next_Message_Task : acc_Message_Task := new Message_Task;
-
- begin
-
- Next_Message_Task.Start;
-
- end; -- declare
-
-
- end Driver_Task;
-
- begin
- null;
- end; -- encapsulation
-
- -- Now verify that all the tasks executed and checked in
- for i in TC_Number_of_Messages loop
- if not TC_Table(i).TC_Checked then
- Report.Failed
- ("Task" & integer'image(integer (i) ) & " did not verify");
- end if;
- end loop;
- Report.Result;
-
-end C910001;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c910002.a b/gcc/testsuite/ada/acats/tests/c9/c910002.a
deleted file mode 100644
index dc0b9b36bba..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c910002.a
+++ /dev/null
@@ -1,143 +0,0 @@
--- C910002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the contents of a task object include the values
--- of its discriminants.
--- Check that selected_component notation can be used to
--- denote a discriminant of a task.
---
--- TEST DESCRIPTION:
--- This test declares a task type that contains discriminants.
--- Objects of the task type are created with different values.
--- The task type has nested tasks that are used to check that
--- the discriminate values are the expected values.
--- Note that the names of the discriminants in the body of task
--- type DTT denote the current instance of the unit.
---
---
--- CHANGE HISTORY:
--- 12 OCT 95 SAIC Initial release for 2.1
--- 8 MAY 96 SAIC Incorporated Reviewer comments.
---
---!
-
-
-with Report;
-procedure C910002 is
- Verbose : constant Boolean := False;
-begin
- Report.Test ("C910002",
- "Check that selected_component notation can be" &
- " used to access task discriminants");
- declare
-
- task type DTT
- (IA, IB : Integer;
- CA, CB : Character) is
- entry Check_Values (First_Int : Integer;
- First_Char : Character);
- end DTT;
-
- task body DTT is
- Int1 : Integer;
- Char1 : Character;
-
- -- simple nested task to check the character values
- task Check_Chars is
- entry Start_Check;
- end Check_Chars;
- task body Check_Chars is
- begin
- accept Start_Check;
- if DTT.CA /= Char1 or
- DTT.CB /= Character'Succ (Char1) then
- Report.Failed ("character check failed. Expected: '" &
- Char1 & Character'Succ (Char1) &
- "' but found '" &
- DTT.CA & DTT.CB & "'");
- elsif Verbose then
- Report.Comment ("char check for " & Char1);
- end if;
- exception
- when others => Report.Failed ("exception in Check_Chars");
- end Check_Chars;
-
- -- use a discriminated task to check the integer values
- task type Check_Ints (First : Integer);
- task body Check_Ints is
- begin
- if DTT.IA /= Check_Ints.First or
- IB /= First+1 then
- Report.Failed ("integer check failed. Expected:" &
- Integer'Image (Check_Ints.First) &
- Integer'Image (First+1) &
- " but found" &
- Integer'Image (DTT.IA) & Integer'Image (IB) );
- elsif Verbose then
- Report.Comment ("int check for" & Integer'Image (First));
- end if;
- exception
- when others => Report.Failed ("exception in Check_Ints");
- end Check_Ints;
- begin
- accept Check_Values (First_Int : Integer;
- First_Char : Character) do
- Int1 := First_Int;
- Char1 := First_Char;
- end Check_Values;
-
- -- kick off the character check
- Check_Chars.Start_Check;
-
- -- do the integer check
- declare
- Int_Checker : Check_Ints (Int1);
- begin
- null; -- let task do its thing
- end;
-
- -- do one test here too
- if DTT.IA /= Int1 then
- Report.Failed ("DTT check failed. Expected:" &
- Integer'Image (Int1) &
- " but found:" &
- Integer'Image (DTT.IA));
- elsif Verbose then
- Report.Comment ("DTT check for" & Integer'Image (Int1));
- end if;
- exception
- when others => Report.Failed ("exception in DTT");
- end DTT;
-
- T1a : DTT (1, 2, 'a', 'b');
- T9C : DTT (9, 10, 'C', 'D');
- begin -- test encapsulation
- T1a.Check_Values (1, 'a');
- T9C.Check_Values (9, 'C');
- end;
-
- Report.Result;
-end C910002;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c910003.a b/gcc/testsuite/ada/acats/tests/c9/c910003.a
deleted file mode 100644
index b2e11cef826..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c910003.a
+++ /dev/null
@@ -1,185 +0,0 @@
--- C910003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
--- F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
--- software and documentation contained herein. Unlimited rights are
--- defined in DFAR 252.227-7013(a)(19). By making this public release,
--- the Government intends to confer upon all recipients unlimited rights
--- equal to those held by the Government. These rights include rights to
--- use, duplicate, release or disclose the released technical data and
--- computer software in whole or in part, in any manner and for any purpose
--- whatsoever, and to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that task discriminants that have an access subtype may be
--- dereferenced.
---
--- Note that discriminants in Ada 83 never can be dereferenced with
--- selection or indexing, as they cannot have an access type.
---
--- TEST DESCRIPTION:
--- A protected object is defined to create a simple buffer.
--- Two task types are defined, one to put values into the buffer,
--- and one to remove them. The tasks are passed a buffer object as
--- a discriminant with an access subtype. The producer task type includes
--- a discriminant to determine the values to product. The consumer task
--- type includes a value to save the results.
--- Two producer and one consumer tasks are declared, and the results
--- are checked.
---
--- CHANGE HISTORY:
--- 10 Mar 99 RLB Created test.
---
---!
-
-package C910003_Pack is
-
- type Item_Type is range 1 .. 100; -- In a real application, this probably
- -- would be a record type.
-
- type Item_Array is array (Positive range <>) of Item_Type;
-
- protected type Buffer is
- entry Put (Item : in Item_Type);
- entry Get (Item : out Item_Type);
- function TC_Items_Buffered return Item_Array;
- private
- Saved_Item : Item_Type;
- Empty : Boolean := True;
- TC_Items : Item_Array (1 .. 10);
- TC_Last : Natural := 0;
- end Buffer;
-
- type Buffer_Access_Type is access Buffer;
-
- PRODUCE_COUNT : constant := 2; -- Number of items to produce.
-
- task type Producer (Buffer_Access : Buffer_Access_Type;
- Start_At : Item_Type);
- -- Produces PRODUCE_COUNT items. Starts when activated.
-
- type TC_Item_Array_Access_Type is access Item_Array (1 .. PRODUCE_COUNT*2);
-
- task type Consumer (Buffer_Access : Buffer_Access_Type;
- Results : TC_Item_Array_Access_Type) is
- -- Stores PRODUCE_COUNT*2 items consumed in Results. Starts when
- -- activated.
- entry Wait_until_Done;
- end Consumer;
-
-end C910003_Pack;
-
-
-with Report;
-package body C910003_Pack is
-
- protected body Buffer is
- entry Put (Item : in Item_Type) when Empty is
- begin
- Empty := False;
- Saved_Item := Item;
- TC_Last := TC_Last + 1;
- TC_Items(TC_Last) := Item;
- end Put;
-
- entry Get (Item : out Item_Type) when not Empty is
- begin
- Empty := True;
- Item := Saved_Item;
- end Get;
-
- function TC_Items_Buffered return Item_Array is
- begin
- return TC_Items(1..TC_Last);
- end TC_Items_Buffered;
-
- end Buffer;
-
-
- task body Producer is
- -- Produces PRODUCE_COUNT items. Starts when activated.
- begin
- for I in 1 .. Report.Ident_Int(PRODUCE_COUNT) loop
- Buffer_Access.Put (Start_At + (Item_Type(I)-1)*2);
- end loop;
- end Producer;
-
-
- task body Consumer is
- -- Stores PRODUCE_COUNT*2 items consumed in Results. Starts when
- -- activated.
- begin
- for I in 1 .. Report.Ident_Int(PRODUCE_COUNT*2) loop
- Buffer_Access.Get (Results (I));
- -- Buffer_Access and Results are both dereferenced.
- end loop;
-
- -- Check the results (and function call with a prefix dereference).
- if Results.all(Report.Ident_Int(1)) /= Buffer_Access.all.TC_Items_Buffered(Report.Ident_Int(1)) then
- Report.Failed ("First item mismatch");
- end if;
- if Results(Report.Ident_Int(2)) /= Buffer_Access.TC_Items_Buffered(Report.Ident_Int(2)) then
- Report.Failed ("Second item mismatch");
- end if;
- accept Wait_until_Done; -- Tell main that we're done.
- end Consumer;
-
-end C910003_Pack;
-
-
-with Report;
-with C910003_Pack;
-
-procedure C910003 is
-
-begin -- C910003
-
- Report.Test ("C910003", "Check that tasks discriminants of access types can be dereferenced");
-
-
- declare -- encapsulate the test
-
- Buffer_Access : C910003_Pack.Buffer_Access_Type :=
- new C910003_Pack.Buffer;
-
- TC_Results : C910003_Pack.TC_Item_Array_Access_Type :=
- new C910003_Pack.Item_Array (1 .. C910003_Pack.PRODUCE_COUNT*2);
-
- Producer_1 : C910003_Pack.Producer (Buffer_Access, 12);
- Producer_2 : C910003_Pack.Producer (Buffer_Access, 23);
-
- Consumer : C910003_Pack.Consumer (Buffer_Access, TC_Results);
-
- use type C910003_Pack.Item_Array; -- For /=.
-
- begin
- Consumer.Wait_until_Done;
- if TC_Results.all /= Buffer_Access.TC_Items_Buffered then
- Report.Failed ("Different items buffered than returned - Main");
- end if;
- if (TC_Results.all /= (12, 14, 23, 25) and
- TC_Results.all /= (12, 23, 14, 25) and
- TC_Results.all /= (12, 23, 25, 14) and
- TC_Results.all /= (23, 12, 14, 25) and
- TC_Results.all /= (23, 12, 25, 14) and
- TC_Results.all /= (23, 25, 12, 14)) then
- -- Above are the only legal results.
- Report.Failed ("Wrong results");
- end if;
- end; -- encapsulation
-
- Report.Result;
-
-end C910003;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c930001.a b/gcc/testsuite/ada/acats/tests/c9/c930001.a
deleted file mode 100644
index 87451899021..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c930001.a
+++ /dev/null
@@ -1,153 +0,0 @@
--- C930001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check when a dependent task and its master both
--- terminate as a result of a terminate alternative that
--- finalization is performed and that the finalization is
--- performed in the proper order.
---
--- TEST DESCRIPTION:
--- A controlled type with finalization is used to determine
--- the order in which finalization occurs. The finalization
--- procedure records the identity of the object being
--- finalized.
--- Two tasks, one nested inside the other, both contain
--- objects of the above finalization type. These tasks
--- cooperatively terminate so the termination and finalization
--- order can be noted.
---
---
--- CHANGE HISTORY:
--- 08 Jan 96 SAIC ACVC 2.1
--- 09 May 96 SAIC Addressed Reviewer comments.
---
---!
-
-
-with Ada.Finalization;
-package C930001_0 is
- Verbose : constant Boolean := False;
-
- type Ids is range 0..10;
- Finalization_Order : array (Ids) of Ids := (Ids => 0);
- Finalization_Cnt : Ids := 0;
-
- protected Note is
- -- serializes concurrent access to Finalization_* above
- procedure Done (Id : Ids);
- end Note;
-
- -- Objects of the following type are used to note the order in
- -- which finalization occurs.
- type Has_Finalization is new Ada.Finalization.Limited_Controlled with
- record
- Id : Ids;
- end record;
- procedure Finalize (Object : in out Has_Finalization);
-end C930001_0;
-
-
-with Report;
-package body C930001_0 is
-
- protected body Note is
- procedure Done (Id : Ids) is
- begin
- Finalization_Cnt := Finalization_Cnt + 1;
- Finalization_Order (Finalization_Cnt) := Id;
- end Done;
- end Note;
-
- procedure Finalize (Object : in out Has_Finalization) is
- begin
- Note.Done (Object.Id);
- if Verbose then
- Report.Comment ("in Finalize for" & Ids'Image (Object.Id));
- end if;
- end Finalize;
-end C930001_0;
-
-
-with Report;
-with ImpDef;
-with C930001_0; use C930001_0;
-procedure C930001 is
-begin
-
- Report.Test ("C930001", "Check that dependent tasks are terminated" &
- " before the remaining finalization");
-
- declare
- task Level_1;
- task body Level_1 is
- V1a : C930001_0.Has_Finalization; -------> 4
- task Level_2 is
- entry Not_Taken;
- end Level_2;
- task body Level_2 is
- V2 : C930001_0.Has_Finalization; -------> 2
- begin
- V2.Id := 2;
- C930001_0.Note.Done (1); -------> 1
- select
- accept Not_Taken;
- or
- terminate;
- -- cooperative termination at this point of
- -- both tasks
- end select;
- end Level_2;
-
- -- 7.6.1(11) requires that V1b be finalized before V1a
- V1b : C930001_0.Has_Finalization; -------> 3
- begin
- V1a.Id := 4;
- V1b.Id := 3;
- end Level_1;
- begin -- declare
- while not Level_1'Terminated loop
- delay ImpDef.Switch_To_New_Task;
- end loop;
- C930001_0.Note.Done (5); -------> 5
-
- -- now check the order
- for I in Ids range 1..5 loop
- if Verbose then
- Report.Comment (Ids'Image (I) &
- Ids'Image (Finalization_Order (I)));
- end if;
- if Finalization_Order (I) /= I then
- Report.Failed ("Finalization occurred out of order" &
- " expected:" &
- Ids'Image (I) &
- " actual:" &
- Ids'Image (Finalization_Order (I)));
- end if;
- end loop;
- end;
-
- Report.Result;
-end C930001;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940001.a b/gcc/testsuite/ada/acats/tests/c9/c940001.a
deleted file mode 100644
index 2bc1a9ffd03..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940001.a
+++ /dev/null
@@ -1,212 +0,0 @@
--- C940001.A
---
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a protected object provides coordinated access to
--- shared data. Check that it can be used to sequence a number of tasks.
--- Use the protected object to control a single token for which three
--- tasks compete. Check that only one task is running at a time and that
--- all tasks get a chance to run sometime.
---
--- TEST DESCRIPTION:
--- Declare a protected type with two entries. A task may call the Take
--- entry to get a token which allows it to continue processing. If it
--- has the token, it may call the Give entry to return it. The tasks
--- implement a discipline whereby only the task with the token may be
--- active. The test does not require any specific order for the tasks
--- to run.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 07 Jul 96 SAIC Fixed spelling nits.
---
---!
-
-package C940001_0 is
-
- type Token_Type is private;
- True_Token : constant Token_Type; -- Create a deferred constant in order
- -- to provide a component init for the
- -- protected object
-
- protected type Token_Mgr_Prot_Unit is
- entry Take (T : out Token_Type);
- entry Give (T : in out Token_Type);
- private
- Token : Token_Type := True_Token;
- end Token_Mgr_Prot_Unit;
-
- function Init_Token return Token_Type; -- call to initialize an
- -- object of Token_Type
- function Token_Value (T : Token_Type) return Boolean;
- -- call to inspect the value of an
- -- object of Token_Type
-private
- type Token_Type is new boolean;
- True_Token : constant Token_Type := true;
-end C940001_0;
-
---=================================================================--
-
-package body C940001_0 is
- protected body Token_Mgr_Prot_Unit is
- entry Take (T : out Token_Type) when Token = true is
- begin -- Calling task will Take the token, so
- T := Token; -- check first that token_mgr owns the
- Token := false; -- token to give, then give it to caller
- end Take;
-
- entry Give (T : in out Token_Type) when Token = false is
- begin -- Calling task will Give the token back,
- if T = true then -- so first check that token_mgr does not
- Token := T; -- own the token, then check that the task has
- T := false; -- the token to give, then take it from the
- end if; -- task
- -- if caller does not own the token, then
- end Give; -- it falls out of the entry body with no
- end Token_Mgr_Prot_Unit; -- action
-
- function Init_Token return Token_Type is
- begin
- return false;
- end Init_Token;
-
- function Token_Value (T : Token_Type) return Boolean is
- begin
- return Boolean (T);
- end Token_Value;
-
-end C940001_0;
-
---===============================================================--
-
-with Report;
-with ImpDef;
-with C940001_0;
-
-procedure C940001 is
-
- type TC_Int_Type is range 0..2;
- -- range is very narrow so that erroneous execution may
- -- raise Constraint_Error
-
- type TC_Artifact_Type is record
- TC_Int : TC_Int_Type := 1;
- Number_of_Accesses : integer := 0;
- end record;
-
- TC_Artifact : TC_Artifact_Type;
-
- Sequence_Mgr : C940001_0.Token_Mgr_Prot_Unit;
-
- procedure Bump (Item : in out TC_Int_Type) is
- begin
- Item := Item + 1;
- exception
- when Constraint_Error =>
- Report.Failed ("Incremented without corresponding decrement");
- when others =>
- Report.Failed ("Bump raised Unexpected Exception");
- end Bump;
-
- procedure Decrement (Item : in out TC_Int_Type) is
- begin
- Item := Item - 1;
- exception
- when Constraint_Error =>
- Report.Failed ("Decremented without corresponding increment");
- when others =>
- Report.Failed ("Decrement raised Unexpected Exception");
- end Decrement;
-
- --==============--
-
- task type Network_Node_Type;
-
- task body Network_Node_Type is
-
- Slot_for_Token : C940001_0.Token_Type := C940001_0.Init_Token;
-
- begin
-
- -- Ask for token - if request is not granted, task will be queued
- Sequence_Mgr.Take (Slot_for_Token);
-
- -- Task now has token and may perform its work
-
- --==========================--
- -- in this case, the work is to ensure that the test results
- -- are the expected ones!
- --==========================--
- Bump (TC_Artifact.TC_Int); -- increment when request is granted
- TC_Artifact.Number_Of_Accesses :=
- TC_Artifact.Number_Of_Accesses + 1;
- if not C940001_0.Token_Value ( Slot_for_Token) then
- Report.Failed ("Incorrect results from entry Take");
- end if;
-
- -- give a chance for other tasks to (incorrectly) run
- delay ImpDef.Minimum_Task_Switch;
-
- Decrement (TC_Artifact.TC_Int); -- prepare to return token
-
- -- Task has completed its work and will return token
-
- Sequence_Mgr.Give (Slot_for_Token); -- return token to sequence manager
-
- if c940001_0.Token_Value (Slot_for_Token) then
- Report.Failed ("Incorrect results from entry Give");
- end if;
-
- exception
- when others => Report.Failed ("Unexpected exception raised in task");
-
- end Network_Node_Type;
-
- --==============--
-
-begin
-
- Report.Test ("C940001", "Check that a protected object can control " &
- "tasks by coordinating access to shared data");
-
- declare
- Node_1, Node_2, Node_3 : Network_Node_Type;
- -- declare three tasks which will compete for
- -- a single token, managed by Sequence Manager
-
- begin -- tasks start
- null;
- end; -- wait for all tasks to terminate before reporting result
-
- if TC_Artifact.Number_of_Accesses /= 3 then
- Report.Failed ("Not all tasks got through");
- end if;
-
- Report.Result;
-
-end C940001;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940002.a b/gcc/testsuite/ada/acats/tests/c9/c940002.a
deleted file mode 100644
index 420f54440ed..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940002.a
+++ /dev/null
@@ -1,309 +0,0 @@
--- C940002.A
---
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a protected object provides coordinated access to shared
--- data. Check that it can implement a semaphore-like construct using a
--- parameterless procedure which allows a specific maximum number of tasks
--- to run and excludes all others
---
--- TEST DESCRIPTION:
--- Implement a counting semaphore type that can be initialized to a
--- specific number of available resources. Declare an entry for
--- requesting a resource and a procedure for releasing it. Declare an
--- object of this type, initialized to two resources. Declare and start
--- three tasks each of which asks for a resource. Verify that only two
--- resources are granted and that the last task in is queued.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-package C940002_0 is
- -- Semaphores
-
- protected type Semaphore_Type (Resources_Available : Integer :=1) is
- entry Request;
- procedure Release;
- function Available return Integer;
- private
- Currently_Available : Integer := Resources_Available;
- end Semaphore_Type;
-
- Max_Resources : constant Integer := 2;
- Resource : Semaphore_Type (Max_Resources);
-
-end C940002_0;
- -- Semaphores;
-
-
- --========================================================--
-
-
-package body C940002_0 is
- -- Semaphores
-
- protected body Semaphore_Type is
-
- entry Request when Currently_Available >0 is -- when granted, secures
- begin -- a resource
- Currently_Available := Currently_Available - 1;
- end Request;
-
- procedure Release is -- when called, releases
- begin -- a resource
- Currently_Available := Currently_Available + 1;
- end Release;
-
- function Available return Integer is -- returns number of
- begin -- available resources
- return Currently_Available;
- end Available;
-
- end Semaphore_Type;
-
-end C940002_0;
- -- Semaphores;
-
-
- --========================================================--
-
-
-package C940002_1 is
- -- Task_Pkg
-
- task type Requesting_Task is
- entry Done; -- call on Done instructs the task
- end Requesting_Task; -- to release resource
-
- type Task_Ptr is access Requesting_Task;
-
- protected Counter is
- procedure Increment;
- procedure Decrement;
- function Number return integer;
- private
- Count : Integer := 0;
- end Counter;
-
- protected Hold_Lock is
- procedure Lock;
- procedure Unlock;
- function Locked return Boolean;
- private
- Lock_State : Boolean := true; -- starts out locked
- end Hold_Lock;
-
-
-end C940002_1;
- -- Task_Pkg
-
-
- --========================================================--
-
-
-with Report;
-with C940002_0;
- -- Semaphores;
-
-package body C940002_1 is
- -- Task_Pkg is
-
- protected body Counter is
-
- procedure Increment is
- begin
- Count := Count + 1;
- end Increment;
-
- procedure Decrement is
- begin
- Count := Count - 1;
- end Decrement;
-
- function Number return Integer is
- begin
- return Count;
- end Number;
-
- end Counter;
-
-
- protected body Hold_Lock is
-
- procedure Lock is
- begin
- Lock_State := true;
- end Lock;
-
- procedure Unlock is
- begin
- Lock_State := false;
- end Unlock;
-
- function Locked return Boolean is
- begin
- return Lock_State;
- end Locked;
-
- end Hold_Lock;
-
-
- task body Requesting_Task is
- begin
- C940002_0.Resource.Request; -- request a resource
- -- if resource is not available,
- -- task will be queued to wait
- Counter.Increment; -- add to count of resources obtained
- Hold_Lock.Unlock; -- and unlock Lock - system is stable;
- -- status may now be queried
-
- accept Done do -- hold resource until Done is called
- C940002_0.Resource.Release; -- release the resource and
- Counter.Decrement; -- note release
- end Done;
-
- exception
- when others => Report.Failed ("Unexpected Exception in Requesting_Task");
- end Requesting_Task;
-
-end C940002_1;
- -- Task_Pkg;
-
-
- --========================================================--
-
-
-with Report;
-with ImpDef;
-with C940002_0,
- -- Semaphores,
- C940002_1;
- -- Task_Pkg;
-
-procedure C940002 is
-
- package Semaphores renames C940002_0;
- package Task_Pkg renames C940002_1;
-
- Ptr1,
- Ptr2,
- Ptr3 : Task_Pkg.Task_Ptr;
- Num : Integer;
-
- procedure Spinlock is
- begin
- -- loop until unlocked
- while Task_Pkg.Hold_Lock.Locked loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- Task_Pkg.Hold_Lock.Lock;
- end Spinlock;
-
-begin
-
- Report.Test ("C940002", "Check that a protected record can be used to " &
- "control access to resources");
-
- if (Task_Pkg.Counter.Number /=0)
- or (Semaphores.Resource.Available /= 2) then
- Report.Failed ("Wrong initial conditions");
- end if;
-
- Ptr1 := new Task_Pkg.Requesting_Task; -- newly allocated task requests
- -- resource; request for resource should
- -- be granted
- Spinlock; -- ensure that task obtains resource
-
- -- Task 1 waiting for call to Done
- -- One resource assigned to task 1
- -- One resource still available
- if (Task_Pkg.Counter.Number /= 1)
- or (Semaphores.Resource.Available /= 1) then
- Report.Failed ("Resource not assigned to task 1");
- end if;
-
- Ptr2 := new Task_Pkg.Requesting_Task; -- newly allocated task requests
- -- resource; request for resource should
- -- be granted
- Spinlock; -- ensure that task obtains resource
-
- -- Task 1 waiting for call to Done
- -- Task 2 waiting for call to Done
- -- Resources held by tasks 1 and 2
- -- No resources available
- if (Task_Pkg.Counter.Number /= 2)
- or (Semaphores.Resource.Available /= 0) then
- Report.Failed ("Resource not assigned to task 2");
- end if;
-
- Ptr3 := new Task_Pkg.Requesting_Task; -- newly allocated task requests
- -- resource; request for resource should
- -- be denied and task queued to wait for
- -- next available resource
-
-
- Ptr1.all.Done; -- Task 1 releases resource and lock
- -- Resource should be given to queued task
- Spinlock; -- ensure that resource is released
-
-
- -- Task 1 holds no resource
- -- One resource still assigned to task 2
- -- One resource assigned to task 3
- -- No resources available
- if (Task_Pkg.Counter.Number /= 2)
- or (Semaphores.Resource.Available /= 0) then
- Report.Failed ("Resource not properly released/assigned to task 3");
- end if;
-
- Ptr2.all.Done; -- Task 2 releases resource and lock
- -- No outstanding request for resource
-
- -- Tasks 1 and 2 hold no resources
- -- One resource assigned to task 3
- -- One resource available
- if (Task_Pkg.Counter.Number /= 1)
- or (Semaphores.Resource.Available /= 1) then
- Report.Failed ("Resource not properly released from task 2");
- end if;
-
- Ptr3.all.Done; -- Task 3 releases resource and lock
-
- -- All resources released
- -- All tasks terminated (or close)
- -- Two resources available
- if (Task_Pkg.Counter.Number /=0)
- or (Semaphores.Resource.Available /= 2) then
- Report.Failed ("Resource not properly released from task 3");
- end if;
-
- Report.Result;
-
-end C940002;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940004.a b/gcc/testsuite/ada/acats/tests/c9/c940004.a
deleted file mode 100644
index 059c97f41b6..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940004.a
+++ /dev/null
@@ -1,416 +0,0 @@
--- C940004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that a protected record can be used to control access to
--- resources (data internal to the protected record).
---
--- TEST DESCRIPTION:
--- Declare a resource descriptor tagged type. Extend the type and
--- use the extended type in a protected data structure.
--- Implement a binary semaphore type. Declare an entry for
--- requesting a specific resource and an procedure for releasing the
--- same resource. Declare an object of this (protected) type.
--- Declare and start three tasks each of which asks for a resource
--- when directed to. Verify that resources are properly allocated
--- and deallocated.
---
---
--- CHANGE HISTORY:
---
--- 12 DEC 93 SAIC Initial PreRelease version
--- 23 JUL 95 SAIC Second PreRelease version
--- 16 OCT 95 SAIC ACVC 2.1
--- 13 MAR 03 RLB Fixed race condition in test.
---
---!
-
-package C940004_0 is
--- Resource_Pkg
-
- type ID_Type is new Integer range 0..10;
- type User_Descriptor_Type is tagged record
- Id : ID_Type := 0;
- end record;
-
-end C940004_0; -- Resource_Pkg
-
---============================--
--- no body for C940004_0
---=============================--
-
-with C940004_0; -- Resource_Pkg
-
--- This generic package implements a semaphore to control a single resource
-
-generic
-
- type Generic_Record_Type is new C940004_0.User_Descriptor_Type
- with private;
-
-package C940004_1 is
--- Generic_Semaphore_Pkg
- -- generic package extends the tagged formal generic
- -- type with some implementation relevant details, and
- -- it provides a semaphore with operations that work
- -- on that type
- type User_Rec_Type is new Generic_Record_Type with private;
-
- protected type Semaphore_Type is
- function TC_Count return Integer;
- entry Request (R : in out User_Rec_Type);
- procedure Release (R : in out User_Rec_Type);
- private
- In_Use : Boolean := false;
- end Semaphore_Type;
-
- function Has_Access (R : User_Rec_Type) return Boolean;
-
-private
-
- type User_Rec_Type is new Generic_Record_Type with record
- Access_To_Resource : boolean := false;
- end record;
-
-end C940004_1; -- Generic_Semaphore_Pkg
-
---===================================================--
-
-package body C940004_1 is
--- Generic_Semaphore_Pkg
-
- protected body Semaphore_Type is
-
- function TC_Count return Integer is
- begin
- return Request'Count;
- end TC_Count;
-
- entry Request (R : in out User_Rec_Type)
- when not In_Use is
- begin
- In_Use := true;
- R.Access_To_Resource := true;
- end Request;
-
- procedure Release (R : in out User_Rec_Type) is
- begin
- In_Use := false;
- R.Access_To_Resource := false;
- end Release;
-
- end Semaphore_Type;
-
- function Has_Access (R : User_Rec_Type) return Boolean is
- begin
- return R.Access_To_Resource;
- end Has_Access;
-
-end C940004_1; -- Generic_Semaphore_Pkg
-
---=============================================--
-
-with Report;
-with C940004_0; -- Resource_Pkg,
-with C940004_1; -- Generic_Semaphore_Pkg;
-
-package C940004_2 is
--- Printer_Mgr_Pkg
-
- -- Instantiate the generic to get code to manage a single printer;
- -- User processes contend for the printer, asking for it by a call
- -- to Request, and relinquishing it by a call to Release
-
- -- This package extends a tagged type to customize it for the printer
- -- in question, then it uses the type to instantiate the generic and
- -- declare a semaphore specific to the particular resource
-
- package Resource_Pkg renames C940004_0;
-
- type User_Desc_Type is new Resource_Pkg.User_Descriptor_Type with record
- New_Details : Integer := 0; -- for example
- end record;
-
- package Instantiation is new C940004_1 -- Generic_Semaphore_Pkg
- (Generic_Record_Type => User_Desc_Type);
-
- Printer_Access_Mgr : Instantiation.Semaphore_Type;
-
-
-end C940004_2; -- Printer_Mgr_Pkg
-
---============================--
--- no body for C940004_2
---============================--
-
-with C940004_0; -- Resource_Pkg,
-with C940004_2; -- Printer_Mgr_Pkg;
-
-package C940004_3 is
--- User_Task_Pkg
-
--- This package models user tasks that will request and release
--- the printer
- package Resource_Pkg renames C940004_0;
- package Printer_Mgr_Pkg renames C940004_2;
-
- task type User_Task_Type (ID : Resource_Pkg.ID_Type) is
- entry Get_Printer; -- instructs task to request resource
-
- entry Release_Printer -- instructs task to release printer
- (Descriptor : in out Printer_Mgr_pkg.Instantiation.User_Rec_Type);
-
- --==================--
- -- Test management machinery
- --==================--
- entry TC_Get_Descriptor -- returns descriptor
- (Descriptor : out Printer_Mgr_Pkg.Instantiation.User_Rec_Type);
-
- end User_Task_Type;
-
- --==================--
- -- Test management machinery
- --==================--
- TC_Times_Obtained : Integer := 0;
- TC_Times_Released : Integer := 0;
-
-end C940004_3; -- User_Task_Pkg;
-
---==============================================--
-
-with Report;
-with C940004_0; -- Resource_Pkg,
-with C940004_2; -- Printer_Mgr_Pkg,
-
-package body C940004_3 is
--- User_Task_Pkg
-
- task body User_Task_Type is
- D : Printer_Mgr_Pkg.Instantiation.User_Rec_Type;
- begin
- D.Id := ID;
- -----------------------------------
- Main:
- loop
- select
- accept Get_Printer;
- Printer_Mgr_Pkg.Printer_Access_Mgr.Request (D);
- -- request resource; if resource is not available,
- -- task will be queued to wait
- --===================--
- -- Test management machinery
- --===================--
- TC_Times_Obtained := TC_Times_Obtained + 1;
- -- when request granted, note it and post a message
-
- or
- accept Release_Printer (Descriptor : in out
- Printer_Mgr_Pkg.Instantiation.User_Rec_Type) do
-
- Printer_Mgr_Pkg.Printer_Access_Mgr.Release (D);
- -- release the resource, note its release
- TC_Times_Released := TC_Times_Released + 1;
- Descriptor := D;
- end Release_Printer;
- exit Main;
-
- or
- accept TC_Get_Descriptor (Descriptor : out
- Printer_Mgr_Pkg.Instantiation.User_Rec_Type) do
-
- Descriptor := D;
- end TC_Get_Descriptor;
-
- end select;
- end loop main;
-
- exception
- when others => Report.Failed ("exception raised in User_Task");
- end User_Task_Type;
-
-end C940004_3; -- User_Task_Pkg;
-
---==========================================================--
-
-with Report;
-with ImpDef;
-
-with C940004_0; -- Resource_Pkg,
-with C940004_2; -- Printer_Mgr_Pkg,
-with C940004_3; -- User_Task_Pkg;
-
-procedure C940004 is
- Verbose : constant Boolean := False;
- package Resource_Pkg renames C940004_0;
- package Printer_Mgr_Pkg renames C940004_2;
- package User_Task_Pkg renames C940004_3;
-
- Task1 : User_Task_Pkg.User_Task_Type (1);
- Task2 : User_Task_Pkg.User_Task_Type (2);
- Task3 : User_Task_Pkg.User_Task_Type (3);
-
- User_Rec_1,
- User_Rec_2,
- User_Rec_3 : Printer_Mgr_Pkg.Instantiation.User_Rec_Type;
-
-begin
-
- Report.Test ("C940004", "Check that a protected record can be used to " &
- "control access to resources");
-
- if (User_Task_Pkg.TC_Times_Obtained /= 0)
- or (User_Task_Pkg.TC_Times_Released /= 0)
- or Printer_Mgr_Pkg.Instantiation.Has_Access (User_Rec_1)
- or Printer_Mgr_Pkg.Instantiation.Has_Access (User_Rec_2)
- or Printer_Mgr_Pkg.Instantiation.Has_Access (User_Rec_3) then
- Report.Failed ("Wrong initial conditions");
- end if;
-
- Task1.Get_Printer; -- ask for resource
- -- request for resource should be granted
- Task1.TC_Get_Descriptor (User_Rec_1);-- wait here 'til task gets resource
-
- if (User_Task_Pkg.TC_Times_Obtained /= 1)
- or (User_Task_Pkg.TC_Times_Released /= 0)
- or not Printer_Mgr_Pkg.Instantiation.Has_Access (User_Rec_1) then
- Report.Failed ("Resource not assigned to task 1");
- end if;
-
- Task2.Get_Printer; -- ask for resource
- -- request for resource should be denied
- -- and task queued to wait
-
- -- Task 1 still waiting to accept Release_Printer, still holds resource
- -- Task 2 queued on Semaphore.Request
-
- -- Ensure that Task2 is queued before continuing to make checks and queue
- -- Task3. We use a for loop here to avoid hangs in broken implementations.
- for TC_Cnt in 1 .. 20 loop
- exit when Printer_Mgr_Pkg.Printer_Access_Mgr.TC_Count >= 1;
- delay Impdef.Minimum_Task_Switch;
- end loop;
-
- if (User_Task_Pkg.TC_Times_Obtained /= 1)
- or (User_Task_Pkg.TC_Times_Released /= 0) then
- Report.Failed ("Resource assigned to task 2");
- end if;
-
- Task3.Get_Printer; -- ask for resource
- -- request for resource should be denied
- -- and task 3 queued on Semaphore.Request
-
- Task1.Release_Printer (User_Rec_1);-- task 1 releases resource
- -- released resource should be given to
- -- queued task 2.
-
- Task2.TC_Get_Descriptor (User_Rec_2);-- wait here for task 2
-
- -- Task 1 has released resource and completed
- -- Task 2 has seized the resource
- -- Task 3 is queued on Semaphore.Request
-
- if (User_Task_Pkg.TC_Times_Obtained /= 2)
- or (User_Task_Pkg.TC_Times_Released /= 1)
- or Printer_Mgr_Pkg.Instantiation.Has_Access (User_Rec_1)
- or not Printer_Mgr_Pkg.Instantiation.Has_Access (User_Rec_2) then
- Report.Failed ("Resource not properly released/assigned" &
- " to task 2");
- if Verbose then
- Report.Comment ("TC_Times_Obtained: " &
- Integer'Image (User_Task_Pkg.TC_Times_Obtained));
- Report.Comment ("TC_Times_Released: " &
- Integer'Image (User_Task_Pkg.TC_Times_Released));
- Report.Comment ("User 1 Has_Access:" &
- Boolean'Image (Printer_Mgr_Pkg.Instantiation.
- Has_Access (User_Rec_1)));
- Report.Comment ("User 2 Has_Access:" &
- Boolean'Image (Printer_Mgr_Pkg.Instantiation.
- Has_Access (User_Rec_2)));
- end if;
- end if;
-
- Task2.Release_Printer (User_Rec_2);-- task 2 releases resource
-
- -- task 3 is released from queue, and is given resource
-
- Task3.TC_Get_Descriptor (User_Rec_3);-- wait for task 3
-
- if (User_Task_Pkg.TC_Times_Obtained /= 3)
- or (User_Task_Pkg.TC_Times_Released /= 2)
- or Printer_Mgr_Pkg.Instantiation.Has_Access (User_Rec_2)
- or not Printer_Mgr_Pkg.Instantiation.Has_Access (User_Rec_3) then
- Report.Failed ("Resource not properly released/assigned " &
- "to task 3");
- if Verbose then
- Report.Comment ("TC_Times_Obtained: " &
- Integer'Image (User_Task_Pkg.TC_Times_Obtained));
- Report.Comment ("TC_Times_Released: " &
- Integer'Image (User_Task_Pkg.TC_Times_Released));
- Report.Comment ("User 1 Has_Access:" &
- Boolean'Image (Printer_Mgr_Pkg.Instantiation.
- Has_Access (User_Rec_1)));
- Report.Comment ("User 2 Has_Access:" &
- Boolean'Image (Printer_Mgr_Pkg.Instantiation.
- Has_Access (User_Rec_2)));
- Report.Comment ("User 3 Has_Access:" &
- Boolean'Image (Printer_Mgr_Pkg.Instantiation.
- Has_Access (User_Rec_3)));
- end if;
- end if;
-
- Task3.Release_Printer (User_Rec_3);-- task 3 releases resource
-
- if (User_Task_Pkg.TC_Times_Obtained /=3)
- or (User_Task_Pkg.TC_Times_Released /=3)
- or Printer_Mgr_Pkg.Instantiation.Has_Access (User_Rec_3) then
- Report.Failed ("Resource not properly released by task 3");
- if Verbose then
- Report.Comment ("TC_Times_Obtained: " &
- Integer'Image (User_Task_Pkg.TC_Times_Obtained));
- Report.Comment ("TC_Times_Released: " &
- Integer'Image (User_Task_Pkg.TC_Times_Released));
- Report.Comment ("User 1 Has_Access:" &
- Boolean'Image (Printer_Mgr_Pkg.Instantiation.
- Has_Access (User_Rec_1)));
- Report.Comment ("User 2 Has_Access:" &
- Boolean'Image (Printer_Mgr_Pkg.Instantiation.
- Has_Access (User_Rec_2)));
- Report.Comment ("User 3 Has_Access:" &
- Boolean'Image (Printer_Mgr_Pkg.Instantiation.
- Has_Access (User_Rec_3)));
- end if;
-
- end if;
-
- -- Ensure that all tasks have terminated before reporting the result
- while not (Task1'terminated
- and Task2'terminated
- and Task3'terminated) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- Report.Result;
-
-end C940004;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940005.a b/gcc/testsuite/ada/acats/tests/c9/c940005.a
deleted file mode 100644
index adb58b18ca4..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940005.a
+++ /dev/null
@@ -1,370 +0,0 @@
--- C940005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the body of a protected function can have internal calls
--- to other protected functions and that the body of a protected
--- procedure can have internal calls to protected procedures and to
--- protected functions.
---
--- TEST DESCRIPTION:
--- Simulate a meter at a freeway on-ramp which, when real-time sensors
--- determine that the freeway is becoming saturated, triggers stop lights
--- which control the access of vehicles to prevent further saturation.
--- Each on-ramp is represented by a protected object - in this case only
--- one is shown (Test_Ramp). The routines to sample and alter the states
--- of the various sensors, to queue the vehicles on the meter and to
--- release them are all part of the protected object and can be shared
--- by various tasks. Apart from the function/procedure tests this example
--- has a mix of other tasking features.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 13 Nov 95 SAIC Updated and fixed bugs ACVC 2.0.1
---
---!
-
-
-with Report;
-with ImpDef;
-with Ada.Calendar;
-
-procedure C940005 is
-
-begin
-
- Report.Test ("C940005", "Check internal calls of protected functions" &
- " and procedures");
-
- declare -- encapsulate the test
-
- function "+" (Left : Ada.Calendar.Time; Right: Duration)
- return Ada.Calendar.Time renames Ada.Calendar."+";
-
- -- Weighted load given to each potential problem area and accumulated
- type Load_Factor is range 0..8;
- Clear_Level : constant Load_Factor := 0;
- Minimum_Level : constant Load_Factor := 1;
- Moderate_Level : constant Load_Factor := 2;
- Serious_Level : constant Load_Factor := 4;
- Critical_Level : constant Load_Factor := 6;
-
- -- Weighted loads given to each Sample Point (pure weights, not levels)
- Local_Overload_wt : constant Load_Factor := 1;
- Next_Ramp_in_Overload_wt : constant Load_Factor := 1;
- Ramp_Junction_in_Overload_wt : constant Load_Factor :=2; --higher wght
- -- :::: other weighted loads
-
- TC_Multiplier : integer := 1; -- changed half way through
- TC_Expected_Passage_Total : constant integer := 486;
-
- -- This is the time between synchronizing pulses to the ramps.
- -- In reality one would expect a time of 5 to 10 seconds. In
- -- the interests of speeding up the test suite a shorter time
- -- is used
- Pulse_Time_Delta : constant duration := ImpDef.Switch_To_New_Task;
-
- -- control over stopping tasks
- protected Control is
- procedure Stop_Now;
- function Stop return Boolean;
- private
- Halt : Boolean := False;
- end Control;
-
- protected body Control is
- procedure Stop_Now is
- begin
- Halt := True;
- end Stop_Now;
-
- function Stop return Boolean is
- begin
- return Halt;
- end Stop;
- end Control;
-
- task Pulse_Task; -- task to generate a pulse for each ramp
-
- -- Carrier task. One is created for each vehicle arriving at the ramp
- task type Vehicle;
- type acc_Vehicle is access Vehicle;
-
- --================================================================
- protected Test_Ramp is
- function Next_Ramp_in_Overload return Load_Factor;
- function Local_Overload return Load_Factor;
- function Freeway_Overload return Load_Factor;
- function Freeway_Breakdown return Boolean;
- function Meter_in_use_State return Boolean;
- procedure Set_Local_Overload;
- procedure Add_Meter_Queue;
- procedure Subtract_Meter_Queue;
- procedure Time_Pulse_Received;
- entry Wait_at_Meter;
- procedure TC_Passage (Pass_Point : Integer);
- function TC_Get_Passage_Total return integer;
- -- ::::::::: many routines are not shown (for example none of the
- -- clears, none of the real-time-sensor handlers)
-
- private
-
- Release_One_Vehicle : Boolean := false;
- Meter_in_Use : Boolean := false;
- Fwy_Break_State : Boolean := false;
-
-
- Ramp_Count : integer range 0..20 := 0;
- Ramp_Count_Threshold : integer := 15;
-
- -- Current state of the various Sample Points
- Local_State : Load_Factor := Clear_Level;
- Next_Ramp_State : Load_Factor := Clear_Level;
- -- :::: other Sample Point states not shown
-
- TC_Passage_Total : integer := 0;
- end Test_Ramp;
- --================================================================
- protected body Test_Ramp is
-
- procedure Start_Meter is
- begin
- Meter_in_Use := True;
- null; -- stub :::: trigger the metering hardware
- end Start_Meter;
-
- -- External call for Meter_in_Use
- function Meter_in_Use_State return Boolean is
- begin
- return Meter_in_Use;
- end Meter_in_Use_State;
-
- -- Trace the paths through the various routines by totaling the
- -- weighted call parameters
- procedure TC_Passage (Pass_Point : Integer) is
- begin
- TC_Passage_Total := TC_Passage_Total+(Pass_Point*TC_Multiplier);
- end TC_Passage;
-
- -- For the final check of the whole test
- function TC_Get_Passage_Total return integer is
- begin
- return TC_Passage_Total;
- end TC_Get_Passage_Total;
-
- -- These Set/Clear routines are triggered by real-time sensors that
- -- reflect traffic state
- procedure Set_Local_Overload is
- begin
- Local_State := Local_Overload_wt;
- if not Meter_in_Use then
- Start_Meter; -- LOCAL INTERNAL PROCEDURE FROM PROCEDURE
- end if;
- end Set_Local_Overload;
-
- --::::: Set/Clear routines for all the other sensors not shown
-
- function Local_Overload return Load_Factor is
- begin
- return Local_State;
- end Local_Overload;
-
- function Next_Ramp_in_Overload return Load_Factor is
- begin
- return Next_Ramp_State;
- end Next_Ramp_in_Overload;
-
- -- :::::::: other overload factor states not shown
-
- -- return the summation of all the load factors
- function Freeway_Overload return Load_Factor is
- begin
- return Local_Overload -- EACH IS A CALL OF A
- -- + :::: others -- FUNCTION FROM WITHIN
- + Next_Ramp_in_Overload; -- A FUNCTION
- end Freeway_Overload;
-
- -- Freeway Breakdown is defined as traffic moving < 5mph
- function Freeway_Breakdown return Boolean is
- begin
- return Fwy_Break_State;
- end Freeway_Breakdown;
-
- -- Keep count of vehicles currently on meter queue - we can't use
- -- the 'count because we need the outcall trigger
- procedure Add_Meter_Queue is
- TC_Pass_Point : constant integer := 22;
- begin
- Ramp_Count := Ramp_Count + 1;
- TC_Passage ( TC_Pass_Point ); -- note passage through here
- if Ramp_Count > Ramp_Count_Threshold then
- null; -- :::: stub, trigger surface street notification
- end if;
- end Add_Meter_Queue;
- --
- procedure Subtract_Meter_Queue is
- TC_Pass_Point : constant integer := 24;
- begin
- Ramp_Count := Ramp_Count - 1;
- TC_Passage ( TC_Pass_Point ); -- note passage through here
- end Subtract_Meter_Queue;
-
- -- Here each Vehicle task queues itself awaiting release
- entry Wait_at_Meter when Release_One_Vehicle is
- -- EXAMPLE OF ENTRY WITH BARRIERS AND PERSISTENT SIGNAL
- TC_Pass_Point : constant integer := 23;
- begin
- TC_Passage ( TC_Pass_Point ); -- note passage through here
- Release_One_Vehicle := false; -- Consume the signal
- -- Decrement number of vehicles on ramp
- Subtract_Meter_Queue; -- CALL PROCEDURE FROM WITHIN ENTRY BODY
- end Wait_at_Meter;
-
-
- procedure Time_Pulse_Received is
- Load : Load_factor := Freeway_Overload; -- CALL MULTILEVEL
- -- FUNCTION
- -- FROM WITHIN PROCEDURE
- begin
- -- if broken down, no vehicles are released
- if not Freeway_Breakdown then -- CALL FUNCTION FROM A PROCEDURE
- if Load < Moderate_Level then
- Release_One_Vehicle := true;
- end if;
- null; -- stub ::: If other levels, release every other
- -- pulse, every third pulse etc.
- end if;
- end Time_Pulse_Received;
-
- end Test_Ramp;
- --================================================================
-
-
- -- Simulate the arrival of a vehicle at the Ramp_Receiver and the
- -- generation of an accompanying carrier task
- procedure New_Arrival is
- Next_Vehicle_Task: acc_Vehicle := new Vehicle;
- TC_Pass_Point : constant integer := 3;
- begin
- Test_Ramp.TC_Passage ( TC_Pass_Point ); -- Note passage through here
- null;
- end New_arrival;
-
-
- -- Carrier task. One is created for each vehicle arriving at the ramp
- task body Vehicle is
- TC_Pass_point : constant integer := 1;
- TC_Pass_Point_2 : constant integer := 21;
- TC_Pass_Point_3 : constant integer := 2;
- begin
- Test_Ramp.TC_Passage ( TC_Pass_Point ); -- note passage through here
- if Test_Ramp.Meter_in_Use_State then
- Test_Ramp.TC_Passage ( TC_Pass_Point_2 ); -- note passage
- -- Increment count of number of vehicles on ramp
- Test_Ramp.Add_Meter_Queue; -- CALL a protected PROCEDURE
- -- which is also called from within
- -- enter the meter queue
- Test_Ramp.Wait_at_Meter; -- CALL a protected ENTRY
- end if;
- Test_Ramp.TC_Passage ( TC_Pass_Point_3 ); -- note passage thru here
- null; --:::: call to the first in the series of the Ramp_Sensors
- -- this "passes" the vehicle from one sensor to the next
- exception
- when others =>
- Report.Failed ("Unexpected exception in Vehicle Task");
- end Vehicle;
-
-
- -- Task transmits a synchronizing "pulse" to all ramps
- --
- task body Pulse_Task is
- Pulse_Time : Ada.Calendar.Time := Ada.Calendar.Clock;
- begin
- While not Control.Stop loop
- delay until Pulse_Time;
- Test_Ramp.Time_Pulse_Received; -- causes INTERNAL CALLS
- -- :::::::::: and to all the others
- Pulse_Time := Pulse_Time + Pulse_Time_Delta; -- calculate next
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Pulse_Task");
- end Pulse_Task;
-
-
- begin -- declare
-
- -- Test driver. This is ALL test control code
-
- -- First simulate calls to the protected functions and procedures
- -- from without the protected object
- --
- -- CALL FUNCTIONS
- if Test_Ramp.Local_Overload /= Clear_Level then
- Report.Failed ("External Call to Local_Overload incorrect");
- end if;
- if Test_Ramp.Next_Ramp_in_Overload /= Clear_Level then
- Report.Failed ("External Call to Next_Ramp_in_Overload incorrect");
- end if;
- if Test_Ramp.Freeway_Overload /= Clear_Level then
- Report.Failed ("External Call to Freeway_Overload incorrect");
- end if;
-
- -- Now Simulate the arrival of a vehicle to verify path through test
- New_Arrival;
- delay Pulse_Time_Delta*2; -- allow it to pass through the complex
-
- TC_Multiplier := 5; -- change the weights for the paths for the next
- -- part of the test
-
- -- Simulate a real-time sensor reporting overload
- Test_Ramp.Set_Local_Overload; -- CALL A PROCEDURE (and change levels)
-
- -- CALL FUNCTIONS again
- if Test_Ramp.Local_Overload /= Minimum_Level then
- Report.Failed ("External Call to Local_Overload incorrect - 2");
- end if;
- if Test_Ramp.Freeway_Overload /= Minimum_Level then
- Report.Failed ("External Call to Freeway_Overload incorrect -2");
- end if;
-
- -- Now Simulate the arrival of another vehicle again causing
- -- INTERNAL CALLS but following different paths (queuing on the
- -- meter etc.)
- New_Arrival;
- delay Pulse_Time_Delta*2; -- allow it to pass through the complex
-
- Control.Stop_Now; -- finish test
-
- if TC_Expected_Passage_Total /= Test_Ramp.TC_Get_Passage_Total then
- Report.Failed ("Unexpected paths taken");
- end if;
-
- end; -- declare
-
- Report.Result;
-
-end C940005;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940006.a b/gcc/testsuite/ada/acats/tests/c9/c940006.a
deleted file mode 100644
index 36e6c9171a6..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940006.a
+++ /dev/null
@@ -1,223 +0,0 @@
--- C940006.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the body of a protected function can have external calls
--- to other protected functions and that the body of a protected
--- procedure can have external calls to protected procedures and to
--- protected functions.
---
--- TEST DESCRIPTION:
--- Use a subset of the simulation of the freeway on-ramp described in
--- c940005. In this case two protected objects are used but only a
--- minimum of routines are shown in each. Both objects are hard coded
--- and detail two adjacent on-ramps (Ramp_31 & Ramp_32) with routines in
--- each which use external calls to the other.
-
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-
-procedure C940006 is
-
-begin
-
- Report.Test ("C940006", "Check external calls of protected functions" &
- " and procedures");
-
- declare -- encapsulate the test
-
- -- Weighted load given to each potential problem area and accumulated
- type Load_Factor is range 0..8;
- --
- Clear_Level : constant Load_Factor := 0;
- Minimum_Level : constant Load_Factor := 1;
- Moderate_Level : constant Load_Factor := 3;
- Serious_Level : constant Load_Factor := 4;
- Critical_Level : constant Load_Factor := 6;
-
- --================================================================
- -- Only the Routines that are used in this test are shown
- --
- protected Ramp_31 is
-
- function Local_Overload return Load_Factor;
- procedure Set_Local_Overload(Sensor_Level : Load_Factor);
- procedure Notify;
- function Next_Ramp_Overload return Load_Factor;
- function Freeway_Overload return Load_Factor;
- procedure Downstream_Ramps;
- function Get_DSR_Accumulate return Load_Factor;
-
- private
- Next_Ramp_Alert : Boolean := false; -- Next Ramp is in trouble?
-
- -- Current state of the various Sample Points
- Local_State : Load_Factor := Clear_Level;
- -- Accumulated load for next three downstream ramps
- DSR_Accumulate : Load_Factor := Clear_Level;
-
- end Ramp_31;
- --================================================================
- -- Only the Routines that are used in this test are shown
- --
- protected Ramp_32 is
-
- function Local_Overload return Load_Factor;
- procedure Set_Local_Overload (Sensor_Level : Load_Factor);
-
- private
-
- Local_State : Load_Factor := Clear_Level;
-
- end Ramp_32;
- --================================================================
- protected body Ramp_31 is
-
- -- These Set/Clear routines are triggered by real-time sensors that
- -- reflect traffic state
- procedure Set_Local_Overload (Sensor_Level : Load_Factor) is
- begin
- -- Notify "previous" ramp to check this one for current state.
- -- Subsequent changes in state will not send an alert
- null; --::::: (see Ramp_32 for this code)
- Local_State := Sensor_Level;
- null; --::::: Start local meter if not already started
- end Set_Local_Overload;
-
- function Local_Overload return Load_Factor is
- begin
- return Local_State;
- end Local_Overload;
-
- -- This is notification from the next ramp that it is in
- -- overload. With this provision we only need to sample the next
- -- ramp during adverse conditions.
- procedure Notify is
- begin
- Next_Ramp_Alert := true;
- end Notify;
-
- function Next_Ramp_Overload return Load_Factor is
- begin
- if Next_Ramp_Alert then
- -- EXTERNAL FUNCTION CALL FROM FUNCTION
- -- Get next ramp's current state
- return Ramp_32.Local_Overload;
- else
- return Clear_Level;
- end if;
- end Next_Ramp_Overload;
-
- -- return the summation of all the load factors
- function Freeway_Overload return Load_Factor is
- begin
- return Local_Overload
- -- + :::: others
- + Next_Ramp_Overload;
- end Freeway_Overload;
-
- -- Snapshot the states of the next three downstream ramps
- procedure Downstream_Ramps is
- begin
- DSR_Accumulate := Ramp_32.Local_Overload; -- EXTERNAL FUNCTION
- -- :::: + Ramp_33.Local_Overload -- FROM PROCEDURE
- -- :::: + Ramp_34.Local_Overload
- end Downstream_Ramps;
-
- -- Get last snapshot
- function Get_DSR_Accumulate return Load_Factor is
- begin
- return DSR_Accumulate;
- end Get_DSR_Accumulate;
-
- end Ramp_31;
- --================================================================
- protected body Ramp_32 is
-
- function Local_Overload return Load_Factor is
- begin
- return Local_State;
- end;
-
-
- -- These Set/Clear routines are triggered by real-time sensors that
- -- reflect traffic state
- procedure Set_Local_Overload(Sensor_Level : Load_Factor) is
- begin
- if Local_State = Clear_Level then
- -- Notify "previous" ramp to check this one for current state.
- -- Subsequent changes in state will not send an alert
- -- When the situation clears another routine performs the
- -- all_clear notification. (not shown)
- -- EXTERNAL CALL OF PROCEDURE FROM PROCEDURE
- Ramp_31.Notify;
- end if;
- Local_State := Sensor_Level;
- null; --::::: Start local meter if not already started
- end;
-
- end Ramp_32;
- --================================================================
-
-
-
- begin -- declare
-
- -- Test driver. This is ALL test control code
- -- Simulate calls to the protected functions and procedures
- -- from without the protected object, these will, in turn make the
- -- external calls.
-
- -- Check initial conditions, exercising the simple calls
- if not (Ramp_31.Local_Overload = Clear_Level and
- Ramp_31.Next_Ramp_Overload = Clear_Level and
- Ramp_31.Freeway_Overload = Clear_Level) and
- Ramp_32.Local_Overload = Clear_Level then
- Report.Failed ("Initial Calls provided unexpected Results");
- end if;
-
- -- Simulate real-time sensors reporting overloads at a hardware level
- Ramp_31.Set_Local_Overload (1);
- Ramp_32.Set_Local_Overload (3);
-
- Ramp_31.Downstream_Ramps; -- take the current snapshot
-
- if not (Ramp_31.Local_Overload = Minimum_Level and
- Ramp_31.Get_DSR_Accumulate = Moderate_Level and
- Ramp_31.Freeway_Overload = Serious_Level) then
- Report.Failed ("Secondary Calls provided unexpected Results");
- end if;
-
- end; -- declare
-
- Report.Result;
-
-end C940006;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940007.a b/gcc/testsuite/ada/acats/tests/c9/c940007.a
deleted file mode 100644
index c678463633a..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940007.a
+++ /dev/null
@@ -1,427 +0,0 @@
--- C940007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the body of a protected function declared as an object of a
--- given type can have internal calls to other protected functions and
--- that a protected procedure in such an object can have internal calls
--- to protected procedures and to protected functions.
---
--- TEST DESCRIPTION:
--- Simulate a meter at a freeway on-ramp which, when real-time sensors
--- determine that the freeway is becoming saturated, triggers stop lights
--- which control the access of vehicles to prevent further saturation.
--- Each on-ramp is represented by a protected object of the type Ramp.
--- The routines to sample and alter the states of the various sensors, to
--- queue the vehicles on the meter and to release them are all part of
--- the protected object and can be shared by various tasks. Apart from
--- the function/procedure tests this example has a mix of other tasking
--- features. In this test two objects representing two adjacent ramps
--- are created from the same type. The same "traffic" is simulated for
--- each ramp. The results should be identical.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 13 Nov 95 SAIC Replaced shared global variable Pulse_Stop
--- with a protected object.
--- ACVC 2.0.1
---
---!
-
-
-with Report;
-with ImpDef;
-with Ada.Calendar;
-
-
-procedure C940007 is
-
-begin
-
- Report.Test ("C940007", "Check internal calls of protected functions" &
- " and procedures in objects declared as a type");
-
- declare -- encapsulate the test
-
- function "+" (Left : Ada.Calendar.Time; Right: Duration)
- return Ada.Calendar.Time renames Ada.Calendar."+";
-
- -- Weighted load given to each potential problem area and accumulated
- type Load_Factor is range 0..8;
- Clear_Level : constant Load_Factor := 0;
- Minimum_Level : constant Load_Factor := 1;
- Moderate_Level : constant Load_Factor := 2;
- Serious_Level : constant Load_Factor := 4;
- Critical_Level : constant Load_Factor := 6;
-
- -- Weighted loads given to each Sample Point (pure weights, not levels)
- Local_Overload_wt : constant Load_Factor := 1;
- Next_Ramp_in_Overload_wt : constant Load_Factor := 1;
- Ramp_Junction_in_Overload_wt : constant Load_Factor :=2; --higher wght
- -- :::: other weighted loads
-
- TC_Expected_Passage_Total : integer := 486;
-
-
- -- This is the time between synchronizing pulses to the ramps.
- -- In reality one would expect a time of 5 to 10 seconds. In
- -- the interests of speeding up the test suite a shorter time
- -- is used
- Pulse_Time_Delta : constant duration := ImpDef.Switch_To_New_Task;
-
-
- -- control over stopping tasks
- protected Control is
- procedure Stop_Now;
- function Stop return Boolean;
- private
- Halt : Boolean := False;
- end Control;
-
- protected body Control is
- procedure Stop_Now is
- begin
- Halt := True;
- end Stop_Now;
-
- function Stop return Boolean is
- begin
- return Halt;
- end Stop;
- end Control;
-
-
- task Pulse_Task; -- task to generate a pulse for each ramp
-
- -- Carrier tasks. One is created for each vehicle arriving at each ramp
- task type Vehicle_31; -- For Ramp_31
- type acc_Vehicle_31 is access Vehicle_31;
- --
- task type Vehicle_32; -- For Ramp_32
- type acc_Vehicle_32 is access Vehicle_32;
-
- --================================================================
- protected type Ramp is
- function Next_Ramp_in_Overload return Load_Factor;
- function Local_Overload return Load_Factor;
- function Freeway_Overload return Load_Factor;
- function Freeway_Breakdown return Boolean;
- function Meter_in_Use_State return Boolean;
- procedure Set_Local_Overload;
- procedure Add_Meter_Queue;
- procedure Subtract_Meter_Queue;
- procedure Time_Pulse_Received;
- entry Wait_at_Meter;
- procedure TC_Passage (Pass_Point : Integer);
- function TC_Get_Passage_Total return integer;
- -- ::::::::: many routines are not shown (for example none of the
- -- clears, none of the real-time-sensor handlers)
-
- private
-
- Release_One_Vehicle : Boolean := false;
- Meter_in_Use : Boolean := false;
- Fwy_Break_State : Boolean := false;
-
-
- Ramp_Count : integer range 0..20 := 0;
- Ramp_Count_Threshold : integer := 15;
-
- -- Current state of the various Sample Points
- Local_State : Load_Factor := Clear_Level;
- Next_Ramp_State : Load_Factor := Clear_Level;
- -- :::: other Sample Point states not shown
-
- TC_Multiplier : integer := 1; -- changed half way through
- TC_Passage_Total : integer := 0;
- end Ramp;
- --================================================================
- protected body Ramp is
-
- procedure Start_Meter is
- begin
- Meter_in_Use := True;
- null; -- stub :::: trigger the metering hardware
- end Start_Meter;
-
- function Meter_in_Use_State return Boolean is
- begin
- return Meter_in_Use;
- end Meter_in_Use_State;
-
- -- Trace the paths through the various routines by totaling the
- -- weighted call parameters
- procedure TC_Passage (Pass_Point : Integer) is
- begin
- TC_Passage_Total := TC_Passage_Total+(Pass_Point*TC_Multiplier);
- end TC_Passage;
-
- -- For the final check of the whole test
- function TC_Get_Passage_Total return integer is
- begin
- return TC_Passage_Total;
- end TC_Get_Passage_Total;
-
- -- These Set/Clear routines are triggered by real-time sensors that
- -- reflect traffic state
- procedure Set_Local_Overload is
- begin
- Local_State := Local_Overload_wt;
- if not Meter_in_Use then
- Start_Meter; -- LOCAL INTERNAL PROCEDURE FROM PROCEDURE
- end if;
- -- Change the weights for the paths for the next part of the test
- TC_Multiplier :=5;
- end Set_Local_Overload;
-
- --::::: Set/Clear routines for all the other sensors not shown
-
- function Local_Overload return Load_Factor is
- begin
- return Local_State;
- end Local_Overload;
-
- function Next_Ramp_in_Overload return Load_Factor is
- begin
- return Next_Ramp_State;
- end Next_Ramp_in_Overload;
-
- -- :::::::: other overload factor states not shown
-
- -- return the summation of all the load factors
- function Freeway_Overload return Load_Factor is
- begin
- return Local_Overload -- EACH IS A CALL OF A
- -- + :::: others -- FUNCTION FROM WITHIN
- + Next_Ramp_in_Overload; -- A FUNCTION
- end Freeway_Overload;
-
- -- Freeway Breakdown is defined as traffic moving < 5mph
- function Freeway_Breakdown return Boolean is
- begin
- return Fwy_Break_State;
- end Freeway_Breakdown;
-
- -- Keep count of vehicles currently on meter queue - we can't use
- -- the 'count because we need the outcall trigger
- procedure Add_Meter_Queue is
- TC_Pass_Point : constant integer := 22;
- begin
- Ramp_Count := Ramp_Count + 1;
- TC_Passage ( TC_Pass_Point ); -- note passage through here
- if Ramp_Count > Ramp_Count_Threshold then
- null; -- :::: stub, trigger surface street notification
- end if;
- end Add_Meter_Queue;
- --
- procedure Subtract_Meter_Queue is
- TC_Pass_Point : constant integer := 24;
- begin
- Ramp_Count := Ramp_Count - 1;
- TC_Passage ( TC_Pass_Point ); -- note passage through here
- end Subtract_Meter_Queue;
-
- -- Here each Vehicle task queues itself awaiting release
- entry Wait_at_Meter when Release_One_Vehicle is
- -- EXAMPLE OF ENTRY WITH BARRIERS AND PERSISTENT SIGNAL
- TC_Pass_Point : constant integer := 23;
- begin
- TC_Passage ( TC_Pass_Point ); -- note passage through here
- Release_One_Vehicle := false; -- Consume the signal
- -- Decrement number of vehicles on ramp
- Subtract_Meter_Queue; -- CALL PROCEDURE FROM WITHIN ENTRY BODY
- end Wait_at_Meter;
-
-
- procedure Time_Pulse_Received is
- Load : Load_factor := Freeway_Overload; -- CALL MULTILEVEL FUNCTN
- -- FROM WITHIN PROCEDURE
- begin
- -- if broken down, no vehicles are released
- if not Freeway_Breakdown then -- CALL FUNCTION FROM A PROCEDURE
- if Load < Moderate_Level then
- Release_One_Vehicle := true;
- end if;
- null; -- stub ::: If other levels, release every other
- -- pulse, every third pulse etc.
- end if;
- end Time_Pulse_Received;
-
- end Ramp;
- --================================================================
-
- -- Now create two Ramp objects from this type
- Ramp_31 : Ramp;
- Ramp_32 : Ramp;
-
-
-
- -- Simulate the arrival of a vehicle at the Ramp_Receiver of Ramp_31
- -- and the generation of an accompanying carrier task
- procedure New_Arrival_31 is
- Next_Vehicle_Task_31: acc_Vehicle_31 := new Vehicle_31;
- TC_Pass_Point : constant integer := 3;
- begin
- Ramp_31.TC_Passage ( TC_Pass_Point ); -- Note passage through here
- null; --::: stub
- end New_arrival_31;
-
-
- -- Carrier task. One is created for each vehicle arriving at Ramp_31
- task body Vehicle_31 is
- TC_Pass_point : constant integer := 1;
- TC_Pass_Point_2 : constant integer := 21;
- TC_Pass_Point_3 : constant integer := 2;
- begin
- Ramp_31.TC_Passage ( TC_Pass_Point ); -- note passage through here
- if Ramp_31.Meter_in_Use_State then
- Ramp_31.TC_Passage ( TC_Pass_Point_2 ); -- note passage
- -- Increment count of number of vehicles on ramp
- Ramp_31.Add_Meter_Queue; -- CALL a protected PROCEDURE
- -- which is also called from within
- -- enter the meter queue
- Ramp_31.Wait_at_Meter; -- CALL a protected ENTRY
- end if;
- Ramp_31.TC_Passage ( TC_Pass_Point_3 ); -- note passage through here
- null; --:::: call to the first in the series of the Ramp_Sensors
- -- this "passes" the vehicle from one sensor to the next
- exception
- when others =>
- Report.Failed ("Unexpected exception in Vehicle Task");
- end Vehicle_31;
-
-
- -- Simulate the arrival of a vehicle at the Ramp_Receiver and the
- -- generation of an accompanying carrier task
- procedure New_Arrival_32 is
- Next_Vehicle_Task_32 : acc_Vehicle_32 := new Vehicle_32;
- TC_Pass_Point : constant integer := 3;
- begin
- Ramp_32.TC_Passage ( TC_Pass_Point ); -- Note passage through here
- null; --::: stub
- end New_arrival_32;
-
-
- -- Carrier task. One is created for each vehicle arriving at Ramp_32
- task body Vehicle_32 is
- TC_Pass_point : constant integer := 1;
- TC_Pass_Point_2 : constant integer := 21;
- TC_Pass_Point_3 : constant integer := 2;
- begin
- Ramp_32.TC_Passage ( TC_Pass_Point ); -- note passage through here
- if Ramp_32.Meter_in_Use_State then
- Ramp_32.TC_Passage ( TC_Pass_Point_2 ); -- note passage
- -- Increment count of number of vehicles on ramp
- Ramp_32.Add_Meter_Queue; -- CALL a protected PROCEDURE
- -- which is also called from within
- -- enter the meter queue
- Ramp_32.Wait_at_Meter; -- CALL a protected ENTRY
- end if;
- Ramp_32.TC_Passage ( TC_Pass_Point_3 ); -- note passage through here
- null; --:::: call to the first in the series of the Ramp_Sensors
- -- this "passes" the vehicle from one sensor to the next
- exception
- when others =>
- Report.Failed ("Unexpected exception in Vehicle Task");
- end Vehicle_32;
-
-
- -- Task transmits a synchronizing "pulse" to all ramps
- --
- task body Pulse_Task is
- Pulse_Time : Ada.Calendar.Time := Ada.Calendar.Clock;
- begin
- While not Control.Stop loop
- delay until Pulse_Time;
- Ramp_31.Time_Pulse_Received; -- CALL OF PROCEDURE CAUSES
- Ramp_32.Time_Pulse_Received; -- INTERNAL CALLS
- -- :::::::::: and to all the others
- Pulse_Time := Pulse_Time + Pulse_Time_Delta; -- calculate next
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Pulse_Task");
- end Pulse_Task;
-
-
- begin -- declare
-
- -- Test driver. This is ALL test control code
-
- -- First simulate calls to the protected functions and procedures
- -- from without the protected object
- --
- -- CALL FUNCTIONS
- if not ( Ramp_31.Local_Overload = Clear_Level and
- Ramp_31.Next_Ramp_in_Overload = Clear_Level and
- Ramp_31.Freeway_Overload = Clear_Level ) then
- Report.Failed ("Initial Calls to Ramp_31 incorrect");
- end if;
- if not ( Ramp_32.Local_Overload = Clear_Level and
- Ramp_32.Next_Ramp_in_Overload = Clear_Level and
- Ramp_32.Freeway_Overload = Clear_Level ) then
- Report.Failed ("Initial Calls to Ramp_32 incorrect");
- end if;
-
- -- Now Simulate the arrival of a vehicle at each ramp to verify
- -- basic paths through the test
- New_Arrival_31;
- New_Arrival_32;
- delay Pulse_Time_Delta*2; -- allow them to pass through the complex
-
- -- Simulate real-time sensors reporting overload
- Ramp_31.Set_Local_Overload; -- CALL A PROCEDURE (and change levels)
- Ramp_32.Set_Local_Overload; -- CALL A PROCEDURE (and change levels)
-
- -- CALL FUNCTIONS again
- if not ( Ramp_31.Local_Overload = Minimum_Level and
- Ramp_31.Freeway_Overload = Minimum_Level ) then
- Report.Failed ("Secondary Calls to Ramp_31 incorrect");
- end if;
- if not ( Ramp_32.Local_Overload = Minimum_Level and
- Ramp_32.Freeway_Overload = Minimum_Level ) then
- Report.Failed ("Secondary Calls to Ramp_32 incorrect");
- end if;
-
- -- Now Simulate the arrival of another vehicle at each ramp again causing
- -- INTERNAL CALLS but following different paths (queuing on the
- -- meter etc.)
- New_Arrival_31;
- New_Arrival_32;
- delay Pulse_Time_Delta*2; -- allow them to pass through the complex
-
- Control.Stop_Now; -- finish test
-
- if not (TC_Expected_Passage_Total = Ramp_31.TC_Get_Passage_Total and
- TC_Expected_Passage_Total = Ramp_32.TC_Get_Passage_Total) then
- Report.Failed ("Unexpected paths taken");
- end if;
-
- end; -- declare
-
- Report.Result;
-
-end C940007;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940010.a b/gcc/testsuite/ada/acats/tests/c9/c940010.a
deleted file mode 100644
index c4a670552d4..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940010.a
+++ /dev/null
@@ -1,269 +0,0 @@
--- C940010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if an exception is raised during the execution of an
--- entry body it is propagated back to the caller
---
--- TEST DESCRIPTION:
--- Use a small fragment of code from the simulation of a freeway meter
--- used in c940007. Create three individual tasks which will be queued on
--- the entry as the barrier is set. Release them one at a time. A
--- procedure which is called within the entry has been modified for this
--- test to raise a different exception for each pass through. Check that
--- all expected exceptions are raised and propagated.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-with Report;
-with ImpDef;
-
-procedure C940010 is
-
- TC_Failed_1 : Boolean := false;
-
-begin
-
- Report.Test ("C940010", "Check that an exception raised in an entry " &
- "body is propagated back to the caller");
-
- declare -- encapsulate the test
-
- TC_Defined_Error : Exception; -- User defined exception
- TC_Expected_Passage_Total : constant integer := 669;
- TC_Int : constant integer := 5;
-
- -- Carrier tasks. One is created for each vehicle arriving at each ramp
- task type Vehicle_31; -- For Ramp_31
- type acc_Vehicle_31 is access Vehicle_31;
-
-
- --================================================================
- protected Ramp_31 is
-
- function Meter_in_Use_State return Boolean;
- procedure Add_Meter_Queue;
- procedure Subtract_Meter_Queue;
- entry Wait_at_Meter;
- procedure Pulse;
- --
- procedure TC_Passage (Pass_Point : Integer);
- function TC_Get_Passage_Total return integer;
- function TC_Get_Current_Exception return integer;
-
- private
-
- Release_One_Vehicle : Boolean := false;
- Meter_in_Use : Boolean := true; -- TC: set true for this test
- --
- TC_Multiplier : integer := 1;
- TC_Passage_Total : integer := 0;
- -- Use this to cycle through the required exceptions
- TC_Current_Exception : integer range 0..3 := 0;
-
- end Ramp_31;
- --================================================================
- protected body Ramp_31 is
-
-
- -- Trace the paths through the various routines by totaling the
- -- weighted call parameters
- procedure TC_Passage (Pass_Point : Integer) is
- begin
- TC_Passage_Total := TC_Passage_Total+(Pass_Point*TC_Multiplier);
- end TC_Passage;
-
- -- For the final check of the whole test
- function TC_Get_Passage_Total return integer is
- begin
- return TC_Passage_Total;
- end TC_Get_Passage_Total;
-
- function TC_Get_Current_Exception return integer is
- begin
- return TC_Current_Exception;
- end TC_Get_Current_Exception;
-
-
- -----------------
-
- function Meter_in_Use_State return Boolean is
- begin
- return Meter_in_Use;
- end Meter_in_Use_State;
-
- -- Simulate the effects of the regular signal pulse
- procedure Pulse is
- begin
- Release_one_Vehicle := true;
- end Pulse;
-
- -- Keep count of vehicles currently on meter queue - we can't use
- -- the 'count because we need the outcall trigger
- procedure Add_Meter_Queue is
- begin
- null; --::: stub
- end Add_Meter_Queue;
-
- -- TC: This routine has been modified to raise the required
- -- exceptions
- procedure Subtract_Meter_Queue is
- TC_Pass_Point1 : constant integer := 10;
- TC_Pass_Point2 : constant integer := 20;
- TC_Pass_Point3 : constant integer := 30;
- TC_Pass_Point9 : constant integer := 1000; -- error
- begin
- -- Cycle through the required exceptions, one per call
- TC_Current_Exception := TC_Current_Exception + 1;
- case TC_Current_Exception is
- when 1 =>
- TC_Passage (TC_Pass_Point1); -- note passage through here
- raise Storage_Error; -- PREDEFINED EXCEPTION
- when 2 =>
- TC_Passage (TC_Pass_Point2); -- note passage through here
- raise TC_Defined_Error; -- USER DEFINED EXCEPTION
- when 3 =>
- TC_Passage (TC_Pass_Point3); -- note passage through here
- -- RUN TIME EXCEPTION (Constraint_Error)
- -- Add the value 3 to 5 then try to assign it to an object
- -- whose range is 0..3 - this causes the exception.
- -- Disguise the values which cause the Constraint_Error
- -- so that the optimizer will not eliminate this code
- -- Note: the variable is checked at the end to ensure
- -- that the actual assignment is attempted. Also note
- -- the value remains at 3 as the assignment does not
- -- take place. This is the value that is checked at
- -- the end of the test.
- -- Otherwise the optimizer could decide that the result
- -- of the assignment was not used so why bother to do it?
- TC_Current_Exception :=
- Report.Ident_Int (TC_Current_Exception) +
- Report.Ident_Int (TC_Int);
- when others =>
- -- Set flag for Report.Failed which cannot be called from
- -- within a Protected Object
- TC_Failed_1 := True;
- end case;
-
- TC_Passage ( TC_Pass_Point9 ); -- note passage through here
- end Subtract_Meter_Queue;
-
- -- Here each Vehicle task queues itself awaiting release
- entry Wait_at_Meter when Release_One_Vehicle is
- -- Example of entry with barriers and persistent signal
- TC_Pass_Point : constant integer := 2;
- begin
- TC_Passage ( TC_Pass_Point ); -- note passage through here
- Release_One_Vehicle := false; -- Consume the signal
- -- Decrement number of vehicles on ramp
- Subtract_Meter_Queue; -- Call procedure from within entry body
- end Wait_at_Meter;
-
- end Ramp_31;
- --================================================================
-
- -- Carrier task. One is created for each vehicle arriving at Ramp_31
- task body Vehicle_31 is
- TC_Pass_Point_1 : constant integer := 100;
- TC_Pass_Point_2 : constant integer := 200;
- TC_Pass_Point_3 : constant integer := 300;
- begin
- if Ramp_31.Meter_in_Use_State then
- -- Increment count of number of vehicles on ramp
- Ramp_31.Add_Meter_Queue; -- Call a protected procedure
- -- which is also called from within
- -- enter the meter queue
- Ramp_31.Wait_at_Meter; -- Call a protected entry
- Report.Failed ("Exception not propagated back");
- end if;
- null; --:::: call to the first in the series of the Ramp_Sensors
- -- this "passes" the vehicle from one sensor to the next
- exception
- when Storage_Error =>
- Ramp_31.TC_Passage ( TC_Pass_Point_1 ); -- note passage
- when TC_Defined_Error =>
- Ramp_31.TC_Passage ( TC_Pass_Point_2 ); -- note passage
- when Constraint_Error =>
- Ramp_31.TC_Passage ( TC_Pass_Point_3 ); -- note passage
- when others =>
- Report.Failed ("Unexpected exception in Vehicle Task");
- end Vehicle_31;
-
- -- Simulate the arrival of a vehicle at the Ramp_Receiver of Ramp_31
- -- and the generation of an accompanying carrier task
- procedure New_Arrival_31 is
- Next_Vehicle_Task_31: acc_Vehicle_31 := new Vehicle_31;
- TC_Pass_Point : constant integer := 1;
- begin
- Ramp_31.TC_Passage ( TC_Pass_Point ); -- Note passage through here
- null; --::: stub
- end New_arrival_31;
-
-
-
- begin -- declare
-
- -- Test driver. This is ALL test control code
-
- -- Create three independent tasks which will queue themselves on the
- -- entry. Each task will get a different exception
- New_Arrival_31;
- New_Arrival_31;
- New_Arrival_31;
-
- delay ImpDef.Clear_Ready_Queue;
-
- -- Set the barrier condition of the entry true, releasing one task
- Ramp_31.Pulse;
- delay ImpDef.Clear_Ready_Queue;
-
- Ramp_31.Pulse;
- delay ImpDef.Clear_Ready_Queue;
-
- Ramp_31.Pulse;
- delay ImpDef.Clear_Ready_Queue;
-
- if (TC_Expected_Passage_Total /= Ramp_31.TC_Get_Passage_Total) or
- -- Note: We are not really interested in this next check. It is
- -- here to ensure the earlier statements which raised the
- -- Constraint_Error are not optimized out
- (Ramp_31.TC_Get_Current_Exception /= 3) then
- Report.Failed ("Unexpected paths taken");
- end if;
-
- end; -- declare
-
- if TC_Failed_1 then
- Report.Failed ("Bad path through Subtract_Meter_Queue");
- end if;
-
- Report.Result;
-
-end C940010;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940011.a b/gcc/testsuite/ada/acats/tests/c9/c940011.a
deleted file mode 100644
index 65228666cd3..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940011.a
+++ /dev/null
@@ -1,175 +0,0 @@
--- C940011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, in the body of a protected object created by the execution
--- of an allocator, external calls to other protected objects via
--- the access type are correctly performed
---
--- TEST DESCRIPTION:
--- Use a subset of the simulation of the freeway on-ramp described in
--- c940005. In this case an array of access types is built with pointers
--- to successive ramps. The external calls within the protected
--- objects are made via the index into the array. Routines which refer
--- to the "previous" ramp and the "next" ramp are exercised. (Note: The
--- first and last ramps are assumed to be dummies and no first/last
--- condition code is included)
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-with Report;
-
-
-procedure C940011 is
-
- type Ramp;
- type acc_Ramp is access Ramp;
-
- subtype Ramp_Index is integer range 1..4;
-
-
- -- Weighted load given to each potential problem area and accumulated
- type Load_Factor is range 0..8;
- Clear_Level : constant Load_Factor := 0;
- Moderate_Level : constant Load_Factor := 3;
-
- --================================================================
- -- Only the Routines that are used in this test are shown
- --
- protected type Ramp is
-
- procedure Set_Index (Index : Ramp_Index);
- procedure Set_Local_Overload (Sensor_Level : Load_Factor);
- function Local_Overload return Load_Factor;
- procedure Notify;
- function Next_Ramp_Overload return Load_Factor;
-
- private
-
- This_Ramp : Ramp_Index;
-
- Next_Ramp_Alert : Boolean := false; -- Next Ramp is in trouble?
-
- -- Current state of the various Sample Points
- Local_State : Load_Factor := Clear_Level;
-
- end Ramp;
- --================================================================
-
- -- Build a set of Ramp objects and an array of pointers to them
- --
- Ramp_Array : array (Ramp_Index) of acc_Ramp := (Ramp_Index => new Ramp);
-
- --================================================================
- protected body Ramp is
-
- procedure Set_Index (Index : Ramp_Index) is
- begin
- This_Ramp := Index;
- end Set_Index;
-
- -- These Set/Clear routines are triggered by real-time sensors that
- -- reflect traffic state
- procedure Set_Local_Overload(Sensor_Level : Load_Factor) is
- begin
- if Local_State = Clear_Level then
- -- Notify "previous" ramp to check this one for current state.
- -- Subsequent changes in state will not send an alert
- -- When the situation clears another routine performs the
- -- all_clear notification. (not shown)
- -- EXTERNAL CALL OF PROCEDURE FROM PROCEDURE
- Ramp_Array(This_Ramp - 1).Notify; -- index to previous ramp
- end if;
- Local_State := Sensor_Level;
- null; --::::: Start local meter if not already started
- end Set_Local_Overload;
-
- function Local_Overload return Load_Factor is
- begin
- return Local_State;
- end Local_Overload;
-
- -- This is notification from the next ramp that it is in
- -- overload. With this provision we only need to sample the next
- -- ramp during adverse conditions.
- procedure Notify is
- begin
- Next_Ramp_Alert := true;
- end Notify;
-
- function Next_Ramp_Overload return Load_Factor is
- begin
- if Next_Ramp_Alert then
- -- EXTERNAL FUNCTION CALL FROM FUNCTION
- -- Get next ramp's current state
- return Ramp_Array(This_Ramp + 1).Local_Overload;
- else
- return Clear_Level;
- end if;
- end Next_Ramp_Overload;
- end Ramp;
-
- --================================================================
-
-
-begin
-
-
- Report.Test ("C940011", "Protected Objects created by allocators: " &
- "external calls via access types");
-
- -- Initialize each Ramp
- for i in Ramp_Index loop
- Ramp_Array(i).Set_Index (i);
- end loop;
-
- -- Test driver. This is ALL test control code
-
- -- Simulate calls to the protected functions and procedures
- -- external calls. (do not call the "dummy" end ramps)
-
- -- Simple Call
- if Ramp_Array(2).Next_Ramp_Overload /= Clear_level then
- Report.Failed ("Primary call incorrect");
- end if;
-
- -- Call which results in an external procedure call via the array
- -- index from within the protected object
- Ramp_Array(3).Set_Local_Overload (Moderate_Level);
-
- -- Call which results in an external function call via the array
- -- index from within the protected object
- if Ramp_Array(2).Next_Ramp_Overload /= Moderate_level then
- Report.Failed ("Secondary call incorrect");
- end if;
-
- Report.Result;
-
-end C940011;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940012.a b/gcc/testsuite/ada/acats/tests/c9/c940012.a
deleted file mode 100644
index d4bd2079cb2..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940012.a
+++ /dev/null
@@ -1,174 +0,0 @@
--- C940012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a protected object can have discriminants
---
--- TEST DESCRIPTION:
--- Use a subset of the simulation of the freeway on-ramp described in
--- c940005. In this case an array of access types is built with pointers
--- to successive ramps. Each ramp has its Ramp_Number specified by
--- discriminant and this corresponds to the index in the array. The test
--- checks that the ramp numbers are assigned as expected then uses calls
--- to procedures within the objects (ramps) to verify external calls to
--- ensure the structures are valid. The external references within the
--- protected objects are made via the index into the array. Routines
--- which refer to the "previous" ramp and the "next" ramp are exercised.
--- (Note: The first and last ramps are assumed to be dummies and no
--- first/last condition code is included)
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-with Report;
-
-
-procedure C940012 is
-
- type Ramp_Index is range 1..4;
-
- type Ramp;
- type a_Ramp is access Ramp;
-
- Ramp_Array : array (Ramp_Index) of a_Ramp;
-
- -- Weighted load given to each potential problem area and accumulated
- type Load_Factor is range 0..8;
- Clear_Level : constant Load_Factor := 0;
- Moderate_Level : constant Load_Factor := 3;
-
- --================================================================
- -- Only the Routines that are used in this test are shown
- --
- protected type Ramp (Ramp_In : Ramp_Index) is
-
- function Ramp_Number return Ramp_Index;
- function Local_Overload return Load_Factor;
- function Next_Ramp_Overload return Load_Factor;
- procedure Set_Local_Overload(Sensor_Level : Load_Factor);
- procedure Notify;
-
- private
-
- Next_Ramp_Alert : Boolean := false; -- Next Ramp is in trouble?
-
- -- Current state of the various Sample Points
- Local_State : Load_Factor := Clear_Level;
-
- end Ramp;
- --================================================================
- protected body Ramp is
-
- function Ramp_Number return Ramp_Index is
- begin
- return Ramp_In;
- end Ramp_Number;
-
- -- These Set/Clear routines are triggered by real-time sensors that
- -- reflect traffic state
- procedure Set_Local_Overload(Sensor_Level : Load_Factor) is
- begin
- if Local_State = Clear_Level then
- -- Notify "previous" ramp to check this one for current state.
- -- Subsequent changes in state will not send an alert
- -- When the situation clears another routine performs the
- -- all_clear notification. (not shown)
- Ramp_Array(Ramp_In - 1).Notify; -- index to previous ramp
- end if;
- Local_State := Sensor_Level;
- null; --::::: Start local meter if not already started
- end;
-
- function Local_Overload return Load_Factor is
- begin
- return Local_State;
- end Local_Overload;
-
- -- This is notification from the next ramp that it is in
- -- overload. With this provision we only need to sample the next
- -- ramp during adverse conditions.
- procedure Notify is
- begin
- Next_Ramp_Alert := true;
- end Notify;
-
- function Next_Ramp_Overload return Load_Factor is
- begin
- if Next_Ramp_Alert then
- -- Get next ramp's current state
- return Ramp_Array(Ramp_In + 1).Local_Overload;
- else
- return Clear_Level;
- end if;
- end Next_Ramp_Overload;
- end Ramp;
- --================================================================
-
-begin
-
-
- Report.Test ("C940012", "Check that a protected object " &
- "can have discriminants");
-
- -- Build the ramps and populate the ramp array
- for i in Ramp_Index loop
- Ramp_Array(i) := new Ramp (i);
- end loop;
-
- -- Test driver. This is ALL test control code
-
- -- Check the assignment of the index
- for i in Ramp_Index loop
- if Ramp_Array(i).Ramp_Number /= i then
- Report.Failed ("Ramp_Number assignment incorrect");
- end if;
- end loop;
-
- -- Simulate calls to the protected functions and procedures
- -- external calls. (do not call the "dummy" end ramps)
-
- -- Simple Call
- if Ramp_Array(2).Next_Ramp_Overload /= Clear_level then
- Report.Failed ("Primary call incorrect");
- end if;
-
- -- Call which results in an external procedure call via the array
- -- index from within the protected object
- Ramp_Array(3).Set_Local_Overload (Moderate_Level);
-
- -- Call which results in an external function call via the array
- -- index from within the protected object
- if Ramp_Array(2).Next_Ramp_Overload /= Moderate_level then
- Report.Failed ("Secondary call incorrect");
- end if;
-
-
- Report.Result;
-
-end C940012;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940013.a b/gcc/testsuite/ada/acats/tests/c9/c940013.a
deleted file mode 100644
index 58d34bc9697..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940013.a
+++ /dev/null
@@ -1,379 +0,0 @@
--- C940013.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that items queued on a protected entry are handled FIFO and that
--- the 'count attribute of that entry reflects the length of the queue.
---
--- TEST DESCRIPTION:
--- Use a small subset of the freeway ramp simulation shown in other
--- tests. With the timing pulse off (which prevents items from being
--- removed from the queue) queue up a small number of calls. Start the
--- timing pulse and, at the first execution of the entry code, check the
--- 'count attribute. Empty the queue. Pass the items being removed from
--- the queue to the Ramp_Sensor_01 task; there check that the items are
--- arriving in FIFO order. Check the final 'count value
---
--- Send another batch of items at a rate which will, if the delay timing
--- of the implementation is reasonable, cause the queue length to
--- fluctuate in both directions. Again check that all items arrive
--- FIFO. At the end check that the 'count returned to zero reflecting
--- the empty queue.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-with ImpDef;
-with Ada.Calendar;
-
-procedure C940013 is
-
- TC_Failed_1 : Boolean := false;
-
-begin
-
- Report.Test ("C940013", "Check that queues on protected entries are " &
- "handled FIFO and that 'count is correct");
-
- declare -- encapsulate the test
-
- function "+" (Left : Ada.Calendar.Time; Right: Duration)
- return Ada.Calendar.Time renames Ada.Calendar."+";
-
- -- Weighted load given to each potential problem area and accumulated
- type Load_Factor is range 0..8;
- Clear_Level : constant Load_Factor := 0;
- Minimum_Level : constant Load_Factor := 1;
- Moderate_Level : constant Load_Factor := 2;
- Serious_Level : constant Load_Factor := 4;
- Critical_Level : constant Load_Factor := 6;
-
- TC_Expected_Passage_Total : constant integer := 624;
-
- -- For this test give each vehicle an integer ID incremented
- -- by one for each successive vehicle. In reality this would be
- -- a more complex alpha-numeric ID assigned at pickup time.
- type Vehicle_ID is range 1..5000;
- Next_ID : Vehicle_ID := Vehicle_ID'first;
-
- -- In reality this would be about 5 seconds. The default value of
- -- this constant in the implementation defined package is similar
- -- but could, of course be considerably different - it would not
- -- affect the test
- --
- Pulse_Time_Delta : duration := ImpDef.Clear_Ready_Queue;
-
-
- task Pulse_Task; -- task to generate a pulse for each ramp
-
- -- Carrier task. One is created for each vehicle arriving at the ramp
- task type Vehicle is
- entry Get_ID (Input_ID : in Vehicle_ID);
- end Vehicle;
- type acc_Vehicle is access Vehicle;
-
- task Ramp_Sensor_01 is
- entry Accept_Vehicle (Input_ID : in Vehicle_ID);
- entry TC_First_Three_Handled;
- entry TC_All_Done;
- end Ramp_Sensor_01;
-
- protected Pulse_State is
- procedure Start_Pulse;
- procedure Stop_Pulse;
- function Pulsing return Boolean;
- private
- State : Boolean := false; -- start test will pulse off
- end Pulse_State;
-
- protected body Pulse_State is
-
- procedure Start_Pulse is
- begin
- State := true;
- end Start_Pulse;
-
- procedure Stop_Pulse is
- begin
- State := false;
- end Stop_Pulse;
-
- function Pulsing return Boolean is
- begin
- return State;
- end Pulsing;
-
- end Pulse_State;
-
- --================================================================
- protected Test_Ramp is
-
- function Meter_in_use_State return Boolean;
- procedure Time_Pulse_Received;
- entry Wait_at_Meter;
- procedure TC_Passage (Pass_Point : Integer);
- function TC_Get_Passage_Total return integer;
- function TC_Get_Count return integer;
-
- private
-
- Release_One_Vehicle : Boolean := false;
- -- For this test have Meter_in_Use already set
- Meter_in_Use : Boolean := true;
-
- TC_Wait_at_Meter_First : Boolean := true;
- TC_Entry_Queue_Count : integer := 0; -- 'count of Wait_at_Meter
- TC_Passage_Total : integer := 0;
- TC_Pass_Point_WAM : integer := 23;
-
- end Test_Ramp;
- --================================================================
- protected body Test_Ramp is
-
- -- External call for Meter_in_Use
- function Meter_in_Use_State return Boolean is
- begin
- return Meter_in_Use;
- end Meter_in_Use_State;
-
- -- Trace the paths through the various routines by totalling the
- -- weighted call parameters
- procedure TC_Passage (Pass_Point : Integer) is
- begin
- TC_Passage_Total := TC_Passage_Total + Pass_Point;
- end TC_Passage;
-
- -- For the final check of the whole test
- function TC_Get_Passage_Total return integer is
- begin
- return TC_Passage_Total;
- end TC_Get_Passage_Total;
-
- function TC_Get_Count return integer is
- begin
- return TC_Entry_Queue_Count;
- end TC_Get_Count;
-
-
- -- Here each Vehicle task queues itself awaiting release
- --
- entry Wait_at_Meter when Release_One_Vehicle is
- -- EXAMPLE OF ENTRY WITH BARRIERS AND PERSISTENT SIGNAL
- begin
- --
- TC_Passage ( TC_Pass_Point_WAM ); -- note passage
- -- For this test three vehicles are queued before the first
- -- is released. If the queueing mechanism is working correctly
- -- the first time we pass through here the entry'count should
- -- reflect this
- if TC_Wait_at_Meter_First then
- if Wait_at_Meter'count /= 2 then
- TC_Failed_1 := true;
- end if;
- TC_Wait_at_Meter_First := false;
- end if;
- TC_Entry_Queue_Count := Wait_at_Meter'count; -- note for later
-
- Release_One_Vehicle := false; -- Consume the signal
- null; -- stub ::: Decrement count of number of vehicles on ramp
- end Wait_at_Meter;
-
-
- procedure Time_Pulse_Received is
- Load : Load_factor := Minimum_Level; -- for this version of the
- Freeway_Breakdown : Boolean := false; -- test, freeway is Minimum
- begin
- -- if broken down, no vehicles are released
- if not Freeway_Breakdown then
- if Load < Moderate_Level then
- Release_One_Vehicle := true;
- end if;
- null; -- stub ::: If other levels, release every other
- -- pulse, every third pulse etc.
- end if;
- end Time_Pulse_Received;
-
- end Test_Ramp;
- --================================================================
-
- -- Simulate the arrival of a vehicle at the Ramp_Receiver and the
- -- generation of an accompanying carrier task
- procedure New_Arrival is
- Next_Vehicle_Task: acc_Vehicle := new Vehicle;
- TC_Pass_Point : constant integer := 3;
- begin
- Next_ID := Next_ID + 1;
- Next_Vehicle_Task.Get_ID(Next_ID);
- Test_Ramp.TC_Passage ( TC_Pass_Point ); -- Note passage through here
- null;
- end New_arrival;
-
-
- -- Carrier task. One is created for each vehicle arriving at the ramp
- task body Vehicle is
- This_ID : Vehicle_ID;
- TC_Pass_Point_2 : constant integer := 21;
- begin
- accept Get_ID (Input_ID : in Vehicle_ID) do
- This_ID := Input_ID;
- end Get_ID;
-
- if Test_Ramp.Meter_in_Use_State then
- Test_Ramp.TC_Passage ( TC_Pass_Point_2 ); -- note passage
- null; -- stub::: Increment count of number of vehicles on ramp
- Test_Ramp.Wait_at_Meter; -- Queue on the meter entry
- end if;
-
- -- Call to the first in the series of the Ramp_Sensors
- -- this "passes" the vehicle from one sensor to the next
- -- Each sensor will requeue the call to the next thus this
- -- rendezvous will only be completed as the vehicle is released
- -- by the last sensor on the ramp.
- Ramp_Sensor_01.Accept_Vehicle (This_ID);
- exception
- when others =>
- Report.Failed ("Unexpected exception in Vehicle Task");
- end Vehicle;
-
- task body Ramp_Sensor_01 is
- TC_Pass_Point : constant integer := 31;
- This_ID : Vehicle_ID;
- TC_Last_ID : Vehicle_ID := Vehicle_ID'first;
- begin
- loop
- select
- accept Accept_Vehicle (Input_ID : in Vehicle_ID) do
- null; -- stub:::: match up with next Real-Time notification
- -- from the sensor. Requeue to next ramp sensor
- This_ID := Input_ID;
-
- -- The following is all Test_Control code
- Test_Ramp.TC_Passage ( TC_Pass_Point ); -- note passage
- -- The items arrive in the order they are taken from
- -- the Wait_at_Meter entry queue
- if ( This_ID - TC_Last_ID ) /= 1 then
- -- The tasks are being queued (or unqueued) in the
- -- wrong order
- Report.Failed
- ("Queueing on the Wait_at_Meter queue failed");
- end if;
- TC_Last_ID := This_ID; -- for the next check
- if TC_Last_ID = 4 then
- -- rendezvous with the test driver
- accept TC_First_Three_Handled;
- elsif TC_Last_ID = 9 then
- -- rendezvous with the test driver
- accept TC_All_Done;
- end if;
- end Accept_Vehicle;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Ramp_Sensor_01");
- end Ramp_Sensor_01;
-
-
- -- Task transmits a synchronizing "pulse" to all ramps
- --
- task body Pulse_Task is
- Pulse_Time : Ada.Calendar.Time;
- begin
- While not Pulse_State.Pulsing loop
- -- Starts up in the quiescent state
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- Pulse_Time := Ada.Calendar.Clock;
- While Pulse_State.Pulsing loop
- delay until Pulse_Time;
- Test_Ramp. Time_Pulse_Received; -- Transmit pulse to test_ramp
- -- :::::::::: and to all the other ramps
- Pulse_Time := Pulse_Time + Pulse_Time_Delta; -- calculate next
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Pulse_Task");
- end Pulse_Task;
-
-
- begin -- declare
-
- -- Test driver. This is ALL test control code
-
- -- Arrange to queue three vehicles on the Wait_at_Meter queue. The
- -- timing pulse is quiescent so the queue will build
- for i in 1..3 loop
- New_Arrival;
- end loop;
-
- delay Pulse_Time_Delta; -- ensure all is settled
-
- Pulse_State.Start_Pulse; -- Start the timing pulse, the queue will
- -- be serviced
-
- -- wait here until the first three are complete
- Ramp_Sensor_01.TC_First_Three_Handled;
-
- if Test_Ramp.TC_Get_Count /= 0 then
- Report.Failed ("Intermediate Wait_at_Entry'count is incorrect");
- end if;
-
- -- generate new arrivals at a rate that will make the queue increase
- -- and decrease "randomly"
- for i in 1..5 loop
- New_Arrival;
- delay Pulse_Time_Delta/2;
- end loop;
-
- -- wait here till all have been handled
- Ramp_Sensor_01.TC_All_Done;
-
- if Test_Ramp.TC_Get_Count /= 0 then
- Report.Failed ("Final Wait_at_Entry'count is incorrect");
- end if;
-
- Pulse_State.Stop_Pulse; -- finish test
-
-
- if TC_Expected_Passage_Total /= Test_Ramp.TC_Get_Passage_Total then
- Report.Failed ("Unexpected paths taken");
- end if;
-
-
- end; -- declare
-
- if TC_Failed_1 then
- Report.Failed ("Wait_at_Meter'count incorrect");
- end if;
-
- Report.Result;
-
-end C940013;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940014.a b/gcc/testsuite/ada/acats/tests/c9/c940014.a
deleted file mode 100644
index 0eb53ea5127..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940014.a
+++ /dev/null
@@ -1,177 +0,0 @@
--- C940014.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that as part of the finalization of a protected object
--- each call remaining on an entry queue of the objet is removed
--- from its queue and Program_Error is raised at the place of
--- the corresponding entry_call_statement.
---
--- TEST DESCRIPTION:
--- The example in 9.4(20a-20f);6.0 demonstrates how to cause a
--- protected object to finalize while tasks are still waiting
--- on its entry queues. The first part of this test mirrors
--- that example. The second part of the test expands upon
--- the example code to add an object with finalization code
--- to the protected object. The finalization code should be
--- executed after Program_Error is raised in the callers left
--- on the entry queues.
---
---
--- CHANGE HISTORY:
--- 08 Jan 96 SAIC Initial Release for 2.1
--- 10 Jul 96 SAIC Incorporated Reviewer comments to fix race
--- condition.
---
---!
-
-
-with Ada.Finalization;
-package C940014_0 is
- Verbose : constant Boolean := False;
- Finalization_Occurred : Boolean := False;
-
- type Has_Finalization is new Ada.Finalization.Limited_Controlled with
- record
- Placeholder : Integer;
- end record;
- procedure Finalize (Object : in out Has_Finalization);
-end C940014_0;
-
-
-with Report;
-with ImpDef;
-package body C940014_0 is
- procedure Finalize (Object : in out Has_Finalization) is
- begin
- delay ImpDef.Clear_Ready_Queue;
- Finalization_Occurred := True;
- if Verbose then
- Report.Comment ("in Finalize");
- end if;
- end Finalize;
-end C940014_0;
-
-
-
-with Report;
-with ImpDef;
-with Ada.Finalization;
-with C940014_0;
-
-procedure C940014 is
- Verbose : constant Boolean := C940014_0.Verbose;
-
-begin
-
- Report.Test ("C940014", "Check that the finalization of a protected" &
- " object results in program_error being raised" &
- " at the point of the entry call statement for" &
- " any tasks remaining on any entry queue");
-
- First_Check: declare
- -- example from ARM 9.4(20a-f);6.0 with minor mods
- task T is
- entry E;
- end T;
- task body T is
- protected PO is
- entry Ee;
- end PO;
- protected body PO is
- entry Ee when Report.Ident_Bool (False) is
- begin
- null;
- end Ee;
- end PO;
- begin
- accept E do
- requeue PO.Ee;
- end E;
- if Verbose then
- Report.Comment ("task about to terminate");
- end if;
- end T;
- begin -- First_Check
- begin
- T.E;
- delay ImpDef.Clear_Ready_Queue;
- Report.Failed ("exception not raised in First_Check");
- exception
- when Program_Error =>
- if Verbose then
- Report.Comment ("ARM Example passed");
- end if;
- when others =>
- Report.Failed ("wrong exception in First_Check");
- end;
- end First_Check;
-
-
- Second_Check : declare
- -- here we want to check that the raising of Program_Error
- -- occurs before the other finalization actions.
- task T is
- entry E;
- end T;
- task body T is
- protected PO is
- entry Ee;
- private
- Component : C940014_0.Has_Finalization;
- end PO;
- protected body PO is
- entry Ee when Report.Ident_Bool (False) is
- begin
- null;
- end Ee;
- end PO;
- begin
- accept E do
- requeue PO.Ee;
- end E;
- if Verbose then
- Report.Comment ("task about to terminate");
- end if;
- end T;
- begin -- Second_Check
- T.E;
- delay ImpDef.Clear_Ready_Queue;
- Report.Failed ("exception not raised in Second_Check");
- exception
- when Program_Error =>
- if C940014_0.Finalization_Occurred then
- Report.Failed ("wrong order for finalization");
- elsif Verbose then
- Report.Comment ("Second_Check passed");
- end if;
- when others =>
- Report.Failed ("Wrong exception in Second_Check");
- end Second_Check;
-
-
- Report.Result;
-
-end C940014;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940015.a b/gcc/testsuite/ada/acats/tests/c9/c940015.a
deleted file mode 100644
index 92a6699c3d4..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940015.a
+++ /dev/null
@@ -1,149 +0,0 @@
--- C940015.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that the component_declarations of a protected_operation
--- are elaborated in the proper order.
---
--- TEST DESCRIPTION:
--- A discriminated protected object is declared with some
--- components that depend upon the discriminant and some that
--- do not depend upon the discriminant. All the components
--- are initialized with a function call. As a side-effect of
--- the function call the parameter passed to the function is
--- recorded in an elaboration order array.
--- Two objects of the protected type are declared. The
--- elaboration order is recorded and checked against the
--- expected order.
---
---
--- CHANGE HISTORY:
--- 09 Jan 96 SAIC Initial Version for 2.1
--- 09 Jul 96 SAIC Addressed reviewer comments.
--- 13 Feb 97 PWB.CTA Removed doomed attempt to check per-object
--- constraint elaborations.
---!
-
-
-with Report;
-
-procedure C940015 is
- Verbose : constant Boolean := False;
- Do_Display : Boolean := Verbose;
-
- type Index is range 0..10;
-
- type List is array (1..10) of Integer;
- Last : Natural range 0 .. List'Last := 0;
- E_List : List := (others => 0);
-
- function Elaborate (Id : Integer) return Index is
- begin
- Last := Last + 1;
- E_List (Last) := Id;
- if Verbose then
- Report.Comment ("Elaborating" & Integer'Image (Id));
- end if;
- return Index(Id mod 10);
- end Elaborate;
-
- function Elaborate (Id, Per_Obj_Expr : Integer) return Index is
- begin
- return Elaborate (Id);
- end Elaborate;
-
-begin
-
- Report.Test ("C940015", "Check that the component_declarations of a" &
- " protected object are elaborated in the" &
- " proper order");
- declare
- -- an unprotected queue type
- type Storage is array (Index range <>) of Integer;
- type Queue (Size, Flag : Index := 1) is
- record
- Head : Index := 1;
- Tail : Index := 1;
- Count : Index := 0;
- Buffer : Storage (1..Size);
- end record;
-
- -- protected group of queues type
- protected type Prot_Queues (Size : Index := Elaborate (104)) is
- procedure Clear;
- -- other needed procedures not provided at this time
- private
- -- elaborate at type elaboration
- Fixed_Queue_1 : Queue (3,
- Elaborate (105));
- -- elaborate at type elaboration
- Fixed_Queue_2 : Queue (6,
- Elaborate (107));
- end Prot_Queues;
- protected body Prot_Queues is
- procedure Clear is
- begin
- Fixed_Queue_1.Count := 0;
- Fixed_Queue_1.Head := 1;
- Fixed_Queue_1.Tail := 1;
- Fixed_Queue_2.Count := 0;
- Fixed_Queue_2.Head := 1;
- Fixed_Queue_2.Tail := 1;
- end Clear;
- end Prot_Queues;
-
- PO1 : Prot_Queues(9);
- PO2 : Prot_Queues;
-
- Expected_Elab_Order : List := (
- -- from the elaboration of the protected type Prot_Queues
- 105, 107,
- -- from the unconstrained object PO2
- 104,
- others => 0);
- begin
- for I in List'Range loop
- if E_List (I) /= Expected_Elab_Order (I) then
- Report.Failed ("wrong elaboration order");
- Do_Display := True;
- end if;
- end loop;
- if Do_Display then
- Report.Comment ("Expected Actual");
- for I in List'Range loop
- Report.Comment (
- Integer'Image (Expected_Elab_Order(I)) &
- Integer'Image (E_List(I)));
- end loop;
- end if;
-
- -- make use of the protected objects
- PO1.Clear;
- PO2.Clear;
- end;
-
- Report.Result;
-
-end C940015;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940016.a b/gcc/testsuite/ada/acats/tests/c9/c940016.a
deleted file mode 100644
index 2226eefb40d..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940016.a
+++ /dev/null
@@ -1,211 +0,0 @@
--- C940016.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that an Unchecked_Deallocation of a protected object
--- performs the required finalization on the protected object.
---
--- TEST DESCRIPTION:
--- Test that finalization takes place when an Unchecked_Deallocation
--- deallocates a protected object with queued callers.
--- Try protected objects that have no other finalization code and
--- protected objects with user defined finalization.
---
---
--- CHANGE HISTORY:
--- 16 Jan 96 SAIC ACVC 2.1
--- 10 Jul 96 SAIC Fixed race condition noted by reviewers.
---
---!
-
-
-with Ada.Finalization;
-package C940016_0 is
- Verbose : constant Boolean := False;
- Finalization_Occurred : Boolean := False;
-
- type Has_Finalization is new Ada.Finalization.Limited_Controlled with
- record
- Placeholder : Integer;
- end record;
- procedure Finalize (Object : in out Has_Finalization);
-end C940016_0;
-
-
-with Report;
-with ImpDef;
-package body C940016_0 is
- procedure Finalize (Object : in out Has_Finalization) is
- begin
- delay ImpDef.Clear_Ready_Queue;
- Finalization_Occurred := True;
- if Verbose then
- Report.Comment ("in Finalize");
- end if;
- end Finalize;
-end C940016_0;
-
-
-
-with Report;
-with Ada.Finalization;
-with C940016_0;
-with Ada.Unchecked_Deallocation;
-with ImpDef;
-
-procedure C940016 is
- Verbose : constant Boolean := C940016_0.Verbose;
-
-begin
-
- Report.Test ("C940016", "Check that Unchecked_Deallocation of a" &
- " protected object finalizes the" &
- " protected object");
-
- First_Check: declare
- protected type Semaphore is
- entry Wait;
- procedure Signal;
- private
- Count : Integer := 0;
- end Semaphore;
- protected body Semaphore is
- entry Wait when Count > 0 is
- begin
- Count := Count - 1;
- end Wait;
-
- procedure Signal is
- begin
- Count := Count + 1;
- end Signal;
- end Semaphore;
-
- type pSem is access Semaphore;
- procedure Zap_Semaphore is new
- Ada.Unchecked_Deallocation (Semaphore, pSem);
- Sem_Ptr : pSem := new Semaphore;
-
- -- positive confirmation that Blocker got the exception
- Ok : Boolean := False;
-
- task Blocker;
-
- task body Blocker is
- begin
- Sem_Ptr.Wait;
- Report.Failed ("Program_Error not raised in waiting task");
- exception
- when Program_Error =>
- Ok := True;
- if Verbose then
- Report.Comment ("Blocker received Program_Error");
- end if;
- when others =>
- Report.Failed ("Wrong exception in Blocker");
- end Blocker;
-
- begin -- First_Check
- -- wait for Blocker to get blocked on the semaphore
- delay ImpDef.Clear_Ready_Queue;
- Zap_Semaphore (Sem_Ptr);
- -- make sure Blocker has time to complete
- delay ImpDef.Clear_Ready_Queue * 2;
- if not Ok then
- Report.Failed ("finalization not properly performed");
- -- Blocker is probably hung so kill it
- abort Blocker;
- end if;
- end First_Check;
-
-
- Second_Check : declare
- -- here we want to check that the raising of Program_Error
- -- occurs before the other finalization actions.
- protected type Semaphore is
- entry Wait;
- procedure Signal;
- private
- Count : Integer := 0;
- Component : C940016_0.Has_Finalization;
- end Semaphore;
- protected body Semaphore is
- entry Wait when Count > 0 is
- begin
- Count := Count - 1;
- end Wait;
-
- procedure Signal is
- begin
- Count := Count + 1;
- end Signal;
- end Semaphore;
-
- type pSem is access Semaphore;
- procedure Zap_Semaphore is new
- Ada.Unchecked_Deallocation (Semaphore, pSem);
- Sem_Ptr : pSem := new Semaphore;
-
- -- positive confirmation that Blocker got the exception
- Ok : Boolean := False;
-
- task Blocker;
-
- task body Blocker is
- begin
- Sem_Ptr.Wait;
- Report.Failed ("Program_Error not raised in waiting task 2");
- exception
- when Program_Error =>
- Ok := True;
- if C940016_0.Finalization_Occurred then
- Report.Failed ("wrong order for finalization 2");
- elsif Verbose then
- Report.Comment ("Blocker received Program_Error 2");
- end if;
- when others =>
- Report.Failed ("Wrong exception in Blocker 2");
- end Blocker;
-
- begin -- Second_Check
- -- wait for Blocker to get blocked on the semaphore
- delay ImpDef.Clear_Ready_Queue;
- Zap_Semaphore (Sem_Ptr);
- -- make sure Blocker has time to complete
- delay ImpDef.Clear_Ready_Queue * 2;
- if not Ok then
- Report.Failed ("finalization not properly performed 2");
- -- Blocker is probably hung so kill it
- abort Blocker;
- end if;
- if not C940016_0.Finalization_Occurred then
- Report.Failed ("user defined finalization didn't happen");
- end if;
- end Second_Check;
-
-
- Report.Result;
-
-end C940016;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c940a03.a b/gcc/testsuite/ada/acats/tests/c9/c940a03.a
deleted file mode 100644
index 22876d26b18..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c940a03.a
+++ /dev/null
@@ -1,350 +0,0 @@
--- C940A03.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a protected object provides coordinated access to
--- shared data. Check that it can implement a semaphore-like construct
--- controlling access to shared data through procedure parameters to
--- allow a specific maximum number of tasks to run and exclude all
--- others.
---
--- TEST DESCRIPTION:
--- Declare a resource descriptor tagged type. Extend the type and
--- use the extended type in a protected data structure.
--- Implement a counting semaphore type that can be initialized to a
--- specific number of available resources. Declare an entry for
--- requesting a specific resource and an procedure for releasing the
--- same resource it. Declare an object of this (protected) type,
--- initialized to two resources. Declare and start three tasks each
--- of which asks for a resource. Verify that only two resources are
--- granted and that the last task in is queued.
---
--- This test models a multi-user operating system that allows a limited
--- number of logins. Users requesting login are modeled by tasks.
---
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- F940A00
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 13 Nov 95 SAIC Fixed bugs for ACVC 2.0.1
---
---!
-
-package C940A03_0 is
- --Resource_Pkg
-
- -- General type declarations that will be extended to model available
- -- logins
-
- type Resource_ID_Type is range 0..10;
- type Resource_Type is tagged record
- Id : Resource_ID_Type := 0;
- end record;
-
-end C940A03_0;
- --Resource_Pkg
-
---======================================--
--- no body for C940A3_0
---======================================--
-
-with F940A00; -- Interlock_Foundation
-with C940A03_0; -- Resource_Pkg;
-
-package C940A03_1 is
- -- Semaphores
-
- -- Models a counting semaphore that will allow up to a specific
- -- number of logins
- -- Users (tasks) request a login slot by calling the Request_Login
- -- entry and logout by calling the Release_Login procedure
-
- Max_Logins : constant Integer := 2;
-
-
- type Key_Type is range 0..100;
- -- When a user requests a login, an
- -- identifying key will be returned
- Init_Key : constant Key_Type := 0;
-
- type Login_Record_Type is new C940A03_0.Resource_Type with record
- Key : Key_Type := Init_Key;
- end record;
-
-
- protected type Login_Semaphore_Type (Resources_Available : Integer :=1) is
-
- entry Request_Login (Resource_Key : in out Login_Record_Type);
- procedure Release_Login;
- function Available return Integer; -- how many logins are available?
- private
- Logins_Avail : Integer := Resources_Available;
- Next_Key : Key_Type := Init_Key;
-
- end Login_Semaphore_Type;
-
- Login_Semaphore : Login_Semaphore_Type (Max_Logins);
-
- --====== machinery for the test, not the model =====--
- TC_Control_Message : F940A00.Interlock_Type;
- function TC_Key_Val (Login_Rec : Login_Record_Type) return Integer;
-
-
-end C940A03_1;
- -- Semaphores;
-
---=========================================================--
-
-package body C940A03_1 is
- -- Semaphores is
-
- protected body Login_Semaphore_Type is
-
- entry Request_Login (Resource_Key : in out Login_Record_Type)
- when Logins_Avail > 0 is
- begin
- Next_Key := Next_Key + 1; -- login process returns a key
- Resource_Key.Key := Next_Key; -- to the requesting user
- Logins_Avail := Logins_Avail - 1;
- end Request_Login;
-
- procedure Release_Login is
- begin
- Logins_Avail := Logins_Avail + 1;
- end Release_Login;
-
- function Available return Integer is
- begin
- return Logins_Avail;
- end Available;
-
- end Login_Semaphore_Type;
-
- function TC_Key_Val (Login_Rec : Login_Record_Type) return Integer is
- begin
- return Integer (Login_Rec.Key);
- end TC_Key_Val;
-
-end C940A03_1;
- -- Semaphores;
-
---=========================================================--
-
-with C940A03_0; -- Resource_Pkg,
-with C940A03_1; -- Semaphores;
-
-package C940A03_2 is
- -- Task_Pkg
-
- package Semaphores renames C940A03_1;
-
- task type User_Task_Type is
-
- entry Login (user_id : C940A03_0.Resource_Id_Type);
- -- instructs the task to ask for a login
- entry Logout; -- instructs the task to release the login
- --=======================--
- -- this entry is used to get information to verify test operation
- entry Get_Status (User_Record : out Semaphores.Login_Record_Type);
-
- end User_Task_Type;
-
-end C940A03_2;
- -- Task_Pkg
-
---=========================================================--
-
-with Report;
-with C940A03_0; -- Resource_Pkg,
-with C940A03_1; -- Semaphores,
-with F940A00; -- Interlock_Foundation;
-
-package body C940A03_2 is
- -- Task_Pkg
-
- -- This task models a user requesting a login from the system
- -- For control of this test, we can ask the task to login, logout, or
- -- give us the current user record (containing login information)
-
- task body User_Task_Type is
- Rec : Semaphores.Login_Record_Type;
- begin
- loop
- select
- accept Login (user_id : C940A03_0.Resource_Id_Type) do
- Rec.Id := user_id;
- end Login;
-
- Semaphores.Login_Semaphore.Request_Login (Rec);
- -- request a resource; if resource is not available,
- -- task will be queued to wait
-
- --== following is test control machinery ==--
- F940A00.Counter.Increment;
- Semaphores.TC_Control_Message.Post;
- -- after resource is obtained, post message
-
- or
- accept Logout do
- Semaphores.Login_Semaphore.Release_Login;
- -- release the resource
- --== test control machinery ==--
- F940A00.Counter.Decrement;
- end Logout;
- exit;
-
- or
- accept Get_Status (User_Record : out Semaphores.Login_Record_Type) do
- User_Record := Rec;
- end Get_Status;
-
- end select;
- end loop;
-
- exception
- when others => Report.Failed ("Exception raised in model user task");
- end User_Task_Type;
-
-end C940A03_2;
- -- Task_Pkg
-
---=========================================================--
-
-with Report;
-with ImpDef;
-with C940A03_1; -- Semaphores,
-with C940A03_2; -- Task_Pkg,
-with F940A00; -- Interlock_Foundation;
-
-procedure C940A03 is
-
- package Semaphores renames C940A03_1;
- package Users renames C940A03_2;
-
- Task1, Task2, Task3 : Users.User_Task_Type;
- User_Rec : Semaphores.Login_Record_Type;
-
-begin -- Tasks start here
-
- Report.Test ("C940A03", "Check that a protected object can coordinate " &
- "shared data access using procedure parameters");
-
- if F940A00.Counter.Number /=0 then
- Report.Failed ("Wrong initial conditions");
- end if;
-
- Task1.Login (1); -- request resource; request should be granted
- Semaphores.TC_Control_Message.Consume;
- -- ensure that task obtains resource by
- -- waiting for task to post message
-
- -- Task 1 waiting for call to Logout
- -- Others still available
- Task1.Get_Status (User_Rec);
- if (F940A00.Counter.Number /= 1)
- or (Semaphores.Login_Semaphore.Available /=1)
- or (Semaphores.TC_Key_Val (User_Rec) /= 1) then
- Report.Failed ("Resource not assigned to task 1");
- end if;
-
- Task2.Login (2); -- Request for resource should be granted
- Semaphores.TC_Control_Message.Consume;
- -- ensure that task obtains resource by
- -- waiting for task to post message
-
- Task2.Get_Status (User_Rec);
- if (F940A00.Counter.Number /= 2)
- or (Semaphores.Login_Semaphore.Available /=0)
- or (Semaphores.TC_Key_Val (User_Rec) /= 2) then
- Report.Failed ("Resource not assigned to task 2");
- end if;
-
-
- Task3.Login (3); -- request for resource should be denied
- -- and task queued
-
-
- -- Tasks 1 and 2 holds resources
- -- and are waiting for a call to Logout
- -- Task 3 is queued
-
- if (F940A00.Counter.Number /= 2)
- or (Semaphores.Login_Semaphore.Available /=0) then
- Report.Failed ("Resource incorrectly assigned to task 3");
- end if;
-
- Task1.Logout; -- released resource should be given to
- -- queued task
- Semaphores.TC_Control_Message.Consume;
- -- wait for confirming message from task
-
- -- Task 1 holds no resources
- -- and is terminated (or will soon)
- -- Tasks 2 and 3 hold resources
- -- and are waiting for a call to Logout
-
- Task3.Get_Status (User_Rec);
- if (F940A00.Counter.Number /= 2)
- or (Semaphores.Login_Semaphore.Available /=0)
- or (Semaphores.TC_Key_Val (User_Rec) /= 3) then
- Report.Failed ("Resource not properly released/assigned to task 3");
- end if;
-
- Task2.Logout; -- no outstanding request for released
- -- resource
- -- Tasks 1 and 2 hold no resources
- -- Task 3 holds a resource
- -- and is waiting for a call to Logout
-
- if (F940A00.Counter.Number /= 1)
- or (Semaphores.Login_Semaphore.Available /=1) then
- Report.Failed ("Resource not properly released from task 2");
- end if;
-
- Task3.Logout;
-
- -- all resources have been returned
- -- all tasks have terminated or will soon
-
- if (F940A00.Counter.Number /=0)
- or (Semaphores.Login_Semaphore.Available /=2) then
- Report.Failed ("Resource not properly released from task 3");
- end if;
-
- -- Ensure all tasks have terminated before calling Result
- while not (Task1'terminated and
- Task2'terminated and
- Task3'terminated) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- Report.Result;
-
-end C940A03;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c951001.a b/gcc/testsuite/ada/acats/tests/c9/c951001.a
deleted file mode 100644
index c1cf96593b2..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c951001.a
+++ /dev/null
@@ -1,192 +0,0 @@
--- C951001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that two procedures in a protected object will not be
--- executed concurrently.
---
--- TEST DESCRIPTION:
--- A very simple example of two tasks calling two procedures in the same
--- protected object is used. Test control code has been added to the
--- procedures such that, whichever gets called first executes a lengthy
--- calculation giving sufficient time (on a multiprocessor or a
--- time-slicing machine) for the other task to get control and call the
--- other procedure. The control code verifies that entry to the second
--- routine is postponed until the first is complete.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C951001 is
-
- protected Ramp_31 is
-
- procedure Add_Meter_Queue;
- procedure Subtract_Meter_Queue;
- function TC_Failed return Boolean;
-
- private
-
- Ramp_Count : integer range 0..20 := 4; -- Start test with some
- -- vehicles on the ramp
-
- TC_Add_Started : Boolean := false;
- TC_Subtract_Started : Boolean := false;
- TC_Add_Finished : Boolean := false;
- TC_Subtract_Finished : Boolean := false;
- TC_Concurrent_Running: Boolean := false;
-
- end Ramp_31;
-
-
- protected body Ramp_31 is
-
- function TC_Failed return Boolean is
- begin
- -- this indicator will have been set true if any instance
- -- of concurrent running has been proved
- return TC_Concurrent_Running;
- end TC_Failed;
-
-
- procedure Add_Meter_Queue is
- begin
- --==================================================
- -- This section is all Test_Control code
- TC_Add_Started := true;
- if TC_Subtract_Started then
- if not TC_Subtract_Finished then
- TC_Concurrent_Running := true;
- end if;
- else
- -- Subtract has not started.
- -- Execute a lengthy routine to give it a chance to do so
- ImpDef.Exceed_Time_Slice;
-
- if TC_Subtract_Started then
- -- Subtract was able to start so we have concurrent
- -- running and the test has failed
- TC_Concurrent_Running := true;
- end if;
- end if;
- TC_Add_Finished := true;
- --==================================================
- Ramp_Count := Ramp_Count + 1;
- end Add_Meter_Queue;
-
- procedure Subtract_Meter_Queue is
- begin
- --==================================================
- -- This section is all Test_Control code
- TC_Subtract_Started := true;
- if TC_Add_Started then
- if not TC_Add_Finished then
- -- We already have concurrent running
- TC_Concurrent_Running := true;
- end if;
- else
- -- Add has not started.
- -- Execute a lengthy routine to give it a chance to do so
- ImpDef.Exceed_Time_Slice;
-
- if TC_Add_Started then
- -- Add was able to start so we have concurrent
- -- running and the test has failed
- TC_Concurrent_Running := true;
- end if;
- end if;
- TC_Subtract_Finished := true;
- --==================================================
- Ramp_Count := Ramp_Count - 1;
- end Subtract_Meter_Queue;
-
- end Ramp_31;
-
-begin
-
- Report.Test ("C951001", "Check that two procedures in a protected" &
- " object will not be executed concurrently");
-
- declare -- encapsulate the test
-
- task Vehicle_1;
- task Vehicle_2;
-
-
- -- Vehicle_1 and Vehicle_2 are simulations of Instances of the task
- -- of type Vehicle in different stages of execution
-
- task body Vehicle_1 is
- begin
- null; -- ::::: stub. preparation code
-
- -- Add to the count of vehicles on the queue
- Ramp_31.Add_Meter_Queue;
-
- null; -- ::::: stub: wait at the meter then pass to first sensor
-
- -- Reduce the count of vehicles on the queue
- null; -- ::::: stub: Ramp_31.Subtract_Meter_Queue
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Vehicle_1 task");
- end Vehicle_1;
-
-
- task body Vehicle_2 is
- begin
- null; -- ::::: stub. preparation code
-
- -- Add to the count of vehicles on the queue
- null; -- ::::: stub Ramp_31.Add_Meter_Queue;
-
- null; -- ::::: stub: wait at the meter then pass to first sensor
-
- -- Reduce the count of vehicles on the queue
- Ramp_31.Subtract_Meter_Queue;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Vehicle_2 task");
- end Vehicle_2;
-
-
-
- begin
- null;
- end; -- encapsulation
-
- if Ramp_31.TC_Failed then
- Report.Failed ("Concurrent Running detected");
- end if;
-
- Report.Result;
-
-end C951001;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c951002.a b/gcc/testsuite/ada/acats/tests/c9/c951002.a
deleted file mode 100644
index 8ccb2d012fe..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c951002.a
+++ /dev/null
@@ -1,334 +0,0 @@
--- C951002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an entry and a procedure within the same protected object
--- will not be executed simultaneously.
---
--- TEST DESCRIPTION:
--- Two tasks are used. The first calls an entry who's barrier is set
--- and is thus queued. The second calls a procedure in the same
--- protected object. This procedure clears the entry barrier of the
--- first then executes a lengthy compute bound procedure. This is
--- intended to allow a multiprocessor, or a time-slicing implementation
--- of a uniprocessor, to (erroneously) permit the first task to continue
--- while the second is still computing. Flags in each process in the
--- PO are checked to ensure that they do not run out of sequence or in
--- parallel.
--- In the second part of the test another entry and procedure are used
--- but in this case the procedure is started first. A different task
--- calls the entry AFTER the procedure has started. If the entry
--- completes before the procedure the test fails.
---
--- This test will not be effective on a uniprocessor without time-slicing
--- It is designed to increase the chances of failure on a multiprocessor,
--- or a uniprocessor with time-slicing, if the entry and procedure in a
--- Protected Object are not forced to acquire a single execution
--- resource. It is not guaranteed to fail.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C951002 is
-
- -- These global error flags are used for failure conditions within
- -- the protected object. We cannot call Report.Failed (thus Text_io)
- -- which would result in a bounded error.
- --
- TC_Error_01 : Boolean := false;
- TC_Error_02 : Boolean := false;
- TC_Error_03 : Boolean := false;
- TC_Error_04 : Boolean := false;
- TC_Error_05 : Boolean := false;
- TC_Error_06 : Boolean := false;
-
-begin
-
- Report.Test ("C951002", "Check that a procedure and an entry body " &
- "in a protected object will not run concurrently");
-
- declare -- encapsulate the test
-
- task Credit_Message is
- entry TC_Start;
- end Credit_Message;
-
- task Credit_Task is
- entry TC_Start;
- end Credit_Task;
-
- task Debit_Message is
- entry TC_Start;
- end Debit_Message;
-
- task Debit_Task is
- entry TC_Start;
- end Debit_Task;
-
- --====================================
-
- protected Hold is
-
- entry Wait_for_CR_Underload;
- procedure Clear_CR_Overload;
- entry Wait_for_DB_Underload;
- procedure Set_DB_Overload;
- procedure Clear_DB_Overload;
- --
- function TC_Message_is_Queued return Boolean;
-
- private
- Credit_Overloaded : Boolean := true; -- Test starts in overload
- Debit_Overloaded : Boolean := false;
- --
- TC_CR_Proc_Finished : Boolean := false;
- TC_CR_Entry_Finished : Boolean := false;
- TC_DB_Proc_Finished : Boolean := false;
- TC_DB_Entry_Finished : Boolean := false;
- end Hold;
- --====================
- protected body Hold is
-
- entry Wait_for_CR_Underload when not Credit_Overloaded is
- begin
- -- The barrier must only be re-evaluated at the end of the
- -- of the execution of the procedure, also while the procedure
- -- is executing this entry body must not be executed
- if not TC_CR_Proc_Finished then
- TC_Error_01 := true; -- Set error indicator
- end if;
- TC_CR_Entry_Finished := true;
- end Wait_for_CR_Underload ;
-
- -- This is the procedure which should NOT be able to run in
- -- parallel with the entry body
- --
- procedure Clear_CR_Overload is
- begin
-
- -- The entry body must not be executed until this procedure
- -- is completed.
- if TC_CR_Entry_Finished then
- TC_Error_02 := true; -- Set error indicator
- end if;
- Credit_Overloaded := false; -- clear the entry barrier
-
- -- Execute an implementation defined compute bound routine which
- -- is designed to run long enough to allow a task switch on a
- -- time-sliced uniprocessor, or for a multiprocessor to pick up
- -- another task.
- --
- ImpDef.Exceed_Time_Slice;
-
- -- Again, the entry body must not be executed until the current
- -- procedure is completed.
- --
- if TC_CR_Entry_Finished then
- TC_Error_03 := true; -- Set error indicator
- end if;
- TC_CR_Proc_Finished := true;
-
- end Clear_CR_Overload;
-
- --============
- -- The following subprogram and entry body are used in the second
- -- part of the test
-
- entry Wait_for_DB_Underload when not Debit_Overloaded is
- begin
- -- By the time the task that calls this entry is allowed access to
- -- the queue the barrier, which starts off as open, will be closed
- -- by the Set_DB_Overload procedure. It is only reopened
- -- at the end of the test
- if not TC_DB_Proc_Finished then
- TC_Error_04 := true; -- Set error indicator
- end if;
- TC_DB_Entry_Finished := true;
- end Wait_for_DB_Underload ;
-
-
- procedure Set_DB_Overload is
- begin
- -- The task timing is such that this procedure should be started
- -- before the entry is called. Thus the entry should be blocked
- -- until the end of this procedure which then sets the barrier
- --
- if TC_DB_Entry_Finished then
- TC_Error_05 := true; -- Set error indicator
- end if;
-
- -- Execute an implementation defined compute bound routine which
- -- is designed to run long enough to allow a task switch on a
- -- time-sliced uniprocessor, or for a multiprocessor to pick up
- -- another task
- --
- ImpDef.Exceed_Time_Slice;
-
- Debit_Overloaded := true; -- set the entry barrier
-
- if TC_DB_Entry_Finished then
- TC_Error_06 := true; -- Set error indicator
- end if;
- TC_DB_Proc_Finished := true;
-
- end Set_DB_Overload;
-
- procedure Clear_DB_Overload is
- begin
- Debit_Overloaded := false; -- open the entry barrier
- end Clear_DB_Overload;
-
- function TC_Message_is_Queued return Boolean is
- begin
-
- -- returns true when one message arrives on the queue
- return (Wait_for_CR_Underload'Count = 1);
-
- end TC_Message_is_Queued ;
-
- end Hold;
-
- --====================================
-
- task body Credit_Message is
- begin
- accept TC_Start;
- --:: some application processing. Part of the process finds that
- -- the Overload threshold has been exceeded for the Credit
- -- application. This message task queues itself on a queue
- -- waiting till the overload in no longer in effect
- Hold.Wait_for_CR_Underload;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Credit_Message Task");
- end Credit_Message;
-
- task body Credit_Task is
- begin
- accept TC_Start;
- -- Application code here (not shown) determines that the
- -- underload threshold has been reached
- Hold.Clear_CR_Overload;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Credit_Task");
- end Credit_Task;
-
- --==============
-
- -- The following two tasks are used in the second part of the test
-
- task body Debit_Message is
- begin
- accept TC_Start;
- --:: some application processing. Part of the process finds that
- -- the Overload threshold has been exceeded for the Debit
- -- application. This message task queues itself on a queue
- -- waiting till the overload is no longer in effect
- --
- Hold.Wait_for_DB_Underload;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Debit_Message Task");
- end Debit_Message;
-
- task body Debit_Task is
- begin
- accept TC_Start;
- -- Application code here (not shown) determines that the
- -- underload threshold has been reached
- Hold.Set_DB_Overload;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Debit_Task");
- end Debit_Task;
-
- begin -- declare
-
- Credit_Message.TC_Start;
-
- -- Wait until the message is queued on the entry before starting
- -- the Credit_Task
- while not Hold.TC_Message_is_Queued loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- --
- Credit_Task.TC_Start;
-
- -- Ensure the first part of the test is complete before continuing
- while not (Credit_Message'terminated and Credit_Task'terminated) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- --======================================================
- -- Second part of the test
-
-
- Debit_Task.TC_Start;
-
- -- Delay long enough to allow a task switch to the Debit_Task and
- -- for it to reach the accept statement and call Hold.Set_DB_Overload
- -- before starting Debit_Message
- --
- delay ImpDef.Switch_To_New_Task;
-
- Debit_Message.TC_Start;
-
- while not Debit_Task'terminated loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- Hold.Clear_DB_Overload; -- Allow completion
-
- end; -- declare (encapsulation)
-
- if TC_Error_01 then
- Report.Failed ("Wait_for_CR_Underload executed out of sequence");
- end if;
- if TC_Error_02 then
- Report.Failed ("Credit: Entry executed before procedure");
- end if;
- if TC_Error_03 then
- Report.Failed ("Credit: Entry executed in parallel");
- end if;
- if TC_Error_04 then
- Report.Failed ("Wait_for_DB_Underload executed out of sequence");
- end if;
- if TC_Error_05 then
- Report.Failed ("Debit: Entry executed before procedure");
- end if;
- if TC_Error_06 then
- Report.Failed ("Debit: Entry executed in parallel");
- end if;
-
- Report.Result;
-
-end C951002;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c953001.a b/gcc/testsuite/ada/acats/tests/c9/c953001.a
deleted file mode 100644
index bc9c85f302f..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c953001.a
+++ /dev/null
@@ -1,188 +0,0 @@
--- C953001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the evaluation of an entry_barrier condition
--- propagates an exception, the exception Program_Error
--- is propagated to all current callers of all entries of the
--- protected object.
---
--- TEST DESCRIPTION:
--- This test declares a protected object (PO) with two entries and
--- a 5 element entry family.
--- All the entries are always closed. However, one of the entries
--- (Oh_No) will get a constraint_error in its barrier_evaluation
--- whenever the global variable Blow_Up is true.
--- An array of tasks is created where the tasks wait on the various
--- entries of the protected object. Once all the tasks are waiting
--- the main procedure calls the entry Oh_No and causes an exception
--- to be propagated to all the tasks. The tasks record the fact
--- that they got the correct exception in global variables that
--- can be checked after the tasks complete.
---
---
--- CHANGE HISTORY:
--- 19 OCT 95 SAIC ACVC 2.1
---
---!
-
-
-with Report;
-with ImpDef;
-procedure C953001 is
- Verbose : constant Boolean := False;
- Max_Tasks : constant := 12;
-
- -- note status and error conditions
- Blocked_Entry_Taken : Boolean := False;
- In_Oh_No : Boolean := False;
- Task_Passed : array (1..Max_Tasks) of Boolean := (1..Max_Tasks => False);
-
-begin
- Report.Test ("C953001",
- "Check that an exception in an entry_barrier condition" &
- " causes Program_Error to be propagated to all current" &
- " callers of all entries of the protected object");
-
- declare -- test encapsulation
- -- miscellaneous values
- Cows : Integer := Report.Ident_Int (1);
- Came_Home : Integer := Report.Ident_Int (2);
-
- -- make the Barrier_Condition fail only when we want it to
- Blow_Up : Boolean := False;
-
- function Barrier_Condition return Boolean is
- begin
- if Blow_Up then
- return 5 mod Report.Ident_Int(0) = 1;
- else
- return False;
- end if;
- end Barrier_Condition;
-
- subtype Family_Index is Integer range 1..5;
-
- protected PO is
- entry Block1;
- entry Oh_No;
- entry Family (Family_Index);
- end PO;
-
- protected body PO is
- entry Block1 when Report.Ident_Int(0) = Report.Ident_Int(1) is
- begin
- Blocked_Entry_Taken := True;
- end Block1;
-
- -- barrier will get a Constraint_Error (divide by 0)
- entry Oh_No when Barrier_Condition is
- begin
- In_Oh_No := True;
- end Oh_No;
-
- entry Family (for Member in Family_Index) when Cows = Came_Home is
- begin
- Blocked_Entry_Taken := True;
- end Family;
- end PO;
-
-
- task type Waiter is
- entry Take_Id (Id : Integer);
- end Waiter;
-
- Bunch_of_Waiters : array (1..Max_Tasks) of Waiter;
-
- task body Waiter is
- Me : Integer;
- Action : Integer;
- begin
- accept Take_Id (Id : Integer) do
- Me := Id;
- end Take_Id;
-
- Action := Me mod (Family_Index'Last + 1);
- begin
- if Action = 0 then
- PO.Block1;
- else
- PO.Family (Action);
- end if;
- Report.Failed ("no exception for task" & Integer'Image (Me));
- exception
- when Program_Error =>
- Task_Passed (Me) := True;
- if Verbose then
- Report.Comment ("pass for task" & Integer'Image (Me));
- end if;
- when others =>
- Report.Failed ("wrong exception raised in task" &
- Integer'Image (Me));
- end;
- end Waiter;
-
-
- begin -- test encapsulation
- for I in 1..Max_Tasks loop
- Bunch_Of_Waiters(I).Take_Id (I);
- end loop;
-
- -- give all the Waiters time to get queued
- delay 2*ImpDef.Clear_Ready_Queue;
-
- -- cause the protected object to fail
- begin
- Blow_Up := True;
- PO.Oh_No;
- Report.Failed ("no exception in call to PO.Oh_No");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error instead of Program_Error");
- when Program_Error =>
- if Verbose then
- Report.Comment ("main exception passed");
- end if;
- when others =>
- Report.Failed ("wrong exception in main");
- end;
- end; -- test encapsulation
-
- -- all the tasks have now completed.
- -- check the flags for pass/fail info
- if Blocked_Entry_Taken then
- Report.Failed ("blocked entry taken");
- end if;
- if In_Oh_No then
- Report.Failed ("entry taken with exception in barrier");
- end if;
- for I in 1..Max_Tasks loop
- if not Task_Passed (I) then
- Report.Failed ("task" & Integer'Image (I) & " did not pass");
- end if;
- end loop;
-
- Report.Result;
-end C953001;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c953002.a b/gcc/testsuite/ada/acats/tests/c9/c953002.a
deleted file mode 100644
index d821bb24e4e..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c953002.a
+++ /dev/null
@@ -1,242 +0,0 @@
--- C953002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the servicing of entry queues of a protected object
--- continues until there are no open entries with queued calls
--- and that this takes place as part of a single protected
--- operation.
---
--- TEST DESCRIPTION:
--- This test enqueues a bunch of tasks on the entries of the
--- protected object Main_PO. At the same time another bunch of
--- of tasks are queued on the single entry of protected object
--- Holding_Pen.
--- Once all the tasks have had time to block, the main procedure
--- opens all the entries for Main_PO by calling the
--- Start_Protected_Operation protected procedure. This should
--- process all the pending callers as part of a single protected
--- operation.
--- During this protected operation, the entries of Main_PO release
--- the tasks blocked on Holding_Pen by calling the protected
--- procedure Release.
--- Once released from Holding_Pen, the task immediately calls
--- an entry in Main_PO.
--- These new calls should not gain access to Main_PO until
--- the initial protected operation on that object completes.
--- The order in which the entry calls on Main_PO are taken is
--- recorded in a global array and checked after all the tasks
--- have terminated.
---
---
--- CHANGE HISTORY:
--- 25 OCT 95 SAIC ACVC 2.1
--- 15 JAN 95 SAIC Fixed deadlock problem.
---
---!
-
-with Report;
-procedure C953002 is
- Verbose : constant Boolean := False;
-
- Half_Tasks : constant := 15; -- how many tasks of each group
- Max_Tasks : constant := Half_Tasks * 2; -- total number of tasks
-
- Note_Order : array (1..Max_Tasks) of Integer := (1..Max_Tasks => 0);
- Note_Cnt : Integer := 0;
-begin
- Report.Test ("C953002",
- "Check that the servicing of entry queues handles all" &
- " open entries as part of a single protected operation");
- declare
- task type Assault_PO is
- entry Take_ID (Id : Integer);
- end Assault_PO;
-
- First_Wave : array (1 .. Half_Tasks) of Assault_PO;
- Second_Wave : array (1 .. Half_Tasks) of Assault_PO;
-
- protected Main_PO is
- entry E0 (Who : Integer);
- entry E1 (Who : Integer);
- entry E2 (Who : Integer);
- entry E3 (Who : Integer);
- entry All_Present;
- procedure Start_Protected_Operation;
- private
- Open : Boolean := False;
- end Main_PO;
-
- protected Holding_Pen is
- -- Note that Release is called by tasks executing in
- -- the protected object Main_PO.
- entry Wait (Who : Integer);
- entry All_Present;
- procedure Release;
- private
- Open : Boolean := False;
- end Holding_Pen;
-
-
- protected body Main_PO is
- procedure Start_Protected_Operation is
- begin
- Open := True;
- -- at this point all the First_Wave tasks are
- -- waiting at the entries and all of them should
- -- be processed as part of the protected operation.
- end Start_Protected_Operation;
-
- entry All_Present when E0'Count + E1'Count + E2'Count + E3'Count =
- Max_Tasks / 2 is
- begin
- null; -- all tasks are waiting
- end All_Present;
-
- entry E0 (Who : Integer) when Open is
- begin
- Holding_Pen.Release;
- -- note the order in which entry calls are handled.
- Note_Cnt := Note_Cnt + 1;
- Note_Order (Note_Cnt) := Who;
- end E0;
-
- entry E1 (Who : Integer) when Open is
- begin
- Holding_Pen.Release;
- Note_Cnt := Note_Cnt + 1;
- Note_Order (Note_Cnt) := Who;
- end E1;
-
- entry E2 (Who : Integer) when Open is
- begin
- Holding_Pen.Release;
- Note_Cnt := Note_Cnt + 1;
- Note_Order (Note_Cnt) := Who;
- end E2;
-
- entry E3 (Who : Integer) when Open is
- begin
- Holding_Pen.Release;
- Note_Cnt := Note_Cnt + 1;
- Note_Order (Note_Cnt) := Who;
- end E3;
- end Main_PO;
-
-
- protected body Holding_Pen is
- procedure Release is
- begin
- Open := True;
- end Release;
-
- entry All_Present when Wait'Count = Max_Tasks / 2 is
- begin
- null; -- all tasks waiting
- end All_Present;
-
- entry Wait (Who : Integer) when Open is
- begin
- null; -- unblock the task
- end Wait;
- end Holding_Pen;
-
- task body Assault_PO is
- Me : Integer;
- begin
- accept Take_Id (Id : Integer) do
- Me := Id;
- end Take_Id;
- if Me >= 200 then
- Holding_Pen.Wait (Me);
- end if;
- case Me mod 4 is
- when 0 => Main_PO.E0 (Me);
- when 1 => Main_PO.E1 (Me);
- when 2 => Main_PO.E2 (Me);
- when 3 => Main_PO.E3 (Me);
- when others => null; -- cant happen
- end case;
- if Verbose then
- Report.Comment ("task" & Integer'Image (Me) &
- " done");
- end if;
- exception
- when others =>
- Report.Failed ("exception in task");
- end Assault_PO;
-
- begin -- test encapsulation
- for I in First_Wave'Range loop
- First_Wave (I).Take_ID (100 + I);
- end loop;
- for I in Second_Wave'Range loop
- Second_Wave (I).Take_ID (200 + I);
- end loop;
-
- -- let all the tasks get blocked
- Main_PO.All_Present;
- Holding_Pen.All_Present;
-
- -- let the games begin
- if Verbose then
- Report.Comment ("starting protected operation");
- end if;
- Main_PO.Start_Protected_Operation;
-
- -- wait for all the tasks to complete
- if Verbose then
- Report.Comment ("waiting for tasks to complete");
- end if;
- end;
-
- -- make sure all tasks registered their order
- if Note_Cnt /= Max_Tasks then
- Report.Failed ("task registration count wrong. " &
- Integer'Image (Note_Cnt));
- end if;
-
- -- check the order in which entries were handled.
- -- all the 100 level items should be handled as part of the
- -- first protected operation and thus should be completed
- -- before any 200 level item.
-
- if Verbose then
- for I in 1..Max_Tasks loop
- Report.Comment ("order" & Integer'Image (I) & " is" &
- Integer'Image (Note_Order (I)));
- end loop;
- end if;
- for I in 2 .. Max_Tasks loop
- if Note_Order (I) < 200 and
- Note_Order (I-1) >= 200 then
- Report.Failed ("protected operation failure" &
- Integer'Image (Note_Order (I-1)) &
- Integer'Image (Note_Order (I)));
- end if;
- end loop;
-
- Report.Result;
-end C953002;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c953003.a b/gcc/testsuite/ada/acats/tests/c9/c953003.a
deleted file mode 100644
index 4ac91169e21..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c953003.a
+++ /dev/null
@@ -1,189 +0,0 @@
--- C953003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the servicing of entry queues of a protected object
--- continues until there are no open entries with queued (or
--- requeued) calls and that internal requeues are handled
--- as part of a single protected operation.
---
--- TEST DESCRIPTION:
--- A number of tasks are created and blocked on a protected object
--- so that they can all be released at one time. When released,
--- these tasks make an entry call to an entry in the Main_PO
--- protected object. As part of the servicing of this entry
--- call the call is passed through the remaining entries of the
--- protected object by using internal requeues. The protected
--- object checks that no other entry call is accepted until
--- after all the internal requeuing has completed.
---
---
--- CHANGE HISTORY:
--- 12 JAN 96 SAIC Initial version for 2.1
---
---!
-
-with Report;
-procedure C953003 is
- Verbose : constant Boolean := False;
-
- Order_Error : Boolean := False;
-
- Max_Tasks : constant := 10; -- total number of tasks
- Max_Entries : constant := 4; -- number of entries in Main_PO
- Note_Cnt : Integer := 0;
- Note_Order : array (1..Max_Tasks*Max_Entries) of Integer;
-begin
- Report.Test ("C953003",
- "Check that the servicing of entry queues handles all" &
- " open entries as part of a single protected operation," &
- " including those resulting from an internal requeue");
- declare
- task type Assault_PO is
- entry Take_ID (Id : Integer);
- end Assault_PO;
-
- Marines : array (1 .. Max_Tasks) of Assault_PO;
-
- protected Main_PO is
- entry E0 (Who : Integer);
- private
- entry E3 (Who : Integer);
- entry E2 (Who : Integer);
- entry E1 (Who : Integer);
- Expected_Next : Integer := 0;
- end Main_PO;
-
-
- protected body Main_PO is
-
- entry E0 (Who : Integer) when True is
- begin
- Order_Error := Order_Error or Expected_Next /= 0;
- Expected_Next := 1;
- Note_Cnt := Note_Cnt + 1;
- Note_Order (Note_Cnt) := Who;
- requeue E1;
- end E0;
-
- entry E1 (Who : Integer) when True is
- begin
- Order_Error := Order_Error or Expected_Next /= 1;
- Expected_Next := 2;
- Note_Cnt := Note_Cnt + 1;
- Note_Order (Note_Cnt) := Who;
- requeue E2;
- end E1;
-
- entry E3 (Who : Integer) when True is
- begin
- Order_Error := Order_Error or Expected_Next /= 3;
- Expected_Next := 0;
- Note_Cnt := Note_Cnt + 1;
- Note_Order (Note_Cnt) := Who;
- -- all done - return now
- end E3;
-
- entry E2 (Who : Integer) when True is
- begin
- Order_Error := Order_Error or Expected_Next /= 2;
- Expected_Next := 3;
- Note_Cnt := Note_Cnt + 1;
- Note_Order (Note_Cnt) := Who;
- requeue E3;
- end E2;
- end Main_PO;
-
- protected Holding_Pen is
- entry Wait_For_All_Present;
- entry Wait;
- private
- Open : Boolean := False;
- end Holding_Pen;
-
- protected body Holding_Pen is
- entry Wait_For_All_Present when Wait'Count = Max_Tasks is
- begin
- Open := True;
- end Wait_For_All_Present;
-
- entry Wait when Open is
- begin
- null; -- just go
- end Wait;
- end Holding_Pen;
-
-
- task body Assault_PO is
- Me : Integer;
- begin
- accept Take_Id (Id : Integer) do
- Me := Id;
- end Take_Id;
- Holding_Pen.Wait;
- Main_PO.E0 (Me);
- if Verbose then
- Report.Comment ("task" & Integer'Image (Me) &
- " done");
- end if;
- exception
- when others =>
- Report.Failed ("exception in task");
- end Assault_PO;
-
- begin -- test encapsulation
- for I in Marines'Range loop
- Marines (I).Take_ID (100 + I);
- end loop;
-
- -- let all the tasks get blocked so we can release them all
- -- at one time
- Holding_Pen.Wait_For_All_Present;
-
- -- wait for all the tasks to complete
- if Verbose then
- Report.Comment ("waiting for tasks to complete");
- end if;
- end;
-
- -- make sure all tasks registered their order
- if Note_Cnt /= Max_Tasks * Max_Entries then
- Report.Failed ("task registration count wrong. " &
- Integer'Image (Note_Cnt));
- end if;
-
- if Order_Error then
- Report.Failed ("internal requeue not handled as part of operation");
- end if;
-
- if Verbose or Order_Error then
- for I in 1..Max_Tasks * Max_Entries loop
- Report.Comment ("order" & Integer'Image (I) & " is" &
- Integer'Image (Note_Order (I)));
- end loop;
- end if;
-
- Report.Result;
-end C953003;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954001.a b/gcc/testsuite/ada/acats/tests/c9/c954001.a
deleted file mode 100644
index 3112cce2b5c..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954001.a
+++ /dev/null
@@ -1,273 +0,0 @@
--- C954001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a requeue statement within an entry_body with parameters
--- may requeue the entry call to a protected entry with a subtype-
--- conformant parameter profile. Check that, if the call is queued on the
--- new entry's queue, the original caller remains blocked after the
--- requeue, but the entry_body containing the requeue is completed.
---
--- TEST DESCRIPTION:
--- Declare a protected object which simulates a disk device. Declare an
--- entry that requeues the caller to a second entry if the disk head is
--- not in the proper location, but first sets the second entry's barrier
--- to false. Declare a procedure which sets the second entry's barrier
--- to true.
---
--- Declare a task which calls the first entry such that the requeue is
--- called. This task should be queued on the second entry and remain
--- blocked, and the first entry should be complete. Call the procedure
--- which releases the second entry's queue. The second entry should
--- complete, after which the task should complete.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C954001_0 is -- Disk management abstraction.
-
-
- -- Simulate a read-only disk device with a head that may be moved to
- -- different tracks. If a read request is issued for the current
- -- track, the request can be satisfied immediately. Otherwise, the head
- -- must be moved to the correct track, during which time the calling task
- -- is blocked. When the head reaches the correct track, the disk generates
- -- an interrupt, after which the request can be satisfied, and the
- -- calling task can proceed.
-
- Buffer_Size : constant := 100;
-
- type Disk_Buffer is new String (1 .. Buffer_Size);
- type Disk_Track is new Natural;
-
- type Disk_Address is record
- Track : Disk_Track;
- -- Additional components.
- end record;
-
- Initial_Track : constant Disk_Track := 0;
- New_Track : constant Disk_Track := 5;
-
- --==============================================--
-
- protected Disk_Device is
-
- entry Read (Where : Disk_Address; -- Read data from disk
- Data : out Disk_Buffer); -- track.
-
- procedure Disk_Interrupt; -- Handle interrupt
- -- from disk.
-
- function TC_Track return Disk_Track; -- Return current track.
-
- function TC_Pending_Queued return Boolean; -- True when there is
- -- an entry in queue
-
- private
-
- entry Pending_Read (Where : Disk_Address; -- Wait for head to
- Data : out Disk_Buffer); -- move then read data.
-
- Current_Track : Disk_Track := Initial_Track; -- Current disk track.
- Operation_Pending : Boolean := False; -- Vis. entry barrier.
- Disk_Interrupted : Boolean := False; -- Priv. entry barrier.
-
- end Disk_Device;
-
-
-end C954001_0;
-
-
- --==================================================================--
-
-
-package body C954001_0 is -- Disk management abstraction.
-
-
- protected body Disk_Device is
-
- entry Read (Where : Disk_Address; Data : out Disk_Buffer)
- when not Operation_Pending is
- begin
- if (Where.Track = Current_Track) then -- If the head is over the
- -- Read data from disk... -- requested track, read
- null; -- the data.
-
- else -- Otherwise, defer read
- Operation_Pending := True; -- while head is moved to
- -- correct track (signaled
- -- -- -- by a disk interrupt).
- -- Requeue is tested here --
- -- --
-
- requeue Pending_Read;
-
- end if;
- end Read;
-
-
- procedure Disk_Interrupt is -- Called when the disk
- begin -- interrupts, indicating
- Disk_Interrupted := True; -- that the head is over
- end Disk_Interrupt; -- the correct track.
-
-
- function TC_Track return Disk_Track is -- Artifice required for
- begin -- testing purposes.
- return (Current_Track);
- end TC_Track;
-
-
- entry Pending_Read (Where : Disk_Address; Data : out Disk_Buffer)
- when Disk_Interrupted is
- begin
- Current_Track := Where.Track; -- Head is now over the
- -- Read data from disk... -- correct track; read
- Operation_Pending := False; -- the data.
- Disk_Interrupted := False;
- end Pending_Read;
-
- function TC_Pending_Queued return Boolean is
- begin
- -- Return true when there is something on the Pending_Read queue
- return (Pending_Read'Count /=0);
- end TC_Pending_Queued;
-
- end Disk_Device;
-
-
-end C954001_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-with C954001_0; -- Disk management abstraction.
-use C954001_0;
-
-procedure C954001 is
-
-
- task type Read_Task is -- an unusual (but legal) declaration
- end Read_Task;
- --
- --
- task body Read_Task is
- Location : constant Disk_Address := (Track => New_Track);
- Data : Disk_Buffer := (others => ' ');
- begin
- Disk_Device.Read (Location, Data); -- Invoke requeue statement.
- exception
- when others =>
- Report.Failed ("Exception raised in task");
- end Read_Task;
-
- --==============================================--
-
-begin -- Main program.
-
- Report.Test ("C954001", "Requeue from an entry within a P.O. " &
- "to a private entry within the same P.O.");
-
-
- declare
-
- IO_Request : Read_Task; -- Request a read from other
- -- than the current track.
- -- IO_Request will be requeued
- -- from Read to Pending_Read.
- begin
-
- -- To pass this test, the following must be true:
- --
- -- (A) The Read entry call made by the task IO_Request must be
- -- completed by the requeue.
- -- (B) IO_Request must remain blocked following the requeue.
- -- (C) IO_Request must be queued on the Pending_Read entry queue.
- -- (D) IO_Request must continue execution after the Pending_Read
- -- entry completes.
- --
- -- First, verify (A): that the Read entry call is complete.
- --
- -- Call a protected operation (Disk_Device.TC_Track). Since no two
- -- protected actions may proceed concurrently unless both are protected
- -- function calls, a call to a protected operation at this point can
- -- proceed only if the Read entry call is already complete.
- --
- -- Note that if Read is NOT complete, the test will likely hang here.
- --
- -- Next, verify (B): that IO_Request remains blocked following the
- -- requeue. Also verify that Pending_Read (the entry to which
- -- IO_Request should have been queued) has not yet executed.
-
- -- Wait until the task had made the call and the requeue has been
- -- effected.
- while not Disk_Device.TC_Pending_Queued loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- if Disk_Device.TC_Track /= Initial_Track then
- Report.Failed ("Target entry of requeue executed prematurely");
- elsif IO_Request'Terminated then
- Report.Failed ("Caller did not remain blocked after " &
- "the requeue or was never requeued");
- else
-
- -- Verify (C): that IO_Request is queued on the
- -- Pending_Read entry queue.
- --
- -- Set the barrier for Pending_Read to true. Check that the
- -- current track is updated and that IO_Request terminates.
-
- Disk_Device.Disk_Interrupt; -- Simulate a disk interrupt,
- -- signaling that the head is
- -- over the correct track.
-
- -- The Pending_Read entry body will complete before the next
- -- protected action is called (Disk_Device.TC_Track).
-
- if Disk_Device.TC_Track /= New_Track then
- Report.Failed ("Caller was not requeued on target entry");
- end if;
-
- -- Finally, verify (D): that Read_Task continues after Pending_Read
- -- completes.
- --
- -- Note that the test will hang here if Read_Task does not continue
- -- executing following the completion of the requeued entry call.
-
- end if;
-
- end; -- We will not exit the declare block until the task completes
-
- Report.Result;
-
-end C954001;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954010.a b/gcc/testsuite/ada/acats/tests/c9/c954010.a
deleted file mode 100644
index ac39c89a838..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954010.a
+++ /dev/null
@@ -1,286 +0,0 @@
--- C954010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a requeue within an accept statement does not block.
--- This test uses: Requeue to an entry in a different task
--- Parameterless call
--- Requeue with abort
---
--- TEST DESCRIPTION:
--- In the Distributor task, requeue two successive calls on the entries
--- of two separate target tasks. Verify that the target tasks are
--- run in parallel proving that the first requeue does not block
--- while the first target rendezvous takes place.
---
--- This series of tests uses a simulation of a transaction driven
--- processing system. Line Drivers accept input from an external source
--- and build them into transaction records. These records are then
--- encapsulated in message tasks which remain extant for the life of the
--- transaction in the system. The message tasks put themselves on the
--- input queue of a Distributor which, from information in the
--- transaction and/or system load conditions forwards them to other
--- operating tasks. These in turn might forward the transactions to yet
--- other tasks for further action. The routing is, in real life,
--- dynamic and unpredictable at the time of message generation. All
--- rerouting in this model is done by means of requeues.
---
--- This test is directed towards the BLOCKING of the REQUEUE only
--- If the original caller does not block, the outcome of the test will
--- not be affected. If the original caller does not continue after
--- the return, the test will not pass.
--- If the requeue gets placed on the wrong entry a failing test could
--- pass (eg. if the first message is delivered to the second
--- computation task and the second message to the first) - a check for
--- this condition is made in other tests
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C954010 is
-
- -- Mechanism to count the number of Message tasks completed
- protected TC_Tasks_Completed is
- procedure Increment;
- function Count return integer;
- private
- Number_Complete : integer := 0;
- end TC_Tasks_Completed;
- --
- TC_Expected_To_Complete : constant integer := 2;
-
-
- task type Message_Task;
- type acc_Message_Task is access Message_Task;
-
- task Line_Driver is
- entry Start;
- end Line_Driver;
-
- task Distributor is
- entry Input;
- end Distributor;
-
- task Credit_Computation is
- entry Input;
- end Credit_Computation;
-
- task Debit_Computation is
- entry Input;
- entry TC_Artificial_Rendezvous_1; -- test purposes only
- entry TC_Artificial_Rendezvous_2; -- test purposes only
- end Debit_Computation;
-
-
- -- Mechanism to count the number of Message tasks completed
- protected body TC_Tasks_Completed is
- procedure Increment is
- begin
- Number_Complete := Number_Complete + 1;
- end Increment;
-
- function Count return integer is
- begin
- return Number_Complete;
- end Count;
- end TC_Tasks_Completed;
-
-
-
- -- Assemble messages received from an external source
- -- Creates a message task for each and sends this to a Distributor
- -- for appropriate disposal around the network of tasks
- -- Such a task would normally be designed to loop continuously
- -- creating the messages as input is received. Simulate this
- -- but limit it to two dummy messages for this test and allow it
- -- to terminate at that point
- --
- task body Line_Driver is
-
- begin
-
- accept Start; -- Wait for trigger from main
-
- for i in 1..2 loop
- declare
- -- create a new message task
- N : acc_Message_Task := new Message_Task;
- begin
- -- preparation code
- null; -- stub
-
- end; -- declare
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Line_Driver");
- end Line_Driver;
-
-
- task body Message_Task is
- begin
- -- Queue up on Distributor's Input queue
- Distributor.Input;
-
- -- After the required computations have been performed
- -- return the message appropriately (probably to an output
- -- line driver
- null; -- stub
-
- -- Increment to show completion of this task
- TC_Tasks_Completed.Increment;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Message_Task");
-
- end Message_Task;
-
-
- -- Dispose each input message to the appropriate computation tasks
- -- Normally this would be according to some parameters in the entry
- -- but this simple test is using parameterless entries.
- --
- task body Distributor is
- Last_was_for_Credit_Computation : Boolean := false; -- switch
- begin
- loop
- select
- accept Input do
- -- Determine to which task the message should be
- -- distributed
- -- For this test arbitrarily send the first to
- -- Credit_Computation and the second to Debit_Computation
- if Last_was_for_Credit_Computation then
- requeue Debit_Computation.Input with abort;
- else
- Last_was_for_Credit_Computation := true;
- requeue Credit_Computation.Input with abort;
- end if;
- end Input;
- or
- terminate;
- end select;
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Distributor");
- end Distributor;
-
-
- -- Computation task. After the computation is performed the rendezvous
- -- in the original message task is completed.
- task body Credit_Computation is
- begin
- loop
- select
- accept Input do
- -- Perform the computations required for this message
- --
- null; -- stub
-
- -- For the test:
- -- Artificially rendezvous with Debit_Computation.
- -- If the first requeue in Distributor has blocked
- -- waiting for the current rendezvous to complete then the
- -- second message will not be sent to Debit_Computation
- -- which will still be waiting on its Input accept.
- -- This task will HANG
- --
- Debit_Computation.TC_Artificial_Rendezvous_1;
- --
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Computation");
- end Credit_Computation;
-
-
- -- Computation task. After the computation is performed the rendezvous
- -- in the original message task is completed.
- task body Debit_Computation is
- Message_Count : integer := 0;
- TC_AR1_is_complete : Boolean := false;
- begin
- loop
- select
- accept Input do
- -- Perform the computations required for this message
- null; -- stub
- end Input;
- Message_Count := Message_Count + 1;
- or
- -- Guard until the rendezvous with the message for this task
- -- has completed
- when Message_Count > 0 =>
- accept TC_Artificial_Rendezvous_1; -- see comments in
- -- Credit_Computation above
- TC_AR1_is_complete := true;
- or
- -- Completion rendezvous with the main procedure
- when TC_AR1_is_complete =>
- accept TC_Artificial_Rendezvous_2;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Debit_Computation");
-
-
- end Debit_Computation;
-
-
-begin -- c954010
- Report.Test ("C954010", "Requeue in an accept body does not block");
-
- Line_Driver.Start;
-
- -- Ensure that both messages were delivered to the computation tasks
- -- This shows that both requeues were effective.
- --
- Debit_Computation.TC_Artificial_Rendezvous_2;
-
- -- Ensure that the message tasks completed
- while (TC_Tasks_Completed.Count < TC_Expected_To_Complete) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- Report.Result;
-
-end C954010;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954011.a b/gcc/testsuite/ada/acats/tests/c9/c954011.a
deleted file mode 100644
index 159b32dba58..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954011.a
+++ /dev/null
@@ -1,384 +0,0 @@
--- C954011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a requeue is placed on the correct entry; that the
--- original caller waits for the completion of the requeued rendezvous;
--- that the original caller continues after the rendezvous.
--- Specifically, this test checks requeue to an entry in a different
--- task, requeue where the entry has parameters, and requeue with
--- abort.
---
--- TEST DESCRIPTION:
--- In the Distributor task, requeue two successive calls on the entries
--- of two separate target tasks. Each task in each of the paths adds
--- identifying information in the transaction being passed. This
--- information is checked by the Message tasks on completion ensuring that
--- the requeues have been placed on the correct queues.
---
--- This series of tests uses a simulation of a transaction driven
--- processing system. Line Drivers accept input from an external source
--- and build them into transaction records. These records are then
--- encapsulated in message tasks which remain extant for the life of the
--- transaction in the system. The message tasks put themselves on the
--- input queue of a Distributor which, from information in the
--- transaction and/or system load conditions forwards them to other
--- operating tasks. These in turn might forward the transactions to yet
--- other tasks for further action. The routing is, in real life,
--- dynamic and unpredictable at the time of message generation. All
--- rerouting in this model is done by means of requeues.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 26 Nov 95 SAIC Fixed problems with shared global variables
--- for ACVC 2.0.1
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C954011 is
-
-
- -- Arbitrary test values
- Credit_Return : constant := 1;
- Debit_Return : constant := 2;
-
- type Transaction_Code is (Credit, Debit);
-
- type Transaction_Record;
- type acc_Transaction_Record is access Transaction_Record;
- type Transaction_Record is
- record
- ID : integer := 0;
- Code : Transaction_Code := Debit;
- Account_Number : integer := 0;
- Stock_Number : integer := 0;
- Quantity : integer := 0;
- Return_Value : integer := 0;
- TC_Message_Count : integer := 0;
- TC_Thru_Distrib : Boolean := false;
- end record;
-
- protected type Message_Mgr is
- procedure Mark_Complete;
- function Is_Complete return Boolean;
- private
- Complete : Boolean := False;
- end Message_Mgr;
-
- protected body Message_Mgr is
- procedure Mark_Complete is
- begin
- Complete := True;
- end Mark_Complete;
-
- Function Is_Complete return Boolean is
- begin
- return Complete;
- end Is_Complete;
- end Message_Mgr;
-
- TC_Debit_Message : Message_Mgr;
- TC_Credit_Message : Message_Mgr;
-
-
- task type Message_Task is
- entry Accept_Transaction (In_Transaction : acc_Transaction_Record);
- end Message_Task;
- type acc_Message_Task is access Message_Task;
-
- task Line_Driver is
- entry Start;
- end Line_Driver;
-
- task Distributor is
- entry Input(Transaction : acc_Transaction_Record);
- end Distributor;
-
- task Credit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Computation;
-
- task Debit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Debit_Computation;
-
-
-
- -- Assemble messages received from an external source
- -- Creates a message task for each. The message tasks remain extant
- -- for the life of the messages in the system.
- -- The Line Driver task would normally be designed to loop continuously
- -- creating the messages as input is received. Simulate this
- -- but limit it to two dummy messages for this test and allow it
- -- to terminate at that point
- --
- task body Line_Driver is
- Current_ID : integer := 1;
- TC_Last_was_for_credit : Boolean := false;
-
- procedure Build_Credit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 100;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Credit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Credit_Record;
-
-
- procedure Build_Debit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 200;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Debit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Debit_Record;
-
- begin
-
- accept Start; -- Wait for trigger from Main
-
- for i in 1..2 loop -- arbitrarily limit to two messages for the test
- declare
- -- Create a task for the next message
- Next_Message_Task : acc_Message_Task := new Message_Task;
- -- Create a record for it
- Next_Transaction : acc_Transaction_Record
- := new Transaction_Record;
- begin
- if TC_Last_was_for_credit then
- Build_Debit_Record ( Next_Transaction );
- else
- Build_Credit_Record( Next_Transaction );
- TC_Last_was_for_credit := true;
- end if;
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- end; -- declare
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Line_Driver");
- end Line_Driver;
-
-
-
-
- task body Message_Task is
-
- TC_Original_Transaction_Code : Transaction_Code;
- This_Transaction : acc_Transaction_Record := new Transaction_Record;
-
- begin
- accept Accept_Transaction (In_Transaction : acc_Transaction_Record) do
- This_Transaction.all := In_Transaction.all;
- end Accept_Transaction;
-
- -- Note the original code to ensure correct return
- TC_Original_Transaction_Code := This_Transaction.Code;
-
- -- Queue up on Distributor's Input queue
- Distributor.Input ( This_Transaction );
- -- This task will now wait for the requeued rendezvous
- -- to complete before proceeding
-
- -- After the required computations have been performed
- -- return the Transaction_Record appropriately (probably to an output
- -- line driver)
- null; -- stub
-
-
- -- The following is all Test Control Code
-
- -- Check that the return values are as expected
- if TC_Original_Transaction_Code /= This_Transaction.Code then
- -- Incorrect rendezvous
- Report.Failed ("Message Task: Incorrect code returned");
- end if;
-
- if This_Transaction.Code = Credit then
- if This_Transaction.Return_Value /= Credit_Return or
- This_Transaction.TC_Message_Count /= 1 or not
- This_Transaction.TC_Thru_Distrib then
- Report.Failed ("Expected path not traversed");
- end if;
- TC_Credit_Message.Mark_Complete;
- else
- if This_Transaction.Return_Value /= Debit_Return or
- This_Transaction.TC_Message_Count /= 1 or not
- This_Transaction.TC_Thru_Distrib then
- Report.Failed ("Expected path not traversed");
- end if;
- TC_Debit_Message.Mark_Complete;
- end if;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Message_Task");
-
- end Message_Task;
-
-
-
- -- Dispose each input Transaction_Record to the appropriate
- -- computation tasks
- --
- task body Distributor is
-
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Mark the message as having passed through the distributor
- Transaction.TC_Thru_Distrib := true;
-
- -- Pass this transaction on the appropriate computation
- -- task
- case Transaction.Code is
- when Credit =>
- requeue Credit_Computation.Input with abort;
- when Debit =>
- requeue Debit_Computation.Input with abort;
- end case;
- end Input;
- or
- terminate;
- end select;
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Distributor");
- end Distributor;
-
-
-
- -- Computation task.
- -- Note: After the computation is performed in this task and the
- -- accept body is completed the rendezvous in the original
- -- message task is completed.
- --
- task body Credit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input ( Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this transaction
- null; -- stub
-
- -- For the test:
- if not Transaction.TC_Thru_Distrib then
- Report.Failed
- ("Credit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Credit then
- Report.Failed
- ("Credit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Credit_Return;
- -- one, and only one message should pass through
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Computation");
- end Credit_Computation;
-
-
-
- -- Computation task.
- -- Note: After the computation is performed in this task and the
- -- accept body is completed the rendezvous in the original
- -- message task is completed.
- --
- task body Debit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this message
- null; -- stub
-
- -- For the test:
- if not Transaction.TC_Thru_Distrib then
- Report.Failed
- ("Debit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Debit then
- Report.Failed
- ("Debit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Debit_Return;
- -- one, and only one, message should pass through
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Debit_Computation");
-
-
- end Debit_Computation;
-
-
-begin -- c954011
-
- Report.Test ("C954011", "Requeue from task body to task entry");
-
- Line_Driver.Start; -- Start the test
-
- -- Ensure that the message tasks complete before reporting the result
- while not (TC_Credit_Message.Is_Complete and
- TC_Debit_Message.Is_Complete) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- Report.Result;
-
-end C954011;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954012.a b/gcc/testsuite/ada/acats/tests/c9/c954012.a
deleted file mode 100644
index 44575b1b1e5..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954012.a
+++ /dev/null
@@ -1,496 +0,0 @@
--- C954012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check a requeue within an accept body to another entry in the same task
--- Specifically, check a call with parameters and a requeue with abort.
---
--- TEST DESCRIPTION:
--- One transaction is sent through to check the paths. After
--- processing this the Credit task sets the "overloaded" indicator. Once
--- this indicator is set the Distributor queues low priority transactions
--- on a Wait_for_Underload queue in the same task using a requeue. The
--- Distributor still delivers high priority transactions. After two high
--- priority transactions have been processed by the Credit task it clears
--- the overload condition. The low priority transactions should now be
--- delivered.
---
--- This series of tests uses a simulation of a transaction driven
--- processing system. Line Drivers accept input from an external source
--- and build them into transaction records. These records are then
--- encapsulated in message tasks which remain extant for the life of the
--- transaction in the system. The message tasks put themselves on the
--- input queue of a Distributor which, from information in the
--- transaction and/or system load conditions forwards them to other
--- operating tasks. These in turn might forward the transactions to yet
--- other tasks for further action. The routing is, in real life, dynamic
--- and unpredictable at the time of message generation. All rerouting in
--- this model is done by means of requeues.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 25 Nov 95 SAIC Fixed shared global variable problem for
--- ACVC 2.0.1
--- 14 Mar 03 RLB Fixed a race condition and an incorrect termination
--- condition in the test.
---!
-
-with Report;
-with ImpDef;
-with Ada.Calendar;
-
-procedure C954012 is
-
- function "=" (X,Y: Ada.Calendar.Time) return Boolean
- renames Ada.Calendar."=";
-
- -- Arbitrary test values
- Credit_Return : constant := 1;
- Debit_Return : constant := 2;
-
-
- -- This is used as an "initializing" time for the messages as they are
- -- created. As they pass through the Distributor they get a time_stamp
- -- of the current time. An arbitrary base time is chosen.
- -- TC: this fact is used, incidentally, to check that the messages have,
- -- indeed, passed through the Distributor as expected.
- --
- Base_Time : Ada.Calendar.Time := Ada.Calendar.Time_of(1959,3,9);
-
-
- -- Mechanism to count the number of Credit Message tasks completed
- protected TC_Tasks_Completed is
- procedure Increment;
- function Count return integer;
- private
- Number_Complete : integer := 0;
- end TC_Tasks_Completed;
-
- protected type Shared_Boolean (Initial_Value : Boolean := False) is
- procedure Set_True;
- procedure Set_False;
- function Value return Boolean;
- private
- Current_Value : Boolean := Initial_Value;
- end Shared_Boolean;
-
- protected body Shared_Boolean is
- procedure Set_True is
- begin
- Current_Value := True;
- end Set_True;
-
- procedure Set_False is
- begin
- Current_Value := False;
- end Set_False;
-
- function Value return Boolean is
- begin
- return Current_Value;
- end Value;
- end Shared_Boolean;
-
- TC_Debit_Message_Complete : Shared_Boolean (False);
- -- Handshaking mechanism between the Line Driver and the Credit task
- TC_First_Message_Has_Arrived : Shared_Boolean (False);
- Credit_Overloaded : Shared_Boolean (False);
-
- TC_Credit_Messages_Expected : constant integer := 5;
-
- type Transaction_Code is (Credit, Debit);
- type Transaction_Priority is (High, Low);
-
- type Transaction_Record;
- type acc_Transaction_Record is access Transaction_Record;
- type Transaction_Record is
- record
- ID : integer := 0;
- Code : Transaction_Code := Debit;
- Priority : Transaction_Priority := High;
- Account_Number : integer := 0;
- Stock_Number : integer := 0;
- Quantity : integer := 0;
- Return_Value : integer := 0;
- Message_Count : integer := 0; -- for test
- Time_Stamp : Ada.Calendar.Time := Base_Time;
- end record;
-
-
- task type Message_Task is
- entry Accept_Transaction (In_Transaction : acc_Transaction_Record);
- end Message_Task;
- type acc_Message_Task is access Message_Task;
-
- task Line_Driver is
- entry Start;
- end Line_Driver;
-
- task Distributor is
- entry Input (Transaction : acc_Transaction_Record);
- entry Wait_for_Underload (Transaction : acc_Transaction_Record);
- entry TC_Credit_OK;
- end Distributor;
-
- task Credit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Computation;
-
- task Debit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Debit_Computation;
-
-
- -- Mechanism to count the number of Message tasks completed (Credit)
- protected body TC_Tasks_Completed is
- procedure Increment is
- begin
- Number_Complete := Number_Complete + 1;
- end Increment;
-
- function Count return integer is
- begin
- return Number_Complete;
- end Count;
- end TC_Tasks_Completed;
-
-
- -- Assemble messages received from an external source
- -- Creates a message task for each. The message tasks remain extant
- -- for the life of the messages in the system.
- -- The Line Driver task would normally be designed to loop continuously
- -- creating the messages as input is received. Simulate this
- -- but limit it to the required number of dummy messages needed for
- -- this test and allow it to terminate at that point. Artificially
- -- alternate High and Low priority Credit transactions for this test.
- --
- task body Line_Driver is
- Current_ID : integer := 1;
- Current_Priority : Transaction_Priority := High;
-
- -- Artificial: number of messages required for this test
- type TC_Trans_Range is range 1..6;
-
- procedure Build_Credit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 100;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Credit;
- Next_Transaction.Priority := Current_Priority;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Credit_Record;
-
-
- procedure Build_Debit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 200;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Debit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Debit_Record;
-
- begin
-
- accept Start; -- Wait for trigger from Main
-
- for Transaction_Numb in TC_Trans_Range loop -- TC: limit the loop
- declare
- -- Create a task for the next message
- Next_Message_Task : acc_Message_Task := new Message_Task;
- -- Create a record for it
- Next_Transaction : acc_Transaction_Record
- := new Transaction_Record;
- begin
- if Transaction_Numb = TC_Trans_Range'first then
- -- Send the first Credit message
- Build_Credit_Record ( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- -- TC: Wait until the first message has been received by the
- -- Credit task and it has set the Overload indicator for the
- -- Distributor
- while not TC_First_Message_Has_Arrived.Value loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- elsif Transaction_Numb = TC_Trans_Range'last then
- -- For this test send the last transaction to the Debit task
- -- to improve the mix
- Build_Debit_Record( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- else
- -- TC: Alternate high and low priority transactions
- if Current_Priority = High then
- Current_Priority := Low;
- else
- Current_Priority := High;
- end if;
- Build_Credit_Record( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- end if;
- end; -- declare
- end loop;
-
- -- TC: Wait for Credit_Overloaded to be cleared, then insure that the
- -- Distributor has evalated all tasks. Otherwise, some tasks may never
- -- be evaluated.
- while Credit_Overloaded.Value loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- Distributor.TC_Credit_OK;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Line_Driver");
- end Line_Driver;
-
-
-
-
- task body Message_Task is
-
- TC_Original_Transaction_Code : Transaction_Code;
- This_Transaction : acc_Transaction_Record := new Transaction_Record;
-
- begin
-
- accept Accept_Transaction (In_Transaction : acc_Transaction_Record) do
- This_Transaction.all := In_Transaction.all;
- end Accept_Transaction;
-
- -- Note the original code to ensure correct return
- TC_Original_Transaction_Code := This_Transaction.Code;
-
- -- Queue up on Distributor's Input queue
- Distributor.Input ( This_Transaction );
- -- This task will now wait for the requeued rendezvous
- -- to complete before proceeding
-
- -- After the required computations have been performed
- -- return the Transaction_Record appropriately (probably to an output
- -- line driver)
- null; -- stub
-
- -- For the test check that the return values are as expected
- if TC_Original_Transaction_Code /= This_Transaction.Code then
- -- Incorrect rendezvous
- Report.Failed ("Message Task: Incorrect code returned");
- end if;
-
- if This_Transaction.Code = Credit then
- if This_Transaction.Return_Value /= Credit_Return or
- This_Transaction.Time_Stamp = Base_Time then
- Report.Failed ("Expected path not traversed");
- end if;
- TC_Tasks_Completed.Increment;
- else
- if This_Transaction.Return_Value /= Debit_Return or
- This_Transaction.Message_Count /= 1 or
- This_Transaction.Time_Stamp = Base_Time then
- Report.Failed ("Expected path not traversed");
- end if;
- TC_Debit_Message_Complete.Set_True;
- end if;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Message_Task");
-
- end Message_Task;
-
-
-
-
- -- Dispose each input Transaction_Record to the appropriate
- -- computation tasks
- --
- task body Distributor is
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Time_Stamp the messages with the current time
- -- TC: Used, incidentally, by the test to check that the
- -- message did pass through the Distributor Task
- Transaction.Time_Stamp := Ada.Calendar.Clock;
-
- -- Pass this transaction on to the appropriate computation
- -- task but temporarily hold low-priority transactions under
- -- overload conditions
- case Transaction.Code is
- when Credit =>
- if Credit_Overloaded.Value and
- Transaction.Priority = Low then
- requeue Wait_for_Underload with abort;
- else
- requeue Credit_Computation.Input with abort;
- end if;
- when Debit =>
- requeue Debit_Computation.Input with abort;
- end case;
- end Input;
- or
- when not Credit_Overloaded.Value =>
- accept Wait_for_Underload (Transaction : acc_Transaction_Record) do
- requeue Credit_Computation.Input with abort;
- end Wait_for_Underload;
- or
- accept TC_Credit_OK;
- -- We need this to insure that we evaluate the guards at least
- -- once when Credit_Overloaded is False. Otherwise, tasks
- -- could stay queued on Wait_for_Underload forever (starvation).
- or
- terminate;
- end select;
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Distributor");
- end Distributor;
-
-
-
- -- Computation task. After the computation is performed the rendezvous
- -- in the original message task is completed.
- --
- task body Credit_Computation is
-
- Message_Count : integer := 0;
-
- begin
- loop
- select
- accept Input ( Transaction : acc_Transaction_Record) do
- if Credit_Overloaded.Value and
- Transaction.Priority = Low then
- -- We should not be getting any Low Priority messages. They
- -- should be waiting on the Distributor's Wait_for_Underload
- -- queue
- Report.Failed
- ("Credit Task: Low priority transaction during overload");
- end if;
- -- Perform the computations required for this transaction
- null; -- stub
-
- -- For the test:
- if Transaction.Time_Stamp = Base_Time then
- Report.Failed
- ("Credit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Credit then
- Report.Failed
- ("Credit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- The following is all Test Control code:
- Transaction.Return_Value := Credit_Return;
- Message_Count := Message_Count + 1;
- --
- -- Now take special action depending on which Message
- if Message_Count = 1 then
- -- After the first message :
- Credit_Overloaded.Set_True;
- -- Now flag the Line_Driver that the second and subsequent
- -- messages may now be sent
- TC_First_Message_Has_Arrived.Set_True;
- end if;
- if Message_Count = 3 then
- -- The two high priority transactions created subsequent
- -- to the overload have now been processed
- Credit_Overloaded.Set_False;
- end if;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Computation");
- end Credit_Computation;
-
-
-
- -- Computation task. After the computation is performed the rendezvous
- -- in the original message task is completed.
- --
- task body Debit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this message
- null; -- stub
-
- -- For the test:
- if Transaction.Time_Stamp = Base_Time then
- Report.Failed
- ("Debit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Debit then
- Report.Failed
- ("Debit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Debit_Return;
- -- one, and only one, message should pass through
- Message_Count := Message_Count + 1;
- Transaction.Message_Count := Message_Count;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Debit_Computation");
-
-
- end Debit_Computation;
-
-
-begin -- c954012
- Report.Test ("C954012", "Requeue within an accept body" &
- " to another entry in the same task");
-
- Line_Driver.Start; -- Start the test
-
- -- Ensure that the message tasks complete before reporting the result
- while (TC_Tasks_Completed.Count < TC_Credit_Messages_Expected)
- or (not TC_Debit_Message_Complete.Value) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- Report.Result;
-
-end C954012;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954013.a b/gcc/testsuite/ada/acats/tests/c9/c954013.a
deleted file mode 100644
index a9de8c56b12..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954013.a
+++ /dev/null
@@ -1,521 +0,0 @@
--- C954013.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a requeue is cancelled and that the requeuing task is
--- unaffected when the calling task is aborted.
--- Specifically, check requeue to an entry in a different task,
--- requeue where the entry has parameters, and requeue with abort.
---
--- TEST DESCRIPTION:
--- Abort a task that has a call requeued to the entry queue of another
--- task. We do this by sending two messages to the Distributor which
--- requeues them to the Credit task. In the accept body of the Credit
--- task we wait for the second message to arrive then check that an
--- abort of the second message task does result in the requeue being
--- removed. The Line Driver task which generates the messages and the
--- Credit task communicate artificially in this test to arrange for the
--- proper timing of the messages and the abort. One extra message is
--- sent to the Debit task to ensure that the Distributor is still viable
--- and has been unaffected by the abort.
---
--- This series of tests uses a simulation of a transaction driven
--- processing system. Line Drivers accept input from an external source
--- and build them into transaction records. These records are then
--- encapsulated in message tasks which remain extant for the life of the
--- transaction in the system. The message tasks put themselves on the
--- input queue of a Distributor which, from information in the
--- transaction and/or system load conditions forwards them to other
--- operating tasks. These in turn might forward the transactions to yet
--- other tasks for further action. The routing is, in real life, dynamic
--- and unpredictable at the time of message generation. All rerouting in
--- this model is done by means of requeues.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 25 Nov 95 SAIC Fixed shared global variable problems for
--- ACVC 2.0.1
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C954013 is
-
-
- -- Arbitrary test values
- Credit_Return : constant := 1;
- Debit_Return : constant := 2;
-
-
- protected type Shared_Boolean (Initial_Value : Boolean := False) is
- procedure Set_True;
- procedure Set_False;
- function Value return Boolean;
- private
- Current_Value : Boolean := Initial_Value;
- end Shared_Boolean;
-
- protected body Shared_Boolean is
- procedure Set_True is
- begin
- Current_Value := True;
- end Set_True;
-
- procedure Set_False is
- begin
- Current_Value := False;
- end Set_False;
-
- function Value return Boolean is
- begin
- return Current_Value;
- end Value;
- end Shared_Boolean;
-
-
- TC_Debit_Message_Complete : Shared_Boolean (False);
- TC_Credit_Message_Complete : Shared_Boolean (False);
-
-
- type Transaction_Code is (Credit, Debit);
-
- type Transaction_Record;
- type acc_Transaction_Record is access Transaction_Record;
- type Transaction_Record is
- record
- ID : integer := 0;
- Code : Transaction_Code := Debit;
- Account_Number : integer := 0;
- Stock_Number : integer := 0;
- Quantity : integer := 0;
- Return_Value : integer := 0;
- TC_Message_Count : integer := 0;
- TC_Thru_Dist : Boolean := false;
- end record;
-
-
- task type Message_Task is
- entry Accept_Transaction (In_Transaction : acc_Transaction_Record);
- end Message_Task;
- type acc_Message_Task is access Message_Task;
-
- task Line_Driver is
- entry Start;
- end Line_Driver;
-
- task Distributor is
- entry Input(Transaction : acc_Transaction_Record);
- end Distributor;
-
- task Credit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Computation;
-
- task Debit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Debit_Computation;
-
- -- This protected object is here for Test Control purposes only
- protected TC_Prt is
- procedure Set_First_Has_Arrived;
- procedure Set_Second_Has_Arrived;
- procedure Set_Abort_Has_Completed;
- function First_Has_Arrived return Boolean;
- function Second_Has_Arrived return Boolean;
- function Abort_Has_Completed return Boolean;
- private
- First_Flag, Second_Flag, Abort_Flag : Boolean := false;
- end TC_Prt;
-
- protected body TC_Prt is
-
- Procedure Set_First_Has_Arrived is
- begin
- First_Flag := true;
- end Set_First_Has_Arrived;
-
- Procedure Set_Second_Has_Arrived is
- begin
- Second_Flag := true;
- end Set_Second_Has_Arrived;
-
- Procedure Set_Abort_Has_Completed is
- begin
- Abort_Flag := true;
- end Set_Abort_Has_Completed;
-
- Function First_Has_Arrived return boolean is
- begin
- return First_Flag;
- end First_Has_Arrived;
-
- Function Second_Has_Arrived return boolean is
- begin
- return Second_Flag;
- end Second_has_Arrived;
-
- Function Abort_Has_Completed return boolean is
- begin
- return Abort_Flag;
- end Abort_Has_Completed;
-
- end TC_PRT;
-
- -- Assemble messages received from an external source
- -- Creates a message task for each. The message tasks remain extant
- -- for the life of the messages in the system.
- -- TC: The Line Driver task would normally be designed to loop
- -- continuously creating the messages as input is received. Simulate
- -- this but limit it to three dummy messages for this test and use
- -- special artificial checks to pace the messages out under controlled
- -- conditions for the test; allow it to terminate at the end
- --
- task body Line_Driver is
- Current_ID : integer := 1;
- TC_First_message_sent: Boolean := false;
-
- procedure Build_Credit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 100;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Credit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Credit_Record;
-
-
- procedure Build_Debit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 200;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Debit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Debit_Record;
-
- begin
-
- accept Start; -- Wait for trigger from main
-
- for i in 1..3 loop -- TC: arbitrarily limit to two credit messages
- -- and one debit, then complete
- declare
- -- Create a task for the next message
- Next_Message_Task : acc_Message_Task := new Message_Task;
- -- Create a record for it
- Next_Transaction : acc_Transaction_Record :=
- new Transaction_Record;
- begin
- if not TC_First_Message_Sent then
- -- send out the first message to start up the Credit task
- Build_Credit_Record ( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- TC_First_Message_Sent := true;
- elsif not TC_Prt.Abort_Has_Completed then
- -- We have not yet processed the second message
- -- Wait to send the second message until we know the first
- -- has arrived at the Credit task and that task is in the
- -- accept body
- while not TC_Prt.First_Has_Arrived loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- We can now send the second message
- Build_Credit_Record( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
-
- -- Now wait for the second to arrive on the Credit input queue
- while not TC_Prt.Second_Has_Arrived loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- At this point: The Credit task is in the accept block
- -- dealing with the first message and the second message is
- -- is on the input queue
- abort Next_Message_Task.all; -- Note: we are still in the
- -- declare block for the
- -- second message task
-
- -- Make absolutely certain that all the actions
- -- associated with the abort have been completed, that the
- -- task has gone from Abnormal right through to
- -- Termination. All requeues that are to going to be
- -- cancelled will have been by the point of Termination.
- while not Next_Message_Task.all'terminated loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
-
- -- We now signal the Credit task that the abort has taken place
- -- so that it can check that the entry queue is empty as the
- -- requeue should have been cancelled
- TC_Prt.Set_Abort_Has_Completed;
- else
- -- The main part of the test is complete. Send one Debit message
- -- as further exercise of the Distributor to ensure it has not
- -- been affected by the cancellation of the requeue.
- Build_Debit_Record ( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- end if;
- end; -- declare
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Line_Driver");
- end Line_Driver;
-
-
-
-
- task body Message_Task is
-
- TC_Original_Transaction_Code : Transaction_Code;
- This_Transaction : acc_Transaction_Record := new Transaction_Record;
-
- begin
-
- accept Accept_Transaction (In_Transaction : acc_Transaction_Record) do
- This_Transaction.all := In_Transaction.all;
- end Accept_Transaction;
-
- -- Note the original code to ensure correct return
- TC_Original_Transaction_Code := This_Transaction.Code;
-
- -- Queue up on Distributor's Input queue
- Distributor.Input ( This_Transaction );
- -- This task will now wait for the requeued rendezvous
- -- to complete before proceeding
-
- -- After the required computations have been performed
- -- return the Transaction_Record appropriately (probably to an output
- -- line driver)
- null; -- stub
-
- -- For the test check that the return values are as expected
- if TC_Original_Transaction_Code /= This_Transaction.Code then
- -- Incorrect rendezvous
- Report.Failed ("Message Task: Incorrect code returned");
- end if;
-
- if This_Transaction.Code = Credit then
- if This_Transaction.Return_Value /= Credit_Return or
- This_Transaction.TC_Message_Count /= 1 or not
- This_Transaction.TC_Thru_Dist then
- Report.Failed ("Expected path not traversed");
- end if;
- TC_Credit_Message_Complete.Set_True;
- else
- if This_Transaction.Return_Value /= Debit_Return or
- This_Transaction.TC_Message_Count /= 1 or not
- This_Transaction.TC_Thru_Dist then
- Report.Failed ("Expected path not traversed");
- end if;
- TC_Debit_Message_Complete.Set_True;
- end if;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Message_Task");
-
- end Message_Task;
-
-
-
- -- Dispose each input Transaction_Record to the appropriate
- -- computation tasks
- --
- task body Distributor is
-
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Show that this message did pass through the Distributor Task
- Transaction.TC_Thru_Dist := true;
-
- -- Pass this transaction on the the appropriate computation
- -- task
- case Transaction.Code is
- when Credit =>
- requeue Credit_Computation.Input with abort;
- when Debit =>
- requeue Debit_Computation.Input with abort;
- end case;
- end Input;
- or
- terminate;
- end select;
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Distributor");
- end Distributor;
-
-
-
- -- Computation task.
- -- Note: After the computation is performed in this task and the
- -- accept body is completed the rendezvous in the original
- -- message task is completed.
- task body Credit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input ( Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this transaction
- --
- null; -- stub
-
- -- The rest of this code is for Test Control
- --
- if not Transaction.TC_Thru_Dist then
- Report.Failed
- ("Credit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Credit then
- Report.Failed
- ("Credit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Credit_Return;
- -- one, and only one message should pass through
- if Message_Count /= 0 then
- Report.Failed ("Aborted Requeue was not cancelled -1");
- end if;
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
-
-
- -- Having done the basic housekeeping we now need to signal
- -- that we are in the accept body of the credit task. The
- -- first message has arrived and the Line Driver may now send
- -- the second one
- TC_Prt.Set_First_Has_Arrived;
-
- -- Now wait for the second to arrive
-
- while Input'Count = 0 loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- -- Second message has been requeued - the Line driver may
- -- now abort the calling task
- TC_Prt.Set_Second_Has_Arrived;
-
- -- Now wait for the Line Driver to signal that the abort of
- -- the first task is complete - the requeue should be cancelled
- -- at this time
- while not TC_Prt.Abort_Has_Completed loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- if Input'Count /=0 then
- Report.Failed ("Aborted Requeue was not cancelled -2");
- end if;
- -- We can now complete the rendezvous with the first caller
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Computation");
- end Credit_Computation;
-
-
-
- -- Computation task.
- -- Note: After the computation is performed in this task and the
- -- accept body is completed the rendezvous in the original
- -- message task is completed.
- task body Debit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this message
- --
- null; -- stub
-
- -- The rest of this code is for Test Control
- --
- if not Transaction.TC_Thru_Dist then
- Report.Failed
- ("Debit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Debit then
- Report.Failed
- ("Debit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Debit_Return;
- -- one, and only one, message should pass through
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Debit_Computation");
-
-
- end Debit_Computation;
-
-
-begin -- c954013
-
- Report.Test ("C954013", "Abort a task that has a call requeued");
-
- Line_Driver.Start; -- start the test
-
- -- Wait for the message tasks to complete before calling Report.Result.
- -- Although two Credit tasks are generated one is aborted so only
- -- one completes, thus a single flag is sufficient
- -- Note: the test will hang here if there is a problem with the
- -- completion of the tasks
- while not (TC_Credit_Message_Complete.Value and
- TC_Debit_Message_Complete.Value) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- Report.Result;
-
-end C954013;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954014.a b/gcc/testsuite/ada/acats/tests/c9/c954014.a
deleted file mode 100644
index 53e45a090dd..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954014.a
+++ /dev/null
@@ -1,485 +0,0 @@
--- C954014.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a requeue is not canceled and that the requeueing
--- task is unaffected when a calling task is aborted. Check that the
--- abort is deferred until the entry call is complete.
--- Specifically, check requeue to an entry in a different task,
--- requeue where the entry call has parameters, and requeue
--- without the abort option.
---
--- TEST DESCRIPTION
--- In the Driver create a task that places a call on the
--- Distributor. In the Distributor requeue this call on the Credit task.
--- Abort the calling task when it is known to be in rendezvous with the
--- Credit task. (We arrange this by using artificial synchronization
--- points in the Driver and the accept body of the Credit task) Ensure
--- that the abort is deferred (the task is not terminated) until the
--- accept body completes. Afterwards, send one extra message through
--- the Distributor to check that the requeueing task has not been
--- disrupted.
---
--- This series of tests uses a simulation of a transaction driven
--- processing system. Line Drivers accept input from an external source
--- and build them into transaction records. These records are then
--- encapsulated in message tasks which remain extant for the life of the
--- transaction in the system. The message tasks put themselves on the
--- input queue of a Distributor which, from information in the
--- transaction and/or system load conditions forwards them to other
--- operating tasks. These in turn might forward the transactions to yet
--- other tasks for further action. The routing is, in real life, dynamic
--- and unpredictable at the time of message generation. All rerouting in
--- this model is done by means of requeues.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 25 Nov 95 SAIC Replaced global variables with protected objects
--- for ACVC 2.0.1.
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C954014 is
-
- -- Arbitrary test values
- Credit_Return : constant := 1;
- Debit_Return : constant := 2;
-
-
- protected type Shared_Boolean (Initial_Value : Boolean := False) is
- procedure Set_True;
- procedure Set_False;
- function Value return Boolean;
- private
- Current_Value : Boolean := Initial_Value;
- end Shared_Boolean;
-
- protected body Shared_Boolean is
- procedure Set_True is
- begin
- Current_Value := True;
- end Set_True;
-
- procedure Set_False is
- begin
- Current_Value := False;
- end Set_False;
-
- function Value return Boolean is
- begin
- return Current_Value;
- end Value;
- end Shared_Boolean;
-
-
- TC_Debit_Message_Complete : Shared_Boolean (False);
-
- -- Synchronization flags for handshaking between the Line_Driver
- -- and the Accept body in the Credit Task
- TC_Handshake_A : Shared_Boolean (False);
- TC_Handshake_B : Shared_Boolean (False);
- TC_Handshake_C : Shared_Boolean (False);
- TC_Handshake_D : Shared_Boolean (False);
- TC_Handshake_E : Shared_Boolean (False);
- TC_Handshake_F : Shared_Boolean (False);
-
-
- type Transaction_Code is (Credit, Debit);
-
- type Transaction_Record;
- type acc_Transaction_Record is access Transaction_Record;
- type Transaction_Record is
- record
- ID : integer := 0;
- Code : Transaction_Code := Debit;
- Account_Number : integer := 0;
- Stock_Number : integer := 0;
- Quantity : integer := 0;
- Return_Value : integer := 0;
- TC_Message_Count : integer := 0;
- TC_Thru_Distrib : Boolean;
- end record;
-
-
- task type Message_Task is
- entry Accept_Transaction (In_Transaction : acc_Transaction_Record);
- end Message_Task;
- type acc_Message_Task is access Message_Task;
-
- task Line_Driver is
- entry start;
- end Line_Driver;
-
- task Distributor is
- entry Input(Transaction : acc_Transaction_Record);
- end Distributor;
-
- task Credit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Computation;
-
- task Debit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Debit_Computation;
-
-
- -- Assemble messages received from an external source
- -- Creates a message task for each. The message tasks remain extant
- -- for the life of the messages in the system.
- -- TC: The Line Driver task would normally be designed to loop
- -- continuously creating the messages as input is received. Simulate
- -- this but limit it to two dummy messages for this test and use
- -- special artificial handshaking checks with the Credit accept body
- -- to control the test. Allow it to terminate at the end
- --
- task body Line_Driver is
- Current_ID : integer := 1;
- TC_First_message_sent: Boolean := false;
-
- procedure Build_Credit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 100;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Credit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Credit_Record;
-
-
- procedure Build_Debit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 200;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Debit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Debit_Record;
-
- begin
-
- accept Start; -- Wait for trigger from main
-
- for i in 1..2 loop -- TC: arbitrarily limit to one credit message
- -- and one debit, then complete
- declare
- -- Create a task for the next message
- Next_Message_Task : acc_Message_Task := new Message_Task;
- -- Create a record for it
- Next_Transaction : acc_Transaction_Record :=
- new Transaction_Record;
- begin
- if not TC_First_Message_Sent then
- -- send out the first message which will be aborted
- Build_Credit_Record ( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- TC_First_Message_Sent := true;
-
- -- Wait for Credit task to get into the accept body
- -- The call from the Message Task has been requeued by
- -- the distributor
- while not TC_Handshake_A.Value loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- Abort the calling task; the Credit task is guaranteed to
- -- be in the accept body
- abort Next_Message_Task.all; -- We are still in this declare
- -- block
-
- -- Inform the Credit task that the abort has been initiated
- TC_Handshake_B.Set_True;
-
- -- Now wait for the "acknowledgment" from the Credit task
- -- this ensures a complete task switch (at least)
- while not TC_Handshake_C.Value loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- The aborted task must not terminate till the accept body
- -- has completed
- if Next_Message_Task'terminated then
- Report.Failed ("The abort was not deferred");
- end if;
-
- -- Inform the Credit task that the termination has been checked
- TC_Handshake_D.Set_True;
-
- -- Now wait for the completion of the accept body in the
- -- Credit task
- while not TC_Handshake_E.Value loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- while not ( Next_Message_Task'terminated ) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- Indicate to the Main program that this section is complete
- TC_Handshake_F.Set_True;
-
- else
- -- The main part of the test is complete. Send one Debit message
- -- as further exercise of the Distributor to ensure it has not
- -- been affected by the abort of the requeue;
- Build_Debit_Record ( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- end if;
- end; -- declare
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Line_Driver");
- end Line_Driver;
-
-
-
- task body Message_Task is
-
- TC_Original_Transaction_Code : Transaction_Code;
- This_Transaction : acc_Transaction_Record := new Transaction_Record;
-
- begin
-
- accept Accept_Transaction (In_Transaction : acc_Transaction_Record) do
- This_Transaction.all := In_Transaction.all;
- end Accept_Transaction;
-
- -- Note the original code to ensure correct return
- TC_Original_Transaction_Code := This_Transaction.Code;
-
- -- Queue up on Distributor's Input queue
- Distributor.Input ( This_Transaction );
- -- This task will now wait for the requeued rendezvous
- -- to complete before proceeding
-
- -- After the required computations have been performed
- -- return the Transaction_Record appropriately (probably to an output
- -- line driver)
- null; -- stub
-
- -- For the test check that the return values are as expected
- if TC_Original_Transaction_Code /= This_Transaction.Code then
- -- Incorrect rendezvous
- Report.Failed ("Message Task: Incorrect code returned");
- end if;
-
- if This_Transaction.Code = Credit then
- -- The only Credit message was the one that should have been aborted
- Report.Failed ("Abort was not effective");
- else
- if This_Transaction.Return_Value /= Debit_Return or
- This_Transaction.TC_Message_Count /= 1 or not
- This_Transaction.TC_Thru_Distrib then
- Report.Failed ("Expected path not traversed");
- end if;
- TC_Debit_Message_Complete.Set_True;
- end if;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Message_Task");
-
- end Message_Task;
-
-
-
- -- Dispose each input Transaction_Record to the appropriate
- -- computation tasks
- --
- task body Distributor is
-
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
-
- -- Indicate that the message did pass through the
- -- Distributor Task
- Transaction.TC_Thru_Distrib := true;
-
- -- Pass this transaction on the appropriate computation
- -- task
- case Transaction.Code is
- when Credit =>
- requeue Credit_Computation.Input; -- without abort
- when Debit =>
- requeue Debit_Computation.Input; -- without abort
- end case;
- end Input;
- or
- terminate;
- end select;
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Distributor");
- end Distributor;
-
-
-
- -- Computation task.
- -- Note: After the computation is performed in this task and the
- -- accept body is completed the rendezvous in the original
- -- message task is completed.
- task body Credit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input ( Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this transaction
- --
- null; -- stub
-
- -- The rest of this code is for Test Control
- --
- if not Transaction.TC_Thru_Distrib then
- Report.Failed
- ("Credit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Credit then
- Report.Failed
- ("Credit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Credit_Return;
- -- one, and only one message should pass through
- if Message_Count /= 0 then
- Report.Failed ("Aborted Requeue was not canceled -1");
- end if;
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
-
- -- Having done the basic housekeeping we now need to signal
- -- that we are in the accept body of the credit task. The
- -- message has arrived and the Line Driver may now abort the
- -- calling task
- TC_Handshake_A.Set_True;
-
- -- Now wait for the Line Driver to inform us the calling
- -- task has been aborted
- while not TC_Handshake_B.Value loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- The abort has taken place
- -- Inform the Line Driver that we are still running in the
- -- accept body
- TC_Handshake_C.Set_True;
-
- -- Now wait for the Line Driver to digest this information
- while not TC_Handshake_D.Value loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- The Line driver has checked that the caller is not terminated
- -- We can now complete the accept
-
- end Input;
- -- We are out of the accept
- TC_Handshake_E.Set_True;
-
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Computation");
- end Credit_Computation;
-
-
-
- -- Computation task.
- -- Note: After the computation is performed in this task and the
- -- accept body is completed the rendezvous in the original
- -- message task is completed.
- task body Debit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this message
- --
- null; -- stub
-
- -- The rest of this code is for Test Control
- --
- if not Transaction.TC_Thru_Distrib then
- Report.Failed
- ("Debit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Debit then
- Report.Failed
- ("Debit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Debit_Return;
- -- one, and only one, message should pass through
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Debit_Computation");
-
-
- end Debit_Computation;
-
-
-begin -- c954014
- Report.Test ("C954014", "Abort a task that has a call" &
- " requeued_without_abort");
-
- Line_Driver.Start; -- Start the test
-
- -- Wait for the message tasks to complete before reporting the result
- --
- while not (TC_Handshake_F.Value -- abort not effective?
- and TC_Debit_Message_Complete.Value -- Distributor affected?
- and TC_Handshake_E.Value ) loop -- accept not completed?
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- Report.Result;
-
-end C954014;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954015.a b/gcc/testsuite/ada/acats/tests/c9/c954015.a
deleted file mode 100644
index c86e1078e79..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954015.a
+++ /dev/null
@@ -1,549 +0,0 @@
--- C954015.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that requeued calls to task entries may, in turn, be requeued.
--- Check that the intermediate requeues are not blocked and that the
--- original caller remains blocked until the last requeue is complete.
--- This test uses:
--- Call with parameters
--- Requeue with abort
---
--- TEST DESCRIPTION
--- A call is placed on the input queue of the Distributor. The
--- Distributor requeues to the Credit task; the Credit task requeues to a
--- secondary task which, in turn requeues to yet another task. This
--- continues down the chain. At the furthest point of the chain the
--- rendezvous is completed. To verify the action, the furthest task
--- waits in the accept statement for a second message to arrive before
--- completing. This second message can only arrive if none of the earlier
--- tasks in the chain are blocked waiting for completion. Apart from
--- the two Credit messages which are used to check the requeue chain one
--- Debit message is sent to validate the mix.
---
---
--- This series of tests uses a simulation of a transaction driven
--- processing system. Line Drivers accept input from an external source
--- and build them into transaction records. These records are then
--- encapsulated in message tasks which remain extant for the life of the
--- transaction in the system. The message tasks put themselves on the
--- input queue of a Distributor which, from information in the
--- transaction and/or system load conditions forwards them to other
--- operating tasks. These in turn might forward the transactions to yet
--- other tasks for further action. The routing is, in real life, dynamic
--- and unpredictable at the time of message generation. All rerouting in
--- this model is done by means of requeues.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-with Report;
-with ImpDef;
-
-procedure C954015 is
-
- -- Arbitrary test values
- Credit_Return : constant := 1;
- Debit_Return : constant := 2;
-
- -- Mechanism to count the number of Credit Message tasks completed
- protected TC_Tasks_Completed is
- procedure Increment;
- function Count return integer;
- private
- Number_Complete : integer := 0;
- end TC_Tasks_Completed;
-
- TC_Expected_To_Complete : constant integer := 3;
-
-
- -- Values added to the Return_Value indicating passage through the
- -- particular task
- TC_Credit_Value : constant integer := 1;
- TC_Sub_1_Value : constant integer := 2;
- TC_Sub_2_Value : constant integer := 3;
- TC_Sub_3_Value : constant integer := 4;
- TC_Sub_4_Value : constant integer := 5;
- --
- TC_Full_Value : integer := TC_Credit_Value + TC_Sub_1_Value +
- TC_Sub_2_Value + TC_Sub_3_Value +
- TC_Sub_4_Value;
-
- type Transaction_Code is (Credit, Debit);
-
- type Transaction_Record;
- type acc_Transaction_Record is access Transaction_Record;
- type Transaction_Record is
- record
- ID : integer := 0;
- Code : Transaction_Code := Debit;
- Account_Number : integer := 0;
- Stock_Number : integer := 0;
- Quantity : integer := 0;
- Return_Value : integer := 0;
- TC_Message_Count : integer := 0;
- TC_Thru_Distrib : Boolean := false;
- end record;
-
-
- task type Message_Task is
- entry Accept_Transaction (In_Transaction : acc_Transaction_Record);
- end Message_Task;
- type acc_Message_Task is access Message_Task;
-
- task Line_Driver is
- entry Start;
- end Line_Driver;
-
- task Distributor is
- entry Input(Transaction : acc_Transaction_Record);
- end Distributor;
-
- task Credit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Computation;
-
- task Debit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Debit_Computation;
-
- -- The following are almost identical for the purpose of the test
- task Credit_Sub_1 is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Sub_1;
- --
- task Credit_Sub_2 is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Sub_2;
- --
- task Credit_Sub_3 is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Sub_3;
-
- -- This is the last in the chain
- task Credit_Sub_4 is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Sub_4;
-
-
- -- Mechanism to count the number of Message tasks completed (Credit)
- protected body TC_Tasks_Completed is
- procedure Increment is
- begin
- Number_Complete := Number_Complete + 1;
- end Increment;
-
- function Count return integer is
- begin
- return Number_Complete;
- end Count;
- end TC_Tasks_Completed;
-
-
-
- -- Assemble messages received from an external source
- -- Creates a message task for each. The message tasks remain extant
- -- for the life of the messages in the system.
- -- The Line Driver task would normally be designed to loop continuously
- -- creating the messages as input is received. Simulate this
- -- but limit it to the number of dummy messages needed for this
- -- test and allow it to terminate at that point.
- --
- task body Line_Driver is
- Current_ID : integer := 1;
- TC_Last_was_for_credit : Boolean := false;
-
- -- Arbitrary limit for the number of messages sent for this test
- type TC_Trans_Range is range 1..3;
-
- procedure Build_Credit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 100;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Credit;
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Credit_Record;
-
- procedure Build_Debit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 200;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Debit;
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Debit_Record;
-
-
- begin
-
- accept Start; -- wait for trigger from Main
-
- -- Arbitrarily limit the loop to the number needed for this test only
- for Transaction_Numb in TC_Trans_Range loop
- declare
- -- Create a task for the next message
- Next_Message_Task : acc_Message_Task := new Message_Task;
- -- Create a record for it
- Next_Transaction : acc_Transaction_Record :=
- new Transaction_Record;
- begin
- -- Artificially send out in the order required
- case Transaction_Numb is
- when 1 =>
- Build_Credit_Record( Next_Transaction );
- when 2 =>
- Build_Credit_Record( Next_Transaction );
- when 3 =>
- Build_Debit_Record ( Next_Transaction );
- end case;
-
- -- Present the record to the message task
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- end; -- declare
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Line_Driver");
- end Line_Driver;
-
-
-
- task body Message_Task is
-
- TC_Original_Transaction_Code : Transaction_Code;
- This_Transaction : acc_Transaction_Record := new Transaction_Record;
-
- begin
-
- accept Accept_Transaction (In_Transaction : acc_Transaction_Record) do
- This_Transaction.all := In_Transaction.all;
- end Accept_Transaction;
-
- -- Note the original code to ensure correct return
- TC_Original_Transaction_Code := This_Transaction.Code;
-
- -- Queue up on Distributor's Input queue
- Distributor.Input ( This_Transaction );
- -- This task will now wait for the requeued rendezvous
- -- to complete before proceeding
-
- -- After the required computations have been performed
- -- return the Transaction_Record appropriately (probably to an output
- -- line driver)
- null; -- stub
-
-
- -- The following is all Test Control Code
-
- -- Check that the return values are as expected
- if TC_Original_Transaction_Code /= This_Transaction.Code then
- -- Incorrect rendezvous
- Report.Failed ("Message Task: Incorrect code returned");
- end if;
-
- if This_Transaction.Code = Credit then
- if This_Transaction.Return_Value /= TC_Full_Value or not
- This_Transaction.TC_Thru_Distrib then
- Report.Failed ("Expected path not traversed - CR");
- end if;
- if
- This_Transaction.TC_Message_Count not in 1..2 then
- Report.Failed ("Incorrect Message Count");
- end if;
- else
- if This_Transaction.Return_Value /= Debit_Return or
- This_Transaction.TC_Message_Count /= 1 or not
- This_Transaction.TC_Thru_Distrib then
- Report.Failed ("Expected path not traversed - DB");
- end if;
- end if;
- TC_Tasks_Completed.Increment;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Message_Task");
-
- end Message_Task;
-
-
-
- -- Dispose each input Transaction_Record to the appropriate
- -- computation tasks
- --
- task body Distributor is
-
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Show that the message did pass through the Distributor Task
- Transaction.TC_Thru_Distrib := true;
-
- -- Pass this transaction on to the appropriate computation
- -- task
- case Transaction.Code is
- when Credit =>
- requeue Credit_Computation.Input with abort;
- when Debit =>
- requeue Debit_Computation.Input with abort;
- end case;
- end Input;
- or
- terminate;
- end select;
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Distributor");
- end Distributor;
-
-
-
-
- -- Computation task.
- -- Note: After the computation is performed in this task the message is
- -- passed on for further processing to some subsidiary task. The choice
- -- of subsidiary task is made according to criteria not specified in
- -- this test.
- --
- task body Credit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input ( Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this transaction
- null; -- stub
-
- -- For the test:
- if not Transaction.TC_Thru_Distrib then
- Report.Failed
- ("Credit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Credit then
- Report.Failed
- ("Credit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test, plug a known value and count
- Transaction.Return_Value := TC_Credit_Value;
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
-
- -- Depending on transaction content send it on to the
- -- some other task for further processing
- -- TC: Arbitrarily send the message on to Credit_Sub_1
- requeue Credit_Sub_1.Input with abort;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Computation");
- end Credit_Computation;
-
-
-
- task body Credit_Sub_1 is
- begin
- loop
- select
- accept Input(Transaction : acc_Transaction_Record) do
- -- Process this transaction
- null; -- stub
-
- -- Add the value showing passage through this task
- Transaction.Return_Value :=
- Transaction.Return_Value + TC_Sub_1_Value;
- -- Depending on transaction content send it on to the
- -- some other task for further processing
- -- Arbitrarily send the message on to Credit_Sub_2
- requeue Credit_Sub_2.Input with abort;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Sub_1");
-
- end Credit_Sub_1;
-
- task body Credit_Sub_2 is
- begin
- loop
- select
- accept Input(Transaction : acc_Transaction_Record) do
- -- Process this transaction
- null; -- stub
-
- -- Add the value showing passage through this task
- Transaction.Return_Value :=
- Transaction.Return_Value + TC_Sub_2_Value;
- -- Depending on transaction content send it on to the
- -- some other task for further processing
- -- Arbitrarily send the message on to Credit_Sub_3
- requeue Credit_Sub_3.Input with abort;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Sub_2");
- end Credit_Sub_2;
-
- task body Credit_Sub_3 is
- begin
- loop
- select
- accept Input(Transaction : acc_Transaction_Record) do
- -- Process this transaction
- null; -- stub
-
- -- Add the value showing passage through this task
- Transaction.Return_Value :=
- Transaction.Return_Value + TC_Sub_3_Value;
- -- Depending on transaction content send it on to the
- -- some other task for further processing
- -- Arbitrarily send the message on to Credit_Sub_4
- requeue Credit_Sub_4.Input with abort;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Sub_3");
- end Credit_Sub_3;
-
- -- This is the last in the chain of tasks to which transactions will
- -- be requeued
- --
- task body Credit_Sub_4 is
-
- TC_First_Message : Boolean := true;
-
- begin
- loop
- select
- accept Input(Transaction : acc_Transaction_Record) do
- -- Process this transaction
- null; -- stub
-
- -- Add the value showing passage through this task
- Transaction.Return_Value :=
- Transaction.Return_Value + TC_Sub_4_Value;
- -- TC: stay in the accept body dealing with the first message
- -- until the second arrives. If any of the requeues are
- -- blocked the test will hang here indicating failure
- if TC_First_Message then
- while Input'count = 0 loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- TC_First_Message := false;
- end if;
- -- for the second message, just complete the rendezvous
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Sub_4");
- end Credit_Sub_4;
-
-
-
- -- Computation task.
- -- Note: After the computation is performed in this task and the
- -- accept body is completed the rendezvous in the original
- -- message task is completed.
- --
- task body Debit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this message
- null; -- stub
-
- -- For the test:
- if not Transaction.TC_Thru_Distrib then
- Report.Failed
- ("Debit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Debit then
- Report.Failed
- ("Debit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Debit_Return;
- -- one, and only one, message should pass through
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Debit_Computation");
-
-
- end Debit_Computation;
-
-
-begin
-
- Report.Test ("C954015", "Test multiple levels of requeue to task entry");
-
- Line_Driver.Start; -- Start the test
-
- -- Ensure that the message tasks completed before calling Result
- while (TC_Tasks_Completed.Count < TC_Expected_To_Complete) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- Report.Result;
-
-end C954015;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954016.a b/gcc/testsuite/ada/acats/tests/c9/c954016.a
deleted file mode 100644
index 1390801eec0..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954016.a
+++ /dev/null
@@ -1,182 +0,0 @@
--- C954016.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that when a task that is called by a requeue is aborted, the
--- original caller receives Tasking_Error and the requeuing task is
--- unaffected.
---
--- TEST DESCRIPTION:
--- The Intermediate task requeues a call from the Original_Caller to the
--- Receiver. While the Receiver is in the accept body for this
--- rendezvous the Main aborts it. Check that Tasking_Error is raised in
--- the Original_Caller, that the Receiver does, indeed, get aborted and
--- the Intermediate task is undisturbed.
--- There are several delay loops in this test any one of which could
--- cause it to hang which would constitute failure.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 25 Nov 95 SAIC Replaced shared global variable with protected
--- object for ACVC 2.0.1
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C954016 is
-
- TC_Original_Caller_Complete : Boolean := false;
- TC_Intermediate_Complete : Boolean := false;
-
-
- protected type Shared_Boolean (Initial_Value : Boolean := False) is
- procedure Set_True;
- procedure Set_False;
- function Value return Boolean;
- private
- Current_Value : Boolean := Initial_Value;
- end Shared_Boolean;
-
- protected body Shared_Boolean is
- procedure Set_True is
- begin
- Current_Value := True;
- end Set_True;
-
- procedure Set_False is
- begin
- Current_Value := False;
- end Set_False;
-
- function Value return Boolean is
- begin
- return Current_Value;
- end Value;
- end Shared_Boolean;
-
- TC_Receiver_in_Accept : Shared_Boolean (False);
-
-
- task Original_Caller is
- entry Start;
- end Original_Caller;
-
- task Intermediate is
- entry Input;
- entry TC_Abort_Process_Complete;
- end Intermediate;
-
- task Receiver is
- entry Input;
- entry TC_Never_Called;
- end Receiver;
-
-
- task body Original_Caller is
- begin
- accept Start; -- wait for the trigger from Main
-
- Intermediate.Input;
- Report.Failed ("Tasking_Error not raised in Original_Caller task");
-
- exception
- when tasking_error =>
- TC_Original_Caller_Complete := true; -- expected behavior
- when others =>
- Report.Failed ("Unexpected Exception in Original_Caller task");
- end Original_Caller;
-
-
- task body Intermediate is
- begin
- accept Input do
- -- Within this accept call another task
- requeue Receiver.Input with abort;
- end Input;
-
- -- Wait for Main to ensure that the abort housekeeping is finished
- accept TC_Abort_Process_Complete;
-
- TC_Intermediate_Complete := true;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Intermediate task");
- end Intermediate;
-
-
- task body Receiver is
- begin
- accept Input do
- TC_Receiver_in_Accept.Set_True;
- -- Hang within the accept body to allow Main to abort this task
- accept TC_Never_Called;
- end Input;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Receiver Task");
-
- end Receiver;
-
-
-begin
- Report.Test ("C954016", "Requeue: abort the called task");
-
- Original_Caller.Start;
-
- -- Wait till the rendezvous with Receiver is started
- while not TC_Receiver_in_Accept.Value loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- At this point the Receiver is guaranteed to be in its accept
- --
- abort Receiver;
-
- -- Wait for the whole of the abort process to complete
- while not ( Original_Caller'terminated and Receiver'terminated ) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- Inform the Intermediate task that the process is complete to allow
- -- it to continue to completion itself
- Intermediate.TC_Abort_Process_Complete;
-
- -- Wait for everything to settle before reporting the result
- while not ( Intermediate'terminated ) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
-
- if not ( TC_Original_Caller_Complete and TC_Intermediate_Complete ) then
- Report.Failed ("Proper paths not traversed");
- end if;
-
- Report.Result;
-
-end C954016;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954017.a b/gcc/testsuite/ada/acats/tests/c9/c954017.a
deleted file mode 100644
index a5447a756c5..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954017.a
+++ /dev/null
@@ -1,184 +0,0 @@
--- C954017.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that when an exception is raised in the rendezvous of a task
--- that was called by a requeue the exception is propagated to the
--- original caller and that the requeuing task is unaffected.
---
--- TEST DESCRIPTION:
--- The Intermediate task requeues a call from the Original_Caller to the
--- Receiver. While the Receiver is in the accept body for this
--- rendezvous a Constraint_Error exception is raised. Check that the
--- exception is propagated to the Original_Caller, that the Receiver's
--- normal exception logic is employed and that the Intermediate task
--- is undisturbed.
--- There are several delay loops in this test any one of which could
--- cause it to hang (and thus fail).
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 25 Nov 95 SAIC Fixed shared global variable problem for
--- ACVC 2.0.1
---
---!
-
-with Report;
-with ImpDef;
-
-
-procedure C954017 is
-
- TC_Original_Caller_Complete : Boolean := false;
- TC_Intermediate_Complete : Boolean := false;
- TC_Receiver_Complete : Boolean := false;
- TC_Exception : Exception;
-
-
- protected type Shared_Boolean (Initial_Value : Boolean := False) is
- procedure Set_True;
- procedure Set_False;
- function Value return Boolean;
- private
- Current_Value : Boolean := Initial_Value;
- end Shared_Boolean;
-
- protected body Shared_Boolean is
- procedure Set_True is
- begin
- Current_Value := True;
- end Set_True;
-
- procedure Set_False is
- begin
- Current_Value := False;
- end Set_False;
-
- function Value return Boolean is
- begin
- return Current_Value;
- end Value;
- end Shared_Boolean;
-
- TC_Exception_Process_Complete : Shared_Boolean (False);
-
- task Original_Caller is
- entry Start;
- end Original_Caller;
-
- task Intermediate is
- entry Input;
- end Intermediate;
-
- task Receiver is
- entry Input;
- end Receiver;
-
-
- task body Original_Caller is
- begin
- accept Start; -- wait for the trigger from Main
-
- Intermediate.Input;
- Report.Failed ("Exception not propagated to Original_Caller");
-
- exception
- when TC_Exception =>
- TC_Original_Caller_Complete := true; -- Expected behavior
- when others =>
- Report.Failed ("Unexpected Exception in Original_Caller task");
- end Original_Caller;
-
-
- task body Intermediate is
- begin
- accept Input do
- -- Within this accept call another task
- requeue Receiver.Input with abort;
- end Input;
-
- -- Wait for Main to ensure that the exception housekeeping is finished
- while not TC_Exception_Process_Complete.Value loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- TC_Intermediate_Complete := true;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Intermediate task");
- end Intermediate;
-
-
- task body Receiver is
- --
- begin
- accept Input do
- null; -- the user code for the rendezvous is stubbed out
-
- -- Test Control: Raise an exception in the destination task which
- -- should then be propagated
- raise TC_Exception;
-
- end Input;
- exception
- when TC_Exception =>
- TC_Receiver_Complete := true; -- expected behavior
- when others =>
- Report.Failed ("Unexpected Exception in Receiver Task");
- end Receiver;
-
-
-begin
-
- Report.Test ("C954017", "Requeue: exception processing");
-
- Original_Caller.Start; -- Start the test after the Report.Test
-
- -- Wait for the whole of the exception process to complete
- while not ( Original_Caller'terminated and Receiver'terminated ) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- Inform the Intermediate task that the process is complete to allow
- -- it to continue to completion itself
- TC_Exception_Process_Complete.Set_True;
-
- -- Wait for everything to settle before reporting the result
- while not ( Intermediate'terminated ) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
-
- if not ( TC_Original_Caller_Complete and
- TC_Intermediate_Complete and
- TC_Receiver_Complete) then
- Report.Failed ("Proper paths not traversed");
- end if;
-
- Report.Result;
-
-end C954017;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954018.a b/gcc/testsuite/ada/acats/tests/c9/c954018.a
deleted file mode 100644
index a9da1e06bad..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954018.a
+++ /dev/null
@@ -1,227 +0,0 @@
--- C954018.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if a task is aborted while a requeued call is queued
--- on one of its entries the original caller receives Tasking_Error
--- and the requeuing task is unaffected.
--- This test uses: Requeue to an entry in a different task
--- Parameterless call
--- Requeue with abort
---
--- TEST DESCRIPTION:
--- The Intermediate task requeues a call from the Original_Caller to the
--- Receiver on an entry with a guard that is always false. While the
--- Original_Caller is still queued the Receiver is aborted.
--- Check that Tasking_Error is raised in the Original_Caller, that the
--- Receiver does, indeed, get aborted and the Intermediate task
--- is undisturbed.
--- There are several delay loops in this test any one of which could
--- cause it to hang and thus indicate failure.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-with Report;
-with ImpDef;
-
-
-procedure C954018 is
-
-
- -- Protected object to control the shared test variables
- --
- protected TC_State is
- function On_Entry_Queue return Boolean;
- procedure Set_On_Entry_Queue;
- function Original_Caller_Complete return Boolean;
- procedure Set_Original_Caller_Complete;
- function Intermediate_Complete return Boolean;
- procedure Set_Intermediate_Complete;
- private
- On_Entry_Queue_Flag : Boolean := false;
- Original_Caller_Complete_Flag : Boolean := false;
- Intermediate_Complete_Flag : Boolean := false;
- end TC_State;
- --
- --
- protected body TC_State is
- function On_Entry_Queue return Boolean is
- begin
- return On_Entry_Queue_Flag;
- end On_Entry_Queue;
-
- procedure Set_On_Entry_Queue is
- begin
- On_Entry_Queue_Flag := true;
- end Set_On_Entry_Queue;
-
- function Original_Caller_Complete return Boolean is
- begin
- return Original_Caller_Complete_Flag;
- end Original_Caller_Complete;
-
- procedure Set_Original_Caller_Complete is
- begin
- Original_Caller_Complete_Flag := true;
- end Set_Original_Caller_Complete;
-
- function Intermediate_Complete return Boolean is
- begin
- return Intermediate_Complete_Flag;
- end Intermediate_Complete;
-
- procedure Set_Intermediate_Complete is
- begin
- Intermediate_Complete_Flag := true;
- end Set_Intermediate_Complete;
-
- end TC_State;
-
- --================================
-
- task Original_Caller is
- entry Start;
- end Original_Caller;
-
- task Intermediate is
- entry Input;
- entry TC_Abort_Process_Complete;
- end Intermediate;
-
- task Receiver is
- entry Input;
- end Receiver;
-
-
- task body Original_Caller is
- begin
- accept Start; -- wait for the trigger from Main
-
- Intermediate.Input;
- Report.Failed ("Tasking_Error not raised in Original_Caller task");
-
- exception
- when tasking_error =>
- TC_State.Set_Original_Caller_Complete; -- expected behavior
- when others =>
- Report.Failed ("Unexpected Exception in Original_Caller task");
- end Original_Caller;
-
-
- task body Intermediate is
- begin
- accept Input do
- -- Within this accept call another task
- TC_State.Set_On_Entry_Queue;
- requeue Receiver.Input with abort;
- Report.Failed ("Requeue did not complete the Accept");
- end Input;
-
- -- Wait for Main to ensure that the abort housekeeping is finished
- accept TC_Abort_Process_Complete;
-
- TC_State.Set_Intermediate_Complete;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Intermediate task");
- end Intermediate;
-
-
- task body Receiver is
- begin
- loop
- select
- -- A call to Input will be placed on the queue and never serviced
- when Report.Equal (1,2) => -- Always false
- accept Input do
- Report.Failed ("Receiver in Accept");
- end Input;
- or
- delay ImpDef.Minimum_Task_Switch;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Receiver Task");
-
- end Receiver;
-
-
-begin
-
- Report.Test ("C954018", "Requeue: abort the called task" &
- " while Caller is still queued");
-
- Original_Caller.Start;
-
-
- -- This is the main part of the test
-
- -- Wait for the requeue
- while not TC_State.On_Entry_Queue loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- Delay long enough to ensure that the requeue has "arrived" on
- -- the entry queue. Note: TC_State.Set_On_Entry_Queue is called the
- -- statement before the requeue
- --
- delay ImpDef.Switch_To_New_Task;
-
- -- At this point the Receiver is guaranteed to have the requeue on
- -- the entry queue
- --
- abort Receiver;
-
- -- Wait for the whole of the abort process to complete
- while not ( Original_Caller'terminated and Receiver'terminated ) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
-
- -- Inform the Intermediate task that the process is complete to allow
- -- it to continue to completion itself
- Intermediate.TC_Abort_Process_Complete;
-
- -- Wait for everything to settle before reporting the result
- while not ( Intermediate'terminated ) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
-
- if not ( TC_State.Original_Caller_Complete and
- TC_State.Intermediate_Complete ) then
- Report.Failed ("Proper paths not traversed");
- end if;
-
- Report.Result;
-
-end C954018;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954019.a b/gcc/testsuite/ada/acats/tests/c9/c954019.a
deleted file mode 100644
index fafc6aa591f..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954019.a
+++ /dev/null
@@ -1,314 +0,0 @@
--- C954019.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that when a requeue is to the same entry the items go to the
--- right queue and that they are placed back on the end of the queue.
---
--- TEST DESCRIPTION:
--- Simulate part of a message handling application where the messages are
--- composed of several segments. The sequence of the segments within the
--- message is specified by Seg_Sequence_No. The segments are handled by
--- different tasks and finally forwarded to an output driver. The
--- segments can arrive in any order but must be assembled into the proper
--- sequence for final output. There is a Sequencer task interposed
--- before the Driver. This takes the segments of the message off the
--- Ordering_Queue and those that are in the right order it sends on to
--- the driver; those that are out of order it places back on the end of
--- the queue.
---
--- The test just simulates the arrival of the segments at the Sequencer.
--- The task generating the segments handshakes with the Sequencer during
--- the "Await Arrival" phase ensuring that the three segments of a
--- message arrive in REVERSE order (the End-of-Message segment arrives
--- first and the Header last). In the first cycle the sequencer pulls
--- segments off the queue and puts them back on the end till it
--- encounters the header. It checks the sequence of the ones it pulls
--- off in case the segments are being put back on in the wrong part of
--- the queue. Having cycled once through it no longer verifies the
--- sequence - it just executes the "application" code for the correct
--- order for dispatch to the driver.
---
--- In this simple example no attempt is made to address segments of
--- another message arriving or any other error conditions (such as
--- missing segments, timing etc.)
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Dec 94 SAIC Remove parameter from requeue statement
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C954019 is
-begin
-
-
- Report.Test ("C954019", "Check Requeue to the same Accept");
-
- declare -- encapsulate the test
-
- type Segment_Sequence is range 1..8;
- Header : constant Segment_Sequence := Segment_Sequence'first;
-
- type Message_Segment is record
- ID : integer; -- Message ID
- Seg_Sequence_No : Segment_Sequence; -- Within the message
- Alpha : string (1..128);
- EOM : Boolean := false; -- true for final msg segment
- end record;
- type acc_Message_Segment is access Message_Segment;
-
- task TC_Simulate_Arrival;
-
- task type Carrier_Task is
- entry Input ( Segment : acc_Message_Segment );
- end Carrier_Task;
- type acc_Carrier_Task is access Carrier_Task;
-
- task Sequencer is
- entry Ordering_Queue ( Segment : acc_Message_Segment );
- entry TC_Handshake_1;
- entry TC_Handshake_2;
- end Sequencer;
-
- task Output_Driver is
- entry Input ( Segment : acc_Message_Segment );
- end Output_Driver;
-
-
- -- Simulate the arrival of three message segments in REVERSE order
- --
- task body TC_Simulate_Arrival is
- begin
-
- for i in 1..3 loop
- declare
- -- Create a task for the next message segment
- Next_Segment_Task : acc_Carrier_Task := new Carrier_Task;
- -- Create a record for the next segment
- Next_Segment : acc_Message_Segment := new Message_Segment;
- begin
- if i = 1 then
- -- Build the EOM segment as the first to "send"
- Next_Segment.Seg_Sequence_No := Header + 2;
- Next_Segment.EOM := true;
- elsif i = 2 then
- -- Wait for the first segment to arrive at the Sequencer
- -- before "sending" the second
- Sequencer.TC_Handshake_1;
- -- Build the segment
- Next_Segment.Seg_Sequence_No := Header + 1;
- else
- -- Wait for the second segment to arrive at the Sequencer
- -- before "sending" the third
- Sequencer.TC_Handshake_2;
- -- Build the segment. The last segment in order to
- -- arrive will be the "header" segment
- Next_Segment.Seg_Sequence_No := Header;
- end if;
- -- pass the record to its carrier
- Next_Segment_Task.Input ( Next_Segment );
- end;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in TC_Simulate_Arrival");
- end TC_Simulate_Arrival;
-
-
- -- One of these is generated for each message segment and the flow
- -- of the segments through the system is controlled by the calls the
- -- task makes and the requeues of those calls
- --
- task body Carrier_Task is
- This_Segment : acc_Message_Segment := new Message_Segment;
- begin
- accept Input ( Segment : acc_Message_Segment ) do
- This_Segment.all := Segment.all;
- end Input;
- null; --:: stub. Pass the segment around the application as needed
-
- -- Now output the segment to the Output_Driver. First we have to
- -- go through the Sequencer.
- Sequencer.Ordering_Queue ( This_Segment );
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Carrier_Task");
- end Carrier_Task;
-
-
- -- Pull segments off the Ordering_Queue and deliver them in the correct
- -- sequence to the Output_Driver.
- --
- task body Sequencer is
- Next_Needed : Segment_Sequence := Header;
-
- TC_Await_Arrival : Boolean := true;
- TC_First_Cycle : Boolean := true;
- TC_Expected_Sequence : Segment_Sequence := Header+2;
- begin
- loop
- select
- accept Ordering_Queue ( Segment : acc_Message_Segment ) do
-
- --=====================================================
- -- This part is all Test_Control code
-
- if TC_Await_Arrival then
- -- We have to arrange that the segments arrive on the
- -- queue in the right order, so we handshake with the
- -- TC_Simulate_Arrival task to "send" only one at
- -- a time
- accept TC_Handshake_1; -- the first has arrived
- -- and has been pulled off the
- -- queue
-
- -- Wait for the second to arrive (the first has already
- -- been pulled off the queue
- while Ordering_Queue'count < 1 loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- --
- accept TC_Handshake_2; -- the second has arrived
-
- -- Wait for the third to arrive
- while Ordering_Queue'count < 2 loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- Subsequent passes through the loop, bypass this code
- TC_Await_Arrival := false;
-
-
- end if; -- await arrival
-
- if TC_First_Cycle then
- -- Check the order of the original three
- if Segment.Seg_Sequence_No /= TC_Expected_Sequence then
- -- The segments are not being pulled off in the
- -- expected sequence. This could occur if the
- -- requeue is not putting them back on the end.
- Report.Failed ("Sequencer: Segment out of sequence");
- end if; -- sequence check
- -- Decrement the expected sequence
- if TC_Expected_Sequence /= Header then
- TC_Expected_Sequence := TC_Expected_Sequence - 1;
- else
- TC_First_Cycle := false; -- This is the Header - the
- -- first two segments are
- -- back on the queue
-
- end if; -- decrementing
- end if; -- first pass
- --=====================================================
-
- -- And this is the Application code
- if Segment.Seg_Sequence_No = Next_Needed then
- if Segment.EOM then
- Next_Needed := Header; -- reset for next message
- else
- Next_Needed := Next_Needed + 1;
- end if;
- requeue Output_Driver.Input with abort;
- Report.Failed ("Requeue did not complete accept body");
- else
- -- Not the next needed - put it back on the queue
- requeue Sequencer.Ordering_Queue;
- Report.Failed ("Requeue did not complete accept body");
- end if;
- end Ordering_Queue;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Sequencer");
- end Sequencer;
-
-
- task body Output_Driver is
- This_Segment : acc_Message_Segment := new Message_Segment;
-
- TC_Expected_Sequence : Segment_Sequence := Segment_Sequence'first;
- TC_Segment_Total : integer := 0;
- TC_Expected_Total : integer := 3;
- begin
- loop
- -- Note: normally we would expect this Accept to be in a select
- -- with terminate. For the test we exit the loop on completion
- -- to give better control
- accept Input ( Segment : acc_Message_Segment ) do
- This_Segment.all := Segment.all;
- end Input;
-
- null; --::: stub - output the next segment of the message
-
- -- The following is all test control code
- --
- if This_Segment.Seg_Sequence_No /= TC_Expected_Sequence then
- Report.Failed ("Output_Driver: Segment out of sequence");
- end if;
- TC_Expected_Sequence := TC_Expected_Sequence + 1;
-
- -- Now count the number of segments
- TC_Segment_Total := TC_Segment_Total + 1;
-
- -- Check the number and exit loop when complete
- -- There must be exactly TC_Expected_Total in number and
- -- the last one must be EOM
- -- (test will hang if < TC_Expected_Total arrive
- -- without EOM)
- if This_Segment.EOM then
- -- This is the last segment.
- if TC_Segment_Total /= TC_Expected_Total then
- Report.Failed ("EOM and wrong number of segments");
- end if;
- exit; -- the loop and terminate the task
- elsif TC_Segment_Total = TC_Expected_Total then
- Report.Failed ("No EOM found");
- exit;
- end if;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Output_Driver");
- end Output_Driver;
-
-
-
- begin
-
- null;
-
- end; -- encapsulation
-
- Report.Result;
-
-end C954019;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954020.a b/gcc/testsuite/ada/acats/tests/c9/c954020.a
deleted file mode 100644
index bc08a6bd4c2..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954020.a
+++ /dev/null
@@ -1,422 +0,0 @@
--- C954020.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a call to a protected entry can be requeued to a task
--- entry. Check that the requeue is placed on the correct entry; that the
--- original caller waits for the completion of the requeue and continues
--- after the requeued rendezvous. Check that the requeue does not block.
--- Specifically, check a requeue with abort from a protected entry to
--- an entry in a task.
---
--- TEST DESCRIPTION:
---
--- In the Distributor protected object, requeue two successive calls on
--- the entries of two separate target tasks. Each task in each of the
--- paths adds identifying information in the transaction being passed.
--- This information is checked by the Message tasks on completion
--- ensuring that the requeues have been placed on the correct queues.
--- There is an artificial guard on the Credit Task to ensure that the
--- input is queued; this guard is released by the Debit task which
--- handles its input immediately. This ensures that we have one of the
--- requeued items actually queued for later handling and also verifies
--- that the requeuing process (in the protected object) is not blocked.
---
--- This series of tests uses a simulation of a transaction driven
--- processing system. Line Drivers accept input from an external source
--- and build them into transaction records. These records are then
--- encapsulated in message tasks which remain extant for the life of the
--- transaction in the system. The message tasks put themselves on the
--- input queue of a Distributor object which, from information in the
--- transaction and/or system load conditions forwards them to other
--- operating tasks. These in turn might forward the transactions to yet
--- other tasks for further action. The routing is, in real life,
--- dynamic and unpredictable at the time of message generation. All
--- rerouting in this model is done by means of requeues.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 06 Nov 95 SAIC Fixed problems for ACVC 2.0.1
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C954020 is
- Verbose : constant Boolean := False;
-
- -- Arbitrary test values
- Credit_Return : constant := 1;
- Debit_Return : constant := 2;
-
- protected type Message_Status is
- procedure Set_Complete;
- function Complete return Boolean;
- private
- Is_Complete : Boolean := False;
- end Message_Status;
-
- protected body Message_Status is
- procedure Set_Complete is
- begin
- Is_Complete := True;
- end Set_Complete;
-
- function Complete return Boolean is
- begin
- return Is_Complete;
- end Complete;
- end Message_Status;
-
- TC_Debit_Message : Message_Status;
- TC_Credit_Message : Message_Status;
-
- type Transaction_Code is (Credit, Debit);
-
- type Transaction_Record;
- type acc_Transaction_Record is access Transaction_Record;
- type Transaction_Record is
- record
- ID : integer := 0;
- Code : Transaction_Code := Debit;
- Account_Number : integer := 0;
- Stock_Number : integer := 0;
- Quantity : integer := 0;
- Return_Value : integer := 0;
- TC_Message_Count : integer := 0;
- TC_Thru_Dist : Boolean := false;
- end record;
-
-
- task type Message_Task is
- entry Accept_Transaction (In_Transaction : acc_Transaction_Record);
- end Message_Task;
- type acc_Message_Task is access Message_Task;
-
- task Line_Driver is
- entry Start;
- end Line_Driver;
-
- task Credit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Computation;
-
- task Debit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Debit_Computation;
-
- protected Time_Lock is
- procedure Credit_Start;
- function Credit_Enabled return Boolean;
- private
- Credit_OK : Boolean := false;
- end Time_Lock;
-
- protected body Time_Lock is
- procedure Credit_Start is
- begin
- Credit_OK := true;
- end Credit_Start;
-
- function Credit_Enabled return Boolean is
- begin
- return Credit_OK;
- end Credit_Enabled;
- end Time_Lock;
-
-
-
- protected Distributor is
- entry Input (Transaction : acc_Transaction_Record);
- end Distributor;
- --
- --
- -- Dispose each input Transaction_Record to the appropriate
- -- computation tasks
- --
- protected body Distributor is
- entry Input (Transaction : acc_Transaction_Record) when true is
- -- barrier is always open
- begin
- -- Test Control: Set the indicator in the message to show it has
- -- passed through the Distributor object
- Transaction.TC_thru_Dist := true;
-
- -- Pass this transaction on to the appropriate computation
- -- task
- case Transaction.Code is
- when Credit =>
- requeue Credit_Computation.Input with abort;
- when Debit =>
- requeue Debit_Computation.Input with abort;
- end case;
- end Input;
- end Distributor;
-
-
-
-
- -- Assemble messages received from an external source
- -- Creates a message task for each. The message tasks remain extant
- -- for the life of the messages in the system.
- -- The Line Driver task would normally be designed to loop continuously
- -- creating the messages as input is received. Simulate this
- -- but limit it to two dummy messages for this test and allow it
- -- to terminate at that point
- --
- task body Line_Driver is
- Current_ID : integer := 1;
- TC_Last_was_for_credit : Boolean := false;
-
- procedure Build_Credit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 100;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Credit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Credit_Record;
-
-
- procedure Build_Debit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 200;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Debit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Debit_Record;
-
- begin
-
- accept Start; -- Wait for trigger from Main
-
- for i in 1..2 loop -- arbitrarily limit to two messages for the test
- declare
- -- Create a task for the next message
- Next_Message_Task : acc_Message_Task := new Message_Task;
- -- Create a record for it
- Next_Transaction : acc_Transaction_Record
- := new Transaction_Record;
- begin
- if TC_Last_was_for_credit then
- Build_Debit_Record ( Next_Transaction );
- else
- Build_Credit_Record( Next_Transaction );
- TC_Last_was_for_credit := true;
- end if;
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- end; -- declare
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Line_Driver");
- end Line_Driver;
-
-
-
-
- task body Message_Task is
-
- TC_Original_Transaction_Code : Transaction_Code;
- This_Transaction : acc_Transaction_Record := new Transaction_Record;
-
- begin
- accept Accept_Transaction (In_Transaction : acc_Transaction_Record) do
- This_Transaction.all := In_Transaction.all;
- end Accept_Transaction;
-
- if Verbose then
- Report.Comment ("message task got " &
- Transaction_Code'Image (This_Transaction.Code));
- end if;
-
- -- Note the original code to ensure correct return
- TC_Original_Transaction_Code := This_Transaction.Code;
-
- -- Queue up on Distributor's Input queue
- Distributor.Input ( This_Transaction );
- -- This task will now wait for the requeued rendezvous
- -- to complete before proceeding
-
- -- After the required computations have been performed
- -- return the Transaction_Record appropriately (probably to an output
- -- line driver)
- null; -- stub
-
-
- -- The following is all Test Control Code
-
- -- Check that the return values are as expected
- if TC_Original_Transaction_Code /= This_Transaction.Code then
- -- Incorrect rendezvous
- Report.Failed ("Message Task: Incorrect code returned");
- end if;
-
- if This_Transaction.Code = Credit then
- if This_Transaction.Return_Value /= Credit_Return or
- This_Transaction.TC_Message_Count /= 1 or
- not This_Transaction.TC_thru_Dist then
- Report.Failed ("Expected path not traversed");
- end if;
- TC_Credit_Message.Set_Complete;
- else
- if This_Transaction.Return_Value /= Debit_Return or
- This_Transaction.TC_Message_Count /= 1 or
- not This_Transaction.TC_thru_Dist then
- Report.Failed ("Expected path not traversed");
- end if;
- TC_Debit_Message.Set_Complete;
- end if;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Message_Task");
-
- end Message_Task;
-
-
-
- -- Computation task.
- -- Note: After the computation is performed in this task and the
- -- accept body is completed the rendezvous in the original
- -- message task is completed.
- --
- task body Credit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- when Time_Lock.Credit_enabled =>
- accept Input ( Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this transaction
- null; -- stub
-
- if Verbose then
- Report.Comment ("Credit_Computation in accept");
- end if;
-
- -- For the test:
- if not Transaction.TC_thru_Dist then
- Report.Failed
- ("Credit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Credit then
- Report.Failed
- ("Credit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Credit_Return;
- -- one, and only one message should pass through
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
-
- end Input;
- exit; -- only handle 1 transaction
- else
- -- poll until we can accept credit transaction
- delay ImpDef.Clear_Ready_Queue;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Computation");
- end Credit_Computation;
-
-
-
- -- Computation task.
- -- Note: After the computation is performed in this task and the
- -- accept body is completed the rendezvous in the original
- -- message task is completed.
- --
- task body Debit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this message
- null; -- stub
-
- if Verbose then
- Report.Comment ("Debit_Computation in accept");
- end if;
-
- -- For the test:
- if not Transaction.TC_thru_Dist then
- Report.Failed
- ("Debit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Debit then
- Report.Failed
- ("Debit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Debit_Return;
- -- one, and only one, message should pass through
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
- -- for the test: once we have completed the only Debit
- -- message release the Credit Messages which are queued
- -- on the Credit Input queue
- Time_Lock.Credit_Start;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Debit_Computation");
-
-
- end Debit_Computation;
-
-
-begin -- C954020
-
- Report.Test ("C954020", "Requeue, with abort, from protected entry " &
- "to task entry");
-
- Line_Driver.Start; -- Start the test
-
- -- Ensure that the message tasks complete before reporting the result
- while not (TC_Credit_Message.Complete and TC_Debit_Message.Complete) loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- Report.Result;
-
-end C954020;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954021.a b/gcc/testsuite/ada/acats/tests/c9/c954021.a
deleted file mode 100644
index 626f2f970a2..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954021.a
+++ /dev/null
@@ -1,524 +0,0 @@
--- C954021.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a requeue within a protected entry to an entry in a
--- different protected object is queued correctly.
---
--- TEST DESCRIPTION:
--- One transaction is sent through to check the paths. After processing
--- this the Credit task sets the "overloaded" indicator. Once this
--- indicator is set the Distributor (a protected object) queues low
--- priority transactions on a Wait_for_Underload queue in another
--- protected object using a requeue. The Distributor still delivers high
--- priority transactions. After two high priority transactions have been
--- processed by the Credit task it clears the overload condition. The
--- low priority transactions should now be delivered.
---
--- This series of tests uses a simulation of a transaction driven
--- processing system. Line Drivers accept input from an external source
--- and build them into transaction records. These records are then
--- encapsulated in message tasks which remain extant for the life of the
--- transaction in the system. The message tasks put themselves on the
--- input queue of a Distributor which, from information in the
--- transaction and/or system load conditions forwards them to other
--- operating tasks. These in turn might forward the transactions to yet
--- other tasks for further action. The routing is, in real life, dynamic
--- and unpredictable at the time of message generation. All rerouting in
--- this model is done by means of requeues.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 26 Nov 95 SAIC Fixed shared global variable for ACVC 2.0.1
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C954021 is
-
- -- Arbitrary test values
- Credit_Return : constant := 1;
- Debit_Return : constant := 2;
-
-
- -- Mechanism to count the number of Credit Message tasks completed
- protected TC_Tasks_Completed is
- procedure Increment;
- function Count return integer;
- private
- Number_Complete : integer := 0;
- end TC_Tasks_Completed;
-
-
- TC_Credit_Messages_Expected : constant integer := 5;
-
- protected TC_Handshake is
- procedure Set;
- function First_Message_Arrived return Boolean;
- private
- Arrived_Flag : Boolean := false;
- end TC_Handshake;
-
- -- Handshaking mechanism between the Line Driver and the Credit task
- --
- protected body TC_Handshake is
- --
- procedure Set is
- begin
- Arrived_Flag := true;
- end Set;
- --
- function First_Message_Arrived return Boolean is
- begin
- return Arrived_Flag;
- end First_Message_Arrived;
- --
- end TC_Handshake;
-
-
- protected type Shared_Boolean (Initial_Value : Boolean := False) is
- procedure Set_True;
- procedure Set_False;
- function Value return Boolean;
- private
- Current_Value : Boolean := Initial_Value;
- end Shared_Boolean;
-
- protected body Shared_Boolean is
- procedure Set_True is
- begin
- Current_Value := True;
- end Set_True;
-
- procedure Set_False is
- begin
- Current_Value := False;
- end Set_False;
-
- function Value return Boolean is
- begin
- return Current_Value;
- end Value;
- end Shared_Boolean;
-
- TC_Debit_Message_Complete : Shared_Boolean (False);
-
- type Transaction_Code is (Credit, Debit);
- type Transaction_Priority is (High, Low);
-
- type Transaction_Record;
- type acc_Transaction_Record is access Transaction_Record;
- type Transaction_Record is
- record
- ID : integer := 0;
- Code : Transaction_Code := Debit;
- Priority : Transaction_Priority := High;
- Account_Number : integer := 0;
- Stock_Number : integer := 0;
- Quantity : integer := 0;
- Return_Value : integer := 0;
- TC_Message_Count : integer := 0;
- TC_Thru_Dist : Boolean := false;
- end record;
-
-
- task type Message_Task is
- entry Accept_Transaction (In_Transaction : acc_Transaction_Record);
- end Message_Task;
- type acc_Message_Task is access Message_Task;
-
- task Line_Driver is
- entry Start;
- end Line_Driver;
-
- protected Distributor is
- procedure Set_Credit_Overloaded;
- procedure Clear_Credit_Overloaded;
- function Credit_is_Overloaded return Boolean;
- entry Input (Transaction : acc_Transaction_Record);
- private
- Credit_Overloaded : Boolean := false;
- end Distributor;
-
- protected Hold is
- procedure Underloaded;
- entry Wait_for_Underload (Transaction : acc_Transaction_Record);
- private
- Release_All : Boolean := false;
- end Hold;
-
- task Credit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Computation;
-
- task Debit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Debit_Computation;
-
- --
- -- Dispose each input Transaction_Record to the appropriate
- -- computation tasks
- --
- protected body Distributor is
-
- procedure Set_Credit_Overloaded is
- begin
- Credit_Overloaded := true;
- end Set_Credit_Overloaded;
-
- procedure Clear_Credit_Overloaded is
- begin
- Credit_Overloaded := false;
- Hold.Underloaded; -- Release all held messages
- end Clear_Credit_Overloaded;
-
- function Credit_is_Overloaded return Boolean is
- begin
- return Credit_Overloaded;
- end Credit_is_Overloaded;
-
-
- entry Input (Transaction : acc_Transaction_Record) when true is
- -- barrier is always open
- begin
- -- Test Control: Set the indicator in the message to show it has
- -- passed through the Distributor object
- Transaction.TC_thru_Dist := true;
-
- -- Pass this transaction on to the appropriate computation
- -- task but temporarily hold low-priority transactions under
- -- overload conditions
- case Transaction.Code is
- when Credit =>
- if Credit_Overloaded and Transaction.Priority = Low then
- requeue Hold.Wait_for_Underload with abort;
- else
- requeue Credit_Computation.Input with abort;
- end if;
- when Debit =>
- requeue Debit_Computation.Input with abort;
- end case;
- end Input;
- end Distributor;
-
-
- -- Low priority Message tasks are held on the Wait_for_Underload queue
- -- while the Credit computation system is overloaded. Once the Credit
- -- system reached underload send all queued messages immediately
- --
- protected body Hold is
-
- -- Once this is executed the barrier condition for the entry is
- -- evaluated
- procedure Underloaded is
- begin
- Release_All := true;
- end Underloaded;
-
- entry Wait_for_Underload (Transaction : acc_Transaction_Record)
- when Release_All is
- begin
- requeue Credit_Computation.Input with abort;
- if Wait_for_Underload'count = 0 then
- -- Queue is purged. Set up to hold next batch
- Release_All := false;
- end if;
- end Wait_for_Underload;
-
- end Hold;
-
- -- Mechanism to count the number of Message tasks completed (Credit)
- protected body TC_Tasks_Completed is
- procedure Increment is
- begin
- Number_Complete := Number_Complete + 1;
- end Increment;
-
- function Count return integer is
- begin
- return Number_Complete;
- end Count;
- end TC_Tasks_Completed;
-
-
- -- Assemble messages received from an external source
- -- Creates a message task for each. The message tasks remain extant
- -- for the life of the messages in the system.
- -- The Line Driver task would normally be designed to loop continuously
- -- creating the messages as input is received. Simulate this
- -- but limit it to the required number of dummy messages needed for
- -- this test and allow it to terminate at that point. Artificially
- -- alternate High and Low priority Credit transactions for this test.
- --
- task body Line_Driver is
- Current_ID : integer := 1;
- Current_Priority : Transaction_Priority := High;
-
- -- Artificial: number of messages required for this test
- type TC_Trans_Range is range 1..6;
-
- procedure Build_Credit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 100;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Credit;
- Next_Transaction.Priority := Current_Priority;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Credit_Record;
-
-
- procedure Build_Debit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 200;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Debit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Debit_Record;
-
- begin
-
- accept Start; -- Wait for trigger from Main
-
- for Transaction_Numb in TC_Trans_Range loop -- TC: limit the loop
- declare
- -- Create a task for the next message
- Next_Message_Task : acc_Message_Task := new Message_Task;
- -- Create a record for it
- Next_Transaction : acc_Transaction_Record :=
- new Transaction_Record;
- begin
- if Transaction_Numb = TC_Trans_Range'first then
- -- Send the first Credit message
- Build_Credit_Record ( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- -- TC: Wait until the first message has been received by the
- -- Credit task and it has set the Overload indicator for the
- -- Distributor
- while not TC_Handshake.First_Message_Arrived loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- elsif Transaction_Numb = TC_Trans_Range'last then
- -- For this test send the last transaction to the Debit task
- -- to improve the mix
- Build_Debit_Record( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- else
- -- TC: Alternate high and low priority transactions
- if Current_Priority = High then
- Current_Priority := Low;
- else
- Current_Priority := High;
- end if;
- Build_Credit_Record( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- end if;
- end; -- declare
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Line_Driver");
- end Line_Driver;
-
-
-
-
- task body Message_Task is
-
- TC_Original_Transaction_Code : Transaction_Code;
- This_Transaction : acc_Transaction_Record := new Transaction_Record;
-
- begin
-
- accept Accept_Transaction (In_Transaction : acc_Transaction_Record) do
- This_Transaction.all := In_Transaction.all;
- end Accept_Transaction;
-
- -- Note the original code to ensure correct return
- TC_Original_Transaction_Code := This_Transaction.Code;
-
- -- Queue up on Distributor's Input queue
- Distributor.Input ( This_Transaction );
- -- This task will now wait for the requeued rendezvous
- -- to complete before proceeding
-
- -- After the required computations have been performed
- -- return the Transaction_Record appropriately (probably to an output
- -- line driver)
- null; -- stub
-
- -- For the test check that the return values are as expected
- if TC_Original_Transaction_Code /= This_Transaction.Code then
- -- Incorrect rendezvous
- Report.Failed ("Message Task: Incorrect code returned");
- end if;
-
- if This_Transaction.Code = Credit then
- if This_Transaction.Return_Value /= Credit_Return or
- not This_Transaction.TC_thru_Dist then
- Report.Failed ("Expected path not traversed - Credit");
- end if;
- TC_Tasks_Completed.Increment;
- else
- if This_Transaction.Return_Value /= Debit_Return or
- This_Transaction.TC_Message_Count /= 1 or
- not This_Transaction.TC_thru_Dist then
- Report.Failed ("Expected path not traversed - Debit");
- end if;
- TC_Debit_Message_Complete.Set_True;
- end if;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Message_Task");
- end Message_Task;
-
-
-
-
-
- -- Computation task. After the computation is performed the rendezvous
- -- in the original message task is completed.
- task body Credit_Computation is
-
- Message_Count : integer := 0;
-
- begin
- loop
- select
- accept Input ( Transaction : acc_Transaction_Record) do
- if Distributor.Credit_is_Overloaded
- and Transaction.Priority = Low then
- -- We should not be getting any Low Priority messages. They
- -- should be waiting on the Hold.Wait_for_Underload
- -- queue
- Report.Failed
- ("Credit Task: Low priority transaction during overload");
- end if;
- -- Perform the computations required for this transaction
- null; -- stub
-
- -- For the test:
- if not Transaction.TC_thru_Dist then
- Report.Failed
- ("Credit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Credit then
- Report.Failed
- ("Credit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- The following is all Test Control code:
- Transaction.Return_Value := Credit_Return;
- Message_Count := Message_Count + 1;
- --
- -- Now take special action depending on which Message
- if Message_Count = 1 then
- -- After the first message :
- Distributor.Set_Credit_Overloaded;
- -- Now flag the Line_Driver that the second and subsequent
- -- messages may now be sent
- TC_Handshake.Set;
- end if;
- if Message_Count = 3 then
- -- The two high priority transactions created subsequent
- -- to the overload have now been processed
- Distributor.Clear_Credit_Overloaded;
- end if;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Computation");
- end Credit_Computation;
-
-
-
- -- Computation task. After the computation is performed the rendezvous
- -- in the original message task is completed.
- --
- task body Debit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this message
- null; -- stub
-
- -- For the test:
- if not Transaction.TC_thru_Dist then
- Report.Failed
- ("Debit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Debit then
- Report.Failed
- ("Debit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Debit_Return;
- -- one, and only one, message should pass through
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Debit_Computation");
- end Debit_Computation;
-
-
-begin
- Report.Test ("C954021", "Requeue from one entry body to an entry in" &
- " another protected object");
-
- Line_Driver.Start; -- Start the test
-
-
- -- Ensure that the message tasks have completed before reporting result
- while (TC_Tasks_Completed.Count < TC_Credit_Messages_Expected)
- and not TC_Debit_Message_Complete.Value loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- Report.Result;
-
-end C954021;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954022.a b/gcc/testsuite/ada/acats/tests/c9/c954022.a
deleted file mode 100644
index 5ebff8dcb0f..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954022.a
+++ /dev/null
@@ -1,351 +0,0 @@
--- C954022.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- In an entry body requeue the call to the same entry. Check that the
--- items go to the right queue and that they are placed back on the end
--- of the queue
---
--- TEST DESCRIPTION:
--- Simulate part of a message handling application where the messages are
--- composed of several segments. The sequence of the segments within the
--- message is specified by Seg_Sequence_No. The segments are handled by
--- different tasks and finally forwarded to an output driver. The
--- segments can arrive in any order but must be assembled into the proper
--- sequence for final output. There is a Sequencer task interposed
--- before the Driver. This takes the segments of the message off the
--- Ordering_Queue and those that are in the right order it sends on to
--- the driver; those that are out of order it places back on the end of
--- the queue.
---
--- The test just simulates the arrival of the segments at the Sequencer.
--- The task generating the segments handshakes with the Sequencer during
--- the "Await Arrival" phase ensuring that the three segments of a
--- message arrive in REVERSE order (the End-of-Message segment arrives
--- first and the Header last). In the first cycle the sequencer pulls
--- segments off the queue and puts them back on the end till it
--- encounters the header. It checks the sequence of the ones it pulls
--- off in case the segments are being put back on in the wrong part of
--- the queue. Having cycled once through it no longer verifies the
--- sequence - it just executes the "application" code for the correct
--- order for dispatch to the driver.
---
--- In this simple example no attempt is made to address segments of
--- another message arriving or any other error conditions (such as
--- missing segments, timing etc.)
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 07 Nov 95 SAIC ACVC 2.0.1
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C954022 is
-
- -- These global Booleans are set when failure conditions inside Protected
- -- objects are encountered. Report.Failed cannot be called within
- -- the object or a Bounded Error would occur
- --
- TC_Failed_1 : Boolean := false;
- TC_Failed_2 : Boolean := false;
- TC_Failed_3 : Boolean := false;
-
-begin
-
-
- Report.Test ("C954022", "Check Requeue to the same Protected Entry");
-
- declare -- encapsulate the test
-
- type Segment_Sequence is range 1..8;
- Header : constant Segment_Sequence := Segment_Sequence'first;
-
- type Message_Segment is record
- ID : integer; -- Message ID
- Seg_Sequence_No : Segment_Sequence; -- Within the message
- Segs_In_Message : integer; -- Total segs this message
- EOM : Boolean := false; -- true for final msg segment
- Alpha : string (1..128);
- end record;
- type acc_Message_Segment is access Message_Segment;
-
- task TC_Simulate_Arrival;
-
- task type Carrier_Task is
- entry Input ( Segment : acc_Message_Segment );
- end Carrier_Task;
- type acc_Carrier_Task is access Carrier_Task;
-
- protected Sequencer is
- function TC_Arrivals return integer;
- entry Input ( Segment : acc_Message_Segment );
- entry Ordering_Queue ( Segment : acc_Message_Segment );
- private
- Number_of_Segments_Arrived : integer := 0;
- Number_of_Segments_Expected : integer := 0;
- Next_Needed : Segment_Sequence := Header;
- All_Segments_Arrived : Boolean := false;
- Seen_EOM : Boolean := false;
-
- TC_First_Cycle : Boolean := true;
- TC_Expected_Sequence : Segment_Sequence := Header+2;
-
- end Sequencer;
-
-
- task Output_Driver is
- entry Input ( Segment : acc_Message_Segment );
- end Output_Driver;
-
-
- -- Simulate the arrival of three message segments in REVERSE order
- --
- task body TC_Simulate_Arrival is
- begin
- for i in 1..3 loop
- declare
- -- Create a task for the next message segment
- Next_Segment_Task : acc_Carrier_Task := new Carrier_Task;
- -- Create a record for the next segment
- Next_Segment : acc_Message_Segment := new Message_Segment;
- begin
- if i = 1 then
- -- Build the EOM segment as the first to "send"
- Next_Segment.Seg_Sequence_No := Header + 2;
- Next_Segment.Segs_In_Message := 3;
- Next_Segment.EOM := true;
- elsif i = 2 then
- -- Wait for the first segment to arrive at the Sequencer
- -- before "sending" the second
- while Sequencer.TC_Arrivals < 1 loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- -- Build the segment
- Next_Segment.Seg_Sequence_No := Header +1;
- else
- -- Wait for the second segment to arrive at the Sequencer
- -- before "sending" the third
- while Sequencer.TC_Arrivals < 2 loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- -- Build the segment. The last segment (in order) to
- -- arrive will be the "header" segment
- Next_Segment.Seg_Sequence_No := Header;
- end if;
- -- pass the record to its carrier
- Next_Segment_Task.Input ( Next_Segment );
- end;
- end loop;
-
-
- exception
- when others =>
- Report.Failed ("Unexpected Exception in TC_Simulate_Arrival");
- end TC_Simulate_Arrival;
-
-
- -- One of these is generated for each message segment and the flow
- -- of the segments through the system is controlled by the calls the
- -- task makes and the requeues of those calls
- --
- task body Carrier_Task is
- This_Segment : acc_Message_Segment := new Message_Segment;
- begin
- accept Input ( Segment : acc_Message_Segment ) do
- This_Segment.all := Segment.all;
- end Input;
- null; --:: stub. Pass the segment around the application as needed
-
- -- Now output the segment to the Output_Driver. First we have to
- -- go through the Sequencer.
- Sequencer.Input ( This_Segment );
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Carrier_Task");
- end Carrier_Task;
-
- -- Store segments on the Ordering_Queue then deliver them in the correct
- -- sequence to the Output_Driver.
- --
- protected body Sequencer is
-
- function TC_Arrivals return integer is
- begin
- return Number_of_Segments_Arrived;
- end TC_Arrivals;
-
-
- -- Segments arriving at the Input queue are counted and checked
- -- against the total number of segments for the message. They
- -- are requeued onto the ordering queue where they are held until
- -- all the segments have arrived.
- entry Input ( Segment : acc_Message_Segment ) when true is
- begin
- -- check for EOM, if so get the number of segments in the message
- -- Note: in this portion of code no attempt is made to address
- -- reset for new message , end conditions, missing segments,
- -- segments of a different message etc.
- Number_of_Segments_Arrived := Number_of_Segments_Arrived + 1;
- if Segment.EOM then
- Number_of_Segments_Expected := Segment.Segs_In_Message;
- Seen_EOM := true;
- end if;
-
- if Seen_EOM then
- if Number_of_Segments_Arrived = Number_of_Segments_Expected then
- -- This is the last segment for this message
- All_Segments_Arrived := true; -- clear the barrier
- end if;
- end if;
-
- requeue Ordering_Queue;
-
- -- At this exit point the entry queue barriers are evaluated
-
- end Input;
-
-
- entry Ordering_Queue ( Segment : acc_Message_Segment )
- when All_Segments_Arrived is
- begin
-
- --=====================================================
- -- This part is all Test_Control code
-
- if TC_First_Cycle then
- -- Check the order of the original three
- if Segment.Seg_Sequence_No /= TC_Expected_Sequence then
- -- The segments are not being pulled off in the
- -- expected sequence. This could occur if the
- -- requeue is not putting them back on the end.
- TC_Failed_3 := true;
- end if; -- sequence check
- -- Decrement the expected sequence
- if TC_Expected_Sequence /= Header then
- TC_Expected_Sequence := TC_Expected_Sequence - 1;
- else
- TC_First_Cycle := false; -- This is the Header - the
- -- first two segments are
- -- back on the queue
- end if; -- decrementing
- end if; -- first cycle
- --=====================================================
-
- -- And this is the Application code
- if Segment.Seg_Sequence_No = Next_Needed then
- if Segment.EOM then
- Next_Needed := Header; -- reset for next message
- -- :: other resets not shown
- else
- Next_Needed := Next_Needed + 1;
- end if;
- requeue Output_Driver.Input with abort;
- -- set to Report Failed - Requeue did not complete entry body
- TC_Failed_1 := true;
- else
- -- Not the next needed - put it back on the queue
- -- NOTE: here we are requeueing to the same entry
- requeue Sequencer.Ordering_Queue;
- -- set to Report Failed - Requeue did not complete entry body
- TC_Failed_2 := true;
- end if;
- end Ordering_Queue;
- end Sequencer;
-
-
- task body Output_Driver is
- This_Segment : acc_Message_Segment := new Message_Segment;
-
- TC_Expected_Sequence : Segment_Sequence := Segment_Sequence'first;
- TC_Segment_Total : integer := 0;
- TC_Expected_Total : integer := 3;
- begin
- loop
- -- Note: normally we would expect this Accept to be in a select
- -- with terminate. For the test we exit the loop on completion
- -- to give better control
- accept Input ( Segment : acc_Message_Segment ) do
- This_Segment.all := Segment.all;
- end Input;
-
- null; --::: stub - output the next segment of the message
-
- -- The following is all test control code
- --
- if This_Segment.Seg_Sequence_No /= TC_Expected_Sequence then
- Report.Failed ("Output_Driver: Segment out of sequence");
- end if;
- TC_Expected_Sequence := TC_Expected_Sequence + 1;
-
- -- Now count the number of segments
- TC_Segment_Total := TC_Segment_Total + 1;
-
- -- Check the number and exit loop when complete
- -- There must be exactly TC_Expected_Total in number and
- -- the last one must be EOM
- -- (test will hang if < TC_Expected_Total arrive
- -- without EOM)
- if This_Segment.EOM then
- -- This is the last segment.
- if TC_Segment_Total /= TC_Expected_Total then
- Report.Failed ("EOM and wrong number of segments");
- end if;
- exit; -- the loop and terminate the task
- elsif TC_Segment_Total = TC_Expected_Total then
- Report.Failed ("No EOM found");
- exit;
- end if;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in Output_Driver");
- end Output_Driver;
-
-
- begin
-
- null;
-
- end; -- encapsulation
-
- if TC_Failed_1 then
- Report.Failed ("Requeue did not complete entry body - 1");
- end if;
-
- if TC_Failed_2 then
- Report.Failed ("Requeue did not complete entry body - 2");
- end if;
-
- if TC_Failed_3 then
- Report.Failed ("Sequencer: Segment out of sequence");
- end if;
-
- Report.Result;
-
-end C954022;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954023.a b/gcc/testsuite/ada/acats/tests/c9/c954023.a
deleted file mode 100644
index bfa69dc6054..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954023.a
+++ /dev/null
@@ -1,558 +0,0 @@
--- C954023.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a requeue within a protected entry to a family of entries
--- in a different protected object is queued correctly
--- Call with parameters
--- Requeue with abort
---
--- TEST DESCRIPTION:
--- One transaction is sent through to check the paths. After processing
--- this, the Credit task sets the "overloaded" indicator. Once this
--- indicator is set the Distributor (a protected object) queues lower
--- priority transactions on a family of queues (Wait_for_Underload) in
--- another protected object using a requeue. The Distributor still
--- delivers high priority transactions. After two more high priority
--- transactions have been processed by the Credit task the artificial
--- test code clears the overload condition to the threshold level that
--- allows only the items on the Medium priority queue of the family to be
--- released. When these have been processed and checked the test code
--- then lowers the priority threshold once again, allowing the Low
--- priority items from the last queue in the family to be released,
--- processed and checked. Note: the High priority queue in the family is
--- not used.
---
--- This series of tests uses a simulation of a transaction driven
--- processing system. Line Drivers accept input from an external source
--- and build them into transaction records. These records are then
--- encapsulated in message tasks which remain extant for the life of the
--- transaction in the system. The message tasks put themselves on the
--- input queue of a Distributor which, from information in the
--- transaction and/or system load conditions forwards them to other
--- operating tasks. These in turn might forward the transactions to yet
--- other tasks for further action. The routing is, in real life, dynamic
--- and unpredictable at the time of message generation. All rerouting in
--- this model is done by means of requeues.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C954023 is
-
- -- Artificial: number of messages required for this test
- subtype TC_Trans_Range is integer range 1..8;
-
- TC_Credit_Messages_Expected : constant integer
- := TC_Trans_Range'Last - 1;
-
- TC_Debit_Message_Complete : Boolean := false;
-
-
- -- Mechanism for handshaking between tasks
- protected TC_PO is
- procedure Increment_Tasks_Completed_Count;
- function Tasks_Completed_Count return integer;
- function First_Message_Has_Arrived return Boolean;
- procedure Set_First_Message_Has_Arrived;
- private
- Number_Complete : integer := 0;
- Message_Arrived_Flag : Boolean := false;
- end TC_PO;
- --
- protected body TC_PO is
- procedure Increment_Tasks_Completed_Count is
- begin
- Number_Complete := Number_Complete + 1;
- end Increment_Tasks_Completed_Count;
-
- function Tasks_Completed_Count return integer is
- begin
- return Number_Complete;
- end Tasks_Completed_Count;
-
- function First_Message_Has_Arrived return Boolean is
- begin
- return Message_Arrived_Flag;
- end First_Message_Has_Arrived;
-
- procedure Set_First_Message_Has_Arrived is
- begin
- Message_Arrived_Flag := true;
- end Set_First_Message_Has_Arrived;
-
- end TC_PO;
-
-begin
-
- Report.Test ("C954023", "Requeue from within a protected object" &
- " to a family of entries in another protected object");
-
-
- declare -- encapsulate the test
-
- -- Arbitrary test values
- Credit_Return : constant := 1;
- Debit_Return : constant := 2;
-
- type Transaction_Code is (Credit, Debit);
- type App_Priority is (Low, Medium, High);
- type Priority_Block is array (App_Priority) of Boolean;
-
- type Transaction_Record;
- type acc_Transaction_Record is access Transaction_Record;
- type Transaction_Record is
- record
- ID : integer := 0;
- Code : Transaction_Code := Debit;
- Priority : App_Priority := High;
- Account_Number : integer := 0;
- Stock_Number : integer := 0;
- Quantity : integer := 0;
- Return_Value : integer := 0;
- TC_Message_Count : integer := 0;
- TC_Thru_Distrib : Boolean := false;
- end record;
-
-
- task type Message_Task is
- entry Accept_Transaction (In_Transaction : acc_Transaction_Record);
- end Message_Task;
- type acc_Message_Task is access Message_Task;
-
- task Line_Driver is
- entry Start;
- end Line_Driver;
-
- protected Distributor is
- procedure Set_Credit_Overloaded;
- procedure Clear_Overload_to_Medium;
- procedure Clear_Overload_to_Low;
- entry Input (Transaction : acc_Transaction_Record);
- private
- Credit_Overloaded : Boolean := false;
- end Distributor;
-
- protected Hold is
- procedure Release_Medium;
- procedure Release_Low;
- -- Family of entry queues indexed by App_Priority
- entry Wait_for_Underload (App_Priority)
- (Transaction : acc_Transaction_Record);
- private
- Release : Priority_Block := (others => false);
- end Hold;
-
- task Credit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Computation;
-
- task Debit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Debit_Computation;
-
- --
- -- Dispose each input Transaction_Record to the appropriate
- -- computation tasks
- --
- protected body Distributor is
-
- procedure Set_Credit_Overloaded is
- begin
- Credit_Overloaded := true;
- end Set_Credit_Overloaded;
-
- procedure Clear_Overload_to_Medium is
- begin
- Credit_Overloaded := false;
- Hold.Release_Medium; -- Release all held messages on Medium
- -- priority queue
- end Clear_Overload_to_Medium;
-
- procedure Clear_Overload_to_Low is
- begin
- Credit_Overloaded := false;
- Hold.Release_Low; -- Release all held messages on Low
- -- priority queue
- end Clear_Overload_to_Low;
-
-
-
- entry Input (Transaction : acc_Transaction_Record) when true is
- -- barrier is always open
- begin
- -- Test Control: Set the indicator in the message to show it has
- -- passed through the Distributor object
- Transaction.TC_thru_Distrib := true;
-
- -- Pass this transaction on to the appropriate computation
- -- task but temporarily hold low-priority transactions under
- -- overload conditions
- case Transaction.Code is
- when Credit =>
- if Credit_Overloaded and Transaction.Priority /= High then
- -- use the appropriate queue in the family
- requeue Hold.Wait_for_Underload(Transaction.Priority)
- with abort;
- else
- requeue Credit_Computation.Input with abort;
- end if;
- when Debit =>
- requeue Debit_Computation.Input with abort;
- end case;
- end Input;
- end Distributor;
-
-
- -- Low priority Message tasks are held on the Wait_for_Underload queue
- -- while the Credit computation system is overloaded. Once the Credit
- -- system reached underload send all queued messages immediately
- --
- protected body Hold is
-
- -- Once these are executed the barrier conditions for the entries
- -- are evaluated
- procedure Release_Medium is
- begin
- Release(Medium) := true;
- end Release_Medium;
- --
- procedure Release_Low is
- begin
- Release(Low) := true;
- end Release_Low;
-
- -- This is a family of entry queues indexed by App_Priority
- entry Wait_for_Underload (for AP in App_Priority)
- (Transaction : acc_Transaction_Record)
- when Release(AP) is
- begin
- requeue Credit_Computation.Input with abort;
- if Wait_for_Underload(AP)'count = 0 then
- -- Queue is purged. Set up to hold next batch
- Release(AP) := false;
- end if;
- end Wait_for_Underload;
-
- end Hold;
-
-
-
-
- -- Assemble messages received from an external source
- -- Creates a message task for each. The message tasks remain extant
- -- for the life of the messages in the system.
- -- The Line Driver task would normally be designed to loop
- -- creating the messages as input is received. Simulate this
- -- but limit it to the required number of dummy messages needed for
- -- this test and allow it to terminate at that point. Artificially
- -- cycle the generation of High medium and Low priority Credit
- -- transactions for this test. Send out one final Debit message
- --
- task body Line_Driver is
- Current_ID : integer := 1;
- Current_Priority : App_Priority := High;
-
- procedure Build_Credit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 100;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Credit;
- Next_Transaction.Priority := Current_Priority;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Credit_Record;
-
-
- procedure Build_Debit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 200;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Debit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Debit_Record;
-
- begin
-
- for Transaction_Numb in TC_Trans_Range loop -- TC: limit the loop
- declare
- -- Create a task for the next message
- Next_Message_Task : acc_Message_Task := new Message_Task;
- -- Create a record for it
- Next_Transaction : acc_Transaction_Record :=
- new Transaction_Record;
- begin
- if Transaction_Numb = TC_Trans_Range'first then
- -- Send the first Credit message
- Build_Credit_Record ( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- -- TC: Wait until the first message has been received by the
- -- Credit task and it has set the Overload indicator for the
- -- Distributor
- while not TC_PO.First_Message_Has_Arrived loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- elsif Transaction_Numb = TC_Trans_Range'last then
- -- For this test send the last transaction to the Debit task
- -- to improve the mix
- Build_Debit_Record( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- else
- -- TC: Cycle generation of high medium and low priority
- -- transactions
- if Current_Priority = High then
- Current_Priority := Medium;
- elsif
- Current_Priority = Medium then
- Current_Priority := Low;
- else
- Current_Priority := High;
- end if;
- Build_Credit_Record( Next_Transaction );
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- end if;
- end; -- declare
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Line_Driver");
- end Line_Driver;
-
-
-
-
- task body Message_Task is
-
- TC_Original_Transaction_Code : Transaction_Code;
- This_Transaction : acc_Transaction_Record := new Transaction_Record;
-
- begin
-
- accept Accept_Transaction(In_Transaction : acc_Transaction_Record) do
- This_Transaction.all := In_Transaction.all;
- end Accept_Transaction;
-
- -- Note the original code to ensure correct return
- TC_Original_Transaction_Code := This_Transaction.Code;
-
- -- Queue up on Distributor's Input queue
- Distributor.Input ( This_Transaction );
- -- This task will now wait for the requeued rendezvous
- -- to complete before proceeding
-
- -- After the required computations have been performed
- -- return the Transaction_Record appropriately (probably to an output
- -- line driver)
- null; -- stub
-
- -- For the test check that the return values are as expected
- if TC_Original_Transaction_Code /= This_Transaction.Code then
- -- Incorrect rendezvous
- Report.Failed ("Message Task: Incorrect code returned");
- end if;
-
- if This_Transaction.Code = Credit then
- if This_Transaction.Return_Value /= Credit_Return or
- not This_Transaction.TC_thru_Distrib then
- Report.Failed ("Expected path not traversed - Credit");
- end if;
- TC_PO.Increment_Tasks_Completed_Count;
- else
- if This_Transaction.Return_Value /= Debit_Return or
- This_Transaction.TC_Message_Count /= 1 or
- not This_Transaction.TC_thru_Distrib then
- Report.Failed ("Expected path not traversed - Debit");
- end if;
- TC_Debit_Message_Complete := true;
- end if;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Message_Task");
- end Message_Task;
-
-
-
-
-
- -- Computation task. After the computation is performed the rendezvous
- -- in the original message task is completed.
- task body Credit_Computation is
-
- Message_Count : integer := 0;
-
- begin
- loop
- select
- accept Input ( Transaction : acc_Transaction_Record) do
-
- -- Perform the computations required for this transaction
- null; -- stub
-
-
- -- The following is all Test Control code:
-
- if not Transaction.TC_thru_Distrib then
- Report.Failed
- ("Credit Task: Wrong queue, Distributor bypassed");
- end if;
-
- if Transaction.code /= Credit then
- Report.Failed
- ("Credit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- This is checked by the Message_Task:
- Transaction.Return_Value := Credit_Return;
-
- -- Now take special action depending on which Message.
- -- Note: The count gives the order in which the messages are
- -- arriving at this task NOT the order in which they
- -- were originally generated and sent out.
-
- Message_Count := Message_Count + 1;
-
- if Message_Count < 4 then
- -- This is one of the first three messages which must
- -- be High priority because we will set "Overload" after
- -- the first, which is known to be High. The lower
- -- priority should be waiting on the queues
- if Transaction.Priority /= High then
- Report.Failed
- ("Credit Task: Lower priority trans. during overload");
- end if;
- if Message_Count = 1 then
- -- After the first message :
- Distributor.Set_Credit_Overloaded;
- -- Now flag the Line_Driver that the second and
- -- subsequent messages may now be sent
- TC_PO.Set_First_Message_Has_Arrived;
- elsif
- Message_Count = 3 then
- -- The two high priority transactions created
- -- subsequent to the overload have now been processed,
- -- release the Medium priority items
- Distributor.Clear_Overload_to_Medium;
- end if;
- elsif Message_Count < 6 then
- -- This must be one of the Medium priority messages
- if Transaction.Priority /= Medium then
- Report.Failed
- ("Credit Task: Second group not Medium Priority");
- end if;
- if Message_Count = 5 then
- -- The two medium priority transactions
- -- have now been processed - release the
- -- Low priority items
- Distributor.Clear_Overload_to_Low;
- end if;
- elsif Message_Count < TC_Trans_Range'Last then
- -- This must be one of the Low priority messages
- if Transaction.Priority /= Low then
- Report.Failed
- ("Credit Task: Third group not Low Priority");
- end if;
- else
- -- Too many transactions have arrived. Duplicates?
- -- the Debit transaction?
- Report.Failed
- ("Credit Task: Too many transactions");
- end if;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Computation");
- end Credit_Computation;
-
-
-
- -- Computation task. After the computation is performed the rendezvous
- -- in the original message task is completed.
- --
- task body Debit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this message
- null; -- stub
-
- -- For the test:
- if not Transaction.TC_thru_Distrib then
- Report.Failed
- ("Debit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Debit then
- Report.Failed
- ("Debit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Debit_Return;
- -- one, and only one, message should pass through
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Debit_Computation");
- end Debit_Computation;
-
-
- begin -- declare
-
- null;
-
- end; -- declare (test encapsulation)
-
- if (TC_PO.Tasks_Completed_Count /= TC_Credit_Messages_Expected)
- and not TC_Debit_Message_Complete then
- Report.Failed ("Incorrect number of Message Tasks completed");
- end if;
-
- Report.Result;
-
-end C954023;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954024.a b/gcc/testsuite/ada/acats/tests/c9/c954024.a
deleted file mode 100644
index 7f19a818322..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954024.a
+++ /dev/null
@@ -1,380 +0,0 @@
--- C954024.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a call to a protected entry can be requeued to a task
--- entry. Check that the requeue is placed on the correct entry; that the
--- original caller waits for the completion of the requeue and continues
--- after the requeued rendezvous. Check that the requeue does not block.
--- Specifically, check a requeue without abort from a protected entry to
--- an entry in a task.
---
--- TEST DESCRIPTION:
--- In the Distributor protected object, requeue two successive calls on
--- the entries of two separate target tasks. Each task in each of the
--- paths adds identifying information in the transaction being passed.
--- This information is checked by the Message tasks on completion
--- ensuring that the requeues have been placed on the correct queues.
--- There is an artificial guard on the Credit Task to ensure that the
--- input is queued; this guard is released by the Debit task which
--- handles its input immediately. This ensures that we have one of the
--- requeued items actually queued for later handling and also verifies
--- that the requeuing process (in the protected object) is not blocked.
---
--- This series of tests uses a simulation of a transaction driven
--- processing system. Line Drivers accept input from an external source
--- and build them into transaction records. These records are then
--- encapsulated in message tasks which remain extant for the life of the
--- transaction in the system. The message tasks put themselves on the
--- input queue of a Distributor object which, from information in the
--- transaction and/or system load conditions forwards them to other
--- operating tasks. These in turn might forward the transactions to yet
--- other tasks for further action. The routing is, in real life,
--- dynamic and unpredictable at the time of message generation. All
--- rerouting in this model is done by means of requeues.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 08 Nov 95 SAIC Fixed reported problems for ACVC 2.0.1
---
---!
-
-with Report;
-with ImpDef;
-procedure C954024 is
-
-
-begin -- C954024
-
- Report.Test ("C954024", "Requeue from protected entry to task entry");
-
- declare -- encapsulate the test
-
- -- Arbitrary test values
- Credit_Return : constant := 1;
- Debit_Return : constant := 2;
-
- type Transaction_Code is (Credit, Debit);
-
- type Transaction_Record;
- type acc_Transaction_Record is access Transaction_Record;
- type Transaction_Record is
- record
- ID : integer := 0;
- Code : Transaction_Code := Debit;
- Account_Number : integer := 0;
- Stock_Number : integer := 0;
- Quantity : integer := 0;
- Return_Value : integer := 0;
- TC_Message_Count : integer := 0;
- TC_Thru_Dist : Boolean := false;
- end record;
-
-
- task type Message_Task is
- entry Accept_Transaction (In_Transaction : acc_Transaction_Record);
- end Message_Task;
- type acc_Message_Task is access Message_Task;
-
- task Line_Driver is
- entry Start;
- end Line_Driver;
-
- task Credit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Credit_Computation;
-
- task Debit_Computation is
- entry Input(Transaction : acc_Transaction_Record);
- end Debit_Computation;
-
- protected Time_Lock is
- procedure Credit_Start;
- function Credit_Enabled return Boolean;
- private
- Credit_OK : Boolean := false;
- end Time_Lock;
-
- protected body Time_Lock is
- procedure Credit_Start is
- begin
- Credit_OK := true;
- end Credit_Start;
-
- function Credit_Enabled return Boolean is
- begin
- return Credit_OK;
- end Credit_Enabled;
- end Time_Lock;
-
-
-
- protected Distributor is
- entry Input (Transaction : acc_Transaction_Record);
- end Distributor;
- --
- --
- -- Dispose each input Transaction_Record to the appropriate
- -- computation tasks
- --
- protected body Distributor is
- entry Input (Transaction : acc_Transaction_Record) when true is
- -- barrier is always open
- begin
- -- Test Control: Set the indicator in the message to show it has
- -- passed through the Distributor object
- Transaction.TC_thru_Dist := true;
-
- -- Pass this transaction on to the appropriate computation
- -- task
- case Transaction.Code is
- when Credit =>
- requeue Credit_Computation.Input;
- when Debit =>
- requeue Debit_Computation.Input;
- end case;
- end Input;
- end Distributor;
-
-
-
-
- -- Assemble messages received from an external source
- -- Creates a message task for each. The message tasks remain extant
- -- for the life of the messages in the system.
- -- NOTE:
- -- The Line Driver task would normally be designed to loop continuously
- -- creating the messages as input is received. Simulate this
- -- but limit it to two dummy messages for this test and allow it
- -- to terminate at that point
- --
- task body Line_Driver is
- Current_ID : integer := 1;
- TC_Last_was_for_credit : Boolean := false;
-
- procedure Build_Credit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 100;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Credit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Credit_Record;
-
-
- procedure Build_Debit_Record
- ( Next_Transaction : acc_Transaction_Record ) is
- Dummy_Account : constant integer := 200;
- begin
- Next_Transaction.ID := Current_ID;
- Next_Transaction.Code := Debit;
-
- Next_Transaction.Account_Number := Dummy_Account;
- Current_ID := Current_ID + 1;
- end Build_Debit_Record;
-
- begin
-
- accept Start; -- Wait for trigger from Main
-
- for i in 1..2 loop -- arbitrarily limit to two messages for the test
- declare
- -- Create a task for the next message
- Next_Message_Task : acc_Message_Task := new Message_Task;
- -- Create a record for it
- Next_Transaction : acc_Transaction_Record
- := new Transaction_Record;
- begin
- if TC_Last_was_for_credit then
- Build_Debit_Record ( Next_Transaction );
- else
- Build_Credit_Record( Next_Transaction );
- TC_Last_was_for_credit := true;
- end if;
- Next_Message_Task.Accept_Transaction ( Next_Transaction );
- end; -- declare
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Line_Driver");
- end Line_Driver;
-
-
-
-
- task body Message_Task is
-
- TC_Original_Transaction_Code : Transaction_Code;
- This_Transaction : acc_Transaction_Record := new Transaction_Record;
-
- begin
- accept Accept_Transaction
- (In_Transaction : acc_Transaction_Record) do
- This_Transaction.all := In_Transaction.all;
- end Accept_Transaction;
-
- -- Note the original code to ensure correct return
- TC_Original_Transaction_Code := This_Transaction.Code;
-
- -- Queue up on Distributor's Input queue
- Distributor.Input ( This_Transaction );
- -- This task will now wait for the requeued rendezvous
- -- to complete before proceeding
-
- -- After the required computations have been performed
- -- return the Transaction_Record appropriately (probably to an output
- -- line driver)
- null; -- stub
-
-
- -- The following is all Test Control Code
-
- -- Check that the return values are as expected
- if TC_Original_Transaction_Code /= This_Transaction.Code then
- -- Incorrect rendezvous
- Report.Failed ("Message Task: Incorrect code returned");
- end if;
-
- if This_Transaction.Code = Credit then
- if This_Transaction.Return_Value /= Credit_Return or
- This_Transaction.TC_Message_Count /= 1 or
- not This_Transaction.TC_thru_Dist then
- Report.Failed ("Expected path not traversed");
- end if;
- else
- if This_Transaction.Return_Value /= Debit_Return or
- This_Transaction.TC_Message_Count /= 1 or
- not This_Transaction.TC_thru_Dist then
- Report.Failed ("Expected path not traversed");
- end if;
- end if;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Message_Task");
-
- end Message_Task;
-
-
-
- -- Computation task.
- -- Note: After the computation is performed in this task and the
- -- accept body is completed the rendezvous in the original
- -- message task is completed.
- --
- task body Credit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- when Time_Lock.Credit_enabled =>
- accept Input ( Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this transaction
- null; -- stub
-
- -- For the test:
- if not Transaction.TC_thru_Dist then
- Report.Failed
- ("Credit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Credit then
- Report.Failed
- ("Credit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Credit_Return;
- -- one, and only one message should pass through
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
- end Input;
- exit; -- one message is enough
- else
- delay ImpDef.Clear_Ready_Queue; -- poll
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Credit_Computation");
- end Credit_Computation;
-
-
-
- -- Computation task.
- -- Note: After the computation is performed in this task and the
- -- accept body is completed the rendezvous in the original
- -- message task is completed.
- --
- task body Debit_Computation is
- Message_Count : integer := 0;
- begin
- loop
- select
- accept Input (Transaction : acc_Transaction_Record) do
- -- Perform the computations required for this message
- null; -- stub
-
- -- For the test:
- if not Transaction.TC_thru_Dist then
- Report.Failed
- ("Debit Task: Wrong queue, Distributor bypassed");
- end if;
- if Transaction.code /= Debit then
- Report.Failed
- ("Debit Task: Requeue delivered to the wrong queue");
- end if;
-
- -- for the test plug a known value and count
- Transaction.Return_Value := Debit_Return;
- -- one, and only one, message should pass through
- Message_Count := Message_Count + 1;
- Transaction.TC_Message_Count := Message_Count;
- -- for the test: once we have completed the only Debit
- -- message release the Credit Messages which are queued
- -- on the Credit Input queue
- Time_Lock.Credit_Start;
-
- end Input;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Debit_Computation");
-
- end Debit_Computation;
-
- begin -- declare block
- Line_Driver.Start;
- end; -- test encapsulation
-
- Report.Result;
-
-end C954024;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954025.a b/gcc/testsuite/ada/acats/tests/c9/c954025.a
deleted file mode 100644
index f48d4cd9096..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954025.a
+++ /dev/null
@@ -1,237 +0,0 @@
--- C954025.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the original entry call was a conditional entry call,
--- the call is cancelled if a requeue-with-abort of the call is not
--- selected immediately.
--- Check that if the original entry call was a timed entry call, the
--- expiration time for a requeue-with-abort is the original expiration
--- time.
---
--- TEST DESCRIPTION:
--- This test declares two tasks: Launch_Control and Mission_Control.
--- Mission_Control instructs Launch_Control to start its countdown
--- and then requeues (with abort) to the Launch_Control.Launch
--- entry. This call to Launch will be accepted at the end of the
--- countdown (if the task is still waiting).
--- The main task does an unconditional, conditional, and timed
--- entry call to Mission_Control and checks to see if the launch
--- was accepted.
---
---
--- CHANGE HISTORY:
--- 18 OCT 95 SAIC ACVC 2.1
--- 10 JUL 96 SAIC Incorporated reviewer's comments.
---
---!
-
-with Calendar; use type Calendar.Time;
-with Report;
-with ImpDef;
-procedure C954025 is
- Verbose : constant Boolean := False;
- Countdown_Amount : constant Duration := 2.0 * Impdef.One_Second;
- Plenty_Of_Time : constant Duration :=
- Countdown_Amount + ImpDef.Clear_Ready_Queue + 1.0 * Impdef.One_Second;
- Not_Enough_Time : constant Duration :=
- Countdown_Amount - 0.5 * Impdef.One_Second;
-begin
- Report.Test ("C954025",
- "Check that if the original entry" &
- " call was a conditional or timed entry call, the" &
- " expiration time for a requeue with abort is the" &
- " original expiration time");
- declare
- -- note that the following object is a shared object and its use
- -- governed by the rules of 9.10(3,4,8);6.0
- Launch_Accepted : Boolean := False;
-
- task Launch_Control is
- entry Enable_Launch_Control;
- entry Start_Countdown (How_Long : Duration);
- -- Launch will be accepted if a call is waiting when the countdown
- -- reaches 0
- entry Launch;
- end Launch_Control;
-
- task body Launch_Control is
- Wait_Amount : Duration := 0.0;
- begin
- loop
- select
- accept Enable_Launch_Control do
- Launch_Accepted := False;
- end Enable_Launch_Control;
- or
- terminate;
- end select;
-
- accept Start_Countdown (How_Long : Duration) do
- Wait_Amount := How_Long;
- end Start_Countdown;
-
- delay Wait_Amount;
-
- select
- accept Launch do
- Launch_Accepted := True;
- end Launch;
- else
- null;
- -- note that Launch_Accepted is False here
- end select;
- end loop;
- end Launch_Control;
-
- task Mission_Control is
- -- launch will occur if we are given enough time to complete
- -- a standard countdown. We will not be rushed!
- entry Do_Launch;
- end Mission_Control;
-
- task body Mission_Control is
- begin
- loop
- select
- accept Do_Launch do
- Launch_Control.Start_Countdown (Countdown_Amount);
- requeue Launch_Control.Launch with abort;
- end Do_Launch;
- or
- terminate;
- end select;
- end loop;
- end Mission_Control;
-
- begin -- test encapsulation
- -- unconditional entry call to check the simple case
- Launch_Control.Enable_Launch_Control;
- Mission_Control.Do_Launch;
- if Launch_Accepted then
- if Verbose then
- Report.Comment ("simple case passed");
- end if;
- else
- Report.Failed ("simple case");
- end if;
-
-
- -- timed but with plenty of time - delay relative
- Launch_Control.Enable_Launch_Control;
- select
- Mission_Control.Do_Launch;
- or
- delay Plenty_Of_Time;
- if Launch_Accepted then
- Report.Failed ("plenty of time timed out after accept (1)");
- end if;
- end select;
- if Launch_Accepted then
- if Verbose then
- Report.Comment ("plenty of time case passed (1)");
- end if;
- else
- Report.Failed ("plenty of time (1)");
- end if;
-
-
- -- timed but with plenty of time -- delay until
- Launch_Control.Enable_Launch_Control;
- select
- Mission_Control.Do_Launch;
- or
- delay until Calendar.Clock + Plenty_Of_Time;
- if Launch_Accepted then
- Report.Failed ("plenty of time timed out after accept(2)");
- end if;
- end select;
- if Launch_Accepted then
- if Verbose then
- Report.Comment ("plenty of time case passed (2)");
- end if;
- else
- Report.Failed ("plenty of time (2)");
- end if;
-
-
- -- timed without enough time - delay relative
- Launch_Control.Enable_Launch_Control;
- select
- Mission_Control.Do_Launch;
- Report.Failed ("not enough time completed accept (1)");
- or
- delay Not_Enough_Time;
- end select;
- if Launch_Accepted then
- Report.Failed ("not enough time (1)");
- else
- if Verbose then
- Report.Comment ("not enough time case passed (1)");
- end if;
- end if;
-
-
- -- timed without enough time - delay until
- Launch_Control.Enable_Launch_Control;
- select
- Mission_Control.Do_Launch;
- Report.Failed ("not enough time completed accept (2)");
- or
- delay until Calendar.Clock + Not_Enough_Time;
- end select;
- if Launch_Accepted then
- Report.Failed ("not enough time (2)");
- else
- if Verbose then
- Report.Comment ("not enough time case passed (2)");
- end if;
- end if;
-
-
- -- conditional case
- Launch_Control.Enable_Launch_Control;
- -- make sure Mission_Control is ready to accept immediately
- delay ImpDef.Clear_Ready_Queue;
- select
- Mission_Control.Do_Launch;
- Report.Failed ("no time completed accept");
- else
- if Verbose then
- Report.Comment ("conditional case - else taken");
- end if;
- end select;
- if Launch_Accepted then
- Report.Failed ("no time");
- else
- if Verbose then
- Report.Comment ("no time case passed");
- end if;
- end if;
-
- end;
-
- Report.Result;
-end C954025;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954026.a b/gcc/testsuite/ada/acats/tests/c9/c954026.a
deleted file mode 100644
index 881b74af81c..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954026.a
+++ /dev/null
@@ -1,269 +0,0 @@
--- C954026.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the original protected entry call was a conditional
--- entry call, the call is cancelled if a requeue-with-abort of the
--- call is not selected immediately.
--- Check that if the original protected entry call was a timed entry
--- call, the expiration time for a requeue-with-abort is the original
--- expiration time.
---
--- TEST DESCRIPTION:
--- In this test the main task makes a variety of calls to the protected
--- object Initial_PO. These calls include a simple call, a conditional
--- call, and a timed call. The timed calls include calls with enough
--- time and those with less than the needed amount of time to get through
--- the requeue performed by Initial_PO.
--- Initial_PO requeues its entry call to Final_PO.
--- Final_PO does not accept the requeued call until the protected
--- procedure Ok_To_Take_Requeue is called.
--- A separate task, Delayed_Opener, is used to call Ok_To_Take_Requeue
--- after a delay amount specified by the main task has expired.
---
---
--- CHANGE HISTORY:
--- 15 DEC 95 SAIC ACVC 2.1
--- 10 JUL 96 SAIC Incorporated reviewer comments.
--- 10 OCT 96 SAIC Incorporated fix provided by vendor.
---
---!
-
-with Calendar;
-use type Calendar.Time;
-with Report;
-with Impdef;
-procedure C954026 is
- Verbose : constant Boolean := False;
- Final_Po_Reached : Boolean := False;
- Allowed_Time : constant Duration := 2.0 * Impdef.One_Second;
- Plenty_Of_Time : constant Duration :=
- Allowed_Time + Impdef.Clear_Ready_Queue + 1.0 * Impdef.One_Second;
- Not_Enough_Time : constant Duration := Allowed_Time - 0.5 * Impdef.One_Second;
-begin
- Report.Test ("C954026",
- "Check that if the original entry" &
- " call was a conditional or timed entry call," &
- " the expiration time for a requeue with" &
- " abort to a protected" &
- " entry is the original expiration time");
- declare
-
- protected Initial_Po is
- entry Start_Here;
- end Initial_Po;
-
- protected Final_Po is
- entry Requeue_Target;
- procedure Ok_To_Take_Requeue;
- procedure Close_Requeue;
- private
- Open : Boolean := False;
- end Final_Po;
-
- -- the Delayed_Opener task is used to notify Final_PO that it can
- -- accept the Requeue_Target entry.
- task Delayed_Opener is
- entry Start_Timer (Amt : Duration);
- entry Cancel_Timer;
- end Delayed_Opener;
-
- task body Delayed_Opener is
- Wait_Amt : Duration;
- begin
- loop
- accept Start_Timer (Amt : Duration) do
- Wait_Amt := Amt;
- end Start_Timer;
- exit when Wait_Amt < 0.0;
- if Verbose then
- Report.Comment ("Timer started");
- end if;
- select
- accept Cancel_Timer do
- Final_Po.Close_Requeue;
- end Cancel_Timer;
- or
- delay Wait_Amt;
- Final_Po.Ok_To_Take_Requeue;
- accept Cancel_Timer do
- Final_Po.Close_Requeue;
- end Cancel_Timer;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("exception in Delayed_Opener");
- end Delayed_Opener;
-
- protected body Initial_Po is
- entry Start_Here when True is
- begin
- Final_Po_Reached := False;
- requeue Final_Po.Requeue_Target with abort;
- end Start_Here;
- end Initial_Po;
-
- protected body Final_Po is
- entry Requeue_Target when Open is
- begin
- Open := False;
- Final_Po_Reached := True;
- end Requeue_Target;
-
- procedure Ok_To_Take_Requeue is
- begin
- Open := True;
- end Ok_To_Take_Requeue;
-
- procedure Close_Requeue is
- begin
- Open := False;
- end Close_Requeue;
- end Final_Po;
-
- begin -- test encapsulation
- -- unconditional entry call to check the simple case
- Delayed_Opener.Start_Timer (0.0);
- Initial_Po.Start_Here;
- if Final_Po_Reached then
- if Verbose then
- Report.Comment ("simple case passed");
- end if;
- else
- Report.Failed ("simple case");
- end if;
- Delayed_Opener.Cancel_Timer;
-
-
- -- timed but with plenty of time - delay relative
- Delayed_Opener.Start_Timer (Allowed_Time);
- select
- Initial_Po.Start_Here;
- or
- delay Plenty_Of_Time;
- Report.Failed ("plenty of time timed out (1)");
- if Final_Po_Reached then
- Report.Failed (
- "plenty of time timed out after accept (1)");
- end if;
- end select;
- if Final_Po_Reached then
- if Verbose then
- Report.Comment ("plenty of time case passed (1)");
- end if;
- else
- Report.Failed ("plenty of time (1)");
- end if;
- Delayed_Opener.Cancel_Timer;
-
-
- -- timed but with plenty of time -- delay until
- Delayed_Opener.Start_Timer (Allowed_Time);
- select
- Initial_Po.Start_Here;
- or
- delay until Calendar.Clock + Plenty_Of_Time;
- Report.Failed ("plenty of time timed out (2)");
- if Final_Po_Reached then
- Report.Failed (
- "plenty of time timed out after accept(2)");
- end if;
- end select;
- if Final_Po_Reached then
- if Verbose then
- Report.Comment ("plenty of time case passed (2)");
- end if;
- else
- Report.Failed ("plenty of time (2)");
- end if;
- Delayed_Opener.Cancel_Timer;
-
-
- -- timed without enough time - delay relative
- Delayed_Opener.Start_Timer (Allowed_Time);
- select
- Initial_Po.Start_Here;
- Report.Failed ("not enough time completed accept (1)");
- or
- delay Not_Enough_Time;
- end select;
- if Final_Po_Reached then
- Report.Failed ("not enough time (1)");
- else
- if Verbose then
- Report.Comment ("not enough time case passed (1)");
- end if;
- end if;
- Delayed_Opener.Cancel_Timer;
-
-
- -- timed without enough time - delay until
- Delayed_Opener.Start_Timer (Allowed_Time);
- select
- Initial_Po.Start_Here;
- Report.Failed ("not enough time completed accept (2)");
- or
- delay until Calendar.Clock + Not_Enough_Time;
- end select;
- if Final_Po_Reached then
- Report.Failed ("not enough time (2)");
- else
- if Verbose then
- Report.Comment ("not enough time case passed (2)");
- end if;
- end if;
- Delayed_Opener.Cancel_Timer;
-
-
- -- conditional case
- Delayed_Opener.Start_Timer (Allowed_Time);
- select
- Initial_Po.Start_Here;
- Report.Failed ("no time completed accept");
- else
- if Verbose then
- Report.Comment ("conditional case - else taken");
- end if;
- end select;
- if Final_Po_Reached then
- Report.Failed ("no time");
- else
- if Verbose then
- Report.Comment ("no time case passed");
- end if;
- end if;
- Delayed_Opener.Cancel_Timer;
-
- -- kill off the Delayed_Opener task
- Delayed_Opener.Start_Timer (-10.0);
-
- exception
- when others =>
- Report.Failed ("exception in main");
- end;
-
- Report.Result;
-end C954026;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954a01.a b/gcc/testsuite/ada/acats/tests/c9/c954a01.a
deleted file mode 100644
index 34f48b29171..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954a01.a
+++ /dev/null
@@ -1,262 +0,0 @@
--- C954A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if a task requeued without abort on a protected entry queue
--- is aborted, the abort is deferred until the entry call completes,
--- after which the task becomes completed.
---
--- TEST DESCRIPTION:
--- Declare a protected type which simulates a printer device driver
--- (foundation code).
---
--- Declare a task which simulates a printer server for multiple printers.
---
--- For the protected type, declare an entry with a barrier that is set
--- false by a protected procedure (which simulates starting a print job
--- on the printer), and is set true by a second protected procedure (which
--- simulates a handler called when the printer interrupts, indicating
--- that printing is done).
---
--- For the task, declare an entry whose corresponding accept statement
--- contains a call to first protected procedure of the protected type
--- (which sets the barrier of the protected entry to false), followed by
--- a requeue with abort to the protected entry. Declare a second entry
--- which does nothing.
---
--- Declare a "requesting" task which calls the printer server task entry
--- (and thus executes the requeue). Attempt to abort the requesting
--- task. Verify that it is not aborted. Call the second protected
--- procedure of the protected type (the interrupt handler) and verify that
--- the protected entry completes for the requesting task. Verify that
--- the requesting task is then aborted.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- F954A00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Oct 96 SAIC Added pragma elaborate.
---
---!
-
-package C954A01_0 is -- Printer server abstraction.
-
- -- Simulate a system with multiple printers. The entry Print requests
- -- that data be printed on the next available printer. The entry call
- -- is accepted when a printer is available, and completes when printing
- -- is done.
-
-
- task Printer_Server is
- entry Print (File_Name : String); -- Test the requeue statement.
- entry Verify_Results; -- Artifice for test purposes.
- end Printer_Server;
-
-end C954A01_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-with F954A00; -- Printer device abstraction.
-use F954A00;
-pragma Elaborate(F954A00);
-
-package body C954A01_0 is -- Printer server abstraction.
-
- task body Printer_Server is
- Printers_Busy : Boolean := True;
- Index : Printer_ID := 1;
- Print_Accepted : Boolean := False;
- begin
-
- loop
- -- Wait for a printer to become available:
-
- while Printers_Busy loop
- Printers_Busy := False; -- Exit loop if
- -- entry accepted.
- select
- Printer(Index).Done_Printing; -- Accepted immed.
- -- when printer is
- -- available.
- else
- Index := 1 + (Index mod Number_Of_Printers);-- Entry not immed.
- Printers_Busy := True; -- accepted; keep
- end select; -- looping.
- end loop;
- -- Value of Index
- -- at loop exit
- -- identifies the
- -- avail. printer.
-
- -- Wait for a print request or terminate:
-
- select
- accept Print (File_Name : String) do
- Print_Accepted := True; -- Allow
- -- Verify_Results
- -- to be accepted.
-
- Printer(Index).Start_Printing (File_Name); -- Begin printing on
- -- the available
- -- -- -- printer.
- -- Requeue is tested here --
- -- --
- -- Requeue caller so
- requeue Printer(Index).Done_Printing; -- server task free
- -- to accept other
- end Print; -- requests.
- or
- -- Guard ensures that Verify_Results cannot be accepted
- -- until after Print has been accepted. This avoids a
- -- race condition in the main program.
-
- when Print_Accepted => accept Verify_Results; -- Artifice for
- -- testing purposes.
- or
- terminate;
- end select;
-
- -- Allow other tasks to get control
- delay ImpDef.Minimum_Task_Switch;
-
- end loop;
-
- exception
- when others =>
- Report.Failed ("Exception raised in Printer_Server task");
- end Printer_Server;
-
-
-end C954A01_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-with F954A00; -- Printer device abstraction.
-with C954A01_0; -- Printer server abstraction.
-
-use C954A01_0;
-use F954A00;
-
-procedure C954A01 is
-
- Long_Enough : constant Duration := ImpDef.Switch_To_New_Task;
-
- --==============================================--
-
- task Print_Request; -- Send a print request.
-
- task body Print_Request is
- My_File : constant String := "MYFILE.DAT";
- begin
- Printer_Server.Print (My_File); -- Invoke requeue statement.
- Report.Failed ("Task continued execution following entry call");
- exception
- when others =>
- Report.Failed ("Exception raised in Print_Request task");
- end Print_Request;
-
- --==============================================--
-
-begin -- Main program.
-
- Report.Test ("C954A01", "Requeue without abort - check that the abort " &
- "is deferred until after the rendezvous completes. (Task to PO)");
-
- -- To pass this test, the following must be true:
- --
- -- (A) The abort of Print_Request is deferred until after the
- -- Done_Printing entry body completes.
- -- (B) Print_Request aborts after the Done_Printing entry call
- -- completes.
- --
- -- Call the entry Verify_Results. The entry call will not be accepted
- -- until after Print_Request has been requeued to Done_Printing.
-
- Printer_Server.Verify_Results; -- Accepted after Print_Request is
- -- requeued to Done_Printing.
-
- -- Simulate an application which needs access to the printer within
- -- a specified time, and which aborts the current printer job if time
- -- runs out.
-
- select
- Printer(1).Done_Printing; -- Wait for printer to come free.
- or
- delay Long_Enough; -- Print job took too long.
- abort Print_Request; -- Abort print job.
- end select;
-
- Printer_Server.Verify_Results; -- Abortion completion point: force
- -- abort to complete (if it's going
- -- to).
-
- -- Verify that the Done_Printing entry body has not yet completed,
- -- and thus that Print_Request has not been aborted.
-
- if Printer(1).Is_Done then
- Report.Failed ("Target entry of requeue executed prematurely");
- elsif Print_Request'Terminated then
- Report.Failed ("Caller was aborted before entry was complete");
- else
-
- Printer(1).Handle_Interrupt; -- Simulate a printer interrupt,
- -- signaling that printing is
- -- done.
-
- -- The Done_Printing entry body will complete before the next protected
- -- action is called (Printer(1).Is_Done). Verify (A) and (B): that the
- -- Print_Request is aborted.
-
- Printer_Server.Verify_Results; -- Abortion completion point: force
- -- Print_Request abort to complete.
-
- if not Printer(1).Is_Done then
- Report.Failed ("Target entry of requeue did not complete");
- end if;
-
- if not Print_Request'Terminated then
- Report.Failed ("Task not aborted following completion of entry call");
- abort Print_Request; -- Try to kill hung task.
- end if;
-
- end if;
-
- Report.Result;
-
-end C954A01;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954a02.a b/gcc/testsuite/ada/acats/tests/c9/c954a02.a
deleted file mode 100644
index 7d61aea8c23..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954a02.a
+++ /dev/null
@@ -1,259 +0,0 @@
--- C954A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if a task requeued with abort on a protected entry queue
--- is aborted, the protected entry call is canceled and the aborted
--- task becomes completed.
---
--- TEST DESCRIPTION:
--- Declare a protected type which simulates a printer device driver
--- (foundation code).
---
--- Declare a task which simulates a printer server for multiple printers.
---
--- For the protected type, declare an entry with a barrier that is set
--- false by a protected procedure (which simulates starting a print job
--- on the printer), and is set true by a second protected procedure (which
--- simulates a handler called when the printer interrupts, indicating
--- that printing is done).
---
--- For the task, declare an entry whose corresponding accept statement
--- contains a call to first protected procedure of the protected type
--- (which sets the barrier of the protected entry to false), followed by
--- a requeue with abort to the protected entry. Declare a second entry
--- which does nothing.
---
--- Declare a "requesting" task which calls the printer server task entry
--- (and thus executes the requeue). Attempt to abort the requesting
--- task. Verify that it is aborted, that the requeued entry call is
--- canceled, and that the corresponding entry body is not executed.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- F954A00.A
---
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Oct 96 SAIC Added pragma elaborate
---
---!
-
-package C954A02_0 is -- Printer server abstraction.
-
- -- Simulate a system with multiple printers. The entry Print requests
- -- that data be printed on the next available printer. The entry call
- -- is accepted when a printer is available, and completes when printing
- -- is done.
-
-
- task Printer_Server is
- entry Print (File_Name : String); -- Test the requeue statement.
- entry Verify_Results; -- Artifice for test purposes.
- end Printer_Server;
-
-end C954A02_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-with F954A00; -- Printer device abstraction.
-use F954A00;
-pragma Elaborate(F954a00);
-
-package body C954A02_0 is -- Printer server abstraction.
-
- task body Printer_Server is
- Printers_Busy : Boolean := True;
- Index : Printer_ID := 1;
- Print_Accepted : Boolean := False;
- begin
-
- loop
- -- Wait for a printer to become available:
-
- while Printers_Busy loop
- Printers_Busy := False; -- Exit loop if
- -- entry accepted.
- select
- Printer(Index).Done_Printing; -- Accepted immed.
- -- when printer is
- -- available.
- else
- Index := 1 + (Index mod Number_Of_Printers);-- Entry not immed.
- Printers_Busy := True; -- accepted; keep
- end select; -- looping.
-
- -- Allow other task to get control
- delay ImpDef.Minimum_Task_Switch;
-
- end loop; -- Value of Index
- -- at loop exit
- -- identifies the
- -- avail. printer.
-
- -- Wait for a print request or terminate:
-
- select
- accept Print (File_Name : String) do
- Print_Accepted := True; -- Allow
- -- Verify_Results
- -- to be accepted.
-
- Printer(Index).Start_Printing (File_Name); -- Begin printing on
- -- the available
- -- -- -- printer.
- -- Requeue is tested here --
- -- --
- -- Requeue caller so
- requeue Printer(Index).Done_Printing -- server task free
- with abort; -- to accept other
- end Print; -- requests.
- or
- -- Guard ensures that Verify_Results cannot be accepted
- -- until after Print has been accepted. This avoids a
- -- race condition in the main program.
-
- when Print_Accepted => accept Verify_Results; -- Artifice for
- -- testing purposes.
- or
- terminate;
- end select;
-
- end loop;
-
- exception
- when others =>
- Report.Failed ("Exception raised in Printer_Server task");
- end Printer_Server;
-
-
-end C954A02_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-with F954A00; -- Printer device abstraction.
-with C954A02_0; -- Printer server abstraction.
-
-use C954A02_0;
-use F954A00;
-
-procedure C954A02 is
-
- -- Length of time which simulates a very long process
- Long_Enough : constant Duration := ImpDef.Clear_Ready_Queue;
-
- --==============================================--
-
- task Print_Request; -- Send a print request.
-
- task body Print_Request is
- My_File : constant String := "MYFILE.DAT";
- begin
- Printer_Server.Print (My_File); -- Invoke requeue statement.
- Report.Failed ("Task continued execution following entry call");
- exception
- when others =>
- Report.Failed ("Exception raised in Print_Request task");
- end Print_Request;
-
- --==============================================--
-
-begin -- Main program.
-
- Report.Test ("C954A02", "Abort a requeue on a Protected entry");
-
- -- To pass this test, the following must be true:
- --
- -- (A) The abort of Print_Request takes place immediately.
- -- (B) The Done_Printing entry call is canceled, and the corresponding
- -- entry body is not executed.
- --
- -- Call the entry Verify_Results. The entry call will not be accepted
- -- until after Print_Request has been requeued to Done_Printing.
-
- Printer_Server.Verify_Results; -- Accepted after Print_Request is
- -- requeued to Done_Printing.
-
- -- Verify that the Done_Printing entry call has not been completed.
- --
- if Printer(1).Is_Done then
- Report.Failed ("Target entry of requeue executed prematurely");
- else
-
- -- Simulate an application which needs access to the printer within
- -- a specified time, and which aborts the current printer job if time
- -- runs out.
-
- select
- Printer(1).Done_Printing; -- Wait for printer to come free.
- or
- delay Long_Enough; -- Print job took too long.
- abort Print_Request; -- Abort print job.
- end select;
-
- Printer_Server.Verify_Results; -- Abortion completion point: force
- -- Print_Request abort to complete.
-
- -- Verify (A): that Print_Request has been aborted.
- -- Note: the test will hang if the task as not been aborted
- --
- while not Print_Request'Terminated loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- Verify (B): that the Done_Printing entry call was canceled, and
- -- the corresponding entry body was not executed.
- --
- -- Set the barrier of the entry to true, then check that the entry
- -- body is not executed. If the entry call is NOT canceled, the
- -- entry body will execute when the barrier is set true.
-
- Printer(1).Handle_Interrupt; -- Simulate a printer interrupt,
- -- signaling that printing is
- -- done.
- if Printer(1).Is_Done then
- Report.Failed ("Entry call was not canceled");
- end if;
-
-
- end if;
-
-
- Report.Result;
-
-end C954A02;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c954a03.a b/gcc/testsuite/ada/acats/tests/c9/c954a03.a
deleted file mode 100644
index 13d21311c7b..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c954a03.a
+++ /dev/null
@@ -1,322 +0,0 @@
--- C954A03.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a requeue statement in an accept_statement with
--- parameters may requeue the entry call to a protected entry with no
--- parameters. Check that, if the call is queued on the new entry's
--- queue, the original caller remains blocked after the requeue, but
--- the accept_statement containing the requeue is completed.
---
--- Note that this test uses a requeue "with abort," although it does not
--- check that such a requeued caller can be aborted; that feature is
--- tested elsewhere.
---
--- TEST DESCRIPTION:
--- Declare a protected type which simulates a printer device driver
--- (foundation code).
---
--- Declare a task which simulates a printer server for multiple printers.
---
--- For the protected type, declare an entry with a barrier that is set
--- false by a protected procedure (which simulates starting a print job
--- on the printer), and is set true by a second protected procedure (which
--- simulates a handler called when the printer interrupts, indicating
--- that printing is done).
---
--- For the task, declare an entry whose corresponding accept statement
--- contains a call to first protected procedure of the protected type
--- (which sets the barrier of the protected entry to false), followed by
--- a requeue with abort to the protected entry. Declare a second entry
--- which does nothing.
---
--- Declare a "requesting" task which calls the printer server task entry
--- (and thus executes the requeue). Verify that, following the requeue,
--- the requesting task remains blocked. Call the second entry of the
--- printer server task (the acceptance of this entry call verifies that
--- the requeue statement completed the entry call by the requesting task.
--- Call the second protected procedure of the protected type (the
--- interrupt handler) and verify that the protected entry completes for
--- the requesting task (which verifies that the requeue statement queued
--- the first task object to the protected entry).
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- F954A00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Oct 96 SAIC Added pragma elaborate.
---
---!
-
-package C954A03_0 is -- Printer server abstraction.
-
- -- Simulate a system with multiple printers. The entry Print requests
- -- that data be printed on the next available printer. The entry call
- -- is accepted when a printer is available, and completes when printing
- -- is done.
-
- task Printer_Server is
- entry Print (File_Name : String); -- Test the requeue statement.
- entry Verify_Results; -- Artifice for test purposes.
- end Printer_Server;
-
-end C954A03_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-with F954A00; -- Printer device abstraction.
-use F954A00;
-pragma Elaborate(F954a00);
-
-package body C954A03_0 is -- Printer server abstraction.
-
-
- task body Printer_Server is
- Printers_Busy : Boolean := True;
- Index : Printer_ID := 1;
- Print_Accepted : Boolean := False;
- begin
-
- loop
- -- Wait for a printer to become available:
-
- while Printers_Busy loop
- Printers_Busy := False; -- Exit loop if
- -- entry accepted.
- select
- Printer(Index).Done_Printing; -- Accepted immed.
- -- when printer is
- -- available.
- else
- Index := 1 + (Index mod Number_Of_Printers);-- Entry not immed.
- Printers_Busy := True; -- accepted; keep
- end select; -- looping.
-
- -- Allow other tasks to get control
- delay ImpDef.Minimum_Task_Switch;
-
- end loop;
- -- Value of Index
- -- at loop exit
- -- identifies the
- -- avail. printer.
-
- -- Wait for a print request or terminate:
-
- select
- accept Print (File_Name : String) do
- Print_Accepted := True; -- Allow
- -- Verify_Results
- -- to be accepted.
-
- Printer(Index).Start_Printing (File_Name); -- Begin printing on
- -- the available
- -- -- -- printer.
- -- Requeue is tested here --
- -- --
- -- Requeue caller so
- requeue Printer(Index).Done_Printing -- server task free
- with abort; -- to accept other
- end Print; -- requests.
- or
- -- Guard ensures that Verify_Results cannot be accepted
- -- until after Print has been accepted. This avoids a
- -- race condition in the main program.
-
- when Print_Accepted => accept Verify_Results; -- Artifice for
- -- testing purposes.
- or
- terminate;
- end select;
-
- end loop;
-
- exception
- when others =>
- Report.Failed ("Exception raised in Printer_Server task");
- end Printer_Server;
-
-
-end C954A03_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-with F954A00; -- Printer device abstraction.
-with C954A03_0; -- Printer server abstraction.
-
-use C954A03_0;
-use F954A00;
-
-procedure C954A03 is
-
- Long_Enough : constant Duration := ImpDef.Clear_Ready_Queue;
-
-
- --==============================================--
-
- Task_Completed : Boolean := False; -- Testing flag.
-
- protected Interlock is -- Artifice for test purposes.
- entry Wait; -- Wait for lock to be released.
- procedure Release; -- Release the lock.
- private
- Locked : Boolean := True;
- end Interlock;
-
-
- protected body Interlock is
-
- entry Wait when not Locked is -- Calls are queued until after
- -- -- Release is called.
- begin
- Task_Completed := True;
- end Wait;
-
- procedure Release is -- Called by Print_Request.
- begin
- Locked := False;
- end Release;
-
- end Interlock;
-
- --==============================================--
-
- task Print_Request is -- Send a print request.
- end Print_Request;
-
- task body Print_Request is
- My_File : constant String := "MYFILE.DAT";
- begin
- Printer_Server.Print (My_File); -- Invoke requeue statement.
- Interlock.Release; -- Allow main to continue.
- exception
- when others =>
- Report.Failed ("Exception raised in Print_Request task");
- end Print_Request;
-
- --==============================================--
-
-begin -- Main program.
-
- Report.Test ("C954A03", "Requeue from an Accept with parameters" &
- " to a Protected Entry without parameters");
-
- -- To pass this test, the following must be true:
- --
- -- (A) The Print entry call made by the task Print_Request must be
- -- completed by the requeue statement.
- -- (B) Print_Request must remain blocked following the requeue.
- -- (C) Print_Request must be queued on the Done_Printing queue of
- -- Printer(1).
- -- (D) Print_Request must continue execution after Done_Printing is
- -- complete.
- --
- -- First, verify (A): that the Print entry call is complete.
- --
- -- Call the entry Verify_Results. If the requeue statement completed the
- -- entry call to Print, the entry call to Verify_Results should be
- -- accepted. Since the main will hang if this is NOT the case, make this
- -- a timed entry call.
-
- select
- Printer_Server.Verify_Results; -- Accepted if requeue completed
- -- entry call to Print.
- or
- delay Long_Enough; -- Time out otherwise.
- Report.Failed ("Requeue did not complete entry call");
- end select;
-
- -- Now verify (B): that Print_Request remains blocked following the
- -- requeue. Also verify that Done_Printing (the entry to which
- -- Print_Request should have been queued) has not yet executed.
-
- if Printer(1).Is_Done then
- Report.Failed ("Target entry of requeue executed prematurely");
- elsif Print_Request'Terminated then
- Report.Failed ("Caller did not remain blocked after the requeue");
- else
-
- -- Verify (C): that Print_Request is queued on the
- -- Done_Printing queue of Printer(1).
- --
- -- Set the barrier for Printer(1).Done_Printing to true. Check
- -- that the Done flag is updated and that Print_Request terminates.
-
- Printer(1).Handle_Interrupt; -- Simulate a printer interrupt,
- -- signaling that printing is
- -- done.
-
- -- The Done_Printing entry body will complete before the next
- -- protected action is called (Printer(1).Is_Done).
-
- if not Printer(1).Is_Done then
- Report.Failed ("Caller was not requeued on target entry");
- end if;
-
- -- Finally, verify (D): that Print_Request continues after Done_Printing
- -- completes.
- --
- -- After Done_Printing completes, there is a potential race condition
- -- between the main program and Print_Request. The protected object
- -- Interlock is provided to ensure that the check of whether
- -- Print_Request continued is made *after* it has had a chance to do so.
- -- The main program waits until the statement in Print_Request following
- -- the requeue-causing statement has executed, then checks to see
- -- whether Print_Request did in fact continue executing.
- --
- -- Note that the test will hang here if Print_Request does not continue
- -- executing following the completion of the requeued entry call.
-
- Interlock.Wait; -- Wait until Print_Request is
- -- done.
- if not Task_Completed then
- Report.Failed ("Caller remained blocked after target " &
- "entry released");
- end if;
-
- -- Wait for Print_Request to finish before calling Report.Result.
- while not Print_Request'Terminated loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- end if;
-
- Report.Result;
-
-end C954A03;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c960001.a b/gcc/testsuite/ada/acats/tests/c9/c960001.a
deleted file mode 100644
index 4eaa1f49ff1..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c960001.a
+++ /dev/null
@@ -1,164 +0,0 @@
--- C960001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Confirm that a simple Delay Until statement is performed. Check
--- that the delay does not complete before the requested time and that it
--- does complete thereafter
---
--- TEST DESCRIPTION:
--- Simulate a task that sends a "pulse" at regular intervals. The Delay
--- Until statement is used to avoid accumulated drift. For the
--- test, we expect the delay to return very close to the requested time;
--- we use an additional Pulse_Time_Delta for the limit. The test
--- driver (main) artificially limits the number of iterations by setting
--- the Stop_Pulse Boolean after a small number.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 Nov 95 SAIC Fixed global variable problem for ACVC 2.0.1
---
---!
-
-with Report;
-with Ada.Calendar;
-with ImpDef;
-
-procedure C960001 is
-
-begin
-
- Report.Test ("C960001", "Simple Delay Until");
-
- declare -- To get the Report.Result after all has completed
-
- function "+" (Left : Ada.Calendar.Time; Right: Duration)
- return Ada.Calendar.Time renames Ada.Calendar."+";
- function "<" (Left, Right : Ada.Calendar.Time)
- return Boolean renames Ada.Calendar."<";
- function ">" (Left, Right : Ada.Calendar.Time)
- return Boolean renames Ada.Calendar.">";
-
- TC_Loop_Count : integer range 0..4 := 0;
-
-
- -- control over stopping tasks
- protected Control is
- procedure Stop_Now;
- function Stop return Boolean;
- private
- Halt : Boolean := False;
- end Control;
-
- protected body Control is
- procedure Stop_Now is
- begin
- Halt := True;
- end Stop_Now;
-
- function Stop return Boolean is
- begin
- return Halt;
- end Stop;
- end Control;
-
- task Pulse_Task is
- entry Trigger;
- end Pulse_Task;
-
-
- -- Task to synchronize all qualified receivers.
- -- The entry Trigger starts the synchronization; Control.Stop
- -- becoming true terminates the task.
- --
- task body Pulse_Task is
-
- Pulse_Time : Ada.Calendar.Time;
-
- Pulse_Time_Delta : duration := ImpDef.Clear_Ready_Queue;
-
- TC_Last_Time : Ada.Calendar.Time;
- TC_Current : Ada.Calendar.Time;
-
-
- -- This routine transmits a synchronizing "pulse" to
- -- all receivers
- procedure Pulse is
- begin
- null; -- Stub
- Report.Comment (".......PULSE........");
- end Pulse;
-
- begin
- accept Trigger;
-
- Pulse_Time := Ada.Calendar.Clock + Pulse_Time_Delta;
- TC_Last_Time := Pulse_Time;
-
- while not Control.Stop loop
- delay until Pulse_Time;
- Pulse;
-
- -- Calculate time for next pulse. Note: this is based on the
- -- last pulse time, not the time we returned from the delay
- --
- Pulse_Time := Pulse_Time + Pulse_Time_Delta;
-
- -- Test Control:
- TC_Current := Ada.Calendar.Clock;
- if TC_Current < TC_Last_Time then
- Report.Failed ("Delay expired before requested time");
- end if;
- if TC_Current > Pulse_Time then
- Report.Failed ("Delay too long");
- end if;
- TC_Last_Time := Pulse_Time;
- TC_Loop_Count := TC_Loop_Count +1;
- end loop;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Pulse_Task");
- end Pulse_Task;
-
-
-
- begin -- declare
-
- Pulse_Task.Trigger; -- Start test
-
- -- Artificially limit the number of iterations
- while TC_Loop_Count < 3 loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
- --
- Control.Stop_Now; -- End test
-
- end; -- declare
-
- Report.Result;
-
-end C960001;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c960002.a b/gcc/testsuite/ada/acats/tests/c9/c960002.a
deleted file mode 100644
index 06edaf0c9d5..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c960002.a
+++ /dev/null
@@ -1,171 +0,0 @@
--- C960002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the simple "delay until" when the request time is "now" and
--- also some time already in the past is obeyed and returns immediately
---
--- TEST DESCRIPTION:
--- Simulate a task that sends a "pulse" at regular intervals. The Delay
--- Until statement is used to avoid accumulated drift. In this test
--- three simple situations simulating the start of drift are used: the
--- next pulse being called for at the normal time, the next pulse being
--- called for at exactly the current time and then at some time which has
--- already past. We assume the delay is within a While Loop and, to
--- simplify the test, we "unfold" the While Loop and execute the Delays
--- in a serial fashion. This loop is shown in test C960001.
--- It is not possible to test the actual immediacy of the expiration. We
--- can only check that it returns in a "reasonable" time. In this case
--- we check that it expires before the next "pulse" should have been
--- issued.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-with ImpDef;
-
-with Ada.Calendar;
-with System;
-
-procedure C960002 is
-
-begin
-
- Report.Test ("C960002", "Simple Delay Until with requested time being" &
- " ""now"" and time already in the past");
-
- declare -- To get the Report.Result after all has completed
-
- function "+" (Left : Ada.Calendar.Time; Right: Duration)
- return Ada.Calendar.Time renames Ada.Calendar."+";
- function "-" (Left : Ada.Calendar.Time; Right: Duration)
- return Ada.Calendar.Time renames Ada.Calendar."-";
- function "-" (Left, Right : Ada.Calendar.Time)
- return duration renames Ada.Calendar."-";
- function ">" (Left, Right : Ada.Calendar.Time)
- return Boolean renames Ada.Calendar.">";
-
-
- task Pulse_Task is
- entry Trigger;
- end Pulse_Task;
-
-
- -- Task to synchronize all qualified receivers.
- -- The entry Trigger starts the synchronization.
- --
- task body Pulse_Task is
- Pulse_Time : Ada.Calendar.Time;
- Pulse_Time_Delta : constant duration := ImpDef.Clear_Ready_Queue;
-
-
-
- TC_Time_Back : Ada.Calendar.Time;
-
-
- -- This routine transmits a synchronizing "pulse" to
- -- all receivers
- procedure Pulse is
- begin
- null; -- Stub
- Report.Comment (".......PULSE........");
- end Pulse;
-
- begin
- accept Trigger;
- Pulse;
- ---------------
- -- normal calculation for "next"
- Pulse_Time := Ada.Calendar.Clock + Pulse_Time_Delta;
-
- -- TC: unfold the "while" loop in C960001. Four passes through
- -- the loop are shown
-
- delay until Pulse_Time;
-
- Pulse;
- ---------------
- -- TC: the normal calculation for "next" would be
- -- Pulse_Time := Pulse_Time + Pulse_Time_Delta;
- -- Instead of this normal pulse time calculation simulate
- -- the new pulse time to be exactly "now" (or, as exactly as
- -- we can)
- Pulse_Time := Ada.Calendar.Clock;
- delay until Ada.Calendar.Clock;
-
- TC_Time_Back := Ada.Calendar.Clock;
-
- -- Now check for reasonableness
- if TC_Time_Back > Pulse_Time + Pulse_Time_Delta then
- Report.Failed
- ("""Now"" delayed for more than Pulse_Time_Delta - A");
- end if;
- Pulse;
- ---------------
- -- normal calculation for "next" would be
- Pulse_Time := Pulse_Time + Pulse_Time_Delta;
-
- -- TC: Instead of this, simulate the new calculated pulse time
- -- being already past
- Pulse_Time := Ada.Calendar.Clock - System.Tick;
- delay until Pulse_Time;
-
- TC_Time_Back := Ada.Calendar.Clock;
-
- -- Now check for reasonableness
- if TC_Time_Back > Pulse_Time + Pulse_Time_Delta then
- Report.Failed
- ("""Now"" delayed for more than Pulse_Time_Delta - B");
- end if;
- Pulse;
- ---------------
- -- normal calculation for "next"
- Pulse_Time := Pulse_Time + Pulse_Time_Delta;
- -- Now simulate getting back into synch
- delay until Pulse_Time;
- Pulse;
- ---------------
- -- This would be the end of the "while" loop
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Pulse_Task");
- end Pulse_Task;
-
-
-
- begin -- declare
-
- Pulse_Task.Trigger; -- Start test
-
- end; -- declare
-
- Report.Result;
-
-end C960002;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c960004.a b/gcc/testsuite/ada/acats/tests/c9/c960004.a
deleted file mode 100644
index f394aab66fc..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c960004.a
+++ /dev/null
@@ -1,206 +0,0 @@
--- C960004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- With the triggering statement being a delay and with the Asynchronous
--- Select statement being in a tasking situation complete the abortable
--- part before the delay expires. Check that the delay is cancelled
--- and that the optional statements in the triggering part are not
--- executed.
---
--- TEST DESCRIPTION:
--- Simulate the creation of a carrier task to control the output of
--- a message via a line driver. If the message sending process is
--- not complete (the completion of the rendezvous) within a
--- specified time the carrier task is designed to take corrective action.
--- Use an asynchronous select to control the timing; arrange that
--- the abortable part (the rendezvous) completes almost immediately.
--- Check that the optional statements are not executed and that the
--- test completes well before the time of the trigger delay request thus
--- showing that it has been cancelled.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-with Report;
-with Ada.Calendar;
-
-procedure C960004 is
-
- function "-" (Left, Right : Ada.Calendar.Time)
- return Duration renames Ada.Calendar."-";
- TC_Start_Time : Ada.Calendar.Time := Ada.Calendar.Clock;
- TC_Elapsed_Time : duration;
-
- -- Note: a properly executing test will complete immediately.
- Allowable_ACK_Time : duration := 600.0;
-
-begin
-
- Report.Test ("C960004", "ATC: When abortable part completes before " &
- "a triggering delay, check that the delay " &
- "is cancelled & optional statements " &
- "are not performed. Tasking situation");
-
- declare -- To get the Report.Result after all has completed
-
- type Sequence_Number is range 1..1_999_999; -- Message Number
- subtype S_length_subtype is integer range 1..80;
-
- type Message_Type (Max_String : S_length_subtype := 1) is
- record
- Message_Number : Sequence_Number;
- Alpha : string(1..Max_String);
- end record;
-
- -- TC: Dummy message for the test
- Dummy_Alpha : constant string := "This could be printed";
- Message_to_Send : Message_Type (Max_string => Dummy_Alpha'length);
-
-
- -- This is the carrier task. One of these is created for each
- -- message that requires ACK
- --
- task type Require_ACK_task is
- entry Message_In (Message_to_Send: Message_Type);
- end Require_ACK_task;
- type acc_Require_ACK_task is access Require_ACK_task;
-
-
- --:::::::::::::::::::::::::::::::::
- -- There would also be another task type "No_ACK_Task" which would
- -- be the carrier task for those messages not requiring an ACK.
- -- This task would call Send_Message.ACK_Not_Required. It is not
- -- shown in this test as it is not used.
- --:::::::::::::::::::::::::::::::::
-
-
-
- task Send_Message is
- entry ACK_Required (Message_to_Send: Message_Type);
- entry ACK_Not_Required (Message_to_Send: Message_Type);
- end Send_Message;
-
-
- -- This is the carrier task. One of these is created for each
- -- message that requires ACK
- --
- task body Require_ACK_task is
- Hold_Message : Message_Type;
-
- procedure Time_Out (Failed_Message_Number : Sequence_Number) is
- begin
- -- Take remedial action on the timed-out message
- null; -- stub
-
- Report.Failed ("Optional statements in triggering part" &
- " were performed");
- end Time_out;
-
- begin
- accept Message_In (Message_to_Send: Message_Type) do
- Hold_Message := Message_to_Send; -- to release caller
- end Message_In;
-
- -- Now put the message out to the Send_Message task and
- -- wait (no more than Allowable_Ack_Time) for its completion
- --
- select
- delay Allowable_ACK_Time;
- -- ACK not received in specified time
- Time_out (Hold_Message.Message_Number);
- then abort
- -- If the rendezvous is not completed in the above time, this
- -- call is cancelled
- -- Note: for this test this call will complete immediately
- -- and thus the trigger should be cancelled
- Send_Message.ACK_Required (Hold_Message);
- end select;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception in Require_ACK_task");
- end Require_ACK_task;
-
-
- -- This is the Line Driver task
- --
- task body Send_Message is
- Hold_Non_ACK_Message : Message_Type;
- begin
- loop
- select
- accept ACK_Required (Message_to_Send: Message_Type) do
- -- Here send the message from within the rendezvous
- -- waiting for full transmission to complete
- null; -- stub
- -- Note: In this test this accept will complete immediately
- end ACK_Required;
- or
- accept ACK_Not_Required (Message_to_Send: Message_Type) do
- Hold_Non_ACK_Message := Message_to_Send;
- end ACK_Not_Required;
- -- Here send the message from outside the rendezvous
- null; -- stub
- or
- terminate;
- end select;
- end loop;
- exception
- when others => Report.Failed ("Unexpected exception in Send_Message");
- end Send_Message;
-
- begin -- declare
- -- Build a dummy message
- Message_to_Send.Alpha := Dummy_Alpha;
- Message_to_Send.Message_Number := 110_693;
-
- declare
- New_Require_ACK_task : acc_Require_ACK_task :=
- new Require_ACK_task;
- begin
- -- Create a carrier task for this message and pass the latter in
- New_Require_ACK_task.Message_In (Message_to_Send);
- end; -- declare
-
- end; -- declare
-
- --Once we are out of the above declarative region, all tasks have completed
-
- TC_Elapsed_Time := Ada.Calendar.Clock - TC_Start_Time;
-
- -- Check that the test has completed well before the time of the requested
- -- delay to ensure the delay was cancelled
- --
- if (TC_Elapsed_Time > Allowable_ACK_Time/2) then
- Report.Failed ("Triggering delay statement was not cancelled");
- end if;
-
- Report.Result;
-end C960004;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974001.a b/gcc/testsuite/ada/acats/tests/c9/c974001.a
deleted file mode 100644
index 04ac93e6d8f..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974001.a
+++ /dev/null
@@ -1,152 +0,0 @@
--- C974001.A
---
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the abortable part of an asynchronous select statement
--- is aborted if it does not complete before the triggering statement
--- completes, where the triggering statement is a delay_relative
--- statement and check that the sequence of statements of the triggering
--- alternative is executed after the abortable part is left.
---
--- TEST DESCRIPTION:
--- Declare a task with an accept statement containing an asynchronous
--- select with a delay_relative triggering statement. Parameterize
--- the accept statement with the time to be used in the delay. Simulate a
--- time-consuming calculation by declaring a procedure containing an
--- infinite loop. Call this procedure in the abortable part.
---
--- The delay will expire before the abortable part completes, at which
--- time the abortable part is aborted, and the sequence of statements
--- following the triggering statement is executed.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-with ImpDef;
-
-procedure C974001 is
-
-
- --========================================================--
-
- -- Medium length delay
- Allotted_Time : constant Duration := ImpDef.Switch_To_New_Task;
-
- Calculation_Canceled : exception;
-
-
- Count : Integer := 1234;
-
- procedure Lengthy_Calculation is
- begin
- -- Simulate a non-converging calculation.
- loop -- Infinite loop.
- Count := (Count + 1) mod 10;
- delay ImpDef.Minimum_Task_Switch; -- allow other task
- end loop;
- end Lengthy_Calculation;
-
-
- --========================================================--
-
-
- task type Timed_Calculation is
- entry Calculation (Time_Limit : in Duration);
- end Timed_Calculation;
-
-
- task body Timed_Calculation is
- --
- begin
- loop
- select
- accept Calculation (Time_Limit : in Duration) do
-
- -- --
- -- Asynchronous select is tested here --
- -- --
-
- select
- delay Time_Limit; -- Time_Limit is not up yet, so
- -- Lengthy_Calculation starts.
-
- raise Calculation_Canceled; -- This is executed after
- -- Lengthy_Calculation aborted.
- then abort
- Lengthy_Calculation; -- Delay expires before complete,
- -- so this call is aborted.
-
- -- Check that the whole of the abortable part is aborted,
- -- not just the statement in the abortable part that was
- -- executing at the time
- Report.Failed ("Abortable part not aborted");
-
- end select;
-
- Report.Failed ("Triggering alternative sequence of " &
- "statements not executed");
-
- exception -- New Ada 9x: handler within accept
- when Calculation_Canceled =>
- if Count = 1234 then
- Report.Failed ("Abortable part did not execute");
- end if;
- end Calculation;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Timed_Calculation task");
- end Timed_Calculation;
-
-
- --========================================================--
-
-
-begin -- Main program.
-
- Report.Test ("C974001", "Asynchronous Select: Trigger is delay_relative" &
- " which completes before abortable part");
-
- declare
- Timed : Timed_Calculation; -- Task.
- begin
- Timed.Calculation (Time_Limit => Allotted_Time); -- Asynchronous select
- -- inside accept block.
- exception
- when Calculation_Canceled =>
- null; -- expected behavior
- end;
-
- Report.Result;
-
-end C974001;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974002.a b/gcc/testsuite/ada/acats/tests/c9/c974002.a
deleted file mode 100644
index 1138e8da3bc..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974002.a
+++ /dev/null
@@ -1,209 +0,0 @@
--- C974002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the sequence of statements of the triggering alternative
--- of an asynchronous select statement is executed if the triggering
--- statement is a delay_until statement, and the specified time has
--- already passed. Check that the abortable part is not executed after
--- the sequence of statements of the triggering alternative is left.
---
--- Check that the sequence of statements of the triggering alternative
--- of an asynchronous select statement is not executed if the abortable
--- part completes before the triggering statement, and the triggering
--- statement is a delay_until statement.
---
--- TEST DESCRIPTION:
--- Declare a task with an accept statement containing an asynchronous
--- select with a delay_until triggering statement. Parameterize
--- the accept statement with the time to be used in the delay. Simulate
--- a quick calculation by declaring a procedure which sets a Boolean
--- flag. Call this procedure in the abortable part.
---
--- Make two calls to the task entry: (1) with a time that has already
--- expired, and (2) with a time that will not expire before the quick
--- calculation completes.
---
--- For (1), the sequence of statements following the triggering statement
--- is executed, and the abortable part never starts.
---
--- For (2), the abortable part completes before the triggering statement,
--- the delay is canceled, and the sequence of statements following the
--- triggering statement never starts.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 26 Nov 95 SAIC Bug fix for ACVC 2.0.1.
---
---!
-
-with Report;
-with Ada.Calendar;
-with ImpDef;
-procedure C974002 is
-
- function "-" (Left: Ada.Calendar.Time; Right: Duration )
- return Ada.Calendar.Time renames Ada.Calendar."-";
- function "+" (Left: Ada.Calendar.Time; Right: Duration )
- return Ada.Calendar.Time renames Ada.Calendar."+";
-
- Abortable_Part_Executed : Boolean;
- Triggering_Alternative_Executed : Boolean;
-
-
- --========================================================--
-
-
- procedure Quick_Calculation is
- begin
- if Report.Equal (1, 1) then
- Abortable_Part_Executed := True;
- end if;
- end Quick_Calculation;
-
-
- --========================================================--
-
-
- task type Timed_Calculation_Task is
- entry Calculation (Time_Out : in Ada.Calendar.Time);
- end Timed_Calculation_Task;
-
-
- task body Timed_Calculation_Task is
- begin
- loop
- select
- accept Calculation (Time_Out : in Ada.Calendar.Time) do
-
- -- --
- -- Asynchronous select is tested here --
- -- --
-
- select
- delay until Time_Out; -- Triggering
- -- statement.
-
- Triggering_Alternative_Executed := True; -- Triggering
- -- alternative.
- then abort
- Quick_Calculation; -- Abortable part.
- end select;
- end Calculation;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Timed_Calculation_Task");
- end Timed_Calculation_Task;
-
-
- --========================================================--
-
-
- Start_Time : constant Ada.Calendar.Time :=
- Ada.Calendar.Time_of (1901,1,1);
- Minute : constant Duration := 60.0;
-
-
- --========================================================--
-
-
-begin -- Main program.
-
- Report.Test ("C974002", "Asynchronous Select with Delay_Until");
-
- -- take care of implementations that start the clock at 1/1/01
- delay ImpDef.Delay_For_Time_Past;
-
-
- Abortable_Part_Executed := False;
- Triggering_Alternative_Executed := False;
-
- NO_DELAY_SUBTEST:
-
- declare
- -- Set Expiry to a time which has already passed
- Expiry : constant Ada.Calendar.Time := Start_Time;
- Timed : Timed_Calculation_Task;
- begin
-
- -- Expiry is the time to be specified in the delay_until statement
- -- of the asynchronous select. Since it has already passed, the
- -- abortable part should not execute, and the sequence of statements
- -- of the triggering alternative should be executed.
-
- Timed.Calculation (Time_Out => Expiry); -- Asynchronous select
- -- inside accept block.
- if Abortable_Part_Executed then
- Report.Failed ("No delay: Abortable part was executed");
- end if;
-
- if not Triggering_Alternative_Executed then
- Report.Failed ("No delay: triggering alternative sequence " &
- "of statements was not executed");
- end if;
- end No_Delay_Subtest;
-
-
- Abortable_Part_Executed := False;
- Triggering_Alternative_Executed := False;
-
- LONG_DELAY_SUBTEST:
-
- declare
-
- -- Quick_Calculation should finish before expiry.
- Expiry : constant Ada.Calendar.Time :=
- Ada.Calendar.Clock + Minute;
- Timed : Timed_Calculation_Task;
-
- begin
-
- -- Expiry is the time to be specified in the delay_until statement
- -- of the asynchronous select. It should not pass before the abortable
- -- part completes, at which time control should return to the caller;
- -- the sequence of statements of the triggering alternative should
- -- not be executed.
-
- Timed.Calculation (Time_Out => Expiry); -- Asynchronous select.
-
- if not Abortable_Part_Executed then
- Report.Failed ("Long delay: Abortable part was not executed");
- end if;
-
- if Triggering_Alternative_Executed then
- Report.Failed ("Long delay: triggering alternative sequence " &
- "of statements was executed");
- end if;
- end Long_Delay_Subtest;
-
-
- Report.Result;
-
-end C974002;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974003.a b/gcc/testsuite/ada/acats/tests/c9/c974003.a
deleted file mode 100644
index c353a918db1..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974003.a
+++ /dev/null
@@ -1,249 +0,0 @@
--- C974003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the abortable part of an asynchronous select statement
--- is aborted if it does not complete before the triggering statement
--- completes, where the triggering statement is a task entry call, and
--- the entry call is queued.
---
--- Check that the sequence of statements of the triggering alternative
--- is executed after the abortable part is left.
---
--- TEST DESCRIPTION:
--- Declare a main procedure containing an asynchronous select with a task
--- entry call as triggering statement. Force the entry call to be
--- queued by having the task call a procedure, prior to the corresponding
--- accept statement, which simulates a routine waiting for user input
--- (with a delay).
---
--- Simulate a time-consuming routine in the abortable part by calling a
--- procedure containing an infinite loop. Meanwhile, simulate input by
--- the user (the delay expires), which causes the task to execute the
--- accept statement corresponding to the triggering entry call.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C974003_0 is -- Automated teller machine abstraction.
-
-
- -- Flags for testing purposes:
- --
- TC_Triggering_Statement_Completed : Boolean := False;
- TC_Count : Integer := 1234; -- Global to defeat
- -- optimization.
-
- type Key_Enum is (None, Cancel, Deposit, Withdraw);
-
- type Card_Number_Type is private;
- type Card_PIN_Type is private;
- type ATM_Card_Type is private;
-
-
- Transaction_Canceled : exception;
-
-
- task type ATM_Keyboard_Task is
- entry Cancel_Pressed;
- end ATM_Keyboard_Task;
-
-
- procedure Read_Card (Card : in out ATM_Card_Type);
-
- procedure Validate_Card (Card : in ATM_Card_Type);
-
- procedure Perform_Transaction (Card : in ATM_Card_Type);
-
-private
-
- type Card_Number_Type is range 1 .. 9999;
- type Card_PIN_Type is range 100 .. 999;
-
- type ATM_Card_Type is record
- Number : Card_Number_Type;
- PIN : Card_PIN_Type;
- end record;
-
-end C974003_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-package body C974003_0 is
-
-
- procedure Listen_For_Input (Key : out Key_Enum) is
- begin
- -- Model the situation where the user waits a bit for the card to
- -- be validated, then presses cancel before it completes.
-
- -- Delay long enough to force queuing of Keyboard.Cancel_Pressed.
- delay ImpDef.Minimum_Task_Switch;
-
- if Report.Equal (3, 3) then -- Always true.
- Key := Cancel;
- end if;
- end Listen_For_Input;
-
-
-
- -- One of these gets created as "Keyboard" for each transaction
- --
- task body ATM_Keyboard_Task is
- Key_Pressed : Key_Enum := None;
- begin
- loop
- -- Force entry calls
- Listen_For_Input (Key_Pressed); -- to be queued,
- -- then set guard to
- -- true.
- select
- when (Key_Pressed = Cancel) => -- Guard is now
- accept Cancel_Pressed do -- true, so accept
- TC_Triggering_Statement_Completed := True; -- queued entry
- end Cancel_Pressed; -- call.
-
- -- User has cancelled the transaction so we exit the
- -- loop and allow the task to terminate
- exit;
- else
- Key_Pressed := None;
- end select;
-
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in ATM_Keyboard_Task");
- end ATM_Keyboard_Task;
-
-
-
- procedure Read_Card (Card : in out ATM_Card_Type) is
- begin
- Card.Number := 9999;
- Card.PIN := 111;
- end Read_Card;
-
-
- procedure Validate_Card (Card : in ATM_Card_Type) is
- begin
- -- Simulate an exceedingly long validation activity.
- loop -- Infinite loop.
- TC_Count := (TC_Count + 1) mod Integer (Card.PIN);
- -- Synch. point to allow transfer of control to Keyboard
- -- task during this simulation
- delay ImpDef.Minimum_Task_Switch;
- exit when not Report.Equal (TC_Count, TC_Count); -- Always false.
- end loop;
- end Validate_Card;
-
-
- procedure Perform_Transaction (Card : in ATM_Card_Type) is
- begin
- Report.Failed ("Triggering alternative sequence of statements " &
- "not executed");
- if not TC_Triggering_Statement_Completed then
- Report.Failed ("Triggering statement did not complete");
- end if;
- if TC_Count = 1234 then
- -- Initial value is unchanged
- Report.Failed ("Abortable part did not execute");
- end if;
- end Perform_Transaction;
-
-
-end C974003_0;
-
-
- --==================================================================--
-
-
-with Report;
-
-with C974003_0; -- Automated teller machine abstraction.
-use C974003_0;
-
-procedure C974003 is
-
- Card_Data : ATM_Card_Type;
-
-begin -- Main program.
-
- Report.Test ("C974003", "Asynchronous Select: Trigger is queued on a " &
- "task entry and completes first");
-
- Read_Card (Card_Data);
-
- declare
- -- Create the task for this transaction
- Keyboard : C974003_0.ATM_Keyboard_Task;
- begin
-
- -- --
- -- Asynchronous select is tested here --
- -- --
-
- select
- Keyboard.Cancel_Pressed; -- Entry call is initially queued, so
- -- abortable part starts.
-
- raise Transaction_Canceled; -- This is executed after Validate_Card
- -- is aborted.
- then abort
- Validate_Card (Card_Data); -- Keyboard.Cancel_Pressed is accepted
- -- and completes before this call
- -- finishes; it is then aborted.
-
- -- Check that the whole of the abortable part is aborted, not
- -- just the statement in the abortable part that was executing
- -- at the time
- Report.Failed ("Abortable part not aborted");
-
- end select;
-
- Perform_Transaction (Card_Data); -- Should not be reached.
- exception
- when Transaction_Canceled =>
- if not TC_Triggering_Statement_Completed then
- Report.Failed ("Triggering alternative sequence of statements " &
- "executed but triggering statement not complete");
- end if;
- if TC_Count = 1234 then
- -- Initial value is unchanged
- Report.Failed ("Abortable part did not execute");
- end if;
- end;
-
- Report.Result;
-
-end C974003;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974004.a b/gcc/testsuite/ada/acats/tests/c9/c974004.a
deleted file mode 100644
index b1200c10368..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974004.a
+++ /dev/null
@@ -1,273 +0,0 @@
--- C974004.A
---
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the abortable part of an asynchronous select statement
--- is aborted if it does not complete before the triggering statement
--- completes, where the triggering statement is a task entry call,
--- the entry call is queued, and the entry call completes by propagating
--- an exception and that the sequence of statements of the triggering
--- alternative is not executed after the abortable part is left and that
--- the exception propagated by the entry call is re-raised immediately
--- following the asynchronous select.
---
--- TEST DESCRIPTION:
--- Declare a main procedure containing an asynchronous select with a task
--- entry call as triggering statement. Force the entry call to be
--- queued by having the task call a procedure, prior to the corresponding
--- accept statement, which simulates a routine waiting for user input
--- (with a delay).
---
--- Simulate a time-consuming routine in the abortable part by calling a
--- procedure containing an infinite loop. Meanwhile, simulate input by
--- the user (the delay expires), which causes the task to execute the
--- accept statement corresponding to the triggering entry call. Raise
--- an exception in the accept statement which is not handled by the task,
--- and which is thus propagated to the caller.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C974004_0 is -- Automated teller machine abstraction.
-
-
- -- Flags for testing purposes:
-
- Count : Integer := 1234; -- Global to defeat
- -- optimization.
- Propagated_From_Task : exception;
-
-
- type Key_Enum is (None, Cancel, Deposit, Withdraw);
-
- type Card_Number_Type is private;
- type Card_PIN_Type is private;
- type ATM_Card_Type is private;
-
-
- Transaction_Canceled : exception;
-
-
- task type ATM_Keyboard_Task is
- entry Cancel_Pressed;
- end ATM_Keyboard_Task;
-
-
- procedure Read_Card (Card : in out ATM_Card_Type);
-
- procedure Validate_Card (Card : in ATM_Card_Type);
-
- procedure Perform_Transaction (Card : in ATM_Card_Type);
-
-private
-
- type Card_Number_Type is range 1 .. 9999;
- type Card_PIN_Type is range 100 .. 999;
-
- type ATM_Card_Type is record
- Number : Card_Number_Type;
- PIN : Card_PIN_Type;
- end record;
-
-end C974004_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-package body C974004_0 is
-
-
- procedure Listen_For_Input (Key : out Key_Enum) is
- begin
- -- Simulate the situation where a user waits a bit for the card to
- -- be validated, then presses cancel before it completes.
-
- -- Delay long enough to force queuing of Keyboard.Cancel_Pressed.
- delay ImpDef.Clear_Ready_Queue;
-
- if Report.Equal (3, 3) then -- Always true.
- Key := Cancel;
- end if;
- end Listen_For_Input;
-
-
- -- One of these gets created as "Keyboard" for each transaction
- --
- task body ATM_Keyboard_Task is
- Key_Pressed : Key_Enum := None;
- begin
- loop
- -- Force entry calls to be
- Listen_For_Input (Key_Pressed); -- queued, then set guard to
- -- true.
- select
- when (Key_Pressed = Cancel) => -- Guard is now true, so accept
- accept Cancel_Pressed do -- queued entry call.
- null; --:::: user code for cancel
- -- Now simulate an unexpected exception arising in the
- -- user code
- raise Propagated_From_Task; -- Propagate an exception.
-
- end Cancel_Pressed;
-
- Report.Failed
- ("Exception not propagated in ATM_Keyboard_Task");
-
- -- User has canceled the transaction so we exit the
- -- loop and allow the task to terminate
- exit;
- else
- Key_Pressed := None;
- end select;
- end loop;
- exception
- when Propagated_From_Task =>
- null; -- This is the expected test behavior
- when others =>
- Report.Failed ("Unexpected Exception in ATM_Keyboard_Task");
- end ATM_Keyboard_Task;
-
-
-
- procedure Read_Card (Card : in out ATM_Card_Type) is
- begin
- Card.Number := 9999;
- Card.PIN := 111;
- end Read_Card;
-
-
- procedure Validate_Card (Card : in ATM_Card_Type) is
- begin
- -- Simulate an exceedingly long validation activity.
- loop -- Infinite loop.
- Count := (Count + 1) mod Integer (Card.PIN);
- -- Synch. point to allow transfer of control to Keyboard
- -- task during this simulation
- delay ImpDef.Minimum_Task_Switch;
- exit when not Report.Equal (Count, Count); -- Always false.
- end loop;
- end Validate_Card;
-
-
- procedure Perform_Transaction (Card : in ATM_Card_Type) is
- begin
- Report.Failed ("Exception not re-raised immediately following " &
- "asynchronous select");
- if Count = 1234 then
- -- Initial value is unchanged
- Report.Failed ("Abortable part did not execute");
- end if;
- end Perform_Transaction;
-
-
-end C974004_0;
-
-
- --==================================================================--
-
-
-with Report;
-
-with C974004_0; -- Automated teller machine abstraction.
-use C974004_0;
-
-procedure C974004 is
-
- Card_Data : ATM_Card_Type;
-
-begin -- Main program.
-
- Report.Test ("C974004", "Asynchronous Select: Trigger is queued on a " &
- "task entry and is completed first by an " &
- "exception");
-
- Read_Card (Card_Data);
-
- begin
-
- declare
- -- Create the task for this transaction
- Keyboard : C974004_0.ATM_Keyboard_Task;
- begin
-
- -- --
- -- Asynchronous select is tested here --
- -- --
-
- select
- Keyboard.Cancel_Pressed; -- Entry call initially queued, so
- -- abortable part starts.
-
- raise Transaction_Canceled; -- Should not be executed.
- then abort
- Validate_Card (Card_Data); -- Keyboard.Cancel_Pressed is accepted
- -- and propagates an exception before
- -- this call finishes; it is then
- -- aborted.
-
- -- Check that the whole of the abortable part is aborted, not
- -- just the statement in the abortable part that was executing
- -- at the time
- Report.Failed ("Abortable part not aborted");
- end select;
- -- The propagated exception is
- -- re-raised here; control passes to
- -- the exception handler.
-
- Perform_Transaction(Card_Data); -- Should not be reached.
- exception
- when Transaction_Canceled =>
- Report.Failed ("Triggering alternative sequence of statements " &
- "executed");
- when Propagated_From_Task =>
- -- This is the expected test path
- if Count = 1234 then
- -- Initial value is unchanged
- Report.Failed ("Abortable part did not execute");
- end if;
- when Tasking_Error =>
- Report.Failed ("Tasking_Error raised");
- when others =>
- Report.Failed ("Wrong exception raised");
- end;
-
- exception
- when Propagated_From_Task =>
- Report.Failed ("Correct exception raised at wrong level");
- when others =>
- Report.Failed ("Wrong exception raised at wrong level");
- end;
-
- Report.Result;
-
-end C974004;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974005.a b/gcc/testsuite/ada/acats/tests/c9/c974005.a
deleted file mode 100644
index 196a8edc04c..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974005.a
+++ /dev/null
@@ -1,259 +0,0 @@
--- C974005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Tasking_Error is raised at the point of an entry call
--- which is the triggering statement of an asynchronous select, if
--- the entry call is queued, but the task containing the entry completes
--- before it can be accepted or canceled.
---
--- Check that the abortable part is aborted if it does not complete
--- before the triggering statement completes.
---
--- Check that the sequence of statements of the triggering alternative
--- is not executed.
---
--- TEST DESCRIPTION:
--- Declare a main procedure containing an asynchronous select with a task
--- entry call as triggering statement. Force the entry call to be
--- queued by having the task call a procedure, prior to the corresponding
--- accept statement, which simulates a routine waiting for user input
--- (with a delay).
---
--- Simulate a time-consuming routine in the abortable part by calling a
--- procedure containing an infinite loop. Meanwhile, simulate input by
--- the user (the delay expires) which is NOT the input expected by the
--- guard on the accept statement. The entry remains closed, and the
--- task completes its execution. Since the entry was not accepted before
--- its task completed, Tasking_Error is raised at the point of the entry
--- call.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C974005_0 is -- Automated teller machine abstraction.
-
-
- -- Flags for testing purposes:
-
- Count : Integer := 1234;
-
- type Key_Enum is (None, Cancel, Deposit, Withdraw);
-
- type Card_Number_Type is private;
- type Card_PIN_Type is private;
- type ATM_Card_Type is private;
-
-
- Transaction_Canceled : exception;
-
-
- task type ATM_Keyboard_Task is
- entry Cancel_Pressed;
- end ATM_Keyboard_Task;
-
-
- procedure Read_Card (Card : in out ATM_Card_Type);
-
- procedure Validate_Card (Card : in ATM_Card_Type);
-
- procedure Perform_Transaction (Card : in ATM_Card_Type);
-
-private
-
- type Card_Number_Type is range 1 .. 9999;
- type Card_PIN_Type is range 100 .. 999;
-
- type ATM_Card_Type is record
- Number : Card_Number_Type;
- PIN : Card_PIN_Type;
- end record;
-
-end C974005_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-package body C974005_0 is
-
-
- procedure Listen_For_Input (Key : out Key_Enum) is
- begin
- -- Simulate the situation where a user waits a bit for the card to
- -- be validated, then presses a transaction key (NOT Cancel).
-
- -- Delay long enough to force queuing of Keyboard.Cancel_Pressed.
- delay ImpDef.Clear_Ready_Queue;
-
- if Report.Equal (3, 3) then -- Always true.
- Key := Deposit; -- Cancel is NOT pressed.
- end if;
- end Listen_For_Input;
-
-
- task body ATM_Keyboard_Task is
- Key_Pressed : Key_Enum := None;
- begin
-
- -- Note: no loop. If the user does not press Cancel, the task completes.
- -- In this model of the keyboard monitor, the user only gets one chance
- -- to cancel the card validation.
- -- Force entry
- Listen_For_Input (Key_Pressed); -- calls to be
- -- queued, but do
- -- NOT set guard
- -- to true.
- select
- when (Key_Pressed = Cancel) => -- Guard is false,
- accept Cancel_Pressed do -- so entry call
- Report.Failed ("Accept statement executed"); -- remains queued.
- end Cancel_Pressed;
- else -- Else alternative
- Key_Pressed := None; -- executed, then
- end select; -- task ends.
- exception
- when others =>
- Report.Failed ("Unexpected exception in ATM_Keyboard_Task");
- end ATM_Keyboard_Task;
-
-
-
- procedure Read_Card (Card : in out ATM_Card_Type) is
- begin
- Card.Number := 9999;
- Card.PIN := 111;
- end Read_Card;
-
-
- procedure Validate_Card (Card : in ATM_Card_Type) is
- begin
- -- Simulate an exceedingly long validation activity.
- loop -- Infinite loop.
- Count := (Count + 1) mod Integer (Card.PIN);
-
- -- Synch Point to allow transfer of control to Keyboard task
- -- during this simulation
- delay ImpDef.Minimum_Task_Switch;
-
- exit when not Report.Equal (Count, Count); -- Always false.
- end loop;
- end Validate_Card;
-
-
- procedure Perform_Transaction (Card : in ATM_Card_Type) is
- begin
- Report.Failed ("Exception not re-raised immediately following " &
- "asynchronous select");
- if Count = 1234 then
- -- Additional analysis added to aid developers
- Report.Failed ("Abortable part did not execute");
- end if;
- end Perform_Transaction;
-
-
-end C974005_0;
-
-
- --==================================================================--
-
-
-with Report;
-
-with C974005_0; -- Automated teller machine abstraction.
-use C974005_0;
-
-procedure C974005 is
-
- Card_Data : ATM_Card_Type;
-
-begin -- Main program.
-
- Report.Test ("C974005", "ATC: trigger is queued but task terminates" &
- " before call is serviced");
-
- Read_Card (Card_Data);
-
- begin
-
- declare
- Keyboard : C974005_0.ATM_Keyboard_Task;
- begin
-
- -- --
- -- Asynchronous select is tested here --
- -- --
-
- select
- Keyboard.Cancel_Pressed; -- Entry call initially queued, so
- -- abortable part starts.
-
- -- Tasking_Error raised here when
- -- Keyboard completes before entry
- -- call can be accepted, and before
- -- abortable part completes.
-
- raise Transaction_Canceled; -- Should not be executed.
- then abort
- Validate_Card (Card_Data); -- Keyboard task completes before
- -- Keyboard.Cancel_Pressed is
- -- accepted, and before this call
- -- finishes. Tasking_Error is raised
- -- at the point of the entry call,
- -- and this call is aborted.
- -- Check that the whole of the abortable part is aborted, not just
- -- the statement in the abortable part that was executing at
- -- the time
- Report.Failed ("Abortable part not aborted");
- end select;
- Perform_Transaction (Card_Data); -- Should not be reached.
- exception
- when Transaction_Canceled =>
- Report.Failed ("Triggering alternative sequence of statements " &
- "executed");
- when Tasking_Error =>
- if Count = 1234 then
- Report.Failed ("Abortable part did not execute");
- end if;
- when others =>
- Report.Failed ("Wrong exception raised");
- end;
-
- exception
- when Tasking_Error =>
- Report.Failed ("Correct exception raised at wrong level");
- when others =>
- Report.Failed ("Wrong exception raised at wrong level");
- end;
-
- Report.Result;
-
-end C974005;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974006.a b/gcc/testsuite/ada/acats/tests/c9/c974006.a
deleted file mode 100644
index f6f4d92e869..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974006.a
+++ /dev/null
@@ -1,197 +0,0 @@
--- C974006.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the sequence of statements of the triggering alternative
--- of an asynchronous select statement is executed if the triggering
--- statement is a protected entry call, and the entry is accepted
--- immediately. Check that the corresponding entry body is executed
--- before the sequence of statements of the triggering alternative.
--- Check that the abortable part is not executed.
---
--- TEST DESCRIPTION:
--- Declare a main procedure containing an asynchronous select with a
--- protected entry call as triggering statement. Declare a protected
--- procedure which sets the protected entry's barrier true. Force the
--- entry call to be accepted immediately by calling this protected
--- procedure prior to the asynchronous select. Since the entry call
--- is accepted immediately, the abortable part should never start. When
--- entry call completes, the sequence of statements of the triggering
--- alternative should execute.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-package C974006_0 is -- Automated teller machine abstraction.
-
-
- -- Flag for testing purposes:
-
- Entry_Body_Executed : Boolean := False;
-
-
- type Key_Enum is (None, Cancel, Deposit, Withdraw);
-
- type Card_Number_Type is private;
- type Card_PIN_Type is private;
- type ATM_Card_Type is private;
-
-
- Transaction_Canceled : exception;
-
-
- protected type ATM_Keyboard_Protected is
- entry Cancel_Pressed;
- procedure Read_Key;
- private
- Last_Key_Pressed : Key_Enum := None;
- end ATM_Keyboard_Protected;
-
-
- procedure Read_Card (Card : in out ATM_Card_Type);
-
- procedure Validate_Card (Card : in ATM_Card_Type);
-
- procedure Perform_Transaction (Card : in ATM_Card_Type);
-
-private
-
- type Card_Number_Type is range 1 .. 9999;
- type Card_PIN_Type is range 100 .. 999;
-
- type ATM_Card_Type is record
- Number : Card_Number_Type;
- PIN : Card_PIN_Type;
- end record;
-
-end C974006_0;
-
-
- --==================================================================--
-
-
-with Report;
-package body C974006_0 is
-
-
- protected body ATM_Keyboard_Protected is
-
- entry Cancel_Pressed when (Last_Key_Pressed = Cancel) is
- begin
- Entry_Body_Executed := True;
- end Cancel_Pressed;
-
- procedure Read_Key is
- begin
- -- Simulate a procedure which processes user keyboard input, and
- -- which is called by some interrupt handler.
- Last_Key_Pressed := Cancel;
- end Read_Key;
-
- end ATM_Keyboard_Protected;
-
-
- procedure Read_Card (Card : in out ATM_Card_Type) is
- begin
- Card.Number := 9999;
- Card.PIN := 111;
- end Read_Card;
-
-
- procedure Validate_Card (Card : in ATM_Card_Type) is
- begin
- Report.Failed ("Abortable part executed");
- end Validate_Card;
-
-
- procedure Perform_Transaction (Card : in ATM_Card_Type) is
- begin
- Report.Failed ("Triggering alternative sequence of statements " &
- "not fully executed");
- end Perform_Transaction;
-
-
-end C974006_0;
-
-
- --==================================================================--
-
-
-with Report;
-
-with C974006_0; -- Automated teller machine abstraction.
-use C974006_0;
-
-procedure C974006 is
-
- Card_Data : ATM_Card_Type;
-
-begin
-
- Report.Test ("C974006", "ATC: trigger is protected entry call" &
- " and completes first");
-
- Read_Card (Card_Data);
-
- declare
- Keyboard : C974006_0.ATM_Keyboard_Protected;
- begin
-
- -- Simulate the situation where the user hits cancel before the
- -- validation process can start:
- Keyboard.Read_Key; -- Force Keyboard.Cancel_Pressed to
- -- be accepted immediately.
-
- -- --
- -- Asynchronous select is tested here --
- -- --
-
- select
- Keyboard.Cancel_Pressed; -- Entry call is accepted immediately,
- -- so abortable part does NOT start.
-
- if not Entry_Body_Executed then -- Executes after entry completes.
- Report.Failed ("Triggering alternative sequence of statements " &
- "executed before triggering statement complete");
- end if;
-
- raise Transaction_Canceled; -- Control passes to exception
- -- handler.
- then abort
- Validate_Card (Card_Data); -- Should not be executed.
- end select;
- Perform_Transaction (Card_Data); -- Should not be reached.
- exception
- when Transaction_Canceled =>
- null;
- end;
-
- Report.Result;
-
-end C974006;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974007.a b/gcc/testsuite/ada/acats/tests/c9/c974007.a
deleted file mode 100644
index 07007b9bb56..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974007.a
+++ /dev/null
@@ -1,205 +0,0 @@
--- C974007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the sequence of statements of the triggering alternative
--- of an asynchronous select statement is not executed if the triggering
--- statement is a protected entry call, and the entry is not accepted
--- before the abortable part completes. Check that execution continues
--- immediately following the asynchronous select.
---
--- TEST DESCRIPTION:
--- Declare a main procedure containing an asynchronous select with a
--- protected entry call as triggering statement. Declare a protected
--- procedure which sets the protected entry's barrier true. Ensure
--- that the entry call is never accepted by not calling the protected
--- procedure; the barrier remains false, and the entry call from
--- asynchronous select is queued. Since the abortable part will complete
--- before the entry is accepted, the sequence of statements of the
--- triggering alternative is never executed.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-package C974007_0 is -- Automated teller machine abstraction.
-
-
- -- Flags for testing purposes:
- --
- Abortable_Part_Executed : Boolean := False;
- Perform_Transaction_Executed : Boolean := False;
- Triggering_Statement_Executed : Boolean := False;
-
-
- type Key_Enum is (None, Cancel, Deposit, Withdraw);
-
- type Card_Number_Type is private;
- type Card_PIN_Type is private;
- type ATM_Card_Type is private;
-
-
- Transaction_Canceled : exception;
-
-
- protected type ATM_Keyboard_Protected is
- entry Cancel_Pressed;
- procedure Read_Key;
- private
- Last_Key_Pressed : Key_Enum := None;
- end ATM_Keyboard_Protected;
-
-
- procedure Read_Card (Card : in out ATM_Card_Type);
-
- procedure Validate_Card (Card : in ATM_Card_Type);
-
- procedure Perform_Transaction (Card : in ATM_Card_Type);
-
-private
-
- type Card_Number_Type is range 1 .. 9999;
- type Card_PIN_Type is range 100 .. 999;
-
- type ATM_Card_Type is record
- Number : Card_Number_Type;
- PIN : Card_PIN_Type;
- end record;
-
-end C974007_0;
-
-
- --==================================================================--
-
-
-with Report;
-package body C974007_0 is
-
-
- protected body ATM_Keyboard_Protected is
-
- -- Barrier is false for the live of the test
- entry Cancel_Pressed when (Last_Key_Pressed = Cancel) is
- begin
- Triggering_Statement_Executed := true; -- Test has failed
- -- (Note: cannot call Report.Failed in the protected entry body]
- end Cancel_Pressed;
-
- procedure Read_Key is -- Never
- begin -- called.
- -- Simulate a procedure which reads user keyboard input, and
- -- which is called by some interrupt handler.
- Last_Key_Pressed := Cancel;
- end Read_Key;
-
- end ATM_Keyboard_Protected;
-
-
- procedure Read_Card (Card : in out ATM_Card_Type) is
- begin
- Card.Number := 9999;
- Card.PIN := 111;
- end Read_Card;
-
-
- procedure Validate_Card (Card : in ATM_Card_Type) is
- begin
- Abortable_Part_Executed := True;
- end Validate_Card;
-
-
- procedure Perform_Transaction (Card : in ATM_Card_Type) is
- begin
- Perform_Transaction_Executed := True;
- end Perform_Transaction;
-
-
-end C974007_0;
-
-
- --==================================================================--
-with Report;
-
-with C974007_0; -- Automated teller machine abstraction.
-use C974007_0;
-
-procedure C974007 is
-
- Card_Data : ATM_Card_Type;
-
-begin
-
- Report.Test ("C974007", "ATC: trigger is protected entry call" &
- " and abortable part completes first");
-
- Read_Card (Card_Data);
-
- declare
- Keyboard : C974007_0.ATM_Keyboard_Protected;
- begin
-
- -- --
- -- Asynchronous select is tested here --
- -- --
-
- select
- Keyboard.Cancel_Pressed; -- Barrier is never set true, so
- -- entry call is queued and never
- -- accepted.
-
- raise Transaction_Canceled; -- Should not be executed.
- then abort
- Validate_Card (Card_Data); -- This call completes before
- -- Keyboard.Cancel_Pressed can be
- -- accepted.
- end select;
- Perform_Transaction (Card_Data); -- Execution proceeds here after
- -- Validate_Card completes.
- exception
- when Transaction_Canceled =>
- Report.Failed ("Triggering alternative sequence of statements " &
- "executed");
- end;
-
-
- if Triggering_Statement_Executed then
- Report.Failed ("Triggering statement was executed");
- end if;
-
- if not Abortable_Part_Executed then
- Report.Failed ("Abortable part not executed");
- end if;
-
- if not Perform_Transaction_Executed then
- Report.Failed ("Statements following asynchronous select not " &
- "executed");
- end if;
-
- Report.Result;
-
-end C974007;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974008.a b/gcc/testsuite/ada/acats/tests/c9/c974008.a
deleted file mode 100644
index b76db7bd05e..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974008.a
+++ /dev/null
@@ -1,229 +0,0 @@
--- C974008.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the abortable part of an asynchronous select statement
--- is not started if the triggering statement is a task entry call, and
--- the entry call is not queued.
---
--- Check that the sequence of statements of the triggering alternative
--- is executed after the abortable part is left.
---
--- TEST DESCRIPTION:
--- Declare a main procedure containing an asynchronous select with a task
--- entry call as triggering statement. Ensure that the task is waiting
--- at the accept statement so the rendezvous is executed immediately (the
--- entry call is not queued).
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C974008_0 is -- Automated teller machine abstraction.
-
-
- -- Flags for testing purposes:
-
- Triggering_Statement_Completed : Boolean := False;
- Count : Integer := 1234; -- Global to defeat
- -- optimization.
-
- type Key_Enum is (None, Cancel, Deposit, Withdraw);
-
- type Card_Number_Type is private;
- type Card_PIN_Type is private;
- type ATM_Card_Type is private;
-
-
- Transaction_Canceled : exception;
-
-
- task type ATM_Keyboard_Task is
- entry Cancel_Pressed;
- end ATM_Keyboard_Task;
-
-
- procedure Read_Card (Card : in out ATM_Card_Type);
-
-
- procedure Perform_Transaction (Card : in ATM_Card_Type);
-
-private
-
- type Card_Number_Type is range 1 .. 9999;
- type Card_PIN_Type is range 100 .. 999;
-
- type ATM_Card_Type is record
- Number : Card_Number_Type;
- PIN : Card_PIN_Type;
- end record;
-
-end C974008_0;
-
-
- --==================================================================--
-
-
-with Report;
-package body C974008_0 is
-
-
- procedure Listen_For_Input (Key : out Key_Enum) is
- begin
- -- Simulate the situation where the user presses the cancel key
- -- before the card is validated
-
- -- press the cancel key immediately
- Key := Cancel;
-
- end Listen_For_Input;
-
-
-
- -- One of these gets created as "Keyboard" for each transaction
- --
- task body ATM_Keyboard_Task is
- Key_Pressed : Key_Enum := None;
- begin
- -- NOTE: Normal usage for this routine would be the loop with
- -- the select statement included. This particular test
- -- requires that the task be waiting at the accept
- -- for the call. To ensure that this is the case the
- -- extraneous commands are commented out (we leave them
- -- in this form to show the reader the surrounds to the
- -- fragment of code remaining)
-
- -- loop
-
- Listen_For_Input (Key_Pressed);
-
- -- select
- -- when (Key_Pressed = Cancel) => -- Guard is now
- accept Cancel_Pressed do -- true, so accept
- Triggering_Statement_Completed := True; -- queued entry
- end Cancel_Pressed; -- call.
-
- -- User has cancelled the transaction so we exit the
- -- loop and allow the task to terminate
- -- exit;
- -- else
- -- Key_Pressed := None;
- -- end select;
-
- -- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in ATM_Keyboard_Task");
- end ATM_Keyboard_Task;
-
-
-
- procedure Read_Card (Card : in out ATM_Card_Type) is
- begin
- Card.Number := 9999;
- Card.PIN := 111;
- end Read_Card;
-
-
- procedure Perform_Transaction (Card : in ATM_Card_Type) is
- begin
- Report.Failed ("Triggering alternative sequence of statements " &
- "not executed");
- if not Triggering_Statement_Completed then
- Report.Failed ("Triggering statement did not complete");
- end if;
- end Perform_Transaction;
-
-
-end C974008_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-with C974008_0; -- Automated teller machine abstraction.
-use C974008_0;
-
-procedure C974008 is
-
- Card_Data : ATM_Card_Type;
-
-begin -- Main program.
-
- Report.Test ("C974008", "Asynchronous Select: Trigger is a call to a " &
- "waiting task entry and completes immediately");
-
- Read_Card (Card_Data);
-
- declare
- -- Create the task for this transaction
- Keyboard : C974008_0.ATM_Keyboard_Task;
- begin
-
- -- Ensure task is waiting at the accept
- -- This is the time required to activate another task and allow it
- -- to run to its first accept statement.
- --
- delay ImpDef.Switch_To_New_Task;
-
- -- --
- -- Asynchronous select is tested here --
- -- --
-
- select
- Keyboard.Cancel_Pressed; -- Entry call is executed immediately
-
- raise Transaction_Canceled; -- This is executed after Validate_Card
- -- is aborted.
- then abort
-
- -- In other similar tests Validate_Card is called here. In this
- -- test we just check to see if the abortable part is called at
- -- all. Since the triggering call is not queued the abortable
- -- part should not be started
- --
- Report.Failed ("Abortable part started");
-
- end select;
-
- Perform_Transaction (Card_Data); -- Should not be reached.
- exception
- when Transaction_Canceled =>
-
- if not Triggering_Statement_Completed then
- Report.Failed ("Triggering alternative sequence of statements " &
- "executed but triggering statement not complete");
- end if;
-
- end;
-
- Report.Result;
-
-end C974008;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974009.a b/gcc/testsuite/ada/acats/tests/c9/c974009.a
deleted file mode 100644
index 419f2a3e9ad..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974009.a
+++ /dev/null
@@ -1,206 +0,0 @@
--- C974009.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the abortable part of an asynchronous select statement
--- is not started if the triggering statement is a task entry call,
--- the entry call is not queued and the entry call completes by
--- propagating an exception.
---
--- Check that the exception is properly propagated to the asynchronous
--- select statement and thus the sequence of statements of the triggering
--- alternative is not executed after the abortable part is left.
---
--- Check that the exception propagated by the entry call is re-raised
--- immediately following the asynchronous select.
---
--- TEST DESCRIPTION:
---
--- Use a small subset of the base Automated teller machine simulation
--- which is shown in greater detail in other tests of this series.
--- Declare a main procedure containing an asynchronous select with a task
--- entry call as triggering statement. Force the task to be waiting at
--- the accept statement so that the call is not queued and the rendezvous
--- is executed immediately. Simulate an unexpected exception in the
--- rendezvous. Use stripped down versions of called procedures to check
--- the correct path in the test.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-package C974009_0 is -- Automated teller machine abstraction.
-
-
- Propagated_From_Task : exception;
- Transaction_Canceled : exception;
-
- type Key_Enum is (None, Cancel, Deposit, Withdraw);
-
- type Card_Number_Type is private;
- type Card_PIN_Type is private;
- type ATM_Card_Type is private;
-
- task type ATM_Keyboard_Task is
- entry Cancel_Pressed;
- end ATM_Keyboard_Task;
-
-
- procedure Validate_Card (Card : in ATM_Card_Type);
-
- procedure Perform_Transaction (Card : in ATM_Card_Type);
-
-
-private
-
- type Card_Number_Type is range 1 .. 9999;
- type Card_PIN_Type is range 100 .. 999;
-
- type ATM_Card_Type is record
- Number : Card_Number_Type;
- PIN : Card_PIN_Type;
- end record;
-
-end C974009_0;
-
-
- --==================================================================--
-
-
-with Report;
-package body C974009_0 is
-
-
-
- -- One of these gets created as "Keyboard" for each transaction
- --
- task body ATM_Keyboard_Task is
- Key_Pressed : Key_Enum := None;
- begin
- accept Cancel_Pressed do -- queued entry call.
- null; --:::: stub, user code for cancel
- -- Now simulate an unexpected exception arising in the
- -- user code
- raise Propagated_From_Task; -- Propagate an exception.
-
- end Cancel_Pressed;
-
- Report.Failed ("Exception not propagated in ATM_Keyboard_Task");
-
- exception
- when Propagated_From_Task =>
- null; -- This is the expected test behavior
- when others =>
- Report.Failed ("Unexpected Exception in ATM_Keyboard_Task");
- end ATM_Keyboard_Task;
-
- procedure Validate_Card (Card : in ATM_Card_Type) is
- begin
- Report.Failed ("Abortable part was executed");
- end Validate_Card;
-
-
- procedure Perform_Transaction (Card : in ATM_Card_Type) is
- begin
- Report.Failed ("Exception not re-raised immediately following " &
- "asynchronous select");
- end Perform_Transaction;
-
-
-end C974009_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-with C974009_0; -- Automated teller machine abstraction.
-use C974009_0;
-
-procedure C974009 is
-
- Card_Data : ATM_Card_Type;
-
-begin -- Main program.
-
- Report.Test ("C974009", "Asynchronous Select: Trigger is a call to a " &
- "task entry, is not queued and is completed " &
- "first by an exception");
-
-
- begin
-
- declare
- -- Create the task for this transaction
- Keyboard : C974009_0.ATM_Keyboard_Task;
- begin
-
- -- Ensure task is waiting a the accept so the call is not queued
- -- This is the time required to activate another task and allow it
- -- to run to its first accept statement
- --
- delay ImpDef.Switch_To_New_Task;
-
- -- --
- -- Asynchronous select is tested here --
- -- --
-
- select
-
- Keyboard.Cancel_Pressed;
-
- raise Transaction_Canceled; -- Should not be executed.
- then abort
- Validate_Card (Card_Data); -- Keyboard.Cancel_Pressed is accepted
- -- and propagates an exception before
- -- this call is executed
- end select;
-
- -- The propagated exception is re-raised here.
- Perform_Transaction(Card_Data); -- Should not be reached.
-
- exception
- when Transaction_Canceled =>
- Report.Failed ("Triggering alternative sequence of statements " &
- "executed");
- when Propagated_From_Task =>
- null; -- This is the expected test path
- when others =>
- Report.Failed ("Wrong exception raised");
- end;
-
- exception
- when others =>
- Report.Failed ("Unexpected exception raised");
- end;
-
- Report.Result;
-
-end C974009;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974010.a b/gcc/testsuite/ada/acats/tests/c9/c974010.a
deleted file mode 100644
index caeb9d57059..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974010.a
+++ /dev/null
@@ -1,209 +0,0 @@
--- C974010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the abortable part of an asynchronous select statement
--- is not started if the triggering statement is a task entry call to
--- a task that has already terminated.
---
--- Check that Tasking_Error is properly propagated to the asynchronous
--- select statement and thus the sequence of statements of the triggering
--- alternative is not executed after the abortable part is left.
---
--- Check that Tasking_Error is re-raised immediately following the
--- asynchronous select.
---
--- TEST DESCRIPTION:
---
--- Use a small subset of the base Automated Teller Machine simulation
--- which is shown in greater detail in other tests of this series.
--- Declare a main procedure containing an asynchronous select with a task
--- entry call as triggering statement. Ensure that the task is
--- terminated before the entry call. Use stripped down versions of
--- the called procedures to check the correct path in the test.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package C974010_0 is -- Automated teller machine abstraction.
-
-
- Transaction_Canceled : exception;
-
- type Key_Enum is (None, Cancel, Deposit, Withdraw);
-
- type Card_Number_Type is private;
- type Card_PIN_Type is private;
- type ATM_Card_Type is private;
-
- task type ATM_Keyboard_Task is
- entry Cancel_Pressed;
- end ATM_Keyboard_Task;
-
-
- procedure Validate_Card (Card : in ATM_Card_Type);
-
- procedure Perform_Transaction (Card : in ATM_Card_Type);
-
-
-private
-
- type Card_Number_Type is range 1 .. 9999;
- type Card_PIN_Type is range 100 .. 999;
-
- type ATM_Card_Type is record
- Number : Card_Number_Type;
- PIN : Card_PIN_Type;
- end record;
-
-end C974010_0;
-
-
- --==================================================================--
-
-
-with Report;
-package body C974010_0 is
-
-
-
- -- One of these gets created as "Keyboard" for each transaction
- --
- task body ATM_Keyboard_Task is
- TC_Suicide : exception;
- Key_Pressed : Key_Enum := None;
- begin
- raise TC_Suicide; -- Simulate early, unexpected termination
-
- accept Cancel_Pressed do -- queued entry call.
- null; --:::: user code for cancel
-
- end Cancel_Pressed;
-
- exception
- when TC_Suicide =>
- null; -- This is the expected test behavior
- when others =>
- Report.Failed ("Unexpected Exception in ATM_Keyboard_Task");
- end ATM_Keyboard_Task;
-
- procedure Validate_Card (Card : in ATM_Card_Type) is
- begin
- Report.Failed ("Abortable part was executed");
- end Validate_Card;
-
-
- procedure Perform_Transaction (Card : in ATM_Card_Type) is
- begin
- Report.Failed ("Exception not re-raised immediately following " &
- "asynchronous select");
- end Perform_Transaction;
-
-
-end C974010_0;
-
-
- --==================================================================--
-
-
-with Report;
-with ImpDef;
-
-with C974010_0; -- Automated teller machine abstraction.
-use C974010_0;
-
-procedure C974010 is
-
- Card_Data : ATM_Card_Type;
- TC_Tasking_Error_Handled : Boolean := false;
-
-begin -- Main program.
-
- Report.Test ("C974010", "Asynchronous Select: Trigger is a call to a " &
- "task entry of a task that is already completed");
-
-
- declare
- -- Create the task for this transaction
- Keyboard : C974010_0.ATM_Keyboard_Task;
- begin
-
- -- Ensure the task is already completed before calling
- --
- while not Keyboard'terminated loop
- delay ImpDef.Minimum_Task_Switch;
- end loop;
-
- -- --
- -- Asynchronous select is tested here --
- -- --
-
- select
-
- Keyboard.Cancel_Pressed;
-
- raise Transaction_Canceled; -- Should not be executed.
-
- then abort
-
- -- Since the triggering call is not queued the abortable part
- -- should not be executed.
- --
- Validate_Card (Card_Data);
-
- end select;
- --
- -- The propagated exception is re-raised here.
-
- Perform_Transaction(Card_Data); -- Should not be reached.
-
- exception
- when Transaction_Canceled =>
- Report.Failed ("Triggering alternative sequence of statements " &
- "executed");
- when Tasking_Error =>
- -- This is the expected test path
- TC_Tasking_Error_Handled := true;
- when others =>
- Report.Failed ("Wrong exception raised: ");
- end;
-
-
- if not TC_Tasking_Error_Handled then
- Report.Failed ("Tasking_Error not properly propagated");
- end if;
-
- Report.Result;
-
-exception
- when Tasking_Error =>
- Report.Failed ("Tasking_Error propagated to wrong handler");
- Report.Result;
-
-
-end C974010;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974011.a b/gcc/testsuite/ada/acats/tests/c9/c974011.a
deleted file mode 100644
index 4682db6286d..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974011.a
+++ /dev/null
@@ -1,275 +0,0 @@
--- C974011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the sequence of statements of the triggering alternative
--- of an asynchronous select statement is not executed if the triggering
--- statement is a task entry call and the entry is not accepted
--- before the abortable part completes.
--- Check that the call queued on the entry is cancelled
---
--- TEST DESCRIPTION:
--- Declare a main procedure containing an asynchronous select with a task
--- entry call as triggering statement. Force the entry call to be
--- queued by having the task call a procedure, prior to the corresponding
--- accept statement, which simulates (with a delay) a routine waiting
--- for user input
---
--- Once the call is known to be queued, complete the abortable part.
--- Check that the rendezvous (and thus the trigger) does not complete.
--- Then clear the barrier and check that the entry has been cancelled
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 28 Nov 95 SAIC Eliminated shared global variable for ACVC 2.0.1
---
---!
-
-with ImpDef;
---
-package C974011_0 is -- Automated teller machine abstraction.
-
-
-
- type Key_Enum is (None, Cancel, Deposit, Withdraw);
-
- protected Key_PO is
- procedure Set (K : Key_Enum);
- function Value return Key_Enum;
- private
- Current : Key_Enum := None;
- end Key_PO;
-
-
- -- Flags for testing purposes
- TC_Abortable_Part_Completed : Boolean := False;
- TC_Rendezvous_Entered : Boolean := False;
- TC_Delay_Time : constant duration := ImpDef.Switch_To_New_Task;
-
-
- Count : Integer := 1234; -- Global to defeat optimization.
-
-
- type Card_Number_Type is private;
- type Card_PIN_Type is private;
- type ATM_Card_Type is private;
-
-
- Transaction_Canceled : exception;
-
-
- task type ATM_Keyboard_Task is
- entry Cancel_Pressed;
- end ATM_Keyboard_Task;
-
- procedure Read_Card (Card : in out ATM_Card_Type);
-
- procedure Validate_Card (Card : in ATM_Card_Type);
-
- procedure Perform_Transaction (Card : in ATM_Card_Type);
-
-private
-
- type Card_Number_Type is range 1 .. 9999;
- type Card_PIN_Type is range 100 .. 999;
-
- type ATM_Card_Type is record
- Number : Card_Number_Type;
- PIN : Card_PIN_Type;
- end record;
-
-end C974011_0;
-
-
- --==================================================================--
-
-
-with Report;
-package body C974011_0 is
-
- protected body Key_PO is
- procedure Set (K : Key_Enum) is
- begin
- Current := K;
- end Set;
-
- function Value return Key_Enum is
- begin
- return Current;
- end Value;
- end Key_PO;
-
-
- procedure Listen_For_Input (Key : out Key_Enum) is
- begin
- -- Model the situation where the user does not press cancel thus
- -- allowing validation to complete
-
- delay TC_Delay_Time; -- Long enough to force queuing on
- -- Keyboard.Cancel_Pressed.
-
- Key := Key_PO.Value;
-
- end Listen_For_Input;
-
-
-
- -- One of these gets created as "Keyboard" for each transaction
- --
- task body ATM_Keyboard_Task is
- Key_Pressed : Key_Enum;
- begin
- loop
- -- Force entry calls
- Listen_For_Input (Key_Pressed); -- to be queued,
-
- select
- when (Key_Pressed = Cancel) =>
- accept Cancel_Pressed do
- TC_Rendezvous_Entered := True;
- end Cancel_Pressed;
-
- -- User has cancelled the transaction so we exit the
- -- loop and allow the task to terminate
- exit;
- else
- delay ImpDef.Switch_To_New_Task;
- end select;
-
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected Exception in ATM_Keyboard_Task");
- end ATM_Keyboard_Task;
-
-
-
- procedure Read_Card (Card : in out ATM_Card_Type) is
- begin
- Card.Number := 9999;
- Card.PIN := 111;
- end Read_Card;
-
-
- procedure Validate_Card (Card : in ATM_Card_Type) is
- begin
- Count := (Count + 1) mod Integer (Card.PIN);
-
- -- Simulate a validation activity which is longer than the time
- -- taken in Listen_For_Input but not inordinately so.
- delay TC_Delay_Time * 2;
-
- end Validate_Card;
-
-
- procedure Perform_Transaction (Card : in ATM_Card_Type) is
- begin
- if TC_Rendezvous_Entered then
- Report.Failed ("Triggering statement completed");
- end if;
- if Count = 1234 then
- -- Initial value is unchanged
- Report.Failed ("Abortable part did not execute");
- end if;
- if not TC_Abortable_Part_Completed then
- Report.Failed ("Abortable part did not complete");
- end if;
- end Perform_Transaction;
-
-
-end C974011_0;
-
-
- --==================================================================--
-
-
-with Report;
-
-with C974011_0; -- Automated teller machine abstraction.
-use C974011_0;
-
-procedure C974011 is
-
- Card_Data : ATM_Card_Type;
-
-begin -- Main program.
-
- Report.Test ("C974011", "Asynchronous Select: Trigger is queued on a " &
- "task entry and the abortable part " &
- "completes first");
-
- Read_Card (Card_Data);
-
- declare
- -- Create the task for this transaction
- Keyboard : C974011_0.ATM_Keyboard_Task;
- begin
-
- -- --
- -- Asynchronous select is tested here --
- -- --
-
- select
-
- Keyboard.Cancel_Pressed; -- Entry call is initially queued, so
- -- abortable part starts.
- raise Transaction_Canceled; -- This would be executed if we
- -- completed the rendezvous
- then abort
-
- Validate_Card (Card_Data);
- TC_Abortable_Part_Completed := true;
-
- end select;
-
- Perform_Transaction (Card_Data);
-
-
- -- Now clear the entry barrier to allow the rendezvous to complete
- -- if the triggering call has not been cancelled
- Key_PO.Set (Cancel);
- --
- delay TC_Delay_Time; -- to allow it all to take place
-
- if TC_Rendezvous_Entered then
- Report.Failed ("Triggering Call was not cancelled");
- end if;
-
- abort Keyboard; -- clean up. (Note: the task will only exit the
- -- loop and terminate if the call hanging on the
- -- entry is executed.)
-
- exception
- when Transaction_Canceled =>
- Report.Failed ("Triggering alternative sequence of statements " &
- "executed");
- when Others =>
- Report.Failed ("Unexpected exception in the Main");
- end;
-
- Report.Result;
-
-end C974011;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974012.a b/gcc/testsuite/ada/acats/tests/c9/c974012.a
deleted file mode 100644
index 4e43c72a842..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974012.a
+++ /dev/null
@@ -1,165 +0,0 @@
--- C974012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the abortable part of an asynchronous select statement is
--- aborted if it does not complete before the triggering statement
--- completes, where the triggering statement is a call on a protected
--- entry which is queued.
---
--- TEST DESCRIPTION:
--- A fraction of in-line code is simulated. A voltage deficiency causes
--- the routine to seek an alternate best-cost route on an electrical grid
--- system.
---
--- An asynchronous select is used with the triggering alternative being a
--- call to a protected entry with a barrier. The abortable part is a
--- routine simulating the lengthy alternate path negotiation. The entry
--- barrier would be cleared if the voltage deficiency is rectified before
--- the alternate can be found thus nullifying the need for the alternate.
---
--- The test simulates a return to normal in the middle of the
--- negotiation. The barrier is cleared, the triggering alternative
--- completes first and the abortable part should be aborted.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-with Report;
-with ImpDef;
-
-procedure C974012 is
-
- subtype Grid_Path is string(1..21);
- subtype Deficiency is integer range 100..1_000; -- in MWh
-
- New_Path : Grid_Path;
- Dummy_Deficiency : Deficiency := 520;
- Path_Available : Boolean := false;
-
- TC_Terminate_Negotiation_Executed : Boolean := false;
- TC_Trigger_Completed : Boolean := false;
- TC_Negotiation_Completed : Boolean := false;
-
- protected Local_Deficit is
- procedure Set_Good_Voltage;
- procedure Bad_Voltage;
- entry Terminate_Negotiation;
- private
- Good_Voltage : Boolean := false; -- barrier
- end Local_Deficit;
-
- protected body Local_Deficit is
-
- procedure Set_Good_Voltage is
- begin
- Good_Voltage := true;
- end Set_Good_Voltage;
-
- procedure Bad_Voltage is
- begin
- Good_Voltage := false;
- end Bad_Voltage;
-
- -- Trigger is queued on this entry with barrier condition
- entry Terminate_Negotiation when Good_Voltage is
- begin
- -- complete the triggering call thus terminating grid_path
- -- negotiation.
- null; --::: stub - signal main board
- TC_Terminate_Negotiation_Executed := true; -- show path traversal
- end Terminate_Negotiation;
-
- end Local_Deficit;
-
-
- -- Routine to find the most cost effective grid path for this
- -- particular deficiency at this particular time
- --
- procedure Path_Negotiation (Requirement : in Deficiency;
- Best_Path : out Grid_Path ) is
-
- Dummy_Path : Grid_Path := "NYC.425_NY.227_NH.132";
- Match : Deficiency := Report.Ident_Int (Requirement);
-
- begin
- --
- null; --::: stub
- --
- -- Simulate a lengthy path negotiation
- for i in 1..5 loop
- delay ImpDef.Minimum_Task_Switch;
- -- Part of the way through the negotiation simulate some external
- -- event returning the voltage to acceptable level
- if i = 3 then
- Local_Deficit.Set_Good_Voltage; -- clear the barrier
- end if;
- end loop;
-
- Best_Path := Dummy_Path;
- TC_Negotiation_Completed := true;
-
- end Path_Negotiation;
-
-
-
-begin
-
- Report.Test ("C974012", "Asynchronous Select: Trigger is queued on a " &
- "protected entry and completes before the " &
- "abortable part");
-
- -- ::::::::: Fragment of code
-
- Local_Deficit.Bad_Voltage; -- Set barrier condition
-
- -- For the given voltage deficiency start negotiating the best grid
- -- path. If voltage returns to acceptable level cancel the negotiation
- --
- select
- -- Prepare to terminate the Path_Negotiation if voltage improves
- Local_Deficit.Terminate_Negotiation;
- TC_Trigger_Completed := true;
- then abort
- Path_Negotiation (Dummy_Deficiency, New_Path) ;
- Path_Available := true;
- end select;
- -- :::::::::
-
- if not TC_Terminate_Negotiation_Executed or else not
- TC_Trigger_Completed then
- Report.Failed ("Unexpected test path taken");
- end if;
-
- if Path_Available or else TC_Negotiation_Completed then
- Report.Failed ("Abortable part was not aborted");
- end if;
- Report.Result;
-
-end C974012;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974013.a b/gcc/testsuite/ada/acats/tests/c9/c974013.a
deleted file mode 100644
index 4a930da93b3..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974013.a
+++ /dev/null
@@ -1,167 +0,0 @@
--- C974013.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the abortable part of an asynchronous select statement
--- is aborted if it does not complete before the triggering statement
--- completes, where the triggering statement is a delay_until
--- statement.
---
--- Check that the sequence of statements of the triggering alternative
--- is executed after the abortable part is left.
---
--- TEST DESCRIPTION:
--- Declare a task with an accept statement containing an asynchronous
--- select with a delay_until triggering statement. Parameterize
--- the accept statement with the amount of time to be added to the
--- current time to be used for the delay. Simulate a time-consuming
--- calculation by declaring a procedure containing an infinite loop.
--- Call this procedure in the abortable part.
---
--- The delay will expire before the abortable part completes, at which
--- time the abortable part is aborted, and the sequence of statements
--- following the triggering statement is executed.
---
--- Main test logic is identical to c974001 which uses simple delay
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 28 Nov 95 SAIC Fixed problems for ACVC 2.0.1.
---
---!
-
-with Report;
-with ImpDef;
-with Ada.Calendar;
-
-procedure C974013 is
-
-
- --========================================================--
-
- function "+" (Left : Ada.Calendar.Time; Right: Duration)
- return Ada.Calendar.Time renames Ada.Calendar."+";
-
-
- Allotted_Time : constant Duration := ImpDef.Switch_To_New_Task;
- Calculation_Canceled : exception;
-
- Count : Integer := 1234;
- procedure Lengthy_Calculation is
- begin
- -- Simulate a non-converging calculation.
- loop -- Infinite loop.
- Count := (Count + 1) mod 10;
- exit when not Report.Equal (Count, Count); -- Condition always false.
- delay 0.0; -- abort completion point
- end loop;
- end Lengthy_Calculation;
-
-
- --========================================================--
-
-
- task type Timed_Calculation is
- entry Calculation (Time_Limit : in Duration);
- end Timed_Calculation;
-
-
- task body Timed_Calculation is
- Delay_Time : Ada.Calendar.Time;
- begin
- loop
- select
- accept Calculation (Time_Limit : in Duration) do
-
- -- We have to construct an "until" time artificially
- -- as we have no control over when the test will be run
- --
- Delay_Time := Ada.Calendar.Clock + Time_Limit;
-
- -- --
- -- Asynchronous select is tested here --
- -- --
-
- select
-
- delay until Delay_Time; -- Time not reached yet, so
- -- Lengthy_Calculation starts.
-
- raise Calculation_Canceled; -- This is executed after
- -- Lengthy_Calculation aborted.
-
- then abort
-
- Lengthy_Calculation; -- Delay expires before complete,
- -- so this call is aborted.
- -- Check that the whole of the abortable part is aborted,
- -- not just the statement in the abortable part that was
- -- executing at the time
- Report.Failed ("Abortable part not aborted");
-
- end select;
-
- Report.Failed ("Triggering alternative sequence of " &
- "statements not executed");
-
- exception -- New Ada 9x: handler within accept
- when Calculation_Canceled =>
- if Count = 1234 then
- Report.Failed ("Abortable part did not execute");
- end if;
- end Calculation;
- or
- terminate;
- end select;
- end loop;
- exception
- when others =>
- Report.Failed ("Unexpected exception in Timed_Calculation task");
- end Timed_Calculation;
-
-
- --========================================================--
-
-
-
-begin -- Main program.
-
- Report.Test ("C974013", "Asynchronous Select: Trigger is delay_until " &
- "which completes before abortable part");
-
- declare
- Timed : Timed_Calculation; -- Task.
- begin
- Timed.Calculation (Time_Limit => Allotted_Time); -- Asynchronous select
- -- inside accept block.
- exception
- when Calculation_Canceled =>
- Report.Failed ("wrong exception handler used");
- end;
-
- Report.Result;
-
-end C974013;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c974014.a b/gcc/testsuite/ada/acats/tests/c9/c974014.a
deleted file mode 100644
index 03ca915f896..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c974014.a
+++ /dev/null
@@ -1,132 +0,0 @@
--- C974014.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the triggering alternative of an asynchronous select
--- statement is a delay and the abortable part completes before the delay
--- expires then the delay is cancelled and the optional statements in the
--- triggering part are not performed. In particular, check the case of
--- the ATC in non-tasking code.
---
--- TEST DESCRIPTION:
--- A fraction of in-line code is simulated. An asynchronous select
--- is used with a triggering delay of several minutes. The abortable
--- part, which is simulating a very lengthy, time consuming procedure
--- actually returns almost immediately thus ensuring that it completes
--- first. At the conclusion, if a substantial amount of time has passed
--- the delay is assumed not to have been cancelled.
--- (based on example in LRM 9.7.4)
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-with Report;
-with Ada.Calendar;
-
-procedure C974014 is
-
- function "-" (Left, Right : Ada.Calendar.Time)
- return Duration renames Ada.Calendar."-";
-
- TC_Start_Time : Ada.Calendar.Time := Ada.Calendar.Clock;
- TC_Elapsed_Time : duration;
-
- Maximum_Allowable_Time : duration := 300.0; -- for Calculate_Gamma_Function
-
-begin
-
- Report.Test ("C974014", "ATC: When abortable part completes before " &
- "a triggering delay, check that the delay " &
- "is cancelled & optional statements " &
- "are not performed");
-
- declare -- encapsulate test code
-
- type Gamma_Index is digits 5; -- float precision
-
- -- (These two fields are assumed filled elsewhere)
- Input_Field, Result_of_Beta : Gamma_Index;
-
- -- Notify and take corrective action in the event that
- -- the procedure Calculate_Gamma_Function does not converge.
- --
- procedure Non_Convergent is
- begin
- null; -- stub
-
- Report.Failed ("Optional statements in triggering part" &
- " were performed");
- end Non_Convergent;
-
-
- -- This is a very time consuming calculation. It is possible,
- -- that, with certain parameters, it will not converge. If it
- -- runs for more than Maximum_Allowable_Time it is considered
- -- not to be convergent and should be aborted.
- --
- Procedure Calculate_Gamma_Function (X, Y : Gamma_Index) is
- begin
- null; -- Stub
- --
- end Calculate_Gamma_Function;
-
- begin -- declare
-
- -- ..... Isolated segment of inline code
-
- -- Now Print Gamma Function (abort and display if not convergent)
- --
- select
- delay Maximum_Allowable_Time; -- for Calculate_Gamma_Function
- Non_Convergent; -- Display error and flag result as failed
-
- then abort
- Calculate_Gamma_Function (Input_Field, Result_of_Beta);
- end select;
-
- -- ..... End of Isolated segment of inline code
-
- end; -- declare
-
- TC_Elapsed_Time := Ada.Calendar.Clock - TC_Start_Time;
-
- -- Note: We are not checking for "cancellation within a reasonable time",
- -- we are checking for cancellation/non-cancellation of the delay. We
- -- use a number which, if exceeded, means that the delay was not
- -- cancelled and has proceeded to full term.
- --
- if ( TC_Elapsed_Time > Maximum_Allowable_Time/2 ) then
- -- Test time exceeds a reasonable value.
- Report.Failed ("Triggering delay statement was not cancelled");
- end if;
-
-
- Report.Result;
-
-end C974014;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c980001.a b/gcc/testsuite/ada/acats/tests/c9/c980001.a
deleted file mode 100644
index 3bd4196f0ec..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c980001.a
+++ /dev/null
@@ -1,303 +0,0 @@
--- C980001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that when a construct is aborted the execution of an Initialize
--- procedure as the last step of the default initialization of a
--- controlled object is abort-deferred.
---
--- Check that when a construct is aborted the execution of a Finalize
--- procedure as part of the finalization of a controlled object is
--- abort-deferred.
---
--- Check that an assignment operation to an object with a controlled
--- part is an abort-deferred operation.
---
--- TEST DESCRIPTION:
--- The controlled operations which are being tested call a subprogram
--- which guarantees that the enclosing operation becomes aborted.
---
--- Each object is created with a unique value to prevent optimizations
--- due to the values being the same.
---
--- Two protected objects are utilized to warrant that the operations
--- are delayed in their execution until such time that the abort is
--- processed. The object Hold_Up is used to hold the targeted
--- operation in execution, the object Progress is used to communicate
--- to the driver software that progress is indeed being made.
---
---
--- CHANGE HISTORY:
--- 01 MAY 95 SAIC Initial version
--- 01 MAY 96 SAIC Revised for 2.1
--- 11 DEC 96 SAIC Final revision for 2.1
--- 02 DEC 97 EDS Remove 2 calls to C980001_0.Hold_Up.Lock
---!
-
----------------------------------------------------------------- C980001_0
-
-with Impdef;
-with Ada.Finalization;
-package C980001_0 is
-
- A_Little_While : constant Duration := Impdef.Switch_To_New_Task * 2.0;
- Enough_Time_For_The_Controlled_Operation_To_Happen : constant Duration
- := Impdef.Switch_To_New_Task * 4.0;
-
- function TC_Unique return Integer;
-
- type Sticks_In_Initialize is new Ada.Finalization.Controlled with record
- Item: Integer := TC_Unique;
- end record;
- procedure Initialize( AV: in out Sticks_In_Initialize );
-
- type Sticks_In_Adjust is new Ada.Finalization.Controlled with record
- Item: Integer := TC_Unique;
- end record;
- procedure Adjust ( AV: in out Sticks_In_Adjust );
-
- type Sticks_In_Finalize is new Ada.Finalization.Controlled with record
- Item: Integer := TC_Unique;
- end record;
- procedure Finalize ( AV: in out Sticks_In_Finalize );
-
- Initialize_Called : Boolean := False;
- Adjust_Called : Boolean := False;
- Finalize_Called : Boolean := False;
-
- protected type Sticker is
- entry Lock;
- procedure Unlock;
- function Is_Locked return Boolean;
- private
- Locked : Boolean := False;
- end Sticker;
-
- Hold_Up : Sticker;
- Progress : Sticker;
-
- procedure Fail_And_Clear( Message : String );
-
-
-end C980001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-with TCTouch;
-package body C980001_0 is
-
- TC_Master_Value : Integer := 0;
-
-
- function TC_Unique return Integer is -- make all values unique.
- begin
- TC_Master_Value := TC_Master_Value +1;
- return TC_Master_Value;
- end TC_Unique;
-
- protected body Sticker is
-
- entry Lock when not Locked is
- begin
- Locked := True;
- end Lock;
-
- procedure Unlock is
- begin
- Locked := False;
- end Unlock;
-
- function Is_Locked return Boolean is
- begin
- return Locked;
- end Is_Locked;
-
- end Sticker;
-
- procedure Initialize( AV: in out Sticks_In_Initialize ) is
- begin
- TCTouch.Touch('I'); -------------------------------------------------- I
- Hold_Up.Unlock; -- cause the select to abort
- Initialize_Called := True;
- AV.Item := TC_Unique;
- TCTouch.Touch('i'); -------------------------------------------------- i
- Progress.Unlock; -- allows Wait_Your_Turn to continue
- end Initialize;
-
- procedure Adjust ( AV: in out Sticks_In_Adjust ) is
- begin
- TCTouch.Touch('A'); -------------------------------------------------- A
- Hold_Up.Unlock; -- cause the select to abort
- Adjust_Called := True;
- AV.Item := TC_Unique;
- TCTouch.Touch('a'); -------------------------------------------------- a
- Progress.Unlock;
- end Adjust;
-
- procedure Finalize ( AV: in out Sticks_In_Finalize ) is
- begin
- TCTouch.Touch('F'); -------------------------------------------------- F
- Hold_Up.Unlock; -- cause the select to abort
- Finalize_Called := True;
- AV.Item := TC_Unique;
- TCTouch.Touch('f'); -------------------------------------------------- f
- Progress.Unlock;
- end Finalize;
-
- procedure Fail_And_Clear( Message : String ) is
- begin
- Report.Failed(Message);
- Hold_Up.Unlock;
- Progress.Unlock;
- end Fail_And_Clear;
-
-end C980001_0;
-
----------------------------------------------------------------------------
-
-with Report;
-with TCTouch;
-with Impdef;
-with C980001_0;
-procedure C980001 is
-
- procedure Check_Initialize_Conditions is
- begin
- if not C980001_0.Initialize_Called then
- C980001_0.Fail_And_Clear("Initialize did not correctly complete");
- end if;
- TCTouch.Validate("Ii", "Initialization Sequence");
- end Check_Initialize_Conditions;
-
- procedure Check_Adjust_Conditions is
- begin
- if not C980001_0.Adjust_Called then
- C980001_0.Fail_And_Clear("Adjust did not correctly complete");
- end if;
- TCTouch.Validate("Aa", "Adjust Sequence");
- end Check_Adjust_Conditions;
-
- procedure Check_Finalize_Conditions is
- begin
- if not C980001_0.Finalize_Called then
- C980001_0.Fail_And_Clear("Finalize did not correctly complete");
- end if;
- TCTouch.Validate("FfFfFf", "Finalization Sequence",
- Order_Meaningful => False);
- end Check_Finalize_Conditions;
-
- procedure Wait_Your_Turn is
- Overrun : Natural := 0;
- begin
- while C980001_0.Progress.Is_Locked loop -- and waits
- delay C980001_0.A_Little_While;
- Overrun := Overrun +1;
- if Overrun > 10 then
- C980001_0.Fail_And_Clear("Overrun expired lock");
- end if;
- end loop;
- end Wait_Your_Turn;
-
-begin -- Main test procedure.
-
- Report.Test ("C980001", "Check the interaction between asynchronous " &
- "transfer of control and controlled types" );
-
- C980001_0.Progress.Lock;
- C980001_0.Hold_Up.Lock;
-
- select
- C980001_0.Hold_Up.Lock; -- Init will unlock
-
- Wait_Your_Turn; -- abortable part is stuck in Initialize
- Check_Initialize_Conditions;
-
- then abort
- declare
- Object : C980001_0.Sticks_In_Initialize;
- begin
- delay Impdef.Minimum_Task_Switch;
- if Report.Ident_Int( Object.Item ) /= Object.Item then
- Report.Failed("Optimization foil caused failure");
- end if;
- C980001_0.Fail_And_Clear(
- "Initialize test executed beyond expected region");
- end;
- end select;
-
- C980001_0.Progress.Lock;
-
- select
- C980001_0.Hold_Up.Lock; -- Adjust will unlock
-
- Wait_Your_Turn; -- abortable part is stuck in Adjust
- Check_Adjust_Conditions;
-
- then abort
- declare
- Object1 : C980001_0.Sticks_In_Adjust;
- Object2 : C980001_0.Sticks_In_Adjust;
- begin
- Object1 := Object2;
- delay Impdef.Minimum_Task_Switch;
- if Report.Ident_Int( Object2.Item )
- /= Report.Ident_Int( Object1.Item ) then
- Report.Failed("Optimization foil 1 caused failure");
- end if;
- C980001_0.Fail_And_Clear("Adjust test executed beyond expected region");
- end;
- end select;
-
- C980001_0.Progress.Lock;
-
- select
- C980001_0.Hold_Up.Lock; -- Finalize will unlock
-
- Wait_Your_Turn; -- abortable part is stuck in Finalize
- Check_Finalize_Conditions;
-
- then abort
- declare
- Object1 : C980001_0.Sticks_In_Finalize;
- Object2 : C980001_0.Sticks_In_Finalize;
- begin
- Object1 := Object2; -- cause a finalize call
- delay Impdef.Minimum_Task_Switch;
- if Report.Ident_Int( Object2.Item )
- /= Report.Ident_Int( Object1.Item ) then
- Report.Failed("Optimization foil 2 caused failure");
- end if;
- C980001_0.Fail_And_Clear(
- "Finalize test executed beyond expected region");
- end;
- end select;
-
- Report.Result;
-
-exception
- when others => C980001_0.Fail_And_Clear("Exception in main");
- Report.Result;
-end C980001;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c980002.a b/gcc/testsuite/ada/acats/tests/c9/c980002.a
deleted file mode 100644
index f2b9c52479c..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c980002.a
+++ /dev/null
@@ -1,165 +0,0 @@
--- C980002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that aborts are deferred during protected actions.
---
--- TEST DESCRIPTION:
--- This test uses an asynchronous transfer of control to attempt
--- to abort a protected operation. The protected operation
--- includes several requeues to check that the requeue does not
--- allow the abort to occur.
---
---
--- CHANGE HISTORY:
--- 30 OCT 95 SAIC ACVC 2.1
---
---!
-
-with Report;
-procedure C980002 is
-
- Max_Checkpoints : constant := 7;
- type Checkpoint_ID is range 1..Max_Checkpoints;
- type Points_Array is array (Checkpoint_ID) of Boolean;
-begin
- Report.Test ("C980002",
- "Check that aborts are deferred during a protected action" &
- " including requeues");
-
- declare -- test encapsulation
-
- protected Checkpoint is
- procedure Got_Here (Id : Checkpoint_ID);
- function Results return Points_Array;
- private
- Reached_Points : Points_Array := (others => False);
- end Checkpoint;
-
- protected body Checkpoint is
- procedure Got_Here (Id : Checkpoint_ID) is
- begin
- Reached_Points (Id) := True;
- end Got_Here;
-
- function Results return Points_Array is
- begin
- return Reached_Points;
- end Results;
- end Checkpoint;
-
-
- protected Start_Here is
- entry AST_Waits_Here;
- entry Start_PO;
- private
- Open : Boolean := False;
- entry First_Stop;
- end Start_Here;
-
- protected Middle_PO is
- entry Stop_1;
- entry Stop_2;
- end Middle_PO;
-
- protected Final_PO is
- entry Final_Stop;
- end Final_PO;
-
-
- protected body Start_Here is
- entry AST_Waits_Here when Open is
- begin
- null;
- end AST_Waits_Here;
-
- entry Start_PO when True is
- begin
- Open := True;
- Checkpoint.Got_Here (1);
- requeue First_Stop;
- end Start_PO;
-
- -- make sure the AST has been accepted before continuing
- entry First_Stop when AST_Waits_Here'Count = 0 is
- begin
- Checkpoint.Got_Here (2);
- requeue Middle_PO.Stop_1;
- end First_Stop;
- end Start_Here;
-
- protected body Middle_PO is
- entry Stop_1 when True is
- begin
- Checkpoint.Got_Here (3);
- requeue Stop_2;
- end Stop_1;
-
- entry Stop_2 when True is
- begin
- Checkpoint.Got_Here (4);
- requeue Final_PO.Final_Stop;
- end Stop_2;
- end Middle_PO;
-
- protected body Final_PO is
- entry Final_Stop when True is
- begin
- Checkpoint.Got_Here (5);
- end Final_Stop;
- end Final_PO;
-
-
- begin -- test encapsulation
- select
- Start_Here.AST_Waits_Here;
- Checkpoint.Got_Here (6);
- then abort
- Start_Here.Start_PO;
- delay 0.0; -- abort completion point
- Checkpoint.Got_Here (7);
- end select;
-
- Check_The_Results: declare
- Chk : constant Points_Array := Checkpoint.Results;
- Expected : constant Points_Array := (1..6 => True,
- 7 => False);
- begin
- for I in Checkpoint_ID loop
- if Chk (I) /= Expected (I) then
- Report.Failed ("checkpoint error" &
- Checkpoint_ID'Image (I) &
- " actual is " &
- Boolean'Image (Chk(I)));
- end if;
- end loop;
- end Check_The_Results;
- exception
- when others =>
- Report.Failed ("unexpected exception");
- end; -- test encapsulation
-
- Report.Result;
-end C980002;
diff --git a/gcc/testsuite/ada/acats/tests/c9/c980003.a b/gcc/testsuite/ada/acats/tests/c9/c980003.a
deleted file mode 100644
index dd69fc7ee68..00000000000
--- a/gcc/testsuite/ada/acats/tests/c9/c980003.a
+++ /dev/null
@@ -1,294 +0,0 @@
--- C980003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- TEST OBJECTIVE:
--- Check that aborts are deferred during the execution of an
--- Initialize procedure (as the last step of the default
--- initialization of a controlled object), during the execution
--- of a Finalize procedure (as part of the finalization of a
--- controlled object), and during an assignment operation to an
--- object with a controlled part.
---
--- TEST DESCRIPTION:
--- A controlled type is created with Initialize, Adjust, and
--- Finalize operations. These operations note in a protected
--- object when the operation starts and completes. This change
--- in state of the protected object will open the barrier for
--- the entry in the protected object.
--- The test contains declarations of objects of the controlled
--- type. An asynchronous select is used to attempt to abort
--- the operations on the controlled type. The asynchronous select
--- makes use of the state change to the protected object to
--- trigger the abort.
---
---
--- CHANGE HISTORY:
--- 11 Jan 96 SAIC Initial Release for 2.1
--- 5 May 96 SAIC Incorporated Reviewer comments.
--- 10 Oct 96 SAIC Addressed issue where assignment statement
--- can be 2 assignment operations.
---
---!
-
-with Ada.Finalization;
-package C980003_0 is
- Verbose : constant Boolean := False;
-
- -- the following flag is set true whenever the
- -- Initialize operation is called.
- Init_Occurred : Boolean;
-
- type Is_Controlled is new Ada.Finalization.Controlled with
- record
- Id : Integer;
- end record;
-
- procedure Initialize (Object : in out Is_Controlled);
- procedure Finalize (Object : in out Is_Controlled);
- procedure Adjust (Object : in out Is_Controlled);
-
- type States is (Unknown,
- Start_Init, Finished_Init,
- Start_Adjust, Finished_Adjust,
- Start_Final, Finished_Final);
-
- protected State_Manager is
- procedure Reset;
- procedure Set (New_State : States);
- function Current return States;
- entry Wait_For_Change;
- private
- Current_State : States := Unknown;
- Changed : Boolean := False;
- end State_Manager;
-
-end C980003_0;
-
-
-with Report;
-with ImpDef;
-package body C980003_0 is
- protected body State_Manager is
- procedure Reset is
- begin
- Current_State := Unknown;
- Changed := False;
- end Reset;
-
- procedure Set (New_State : States) is
- begin
- Changed := True;
- Current_State := New_State;
- end Set;
-
- function Current return States is
- begin
- return Current_State;
- end Current;
-
- entry Wait_For_Change when Changed is
- begin
- Changed := False;
- end Wait_For_Change;
- end State_Manager;
-
- procedure Initialize (Object : in out Is_Controlled) is
- begin
- if Verbose then
- Report.Comment ("starting initialize");
- end if;
- State_Manager.Set (Start_Init);
- if Verbose then
- Report.Comment ("in initialize");
- end if;
- delay ImpDef.Switch_To_New_Task; -- tempting place for abort
- State_Manager.Set (Finished_Init);
- if Verbose then
- Report.Comment ("finished initialize");
- end if;
- Init_Occurred := True;
- end Initialize;
-
- procedure Finalize (Object : in out Is_Controlled) is
- begin
- if Verbose then
- Report.Comment ("starting finalize");
- end if;
- State_Manager.Set (Start_Final);
- if Verbose then
- Report.Comment ("in finalize");
- end if;
- delay ImpDef.Switch_To_New_Task; -- tempting place for abort
- State_Manager.Set (Finished_Final);
- if Verbose then
- Report.Comment ("finished finalize");
- end if;
- end Finalize;
-
- procedure Adjust (Object : in out Is_Controlled) is
- begin
- if Verbose then
- Report.Comment ("starting adjust");
- end if;
- State_Manager.Set (Start_Adjust);
- if Verbose then
- Report.Comment ("in adjust");
- end if;
- delay ImpDef.Switch_To_New_Task; -- tempting place for abort
- State_Manager.Set (Finished_Adjust);
- if Verbose then
- Report.Comment ("finished adjust");
- end if;
- end Adjust;
-end C980003_0;
-
-
-with Report;
-with ImpDef;
-with C980003_0; use C980003_0;
-with Ada.Unchecked_Deallocation;
-procedure C980003 is
-
- procedure Check_State (Should_Be : States;
- Msg : String) is
- Cur : States := State_Manager.Current;
- begin
- if Cur /= Should_Be then
- Report.Failed (Msg);
- Report.Comment ("expected: " & States'Image (Should_Be) &
- " found: " & States'Image (Cur));
- elsif Verbose then
- Report.Comment ("passed: " & Msg);
- end if;
- end Check_State;
-
-begin
-
- Report.Test ("C980003", "Check that aborts are deferred during" &
- " initialization, finalization, and assignment" &
- " operations on controlled objects");
-
- Check_State (Unknown, "initial condition");
-
- -- check that initialization and finalization take place
- Init_Occurred := False;
- select
- State_Manager.Wait_For_Change;
- then abort
- declare
- My_Controlled_Obj : Is_Controlled;
- begin
- delay 0.0; -- abort completion point
- Report.Failed ("state change did not occur");
- end;
- end select;
- if not Init_Occurred then
- Report.Failed ("Initialize did not complete");
- end if;
- Check_State (Finished_Final, "init/final for declared item");
-
- -- check adjust
- State_Manager.Reset;
- declare
- Source, Dest : Is_Controlled;
- begin
- Check_State (Finished_Init, "adjust initial state");
- Source.Id := 3;
- Dest.Id := 4;
- State_Manager.Reset; -- so we will wait for change
- select
- State_Manager.Wait_For_Change;
- then abort
- Dest := Source;
- end select;
-
- -- there are two implementation methods for the
- -- assignment statement:
- -- 1. no temporary was used in the assignment statement
- -- thus the entire
- -- assignment statement is abort deferred.
- -- 2. a temporary was used in the assignment statement so
- -- there are two assignment operations. An abort may
- -- occur between the assignment operations
- -- Various optimizations are allowed by 7.6 that can affect
- -- how many times Adjust and Finalize are called.
- -- Depending upon the implementation, the state can be either
- -- Finished_Adjust or Finished_Finalize. If it is any other
- -- state then the abort took place at the wrong time.
-
- case State_Manager.Current is
- when Finished_Adjust =>
- if Verbose then
- Report.Comment ("assignment aborted after adjust");
- end if;
- when Finished_Final =>
- if Verbose then
- Report.Comment ("assignment aborted after finalize");
- end if;
- when Start_Adjust =>
- Report.Failed ("assignment aborted in adjust");
- when Start_Final =>
- Report.Failed ("assignment aborted in finalize");
- when Start_Init =>
- Report.Failed ("assignment aborted in initialize");
- when Finished_Init =>
- Report.Failed ("assignment aborted after initialize");
- when Unknown =>
- Report.Failed ("assignment aborted in unknown state");
- end case;
-
-
- if Dest.Id /= 3 then
- if Verbose then
- Report.Comment ("assignment not performed");
- end if;
- end if;
- end;
-
-
- -- check dynamically allocated objects
- State_Manager.Reset;
- declare
- type Pointer_Type is access Is_Controlled;
- procedure Free is new Ada.Unchecked_Deallocation (
- Is_Controlled, Pointer_Type);
- Ptr : Pointer_Type;
- begin
- -- make sure initialize is done when object is allocated
- Ptr := new Is_Controlled;
- Check_State (Finished_Init, "init when item allocated");
- -- now try aborting the finalize
- State_Manager.Reset;
- select
- State_Manager.Wait_For_Change;
- then abort
- Free (Ptr);
- end select;
- Check_State (Finished_Final, "finalization in dealloc");
- end;
-
- Report.Result;
-
-end C980003;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11001.a b/gcc/testsuite/ada/acats/tests/ca/ca11001.a
deleted file mode 100644
index c9d1e486ca5..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11001.a
+++ /dev/null
@@ -1,276 +0,0 @@
--- CA11001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a child unit can be used to provide an alternate view and
--- operations on a private type in its parent package. Check that a
--- child unit can be a package. Check that a WITH of a child unit
--- includes an implicit WITH of its ancestor unit.
---
--- TEST DESCRIPTION:
--- Declare a private type in a package specification. Declare
--- subprograms for the type.
---
--- Add a public child to the above package. Within the body of this
--- package, access the private type. Declare operations to read and
--- write to its parent private type.
---
--- In the main program, "with" the child. Declare objects of the
--- parent private type. Access the subprograms from both parent and
--- child packages.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CA11001_0 is -- Cartesian_Complex
--- This package represents a Cartesian view of a complex number. It contains
--- a private type plus subprograms to construct and decompose a complex
--- number.
-
- type Complex_Int is range 0 .. 100;
-
- type Complex_Type is private;
-
- Constant_Complex : constant Complex_Type;
-
- Complex_Error : exception;
-
- procedure Cartesian_Assign (R, I : in Complex_Int;
- C : out Complex_Type);
-
- function Cartesian_Real_Part (C : Complex_Type)
- return Complex_Int;
-
- function Cartesian_Imag_Part (C : Complex_Type)
- return Complex_Int;
-
- function Complex (Real, Imaginary : Complex_Int)
- return Complex_Type;
-
-private
- type Complex_Type is -- Parent private type
- record
- Real, Imaginary : Complex_Int;
- end record;
-
- Constant_Complex : constant Complex_Type := (Real => 0, Imaginary => 0);
-
-end CA11001_0; -- Cartesian_Complex
-
---=======================================================================--
-
-package body CA11001_0 is -- Cartesian_Complex
-
- procedure Cartesian_Assign (R, I : in Complex_Int;
- C : out Complex_Type) is
- begin
- C.Real := R;
- C.Imaginary := I;
- end Cartesian_Assign;
- -------------------------------------------------------------
- function Cartesian_Real_Part (C : Complex_Type)
- return Complex_Int is
- begin
- return C.Real;
- end Cartesian_Real_Part;
- -------------------------------------------------------------
- function Cartesian_Imag_Part (C : Complex_Type)
- return Complex_Int is
- begin
- return C.Imaginary;
- end Cartesian_Imag_Part;
- -------------------------------------------------------------
- function Complex (Real, Imaginary : Complex_Int)
- return Complex_Type is
- begin
- return (Real, Imaginary);
- end Complex;
-
-end CA11001_0; -- Cartesian_Complex
-
---=======================================================================--
-
-package CA11001_0.CA11001_1 is -- Polar_Complex
--- This public child provides a different view of the private type from its
--- parent. It provides a polar view by the provision of subprograms which
--- construct and decompose a complex number.
-
- procedure Polar_Assign (R, Theta : in Complex_Int;
- C : out Complex_Type);
- -- Complex_Type is a
- -- record of CA11001_0
-
- function Polar_Real_Part (C: Complex_Type) return Complex_Int;
-
- function Polar_Imag_Part (C: Complex_Type) return Complex_Int;
-
- function Equals_Const (Num : Complex_Type) return Boolean;
-
-end CA11001_0.CA11001_1; -- Polar_Complex
-
---=======================================================================--
-
-package body CA11001_0.CA11001_1 is -- Polar_Complex
-
- function Cos (Angle : Complex_Int) return Complex_Int is
- Num : constant Complex_Int := 2;
- begin
- return (Angle * Num); -- not true Cosine function
- end Cos;
- -------------------------------------------------------------
- function Sine (Angle : Complex_Int) return Complex_Int is
- begin
- return 1; -- not true Sine function
- end Sine;
- -------------------------------------------------------------
- function Sqrt (Num : Complex_Int)
- return Complex_Int is
- begin
- return (Num); -- not true Square root function
- end Sqrt;
- -------------------------------------------------------------
- function Tan (Angle : Complex_Int) return Complex_Int is
- begin
- return Angle; -- not true Tangent function
- end Tan;
- -------------------------------------------------------------
- procedure Polar_Assign (R, Theta : in Complex_Int;
- C : out Complex_Type) is
- begin
- if R = 0 and Theta = 0 then
- raise Complex_Error;
- end if;
- C.Real := R * Cos (Theta);
- C.Imaginary := R * Sine (Theta);
- end Polar_Assign;
- -------------------------------------------------------------
- function Polar_Real_Part (C: Complex_Type) return Complex_Int is
- begin
- return Sqrt ((Cartesian_Imag_Part (C)) ** 2 +
- (Cartesian_Real_Part (C)) ** 2);
- end Polar_Real_Part;
- -------------------------------------------------------------
- function Polar_Imag_Part (C: Complex_Type) return Complex_Int is
- begin
- return (Tan (Cartesian_Imag_Part (C) /
- Cartesian_Real_Part (C)));
- end Polar_Imag_Part;
- -------------------------------------------------------------
- function Equals_Const (Num : Complex_Type) return Boolean is
- begin
- return Num.Real = Constant_Complex.Real and
- Num.Imaginary = Constant_Complex.Imaginary;
- end Equals_Const;
-
-end CA11001_0.CA11001_1; -- Polar_Complex
-
---=======================================================================--
-
-with CA11001_0.CA11001_1; -- Polar_Complex
-with Report;
-
-procedure CA11001 is
-
- Complex_No : CA11001_0.Complex_Type; -- Complex_Type is a
- -- record of CA11001_0
-
- Complex_5x2 : CA11001_0.Complex_Type := CA11001_0.Complex (5, 2);
-
- Int_2 : CA11001_0.Complex_Int
- := CA11001_0.Complex_Int (Report.Ident_Int (2));
-
-begin
-
- Report.Test ("CA11001", "Check that a child unit can be used " &
- "to provide an alternate view and operations " &
- "on a private type in its parent package");
-
- Basic_View_Subtest:
-
- begin
- -- Assign using Cartesian coordinates.
- CA11001_0.Cartesian_Assign
- (CA11001_0.Complex_Int (Report.Ident_Int (1)), Int_2, Complex_No);
-
- -- Read back in Polar coordinates.
- -- Polar values are surrogates used in checking for correct
- -- subprogram calls.
- if CA11001_0."/=" (CA11001_0.CA11001_1.Polar_Real_Part (Complex_No),
- CA11001_0.Cartesian_Real_Part (Complex_5x2)) and CA11001_0."/="
- (CA11001_0.CA11001_1.Polar_Imag_Part (Complex_No),
- CA11001_0.Cartesian_Imag_Part (Complex_5x2)) then
- Report.Failed ("Incorrect Cartesian result");
- end if;
-
- end Basic_View_Subtest;
- -------------------------------------------------------------
- Alternate_View_Subtest:
- begin
- -- Assign using Polar coordinates.
- CA11001_0.CA11001_1.Polar_Assign
- (Int_2, CA11001_0.Complex_Int (Report.Ident_Int (3)), Complex_No);
-
- -- Read back in Cartesian coordinates.
- if CA11001_0."/=" (CA11001_0.Cartesian_Real_Part
- (Complex_No), CA11001_0.Complex_Int (Report.Ident_Int (12))) or
- CA11001_0."/=" (CA11001_0.Cartesian_Imag_Part (Complex_No), Int_2)
- then
- Report.Failed ("Incorrect Polar result");
- end if;
- end Alternate_View_Subtest;
- -------------------------------------------------------------
- Other_Subtest:
- begin
- -- Assign using Polar coordinates.
- CA11001_0.CA11001_1.Polar_Assign
- (CA11001_0.Complex_Int (Report.Ident_Int (0)), Int_2, Complex_No);
-
- -- Compare with Complex_Num in CA11001_0.
- if not CA11001_0.CA11001_1.Equals_Const (Complex_No)
- then
- Report.Failed ("Incorrect result");
- end if;
- end Other_Subtest;
- -------------------------------------------------------------
- Exception_Subtest:
- begin
- -- Raised parent's exception.
- CA11001_0.CA11001_1.Polar_Assign
- (CA11001_0.Complex_Int (Report.Ident_Int (0)),
- CA11001_0.Complex_Int (Report.Ident_Int (0)), Complex_No);
- Report.Failed ("Exception was not raised");
- exception
- when CA11001_0.Complex_Error =>
- null;
- when others =>
- Report.Failed ("Unexpected exception raised in test");
- end Exception_Subtest;
-
- Report.Result;
-
-end CA11001;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11002.a b/gcc/testsuite/ada/acats/tests/ca/ca11002.a
deleted file mode 100644
index 189e1944c77..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11002.a
+++ /dev/null
@@ -1,238 +0,0 @@
--- CA11002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a public child can utilize its parent unit's visible
--- definitions.
---
--- TEST DESCRIPTION:
--- Declare a parent package that contains the following: type, object,
--- constant, exception, and subprograms. Declare a public child unit
--- that utilizes the components found in the visible part of its parent.
---
--- Demonstrate utilization of the following parent components in the
--- child package:
---
--- Parent
--- Type X
--- Constant X
--- Object X
--- Subprogram X
--- Exception X
---
--- This abstraction simulates a portion of a simple operating system.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CA11002_0 is -- Package OS.
-
- type File_Descriptor is new Integer;
- type File_Mode is (Read_Only, Write_Only, Read_Write);
-
- Null_File : constant File_Descriptor := 0;
- Default_Mode : constant File_Mode := Read_Only;
- Active_Mode : constant File_Mode := Read_Write;
-
- type File_Type is
- record
- Descriptor : File_Descriptor := Null_File;
- Mode : File_Mode := Default_Mode;
- end record;
-
- System_File : File_Type;
- File_Mode_Error : exception;
-
- function Next_Available_File return File_Descriptor;
-
- function Mode_Of_File (File : File_Type) return File_Mode;
-
-end CA11002_0; -- Package OS.
-
- --=================================================================--
-
-package body CA11002_0 is -- Package body OS.
-
- File_Count : Integer := 0;
-
- function Next_Available_File return File_Descriptor is
- begin
- File_Count := File_Count + 1;
- return (File_Descriptor(File_Count)); -- Type conversion.
- end Next_Available_File;
- --------------------------------------------------------------
- function Mode_Of_File (File : File_Type) return File_Mode is
- Mode : File_Mode := File.Mode;
- begin
- return (Mode);
- end Mode_Of_File;
-
-end CA11002_0; -- Package body OS.
-
- --=================================================================--
-
-package CA11002_0.CA11002_1 is -- Child package OS.Operations.
-
- -- Dot qualification of types, objects, etc. from parent is not required
- -- in a child unit.
-
- procedure Create_File (Mode : in File_Mode:= Active_Mode;
- File : out File_Type);
-
-end CA11002_0.CA11002_1; -- Child package OS.Operations.
-
- --=================================================================--
-
-with Report;
-package body CA11002_0.CA11002_1 is -- Child package body OS.Operations.
-
- function New_File_Validated (File : File_Type) -- Ensure that a newly
- return Boolean is -- created file has
- Result : Boolean := False; -- appropriate values.
- begin
- if (File.Descriptor > System_File.Descriptor) and -- Parent object.
- (File.Mode in File_Mode ) -- Parent type.
- then
- Result := True;
- end if;
-
- return (Result);
-
- end New_File_Validated;
- --------------------------------------------------------------
- procedure Create_File
- (Mode : in File_Mode := Active_Mode; -- Parent constant.
- File : out File_Type) is -- Parent type.
-
- New_File : File_Type;
-
- begin
- New_File.Descriptor := Next_Available_File; -- Parent subprogram.
- New_File.Mode := Mode;
-
- if New_File_Validated (File => New_File) then
- File := New_File;
- end if;
-
- end Create_File;
-
-end CA11002_0.CA11002_1; -- Child Package body OS.Operations.
-
- --=================================================================--
-
--- Child library subprogram Convert_File_Mode specification.
-procedure CA11002_0.CA11002_2 (File : in out File_Type; -- Parent type.
- New_Mode : in File_Mode); -- Parent type.
-
-
- --=================================================================--
-with Report;
-
--- Child library subprogram Convert_File_Mode body.
-procedure CA11002_0.CA11002_2 (File : in out File_Type;
- New_Mode : in File_Mode) is
-begin
- if File.Mode = New_Mode then
- raise File_Mode_Error; -- Parent exception.
- Report.Failed ("Exception not raised in child unit");
- else
- File.Mode := New_Mode;
- end if;
-end CA11002_0.CA11002_2;
-
- --=================================================================--
-
-with Report;
-with CA11002_0.CA11002_1; -- Child package OS.Operations.
-with CA11002_0.CA11002_2; -- Child subprogram OS.Convert_File_Mode,
- -- Implicitly with parent, OS.
-use CA11002_0; -- All user-defined operators directly
- -- visible.
-procedure CA11002 is
-begin
-
- Report.Test ("CA11002", "Check that a public child can utilize its " &
- "parent unit's visible definitions");
-
- File_Creation: -- This processing block will demonstrate
- -- use of child package subroutine that
- -- takes advantage of components declared
- -- in the parent package.
- declare
- User_File : File_Type;
- begin
- CA11002_0.CA11002_1.Create_File (File => User_File); -- Default mode
- -- parameter used in
- -- this call.
- if (User_File.Descriptor = System_File.Descriptor) or
- (User_File.Mode = Default_Mode)
- then
- Report.Failed ("Incorrect file creation");
- end if;
-
- end File_Creation;
-
- --------------------------------------------------------------
- File_Mode_Conversion: -- This processing block will demonstrate
- -- the occurrence of a (forced) exception
- -- being raised in a child subprogram, and
- -- propagated to the caller. The exception
- -- is handled, and the child subprogram
- -- is called again, this time to perform
- -- without error.
- declare
- procedure Convert_File_Mode (File : in out File_Type;
- New_Mode : in File_Mode) renames CA11002_0.CA11002_2;
- New_File : File_Type;
- begin -- Raise an exception with this
- -- illegal conversion operation
- -- (attempt to change to current mode).
-
- Convert_File_Mode (File => New_File,
- New_Mode => Default_Mode);
- Report.Failed ("Exception should have been raised in child unit");
-
- exception
- when File_Mode_Error => -- Perform the conversion again, this
- -- time with a different file mode.
-
- Convert_File_Mode (File => New_File,
- New_Mode => CA11002_0.Active_Mode);
-
- if New_File.Mode /= Read_Write then
- Report.Failed ("Incorrect result from mode conversion operation");
- end if;
-
- when others =>
- Report.Failed ("Unexpected exception raised in File_Mode_Conversion");
-
- end File_Mode_Conversion;
-
- Report.Result;
-
-end CA11002;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11003.a b/gcc/testsuite/ada/acats/tests/ca/ca11003.a
deleted file mode 100644
index ff894250ed0..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11003.a
+++ /dev/null
@@ -1,290 +0,0 @@
--- CA11003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a public grandchild can utilize its ancestor unit's visible
--- definitions.
---
--- TEST DESCRIPTION:
--- Declare a public package, public child package, and public
--- grandchild package and library unit function. Within the
--- grandchild package and function, make use of components that are
--- declared in the ancestor packages, both parent and grandparent.
---
--- Use the following ancestral components in the grandchildren library
--- units:
--- Grandparent Parent
--- Type X X
--- Constant X X
--- Object X X
--- Subprogram X X
--- Exception X X
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 21 Dec 94 SAIC Modified procedure Create_File
--- 15 Nov 95 SAIC Update and repair for ACVC 2.0.1
---
---!
-
-package CA11003_0 is -- Package OS
-
- type File_Descriptor is new Integer;
- type File_Mode is (Read_Only, Write_Only, Read_Write);
-
- Null_File : constant File_Descriptor := 0;
- Default_Mode : constant File_Mode := Read_Only;
- File_Data_Error : exception;
-
- type File_Type is tagged
- record
- Descriptor : File_Descriptor := Null_File;
- Mode : File_Mode := Read_Write;
- end record;
-
- System_File : File_Type;
-
- function Next_Available_File return File_Descriptor;
-
- procedure Reclaim_File_Descriptor;
-
-end CA11003_0; -- Package OS
-
- --=================================================================--
-
-package body CA11003_0 is -- Package body OS
-
- File_Count : Integer := 0;
-
- function Next_Available_File return File_Descriptor is
- begin
- File_Count := File_Count + 1;
- return (File_Descriptor(File_Count));
- end Next_Available_File;
- --------------------------------------------------
- procedure Reclaim_File_Descriptor is
- begin
- null; -- Dummy processing unit.
- end Reclaim_File_Descriptor;
-
-end CA11003_0; -- Package body OS
-
- --=================================================================--
-
-package CA11003_0.CA11003_1 is -- Child package OS.Operations
-
- subtype File_Length_Type is Integer range 0 .. 1000;
- Min_File_Size : File_Length_Type := File_Length_Type'First;
- Max_File_Size : File_Length_Type := File_Length_Type'Last;
-
- File_Duplication_Error : exception;
-
- type Extended_File_Type is new File_Type with private;
-
- procedure Create_File (Mode : in File_Mode;
- File : out Extended_File_Type);
-
- procedure Duplicate_File (Original : in Extended_File_Type;
- Duplicate : out Extended_File_Type);
-
-private
- type Extended_File_Type is new File_Type with
- record
- Blocks : File_Length_Type := Min_File_Size;
- end record;
-
- System_Extended_File : Extended_File_Type;
-
-end CA11003_0.CA11003_1; -- Child Package OS.Operations
-
- --=================================================================--
-
-package body CA11003_0.CA11003_1 is -- Child package body OS.Operations
-
- procedure Create_File
- (Mode : in File_Mode;
- File : out Extended_File_Type) is
- begin
- File.Descriptor := Next_Available_File; -- Parent subprogram.
- File.Mode := Default_Mode; -- Parent constant.
- File.Blocks := Min_File_Size;
- end Create_File;
- --------------------------------------------------
- procedure Duplicate_File (Original : in Extended_File_Type;
- Duplicate : out Extended_File_Type) is
- begin
- Duplicate.Descriptor := Next_Available_File; -- Parent subprogram.
- Duplicate.Mode := Original.Mode;
- Duplicate.Blocks := Original.Blocks;
- end Duplicate_File;
-
-end CA11003_0.CA11003_1; -- Child package body OS.Operations
-
- --=================================================================--
-
--- This package contains menu selectable operations for manipulating files.
--- This abstraction builds on the capabilities available from ancestor
--- packages.
-
-package CA11003_0.CA11003_1.CA11003_2 is
-
- procedure News (Mode : in File_Mode;
- File : out Extended_File_Type);
-
- procedure Copy (Original : in Extended_File_Type;
- Duplicate : out Extended_File_Type);
-
- procedure Delete (File : in Extended_File_Type);
-
-end CA11003_0.CA11003_1.CA11003_2; -- Grandchild package OS.Operations.Menu
-
- --=================================================================--
-
--- Grandchild subprogram Validate
-function CA11003_0.CA11003_1.CA11003_3 (File : in Extended_File_Type)
- return Boolean;
-
- --=================================================================--
-
--- Grandchild subprogram Validate
-function CA11003_0.CA11003_1.CA11003_3
- (File : in Extended_File_Type) -- Parent type.
- return Boolean is
-
- function New_File_Validated (File : Extended_File_Type)
- return Boolean is
- begin
- if (File.Descriptor > System_File.Descriptor) and -- Grandparent
- (File.Mode in File_Mode ) and -- object and type
- not ((File.Blocks < System_Extended_File.Blocks) or
- (File.Blocks > Max_File_Size)) -- Parent object
- then -- and constant.
- return True;
- else
- return False;
- end if;
- end New_File_Validated;
-
-begin
- return (New_File_Validated (File)) and
- (File.Descriptor /= Null_File); -- Grandparent constant.
-
-end CA11003_0.CA11003_1.CA11003_3; -- Grandchild subprogram Validate
-
- --=================================================================--
-
-with CA11003_0.CA11003_1.CA11003_3;
- -- Grandchild package body OS.Operations.Menu
-package body CA11003_0.CA11003_1.CA11003_2 is
-
- procedure News (Mode : in File_Mode;
- File : out Extended_File_Type) is -- Parent type.
- begin
- Create_File (Mode, File); -- Parent subprogram.
- if not CA11003_0.CA11003_1.CA11003_3 (File) then
- raise File_Data_Error; -- Grandparent exception.
- end if;
- end News;
- --------------------------------------------------
- procedure Copy (Original : in Extended_File_Type;
- Duplicate : out Extended_File_Type) is
- begin
- Duplicate_File (Original, Duplicate); -- Parent subprogram.
-
- if Original.Descriptor = Duplicate.Descriptor then
- raise File_Duplication_Error; -- Parent exception.
- end if;
-
- end Copy;
- --------------------------------------------------
- procedure Delete (File : in Extended_File_Type) is
- begin
- Reclaim_File_Descriptor; -- Grandparent
- end Delete; -- subprogram.
-
-end CA11003_0.CA11003_1.CA11003_2;
-
- --=================================================================--
-
-with CA11003_0.CA11003_1.CA11003_2; -- Grandchild Pkg OS.Operations.Menu
-with CA11003_0.CA11003_1.CA11003_3; -- Grandchild Ftn OS.Operations.Validate
-with Report;
-
-procedure CA11003 is
-
- package Menu renames CA11003_0.CA11003_1.CA11003_2;
-
-begin
-
- Report.Test ("CA11003", "Check that a public grandchild can utilize " &
- "its ancestor unit's visible definitions");
-
- File_Processing: -- Validate all of the capabilities contained in
- -- the Menu package by exercising them on specific
- -- files. This will demonstrate the use of child
- -- and grandchild functionality based on components
- -- that have been declared in the
- -- parent/grandparent package.
- declare
-
- function Validate (File : CA11003_0.CA11003_1.Extended_File_Type)
- return Boolean renames CA11003_0.CA11003_1.CA11003_3;
-
- MacWrite_File,
- Backup_Copy : CA11003_0.CA11003_1.Extended_File_Type;
- MacWrite_File_Mode : CA11003_0.File_Mode := CA11003_0.Read_Write;
-
- begin
-
- Menu.News (MacWrite_File_Mode, MacWrite_File);
-
- if not Validate (MacWrite_File) then
- Report.Failed ("Incorrect initialization of files");
- end if;
-
- Menu.Copy (MacWrite_File, Backup_Copy);
-
- if not (Validate (MacWrite_File) and
- Validate (Backup_Copy))
- then
- Report.Failed ("Incorrect duplication of files");
- end if;
-
- Menu.Delete (Backup_Copy);
-
- exception
- when CA11003_0.File_Data_Error =>
- Report.Failed ("Exception raised during file validation");
- when CA11003_0.CA11003_1.File_Duplication_Error =>
- Report.Failed ("Exception raised during file duplication");
- when others =>
- Report.Failed ("Unexpected exception in test procedure");
-
- end File_Processing;
-
- Report.Result;
-
-end CA11003;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca110040.a b/gcc/testsuite/ada/acats/tests/ca/ca110040.a
deleted file mode 100644
index 72cc6682eab..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca110040.a
+++ /dev/null
@@ -1,90 +0,0 @@
--- CA110040.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See CA110042.AM
---
--- TEST DESCRIPTION:
--- See CA110042.AM
---
--- TEST FILES:
--- The following files comprise this test:
---
--- => CA110040.A
--- CA110041.A
--- CA110042.AM
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 26 Apr 96 SAIC ACVC 2.1: Modified prologue; Added pragma
--- Elaborate_Body.
---
---!
-
-package CA110040 is -- Package Computer_System.
- pragma Elaborate_Body (CA110040);
-
- -- Types.
- type ID_Type is range 1 .. 4;
- type System_Account_Capacity is new ID_Type;
-
- type Account is tagged
- record
- User_ID : ID_Type;
- end record;
-
- -- Constants.
- Maximum_System_Accounts : constant System_Account_Capacity :=
- System_Account_Capacity'Last;
-
- System_Administrator : constant ID_Type :=
- ID_Type (System_Account_Capacity'First);
-
- Administrator_Account : constant Account :=
- (User_ID => System_Administrator);
-
- -- Objects.
- Total_Accounts : System_Account_Capacity := 1;
-
- -- Exceptions.
- Illegal_Account : exception;
- Account_Limit_Exceeded : exception;
-
- -- Subprograms.
- function Next_Available_ID return ID_Type;
-
-end CA110040; -- Package Computer_System.
-
- --=================================================================--
-
-package body CA110040 is -- Package body Computer_System.
-
- function Next_Available_ID return ID_Type is
- begin
- Total_Accounts := Total_Accounts + 1;
- return (ID_Type(Total_Accounts));
- end Next_Available_ID;
-
-end CA110040; -- Package body Computer_System.
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca110041.a b/gcc/testsuite/ada/acats/tests/ca/ca110041.a
deleted file mode 100644
index 954df7f4d68..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca110041.a
+++ /dev/null
@@ -1,118 +0,0 @@
--- CA110041.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See CA110042.AM
---
--- TEST DESCRIPTION:
--- See CA110042.AM
---
--- TEST FILES:
--- The following files comprise this test:
---
--- CA110040.A
--- => CA110041.A
--- CA110042.AM
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 26 Apr 96 SAIC ACVC 2.1: Modified prologue.
---
---!
-
-package CA110040.CA110041 is -- Child Package Computer_System.Manager
-
- type User_Account is new Account with private;
-
- procedure Initialize_User_Account (Acct : out User_Account);
-
-private
-
--- The private portion of this spec demonstrates that components contained
--- in the visible part of the parent are directly visible in the private
--- part of a public child.
-
- type Account_Access_Type is (None, Guest, User, System);
-
- type User_Account is new Account with -- Parent type.
- record
- Privilege : Account_Access_Type := None;
- end record;
-
- System_Account : User_Account :=
- (User_ID => Administrator_Account.User_ID, -- Parent constant.
- Privilege => System); -- User_ID has been
- -- set to 1.
- Auditor_Account : User_Account :=
- (User_ID => Next_Available_ID, -- Parent function.
- Privilege => System); -- User_ID has been
- -- set to 2.
- Total_Authorized_Accounts : System_Account_Capacity
- renames Total_Accounts; -- Parent object.
-
- Unauthorized_Account : exception
- renames Illegal_Account; -- Parent exception
-
-end CA110040.CA110041; -- Child Package Computer_System.Manager
-
- --=================================================================--
-
- -- Child Package body Computer_System.Manager
-package body CA110040.CA110041 is
-
- function Account_Limit_Reached return Boolean is
- begin
- if Total_Authorized_Accounts = Maximum_System_Accounts then
- return (True);
- else
- return (False);
- end if;
- end Account_Limit_Reached;
- ---------------------------------------------------------------
- function Valid_Account (Acct : User_Account) return Boolean is
- Result : Boolean := False;
- begin
- if (Acct.User_ID /= System_Account.User_ID) and
- (Acct.User_ID /= Auditor_Account.User_ID)
- then
- Result := True;
- end if;
- return (Result);
- end Valid_Account;
- ---------------------------------------------------------------
- procedure Initialize_User_Account (Acct : out User_Account) is
- begin
- if Account_Limit_Reached then
- raise Account_Limit_Exceeded;
- else
- Acct.User_ID := Next_Available_ID;
- Acct.Privilege := User;
- end if;
- if not Valid_Account (Acct) then
- raise Unauthorized_Account;
- end if;
- end Initialize_User_Account;
-
-end CA110040.CA110041; -- Child Package body Computer_System.Manager
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca110050.a b/gcc/testsuite/ada/acats/tests/ca/ca110050.a
deleted file mode 100644
index 88455762c96..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca110050.a
+++ /dev/null
@@ -1,99 +0,0 @@
--- CA110050.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See CA110051.AM
---
--- TEST DESCRIPTION:
--- See CA110051.AM
---
--- TEST FILES:
--- The test consists of the following files:
---
--- => CA110050.A
--- CA110051.AM
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 21 Dec 94 SAIC Modified discriminant type
--- 26 Apr 96 SAIC ACVC 2.1: Modified prologue; Added pragma
--- Elaborate_Body.
---
---!
-
-package CA110050_0 is -- Package Messages.
- pragma Elaborate_Body (CA110050_0);
-
- type Descriptor is new Integer;
-
- Null_Descriptor_Value : constant Descriptor := 0;
- Null_Message_Descriptor : constant Descriptor := 0;
-
- type Message_Type is tagged
- record
- Number : Descriptor := Null_Message_Descriptor;
- end record;
-
- function Next_Available_Message return Descriptor;
-
-end CA110050_0; -- Package Messages.
-
- --=================================================================--
-
-package body CA110050_0 is -- Package body Messages.
-
- Message_Count : Integer := 0;
-
- function Next_Available_Message return Descriptor is
- begin
- Message_Count := Message_Count + 5;
- return (Descriptor(Message_Count));
- end Next_Available_Message;
-
-end CA110050_0; -- Package body Messages.
-
- --=================================================================--
-
-package CA110050_0.CA110050_1 is -- Child package Messages.Text
-
- subtype Default_Length is Natural range 0 .. 80;
-
- type Text_Type (Max_Length : Default_Length := 0) is
- record
- Length : Default_Length := Max_Length;
- Text_Field : String (1 .. Max_Length);
- end record;
-
- type Text_Message_Type is new Message_Type with
- record
- Text : Text_Type;
- end record;
-
- Null_Text : Text_Type (0); -- Null range for
- -- Text_Field component.
-
-end CA110050_0.CA110050_1; -- Child package Messages.Text
---
--- No package body needed for this specification.
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11006.a b/gcc/testsuite/ada/acats/tests/ca/ca11006.a
deleted file mode 100644
index 5cd21fe1f15..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11006.a
+++ /dev/null
@@ -1,211 +0,0 @@
--- CA11006.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the private part of a child library unit can utilize
--- its parent unit's private definition.
---
--- TEST DESCRIPTION:
--- Declare a package and public child package, both with private
--- parts. The child package will have a private extension of a type
--- declared in the parent's private part. In addition, the private
--- part of the child package specification will make use of some of
--- the components declared in the private part of the parent.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 Nov 95 SAIC Update and repair for ACVC 2.0.1
---
---!
-
-package CA11006_0 is -- Package File_Package
-
- type File_Descriptor is private;
- type File_Mode is (Read_Only, Write_Only, Read_Write);
- type File_Type is tagged private;
-
- function Next_Available_File return File_Descriptor;
-
-private
-
- type File_Measure is range 0 .. 1000;
- type File_Descriptor is new Integer;
-
- Null_File : constant File_Descriptor := 0;
- Default_Mode : constant File_Mode := Read_Write;
-
- type File_Type is tagged
- record
- Descriptor : File_Descriptor := Null_File;
- Mode : File_Mode := Default_Mode;
- end record;
-
- System_File : File_Type;
-
-end CA11006_0; -- Package File_Package
-
- --=================================================================--
-
-package body CA11006_0 is -- Package File_Package
-
- File_Count : Integer := 0;
-
- function Next_Available_File return File_Descriptor is
- begin
- File_Count := File_Count + 1;
- return File_Descriptor (File_Count);
- end Next_Available_File;
-
-end CA11006_0; -- Package File_Package
-
- --=================================================================--
-
-package CA11006_0.CA11006_1 is -- Child package File_Package.Operations
-
- type File_Length_Type is private;
- type Extended_File_Type is new File_Type with private;
-
- System_Extended_File : constant Extended_File_Type;
-
- procedure Create_File (Mode : in File_Mode;
- File : out Extended_File_Type);
-
- procedure Compress_File (Original : in Extended_File_Type;
- Compressed_File : out Extended_File_Type);
-
- function Validate (File : in Extended_File_Type) return Boolean;
-
- function Validate_Compression (File : in Extended_File_Type)
- return Boolean;
- -- These two validation functions provide
- -- the capability to check the private
- -- components defined in the parent and
- -- child packages from within the client
- -- program.
-private
-
- type File_Length_Type is new File_Measure; -- Parent private type.
-
- Min_File_Size : File_Length_Type := File_Length_Type'First;
- Max_File_Size : File_Length_Type := File_Length_Type'Last;
-
- type Extended_File_Type is new File_Type with -- Parent type.
- record
- Blocks : File_Length_Type := Min_File_Size;
- end record;
-
- System_Extended_File : constant Extended_File_Type :=
- (Descriptor => System_File.Descriptor, -- Parent private object.
- Mode => Read_Only, -- Parent enumeration literal.
- Blocks => Min_File_Size);
-
-
-end CA11006_0.CA11006_1; -- Child Package File_Package.Operations
-
- --=================================================================--
-
- -- Child package body File_Package.Operations
-package body CA11006_0.CA11006_1 is
-
- procedure Create_File
- (Mode : in File_Mode;
- File : out Extended_File_Type) is
- begin
- File.Descriptor := Next_Available_File; -- Parent subprogram.
- File.Mode := Default_Mode; -- Parent private constant.
- File.Blocks := Max_File_Size;
- end Create_File;
- ------------------------------------------------------------------------
- procedure Compress_File (Original : in Extended_File_Type;
- Compressed_File : out Extended_File_Type) is
- begin
- Compressed_File.Descriptor := Next_Available_File;
- Compressed_File.Mode := Read_Only;
- Compressed_File.Blocks := Original.Blocks / 2; -- Simulated file
- end Compress_File; -- compression.
- ------------------------------------------------------------------------
- function Validate (File : in Extended_File_Type) return Boolean is
- begin
- if ((File.Descriptor /= System_Extended_File.Descriptor) and
- (File.Mode = Read_Write) and
- (File.Blocks = Max_File_Size)) then
- return True;
- else
- return False;
- end if;
- end Validate;
- ------------------------------------------------------------------------
- function Validate_Compression (File : in Extended_File_Type)
- return Boolean is
- begin
- if ((File.Descriptor /= System_File.Descriptor) and
- (File.Mode = Read_Only) and
- (File.Blocks = Max_File_Size/2)) then
- return True;
- else
- return False;
- end if;
- end Validate_Compression;
-
-end CA11006_0.CA11006_1; -- Child package body File_Package.Operations
-
- --=================================================================--
-
-with CA11006_0.CA11006_1; -- with Child package File_Package.Operations
-with Report;
-
-procedure CA11006 is
-
- package File renames CA11006_0;
- package File_Ops renames CA11006_0.CA11006_1;
-
- Validation_File_Mode : File.File_Mode := File.Read_Only;
- Validation_File,
- Storage_Copy : File_Ops.Extended_File_Type;
-
-begin
-
- Report.Test ("CA11006", "Check that the private part of a child " &
- "library unit can utilize its parent " &
- "unit's private definition");
-
- File_Ops.Create_File (Validation_File_Mode, Validation_File);
-
- if not File_Ops.Validate (Validation_File) then
- Report.Failed ("Incorrect initialization of file");
- end if;
-
- File_Ops.Compress_File (Validation_File, Storage_Copy);
-
- if not (File_Ops.Validate (Validation_File) and
- File_Ops.Validate_Compression (Storage_Copy))
- then
- Report.Failed ("Incorrect compression of file");
- end if;
-
- Report.Result;
-
-end CA11006;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11007.a b/gcc/testsuite/ada/acats/tests/ca/ca11007.a
deleted file mode 100644
index c4a6789ab8e..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11007.a
+++ /dev/null
@@ -1,228 +0,0 @@
--- CA11007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the private part of a grandchild library unit can
--- utilize its grandparent unit's private definition.
---
--- TEST DESCRIPTION:
--- Declare a package, child package, and grandchild package, all
--- with private parts in their specifications.
---
--- The private part of the grandchild package will make use of components
--- that have been declared in the private part of the grandparent
--- specification.
---
--- The child package demonstrates the extension of a parent file type
--- into an abstraction of an analog file structure. The grandchild package
--- extends the grandparent file type into an abstraction of a digital
--- file structure, and provides conversion capability to/from the parent
--- analog file structure.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CA11007_0 is -- Package File_Package
-
- type File_Descriptor is private;
- type File_Type is tagged private;
-
- function Next_Available_File return File_Descriptor;
-
-private
-
- type File_Measure_Type is range 0 .. 1000;
- type File_Descriptor is new Integer;
-
- Null_Measure : constant File_Measure_Type := File_Measure_Type'First;
- Null_File : constant File_Descriptor := 0;
-
- type File_Type is tagged
- record
- Descriptor : File_Descriptor := Null_File;
- end record;
-
-end CA11007_0; -- Package File_Package
-
- --=================================================================--
-
-package body CA11007_0 is -- Package body File_Package
-
- File_Count : Integer := 0;
-
- function Next_Available_File return File_Descriptor is
- begin
- File_Count := File_Count + 1;
- return File_Descriptor (File_Count);
- end Next_Available_File;
-
-end CA11007_0; -- Package body File_Package
-
- --=================================================================--
-
-package CA11007_0.CA11007_1 is -- Child package Analog
-
- type Analog_File_Type is new File_Type with private;
-
-private
-
- type Wavelength_Type is new File_Measure_Type;
-
- Min_Wavelength : constant Wavelength_Type := Wavelength_Type'First;
-
- type Analog_File_Type is new File_Type with -- Parent type.
- record
- Wavelength : Wavelength_Type := Min_Wavelength;
- end record;
-
-end CA11007_0.CA11007_1; -- Child package Analog
-
- --=================================================================--
-
-package CA11007_0.CA11007_1.CA11007_2 is -- Grandchild package Digital
-
- type Digital_File_Type is new File_Type with private;
-
- procedure Recording (File : out Digital_File_Type);
-
- procedure Convert (From : in Analog_File_Type;
- To : out Digital_File_Type);
-
- function Validate (File : in Digital_File_Type) return Boolean;
- function Valid_Conversion (To : Digital_File_Type) return Boolean;
- function Valid_Initial (From : Analog_File_Type) return Boolean;
-
-private
-
- type Track_Type is new File_Measure_Type; -- Grandparent type.
-
- Min_Tracks : constant Track_Type :=
- Track_Type (Null_Measure) + Track_Type'First; -- Grandparent private
- Max_Tracks : constant Track_Type := -- constant.
- Track_Type (Null_Measure) + Track_Type'Last;
-
- type Digital_File_Type is new File_Type with -- Grandparent type.
- record
- Tracks : Track_Type := Min_Tracks;
- end record;
-
-end CA11007_0.CA11007_1.CA11007_2; -- Grandchild package Digital
-
- --=================================================================--
-
- -- Grandchild package body Digital
-package body CA11007_0.CA11007_1.CA11007_2 is
-
- procedure Recording (File : out Digital_File_Type) is
- begin
- File.Descriptor := Next_Available_File; -- Assign new file descriptor.
- File.Tracks := Max_Tracks; -- Change initial value.
- end Recording;
- --------------------------------------------------------------------------
- procedure Convert (From : in Analog_File_Type;
- To : out Digital_File_Type) is
- begin
- To.Descriptor := From.Descriptor + 100; -- Dummy conversion.
- To.Tracks := Track_Type (From.Wavelength) / 2;
- end Convert;
- --------------------------------------------------------------------------
- function Validate (File : in Digital_File_Type) return Boolean is
- Result : Boolean := False;
- begin
- if not (File.Tracks /= Max_Tracks) then
- Result := True;
- end if;
- return Result;
- end Validate;
- --------------------------------------------------------------------------
- function Valid_Conversion (To : Digital_File_Type) return Boolean is
- begin
- return (To.Descriptor = 100) and (To.Tracks = (Min_Tracks / 2));
- end Valid_Conversion;
- --------------------------------------------------------------------------
- function Valid_Initial (From : Analog_File_Type) return Boolean is
- begin
- return (From.Wavelength = Min_Wavelength); -- Validate initial
- end Valid_Initial; -- conditions.
-
-end CA11007_0.CA11007_1.CA11007_2; -- Grandchild package body Digital
-
- --=================================================================--
-
-with CA11007_0.CA11007_1.CA11007_2; -- with Grandchild package Digital
-with Report;
-
-procedure CA11007 is
-
- package Analog renames CA11007_0.CA11007_1;
- package Digital renames CA11007_0.CA11007_1.CA11007_2;
-
- Original_Digital_File,
- Converted_Digital_File : Digital.Digital_File_Type;
-
- Original_Analog_File : Analog.Analog_File_Type;
-
-begin
-
- -- This code demonstrates how private extensions could be utilized
- -- in child packages to allow for recording on different media.
- -- The processing contained in the procedures and functions is
- -- "dummy" processing, not intended to perform actual recording,
- -- conversion, or validation operations, but simply to demonstrate
- -- this type of structural decomposition as a possible solution to
- -- a user's design problem.
-
- Report.Test ("CA11007", "Check that the private part of a grandchild " &
- "library unit can utilize its grandparent " &
- "unit's private definition");
-
- if not Digital.Valid_Initial (Original_Analog_File)
- then
- Report.Failed ("Incorrect initialization of Analog File");
- end if;
-
- ---
-
- Digital.Convert (From => Original_Analog_File, -- Convert file to
- To => Converted_Digital_File); -- digital format.
-
- if not Digital.Valid_Conversion (To => Converted_Digital_File) then
- Report.Failed ("Incorrect conversion of analog file");
- end if;
-
- ---
-
- Digital.Recording (Original_Digital_File); -- Create file in
- -- digital format.
- if not Digital.Validate (Original_Digital_File) then
- Report.Failed ("Incorrect recording of digital file");
- end if;
-
- Report.Result;
-
-end CA11007;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11008.a b/gcc/testsuite/ada/acats/tests/ca/ca11008.a
deleted file mode 100644
index 1161fbe0c3a..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11008.a
+++ /dev/null
@@ -1,216 +0,0 @@
--- CA11008.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a private child package can use entities declared in the
--- visible part of its parent unit.
---
--- TEST DESCRIPTION:
--- Declare a parent package containing types and objects used
--- by the system. Declare a private child package that uses the parent
--- components to provide functionality to the system.
---
--- The tagged file type defined in the parent has defaults for all
--- component fields. Prior to initialization, these values are checked
--- to ensure a correct start condition. The initial subprogram is
--- called, which utilizes the functionality provided in the private
--- child package. This subprogram changes the fields of the file object
--- to something other than the default values, and this process is then
--- verified at the conclusion of the test.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CA11008_0 is -- Package OS.
-
- type File_Descriptor_Type is new Integer;
- type File_Name_Type is new String (1 .. 11);
- type Permission_Type is (None, User, System, Bypass);
- type File_Mode_Type is (Read_Only, Write_Only, Read_Write);
- type File_Status_Type is (Open, Closed);
-
- Default_Descriptor : constant File_Descriptor_Type := 0;
- Default_Permission : constant Permission_Type := None;
- Default_Mode : constant File_Mode_Type := Read_Only;
- Default_Status : constant File_Status_Type := Closed;
- Default_Filename : constant File_Name_Type := " ";
-
- Max_Files : constant File_Descriptor_Type := 100;
- Constant_Name : constant File_Name_Type := "AdaFileName";
- File_Counter : Integer := 0;
-
- type File_Type is tagged
- record
- Descriptor : File_Descriptor_Type := Default_Descriptor;
- Name : File_Name_Type := Default_Filename;
- Acct_Access : Permission_Type := Default_Permission;
- Mode : File_Mode_Type := Default_Mode;
- Current_Status : File_Status_Type := Default_Status;
- end record;
-
- type File_Array_Type is array (1 .. Max_Files) of File_Type;
-
- File_Table : File_Array_Type;
-
- --
-
- function Get_File_Name return File_Name_Type;
-
- function Initialize_File return File_Descriptor_Type;
-
-end CA11008_0; -- Package OS.
-
- --=================================================================--
-
--- Subprograms that perform the actual file operations are contained in a
--- private package so that they are not accessible to any client.
-
-private package CA11008_0.CA11008_1 is -- Package OS.Internals
-
- Private_File_Counter : Integer renames File_Counter; -- Parent
- -- object.
- function Initialize
- (File_Name : File_Name_Type := Get_File_Name; -- Parent function.
- File_Mode : File_Mode_Type := Read_Write) -- Parent literal.
- return File_Descriptor_Type; -- Parent type.
-
-end CA11008_0.CA11008_1; -- Package OS.Internals
-
- --=================================================================--
-
-package body CA11008_0.CA11008_1 is -- Package body OS.Internals
-
- function Next_Available_File return File_Descriptor_Type is
- begin
- Private_File_Counter := Private_File_Counter + 1;
- return (File_Descriptor_Type(File_Counter));
- end Next_Available_File;
- -----------------------------------------------------------------
- function Initialize
- (File_Name : File_Name_Type := Get_File_Name; -- Parent function
- File_Mode : File_Mode_Type := Read_Write) -- Parent literal
- return File_Descriptor_Type is -- Parent type
- Number : File_Descriptor_Type;
- begin
- Number := Next_Available_File;
- File_Table(Number).Descriptor := Number; -- Parent object
- File_Table(Number).Name := File_Name; -- Default parameter value
- File_Table(Number).Mode := File_Mode; -- Default parameter value
- File_Table(Number).Acct_Access := User;
- File_Table(Number).Current_Status := Open;
- return (Number);
- end Initialize;
-
-end CA11008_0.CA11008_1; -- Package body OS.Internals
-
- --=================================================================--
-
-with CA11008_0.CA11008_1; -- Private child package "withed" by
- -- parent body.
-
-package body CA11008_0 is -- Package body OS
-
- function Get_File_Name return File_Name_Type is
- begin
- return (Constant_Name); -- Of course if this was a real function, the
- end Get_File_Name; -- user would be asked to input a name, or
- -- there would be some type of similar process.
-
- -- This subprogram utilizes a call to a subprogram contained in a private
- -- child to perform the actual processing.
-
- function Initialize_File return File_Descriptor_Type is
- begin
- return (CA11008_0.CA11008_1.Initialize); -- No parameters are needed,
- -- since defaults have been
- -- provided.
- end Initialize_File;
-
-end CA11008_0; -- Package body OS
-
- --=================================================================--
-
-with CA11008_0; -- with Package OS.
-with Report;
-
-procedure CA11008 is
-
- package OS renames CA11008_0;
- use OS;
- Ada_File_Key : File_Descriptor_Type := Default_Descriptor;
-
-begin
-
- -- This test indicates one approach to file management operations.
- -- It is not intended to demonstrate full functionality, but rather
- -- that the use of a private child package can provide a solution
- -- to a user situation, that being the implementation of certain functions
- -- being provided in a child package, with the parent package body
- -- utilizing these implementations.
-
- Report.Test ("CA11008", "Check that a private child package can use " &
- "entities declared in the visible part of its " &
- "parent unit");
-
- -- Check initial conditions of the first entry in the file table.
- -- These are all default values provided in the declaration of the
- -- type File_Type.
-
- if (Ada_File_Key /= Default_Descriptor) or else
- (File_Table(1).Descriptor /= (Default_Descriptor) or
- (File_Table(1).Name /= Default_Filename)) or else
- (File_Table(1).Acct_Access /= (Default_Permission) or
- (File_Table(1).Mode /= Default_Mode)) or else
- (File_Table(1).Current_Status /= Default_Status)
- then
- Report.Failed ("Initial condition failure");
- end if;
-
- -- Call the initialization function. This will result in the resetting
- -- of the fields associated with the first entry in the File_Table (this
- -- is the first call of Initialize_File).
- -- No parameters are necessary for this call, due to the default values
- -- provided in the private child package routine Initialize.
-
- Ada_File_Key := Initialize_File;
-
- -- Verify that the initial conditions of the file table component have
- -- been properly modified by the initialization function.
-
- if not ((File_Table(1).Descriptor = Ada_File_Key) and then
- (File_Table(1).Name = Constant_Name) and then
- (File_Table(1).Acct_Access = User) and then
- not ((File_Table(1).Mode = Default_Mode) or else
- (File_Table(1).Current_Status = Default_Status)))
- then
- Report.Failed ("Initialization processing failure");
- end if;
-
- Report.Result;
-
-end CA11008;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11009.a b/gcc/testsuite/ada/acats/tests/ca/ca11009.a
deleted file mode 100644
index 84d7dc2b3a7..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11009.a
+++ /dev/null
@@ -1,246 +0,0 @@
--- CA11009.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a private child package can use entities declared in the
--- visible part of the parent unit of its parent unit.
---
--- TEST DESCRIPTION:
--- Declare a parent package containing types and objects used by the
--- system. Declare a public child package that provides a visible
--- interface to the system functionality.
--- Declare a private grandchild package that uses the visible grandparent
--- components to provide the actual functionality to the system.
---
--- The public child (parent of the private grandchild) uses the
--- functionality of its private child (grandchild package) to provide
--- the visible interface to operations of the system.
---
--- The test itself will utilize the visible interface provided in the
--- public child package to demonstrate a possible structure for
--- file management.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 Apr 96 SAIC ACVC 2.1: Added pragma Elaborate_body.
---
---!
-
-package CA11009_0 is -- Package OS.
- pragma Elaborate_Body (CA11009_0);
-
- type File_Descriptor_Type is new Integer;
- type File_Name_Type is new String (1 .. 11);
- type Permission_Type is (None, User, System, Bypass);
- type File_Mode_Type is (Read_Only, Write_Only, Read_Write);
- type File_Status_Type is (Open, Closed);
-
- Default_Descriptor : constant File_Descriptor_Type := 0;
- Default_Permission : constant Permission_Type := None;
- Default_Mode : constant File_Mode_Type := Read_Only;
- Default_Status : constant File_Status_Type := Closed;
- Default_Filename : constant File_Name_Type := " ";
-
- Max_Files : constant File_Descriptor_Type := 10;
- An_Ada_File_Name : constant File_Name_Type := "AdaFileName";
- File_Counter : Integer := 0;
-
- type File_Type is tagged
- record
- Descriptor : File_Descriptor_Type := Default_Descriptor;
- Name : File_Name_Type := Default_Filename;
- Acct_Access : Permission_Type := Default_Permission;
- Mode : File_Mode_Type := Default_Mode;
- Current_Status : File_Status_Type := Default_Status;
- end record;
-
- type File_Array_Type is array (1 .. Max_Files) of File_Type;
-
- File_Table : File_Array_Type;
-
- --
-
- function Get_File_Name return File_Name_Type;
-
-end CA11009_0; -- Package OS.
-
- --=================================================================--
-
-package body CA11009_0 is -- Package body OS.
-
- function Get_File_Name return File_Name_Type is
- begin
- return (An_Ada_File_Name); -- Processing would be replace by a user
- -- prompt in a functioning system.
- end Get_File_Name;
-
-end CA11009_0; -- Package body OS.
-
- --=================================================================--
-
-package CA11009_0.CA11009_1 is -- Child Package OS.File_Manager
-
- -- This package simulates a visible interface for the Operating System.
- -- The actual processing performed by this routine is encapsulated
- -- in the routines of private child package Internals, which is "withed"
- -- by the body of this package.
-
- procedure Create_File (Mode : in File_Mode_Type;
- File_Key : out File_Descriptor_Type);
-
-end CA11009_0.CA11009_1; -- Child Package OS.File_Manager
-
- --=================================================================--
-
--- Subprogram that performs the actual file operation is contained in a
--- private package so that it is not accessible to any client, and can be
--- modified/extended without requiring recompilation of the clients of the
--- parent (since this package is "withed" by the parent body only.)
-
-
- -- Grandchild Package OS.File_Manager.Internals
-private package CA11009_0.CA11009_1.CA11009_2 is
-
- Initial_Permission : constant Permission_Type := User; -- Grandparent
- Initial_Status : constant File_Status_Type := Open; -- literals.
- Initial_Filename : constant File_Name_Type := -- Grandparent type.
- Get_File_Name; -- Grandparent function.
-
- function Create (Mode : File_Mode_Type)
- return File_Descriptor_Type; -- Grandparent type.
-
-end CA11009_0.CA11009_1.CA11009_2;
- -- Grandchild Package OS.File_Manager.Internals
-
- --=================================================================--
-
- -- Grandchild Package body OS.File_Manager.Internals
-package body CA11009_0.CA11009_1.CA11009_2 is
-
- function Next_Available_File return File_Descriptor_Type is
- begin
- File_Counter := File_Counter + 1; -- Grandparent object.
- return (File_Descriptor_Type(File_Counter));
- end Next_Available_File;
- -------------------------------------------------------------------------
- function Create (Mode : File_Mode_Type) -- Grandparent literal.
- return File_Descriptor_Type is
- Number : File_Descriptor_Type; -- Grandparent type.
- begin
- Number := Next_Available_File;
- File_Table(Number).Descriptor := Number; -- Grandparent object.
- File_Table(Number).Name := Initial_Filename;
- File_Table(Number).Mode := Mode; -- Parameter.
- File_Table(Number).Acct_Access := Initial_Permission;
- File_Table(Number).Current_Status := Initial_Status;
- return (Number);
- end Create;
-
-end CA11009_0.CA11009_1.CA11009_2;
- -- Grandchild Package body OS.File_Manager.Internals
-
- --=================================================================--
-
- -- "With" of a child package
- -- by the parent body.
-with CA11009_0.CA11009_1.CA11009_2; -- Grandchild OS.File_Manager.Internals
-
-package body CA11009_0.CA11009_1 is -- Child Package body OS.File_Manager
-
- package Internal renames CA11009_0.CA11009_1.CA11009_2;
-
- -- These subprograms utilize calls to subprograms contained in a private
- -- sibling to perform the actual processing.
-
- procedure Create_File (Mode : in File_Mode_Type;
- File_Key : out File_Descriptor_Type) is
- begin
- File_Key := Internal.Create (Mode);
- end Create_File;
-
-end CA11009_0.CA11009_1; -- Child Package body OS.File_Manager
-
- --=================================================================--
-
-with CA11009_0.CA11009_1; -- with Child Package OS.File_Manager
-with Report;
-
-procedure CA11009 is
-
- package OS renames CA11009_0;
- use OS;
- package File_Manager renames CA11009_0.CA11009_1;
-
- Data_Base_File_Key : File_Descriptor_Type := Default_Descriptor;
- New_Mode : File_Mode_Type := Read_Write;
-
-begin
-
- -- This test indicates one approach to file management.
- -- It is not intended to demonstrate full functionality, but rather
- -- that the use of a private child package could provide a solution
- -- to this type of situation.
-
- Report.Test ("CA11009", "Check that a private child package can use " &
- "entities declared in the visible part of the " &
- "parent unit of its parent unit");
-
- -- Check initial conditions of the first entry in the file table.
- -- These are all default values provided in the declaration of the
- -- type File_Type.
-
- if (not (Data_Base_File_Key = Default_Descriptor)) and then
- (((not (File_Table(1).Name = Default_Filename)) or
- (File_Table(1).Descriptor /= Default_Descriptor)) or else
- ((File_Table(1).Acct_Access /= Default_Permission) or
- (not (File_Table(1).Mode = Default_Mode)) or
- (File_Table(1).Current_Status /= Default_Status)))
- then
- Report.Failed ("Initial condition failure");
- end if;
-
- -- Create/initialize file using the capability provided by the visible
- -- interface to the operating system, OS.File_Manager. The actual
- -- processing routine is contained in the private grandchild package
- -- Internals, which utilize the components from the grandparent package.
-
- File_Manager.Create_File (New_Mode, Data_Base_File_Key);
-
- -- Verify that the initial conditions of the file table component have
- -- been properly modified by the initialization function.
-
- if not ((File_Table(1).Descriptor = Data_Base_File_Key) and then
- (File_Table(1).Name = An_Ada_File_Name) and then
- (File_Table(1).Acct_Access = User) and then
- not ((File_Table(1).Mode = Default_Mode) or else
- (File_Table(1).Current_Status = Default_Status)))
- then
- Report.Failed ("File creation failure");
- end if;
-
- Report.Result;
-
-end CA11009;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11010.a b/gcc/testsuite/ada/acats/tests/ca/ca11010.a
deleted file mode 100644
index b13efd79851..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11010.a
+++ /dev/null
@@ -1,254 +0,0 @@
--- CA11010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a private child package can use entities declared in the
--- private part of its parent unit.
---
--- TEST DESCRIPTION:
--- Declare a parent package containing private types, objects,
--- and functions used by the system. Declare a private child package that
--- uses the parent components to provide functionality to the system.
---
--- Declare an array of files with default values for all
--- component fields of the files (records). Check the initial state of
--- a specified file for proper default values. Perform the file "creation"
--- (initialization), which will modify the fields of the record object.
--- Again verify the file object to determine whether the fields have been
--- reset properly.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
-
-package CA11010_0 is -- Package OS.
-
- type File_Descriptor_Type is private;
-
- Default_Descriptor : constant File_Descriptor_Type;
-
- function Initialize_File return File_Descriptor_Type;
- procedure Verify_Initial_Conditions (Status : out Boolean);
- function Final_Conditions_Valid return Boolean;
-
-private
-
- type File_Descriptor_Type is new Integer;
- type File_Name_Type is new String (1 .. 11);
- type Permission_Type is (None, User, System);
- type File_Mode_Type is (Read_Only, Write_Only, Read_Write);
- type File_Status_Type is (Open, Closed);
-
- Default_Descriptor : constant File_Descriptor_Type := 0;
- Default_Permission : constant Permission_Type := None;
- Default_Mode : constant File_Mode_Type := Read_Only;
- Default_Status : constant File_Status_Type := Closed;
- Default_Filename : constant File_Name_Type := " ";
- An_Ada_File_Name : constant File_Name_Type := "AdaFileName";
- Max_Files : constant File_Descriptor_Type := 100;
-
- type File_Type is tagged
- record
- Descriptor : File_Descriptor_Type := Default_Descriptor;
- Name : File_Name_Type := Default_Filename;
- Acct_Access : Permission_Type := Default_Permission;
- Mode : File_Mode_Type := Default_Mode;
- Current_Status : File_Status_Type := Default_Status;
- end record;
-
- type File_Array_Type is array (1 .. Max_Files) of File_Type;
-
- File_Table : File_Array_Type;
- File_Counter : Integer := 0;
-
- --
-
- function Get_File_Name return File_Name_Type;
-
-end CA11010_0; -- Package OS.
-
- --=================================================================--
-
--- Subprograms that perform the actual file operations are contained in a
--- private package so that they are not accessible to any client.
-
-private package CA11010_0.CA11010_1 is -- Package OS.Internals
-
- Private_File_Counter : Integer renames File_Counter; -- Parent priv. object.
-
- function Initialize
- (File_Name : File_Name_Type := Get_File_Name; -- Parent priv. function.
- File_Mode : File_Mode_Type := Read_Write) -- Parent priv. literal.
- return File_Descriptor_Type; -- Parent type.
-
-end CA11010_0.CA11010_1; -- Package OS.Internals
-
- --=================================================================--
-
-package body CA11010_0.CA11010_1 is -- Package body OS.Internals
-
- function Next_Available_File return File_Descriptor_Type is
- begin
- Private_File_Counter := Private_File_Counter + 1;
- return (File_Descriptor_Type(File_Counter));
- end Next_Available_File;
- ----------------------------------------------------------------
- function Initialize
- (File_Name : File_Name_Type := Get_File_Name; -- Parent priv. function
- File_Mode : File_Mode_Type := Read_Write) -- Parent priv. literal
- return File_Descriptor_Type is -- Parent type
- Number : File_Descriptor_Type;
- begin
- Number := Next_Available_File;
- File_Table(Number).Descriptor := Number; -- Parent priv. object
- File_Table(Number).Name := File_Name; -- Default parameter value
- File_Table(Number).Mode := File_Mode; -- Default parameter value
- File_Table(Number).Acct_Access := User;
- File_Table(Number).Current_Status := Open;
- return (Number);
- end Initialize;
-
-end CA11010_0.CA11010_1; -- Package body OS.Internals
-
- --=================================================================--
-
-with CA11010_0.CA11010_1; -- Private child package "withed" by
- -- parent body.
-
-package body CA11010_0 is -- Package body OS
-
- function Get_File_Name return File_Name_Type is
- begin
- return (An_Ada_File_Name); -- If this was a real function, the user
- end Get_File_Name; -- would be asked to input a name, or there
- -- would be some type of similar processing.
-
- -- This subprogram utilizes a call to a subprogram contained in a private
- -- child to perform the actual processing.
-
- function Initialize_File return File_Descriptor_Type is
- begin
- return (CA11010_0.CA11010_1.Initialize); -- No parameters are needed,
- -- since defaults have been
- -- provided.
- end Initialize_File;
-
- --
- -- Separate subunits.
- --
-
- procedure Verify_Initial_Conditions (Status : out Boolean) is separate;
-
- function Final_Conditions_Valid return Boolean is separate;
-
-end CA11010_0; -- Package body OS
-
- --=================================================================--
-
-separate (CA11010_0)
-procedure Verify_Initial_Conditions (Status : out Boolean) is
-begin
- Status := False;
- if (File_Table(1).Descriptor = Default_Descriptor) and then
- (File_Table(1).Name = Default_Filename) and then
- (File_Table(1).Acct_Access = Default_Permission) and then
- (File_Table(1).Mode = Default_Mode) and then
- (File_Table(1).Current_Status = Default_Status)
- then
- Status := True;
- end if;
-end Verify_Initial_Conditions;
-
- --=================================================================--
-
-separate (CA11010_0)
-function Final_Conditions_Valid return Boolean is
-begin
- if ((File_Table(1).Descriptor /= Default_Descriptor) and then
- (File_Table(1).Name = An_Ada_File_Name) and then
- (File_Table(1).Acct_Access = User) and then
- not ((File_Table(1).Mode = Default_Mode) or else
- (File_Table(1).Current_Status = Default_Status)))
- then
- return (True);
- else
- return (False);
- end if;
-end Final_Conditions_Valid;
-
- --=================================================================--
-
-with CA11010_0; -- with Package OS.
-with Report;
-
-procedure CA11010 is
-
- package OS renames CA11010_0;
-
- Ada_File_Key : OS.File_Descriptor_Type := OS.Default_Descriptor;
- Initialization_Status : Boolean := False;
-
-begin
-
- -- This test indicates one approach to a file management operation.
- -- It is not intended to demonstrate full functionality, but rather
- -- that the use of a private child package can provide a solution
- -- to a user situation, that being the implementation of certain functions
- -- being provided in a child package, with the parent package body
- -- utilizing these implementations.
-
- Report.Test ("CA11010", "Check that a private child package can use " &
- "entities declared in the private part of its " &
- "parent unit");
-
- -- Check initial conditions of the first entry in the file table.
- -- These are all default values provided in the declaration of the
- -- type File_Type.
-
- OS.Verify_Initial_Conditions (Initialization_Status);
-
- if not Initialization_Status then
- Report.Failed ("Initial condition failure");
- end if;
-
- -- Call the initialization function. This will result in the resetting
- -- of the fields associated with the first entry in the File_Table (this
- -- is the first/only call of Initialize_File).
- -- No parameters are necessary for this call, due to the default values
- -- provided in the private child package routine Initialize.
-
- Ada_File_Key := OS.Initialize_File;
-
- -- Verify that the initial conditions of the file table component have
- -- been properly modified by the initialization function.
-
- if not OS.Final_Conditions_Valid then
- Report.Failed ("Initialization processing failure");
- end if;
-
- Report.Result;
-
-end CA11010;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11011.a b/gcc/testsuite/ada/acats/tests/ca/ca11011.a
deleted file mode 100644
index a75261dd840..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11011.a
+++ /dev/null
@@ -1,271 +0,0 @@
--- CA11011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a private child package can use entities declared in the
--- private part of the parent unit of its parent unit.
---
--- TEST DESCRIPTION:
--- Declare a parent package containing private types and objects
--- used by the system. Declare a public child package that
--- provides a visible interface to the system functionality.
--- Declare a private grandchild package that uses the visible grandparent
--- components to provide the actual functionality to the system.
---
--- The public child (parent of the private grandchild) uses the
--- functionality of its private child (grandchild package) to provide
--- the visible interface to operations of the system.
---
--- The test itself will utilize the visible interface provided in the
--- public child package to demonstrate a possible solution to file
--- management.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CA11011_0 is -- Package OS.
-
- type File_Descriptor_Type is private;
-
- Default_Descriptor : constant File_Descriptor_Type;
- First_File : constant File_Descriptor_Type;
-
- procedure Verify_Initial_Conditions (Key : in File_Descriptor_Type;
- Status : out Boolean);
-
- function Final_Conditions_Valid (Key : File_Descriptor_Type)
- return Boolean;
-
-
-private
-
- type File_Descriptor_Type is new Integer;
- type File_Name_Type is new String (1 .. 11);
- type Permission_Type is (None, User, System);
- type File_Mode_Type is (Read_Only, Write_Only, Read_Write);
- type File_Status_Type is (Open, Closed);
-
- Default_Descriptor : constant File_Descriptor_Type := 0;
- First_File : constant File_Descriptor_Type := 1;
- Default_Permission : constant Permission_Type := None;
- Default_Mode : constant File_Mode_Type := Read_Only;
- Default_Status : constant File_Status_Type := Closed;
- Default_Filename : constant File_Name_Type := " ";
-
- Init_Permission : constant Permission_Type := User;
- Init_Mode : constant File_Mode_Type := Read_Write;
- Init_Status : constant File_Status_Type := Open;
- An_Ada_File_Name : constant File_Name_Type := "AdaFileName";
-
- Max_Files : constant File_Descriptor_Type := 10;
-
- type File_Type is tagged
- record
- Descriptor : File_Descriptor_Type := Default_Descriptor;
- Name : File_Name_Type := Default_Filename;
- Acct_Access : Permission_Type := Default_Permission;
- Mode : File_Mode_Type := Default_Mode;
- Current_Status : File_Status_Type := Default_Status;
- end record;
-
- type File_Array_Type is array (1 .. Max_Files) of File_Type;
-
- File_Table : File_Array_Type;
- File_Counter : Integer := 0;
-
- --
-
- function Get_File_Name return File_Name_Type;
-
-end CA11011_0; -- Package OS.
-
- --=================================================================--
-
-package body CA11011_0 is -- Package body OS.
-
- function Get_File_Name return File_Name_Type is
- begin
- return (An_Ada_File_Name);
- end Get_File_Name;
- ---------------------------------------------------------------------
- procedure Verify_Initial_Conditions (Key : in File_Descriptor_Type;
- Status : out Boolean) is
- begin
- Status := False;
- if (File_Table(Key).Descriptor = Default_Descriptor) and then
- (File_Table(Key).Name = Default_Filename) and then
- (File_Table(Key).Acct_Access = Default_Permission) and then
- (File_Table(Key).Mode = Default_Mode) and then
- (File_Table(Key).Current_Status = Default_Status)
- then
- Status := True;
- end if;
- end Verify_Initial_Conditions;
- ---------------------------------------------------------------------
- function Final_Conditions_Valid (Key : File_Descriptor_Type)
- return Boolean is
- begin
- if ((File_Table(Key).Descriptor = First_File) and then
- (File_Table(Key).Name = An_Ada_File_Name) and then
- (File_Table(Key).Acct_Access = Init_Permission) and then
- not ((File_Table(Key).Mode = Default_Mode) or else
- (File_Table(Key).Current_Status = Default_Status)))
- then
- return (True);
- else
- return (False);
- end if;
- end Final_Conditions_Valid;
-
-end CA11011_0; -- Package body OS.
-
- --=================================================================--
-
-package CA11011_0.CA11011_1 is -- Package OS.File_Manager
-
- procedure Create_File (File_Key : in File_Descriptor_Type);
-
-end CA11011_0.CA11011_1; -- Package OS.File_Manager
-
- --=================================================================--
-
--- The Subprogram that performs the actual file operations is contained in a
--- private package so that it is not accessible to any client.
--- Default parameters are used in most cases in the subprogram calls, since
--- the caller does not have visibility to these private types.
-
- -- Package OS.File_Manager.Internals
-private package CA11011_0.CA11011_1.CA11011_2 is
-
- Private_File_Counter : Integer renames File_Counter; -- Grandparent
- -- object.
- procedure Create
- (Key : in File_Descriptor_Type;
- File_Name : in File_Name_Type := Get_File_Name; -- Grandparent
- -- prvt type,
- -- prvt functn.
- File_Mode : in File_Mode_Type := Init_Mode; -- Grandparent
- -- prvt type,
- -- prvt const.
- File_Access : in Permission_Type := Init_Permission; -- Grandparent
- -- prvt type,
- -- prvt const.
- File_Status : in File_Status_Type := Init_Status); -- Grandparent
- -- prvt type,
- -- prvt const.
-
-end CA11011_0.CA11011_1.CA11011_2; -- Package OS.File_Manager.Internals
-
- --=================================================================--
-
- -- Package Body OS.File_Manager.Internals
-package body CA11011_0.CA11011_1.CA11011_2 is
-
- procedure Create
- (Key : in File_Descriptor_Type;
- File_Name : in File_Name_Type := Get_File_Name;
- File_Mode : in File_Mode_Type := Init_Mode;
- File_Access : in Permission_Type := Init_Permission;
- File_Status : in File_Status_Type := Init_Status) is
- begin
- Private_File_Counter := Private_File_Counter + 1;
- File_Table(Key).Descriptor := Key; -- Grandparent object.
- File_Table(Key).Name := File_Name;
- File_Table(Key).Mode := File_Mode;
- File_Table(Key).Acct_Access := File_Access;
- File_Table(Key).Current_Status := File_Status;
- end Create;
-
-end CA11011_0.CA11011_1.CA11011_2; -- Package body OS.File_Manager.Internals
-
- --=================================================================--
-
-with CA11011_0.CA11011_1.CA11011_2; -- with Child OS.File_Manager.Internals
-
-package body CA11011_0.CA11011_1 is -- Package body OS.File_Manager
-
- package Internal renames CA11011_0.CA11011_1.CA11011_2;
-
- -- This subprogram utilizes a call to a subprogram contained in a private
- -- child to perform the actual processing.
-
- procedure Create_File (File_Key : in File_Descriptor_Type) is
- begin
- Internal.Create (Key => File_Key); -- Other parameters are defaults,
- -- since they are of private types
- -- from the parent package.
- -- File_Descriptor_Type is private,
- -- but declared in visible part of
- -- parent spec.
- end Create_File;
-
-end CA11011_0.CA11011_1; -- Package body OS.File_Manager
-
- --=================================================================--
-
-with CA11011_0.CA11011_1; -- with public Child Package OS.File_Manager
-with Report;
-
-procedure CA11011 is
-
- package OS renames CA11011_0;
- package File_Manager renames CA11011_0.CA11011_1;
-
- Data_Base_File_Key : OS.File_Descriptor_Type := OS.First_File;
- TC_Status : Boolean := False;
-
-begin
-
- -- This test indicates one approach to file management operations.
- -- It is not intended to demonstrate full functionality, but rather
- -- that the use of a private child package can provide a solution
- -- to a typical user situation.
-
- Report.Test ("CA11011", "Check that a private child package can use " &
- "entities declared in the private part of the " &
- "parent unit of its parent unit");
-
- OS.Verify_Initial_Conditions (Data_Base_File_Key, TC_Status);
-
- if not TC_Status then
- Report.Failed ("Initial condition failure");
- end if;
-
- -- Perform file initializations.
-
- File_Manager.Create_File (File_Key => Data_Base_File_Key);
-
- TC_Status := OS.Final_Conditions_Valid (Data_Base_File_Key);
-
- if not TC_Status then
- Report.Failed ("Bad status return from Create_File");
- end if;
-
- Report.Result;
-
-end CA11011;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11012.a b/gcc/testsuite/ada/acats/tests/ca/ca11012.a
deleted file mode 100644
index 071b8f8134b..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11012.a
+++ /dev/null
@@ -1,259 +0,0 @@
--- CA11012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a child package of a library level instantiation
--- of a generic can be the instantiation of a child package of
--- the generic. Check that the child instance can use its parent's
--- declarations and operations, including a formal type of the parent.
---
--- TEST DESCRIPTION:
--- Declare a generic package which simulates an integer complex
--- abstraction. Declare a generic child package of this package
--- which defines additional complex operations.
---
--- Instantiate the first generic package, then instantiate the child
--- generic package as a child unit of the first instance. In the main
--- program, check that the operations in both instances perform as
--- expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 21 Dec 94 SAIC Corrected visibility errors for literals
--- 27 Feb 97 PWB.CTA Added elaboration pragma at package CA11012_3
---!
-
-generic -- Complex number abstraction.
- type Int_Type is range <>;
-
-package CA11012_0 is
-
- -- Simulate a generic complex number support package. Complex numbers
- -- are treated as coordinates in the Cartesian plane.
-
- type Complex_Type is private;
-
- Zero : constant Complex_Type; -- Real number (0,0).
-
- function Complex (Real, Imag : Int_Type) -- Create a complex
- return Complex_Type; -- number.
-
- function "-" (Right : Complex_Type) -- Invert a complex
- return Complex_Type; -- number.
-
- function "+" (Left, Right : Complex_Type) -- Add two complex
- return Complex_Type; -- numbers.
-
-private
- type Complex_Type is record
- Real : Int_Type;
- Imag : Int_Type;
- end record;
-
- Zero : constant Complex_Type := (Real => 0, Imag => 0);
-
-end CA11012_0;
-
- --==================================================================--
-
-package body CA11012_0 is
-
- function Complex (Real, Imag : Int_Type) return Complex_Type is
- begin
- return (Real, Imag);
- end Complex;
- ---------------------------------------------------------------
- function "-" (Right : Complex_Type) return Complex_Type is
- begin
- return (-Right.Real, -Right.Imag);
- end "-";
- ---------------------------------------------------------------
- function "+" (Left, Right : Complex_Type) return Complex_Type is
- begin
- return ( (Left.Real + Right.Real, Left.Imag + Right.Imag) );
- end "+";
-
-end CA11012_0;
-
- --==================================================================--
-
--- Generic child of complex number package. Child must be generic since
--- parent is generic.
-
-generic -- Complex additional operations
-
-package CA11012_0.CA11012_1 is
-
- -- More operations on complex number. This child adds a layer of
- -- functionality to the parent generic.
-
- function Real_Part (Complex_No : Complex_Type)
- return Int_Type;
-
- function Imag_Part (Complex_No : Complex_Type)
- return Int_Type;
-
- function "*" (Factor : Int_Type;
- C : Complex_Type) return Complex_Type;
-
- function Vector_Magnitude (Complex_No : Complex_Type)
- return Int_Type;
-
-end CA11012_0.CA11012_1;
-
- --==================================================================--
-
-package body CA11012_0.CA11012_1 is
-
- function Real_Part (Complex_No : Complex_Type) return Int_Type is
- begin
- return (Complex_No.Real);
- end Real_Part;
- ---------------------------------------------------------------
- function Imag_Part (Complex_No : Complex_Type) return Int_Type is
- begin
- return (Complex_No.Imag);
- end Imag_Part;
- ---------------------------------------------------------------
- function "*" (Factor : Int_Type;
- C : Complex_Type) return Complex_Type is
- Result : Complex_Type := Zero; -- Zero is declared in parent,
- -- Complex_Number
- begin
- for I in 1 .. abs (Factor) loop
- Result := Result + C; -- Complex_Number "+"
- end loop;
-
- if Factor < 0 then
- Result := - Result; -- Complex_Number "-"
- end if;
-
- return Result;
- end "*";
- ---------------------------------------------------------------
- function Vector_Magnitude (Complex_No : Complex_Type)
- return Int_Type is -- Not a real vector magnitude.
- begin
- return (Complex_No.Real + Complex_No.Imag);
- end Vector_Magnitude;
-
-end CA11012_0.CA11012_1;
-
- --==================================================================--
-
-package CA11012_2 is
-
- subtype My_Integer is integer range -100 .. 100;
-
- -- ... Various other types used by the application.
-
-end CA11012_2;
-
--- No body for CA11012_2;
-
- --==================================================================--
-
--- Declare instances of the generic complex packages for integer type.
--- The instance of the child must itself be declared as a child of the
--- instance of the parent.
-
-with CA11012_0; -- Complex number abstraction
-with CA11012_2; -- Package containing integer type
-pragma Elaborate (CA11012_0);
-package CA11012_3 is new CA11012_0 (Int_Type => CA11012_2.My_Integer);
-
-with CA11012_0.CA11012_1; -- Complex additional operations
-with CA11012_3;
-package CA11012_3.CA11012_4 is new CA11012_3.CA11012_1;
-
- --==================================================================--
-
-with CA11012_2; -- Package containing integer type
-with CA11012_3.CA11012_4; -- Complex abstraction + additional operations
-with Report;
-
-procedure CA11012 is
-
- package My_Complex_Pkg renames CA11012_3;
-
- package My_Complex_Operation renames CA11012_3.CA11012_4;
-
- use My_Complex_Pkg, -- All user-defined
- My_Complex_Operation; -- operators directly
- -- visible.
- Complex_One, Complex_Two : Complex_Type;
-
-begin
-
- Report.Test ("CA11012", "Check that child instance can use its parent's " &
- "declarations and operations, including a formal " &
- "type of the parent");
-
- Correct_Range_Test:
- declare
- My_Literal : CA11012_2.My_Integer := -3;
-
- begin
- Complex_One := Complex (-4, 7); -- Operation from the generic
- -- parent package.
-
- Complex_Two := My_Literal * Complex_One; -- Operation from the generic
- -- child package.
-
- if Real_Part (Complex_Two) /= 12 -- Operation from the generic
- or Imag_Part (Complex_Two) /= -21 -- child package.
- then
- Report.Failed ("Incorrect results from complex operation");
- end if;
-
- end Correct_Range_Test;
-
- ---------------------------------------------------------------
-
- Out_Of_Range_Test:
- declare
- My_Vector : CA11012_2.My_Integer;
-
- begin
- Complex_One := Complex (70, 70); -- Operation from the generic
- -- parent package.
- My_Vector := Vector_Magnitude (Complex_One);
- -- Operation from the generic child package.
-
- Report.Failed ("Exception not raised in child package");
-
- exception
- when Constraint_Error =>
- Report.Comment ("Exception is raised as expected");
-
- when others =>
- Report.Failed ("Others exception is raised");
-
- end Out_Of_Range_Test;
-
- Report.Result;
-
-end CA11012;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11013.a b/gcc/testsuite/ada/acats/tests/ca/ca11013.a
deleted file mode 100644
index c7f442788c1..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11013.a
+++ /dev/null
@@ -1,201 +0,0 @@
--- CA11013.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a child function of a library level instantiation
--- of a generic can be the instantiation of a child function of
--- the generic. Check that the child instance can use its parent's
--- declarations and operations, including a formal subprogram of the
--- parent.
---
--- TEST DESCRIPTION:
--- Declare a generic package which simulates a real complex
--- abstraction. Declare a generic child function of this package
--- which builds a random complex number. Declare a second
--- package which defines a random complex number generator. This
--- package provides actual parameters for the generic parent package.
---
--- Instantiate the first generic package, then instantiate the child
--- generic function as a child unit of the first instance. In the main
--- program, check that the operations in both instances perform as
--- expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 16 Nov 95 SAIC Update and repair for ACVC 2.0.1
--- 19 Oct 96 SAIC ACVC 2.1: Added pragma Elaborate to context
--- clause of CA11013_3.
--- 27 Feb 97 CTA.PWB Added elaboration pragma at package CA11013_3
---!
-
-generic -- Complex number abstraction.
- type Real_Type is digits <>;
- with function Random_Generator (Seed : Real_Type) return Real_Type;
-
-package CA11013_0 is
-
- -- Simulate a generic complex number support package. Complex numbers
- -- are treated as coordinates in the Cartesian plane.
-
- type Complex_Type is
- record
- Real : Real_Type;
- Imag : Real_Type;
- end record;
-
- function Make (Real, Imag : Real_Type) -- Create a complex
- return Complex_Type; -- number.
-
- procedure Components (Complex_No : in Complex_Type;
- Real_Part, Imag_Part : out Real_Type);
-
-end CA11013_0;
-
- --==================================================================--
-
-package body CA11013_0 is
-
- function Make (Real, Imag : Real_Type) return Complex_Type is
- begin
- return (Real, Imag);
- end Make;
- -------------------------------------------------------------
- procedure Components (Complex_No : in Complex_Type;
- Real_Part, Imag_Part : out Real_Type) is
- begin
- Real_Part := Complex_No.Real;
- Imag_Part := Complex_No.Imag;
- end Components;
-
-end CA11013_0;
-
- --==================================================================--
-
--- Generic child of complex number package. This child adds a layer of
--- functionality to the parent generic.
-
-generic -- Random complex number operation.
-
-function CA11013_0.CA11013_1 (Seed : Real_Type) return Complex_Type;
-
- --==============================================--
-
-function CA11013_0.CA11013_1 (Seed : Real_Type) return Complex_Type is
-
- Random_Real_Part : Real_Type := Random_Generator (Seed);
- -- parent's formal subprogram
- Random_Imag_Part : Real_Type
- := Random_Generator (Random_Generator (Seed));
- -- parent's formal subprogram
- Random_Complex_No : Complex_Type;
-
-begin -- CA11013_0.CA11013_1
-
- Random_Complex_No := Make (Random_Real_Part, Random_Imag_Part);
- -- operation from parent
- return (Random_Complex_No);
-
-end CA11013_0.CA11013_1;
-
- --==================================================================--
-
-package CA11013_2 is
-
- -- To be used as actual parameters for random number generator
- -- in the parent package.
-
- type My_Float is digits 6 range -10.0 .. 100.0;
-
- function Random_Complex (Seed : My_float) return My_Float;
-
-end CA11013_2;
-
- --==================================================================--
-
-package body CA11013_2 is
-
- -- Not a real random number generator.
- function Random_Complex (Seed : My_float) return My_Float is
- begin
- return (Seed + 3.0);
- end Random_Complex;
-
-end CA11013_2;
-
- --==================================================================--
-
--- Declare instances of the generic complex packages for real type.
--- The instance of the child must itself be declared as a child of the
--- instance of the parent.
-
-with CA11013_0; -- Complex number.
-with CA11013_2; -- Random number generator.
-pragma Elaborate (CA11013_0);
-package CA11013_3 is new
- CA11013_0 (Random_Generator => CA11013_2.Random_Complex,
- Real_Type => CA11013_2.My_Float);
-
-with CA11013_0.CA11013_1; -- Random complex number operation.
-with CA11013_3;
-pragma Elaborate (CA11013_3);
-function CA11013_3.CA11013_4 is new CA11013_3.CA11013_1;
-
- --==================================================================--
-
-with Report;
-with CA11013_2; -- Random number generator.
-with CA11013_3.CA11013_4; -- Complex abstraction + Random complex
- -- number operation.
-procedure CA11013 is
-
- package My_Complex_Pkg renames CA11013_3;
- use type CA11013_2.My_Float;
-
- My_Complex : My_Complex_Pkg.Complex_Type;
- My_Literal : CA11013_2.My_Float := 3.0;
- My_Real_Part, My_Imag_Part : CA11013_2.My_Float;
-
-begin
-
- Report.Test ("CA11013", "Check that child instance can use its parent's " &
- "declarations and operations, including a formal " &
- "subprogram of the parent");
-
- My_Complex := CA11013_3.CA11013_4 (My_Literal);
- -- Operation from the generic child function.
-
- My_Complex_Pkg.Components (My_Complex, My_Real_Part, My_Imag_Part);
- -- Operation from the generic parent package.
-
- if My_Real_Part /= 6.0 -- Operation from the generic
- or My_Imag_Part /= 9.0 -- parent package.
- then
- Report.Failed ("Incorrect results from complex operation");
- end if;
-
- Report.Result;
-
-end CA11013;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11014.a b/gcc/testsuite/ada/acats/tests/ca/ca11014.a
deleted file mode 100644
index 7847a5067c1..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11014.a
+++ /dev/null
@@ -1,302 +0,0 @@
--- CA11014.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an instantiation of a child package of a generic package
--- can use its parent's declarations and operations, including a formal
--- package of the parent.
---
--- TEST DESCRIPTION:
--- Declare a list abstraction in a generic package which manages lists of
--- elements of any discrete type. Declare a generic package which
--- operates on lists of elements of integer types. Declare a generic
--- child of this package which defines additional list operations.
--- Use the formal discrete type as the generic formal actual part for the
--- parent formal package.
---
--- Declare an instance of parent, then declare an instance of the child
--- which is itself a child the parent's instance. In the main program,
--- check that the operations in both instances perform as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 Nov 95 SAIC Update and repair for ACVC 2.0.1
--- 07 Sep 96 SAIC Change formal param E to be out only.
--- 19 Oct 96 SAIC ACVC 2.1: Added pragma Elaborate to context
--- clauses of CA11014_0, CA11014_1, and CA11014_5.
--- 27 Feb 97 PWB.CTA Added elaboration pragma at package CA11014_4
---!
-
--- Actual package for the parent's formal.
-generic
-
- type Element_Type is (<>); -- List elems may be of any discrete types.
-
-package CA11014_0 is
-
- type Node_Type;
- type Node_Pointer is access Node_Type;
-
- type Node_Type is record
- Item : Element_Type;
- Next : Node_Pointer := null;
- end record;
-
- type List_Type is record
- First : Node_Pointer := null;
- Current : Node_Pointer := null;
- Last : Node_Pointer := null;
- end record;
-
- -- Return true if current element is last in the list.
- function End_Of_List (L : List_Type) return boolean;
-
- -- Set "current" pointer to first list element.
- procedure Reset (L : in out List_Type);
-
-end CA11014_0;
-
- --==================================================================--
-
-package body CA11014_0 is
-
- function End_Of_List (L : List_Type) return boolean is
- begin
- return (L.Current = null);
- end End_Of_List;
- -------------------------------------------------------
- procedure Reset (L : in out List_Type) is
- begin
- L.Current := L.First; -- Set "current" pointer to first
- end Reset; -- list element.
-
-end CA11014_0;
-
- --==================================================================--
-
-with CA11014_0; -- Generic list abstraction.
-pragma Elaborate (CA11014_0);
-generic
-
- -- Import the list abstraction defined in CA11014_0.
- with package List_Mgr is new CA11014_0 (<>);
-
-package CA11014_1 is
-
- -- Write to current element and advance "current" pointer.
- procedure Write_Element (L : in out List_Mgr.List_Type;
- E : in List_Mgr.Element_Type);
-
- -- Read from current element and advance "current" pointer.
- procedure Read_Element (L : in out List_Mgr.List_Type;
- E : out List_Mgr.Element_Type);
-
- -- Add element to end of list.
- procedure Add_Element (L : in out List_Mgr.List_Type;
- E : in List_Mgr.Element_Type);
-
-end CA11014_1;
-
- --==================================================================--
-
-package body CA11014_1 is
-
- procedure Write_Element (L : in out List_Mgr.List_Type;
- E : in List_Mgr.Element_Type) is
- begin
- L.Current.Item := E; -- Write to current element.
- L.Current := L.Current.Next; -- Advance "current" pointer.
- end Write_Element;
- -------------------------------------------------------
- procedure Read_Element (L : in out List_Mgr.List_Type;
- E : out List_Mgr.Element_Type) is
- begin
- E := L.Current.Item; -- Retrieve current element.
- L.Current := L.Current.Next; -- Advance "current" pointer.
- end Read_Element;
- -------------------------------------------------------
- procedure Add_Element (L : in out List_Mgr.List_Type;
- E : in List_Mgr.Element_Type) is
- New_Node : List_Mgr.Node_Pointer := new List_Mgr.Node_Type'(E, null);
- use type List_Mgr.Node_Pointer;
- begin
- if L.First = null then -- No elements in list, so add new
- L.First := New_Node; -- element at beginning of list.
- else
- L.Last.Next := New_Node; -- Add new element at end of list.
- end if;
- L.Last := New_Node; -- Set last-in-list pointer.
- end Add_Element;
-
-end CA11014_1;
-
- --==================================================================--
-
--- Generic child of list operation. This child adds a layer of
--- functionality to the parent generic.
-
-generic
-
-package CA11014_1.CA11014_2 is
-
- procedure Write_First_To_List (L : in out List_Mgr.List_Type);
-
- -- ... Various other operations used by the application.
-
-end CA11014_1.CA11014_2;
-
- --==================================================================--
-
-package body CA11014_1.CA11014_2 is
-
- procedure Write_First_To_List (L : in out List_Mgr.List_Type) is
- begin
- List_Mgr.Reset (L); -- Parent's formal package.
-
- while not List_Mgr.End_Of_List (L) loop -- Parent's formal package.
- Write_Element (L, List_Mgr.Element_Type'First);
- -- Parent's operation,
- end loop; -- parent's formal.
-
- end Write_First_To_List;
-
-end CA11014_1.CA11014_2;
-
- --==================================================================--
-
-package CA11014_3 is
-
- type Points is range 0 .. 100;
-
- -- ... Various other types used by the application.
-
-end CA11014_3;
-
-
--- No body for CA11014_3;
-
- --==================================================================--
-
--- Declare instances of the generic list packages for the discrete type.
--- The instance of the child must itself be declared as a child of the
--- instance of the parent.
-
-with CA11014_0; -- Generic list abstraction.
-with CA11014_3; -- Package containing discrete type declaration.
-pragma Elaborate (CA11014_0);
-package CA11014_4 is new CA11014_0 (CA11014_3.Points); -- Points list.
-
-with CA11014_4; -- Points list.
-with CA11014_1; -- Generic list operation.
-pragma Elaborate (CA11014_1);
-package CA11014_5 is new CA11014_1 (CA11014_4); -- Scores list.
-
-with CA11014_1.CA11014_2; -- Additional generic list operation,
-with CA11014_5;
-pragma Elaborate (CA11014_5);
-package CA11014_5.CA11014_6 is new CA11014_5.CA11014_2;
- -- Points list operation.
-
- --==================================================================--
-
-with CA11014_1.CA11014_2; -- Additional generic list operation,
- -- implicitly with list operation.
-with CA11014_3; -- Package containing discrete type declaration.
-with CA11014_4; -- Points list.
-with CA11014_5.CA11014_6; -- Points list operation.
-with Report;
-
-procedure CA11014 is
-
- package Lists_Of_Scores renames CA11014_4;
- package Score_Ops renames CA11014_5;
- package Point_Ops renames CA11014_5.CA11014_6;
-
- Scores : Lists_Of_Scores.List_Type; -- List of points.
-
- type TC_Score_Array is array (1 .. 3) of CA11014_3.Points;
-
- TC_Initial_Values : constant TC_Score_Array := (10, 21, 49);
- TC_Final_Values : constant TC_Score_Array := (0, 0, 0);
-
- TC_Initial_Values_Are_Correct : boolean := false;
- TC_Final_Values_Are_Correct : boolean := false;
-
- --------------------------------------------------
-
- -- Initial list contains 3 scores with the values 10, 21, and 49.
- procedure TC_Initialize_List (L : in out Lists_of_Scores.List_Type) is
- begin
- for I in TC_Score_Array'range loop
- Score_Ops.Add_Element (L, TC_Initial_Values(I));
- -- Operation from generic parent.
- end loop;
- end TC_Initialize_List;
-
- --------------------------------------------------
-
- -- Verify that all scores have been set to zero.
- procedure TC_Verify_List (L : in out Lists_of_Scores.List_Type;
- Expected : in TC_Score_Array;
- OK : out boolean) is
- Actual : TC_Score_Array;
- begin
- Lists_of_Scores.Reset (L); -- Operation from parent's formal.
- for I in TC_Score_Array'range loop
- Score_Ops.Read_Element (L, Actual(I));
- -- Operation from generic parent.
- end loop;
- OK := (Actual = Expected);
- end TC_Verify_List;
-
- --------------------------------------------------
-
-begin -- CA11014
-
- Report.Test ("CA11014", "Check that an instantiation of a child package " &
- "of a generic package can use its parent's " &
- "declarations and operations, including a " &
- "formal package of the parent");
-
- TC_Initialize_List (Scores);
- TC_Verify_List (Scores, TC_Initial_Values, TC_Initial_Values_Are_Correct);
-
- if not TC_Initial_Values_Are_Correct then
- Report.Failed ("List contains incorrect initial values");
- end if;
-
- Point_Ops.Write_First_To_List (Scores);
- -- Operation from generic child package.
-
- TC_Verify_List (Scores, TC_Final_Values, TC_Final_Values_Are_Correct);
-
- if not TC_Final_Values_Are_Correct then
- Report.Failed ("List contains incorrect final values");
- end if;
-
- Report.Result;
-
-end CA11014;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11015.a b/gcc/testsuite/ada/acats/tests/ca/ca11015.a
deleted file mode 100644
index 79b99ede82c..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11015.a
+++ /dev/null
@@ -1,312 +0,0 @@
--- CA11015.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a generic child of a non-generic package can use its
--- parent's declarations and operations. Check that the instantiation
--- of the generic child can correctly use the operations.
---
--- TEST DESCRIPTION:
--- Declare a map abstraction in a package which manages basic physical
--- maps. Declare a generic child of this package which defines copies
--- of maps of any discrete type, i.e., population, density, or weather.
---
--- In the main program, declare an instance of the child. Check that
--- the operations in the parent and instance of the child package
--- perform as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
--- Simulates map of physical features, i.e., desert, forest, water,
--- or plains.
-
-package CA11015_0 is
- type Map_Type is private;
- subtype Latitude is integer range 1 .. 9;
- subtype Longitude is integer range 1 .. 7;
-
- type Physical_Features is (Desert, Forest, Water, Plains, Unexplored);
- type Page_Type is range 0 .. 80;
-
- Terra_Incognita : exception;
-
- -- Use geographic database to initialize the basic map.
-
- procedure Initialize_Basic_Map (Map : in out Map_Type);
-
- function Get_Physical_Feature (Lat : Latitude;
- Long : Longitude;
- Map : Map_Type) return Physical_Features;
-
- function Next_Page return Page_Type;
-
-private
- type Map_Type is array (Latitude, Longitude) of Physical_Features;
- Basic_Map : Map_Type;
- Page : Page_Type := 0; -- Location for each copy of Map.
-
-end CA11015_0;
-
- --==================================================================--
-
-package body CA11015_0 is
-
- procedure Initialize_Basic_Map (Map : in out Map_Type) is
- -- Not a real initialization. Real application can use geographic
- -- database to create the basic map.
- begin
- for I in Latitude'first .. Latitude'last loop
- for J in 1 .. 2 loop
- Map (I, J) := Unexplored;
- end loop;
- for J in 3 .. 4 loop
- Map (I, J) := Desert;
- end loop;
- for J in 5 .. 7 loop
- Map (I, J) := Plains;
- end loop;
- end loop;
-
- end Initialize_Basic_Map;
- ---------------------------------------------------
- function Get_Physical_Feature (Lat : Latitude;
- Long : Longitude;
- Map : Map_Type)
- return Physical_Features is
- begin
- return (Map (Lat, Long));
- end Get_Physical_Feature;
- ---------------------------------------------------
- function Next_Page return Page_Type is
- begin
- Page := Page + 1;
- return (Page);
- end Next_Page;
-
- ---------------------------------------------------
- begin -- CA11015_0
- -- Initialize a basic map.
- Initialize_Basic_Map (Basic_Map);
-
-end CA11015_0;
-
- --==================================================================--
-
--- Generic child package of physical map. Instantiate this package to
--- create map copy with a new geographic feature, i.e., population, density,
--- or weather.
-
-generic
-
- type Generic_Feature is (<>); -- Any geographic feature, i.e., population,
- -- density, or weather that can be
- -- characterized by a scalar value.
-
-package CA11015_0.CA11015_1 is
-
- type Feature_Map is private;
-
- function Get_Feature_Val (Lat : Latitude;
- Long : Longitude;
- Map : Feature_Map) return Generic_Feature;
-
- procedure Set_Feature_Val (Lat : in Latitude;
- Long : in Longitude;
- Fea : in Generic_Feature;
- Map : in out Feature_Map);
-
- function Check_Page (Map : Feature_Map;
- Page_No : Page_Type) return boolean;
-
-private
- type Feature_Type is array (Latitude, Longitude) of Generic_Feature;
-
- type Feature_Map is
- record
- Feature : Feature_Type;
- Page : Page_Type := Next_Page; -- Operation from parent.
- end record;
-
-end CA11015_0.CA11015_1;
-
- --==================================================================--
-
-package body CA11015_0.CA11015_1 is
-
- function Get_Feature_Val (Lat : Latitude;
- Long : Longitude;
- Map : Feature_Map) return Generic_Feature is
- begin
- return (Map.Feature (Lat, Long));
- end Get_Feature_Val;
- ---------------------------------------------------
- procedure Set_Feature_Val (Lat : in Latitude;
- Long : in Longitude;
- Fea : in Generic_Feature;
- Map : in out Feature_Map) is
- begin
- if Get_Physical_Feature (Lat, Long, Basic_Map) = Unexplored
- -- Parent's operation,
- -- Parent's private object.
- then
- raise Terra_Incognita; -- Exception from parent.
- else
- Map.Feature (Lat, Long) := Fea;
- end if;
- end Set_Feature_Val;
- ---------------------------------------------------
- function Check_Page (Map : Feature_Map;
- Page_No : Page_Type) return boolean is
- begin
- return (Map.Page = Page_No);
- end Check_Page;
-
-end CA11015_0.CA11015_1;
-
- --==================================================================--
-
-with CA11015_0.CA11015_1; -- Generic map operation,
- -- implicitly withs parent, basic map
- -- application.
-with Report;
-
-procedure CA11015 is
-
-begin
-
- Report.Test ("CA11015", "Check that an instantiation of a child package " &
- "of a non-generic package can use its parent's " &
- "declarations and operations");
-
--- An application creates a population map using an integer type.
-
- Population_Map_Subtest:
- declare
- type Population_Type is range 0 .. 10_000;
-
- -- Declare instance of the child generic map package for one
- -- particular integer type.
-
- package Population is new CA11015_0.CA11015_1 (Population_Type);
-
- Population_Map_Latitude : CA11015_0.Latitude := 1;
- -- parent's type
- Population_Map_Longitude : CA11015_0.Longitude := 5;
- -- parent's type
- Pop_Map : Population.Feature_Map;
- Pop : Population_Type := 1000;
-
- begin
- Population.Set_Feature_Val (Population_Map_Latitude,
- Population_Map_Longitude,
- Pop,
- Pop_Map);
-
- If not ( (Population.Get_Feature_Val (Population_Map_Latitude,
- Population_Map_Longitude, Pop_Map) = Pop) or
- (Population.Check_Page (Pop_Map, 1)) ) then
- Report.Failed ("Population map contains incorrect values");
- end if;
-
- end Population_Map_Subtest;
-
--- An application creates a weather map using an enumeration type.
-
- Weather_Map_Subtest:
- declare
- type Weather_Type is (Hot, Cold, Mild);
-
- -- Declare instance of the child generic map package for one
- -- particular enumeration type.
-
- package Weather_Pkg is new CA11015_0.CA11015_1 (Weather_Type);
-
- Weather_Map_Latitude : CA11015_0.Latitude := 2;
- -- parent's type
- Weather_Map_Longitude : CA11015_0.Longitude := 6;
- -- parent's type
- Weather_Map : Weather_Pkg.Feature_Map;
- Weather : Weather_Type := Mild;
-
- begin
- Weather_Pkg.Set_Feature_Val (Weather_Map_Latitude,
- Weather_Map_Longitude,
- Weather,
- Weather_Map);
-
- if ( (Weather_Pkg.Get_Feature_Val (Weather_Map_Latitude,
- Weather_Map_Longitude, Weather_Map) /= Weather) or
- not (Weather_Pkg.Check_Page (Weather_Map, 2)) )
- then
- Report.Failed ("Weather map contains incorrect values");
- end if;
-
- end Weather_Map_Subtest;
-
--- During processing, the application may erroneously attempts to create
--- a density map on an unexplored area. This would result in the raising
--- of an exception.
-
- Density_Map_Subtest:
- declare
- type Density_Type is (High, Medium, Low);
-
- -- Declare instance of the child generic map package for one
- -- particular enumeration type.
-
- package Density_Pkg is new CA11015_0.CA11015_1 (Density_Type);
-
- Density_Map_Latitude : CA11015_0.Latitude := 7;
- -- parent's type
- Density_Map_Longitude : CA11015_0.Longitude := 2;
- -- parent's type
- Density : Density_Type := Low;
- Density_Map : Density_Pkg.Feature_Map;
-
- begin
- Density_Pkg.Set_Feature_Val (Density_Map_Latitude,
- Density_Map_Longitude,
- Density,
- Density_Map);
-
- Report.Failed ("Exception not raised in child generic package");
-
- exception
-
- when CA11015_0.Terra_Incognita => -- parent's exception,
- null; -- raised in child.
-
- when others =>
- Report.Failed ("Others exception is raised");
-
- end Density_Map_Subtest;
-
- Report.Result;
-
-end CA11015;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11016.a b/gcc/testsuite/ada/acats/tests/ca/ca11016.a
deleted file mode 100644
index d6d4089a959..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11016.a
+++ /dev/null
@@ -1,321 +0,0 @@
--- CA11016.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a child of a non-generic package can be a private generic
--- package. Check that the private child instance can use its parent's
--- declarations and operations. Check that the body of a public child
--- package can instantiate its sibling private generic package.
---
--- TEST DESCRIPTION:
--- Declare a map abstraction in a package which manages basic physical
--- map[s]. Declare a private generic child of this package which can be
--- instantiated for any display device which has display locations of
--- the physical map that can be characterized by any integer type, i.e.,
--- the intensity of the display point.
---
--- Declare a public child of the physical map which specifies the
--- display device. In the body of this child, declare an instance of
--- its generic sibling to display the geographic locations.
---
--- In the main program, check that the operations in the parent, public
--- child and instance of the private child package perform as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 17 Apr 96 SAIC ACVC 2.1: Added pragma Elaborate.
---
---!
-
--- Simulates map of physical features, i.e., desert, forest, or water.
-
-package CA11016_0 is
- type Map_Type is private;
- subtype Latitude is integer range 1 .. 9;
- subtype Longitude is integer range 1 .. 7;
-
- type Physical_Features is (Desert, Forest, Water);
-
- -- Use geographic database to initialize the basic map.
-
- procedure Initialize_Basic_Map (Map : in out Map_Type);
-
- function Get_Physical_Feature (Lat : Latitude;
- Long : Longitude;
- Map : Map_Type) return Physical_Features;
-
-private
- type Map_Type is array (Latitude, Longitude) of Physical_Features;
- Basic_Map : Map_Type;
-
-end CA11016_0;
-
- --==================================================================--
-
-package body CA11016_0 is
-
- procedure Initialize_Basic_Map (Map : in out Map_Type) is
- -- Not a real initialization. Real application can use geographic
- -- database to create the basic map.
-
- begin
- for I in Latitude'first .. Latitude'last loop
- for J in 1 .. 2 loop
- Map (I, J) := Desert;
- end loop;
- for J in 3 .. 4 loop
- Map (I, J) := Forest;
- end loop;
- for J in 5 .. 7 loop
- Map (I, J) := Water;
- end loop;
- end loop;
-
- end Initialize_Basic_Map;
- --------------------------------------------------------
- function Get_Physical_Feature (Lat : Latitude;
- Long : Longitude;
- Map : Map_Type)
- return Physical_Features is
- begin
- return (Map (Lat, Long));
- end Get_Physical_Feature;
- --------------------------------------------------------
-
- begin
- -- Initialize a basic map.
- Initialize_Basic_Map (Basic_Map);
-
-end CA11016_0;
-
- --==================================================================--
-
--- Private generic child package of physical map. This generic package may
--- be instantiated for any display device which has display locations
--- (latitude, longitude) that can be characterized by an integer value.
--- For example, the intensity of the display point might be so characterized.
--- It can be instantiated for any desired range of values (which would
--- correspond to the range accepted by the display device).
-
-
-private
-
-generic
-
- type Display_Value is range <>; -- Any display feature that is
- -- represented by an integer.
-
-package CA11016_0.CA11016_1 is
-
- function Get_Display_Value (Lat : Latitude;
- Long : Longitude;
- Map : Map_Type) return Display_Value;
-
-end CA11016_0.CA11016_1;
-
-
- --==================================================================--
-
-
-package body CA11016_0.CA11016_1 is
-
- function Get_Display_Value (Lat : Latitude;
- Long : Longitude;
- Map : Map_Type)
- return Display_Value is
- begin
- case Get_Physical_Feature (Lat, Long, Map) is
- -- Parent's operation,
- when Forest => return (Display_Value'first);
- -- Parent's type.
- when Desert => return (Display_Value'last);
- -- Parent's type.
- when others => return
- ( (Display_Value'last - Display_Value'first) / 2 );
- -- NOTE: Results are truncated.
- end case;
-
- end Get_Display_Value;
-
-end CA11016_0.CA11016_1;
-
-
- --==================================================================--
-
--- Map display operation, public child of physical map.
-
-package CA11016_0.CA11016_2 is
-
- -- Super-duper Ultra Geographic Display Device (SDUGD) can display
- -- geographic locations with light intensity values ranging from 1 to 7.
-
- type Display_Val is range 1 .. 7;
-
- type Device_Color is (Brown, Blue, Green);
-
- type IO_Packet is
- record
- Lat : Latitude; -- Parent's type.
- Long : Longitude; -- Parent's type.
- Color : Device_Color;
- Intensity : Display_Val;
- end record;
-
- procedure Data_For_SDUGD (Lat : in Latitude;
- Long : in Longitude;
- Output_Packet : in out IO_Packet);
-
-end CA11016_0.CA11016_2;
-
- --==================================================================--
-
-
-with CA11016_0.CA11016_1; -- Private generic sibling.
-pragma Elaborate (CA11016_0.CA11016_1);
-
-package body CA11016_0.CA11016_2 is
-
- -- Declare instance of the private generic sibling for
- -- an integer type that represents color intensity.
-
- package SDUGD is new CA11016_0.CA11016_1 (Display_Val);
-
- procedure Data_For_SDUGD (Lat : in Latitude;
- Long : in Longitude;
- Output_Packet : in out IO_Packet) is
-
- -- Simulates sending control information to a display device.
- -- Control information consists of latitude, longitude, a
- -- color, and an intensity.
-
- begin
- case Get_Physical_Feature (Lat, Long, Basic_Map) is
- -- Parent's operation.
- when Water => Output_Packet.Color := Blue;
- Output_Packet.Intensity := SDUGD.Get_Display_Value
- (Lat, Long, Basic_Map);
- -- Sibling's operation.
- when Forest => Output_Packet.Color := Green;
- Output_Packet.Intensity := SDUGD.Get_Display_Value
- (Lat, Long, Basic_Map);
- -- Sibling's operation.
- when others => Output_Packet.Color := Brown;
- Output_Packet.Intensity := SDUGD.Get_Display_Value
- (Lat, Long, Basic_Map);
- -- Sibling's operation.
- end case;
-
- end Data_For_SDUGD;
-
-end CA11016_0.CA11016_2;
-
- --==================================================================--
-
-with CA11016_0.CA11016_2; -- Map display device operation,
- -- implicitly withs parent, physical map
- -- application.
-
-use CA11016_0.CA11016_2; -- Allows direct visibility to the simple
- -- name of CA11016_0.CA11016_2.
-
-with Report;
-
-procedure CA11016 is
-
- TC_Packet : IO_Packet;
-
-begin
-
- Report.Test ("CA11016", "Check that body of a public child package can " &
- "use its sibling private generic package " &
- "declarations and operations");
-
--- Simulate control information at coordinates 3 and 7 of the
--- basic map for the SDUGD.
-
- Water_Display_Subtest:
- begin
- TC_Packet.Lat := 3;
- TC_Packet.Long := 7;
-
- -- Build color and light intensity of the basic map at
- -- latitude 3 and longitude 7.
-
- Data_For_SDUGD (TC_Packet.Lat, TC_Packet.Long, TC_Packet);
-
- if ( (TC_Packet.Color /= Blue) or
- (TC_Packet.Intensity /= 3) ) then
- Report.Failed ("Map display device contains " &
- "incorrect values for water subtest");
- end if;
-
- end Water_Display_Subtest;
-
--- Simulate control information at coordinates 2 and 1 of the
--- basic map for the SDUGD.
-
- Desert_Display_Subtest:
- begin
- TC_Packet.Lat := 9;
- TC_Packet.Long := 2;
-
- -- Build color and light intensity of the basic map at
- -- latitude 9 and longitude 2.
-
- Data_For_SDUGD (TC_Packet.Lat, TC_Packet.Long, TC_Packet);
-
- if ( (TC_Packet.Color /= Brown) or
- (TC_Packet.Intensity /= 7) ) then
- Report.Failed ("Map display device contains " &
- "incorrect values for desert subtest");
- end if;
-
- end Desert_Display_Subtest;
-
--- Simulate control information at coordinates 8 and 4 of the
--- basic map for the SDUGD.
-
- Forest_Display_Subtest:
- begin
- TC_Packet.Lat := 8;
- TC_Packet.Long := 4;
-
- -- Build color and light intensity of the basic map at
- -- latitude 8 and longitude 4.
-
- Data_For_SDUGD (TC_Packet.Lat, TC_Packet.Long, TC_Packet);
-
- if ( (TC_Packet.Color /= Green) or
- (TC_Packet.Intensity /= 1) ) then
- Report.Failed ("Map display device contains " &
- "incorrect values for forest subtest");
- end if;
-
- end Forest_Display_Subtest;
-
- Report.Result;
-
-end CA11016;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11017.a b/gcc/testsuite/ada/acats/tests/ca/ca11017.a
deleted file mode 100644
index cbcce701d37..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11017.a
+++ /dev/null
@@ -1,246 +0,0 @@
--- CA11017.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that body of the parent package may depend on one of its own
--- public children.
---
--- TEST DESCRIPTION:
--- A scenario is created that demonstrates the potential of adding a
--- public child during code maintenance without distubing a large
--- subsystem. After child is added to the subsystem, a maintainer
--- decides to take advantage of the new functionality and rewrites
--- the parent's body.
---
--- Declare a string abstraction in a package which manipulates string
--- replacement. Define a parent package which provides operations for
--- a record type with discriminant. Declare a public child of this
--- package which adds functionality to the original subsystem. In the
--- parent body, call operations from the public child.
---
--- In the main program, check that operations in the parent and public
--- child perform as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
--- Simulates application which manipulates strings.
-
-package CA11017_0 is
-
- type String_Rec (The_Size : positive) is private;
-
- type Substring is new string;
-
- -- ... Various other types used by the application.
-
- procedure Replace (In_The_String : in out String_Rec;
- At_The_Position : in positive;
- With_The_String : in String_Rec);
-
- -- ... Various other operations used by the application.
-
-private
- -- Different size for each individual record.
-
- type String_Rec (The_Size : positive) is
- record
- The_Length : natural := 0;
- The_Content : Substring (1 .. The_Size);
- end record;
-
-end CA11017_0;
-
- --=================================================================--
-
--- Public child added during code maintenance without disturbing a
--- large system. This public child would add functionality to the
--- original system.
-
-package CA11017_0.CA11017_1 is
-
- Position_Error : exception;
-
- function Equal_Length (Left : in String_Rec;
- Right : in String_Rec) return boolean;
-
- function Same_Content (Left : in String_Rec;
- Right : in String_Rec) return boolean;
-
- procedure Copy (From_The_Substring : in Substring;
- To_The_String : in out String_Rec);
-
- -- ... Various other operations used by the application.
-
-end CA11017_0.CA11017_1;
-
- --=================================================================--
-
-package body CA11017_0.CA11017_1 is
-
- function Equal_Length (Left : in String_Rec;
- Right : in String_Rec) return boolean is
- -- Quick comparison between the lengths of the input strings.
-
- begin
- return (Left.The_Length = Right.The_Length); -- Parent's private
- -- type.
- end Equal_Length;
- --------------------------------------------------------------------
- function Same_Content (Left : in String_Rec;
- Right : in String_Rec) return boolean is
-
- begin
- for I in 1 .. Left.The_Length loop
- if Left.The_Content (I) = Right.The_Content (I) then
- return true;
- else
- return false;
- end if;
- end loop;
-
- end Same_Content;
- --------------------------------------------------------------------
- procedure Copy (From_The_Substring : in Substring;
- To_The_String : in out String_Rec) is
- begin
- To_The_String.The_Content -- Parent's private type.
- (1 .. From_The_Substring'length) := From_The_Substring;
-
- To_The_String.The_Length -- Parent's private type.
- := From_The_Substring'length;
- end Copy;
-
-end CA11017_0.CA11017_1;
-
- --=================================================================--
-
--- After child is added to the subsystem, a maintainer decides
--- to take advantage of the new functionality and rewrites the
--- parent's body.
-
-with CA11017_0.CA11017_1;
-
-package body CA11017_0 is
-
- -- Calls functions from public child for a quick comparison of the
- -- input strings. If their lengths are the same, do the replacement.
-
- procedure Replace (In_The_String : in out String_Rec;
- At_The_Position : in positive;
- With_The_String : in String_Rec) is
- End_Position : natural := At_The_Position +
- With_The_String.The_Length - 1;
-
- begin
- if not CA11017_0.CA11017_1.Equal_Length -- Public child's operation.
- (With_The_String, In_The_String) then
- raise CA11017_0.CA11017_1.Position_Error;
- -- Public child's exception.
- else
- In_The_String.The_Content (At_The_Position .. End_Position) :=
- With_The_String.The_Content (1 .. With_The_String.The_Length);
- end if;
-
- end Replace;
-
-end CA11017_0;
-
- --=================================================================--
-
-with Report;
-
-with CA11017_0.CA11017_1; -- Explicit with public child package,
- -- implicit with parent package (CA11017_0).
-
-procedure CA11017 is
-
- package String_Pkg renames CA11017_0;
- use String_Pkg;
-
-begin
-
- Report.Test ("CA11017", "Check that body of the parent package can " &
- "depend on one of its own public children");
-
--- Both input strings have the same size. Replace the first string by the
--- second string.
-
- Replace_Subtest:
- declare
- The_First_String, The_Second_String : String_Rec (16);
- -- Parent's private type.
- The_Position : positive := 1;
- begin
- CA11017_1.Copy ("This is the time",
- To_The_String => The_First_String);
-
- CA11017_1.Copy ("For all good men", The_Second_String);
-
- Replace (The_First_String, The_Position, The_Second_String);
-
- -- Compare results using function from public child since
- -- the type is private.
-
- if not CA11017_1.Same_Content
- (The_First_String, The_Second_String) then
- Report.Failed ("Incorrect results");
- end if;
-
- end Replace_Subtest;
-
--- During processing, the application may erroneously attempt to replace
--- strings of different size. This would result in the raising of an
--- exception.
-
- Exception_Subtest:
- declare
- The_First_String : String_Rec (17);
- -- Parent's private type.
- The_Second_String : String_Rec (13);
- -- Parent's private type.
- The_Position : positive := 2;
- begin
- CA11017_1.Copy (" ACVC Version 2.0", The_First_String);
-
- CA11017_1.Copy (From_The_Substring => "ACVC 9X Basic",
- To_The_String => The_Second_String);
-
- Replace (The_First_String, The_Position, The_Second_String);
-
- Report.Failed ("Exception was not raised");
-
- exception
- when CA11017_1.Position_Error =>
- Report.Comment ("Exception is raised as expected");
-
- end Exception_Subtest;
-
- Report.Result;
-
-end CA11017;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11018.a b/gcc/testsuite/ada/acats/tests/ca/ca11018.a
deleted file mode 100644
index a01ebfc32a4..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11018.a
+++ /dev/null
@@ -1,366 +0,0 @@
--- CA11018.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that body of the parent package may depend on one of its own
--- public generic children.
---
--- TEST DESCRIPTION:
--- A scenario is created that demonstrates the potential of adding a
--- public generic child during code maintenance without distubing a large
--- subsystem. After child is added to the subsystem, a maintainer
--- decides to take advantage of the new functionality and rewrites
--- the parent's body.
---
--- Declare a message application in a package which highlights some
--- key words. Declare a public generic child of this package which adds
--- functionality to the original subsystem. In the parent body,
--- instantiate the child.
---
--- In the main program, check that the operations in the parent,
--- and instances of the public child package perform as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 14 Dec 94 SAIC Modified Copy_Particularly_Designated_Pkg inst.
--- 17 Nov 95 SAIC Update and repair for ACVC 2.0.1
---
---!
-
--- Simulates application which displays messages.
-
-package CA11018_0 is
-
- type Designated_Num is new Integer range 0 .. 100;
-
- type Particularly_Designated_Num is new Integer range 0 .. 100;
-
- type Message is new String;
-
- type Message_Rec is tagged private;
-
- type Designated_Msg is new Message_Rec with private;
-
- type Particularly_Designated_Msg is new Message_Rec with private;
-
- -- Analyzes message for presence of word in the secret message. If found,
- -- word is highlighted.
-
- procedure Highlight_Designated (The_Word : in Message;
- In_The_Message : in out Designated_Msg);
-
-
- -- Analyzes message for presence of word in the secret message. If found,
- -- word is highlighted and do other actions.
-
- procedure Highlight_Particularly_Designated
- (The_Word : in Message;
- In_The_Message : in out Particularly_Designated_Msg);
-
-
- -- Begin test code declarations: -----------------------
-
- TC_Designated_Not_Zero : Boolean := false;
-
- TC_Particularly_Designated_Not_Zero : Boolean := false;
-
- -- The following two functions are used to check for function
- -- calls from the public generic child.
-
- function TC_Designated_Success return Boolean;
-
- function TC_Particularly_Designated_Success return Boolean;
-
- -- End test code declarations. -------------------------
-
-private
- type Message_Rec is tagged
- record
- The_Length : natural := 0;
- The_Content : Message (1 .. 60);
- end record;
-
- type Designated_Msg is new Message_Rec with null record;
- -- ... More components in real application.
-
- type Particularly_Designated_Msg is new Message_Rec with null record;
- -- ... More components in real application.
-
-end CA11018_0;
-
- --=================================================================--
-
-
--- Public generic child package of message display application. Imagine that
--- messages of one security level are associated with a type derived from
--- integer. For overall system security, messages of a different security
--- level are associated with a different type derived from integer. By
--- instantiating this package for each security level, the results of Count
--- applied to one kind of message cannot inadvertently be compared with the
--- results applied to a different kind.
-
-generic
- type Msg_Type is new Message_Rec with private;
- -- Derived from parent's type.
- type Count is range <>;
-
-package CA11018_0.CA11018_1 is
-
- TC_Function_Called : Boolean := false;
-
- function Find_Word (Wrd : in Message;
- Msg : in Msg_Type) return Count;
-
-end CA11018_0.CA11018_1;
-
- --=================================================================--
-
-package body CA11018_0.CA11018_1 is
-
- function Find_Word (Wrd : in Message;
- Msg : in Msg_Type) return Count is
-
- Num : Count := Count'first;
-
- -- Count how many time the word appears within the given message.
-
- begin
- -- ... Error-checking code omitted for brevity.
-
- for I in 1 .. (Msg.The_Length - Wrd'length + 1) loop
- -- Parent's private type
- if Msg.The_Content (I .. I + Wrd'length - 1) = Wrd
- -- Parent's private type
- then
- Num := Num + 1;
- end if;
-
- end loop;
-
- TC_Function_Called := true;
-
- return (Num);
-
- end Find_Word;
-
-end CA11018_0.CA11018_1;
-
- --=================================================================--
-
-with CA11018_0.CA11018_1; -- Public generic child.
-
-pragma Elaborate (CA11018_0.CA11018_1);
-package body CA11018_0 is
-
- ----------------------------------------------------
- -- Parent's body depends on public generic child. --
- ----------------------------------------------------
-
- -- Instantiate the public child for the secret message.
-
- package Designated_Pkg is new CA11018_0.CA11018_1
- (Msg_Type => Designated_Msg, Count => Designated_Num);
-
- -- Instantiate the public child for the top secret message.
-
- package Particularly_Designated_Pkg is new CA11018_0.CA11018_1
- (Particularly_Designated_Msg, Particularly_Designated_Num);
-
- -- End instantiations. -----------------------------
-
-
- function TC_Designated_Success return Boolean is
- -- Check to see if the function in the public generic child is called.
-
- begin
- return Designated_Pkg.TC_Function_Called;
- end TC_Designated_Success;
- --------------------------------------------------------------
- function TC_Particularly_Designated_Success return Boolean is
- -- Check to see if the function in the public generic child is called.
-
- begin
- return Particularly_Designated_Pkg.TC_Function_Called;
- end TC_Particularly_Designated_Success;
- --------------------------------------------------------------
- -- Calls functions from public child to search for a key word.
- -- If the word appears more than once in each message,
- -- highlight all of them.
-
- procedure Highlight_Designated (The_Word : in Message;
- In_The_Message : in out Designated_Msg) is
-
- -- Not a real highlight procedure. Real application can use graphic
- -- device to highlight all occurrences of words.
-
- begin
- --------------------------------------------------------------
- -- Parent's body uses function from instantiation of public --
- -- generic child. --
- --------------------------------------------------------------
-
- if Designated_Pkg.Find_Word -- Child's operation.
- (The_Word, In_The_Message) > 0 then
-
- -- Highlight all occurrences in lavender.
-
- TC_Designated_Not_Zero := true;
- end if;
-
- end Highlight_Designated;
- --------------------------------------------------------------
- procedure Highlight_Particularly_Designated
- (The_Word : in Message;
- In_The_Message : in out Particularly_Designated_Msg) is
-
- -- Not a real highlight procedure. Real application can use graphic
- -- device to highlight all occurrences of words.
-
- begin
- --------------------------------------------------------------
- -- Parent's body uses function from instantiation of public --
- -- generic child. --
- --------------------------------------------------------------
-
- if Particularly_Designated_Pkg.Find_Word -- Child's operation.
- (The_Word, In_The_Message) > 0 then
-
- -- Highlight all occurrences in chartreuse.
- -- Do other more secret stuff.
-
- TC_Particularly_Designated_Not_Zero := true;
- end if;
-
- end Highlight_Particularly_Designated;
-
-end CA11018_0;
-
- --=================================================================--
-
--- Public generic child to copy words to the messages.
-
-generic
- type Message_Type is new Message_Rec with private;
- -- Derived from parent's type.
-
-package CA11018_0.CA11018_2 is
-
- procedure Copy (From_The_Word : in Message;
- To_The_Message : in out Message_Type);
-
-end CA11018_0.CA11018_2;
-
- --=================================================================--
-
-package body CA11018_0.CA11018_2 is
-
- procedure Copy (From_The_Word : in Message;
- To_The_Message : in out Message_Type) is
-
- -- Copy words to the appropriate messages.
-
- begin
- To_The_Message.The_Content -- Parent's private type.
- (1 .. From_The_Word'length) := From_The_Word;
-
- To_The_Message.The_Length -- Parent's private type.
- := From_The_Word'length;
- end Copy;
-
-end CA11018_0.CA11018_2;
-
- --=================================================================--
-
-with Report;
-
-with CA11018_0.CA11018_2; -- Public generic child package, copy words
- -- to the message.
- -- Implicit with parent package (CA11018_0).
-
-procedure CA11018 is
-
- package Message_Pkg renames CA11018_0;
-
-begin
-
- Report.Test ("CA11018", "Check that body of the parent package can " &
- "depend on one of its own public generic children");
-
--- Highlight the word "Alert" from the secret message.
-
- Designated_Subtest:
- declare
- The_Message : Message_Pkg.Designated_Msg; -- Parent's private type.
-
- -- Instantiate the public child to copy words to the secret message.
-
- package Copy_Designated_Pkg is new CA11018_0.CA11018_2
- (Message_Pkg.Designated_Msg);
-
- begin
- Copy_Designated_Pkg.Copy ("Alert Level 1 : Alert The Guard",
- To_The_Message => The_Message);
-
- Message_Pkg.Highlight_Designated ("Alert", The_Message);
-
- if not Message_Pkg.TC_Designated_Not_Zero and
- Message_Pkg.TC_Designated_Success then
- Report.Failed ("Alert should have been highlighted");
- end if;
-
- end Designated_Subtest;
-
--- Highlight the word "Push The Alarm" from the top secret message.
-
- Particularly_Designated_Subtest:
- declare
- The_Message : Message_Pkg.Particularly_Designated_Msg ;
- -- Parent's private type.
-
- -- Instantiate the public child to copy words to the top secret
- -- message.
-
- package Copy_Particularly_Designated_Pkg is new
- CA11018_0.CA11018_2 (Message_Pkg.Particularly_Designated_Msg);
-
- begin
- Copy_Particularly_Designated_Pkg.Copy
- ("Alert Level 10 : Alert The Guard and Push The Alarm",
- The_Message);
-
- Message_Pkg.Highlight_Particularly_Designated
- ("Push The Alarm", The_Message);
-
- if not Message_Pkg.TC_Particularly_Designated_Not_Zero and
- Message_Pkg.TC_Particularly_Designated_Success then
- Report.Failed ("Key words should have been highlighted");
- end if;
-
- end Particularly_Designated_Subtest;
-
- Report.Result;
-
-end CA11018;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11019.a b/gcc/testsuite/ada/acats/tests/ca/ca11019.a
deleted file mode 100644
index 92b3ba5358b..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11019.a
+++ /dev/null
@@ -1,306 +0,0 @@
--- CA11019.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that body of the parent package may depend on one of its own
--- private generic children.
---
--- TEST DESCRIPTION:
--- A scenario is created that demonstrates the potential of adding a
--- generic private child during code maintenance without distubing a
--- large subsystem. After child is added to the subsystem, a maintainer
--- decides to take advantage of the new functionality and rewrites
--- the parent's body.
---
--- Declare a data collection abstraction in a package. Declare a private
--- generic child of this package which provides parameterized code that
--- have been written once and will be used three times to implement the
--- services of the parent package. In the parent body, instantiate the
--- private child.
---
--- In the main program, check that the operations in the parent,
--- and instance of the private child package perform as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 17 Nov 95 SAIC Update and repair for ACVC 2.0.1
---
---!
-
-package CA11019_0 is
- -- parent
-
- type Data_Record is tagged private;
- type Data_Collection is private;
- ---
- ---
- subtype Data_1 is integer range 0 .. 100;
- procedure Add_1 (Data : Data_1; To : in out Data_Collection);
- function Statistical_Op_1 (Data : Data_Collection) return Data_1;
- ---
- subtype Data_2 is integer range -100 .. 1000;
- procedure Add_2 (Data : Data_2; To : in out Data_Collection);
- function Statistical_Op_2 (Data : Data_Collection) return Data_2;
- ---
- subtype Data_3 is integer range -10_000 .. 10_000;
- procedure Add_3 (Data : Data_3; To : in out Data_Collection);
- function Statistical_Op_3 (Data : Data_Collection) return Data_3;
- ---
-
-private
-
- type Data_Ptr is access Data_Record'class;
- subtype Sequence_Number is positive range 1 .. 512;
-
- type Data_Record is tagged
- record
- Next : Data_Ptr := null;
- Seq : Sequence_Number;
- end record;
- ---
- type Data_Collection is
- record
- First : Data_Ptr := null;
- Last : Data_Ptr := null;
- end record;
-
-end CA11019_0;
- -- parent
-
- --=================================================================--
-
--- This generic package provides parameterized code that has been
--- written once and will be used three times to implement the services
--- of the parent package.
-
-private
-generic
- type Data_Type is range <>;
-
-package CA11019_0.CA11019_1 is
- -- parent.child
-
- type Data_Elem is new Data_Record with
- record
- Value : Data_Type;
- end record;
-
- Next_Avail_Seq_No : Sequence_Number := 1;
-
- procedure Sequence (Ptr : Data_Ptr);
- -- the child must be private for this procedure to know details of
- -- the implementation of data collections
-
- procedure Add (Datum : Data_Type; To : in out Data_Collection);
-
- function Op (Data : Data_Collection) return Data_Type;
- -- op models a complicated operation that whose code can be
- -- used for various data types
-
-
-end CA11019_0.CA11019_1;
- -- parent.child
-
- --=================================================================--
-
-
-package body CA11019_0.CA11019_1 is
- -- parent.child
-
- procedure Sequence (Ptr : Data_Ptr) is
- begin
- Ptr.Seq := Next_Avail_Seq_No;
- Next_Avail_Seq_No := Next_Avail_Seq_No + 1;
- end Sequence;
-
- ---------------------------------------------------------
-
- procedure Add (Datum : Data_Type; To : in out Data_Collection) is
- Ptr : Data_Ptr;
- begin
- if To.First = null then
- -- assign new record with data value to
- -- to.next <- null;
- To.First := new Data_Elem'(Next => null,
- Value => Datum,
- Seq => 1);
- Sequence (To.First);
- To.Last := To.First;
- else
- -- chase to end of list
- Ptr := To.First;
- while Ptr.Next /= null loop
- Ptr := Ptr.Next;
- end loop;
- -- and add element there
- Ptr.Next := new Data_Elem'(Next => null,
- Value => Datum,
- Seq => 1);
- Sequence (Ptr.Next);
- To.Last := Ptr.Next;
- end if;
-
- end Add;
-
- ---------------------------------------------------------
-
- function Op (Data : Data_Collection) return Data_Type is
- -- for simplicity, just return the maximum of the data set
- Max : Data_Type := Data_Elem( Data.First.all ).Value;
- -- assuming non-empty collection
- Ptr : Data_Ptr := Data.First;
-
- begin
- -- no error checking
- while Ptr.Next /= null loop
- if Data_Elem( Ptr.Next.all ).Value > Max then
- Max := Data_Elem( Ptr.Next.all ).Value;
- end if;
- Ptr := Ptr.Next;
- end loop;
- return Max;
- end Op;
-
-end CA11019_0.CA11019_1;
- -- parent.child
-
- --=================================================================--
-
--- parent body depends on private generic child
-with CA11019_0.CA11019_1; -- Private generic child.
-
-pragma Elaborate (CA11019_0.CA11019_1);
-package body CA11019_0 is
-
- -- instantiate the generic child with data types needed by the
- -- package interface services
- package Data_1_Ops is new CA11019_1
- (Data_Type => Data_1);
-
- package Data_2_Ops is new CA11019_1
- (Data_Type => Data_2);
-
- package Data_3_Ops is new CA11019_1
- (Data_Type => Data_3);
-
- ---------------------------------------------------------
-
- procedure Add_1 (Data : Data_1; To : in out Data_Collection) is
- begin
- -- maybe do other stuff here
- Data_1_Ops.Add (Data, To);
- -- and here
- end;
-
- ---------------------------------------------------------
-
- function Statistical_Op_1 (Data : Data_Collection) return Data_1 is
- begin
- -- maybe use generic operation(s) in some complicated ways
- -- (but simplified out, for the sake of testing)
- return Data_1_Ops.Op (Data);
- end;
-
- ---------------------------------------------------------
-
- procedure Add_2 (Data : Data_2; To : in out Data_Collection) is
- begin
- Data_2_Ops.Add (Data, To);
- end;
-
- ---------------------------------------------------------
-
- function Statistical_Op_2 (Data : Data_Collection) return Data_2 is
- begin
- return Data_2_Ops.Op (Data);
- end;
-
- ---------------------------------------------------------
-
- procedure Add_3 (Data : Data_3; To : in out Data_Collection) is
- begin
- Data_3_Ops.Add (Data, To);
- end;
-
- ---------------------------------------------------------
-
- function Statistical_Op_3 (Data : Data_Collection) return Data_3 is
- begin
- return Data_3_Ops.Op (Data);
- end;
-
-end CA11019_0;
-
-
- --=================================================--
-
-with CA11019_0,
- -- Main,
- -- Main.Child is private
- Report;
-
-procedure CA11019 is
-
- package Main renames CA11019_0;
-
- Col_1,
- Col_2,
- Col_3 : Main.Data_Collection;
-
-begin
-
- Report.Test ("CA11019", "Check that body of a (non-generic) package " &
- "may depend on its private generic child");
-
- -- build a data collection
-
- for I in 1 .. 10 loop
- Main.Add_1 ( Main.Data_1(I), Col_1);
- end loop;
-
- if Main.Statistical_Op_1 (Col_1) /= 10 then
- Report.Failed ("Wrong data_1 value returned");
- end if;
-
- for I in reverse 10 .. 20 loop
- Main.Add_2 ( Main.Data_2(I * 10), Col_2);
- end loop;
-
- if Main.Statistical_Op_2 (Col_2) /= 200 then
- Report.Failed ("Wrong data_2 value returned");
- end if;
-
- for I in 0 .. 10 loop
- Main.Add_3 ( Main.Data_3(I + 5), Col_3);
- end loop;
-
- if Main.Statistical_Op_3 (Col_3) /= 15 then
- Report.Failed ("Wrong data_3 value returned");
- end if;
-
- Report.Result;
-
-end CA11019;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11020.a b/gcc/testsuite/ada/acats/tests/ca/ca11020.a
deleted file mode 100644
index 4949ce9feee..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11020.a
+++ /dev/null
@@ -1,238 +0,0 @@
--- CA11020.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that body of the generic parent package can depend on one of
--- its own public generic children.
---
--- TEST DESCRIPTION:
--- A scenario is created that demonstrates the potential of adding a
--- public generic child during code maintenance without distubing a large
--- subsystem. After child is added to the subsystem, a maintainer
--- decides to take advantage of the new functionality and rewrites
--- the parent's body.
---
--- Declare a bag abstraction in a generic package. Declare a public
--- generic child of this package which adds a generic procedure to the
--- original subsystem. In the parent body, instantiate the public
--- child. Then instantiate the procedure as a child instance of the
--- public child instance.
---
--- In the main program, declare an instance of parent. Check that the
--- operations in both parent and child packages perform as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
--- Simulates bag application.
-
-generic
- type Element is private;
- with function Image (E : Element) return String;
-
-package CA11020_0 is
-
- type Bag is limited private;
-
- procedure Add (E : in Element; To_The_Bag : in out Bag);
-
- function Bag_Image (B : Bag) return string;
-
-private
- type Node_Type;
- type Bag is access Node_Type;
-
- type Node_Type is
- record
- The_Element : Element;
-
- -- Other components in real application, i.e.,
- -- The_Count : positive;
-
- Next : Bag;
- end record;
-
-end CA11020_0;
-
- --==================================================================--
-
--- More operations on Bag.
-
-generic
-
--- Parameters go here.
-
-package CA11020_0.CA11020_1 is
-
- -- ... Other declarations.
-
- generic -- Generic iterator procedure.
- with procedure Use_Element (E : in Element);
-
- procedure Iterate (B : in Bag); -- Called once per element in the bag.
-
- -- ... Various other operations.
-
-end CA11020_0.CA11020_1;
-
- --==================================================================--
-
-package body CA11020_0.CA11020_1 is
-
- procedure Iterate (B : in Bag) is
-
- -- Traverse each element in the bag.
-
- Elem : Bag := B;
-
- begin
- while Elem /= null loop
- Use_Element (Elem.The_Element);
- Elem := Elem.Next;
- end loop;
-
- end Iterate;
-
-end CA11020_0.CA11020_1;
-
- --==================================================================--
-
-with CA11020_0.CA11020_1; -- Public generic child package.
-
-package body CA11020_0 is
-
- ----------------------------------------------------
- -- Parent's body depends on public generic child. --
- ----------------------------------------------------
-
- -- Instantiate the public child.
-
- package MS is new CA11020_1;
-
- function Bag_Image (B : Bag) return string is
-
- Buffer : String (1 .. 10_000);
- Last : Integer := 0;
-
- -----------------------------------------------------
-
- -- Will be called by the iterator.
-
- procedure Append_Image (E : in Element) is
- Im : constant String := Image (E);
-
- begin -- Append_Image
- if Last /= 0 then -- Insert a comma.
- Last := Last + 1;
- Buffer (Last) := ',';
- end if;
-
- Buffer (Last + 1 .. Last + Im'Length) := Im;
- Last := Last + Im'Length;
-
- end Append_Image;
-
- -----------------------------------------------------
-
- -- Instantiate procedure Iterate as a child of instance MS.
-
- procedure Append_All is new MS.Iterate (Use_Element => Append_Image);
-
- begin -- Bag_Image
-
- Append_All (B);
-
- return Buffer (1 .. Last);
-
- end Bag_Image;
-
- -----------------------------------------------------
-
- procedure Add (E : in Element; To_The_Bag : in out Bag) is
-
- -- Not a real bag addition.
-
- Index : Bag := To_The_Bag;
-
- begin
- -- ... Error-checking code omitted for brevity.
-
- if Index = null then
- To_The_Bag := new Node_Type' (The_Element => E,
- Next => null);
- else
- -- Goto the end of the list.
-
- while Index.Next /= null loop
- Index := Index.Next;
- end loop;
-
- -- Add element to the end of the list.
-
- Index.Next := new Node_Type' (The_Element => E,
- Next => null);
- end if;
-
- end Add;
-
-end CA11020_0;
-
- --==================================================================--
-
-with CA11020_0; -- Bag application.
-
-with Report;
-
-procedure CA11020 is
-
- -- Instantiate the bag application for integer type and attribute
- -- Image.
-
- package Bag_Of_Integers is new CA11020_0 (Integer, Integer'Image);
-
- My_Bag : Bag_Of_Integers.Bag;
-
-begin
-
- Report.Test ("CA11020", "Check that body of the generic parent package " &
- "can depend on one of its own public generic children");
-
- -- Add 10 consecutive integers to the bag.
-
- for I in 1 .. 10 loop
- Bag_Of_Integers.Add (I, My_Bag);
- end loop;
-
- if Bag_Of_Integers.Bag_Image (My_Bag)
- /= " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10" then
- Report.Failed ("Incorrect results");
- end if;
-
- Report.Result;
-
-end CA11020;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11021.a b/gcc/testsuite/ada/acats/tests/ca/ca11021.a
deleted file mode 100644
index f4da2f91334..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11021.a
+++ /dev/null
@@ -1,245 +0,0 @@
--- CA11021.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that body of the generic parent package can depend on one of
--- its own private generic children.
---
--- TEST DESCRIPTION:
--- A scenario is created that demonstrates the potential of adding a
--- public generic child during code maintenance without distubing a large
--- subsystem. After child is added to the subsystem, a maintainer
--- decides to take advantage of the new functionality and rewrites
--- the parent's body.
---
--- Declare a generic package which declares high level operations for a
--- complex number abstraction. Declare a private generic child package
--- of this package which defines low level complex operations. In the
--- parent body, instantiate the private child. Use the low level
--- operation to complete the high level operation.
---
--- In the main program, instantiate the parent generic package.
--- Check that the operations in both packages perform as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-generic -- Complex number abstraction.
- type Int_Type is range <>;
-
-package CA11021_0 is
-
- -- Simulate a generic complex number support package. Complex numbers
- -- are treated as coordinates in the Cartesian plane.
-
- type Complex_Type is private;
-
- Zero : constant Complex_Type; -- Real number (0,0).
-
- function Real_Part (Complex_No : Complex_Type)
- return Int_Type;
-
- function Imag_Part (Complex_No : Complex_Type)
- return Int_Type;
-
- function Complex (Real, Imag : Int_Type)
- return Complex_Type;
-
- -- High level operation for complex number.
- function "*" (Factor : Int_Type;
- C : Complex_Type) return Complex_Type;
-
- -- ... and other complicated ones.
-
-private
- type Complex_Type is record
- Real : Int_Type;
- Imag : Int_Type;
- end record;
-
- Zero : constant Complex_Type := (Real => 0, Imag => 0);
-
-end CA11021_0;
-
- --==================================================================--
-
--- Private generic child of Complex_Number.
-
-private
-
-generic
-
--- No parameter.
-
-package CA11021_0.CA11021_1 is
-
- -- ... Other declarations.
-
- -- Low level operation on complex number.
- function "+" (Left, Right : Complex_Type)
- return Complex_Type;
-
- function "-" (Right : Complex_Type)
- return Complex_Type;
-
- -- ... Various other operations in real application.
-
-end CA11021_0.CA11021_1;
-
- --==================================================================--
-
-package body CA11021_0.CA11021_1 is
-
- function "+" (Left, Right : Complex_Type)
- return Complex_Type is
-
- begin
- return ( (Left.Real + Right.Real, Left.Imag + Right.Imag) );
- end "+";
-
- --------------------------------------------------
-
- function "-" (Right : Complex_Type) return Complex_Type is
- begin
- return (-Right.Real, -Right.Imag);
- end "-";
-
-end CA11021_0.CA11021_1;
-
- --==================================================================--
-
-with CA11021_0.CA11021_1; -- Private generic child package.
-
-package body CA11021_0 is
-
- -----------------------------------------------------
- -- Parent's body depends on private generic child. --
- -----------------------------------------------------
-
- -- Instantiate the private child.
-
- package Complex_Ops is new CA11021_1;
- use Complex_Ops; -- All user-defined operators
- -- directly visible.
-
- --------------------------------------------------
-
- function "*" (Factor : Int_Type;
- C : Complex_Type) return Complex_Type is
- Result : Complex_Type := Zero;
-
- begin
- for I in 1 .. abs (Factor) loop
- Result := Result + C; -- Private generic child "+".
- end loop;
-
- if Factor < 0 then
- Result := - Result; -- Private generic child "-".
- end if;
-
- return Result;
- end "*";
-
- --------------------------------------------------
-
- function Real_Part (Complex_No : Complex_Type) return Int_Type is
- begin
- return (Complex_No.Real);
- end Real_Part;
-
- --------------------------------------------------
-
- function Imag_Part (Complex_No : Complex_Type) return Int_Type is
- begin
- return (Complex_No.Imag);
- end Imag_Part;
-
- --------------------------------------------------
-
- function Complex (Real, Imag : Int_Type) return Complex_Type is
- begin
- return (Real, Imag);
- end Complex;
-
-end CA11021_0;
-
- --==================================================================--
-
-with CA11021_0; -- Complex number abstraction.
-
-with Report;
-
-procedure CA11021 is
-
- type My_Integer is range -100 .. 100;
-
- --------------------------------------------------
-
--- Declare instance of the generic complex package for one particular
--- integer type.
-
- package My_Complex_Pkg is new
- CA11021_0 (Int_Type => My_Integer);
-
- use My_Complex_Pkg; -- All user-defined operators
- -- directly visible.
-
- --------------------------------------------------
-
- Complex_One, Complex_Two : Complex_Type;
-
- My_Literal : My_Integer := -3;
-
-begin
-
- Report.Test ("CA11021", "Check that body of the generic parent package " &
- "can depend on its private generic child");
-
- Complex_One := Complex (11, 6);
-
- Complex_Two := 5 * Complex_One;
-
- if Real_Part (Complex_Two) /= 55
- and Imag_Part (Complex_Two) /= 30
- then
- Report.Failed ("Incorrect results from complex operation");
- end if;
-
- Complex_One := Complex (-4, 7);
-
- Complex_Two := My_Literal * Complex_One;
-
- if Real_Part (Complex_Two) /= 12
- and Imag_Part (Complex_Two) /= -21
- then
- Report.Failed ("Incorrect results from complex operation");
- end if;
-
- Report.Result;
-
-end CA11021;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11022.a b/gcc/testsuite/ada/acats/tests/ca/ca11022.a
deleted file mode 100644
index 60cbc08ce0a..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11022.a
+++ /dev/null
@@ -1,242 +0,0 @@
--- CA11022.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that body of a child unit can instantiate its generic sibling.
---
--- TEST DESCRIPTION:
--- Declare a package that provides some types for the graphic
--- application. Add a generic child package with a subprogram parameter
--- to provide algorithms that can be used by different terminal types
--- but that have to be customized to the specific terminal. Add child
--- packages to take advantage of the parent types and to provide a
--- customized operation for each of the different terminals. The
--- customized operation will be passed as a generic subprogram parameter
--- to the child package's sibling.
---
--- The main program "with"s the child packages. Check that the
--- operations in child units perform as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CA11022_0 is -- Graphic Manager
-
- type Row is range 1 .. 66;
- type Column is range 1 .. 80;
- type Radius is range 1 .. 3;
- type Length is range 5 .. 10;
-
- -- Testing artifice.
- TC_Screen : array (Row, Column) of boolean := (others => (others => false));
- TC_Draw_Circle : boolean := false;
- TC_Draw_Square : boolean := false;
-
- -- ... and other complicated ones.
-
-end CA11022_0;
-
--- No bodies required for CA11022_0.
-
- --==================================================================--
-
--- Child package to provide general graphic functionalities.
-
-generic
-
- with procedure Put_Dot (X : in Column;
- Y : in Row);
-
-package CA11022_0.CA11022_1 is
-
- procedure Draw_Square (At_Col : in Column;
- At_Row : in Row;
- Len : in Length);
-
- procedure Draw_Circle (At_Col : in Column;
- At_Row : in Row;
- Rad : in Radius);
-
- -- procedure Draw_Ellipse ...
- -- and other drawings ...
-
-end CA11022_0.CA11022_1;
-
- --==================================================================--
-
-package body CA11022_0.CA11022_1 is
-
- procedure Draw_Square (At_Col : in Column;
- At_Row : in Row;
- Len : in Length) is
- begin
- -- use square drawing algorithm
- -- call
- Put_Dot (At_Col + Column (Len), At_Row + Row(Len));
- -- as needed in the algorithm.
- TC_Draw_Square := true;
- end Draw_Square;
-
- -------------------------------------------------------
- procedure Draw_Circle (At_Col : in Column;
- At_Row : in Row;
- Rad : in Radius) is
- begin
- -- use circle drawing algorithm
- -- call
- for I in 1 .. Rad loop
- Put_Dot (At_Col + Column(I), At_Row + Row(I));
- end loop;
- -- as needed in the algorithm.
- TC_Draw_Circle := true;
- end Draw_Circle;
-
-end CA11022_0.CA11022_1;
-
- --==================================================================--
-
-with CA11022_0.CA11022_1; -- Generic sibling.
-
--- Child package to provide customized graphic functions for the
--- VT100.
-package CA11022_0.CA11022_2 is -- VT100 Graphic.
-
- X : Column := 8;
- Y : Row := 3;
- R : Radius := 2;
- L : Length := 6;
-
- procedure VT100_Graphic;
-
-end CA11022_0.CA11022_2;
-
- --==================================================================--
-
-package body CA11022_0.CA11022_2 is
-
- procedure VT100_Graphic is
- procedure VT100_Putdot (X : in Column;
- Y : in Row) is
- begin
- -- Light a pixel at location (X, Y);
- TC_Screen (Y, X) := true;
- end VT100_Putdot;
-
- ------------------------------------
-
- -- Declare instance of the generic sibling package to draw a circle,
- -- a square, or an ellipse customized for the VT100.
- package VT100_Graphic is new CA11022_0.CA11022_1 (VT100_Putdot);
-
- begin
- VT100_Graphic.Draw_Circle (X, Y, R);
- VT100_Graphic.Draw_Square (X, Y, L);
- end VT100_Graphic;
-
-end CA11022_0.CA11022_2;
-
- --==================================================================--
-
-with CA11022_0.CA11022_1; -- Generic sibling.
-
--- Child package to provide customized graphic functions for the
--- IBM3270.
-package CA11022_0.CA11022_3 is -- IBM3270 Graphic.
-
- X : Column := 39;
- Y : Row := 11;
- R : Radius := 3;
- L : Length := 7;
-
- procedure IBM3270_Graphic;
-
-end CA11022_0.CA11022_3;
-
- --==================================================================--
-
-package body CA11022_0.CA11022_3 is
-
- procedure IBM3270_Graphic is
- procedure IBM3270_Putdot (X : in Column;
- Y : in Row) is
- begin
- -- Light a pixel at location (X + 2, Y);
- TC_Screen (Y, X + Column(2)) := true;
- end IBM3270_Putdot;
-
- ------------------------------------
-
- -- Declare instance of the generic sibling package to draw a circle,
- -- a square, or an ellipse customized for the IBM3270.
- package IBM3270_Graphic is new CA11022_0.CA11022_1 (IBM3270_Putdot);
-
- begin
- IBM3270_Graphic.Draw_Circle (X, Y, R);
- IBM3270_Graphic.Draw_Square (X, Y, L);
- end IBM3270_Graphic;
-
-end CA11022_0.CA11022_3;
-
- --==================================================================--
-
-with CA11022_0.CA11022_2; -- VT100 Graphic, implicitly with
- -- CA11022_0, Graphic Manager.
-with CA11022_0.CA11022_3; -- IBM3270 Graphic.
-with Report;
-
-procedure CA11022 is
-
-begin
-
- Report.Test ("CA11022", "Check that body of a child unit can depend on " &
- "its generic sibling");
-
- -- Customized graphic functions for the VT100 terminal.
- CA11022_0.CA11022_2.VT100_Graphic;
-
- if not CA11022_0.TC_Screen (4,9) and not CA11022_0.TC_Screen (5,10)
- and not CA11022_0.TC_Screen (9,14) and not CA11022_0.TC_Draw_Circle
- and not CA11022_0.TC_Draw_Square then
- Report.Failed ("Wrong results for the VT100");
- end if;
-
- CA11022_0.TC_Draw_Circle := false;
- CA11022_0.TC_Draw_Square := false;
-
- -- Customized graphic functions for the IBM3270 terminal.
- CA11022_0.CA11022_3.IBM3270_Graphic;
-
- if not CA11022_0.TC_Screen (12,42) and not CA11022_0.TC_Screen (13,43)
- and not CA11022_0.TC_Screen (14,44) and not CA11022_0.TC_Screen (46,18)
- and not CA11022_0.TC_Draw_Circle and not CA11022_0.TC_Draw_Square then
- Report.Failed ("Wrong results for the IBM3270");
- end if;
-
- Report.Result;
-
-end CA11022;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11a01.a b/gcc/testsuite/ada/acats/tests/ca/ca11a01.a
deleted file mode 100644
index a84c6b84f44..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11a01.a
+++ /dev/null
@@ -1,228 +0,0 @@
--- CA11A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that type extended in a public child inherits primitive
--- operations from its ancestor.
---
--- TEST DESCRIPTION:
--- Declare a root tagged type in a package specification. Declare two
--- primitive subprograms for the type (foundation code).
---
--- Add a public child to the above package. Extend the root type with
--- a record extension in the specification. Declare a new primitive
--- subprogram to write to the child extension.
---
--- Add a public grandchild to the above package. Extend the extension of
--- the parent type with a record extension in the private part of the
--- specification. Declare a new primitive subprogram for this grandchild
--- extension.
---
--- In the main program, "with" the grandchild. Access the primitive
--- operations from grandparent and parent package.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- FA11A00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package FA11A00.CA11A01_0 is -- Color_Widget_Pkg
--- This public child declares an extension from its parent. It
--- represents processing of widgets in a window system.
-
- type Widget_Color_Enum is (Black, Green, White);
-
- type Color_Widget is new Widget with -- Record extension of
- record -- parent tagged type.
- Color : Widget_Color_Enum;
- end record;
-
- -- Inherits procedure Set_Width from Widget.
- -- Inherits procedure Set_Height from Widget.
-
- -- To be inherited by its derivatives.
- procedure Set_Color (The_Widget : in out Color_Widget;
- C : in Widget_Color_Enum);
-
- procedure Set_Color_Widget (The_Widget : in out Color_Widget;
- The_Width : in Widget_Length;
- The_Height : in Widget_Length;
- The_Color : in Widget_Color_Enum);
-
-end FA11A00.CA11A01_0; -- Color_Widget_Pkg
-
---=======================================================================--
-
-package body FA11A00.CA11A01_0 is -- Color_Widget_Pkg
-
- procedure Set_Color (The_Widget : in out Color_Widget;
- C : in Widget_Color_Enum) is
- begin
- The_Widget.Color := C;
- end Set_Color;
- ---------------------------------------------------------------
- procedure Set_Color_Widget (The_Widget : in out Color_Widget;
- The_Width : in Widget_Length;
- The_Height : in Widget_Length;
- The_Color : in Widget_Color_Enum) is
- begin
- Set_Width (The_Widget, The_Width); -- Inherited from parent.
- Set_Height (The_Widget, The_Height); -- Inherited from parent.
- Set_Color (The_Widget, The_Color);
- end Set_Color_Widget;
-
-end FA11A00.CA11A01_0; -- Color_Widget_Pkg
-
---=======================================================================--
-
-package FA11A00.CA11A01_0.CA11A01_1 is -- Label_Widget_Pkg
--- This public grandchild extends the extension from its parent. It
--- represents processing of widgets in a window system.
-
- -- Declaration used by private extension component.
- subtype Widget_Label_Str is string (1 .. 10);
-
- type Label_Widget is new Color_Widget with private;
- -- Record extension of parent tagged type.
-
- -- Inherits (inherited) procedure Set_Width from Color_Widget.
- -- Inherits (inherited) procedure Set_Height from Color_Widget.
- -- Inherits procedure Set_Color from Color_Widget.
- -- Inherits procedure Set_Color_Widget from Color_Widget.
-
- procedure Set_Label_Widget (The_Widget : in out Label_Widget;
- The_Width : in Widget_Length;
- The_Height : in Widget_Length;
- The_Color : in Widget_Color_Enum;
- The_Label : in Widget_Label_Str);
-
- -- The following function is needed to verify the value of the
- -- extension's private component.
-
- function Verify_Label (The_Widget : in Label_Widget;
- The_Label : in Widget_Label_Str) return Boolean;
-
-private
- type Label_Widget is new Color_Widget with
- record
- Label : Widget_Label_Str;
- end record;
-
-end FA11A00.CA11A01_0.CA11A01_1; -- Label_Widget_Pkg
-
---=======================================================================--
-
-package body FA11A00.CA11A01_0.CA11A01_1 is -- Label_Widget_Pkg
-
- procedure Set_Label (The_Widget : in out Label_Widget;
- L : in Widget_Label_Str) is
- begin
- The_Widget.Label := L;
- end Set_Label;
- --------------------------------------------------------------
- procedure Set_Label_Widget (The_Widget : in out Label_Widget;
- The_Width : in Widget_Length;
- The_Height : in Widget_Length;
- The_Color : in Widget_Color_Enum;
- The_Label : in Widget_Label_Str) is
- begin
- Set_Width (The_Widget, The_Width); -- Twice inherited.
- Set_Height (The_Widget, The_Height); -- Twice inherited.
- Set_Color (The_Widget, The_Color); -- Inherited from parent.
- Set_Label (The_Widget, The_Label);
- end Set_Label_Widget;
- --------------------------------------------------------------
- function Verify_Label (The_Widget : in Label_Widget;
- The_Label : in Widget_Label_Str) return Boolean is
- begin
- return (The_Widget.Label = The_Label);
- end Verify_Label;
-
-end FA11A00.CA11A01_0.CA11A01_1; -- Label_Widget_Pkg
-
---=======================================================================--
-
-with FA11A00.CA11A01_0.CA11A01_1; -- Label_Widget_Pkg,
- -- implicitly with Widget_Pkg,
- -- implicitly with Color_Widget_Pkg
-with Report;
-
-procedure CA11A01 is
-
- package Widget_Pkg renames FA11A00;
- package Color_Widget_Pkg renames FA11A00.CA11A01_0;
- package Label_Widget_Pkg renames FA11A00.CA11A01_0.CA11A01_1;
-
- use Widget_Pkg; -- All user-defined operators directly visible.
-
- Mail_Label : Label_Widget_Pkg.Widget_Label_Str := "Quick_Mail";
-
- Default_Widget : Widget;
- Black_Widget : Color_Widget_Pkg.Color_Widget;
- Mail_Widget : Label_Widget_Pkg.Label_Widget;
-
-begin
-
- Report.Test ("CA11A01", "Check that type extended in a public " &
- "child inherits primitive operations from its " &
- "ancestor");
-
- Set_Width (Default_Widget, 9); -- Call from parent.
- Set_Height (Default_Widget, 10); -- Call from parent.
-
- If Default_Widget.Width /= Widget_Length (Report.Ident_Int (9)) or
- Default_Widget.Height /= Widget_Length (Report.Ident_Int (10)) then
- Report.Failed ("Incorrect result for Default_Widget");
- end if;
-
- Color_Widget_Pkg.Set_Color_Widget
- (Black_Widget, 17, 18, Color_Widget_Pkg.Black); -- Explicitly declared.
-
- If Black_Widget.Width /= Widget_Length (Report.Ident_Int (17)) or
- Black_Widget.Height /= Widget_Length (Report.Ident_Int (18)) or
- Color_Widget_Pkg."/=" (Black_Widget.Color, Color_Widget_Pkg.Black) then
- Report.Failed ("Incorrect result for Black_Widget");
- end if;
-
- Label_Widget_Pkg.Set_Label_Widget
- (Mail_Widget, 15, 21, Color_Widget_Pkg.White,
- "Quick_Mail"); -- Explicitly declared.
-
- If Mail_Widget.Width /= Widget_Length (Report.Ident_Int (15)) or
- Mail_Widget.Height /= Widget_Length (Report.Ident_Int (21)) or
- Color_Widget_Pkg."/=" (Mail_Widget.Color, Color_Widget_Pkg.White) or
- not Label_Widget_Pkg.Verify_Label (Mail_Widget, Mail_Label) then
- Report.Failed ("Incorrect result for Mail_Widget");
- end if;
-
- Report.Result;
-
-end CA11A01;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11a02.a b/gcc/testsuite/ada/acats/tests/ca/ca11a02.a
deleted file mode 100644
index e7c161423fb..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11a02.a
+++ /dev/null
@@ -1,156 +0,0 @@
--- CA11A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a type extended in a client of a public child inherits
--- primitive operations from parent.
---
--- TEST DESCRIPTION:
--- Declare a root tagged type in a package specification. Declare two
--- primitive subprograms for the type (foundation code).
---
--- Add a public child to the above package. Extend the root type with
--- a record extension in the specification. Declare a new primitive
--- subprogram to write to the child extension.
---
--- In the main program, "with" the child. Declare an extension of
--- the child extension. Access the primitive operations from both
--- parent and child packages.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- FA11A00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 20 Dec 94 SAIC Moved declaration of Label_Widget to library level
---
---!
-
-package FA11A00.CA11A02_0 is -- Color_Widget_Pkg
--- This public child declares an extension from its parent. It
--- represents processing of widgets in a window system.
-
- type Widget_Color_Enum is (Black, Green, White);
-
- type Color_Widget is new Widget with -- Record extension of
- record -- parent tagged type.
- Color : Widget_Color_Enum;
- end record;
-
- -- Inherits procedure Set_Width from parent.
- -- Inherits procedure Set_Height from parent.
-
- -- To be inherited by its derivatives.
- procedure Set_Color (The_Widget : in out Color_Widget;
- C : in Widget_Color_Enum);
-
-end FA11A00.CA11A02_0; -- Color_Widget_Pkg
-
---=======================================================================--
-
-package body FA11A00.CA11A02_0 is -- Color_Widget_Pkg
-
- procedure Set_Color (The_Widget : in out Color_Widget;
- C : in Widget_Color_Enum) is
- begin
- The_Widget.Color := C;
- end Set_Color;
-
-end FA11A00.CA11A02_0; -- Color_Widget_Pkg
-
---=======================================================================--
-
-with FA11A00.CA11A02_0; -- Color_Widget_Pkg.
-
-package CA11A02_1 is
-
- type Label_Widget (Str_Disc : Integer) is new
- FA11A00.CA11A02_0.Color_Widget with
- record
- Label : String (1 .. Str_Disc);
- end record;
-
- -- Inherits (inherited) procedure Set_Width from Color_Widget.
- -- Inherits (inherited) procedure Set_Height from Color_Widget.
- -- Inherits procedure Set_Color from Color_Widget.
-
-end CA11A02_1;
-
---=======================================================================--
-
-with FA11A00.CA11A02_0; -- Color_Widget_Pkg,
- -- implicitly with Widget_Pkg
-with CA11A02_1;
-
-with Report;
-
-procedure CA11A02 is
-
- package Widget_Pkg renames FA11A00;
- package Color_Widget_Pkg renames FA11A00.CA11A02_0;
-
- use Widget_Pkg; -- All user-defined operators directly visible.
-
- procedure Set_Label (The_Widget : in out CA11A02_1.Label_Widget;
- L : in String) is
- begin
- The_Widget.Label := L;
- end Set_Label;
- ---------------------------------------------------------
- procedure Set_Widget (The_Widget : in out CA11A02_1.Label_Widget;
- The_Width : in Widget_Length;
- The_Height : in Widget_Length;
- The_Color : in
- Color_Widget_Pkg.Widget_Color_Enum;
- The_Label : in String) is
- begin
- CA11A02_1.Set_Width (The_Widget, The_Width); -- Twice inherited.
- CA11A02_1.Set_Height (The_Widget, The_Height); -- Twice inherited.
- CA11A02_1.Set_Color (The_Widget, The_Color); -- Inherited.
- Set_Label (The_Widget, The_Label); -- Explicitly declared.
- end Set_Widget;
-
- White_Widget : CA11A02_1.Label_Widget (11);
-
-begin
-
- Report.Test ("CA11A02", "Check that a type extended in a client of " &
- "a public child inherits primitive operations from parent");
-
- Set_Widget (White_Widget, 15, 21, Color_Widget_Pkg.White, "Alarm_Clock");
-
- If White_Widget.Width /= Widget_Length (Report.Ident_Int (15)) or
- White_Widget.Height /= Widget_Length (Report.Ident_Int (21)) or
- Color_Widget_Pkg."/=" (White_Widget.Color, Color_Widget_Pkg.White) or
- White_Widget.Label /= "Alarm_Clock" then
- Report.Failed ("Incorrect result for White_Widget");
- end if;
-
- Report.Result;
-
-end CA11A02;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11b01.a b/gcc/testsuite/ada/acats/tests/ca/ca11b01.a
deleted file mode 100644
index 8d6de02f1b6..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11b01.a
+++ /dev/null
@@ -1,208 +0,0 @@
--- CA11B01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a type derived in a public child inherits primitive
--- operations from parent.
---
--- TEST DESCRIPTION:
--- Declare a root record type with discriminant in a package
--- specification. Declare a primitive subprogram for the type
--- (foundation code).
---
--- Add a public child to the above package. Derive a new type
--- with constraint to the discriminant record type from the parent
--- package. Declare a new primitive subprogram to write to the child
--- derived type.
---
--- Add a new public child to the above package. This grandchild package
--- derives a new type using the record type from the above package.
--- Declare a new primitive subprogram to write to the grandchild derived
--- type.
---
--- In the main program, "with" the grandchild. Access the inherited
--- operations from grandparent, parent, and grandchild packages.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- FA11B00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
--- Child package of FA11B00.
-package FA11B00.CA11B01_0 is -- Application_Two_Widget
--- This public child declares a derived type from its parent. It
--- represents processing of widgets in a window system.
-
- type App2_Widget is new App1_Widget (Maximum_Size => 5000);
- -- Inherits procedure Create_Widget from parent.
-
- -- Primitive operation of type App2_Widget.
- -- To be inherited by its children derivatives.
- procedure App2_Widget_Specific_Oper (The_Widget : in out App2_Widget;
- Loc : in Widget_Location);
-
-end FA11B00.CA11B01_0; -- Application_Two_Widget
-
---=======================================================================--
-
-package body FA11B00.CA11B01_0 is -- Application_Two_Widget
-
- procedure App2_Widget_Specific_Oper
- (The_Widget : in out App2_Widget;
- Loc : in Widget_Location) is
- begin
- The_Widget.Location := Loc;
- end App2_Widget_Specific_Oper;
-
-end FA11B00.CA11B01_0; -- Application_Two_Widget
-
---=======================================================================--
-
--- Grandchild package of FA11B00, child package of FA11B00.CA11B01_0.
-package FA11B00.CA11B01_0.CA11B01_1 is -- Application_Three_Widget
--- This public grandchild declares a derived type from its parent. It
--- represents processing of widgets in a window system.
-
- type App3_Widget is new App2_Widget; -- Derived record of App2_Widget.
-
- -- Inherits (inherited) procedure Create_Widget from Application_One_Widget.
- -- Inherits procedure App2_Widget_Specific_Oper from App2_Widget.
-
- -- Primitive operation of type App3_Widget.
- procedure App3_Widget_Specific_Oper (The_Widget : in out App3_Widget;
- S : in Widget_Size);
-
-end FA11B00.CA11B01_0.CA11B01_1; -- Application_Three_Widget
-
---=======================================================================--
-
-package body FA11B00.CA11B01_0.CA11B01_1 is -- Application_Three_Widget
-
- procedure App3_Widget_Specific_Oper
- (The_Widget : in out App3_Widget;
- S : in Widget_Size) is
- begin
- The_Widget.Size := S;
- end App3_Widget_Specific_Oper;
-
-end FA11B00.CA11B01_0.CA11B01_1; -- Application_Three_Widget
-
---=======================================================================--
-
-with FA11B00.CA11B01_0.CA11B01_1; -- Application_Three_Widget,
- -- implicitly with Application_Two_Widget,
- -- implicitly with Application_Three_Widget.
-with Report;
-
-procedure CA11B01 is
-
- package Application_One_Widget renames FA11B00;
- package Application_Two_Widget renames FA11B00.CA11B01_0;
- package Application_Three_Widget renames FA11B00.CA11B01_0.CA11B01_1;
-
- use Application_One_Widget;
- use Application_Two_Widget;
- use Application_Three_Widget;
-
-begin
-
- Report.Test ("CA11B01", "Check that a type derived in a public " &
- "child inherits primitive operations from parent");
-
- Application_One_Subtest:
- declare
- White_Widget : App1_Widget;
-
- begin
- -- perform an App1_Widget specific operation.
- App1_Widget_Specific_Oper (C => White, L => "Line Editor ",
- The_Widget => White_Widget, I => 10);
-
- If White_Widget.Color /= White or
- White_Widget.Id /= Widget_ID
- (Report.Ident_Int (10)) or
- White_Widget.Label /= "Line Editor " then
- Report.Failed ("Incorrect result for White_Widget");
- end if;
-
- end Application_One_Subtest;
- ---------------------------------------------------------------
- Application_Two_Subtest:
- declare
- Amber_Widget : App2_Widget;
-
- begin
- App1_Widget_Specific_Oper (Amber_Widget, I => 11,
- C => Amber, L => "Alarm_Clock ");
- -- Inherited from Application_One_Widget.
-
- -- perform an App2_Widget specific operation.
- App2_Widget_Specific_Oper (The_Widget => Amber_Widget, Loc => (380,512));
-
- If Amber_Widget.Color /= Amber or
- Amber_Widget.Id /= Widget_ID (Report.Ident_Int (11)) or
- Amber_Widget.Label /= "Alarm_Clock " or
- Amber_Widget.Location /= (380,512) then
- Report.Failed ("Incorrect result for Amber_Widget");
- end if;
-
- end Application_Two_Subtest;
- ---------------------------------------------------------------
- Application_Three_Subtest:
- declare
- Green_Widget : App3_Widget;
-
- begin
- App1_Widget_Specific_Oper (Green_Widget, 100, Green,
- "Screen Editor ");
- -- Inherited (inherited) from Basic_Widget.
-
- -- perform an App2_Widget specific operation.
- App2_Widget_Specific_Oper (Loc => (1024,760),
- The_Widget => Green_Widget);
- -- Inherited from App_1_Widget.
-
- -- perform an App3_Widget specific operation.
- App3_Widget_Specific_Oper (Green_Widget, S => (100,100));
-
- If Green_Widget.Color /= Green or
- Green_Widget.Id /= Widget_ID (Report.Ident_Int (100)) or
- Green_Widget.Label /= "Screen Editor " or
- Green_Widget.Location /= (1024,760) or
- Green_Widget.Size /= (100,100) then
- Report.Failed ("Incorrect result for Green_Widget");
- end if;
-
- end Application_Three_Subtest;
-
- Report.Result;
-
-end CA11B01;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11b02.a b/gcc/testsuite/ada/acats/tests/ca/ca11b02.a
deleted file mode 100644
index 0743f73336b..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11b02.a
+++ /dev/null
@@ -1,169 +0,0 @@
--- CA11B02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a type derived in a client of a public child inherits
--- primitive operations from parent.
---
--- TEST DESCRIPTION:
--- Declare a root record type with discriminant in a package
--- specification. Declare a primitive subprogram for the type
--- (foundation code).
---
--- Add a public child to the above package. Derive a new type
--- with constraint to the discriminant record type from the parent
--- package. Declare a new primitive subprogram to write to the child
--- derived type.
---
--- In the main program, "with" the child. Derive a new type using the
--- record type from the child package. Access the inherited operations
--- from both parent and child packages.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- FA11B00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
--- Child package of FA11B00.
-package FA11B00.CA11B02_0 is -- Application_Two_Widget
--- This public child declares a derived type from its parent. It
--- represents processing of widgets in a window system.
-
- -- Dimension of app2_widget is limited to 5000 pixels.
-
- type App2_Widget is new App1_Widget (Maximum_Size => 5000);
- -- Derived record of parent type.
-
- -- Inherits procedure App1_Widget_Specific_Oper from parent.
-
-
- -- Primitive operation of type App2_Widget.
-
- procedure App2_Widget_Specific_Op1 (The_Widget : in out App2_Widget;
- S : in Widget_Size);
-
- -- Primitive operation of type App2_Widget.
-
- procedure App2_Widget_Specific_Op2 (The_Widget : in out App2_Widget;
- Loc : in Widget_Location);
-
-end FA11B00.CA11B02_0; -- Application_Two_Widget
-
-
---=======================================================================--
-
-
-package body FA11B00.CA11B02_0 is -- Application_Two_Widget
-
- procedure App2_Widget_Specific_Op1 (The_Widget : in out App2_Widget;
- S : in Widget_Size) is
- begin
- The_Widget.Size := S;
- end App2_Widget_Specific_Op1;
-
- --==============================================--
-
- procedure App2_Widget_Specific_Op2 (The_Widget : in out App2_Widget;
- Loc : in Widget_Location) is
- begin
- The_Widget.Location := Loc;
- end App2_Widget_Specific_Op2;
-
-end FA11B00.CA11B02_0; -- Application_Two_Widget
-
-
---=======================================================================--
-
-with FA11B00.CA11B02_0; -- Application_Two_Widget
- -- implicitly with Application_One_Widget.
-with Report;
-
-procedure CA11B02 is
-
- package Application_One_Widget renames FA11B00;
-
- package Application_Two_Widget renames FA11B00.CA11B02_0;
-
- use Application_One_Widget ;
- use Application_Two_Widget ;
-
- type Emulator_Widget is new App2_Widget; -- Derived record of
- -- parent type.
-
- White_Widget, Amber_Widget : Emulator_Widget;
-
-
-begin
-
- Report.Test ("CA11B02", "Check that a type derived in client of a " &
- "public child inherits primitive operations from parent");
-
- App1_Widget_Specific_Oper (C => White, L => "Line Editor ",
- The_Widget => White_Widget, I => 10);
- -- Inherited from Application_One_Widget.
- If White_Widget.Color /= White or
- White_Widget.Id /= Widget_ID (Report.Ident_Int (10)) or
- White_Widget.Label /= "Line Editor "
- then
- Report.Failed ("Incorrect result for White_Widget");
- end if;
-
- -- perform an App2_Widget specific operation.
-
- App2_Widget_Specific_Op1 (White_Widget, S => (100, 200));
-
- If White_Widget.Size.X_Length /= 100 or
- White_Widget.Size.Y_Length /= 200
- then
- Report.Failed ("Incorrect size for White_Widget");
- end if;
-
- App1_Widget_Specific_Oper (Amber_Widget, 5, Amber, "Screen Editor ");
- -- Inherited from Application_One_Widget.
-
- -- perform an App2_Widget specific operations.
-
- App2_Widget_Specific_Op1 (S => (1024,100), The_Widget => Amber_Widget);
- App2_Widget_Specific_Op2 (Amber_Widget, (1024, 760));
-
- If Amber_Widget.Color /= Amber or
- Amber_Widget.Id /= Widget_ID (Report.Ident_Int (5)) or
- Amber_Widget.Label /= "Screen Editor " or
- Amber_Widget.Size /= (1024,100) or
- Amber_Widget.Location.X_Location /= 1024 or
- Amber_Widget.Location.Y_Location /= 760
- then
- Report.Failed ("Incorrect result for Amber_Widget");
- end if;
-
- Report.Result;
-
-end CA11B02;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11c01.a b/gcc/testsuite/ada/acats/tests/ca/ca11c01.a
deleted file mode 100644
index 195ec2d40e8..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11c01.a
+++ /dev/null
@@ -1,170 +0,0 @@
--- CA11C01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that when primitive operations declared in a child package
--- override operations declared in ancestor packages, a client of the
--- child package inherits the operations correctly.
---
--- TEST DESCRIPTION:
---
--- This test builds on the foundation code file (FA11C00) that contains
--- a parent package, child package, and grandchild package. The parent
--- package declares a tagged type and primitive operation. The child
--- package extends the type, and overrides the primitive operation. The
--- grandchild package does the same.
---
--- The test procedure "withs" the grandchild package, and receives
--- visibility to all of its ancestor packages, types and operations.
--- Three procedures, each with a formal parameter of a specific type are
--- defined. Each of these invokes a particular version of the overridden
--- primitive operation Image. Calls to these local procedures are made,
--- with objects of each of the tagged types as parameters, and the global
--- variable is finally examined to ensure that the correct version of
--- primitive operation was inherited by the client and invoked by the
--- call.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- FA11C00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FA11C00_0.FA11C00_1.FA11C00_2; -- Package Animal.Mammal.Primate
-with Report;
-
-procedure CA11C01 is
-
- package Animal_Package renames FA11C00_0;
- package Mammal_Package renames FA11C00_0.FA11C00_1;
- package Primate_Package renames FA11C00_0.FA11C00_1.FA11C00_2;
-
- Max_Animals : constant := 3;
-
- subtype Data_String is String (1 .. 37);
- type Data_Base_Type is array (1 .. Max_Animals) of Data_String;
-
- Zoo_Data_Base : Data_Base_Type := (others => (others => ' '));
- -- Global variable.
-
- Salmon : Animal_Package.Animal := (Common_Name => "Chinook Salmon ",
- Weight => 10);
-
- Platypus : Mammal_Package.Mammal := (Common_Name => "Tasmanian Platypus ",
- Weight => 13,
- Hair_Color => Mammal_Package.Brown);
-
- Orangutan : Primate_Package.Primate :=
- (Common_Name => "Sumatran Orangutan ",
- Weight => 220,
- Hair_Color => Mammal_Package.Red,
- Habitat => Primate_Package.Arboreal);
-begin
-
- Report.Test ("CA11C01", "Check that when primitive operations declared " &
- "in a child package override operations declared " &
- "in ancestor packages, a client of the child " &
- "package inherits the operations correctly");
-
- declare
-
- use Animal_Package, Mammal_Package, Primate_Package;
-
- -- The function Image has been overridden in the child and grandchild
- -- packages, but the client has inherited all versions of the function,
- -- and can successfully use them to enter data into the database.
- -- Each of the following procedures updates the global variable
- -- Zoo_Data_Base.
-
- procedure Enter_Animal_Data (A : Animal; I : Integer) is
- begin
- Zoo_Data_Base (I) := Image (A);
- end Enter_Animal_Data;
-
- procedure Enter_Mammal_Data (M : Mammal; I : Integer) is
- begin
- Zoo_Data_Base (I) := Image (M);
- end Enter_Mammal_Data;
-
- procedure Enter_Primate_Data (P : Primate; I : Integer) is
- begin
- Zoo_Data_Base (I) := Image (P);
- end Enter_Primate_Data;
-
- begin
-
- -- Verify initial test conditions.
-
- if not (Zoo_Data_Base(1)(1..6) = " ")
- or else
- (Zoo_Data_Base(2)(1..6) /= " ")
- or else
- (Zoo_Data_Base(3)(1..6) /= " ")
- then
- Report.Failed ("Initial condition failure");
- end if;
-
-
- -- Enter data from all three animals into the zoo database.
-
- Enter_Animal_Data (A => Salmon, I => 1); -- First entry in database.
- Enter_Mammal_Data (M => Platypus, I => 2); -- Second entry.
- Enter_Primate_Data (P => Orangutan, I => 3); -- Third entry.
-
- -- Verify the correct version of the overridden function Image was used
- -- for entering the specific data.
-
- if Zoo_Data_Base(1)(1 .. 6) /= "Animal"
- or else
- Zoo_Data_Base(1)(26 .. 31) /= "Salmon"
- then
- Report.Failed ("Incorrect version of Image for parent type");
- end if;
-
- if (Zoo_Data_Base(2)(1 .. 6) /= "Mammal")
- or
- (Zoo_Data_Base(2)(28 .. 35) /= "Platypus")
- then
- Report.Failed ("Incorrect version of Image for child type");
- end if;
-
- if ((Zoo_Data_Base(3)(1 .. 7) /= "Primate")
- or
- (Zoo_Data_Base(3)(27 .. 35) /= "Orangutan"))
- then
- Report.Failed ("Incorrect version of Image for grandchild type");
- end if;
-
- end;
-
-
- Report.Result;
-
-end CA11C01;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11c02.a b/gcc/testsuite/ada/acats/tests/ca/ca11c02.a
deleted file mode 100644
index 7d8749328c0..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11c02.a
+++ /dev/null
@@ -1,158 +0,0 @@
--- CA11C02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that primitive operations declared in a child package
--- override operations declared in ancestor packages, and that
--- operations on class-wide types defined in the ancestor packages
--- dispatch as appropriate to these overriding implementations.
---
--- TEST DESCRIPTION:
---
--- This test builds on the foundation code file (FA11C00) that contains
--- a parent package, child package, and grandchild package. The parent
--- package declares a tagged type and primitive operation. The child
--- package extends the type, and overrides the primitive operation. The
--- grandchild package does the same.
---
--- The test procedure "withs" the grandchild package, and receives
--- visibility to all of its ancestor packages, types and operations.
--- A procedure with a formal class-wide parameter is defined that will
--- allow for dispatching calls to the overridden primitive operations,
--- based on the specific type of the actual parameter. The primitive
--- operations provide a string value to update a global string array
--- variable. Calls to the local procedure are made, with objects of each
--- of the tagged types as parameters, and the global variable is finally
--- examined to ensure that the correct version of primitive operation was
--- dispatched correctly.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- FA11C00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FA11C00_0.FA11C00_1.FA11C00_2; -- Package Animal.Mammal.Primate
-with Report;
-
-procedure CA11C02 is
-
- package Animal_Package renames FA11C00_0;
- package Mammal_Package renames FA11C00_0.FA11C00_1;
- package Primate_Package renames FA11C00_0.FA11C00_1.FA11C00_2;
-
- Max_Animals : constant := 3;
-
- type Data_Base_Type is array (1 .. Max_Animals) of String (1 .. 37);
-
- Zoo_Data_Base : Data_Base_Type := (others => (others => ' '));
- -- Global variable.
-
- Macaw : Animal_Package.Animal := (Common_Name => "Scarlet Macaw ",
- Weight => 2);
-
- Manatee : Mammal_Package.Mammal := (Common_Name => "Southern Manatee ",
- Weight => 230,
- Hair_Color => Mammal_Package.Brown);
-
- Lemur : Primate_Package.Primate :=
- (Common_Name => "Ring-Tailed Lemur ",
- Weight => 5,
- Hair_Color => Mammal_Package.Black,
- Habitat => Primate_Package.Arboreal);
-begin
-
- Report.Test ("CA11C02", "Check that primitive operations declared " &
- "in a child package override operations declared " &
- "in ancestor packages, and that operations " &
- "on class-wide types defined in the ancestor " &
- "packages dispatch as appropriate to these " &
- "overriding implementations");
-
- declare
-
- use Animal_Package, Mammal_Package, Primate_Package;
-
- -- The following procedure updates the global variable Zoo_Data_Base.
-
- procedure Enter_Data (A : Animal'Class; I : Integer) is
- begin
- Zoo_Data_Base (I) := Image (A);
- end Enter_Data;
-
- begin
-
- -- Verify initial test conditions.
-
- if not (Zoo_Data_Base(1)(1..6) = " ")
- or not
- (Zoo_Data_Base(2)(1..6) = " ")
- or not
- (Zoo_Data_Base(3)(1..6) = " ")
- then
- Report.Failed ("Initial condition failure");
- end if;
-
-
- -- Enter data from all three animals into the zoo database.
-
- Enter_Data (Macaw, 1); -- First entry in database.
- Enter_Data (A => Manatee, I => 2); -- Second entry.
- Enter_Data (Lemur, I => 3); -- Third entry.
-
- -- Verify the correct version of the overridden function Image was used
- -- for entering the specific data.
-
- if not (Zoo_Data_Base(1)(1 .. 6) = "Animal")
- or not
- (Zoo_Data_Base(1)(26 .. 30) = "Macaw")
- then
- Report.Failed ("Incorrect version of Image for parent type");
- end if;
-
- if not (Zoo_Data_Base(2)(1 .. 6) = "Mammal"
- and
- Zoo_Data_Base(2)(27 .. 33) = "Manatee")
- then
- Report.Failed ("Incorrect version of Image for child type");
- end if;
-
- if not ((Zoo_Data_Base(3)(1 .. 7) = "Primate")
- and
- (Zoo_Data_Base(3)(30 .. 34) = "Lemur"))
- then
- Report.Failed ("Incorrect version of Image for grandchild type");
- end if;
-
- end;
-
- Report.Result;
-
-end CA11C02;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11c03.a b/gcc/testsuite/ada/acats/tests/ca/ca11c03.a
deleted file mode 100644
index b75a6603483..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11c03.a
+++ /dev/null
@@ -1,186 +0,0 @@
--- CA11C03.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that when a child unit is "withed", visibility is obtained to
--- all ancestor units named in the expanded name of the "withed" child
--- unit. Check that when the parent unit is "used", the simple name of
--- a "withed" child unit is made directly visible.
---
--- TEST DESCRIPTION:
--- To satisfy the first part of the objective, various references are
--- made to types and functions declared in the ancestor packages of the
--- foundation code package hierarchy. Since the grandchild library unit
--- package has been "withed" by this test, the visibility of these
--- components demonstrates that visibility of the ancestor package names
--- is provided when the expanded name of a child library unit is "withed".
---
--- The declare block in the test program includes a "use" clause of the
--- parent package (FA11C00_0.FA11C00_1) of the "withed" child package.
--- As a result, the simple name of the child package (FA11C00_2) is
--- directly visible. The type and function declared in the child
--- package are now visible when qualified with the simple name of the
--- "withed" package (FA11C00_2).
---
--- This test simulates the formatting of data strings, based on the
--- component fields of a "doubly-extended" tagged record type.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- FA11C00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FA11C00_0.FA11C00_1.FA11C00_2; -- "with" of child library package
- -- Animal.Mammal.Primate.
- -- This will be used in conjunction with
- -- a "use" of FA11C00_0.FA11C00_1 below
- -- to verify a portion of the objective.
-with Report;
-
-procedure CA11C03 is
-
- Blank_Name_String : constant FA11C00_0.Species_Name_Type := (others => ' ');
- -- Visibility of grandparent package.
- -- The package FA11C00_0 is visible since
- -- it is an ancestor that is mentioned in
- -- the expanded name of its "withed"
- -- grandchild package.
-
- Blank_Hair_Color :
- String (1..FA11C00_0.FA11C00_1.Hair_Color_Type'Width) := (others => ' ');
- -- Visibility of parent package.
- -- The package FA11C00_0.FA11C00_1 is
- -- visible due to the "with" of its
- -- child package.
-
- subtype Data_String_Type is String (1 .. 60);
-
- TC_Result_String : Data_String_Type := (others => ' ');
-
- --
-
- function Format_Primate_Data (Name : String := Blank_Name_String;
- Hair : String := Blank_Hair_Color)
- return Data_String_Type is
-
- Pos : Integer := 1;
- Hair_Color_Field_Separator : constant String := " Hair Color: ";
-
- Result_String : Data_String_Type := (others => ' ');
-
- begin
- Result_String (Pos .. Name'Length) := Name; -- Enter name at start
- -- of string.
- Pos := Pos + Name'Length; -- Increment counter to
- -- next blank position.
- Result_String
- (Pos .. Pos + Hair_Color_Field_Separator'Length + Hair'Length - 1) :=
- Hair_Color_Field_Separator & Hair; -- Include hair color data
- -- in result string.
- return (Result_String);
- end Format_Primate_Data;
-
-
-begin
-
- Report.Test ("CA11C03", "Check that when a child unit is WITHED, " &
- "visibility is obtained to all ancestor units " &
- "named in the expanded name of the WITHED child " &
- "unit. Check that when the parent unit is USED, " &
- "the simple name of a WITHED child unit is made " &
- "directly visible" );
-
- declare
- use FA11C00_0.FA11C00_1; -- This "use" clause will allow direct
- -- visibility to the simple name of
- -- package FA11C00_0.FA11C00_1.FA11C00_2,
- -- since this child package was "withed" by
- -- the main program.
-
- Tarsier : FA11C00_2.Primate := (Common_Name => "East-Indian Tarsier ",
- Weight => 7,
- Hair_Color => Brown,
- Habitat => FA11C00_2.Arboreal);
-
- -- Demonstrates visibility of package
- -- FA11C00_0.FA11C00_1.FA11C00_2.
- --
- -- Type Primate referenced with the simple
- -- name of package FA11C00_2 only.
- --
- -- Simple name of package FA11C00_2 is
- -- directly visible through "use" of parent.
-
- begin
-
- -- Verify that the Format_Primate_Data function will return a blank
- -- filled string when no parameters are provided in the call.
-
- TC_Result_String := Format_Primate_Data;
-
- if (TC_Result_String (1 .. 20) /= Blank_Name_String) then
- Report.Failed ("Incorrect initialization value from function");
- end if;
-
-
- -- Use function Format_Primate_Data to return a formatted data string.
-
- TC_Result_String :=
- Format_Primate_Data
- (Name => FA11C00_2.Image (Tarsier),
- -- Function returns a 37 character string
- -- value.
- Hair => Hair_Color_Type'Image(Tarsier.Hair_Color));
- -- The Hair_Color_Type is referenced
- -- directly, without package
- -- FA11C00_0.FA11C00_1 qualifier.
- -- No qualification of Hair_Color_Type is
- -- needed due to "use" clause.
-
- -- Note that the result of calling 'Image
- -- with an enumeration type argument
- -- results in an upper-case string.
- -- (See conditional statement below.)
-
- -- Verify the results of the function call.
-
- if not (TC_Result_String (1 .. 37) =
- "Primate Species: East-Indian Tarsier " and then
- TC_Result_String (38 .. 55) =
- " Hair Color: BROWN") then
- Report.Failed ("Incorrect result returned from function call");
- end if;
-
- end;
-
- Report.Result;
-
-end CA11C03;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11d010.a b/gcc/testsuite/ada/acats/tests/ca/ca11d010.a
deleted file mode 100644
index 7ea0e226775..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11d010.a
+++ /dev/null
@@ -1,119 +0,0 @@
--- CA11D010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See CA11D013.AM
---
--- TEST DESCRIPTION:
--- See CA11D013.AM
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FA11D00.A
--- => CA11D010.A
--- CA11D011.A
--- CA11D012.A
--- CA11D013.AM
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 26 Apr 96 SAIC ACVC 2.1: Modified prologue.
---
---!
-
--- Child package of FA11D00.
-
-package FA11D00.CA11D010 is -- Add_Subtract_Complex
-
- procedure Add (Left, Right : in Complex_Type; -- Add two complex
- C : out Complex_Type); -- numbers.
-
- function Subtract (Left, Right : Complex_Type) -- Subtract two
- return Complex_Type; -- complex numbers.
-
-
-
-end FA11D00.CA11D010; -- Add_Subtract_Complex
-
---=======================================================================--
-
-with Report;
-
-package body FA11D00.CA11D010 is -- Add_Subtract_Complex
-
- procedure Add (Left, Right : in Complex_Type;
- C : out Complex_Type) is
- begin
- -- Zero is declared in parent package.
-
- if Left.Real < Zero.Real or else Right.Real < Zero.Real
- or else Left.Imag < Zero.Imag or else Right.Imag < Zero.Imag then
- raise Add_Error; -- Reference to exception in parent package.
- Report.Failed ("Program control not transferred by raise in " &
- "procedure Add");
- else
- C.Real := (Left.Real + Right.Real);
- C.Imag := (Left.Imag + Right.Imag);
- end if;
-
- exception
- when Add_Error =>
- TC_Handled_In_Child_Pkg_Proc := true;
- C := Check_Value; -- Reference to object in parent package.
- raise; -- Reraise the Add_Error exception in the subtest.
- Report.Failed ("Exception not reraised in handler");
-
- when others =>
- Report.Failed ("Unexpected exception raised in Add");
-
- end Add;
- -----------------------------------------------------------
- function Subtract (Left, Right : Complex_Type)
- return Complex_Type is
- begin
- -- Zero is declared in parent package.
- if Left.Real < Zero.Real or Right.Real < Zero.Real
- or Left.Imag < Zero.Imag or Right.Imag < Zero.Imag then
- raise Subtract_Error; -- Reference to exception in parent package.
- Report.Failed ("Program control not transferred by raise in " &
- "function Subtract");
- else
- return ( Real => (Left.Real - Right.Real),
- Imag => (Left.Imag - Right.Imag) );
- end if;
-
- exception
- when Subtract_Error =>
- Report.Comment ("Exception is properly handled in Subtract");
- TC_Handled_In_Child_Pkg_Func := true;
- return Check_Value;
-
- when others =>
- Report.Failed ("Unexpected exception raised in Subtract");
-
- end Subtract;
-
-end FA11D00.CA11D010; -- Add_Subtract_Complex
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11d011.a b/gcc/testsuite/ada/acats/tests/ca/ca11d011.a
deleted file mode 100644
index 014f74be78a..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11d011.a
+++ /dev/null
@@ -1,79 +0,0 @@
--- CA11D011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See CA11D013.AM
---
--- TEST DESCRIPTION:
--- See CA11D013.AM
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FA11D00.A
--- CA11D010.A
--- => CA11D011.A
--- CA11D012.A
--- CA11D013.AM
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 21 Dec 94 SAIC Declared child procedure specification
--- 26 Apr 96 SAIC ACVC 2.1: Modified prologue.
---
---!
-
-with Report;
-
-
--- Child procedure of FA11D00.
-
-procedure FA11D00.CA11D011 (Left, Right : in Complex_Type;
- C : out Complex_Type);
-
---=======================================================================--
-
-procedure FA11D00.CA11D011 (Left, Right : in Complex_Type;
- C : out Complex_Type) is
--- Multiply_Complex.
-
-begin
- -- Zero is declared in parent package.
-
- if Left.Real < Zero.Real or Right.Imag < Zero.Imag then
- raise Multiply_Error; -- Reference to exception in parent package.
- Report.Failed ("Program control not transferred by raise in " &
- "child procedure FA11D00.CA11D011");
- else
- C.Real := (Left.Real * Right.Real);
- C.Imag := (Left.Imag * Right.Imag);
- end if;
-
- exception
- when others =>
- TC_Handled_In_Child_Sub := true;
- C := Check_Value; -- Reference to object in parent package.
-
-end FA11D00.CA11D011; -- Multiply_Complex
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11d012.a b/gcc/testsuite/ada/acats/tests/ca/ca11d012.a
deleted file mode 100644
index 1bb3bd7ac02..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11d012.a
+++ /dev/null
@@ -1,73 +0,0 @@
--- CA11D012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See CA11D013.AM
---
--- TEST DESCRIPTION:
--- See CA11D013.AM
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FA11D00.A
--- CA11D010.A
--- CA11D011.A
--- => CA11D012.A
--- CA11D013.AM
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 21 Dec 94 SAIC Declared child function specification
--- 26 Apr 96 SAIC ACVC 2.1: Modified prologue.
---
---!
-
-with Report;
-
--- Child function of FA11D00.
--- Does not divide zero complex numbers.
-
-function FA11D00.CA11D012 (Left, Right : Complex_Type)
- return Complex_Type;
-
---=======================================================================--
-
-function FA11D00.CA11D012 (Left, Right : Complex_Type)
- return Complex_Type is -- Divide_Complex
-
-begin
- -- Zero is declared in parent package.
-
- if Right.Real = Zero.Real or Right.Imag = Zero.Imag then
- raise Divide_Error; -- Reference to exception in parent package.
- Report.Failed ("Program control not transferred by raise in " &
- "child function FA11D00.CA11D012");
- else
- return ( Real => (Left.Real / Right.Real),
- Imag => (Left.Imag / Right.Imag) );
- end if;
-
-end FA11D00.CA11D012; -- Divide_Complex
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11d02.a b/gcc/testsuite/ada/acats/tests/ca/ca11d02.a
deleted file mode 100644
index 7b4f48869b2..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11d02.a
+++ /dev/null
@@ -1,393 +0,0 @@
--- CA11D02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an exception declared in a package can be raised by a
--- child of a child package. Check that it can be renamed in the
--- child of the child package and raised with the correct effect.
---
--- TEST DESCRIPTION:
--- Declare a package which defines complex number abstraction with
--- user-defined exceptions (foundation code).
---
--- Add a public child package to the above package. Declare two
--- subprograms for the parent type.
---
--- Add a public grandchild package to the foundation package. Declare
--- subprograms to raise exceptions.
---
--- In the main program, "with" the grandchild package, then check that
--- the exceptions are raised and handled as expected. Ensure that
--- exceptions are:
--- 1) raised in the public grandchild package and handled/reraised to
--- be handled by the main program.
--- 2) raised and handled locally by the "others" handler in the
--- public grandchild package.
--- 3) raised in the public grandchild and propagated to the main
--- program.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- FA11D00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
--- Child package of FA11D00.
-
-package FA11D00.CA11D02_0 is -- Basic_Complex
-
- function "+" (Left, Right : Complex_Type)
- return Complex_Type; -- Add two complex numbers.
-
- function "*" (Left, Right : Complex_Type)
- return Complex_Type; -- Multiply two complex numbers.
-
-end FA11D00.CA11D02_0; -- Basic_Complex
-
---=======================================================================--
-
-package body FA11D00.CA11D02_0 is -- Basic_Complex
-
- function "+" (Left, Right : Complex_Type) return Complex_Type is
- begin
- return ( (Left.Real + Right.Real, Left.Imag + Right.Imag) );
- end "+";
- --------------------------------------------------------------
- function "*" (Left, Right : Complex_Type) return Complex_Type is
- begin
- return ( Real => (Left.Real * Right.Real),
- Imag => (Left.Imag * Right.Imag) );
- end "*";
-
-end FA11D00.CA11D02_0; -- Basic_Complex
-
---=======================================================================--
-
--- Child package of FA11D00.CA11D02_0.
--- Grandchild package of FA11D00.
-
-package FA11D00.CA11D02_0.CA11D02_1 is -- Array_Complex
-
- Inverse_Error : exception renames Divide_Error; -- Reference to exception
- -- in grandparent package.
- Array_Size : constant := 2;
-
- type Complex_Array_Type is
- array (1 .. Array_Size) of Complex_Type; -- Reference to type
- -- in parent package.
-
- function Multiply (Left : Complex_Array_Type; -- Multiply two complex
- Right : Complex_Array_Type) -- arrays.
- return Complex_Array_Type;
-
- function Add (Left, Right : Complex_Array_Type) -- Add two complex
- return Complex_Array_Type; -- arrays.
-
- procedure Inverse (Right : in Complex_Array_Type; -- Invert a complex
- Left : in out Complex_Array_Type); -- array.
-
-end FA11D00.CA11D02_0.CA11D02_1; -- Array_Complex
-
---=======================================================================--
-
-with Report;
-
-
-package body FA11D00.CA11D02_0.CA11D02_1 is -- Array_Complex
-
- function Multiply (Left : Complex_Array_Type;
- Right : Complex_Array_Type)
- return Complex_Array_Type is
-
- -- This procedure will raise an exception depending on the input
- -- parameter. The exception will be handled locally by the
- -- "others" handler.
-
- Result : Complex_Array_Type := (others => Zero);
-
- subtype Vector_Size is Positive range Left'Range;
-
- begin
- if Left = Result or else Right = Result then -- Do not multiply zero.
- raise Multiply_Error; -- Refence to exception in
- -- grandparent package.
- Report.Failed ("Program control not transferred by raise");
- else
- for I in Vector_Size loop
- Result(I) := ( Left(I) * Right(I) ); -- Basic_Complex."*".
- end loop;
- end if;
- return (Result);
-
- exception
- when others =>
- Report.Comment ("Exception is handled by others in Multiplication");
- TC_Handled_In_Grandchild_Pkg_Func := true;
- return (Zero, Zero);
-
- end Multiply;
- --------------------------------------------------------------
- function Add (Left, Right : Complex_Array_Type)
- return Complex_Array_Type is
-
- -- This function will raise an exception depending on the input
- -- parameter. The exception will be propagated and handled
- -- by the caller.
-
- Result : Complex_Array_Type := (others => Zero);
-
- subtype Vector_Size is Positive range Left'Range;
-
- begin
- if Left = Result or Right = Result then -- Do not add zero.
- raise Add_Error; -- Refence to exception in
- -- grandparent package.
- Report.Failed ("Program control not transferred by raise");
- else
- for I in Vector_Size loop
- Result(I) := ( Left(I) + Right(I) ); -- Basic_Complex."+".
- end loop;
- end if;
- return (Result);
-
- end Add;
- --------------------------------------------------------------
- procedure Inverse (Right : in Complex_Array_Type;
- Left : in out Complex_Array_Type) is
-
- -- This function will raise an exception depending on the input
- -- parameter. The exception will be handled/reraised to be
- -- handled by the caller.
-
- Result : Complex_Array_Type := (others => Zero);
-
- Array_With_Zero : boolean := false;
-
- begin
- for I in 1 .. Right'Length loop
- if Right(I) = Zero then -- Check for zero.
- Array_With_Zero := true;
- end if;
- end loop;
-
- If Array_With_Zero then
- raise Inverse_Error; -- Do not inverse zero.
- Report.Failed ("Program control not transferred by raise");
- else
- for I in 1 .. Array_Size loop
- Left(I).Real := - Right(I).Real;
- Left(I).Imag := - Right(I).Imag;
- end loop;
- end if;
-
- exception
- when Inverse_Error =>
- TC_Handled_In_Grandchild_Pkg_Proc := true;
- Left := Result;
- raise; -- Reraise the Inverse_Error exception in the subtest.
- Report.Failed ("Exception not reraised in handler");
-
- when others =>
- Report.Failed ("Unexpected exception in procedure Inverse");
- end Inverse;
-
-end FA11D00.CA11D02_0.CA11D02_1; -- Array_Complex
-
---=======================================================================--
-
-with FA11D00.CA11D02_0.CA11D02_1; -- Array_Complex,
- -- implicitly with Basic_Complex.
-with Report;
-
-procedure CA11D02 is
-
- package Complex_Pkg renames FA11D00;
- package Array_Complex_Pkg renames FA11D00.CA11D02_0.CA11D02_1;
-
- use Complex_Pkg;
- use Array_Complex_Pkg;
-
-begin
-
- Report.Test ("CA11D02", "Check that an exception declared in a package " &
- "can be raised by a child of a child package");
-
- Multiply_Complex_Subtest:
- declare
- Operand_1 : Complex_Array_Type
- := ( Complex (Int_Type (Report.Ident_Int (3)),
- Int_Type (Report.Ident_Int (5))),
- Complex (Int_Type (Report.Ident_Int (2)),
- Int_Type (Report.Ident_Int (8))) );
- Operand_2 : Complex_Array_Type
- := ( Complex (Int_Type (Report.Ident_Int (1)),
- Int_Type (Report.Ident_Int (2))),
- Complex (Int_Type (Report.Ident_Int (3)),
- Int_Type (Report.Ident_Int (6))) );
- Operand_3 : Complex_Array_Type := ( Zero, Zero);
- Mul_Result : Complex_Array_Type
- := ( Complex (Int_Type (Report.Ident_Int (3)),
- Int_Type (Report.Ident_Int (10))),
- Complex (Int_Type (Report.Ident_Int (6)),
- Int_Type (Report.Ident_Int (48))) );
- Complex_No : Complex_Array_Type := (others => Zero);
-
- begin
- If (Multiply (Operand_1, Operand_2) /= Mul_Result) then
- Report.Failed ("Incorrect results from multiplication");
- end if;
-
- -- Error is raised and exception will be handled in grandchild package.
-
- Complex_No := Multiply (Operand_1, Operand_3);
-
- if Complex_No /= (Zero, Zero) then
- Report.Failed ("Exception was not raised in multiplication");
- end if;
-
- exception
- when Multiply_Error =>
- Report.Failed ("Exception raised in multiplication and " &
- "propagated to caller");
- TC_Handled_In_Grandchild_Pkg_Func := false;
- -- Improper exception handling in caller.
-
- when others =>
- Report.Failed ("Unexpected exception in multiplication");
- TC_Handled_In_Grandchild_Pkg_Func := false;
- -- Improper exception handling in caller.
-
- end Multiply_Complex_Subtest;
-
-
- Add_Complex_Subtest:
- declare
- Operand_1 : Complex_Array_Type
- := ( Complex (Int_Type (Report.Ident_Int (2)),
- Int_Type (Report.Ident_Int (7))),
- Complex (Int_Type (Report.Ident_Int (5)),
- Int_Type (Report.Ident_Int (8))) );
- Operand_2 : Complex_Array_Type
- := ( Complex (Int_Type (Report.Ident_Int (4)),
- Int_Type (Report.Ident_Int (1))),
- Complex (Int_Type (Report.Ident_Int (2)),
- Int_Type (Report.Ident_Int (3))) );
- Operand_3 : Complex_Array_Type := ( Zero, Zero);
- Add_Result : Complex_Array_Type
- := ( Complex (Int_Type (Report.Ident_Int (6)),
- Int_Type (Report.Ident_Int (8))),
- Complex (Int_Type (Report.Ident_Int (7)),
- Int_Type (Report.Ident_Int (11))) );
- Complex_No : Complex_Array_Type := (others => Zero);
-
- begin
- Complex_No := Add (Operand_1, Operand_2);
-
- If (Complex_No /= Add_Result) then
- Report.Failed ("Incorrect results from addition");
- end if;
-
- -- Error is raised in grandchild package and exception
- -- will be propagated to caller.
-
- Complex_No := Add (Operand_1, Operand_3);
-
- if Complex_No = Add_Result then
- Report.Failed ("Exception was not raised in addition");
- end if;
-
- exception
- when Add_Error =>
- TC_Propagated_To_Caller := true; -- Exception is propagated.
-
- when others =>
- Report.Failed ("Unexpected exception in addition subtest");
- TC_Propagated_To_Caller := false; -- Improper exception handling
- -- in caller.
- end Add_Complex_Subtest;
-
- Inverse_Complex_Subtest:
- declare
- Operand_1 : Complex_Array_Type
- := ( Complex (Int_Type (Report.Ident_Int (1)),
- Int_Type (Report.Ident_Int (5))),
- Complex (Int_Type (Report.Ident_Int (3)),
- Int_Type (Report.Ident_Int (11))) );
- Operand_3 : Complex_Array_Type
- := ( Zero, Complex (Int_Type (Report.Ident_Int (3)),
- Int_Type (Report.Ident_Int (6))) );
- Inv_Result : Complex_Array_Type
- := ( Complex (Int_Type (Report.Ident_Int (-1)),
- Int_Type (Report.Ident_Int (-5))),
- Complex (Int_Type (Report.Ident_Int (-3)),
- Int_Type (Report.Ident_Int (-11))) );
- Complex_No : Complex_Array_Type := (others => Zero);
-
- begin
- Inverse (Operand_1, Complex_No);
-
- if (Complex_No /= Inv_Result) then
- Report.Failed ("Incorrect results from inverse");
- end if;
-
- -- Error is raised in grandchild package and exception
- -- will be handled/reraised to caller.
-
- Inverse (Operand_3, Complex_No);
-
- Report.Failed ("Exception was not handled in inverse");
-
- exception
- when Inverse_Error =>
- if not TC_Handled_In_Grandchild_Pkg_Proc then
- Report.Failed ("Exception was not raised in inverse");
- else
- TC_Handled_In_Caller := true; -- Exception is reraised from
- -- child package.
- end if;
-
- when others =>
- Report.Failed ("Unexpected exception in inverse");
- TC_Handled_In_Caller := false;
- -- Improper exception handling in caller.
-
- end Inverse_Complex_Subtest;
-
- if not (TC_Handled_In_Caller and -- Check to see that all
- TC_Handled_In_Grandchild_Pkg_Proc and -- exceptions were handled
- TC_Handled_In_Grandchild_Pkg_Func and -- in proper location.
- TC_Propagated_To_Caller)
- then
- Report.Failed ("Exceptions handled in incorrect locations");
- end if;
-
- Report.Result;
-
-end CA11D02;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca11d03.a b/gcc/testsuite/ada/acats/tests/ca/ca11d03.a
deleted file mode 100644
index 901b8d2174d..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca11d03.a
+++ /dev/null
@@ -1,174 +0,0 @@
--- CA11D03.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an exception declared in a package can be raised by a
--- client of a child of the package. Check that it can be renamed in
--- the client of the child of the package and raised with the correct
--- effect.
---
--- TEST DESCRIPTION:
--- Declare a package which defines complex number abstraction with
--- user-defined exceptions (foundation code).
---
--- Add a public child package to the above package. Declare two
--- subprograms for the parent type.
---
--- In the main program, "with" the child package, then check that
--- an exception can be raised and handled as expected.
---
--- TEST FILES:
--- This test depends on the following foundation code:
---
--- FA11D00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
--- Child package of FA11D00.
-package FA11D00.CA11D03_0 is -- Basic_Complex
-
- function "+" (Left, Right : Complex_Type)
- return Complex_Type; -- Add two complex numbers.
-
- function "*" (Left, Right : Complex_Type)
- return Complex_Type; -- Multiply two complex numbers.
-
-end FA11D00.CA11D03_0; -- Basic_Complex
-
---=======================================================================--
-
-package body FA11D00.CA11D03_0 is -- Basic_Complex
-
- function "+" (Left, Right : Complex_Type) return Complex_Type is
- begin
- return ( (Left.Real + Right.Real, Left.Imag + Right.Imag) );
- end "+";
- --------------------------------------------------------------
- function "*" (Left, Right : Complex_Type) return Complex_Type is
- begin
- return ( Real => (Left.Real * Right.Real),
- Imag => (Left.Imag * Right.Imag) );
- end "*";
-
-end FA11D00.CA11D03_0; -- Basic_Complex
-
---=======================================================================--
-
-with FA11D00.CA11D03_0; -- Basic_Complex,
- -- implicitly with Complex_Definition.
-with Report;
-
-procedure CA11D03 is
-
- package Complex_Pkg renames FA11D00; -- Complex_Definition_Pkg
- package Basic_Complex_Pkg renames FA11D00.CA11D03_0; -- Basic_Complex
-
- use Complex_Pkg;
- use Basic_Complex_Pkg;
-
- TC_Handled_In_Subtest_1,
- TC_Handled_In_Subtest_2 : boolean := false;
-
-begin
-
- Report.Test ("CA11D03", "Check that an exception declared in a package " &
- "can be raised by a client of a child of the package");
-
- Multiply_Complex_Subtest:
- declare
- Operand_1 : Complex_Type := Complex (Int_Type (Report.Ident_Int (3)),
- Int_Type (Report.Ident_Int (2)));
- -- Referenced to function in parent package.
- Operand_2 : Complex_Type := Complex (Int_Type (Report.Ident_Int (10)),
- Int_Type (Report.Ident_Int (8)));
- Mul_Res : Complex_type := Complex (Int_Type (Report.Ident_Int (30)),
- Int_Type (Report.Ident_Int (16)));
- Complex_No : Complex_Type := Zero; -- Zero is declared in parent package.
- begin
- Complex_No := Operand_1 * Operand_2; -- Basic_Complex."*".
- if Complex_No /= Mul_Res then
- Report.Failed ("Incorrect results from multiplication");
- end if;
-
- -- Error is raised and exception will be handled.
- if Complex_No = Mul_Res then
- raise Multiply_Error; -- Reference to exception in
- end if; -- parent package.
-
- exception
- when Multiply_Error =>
- TC_Handled_In_Subtest_1 := true;
- when others =>
- TC_Handled_In_Subtest_1 := false; -- Improper exception handling.
-
- end Multiply_Complex_Subtest;
-
- Add_Complex_Subtest:
- declare
- Error_In_Client : exception renames Add_Error;
- -- Reference to exception in parent package.
- Operand_1 : Complex_Type := Complex (Int_Type (Report.Ident_Int (2)),
- Int_Type (Report.Ident_Int (7)));
- Operand_2 : Complex_Type := Complex (Int_Type (Report.Ident_Int (-4)),
- Int_Type (Report.Ident_Int (1)));
- Add_Res : Complex_type := Complex (Int_Type (Report.Ident_Int (-2)),
- Int_Type (Report.Ident_Int (8)));
- Complex_No : Complex_Type := One; -- One is declared in parent
- -- package.
- begin
- Complex_No := Operand_1 + Operand_2; -- Basic_Complex."+".
-
- if Complex_No /= Add_Res then
- Report.Failed ("Incorrect results from multiplication");
- end if;
-
- -- Error is raised and exception will be handled.
- if Complex_No = Add_Res then
- raise Error_In_Client;
- end if;
-
- exception
- when Error_In_Client =>
- TC_Handled_In_Subtest_2 := true;
-
- when others =>
- TC_Handled_In_Subtest_2 := false; -- Improper exception handling.
-
- end Add_Complex_Subtest;
-
- if not (TC_Handled_In_Subtest_1 and -- Check to see that all
- TC_Handled_In_Subtest_2) -- exceptions were handled
- -- in the proper location.
- then
- Report.Failed ("Exceptions handled in incorrect locations");
- end if;
-
- Report.Result;
-
-end CA11D03;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca13001.a b/gcc/testsuite/ada/acats/tests/ca/ca13001.a
deleted file mode 100644
index 094bd7a88e0..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca13001.a
+++ /dev/null
@@ -1,370 +0,0 @@
--- CA13001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a separate protected unit declared in a non-generic child
--- unit of a private parent have the same visibility into its parent,
--- its siblings, and packages on which its parent depends as is available
--- at the point of their declaration.
---
--- TEST DESCRIPTION:
--- A scenario is created that demonstrates the potential of having all
--- members of one family to take out a transportation. The restriction
--- is depend on each member to determine who can get a car, a clunker,
--- or a bicycle. If no transportation is available, that member has to
--- walk.
---
--- Declare a package with location for each family member. Declare
--- a public parent package. Declare a private child package. Declare a
--- public grandchild of this private package. Declare a protected unit
--- as a subunit in a public grandchild package. This subunit has
--- visibility into it's parent body ancestor and its sibling.
---
--- Declare another public parent package. The body of this package has
--- visibility into its private sibling's descendants.
---
--- In the main program, "with"s the parent package. Check that the
--- protected subunit performs as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 16 Nov 95 SAIC Update and repair for ACVC 2.0.1
---
---!
-
-package CA13001_0 is
-
- type Location is (School, Work, Beach, Home);
- type Family is (Father, Mother, Teen);
- Destination : array (Family) of Location;
-
- -- Other type definitions and procedure declarations in real application.
-
-end CA13001_0;
-
--- No bodies required for CA13001_0.
-
- --==================================================================--
-
--- Public parent.
-
-package CA13001_1 is
-
- type Transportation is (Bicycle, Clunker, New_Car);
- type Key_Type is private;
- Walking : boolean := false;
-
- -- Other type definitions and procedure declarations in real application.
-
-private
- type Key_Type
- is range Transportation'pos(Bicycle) .. Transportation'pos(New_Car);
-
-end CA13001_1;
-
--- No bodies required for CA13001_1.
-
- --==================================================================--
-
--- Private child.
-
-private package CA13001_1.CA13001_2 is
-
- type Transport is
- record
- In_Use : boolean := false;
- end record;
- Vehicles : array (Transportation) of Transport;
-
- -- Other type definitions and procedure declarations in real application.
-
-end CA13001_1.CA13001_2;
-
--- No bodies required for CA13001_1.CA13001_2.
-
- --==================================================================--
-
--- Public grandchild of a private parent.
-
-package CA13001_1.CA13001_2.CA13001_3 is
-
- Flat_Tire : array (Transportation) of boolean := (others => false);
-
- -- Other type definitions and procedure declarations in real application.
-
-end CA13001_1.CA13001_2.CA13001_3;
-
--- No bodies required for CA13001_1.CA13001_2.CA13001_3.
-
- --==================================================================--
-
--- Context clauses required for visibility needed by a separate subunit.
-
-with CA13001_0;
-use CA13001_0;
-
--- Public grandchild of a private parent.
-
-package CA13001_1.CA13001_2.CA13001_4 is
-
- type Transit is
- record
- Available : boolean := false;
- end record;
- type Keys_Array is array (Transportation) of Transit;
- Fuel : array (Transportation) of boolean := (others => true);
-
- protected Family_Transportation is
-
- procedure Get_Vehicle (Who : in Family;
- Key : out Key_Type);
- procedure Return_Vehicle (Tr : in Transportation);
- function TC_Verify (What : Transportation) return boolean;
-
- private
- Keys : Keys_Array;
-
- end Family_Transportation;
-
-end CA13001_1.CA13001_2.CA13001_4;
-
- --==================================================================--
-
--- Context clause required for visibility needed by a separate subunit.
-
-with CA13001_1.CA13001_2.CA13001_3; -- Public sibling.
-
-package body CA13001_1.CA13001_2.CA13001_4 is
-
- protected body Family_Transportation is separate;
-
-end CA13001_1.CA13001_2.CA13001_4;
-
- --==================================================================--
-
-separate (CA13001_1.CA13001_2.CA13001_4)
-protected body Family_Transportation is
-
- procedure Get_Vehicle (Who : in Family;
- Key : out Key_Type) is
- begin
- case Who is
- when Father|Mother =>
- -- Drive new car to work
-
- -- Reference package with'ed by the subunit parent's body.
- if Destination(Who) = Work then
-
- -- Reference type declared in the private parent of the subunit
- -- parent's body.
- -- Reference type declared in the visible part of the
- -- subunit parent's body.
- if not Vehicles(New_Car).In_Use and Fuel(New_Car)
-
- -- Reference type declared in the public sibling of the
- -- subunit parent's body.
- and not CA13001_1.CA13001_2.CA13001_3.Flat_Tire(New_Car) then
- Vehicles(New_Car).In_Use := true;
-
- -- Reference type declared in the private part of the
- -- protected subunit.
- Keys(New_Car).Available := false;
- Key := Transportation'pos(New_Car);
- else
- -- Reference type declared in the grandparent of the subunit
- -- parent's body.
- Walking := true;
- end if;
-
- -- Drive clunker to other destinations.
- else
- if not Vehicles(Clunker).In_Use and Fuel(Clunker) and not
- CA13001_1.CA13001_2.CA13001_3.Flat_Tire(Clunker) then
- Vehicles(Clunker).In_Use := true;
- Keys(Clunker).Available := false;
- Key := Transportation'pos(Clunker);
- else
- Walking := true;
- Key := Transportation'pos(Bicycle);
- end if;
- end if;
-
- -- Similar for Teen.
- when Teen =>
- if not Vehicles(Clunker).In_Use and Fuel(Clunker) and not
- CA13001_1.CA13001_2.CA13001_3.Flat_Tire(Clunker) then
- Vehicles(Clunker).In_Use := true;
- Keys(Clunker).Available := false;
- Key := Transportation'pos(Clunker);
- else
- Walking := true;
- Key := Transportation'pos(Bicycle);
- end if;
- end case;
-
- end Get_Vehicle;
-
- ----------------------------------------------------------------
-
- -- Any family member can bring back the transportation with the key.
-
- procedure Return_Vehicle (Tr : in Transportation) is
- begin
- Vehicles(Tr).In_Use := false;
- Keys(Tr).Available := true;
- end Return_Vehicle;
-
- ----------------------------------------------------------------
-
- function TC_Verify (What : Transportation) return boolean is
- begin
- return Keys(What).Available;
- end TC_Verify;
-
-end Family_Transportation;
-
- --==================================================================--
-
-with CA13001_0;
-use CA13001_0;
-
--- Public child.
-
-package CA13001_1.CA13001_5 is
-
- -- In a real application, tasks could be used to demonstrate
- -- a family transportation scenario, i.e., each member of
- -- a family can take a vehicle out concurrently, then return
- -- them at the same time. For the purposes of the test, family
- -- transportation happens sequentially.
-
- procedure Provide_Transportation (Who : in Family;
- Get_Key : out Key_Type;
- Get_Veh : out boolean);
- procedure Return_Transportation (What : in Transportation;
- Rt_Veh : out boolean);
-
-end CA13001_1.CA13001_5;
-
- --==================================================================--
-
-with CA13001_1.CA13001_2.CA13001_4; -- Public grandchild of a private parent,
- -- implicitly with CA13001_1.CA13001_2.
-package body CA13001_1.CA13001_5 is
-
- package Transportation_Pkg renames CA13001_1.CA13001_2.CA13001_4;
- use Transportation_Pkg;
-
- -- These two validation subprograms provide the capability to check the
- -- components defined in the private packages from within the client
- -- program.
-
- procedure Provide_Transportation (Who : in Family;
- Get_Key : out Key_Type;
- Get_Veh : out boolean) is
- begin
- -- Goto work, school, or to the beach.
- Family_Transportation.Get_Vehicle (Who, Get_Key);
- if not Family_Transportation.TC_Verify
- (Transportation'Val(Get_Key)) then
- Get_Veh := true;
- else
- Get_Veh := false;
- end if;
-
- end Provide_Transportation;
-
- ----------------------------------------------------------------
-
- procedure Return_Transportation (What : in Transportation;
- Rt_Veh : out boolean) is
- begin
- Family_Transportation.Return_Vehicle (What);
- if Family_Transportation.TC_Verify(What) and
- not CA13001_1.CA13001_2.Vehicles(What).In_Use then
- Rt_Veh := true;
- else
- Rt_Veh := false;
- end if;
-
- end Return_Transportation;
-
-end CA13001_1.CA13001_5;
-
- --==================================================================--
-
-with CA13001_0;
-with CA13001_1.CA13001_5; -- Implicitly with parent, CA13001_1.
-with Report;
-
-procedure CA13001 is
-
- Mommy : CA13001_0.Family := CA13001_0.Mother;
- Daddy : CA13001_0.Family := CA13001_0.Father;
- BG : CA13001_0.Family := CA13001_0.Teen;
- BG_Clunker : CA13001_1.Transportation := CA13001_1.Clunker;
- Get_Key : CA13001_1.Key_Type;
- Get_Transit : boolean := false;
- Return_Transit : boolean := false;
-
-begin
- Report.Test ("CA13001", "Check that a protected subunit declared in " &
- "a child unit of a private parent have the same visibility " &
- "into its parent, its parent's siblings, and packages on " &
- "which its parent depends");
-
- -- Get transportation for mother to go to work.
- CA13001_0.Destination(CA13001_0.Mother) := CA13001_0.Work;
- CA13001_1.CA13001_5.Provide_Transportation (Mommy, Get_Key, Get_Transit);
- if not Get_Transit then
- Report.Failed ("Failed to get mother transportation");
- end if;
-
- -- Get transportation for teen to go to school.
- CA13001_0.Destination(CA13001_0.Teen) := CA13001_0.School;
- Get_Transit := false;
- CA13001_1.CA13001_5.Provide_Transportation (BG, Get_Key, Get_Transit);
- if not Get_Transit then
- Report.Failed ("Failed to get teen transportation");
- end if;
-
- -- Get transportation for father to go to the beach.
- CA13001_0.Destination(CA13001_0.Father) := CA13001_0.Beach;
- Get_Transit := false;
- CA13001_1.CA13001_5.Provide_Transportation (Daddy, Get_Key, Get_Transit);
- if Get_Transit and not CA13001_1.Walking then
- Report.Failed ("Failed to make daddy to walk to the beach");
- end if;
-
- -- Return the clunker.
- CA13001_1.CA13001_5.Return_Transportation (BG_Clunker, Return_Transit);
- if not Return_Transit then
- Report.Failed ("Failed to get back the clunker");
- end if;
-
- Report.Result;
-
-end CA13001;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca13002.a b/gcc/testsuite/ada/acats/tests/ca/ca13002.a
deleted file mode 100644
index e985174afd4..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca13002.a
+++ /dev/null
@@ -1,259 +0,0 @@
--- CA13002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that two library child units and/or subunits may have the same
--- simple names if they have distinct expanded names.
---
--- TEST DESCRIPTION:
--- Declare a package that provides some primitive functionality (minimal
--- terminal driver operations in this case). Add child packages to
--- expand the functionality for different but related contexts (different
--- terminal kinds). Add child packages, or subunits, to the children to
--- provide the same high level operation for each of the different
--- contexts (terminals). Since the operations are the same, at the leaf
--- level they are likely to have the same names.
---
--- The main program "with"s the child packages. Check that the
--- child units and subunits perform as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
--- Public parent.
-package CA13002_0 is -- Terminal_Driver.
-
- type TC_Name is (First_Child, Second_Child, Third_Child, Fourth_Child);
- type TC_Call_From is (First_Grandchild, Second_Grandchild, First_Subunit,
- Second_Subunit);
- type TC_Calls_Arr is array (TC_Name, TC_Call_From) of boolean;
- TC_Calls : TC_Calls_Arr := (others => (others => false));
-
- -- In real application, Send_Control_Sequence sends keystrokes from
- -- the terminal, i.e., space, escape, etc.
- procedure Send_Control_Sequence (Row : in TC_Name;
- Col : in TC_Call_From);
-
-end CA13002_0;
-
- --==================================================================--
-
--- First child.
-package CA13002_0.CA13002_1 is -- Terminal_Driver.VT100
-
- -- Move cursor up, down, left, or right.
- procedure Move_Cursor (Col : in TC_Call_From);
-
-end CA13002_0.CA13002_1;
-
- --==================================================================--
-
--- First grandchild.
-procedure CA13002_0.CA13002_1.CA13002_5; -- Terminal_Driver.VT100.Cursor_Up
-
- --==================================================================--
-
--- Second child.
-package CA13002_0.CA13002_2 is -- Terminal_Driver.IBM3270
-
- procedure Move_Cursor (Col : in TC_Call_From);
-
-end CA13002_0.CA13002_2;
-
- --==================================================================--
-
--- Second grandchild.
-procedure CA13002_0.CA13002_2.CA13002_5; -- Terminal_Driver.IBM3270.Cursor_Up
-
- --==================================================================--
-
--- Third child.
-package CA13002_0.CA13002_3 is -- Terminal_Driver.DOS_ANSI
-
- procedure Move_Cursor (Col : in TC_Call_From);
-
- procedure CA13002_5; -- Terminal_Driver.DOS_ANSI.Cursor_Up
- -- implementation will be as a
- -- separate subunit.
-end CA13002_0.CA13002_3;
-
- --==================================================================--
-
--- Fourth child.
-package CA13002_0.CA13002_4 is -- Terminal_Driver.WYSE
-
- procedure Move_Cursor (Col : in TC_Call_From);
-
- procedure CA13002_5; -- Terminal_Driver.WYSE.Cursor_Up
- -- implementation will be as a
- -- separate subunit.
-
-end CA13002_0.CA13002_4;
-
- --==================================================================--
-
--- Terminal_Driver.
-package body CA13002_0 is
-
- procedure Send_Control_Sequence (Row : in TC_Name;
- Col : in TC_Call_From) is
- begin
- -- Reads a key and takes action.
- TC_Calls (Row, Col) := true;
- end Send_Control_Sequence;
-
-end CA13002_0;
-
- --==================================================================--
-
--- Terminal_Driver.VT100.
-package body CA13002_0.CA13002_1 is
-
- procedure Move_Cursor (Col : in TC_Call_From) is
- begin
- Send_Control_Sequence (First_Child, Col);
- end Move_Cursor;
-
-end CA13002_0.CA13002_1;
-
- --==================================================================--
-
--- Terminal_Driver.VT100.Cursor_Up.
-procedure CA13002_0.CA13002_1.CA13002_5 is
-begin
- Move_Cursor (First_Grandchild); -- from Terminal_Driver.VT100.
-end CA13002_0.CA13002_1.CA13002_5;
-
- --==================================================================--
-
--- Terminal_Driver.IBM3270.
-package body CA13002_0.CA13002_2 is
-
- procedure Move_Cursor (Col : in TC_Call_From) is
- begin
- Send_Control_Sequence (Second_Child, Col);
- end Move_Cursor;
-
-end CA13002_0.CA13002_2;
-
- --==================================================================--
-
--- Terminal_Driver.IBM3270.Cursor_Up.
-procedure CA13002_0.CA13002_2.CA13002_5 is
-begin
- Move_Cursor (Second_Grandchild); -- from Terminal_Driver.IBM3270.
-end CA13002_0.CA13002_2.CA13002_5;
-
- --==================================================================--
-
--- Terminal_Driver.DOS_ANSI.
-package body CA13002_0.CA13002_3 is
-
- procedure Move_Cursor (Col : in TC_Call_From) is
- begin
- Send_Control_Sequence (Third_Child, Col);
- end Move_Cursor;
-
- procedure CA13002_5 is separate;
-
-end CA13002_0.CA13002_3;
-
- --==================================================================--
-
--- Terminal_Driver.DOS_ANSI.Cursor_Up.
-separate (CA13002_0.CA13002_3)
-procedure CA13002_5 is
-begin
- Move_Cursor (First_Subunit); -- from Terminal_Driver.DOS_ANSI.
-end CA13002_5;
-
- --==================================================================--
-
--- Terminal_Driver.WYSE.
-package body CA13002_0.CA13002_4 is
-
- procedure Move_Cursor (Col : in TC_Call_From) is
- begin
- Send_Control_Sequence (Fourth_Child, Col);
- end Move_Cursor;
-
- procedure CA13002_5 is separate;
-
-end CA13002_0.CA13002_4;
-
- --==================================================================--
-
--- Terminal_Driver.WYSE.Cursor_Up.
-separate (CA13002_0.CA13002_4)
-procedure CA13002_5 is
-begin
- Move_Cursor (Second_Subunit); -- from Terminal_Driver.WYSE.
-end CA13002_5;
-
- --==================================================================--
-
-with CA13002_0.CA13002_1.CA13002_5; -- Terminal_Driver.VT100.Cursor_Up,
- -- implicitly with parent, CA13002_0.
-with CA13002_0.CA13002_2.CA13002_5; -- Terminal_Driver.IBM3270.Cursor_Up.
-with CA13002_0.CA13002_3; -- Terminal_Driver.DOS_ANSI.
-with CA13002_0.CA13002_4; -- Terminal_Driver.WYSE.
-with Report;
-use CA13002_0; -- All primitive subprograms directly
- -- visible.
-
-procedure CA13002 is
- Expected_Calls : constant CA13002_0.TC_Calls_Arr
- := ((true, false, false, false),
- (false, true , false, false),
- (false, false, true , false),
- (false, false, false, true ));
-begin
- Report.Test ("CA13002", "Check that two library units and/or subunits " &
- "may have the same simple names if they have distinct " &
- "expanded names");
-
- -- Note that the leaves all have the same name.
- -- Call the first grandchild.
- CA13002_0.CA13002_1.CA13002_5;
-
- -- Call the second grandchild.
- CA13002_0.CA13002_2.CA13002_5;
-
- -- Call the first subunit.
- CA13002_0.CA13002_3.CA13002_5;
-
- -- Call the second subunit.
- CA13002_0.CA13002_4.CA13002_5;
-
- if TC_Calls /= Expected_Calls then
- Report.Failed ("Wrong result");
- end if;
-
- Report.Result;
-
-end CA13002;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca13003.a b/gcc/testsuite/ada/acats/tests/ca/ca13003.a
deleted file mode 100644
index 607639efecd..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca13003.a
+++ /dev/null
@@ -1,256 +0,0 @@
--- CA13003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that separate subunits which share an ancestor may have the
--- same name if they have different fully qualified names. Check
--- the case of separate subunits of separate subunits.
--- This test is a change in semantics from Ada 83 to Ada 9X.
---
--- TEST DESCRIPTION:
--- Declare a package that provides file processing operations. Declare
--- one separate package to do the file processing, and another to do the
--- auditing. These packages contain similar functions declared in
--- separate subunits. Verify that the main program can call the
--- separate subunits with the same name.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
--- Simulates a file processing application. The processing package opens
--- files, reads files, does file processing, and generates reports.
--- The auditing package opens files, read files, and generates reports.
-
-package CA13003_0 is
-
- type File_ID is range 1 .. 100;
- subtype File_Name is string (1 .. 10);
-
- TC_Open_For_Process : boolean := false;
- TC_Open_For_Audit : boolean := false;
- TC_Report_From_Process : boolean := false;
- TC_Report_From_Audit : boolean := false;
-
- type File_Rec is
- record
- Name : File_Name;
- ID : File_ID;
- end record;
-
- procedure Initialize_File_Rec (Name_In : in File_Name;
- ID_In : in File_ID;
- File_In : out File_Rec);
-
- ----------------------------------------------------------------------
-
- package CA13003_1 is -- File processing
-
- procedure CA13003_3; -- Open files
- function CA13003_4 (ID_In : File_ID; File_In : File_Rec)
- return File_Name; -- Process files
- package CA13003_5 is -- Generate report
- procedure Generate_Report;
- end CA13003_5;
-
- end CA13003_1;
-
- ----------------------------------------------------------------------
-
- package CA13003_2 is -- File auditing
-
- procedure CA13003_3; -- Open files
- function CA13003_4 (ID_In : File_ID; File_In : File_Rec)
- return File_Name; -- Process files
- package CA13003_5 is -- Generate report
- procedure Generate_Report;
- end CA13003_5;
-
- end CA13003_2;
-
-end CA13003_0;
-
- --==================================================================--
-
-package body CA13003_0 is
-
- procedure Initialize_File_Rec (Name_In : in File_Name;
- ID_In : in File_ID;
- File_In : out File_Rec) is
- -- Not a real initialization. Real application can use file
- -- database to create the file record.
- begin
- File_In.Name := Name_In;
- File_In.ID := ID_In;
- end Initialize_File_Rec;
-
- package body CA13003_1 is separate;
- package body CA13003_2 is separate;
-
-end CA13003_0;
-
- --==================================================================--
-
-separate (CA13003_0)
-package body CA13003_1 is
-
- procedure CA13003_3 is separate; -- Open files
- function CA13003_4 (ID_In : File_ID; File_In : File_Rec)
- return File_Name is separate; -- Process files
- package body CA13003_5 is separate; -- Generate report
-
-end CA13003_1;
-
- --==================================================================--
-
-separate (CA13003_0.CA13003_1)
-procedure CA13003_3 is -- Open files
-begin
- -- In real file processing application, open file from database, setup
- -- data structure, etc.
- TC_Open_For_Process := true;
-end CA13003_3;
-
- --==================================================================--
-
-separate (CA13003_0.CA13003_1)
-function CA13003_4 (ID_In : File_ID; -- Process files
- File_In : File_Rec) return File_Name is
-begin
- -- In real file processing application, process files for more information.
- return File_In.Name;
-end CA13003_4;
-
- --==================================================================--
-
-separate (CA13003_0.CA13003_1)
-package body CA13003_5 is -- Generate report
- procedure Generate_Report is
- begin
- -- In real file processing application, generate various report from the
- -- file database.
- TC_Report_From_Process := true;
- end Generate_Report;
-
-end CA13003_5;
-
- --==================================================================--
-
-separate (CA13003_0)
-package body CA13003_2 is
-
- procedure CA13003_3 is separate; -- Open files
- function CA13003_4 (ID_In : File_ID; File_In : File_Rec)
- return File_Name is separate; -- Process files
- package body CA13003_5 is separate; -- Generate report
-
-end CA13003_2;
-
- --==================================================================--
-
-separate (CA13003_0.CA13003_2)
-procedure CA13003_3 is -- Open files
-begin
- TC_Open_For_Audit := true;
-end CA13003_3;
-
- --==================================================================--
-
-separate (CA13003_0.CA13003_2)
-function CA13003_4 (ID_In : File_ID;
- File_In : File_Rec) return File_Name is
-begin
- return File_In.Name;
-end CA13003_4;
-
- --==================================================================--
-
-separate (CA13003_0.CA13003_2)
-package body CA13003_5 is -- Generate report
- procedure Generate_Report is
- begin
- TC_Report_From_Audit := true;
- end Generate_Report;
-
-end CA13003_5;
-
- --==================================================================--
-
-with CA13003_0;
-with Report;
-
-procedure CA13003 is
- First_File_Name : CA13003_0.File_Name := "Joe Smith ";
- First_File_Id : CA13003_0.File_ID := 11;
- Second_File_Name : CA13003_0.File_Name := "John Schep";
- Second_File_Id : CA13003_0.File_ID := 47;
- Expected_Name : CA13003_0.File_Name := " ";
- Student_File : CA13003_0.File_Rec;
-
- function Process_Input_Files (ID_In : CA13003_0.File_ID;
- File_In : CA13003_0.File_Rec) return
- CA13003_0.File_Name renames CA13003_0.CA13003_1.CA13003_4;
-
- function Process_Audit_Files (ID_In : CA13003_0.File_ID;
- File_In : CA13003_0.File_Rec) return
- CA13003_0.File_Name renames CA13003_0.CA13003_2.CA13003_4;
-begin
- Report.Test ("CA13003", "Check that separate subunits which share " &
- "an ancestor may have the same name if they have " &
- "different fully qualified names");
-
- Student_File := (ID => First_File_Id, Name => First_File_Name);
-
- -- Note that all subunits have the same simple name.
- -- Generate report from file processing.
- CA13003_0.CA13003_1.CA13003_3;
- Expected_Name := Process_Input_Files (First_File_Id, Student_File);
- CA13003_0.CA13003_1.CA13003_5.Generate_Report;
-
- if not CA13003_0.TC_Open_For_Process or
- not CA13003_0.TC_Report_From_Process or
- Expected_Name /= First_File_Name then
- Report.Failed ("Unexpected results in processing file");
- end if;
-
- CA13003_0.Initialize_File_Rec
- (Second_File_Name, Second_File_Id, Student_File);
-
- -- Generate report from file auditing.
- CA13003_0.CA13003_2.CA13003_3;
- Expected_Name := Process_Audit_Files (Second_File_Id, Student_File);
- CA13003_0.CA13003_2.CA13003_5.Generate_Report;
-
- if not CA13003_0.TC_Open_For_Audit or
- not CA13003_0.TC_Report_From_Audit or
- Expected_Name /= Second_File_Name then
- Report.Failed ("Unexpected results in auditing file");
- end if;
-
- Report.Result;
-
-end CA13003;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca13a01.a b/gcc/testsuite/ada/acats/tests/ca/ca13a01.a
deleted file mode 100644
index 3963bc61f19..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca13a01.a
+++ /dev/null
@@ -1,320 +0,0 @@
--- CA13A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that subunits declared in non-generic child units of a public
--- parent have the same visibility into its parent, its siblings
--- (public and private), and packages on which its parent depends
--- as is available at the point of their declaration.
---
--- TEST DESCRIPTION:
--- Declare an check system procedure as a subunit in a private child
--- package of the basic operation package (FA13A00.A). This procedure
--- has visibility into its parent ancestor and its private sibling.
---
--- Declare an emergency procedure as a subunit in a public child package
--- of the basic operation package (FA13A00.A). This procedure has
--- visibility into its parent ancestor and its private sibling.
---
--- Declare an express procedure as a subunit in a public child subprogram
--- of the basic operation package (FA13A00.A). This procedure has
--- visibility into its parent ancestor and its public sibling.
---
--- In the main program, "with"s the child package and subprogram. Check
--- that subunits perform as expected.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FA13A00.A
--- CA13A01.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
--- Private child package of an elevator application. This package
--- provides maintenance operations.
-
-private package FA13A00_1.CA13A01_4 is -- Maintenance operation
-
- One_Floor : Floor_No := 1; -- Type declared in parent.
-
- procedure Check_System;
-
- -- other type definitions and procedure declarations in real application.
-
-end FA13A00_1.CA13A01_4;
-
- --==================================================================--
-
--- Context clauses required for visibility needed by separate subunit.
-
-with FA13A00_0; -- Building Manager
-
-with FA13A00_1.FA13A00_2; -- Floor Calculation (private)
-
-with FA13A00_1.FA13A00_3; -- Move Elevator
-
-use FA13A00_0;
-
-package body FA13A00_1.CA13A01_4 is
-
- procedure Check_System is separate;
-
-end FA13A00_1.CA13A01_4;
-
- --==================================================================--
-
-separate (FA13A00_1.CA13A01_4)
-
--- Subunit Check_System declared in Maintenance Operation.
-
-procedure Check_System is
-begin
- -- See if regular power is on.
-
- if Power /= V120 then -- Reference package with'ed by
- TC_Operation := false; -- the subunit parent's body.
- end if;
-
- -- Test elevator function.
-
- FA13A00_1.FA13A00_3.Move_Elevator -- Reference public sibling of
- (Penthouse, Call_Waiting); -- the subunit parent's body.
-
- if not Call_Waiting (Penthouse) then -- Reference private part of the
- TC_Operation := false; -- parent of the subunit package's
- -- body.
- end if;
-
- FA13A00_1.FA13A00_2.Down (One_Floor); -- Reference private sibling of
- -- the subunit parent's body.
-
- if Current_Floor /= Floor'pred (Penthouse) then
- TC_Operation := false; -- Reference type declared in the
- end if; -- parent of the subunit parent's
- -- body.
-
-end Check_System;
-
- --==================================================================--
-
--- Public child package of an elevator application. This package provides
--- an emergency operation.
-
-package FA13A00_1.CA13A01_5 is -- Emergency Operation
-
- -- Other type definitions in real application.
-
- procedure Emergency;
-
-private
- type Bell_Type is (Inactive, Active);
-
-end FA13A00_1.CA13A01_5;
-
- --==================================================================--
-
--- Context clauses required for visibility needed by separate subunit.
-
-with FA13A00_0; -- Building Manager
-
-with FA13A00_1.FA13A00_3; -- Move Elevator
-
-with FA13A00_1.CA13A01_4; -- Maintenance Operation (private)
-
-use FA13A00_0;
-
-package body FA13A00_1.CA13A01_5 is
-
- procedure Emergency is separate;
-
-end FA13A00_1.CA13A01_5;
-
- --==================================================================--
-
-separate (FA13A00_1.CA13A01_5)
-
--- Subunit Emergency declared in Maintenance Operation.
-
-procedure Emergency is
- Bell : Bell_Type; -- Reference type declared in the
- -- subunit parent's body.
-
-begin
- -- Calls maintenance operation.
-
- FA13A00_1.CA13A01_4.Check_System; -- Reference private sibling of the
- -- subunit parent 's body.
-
- -- Clear all calls to the elevator.
-
- Clear_Calls (Call_Waiting); -- Reference subprogram declared
- -- in the parent of the subunit
- -- parent's body.
- for I in Floor loop
- if Call_Waiting (I) then -- Reference private part of the
- TC_Operation := false; -- parent of the subunit parent's
- end if; -- body.
- end loop;
-
- -- Move elevator to the basement.
-
- FA13A00_1.FA13A00_3.Move_Elevator -- Reference public sibling of the
- (Basement, Call_Waiting); -- subunit parent's body.
-
- if Current_Floor /= Basement then -- Reference type declared in the
- TC_Operation := false; -- parent of the subunit parent's
- end if; -- body.
-
- -- Shut off power.
-
- Power := Off; -- Reference package with'ed by
- -- the subunit parent's body.
-
- -- Activate bell.
-
- Bell := Active; -- Reference type declared in the
- -- subunit parent's body.
-
-end Emergency;
-
- --==================================================================--
-
--- Public child subprogram of an elevator application. This subprogram
--- provides an express operation.
-
-procedure FA13A00_1.CA13A01_6;
-
- --==================================================================--
-
--- Context clauses required for visibility needed by separate subunit.
-
-with FA13A00_0; -- Building Manager
-
-with FA13A00_1.FA13A00_2; -- Floor Calculation (private)
-
-with FA13A00_1.FA13A00_3; -- Move Elevator
-
-use FA13A00_0;
-
-procedure FA13A00_1.CA13A01_6 is -- Express Operation
-
- -- Other type definitions in real application.
-
- procedure GoTo_Penthouse is separate;
-
-begin
- GoTo_Penthouse;
-
-end FA13A00_1.CA13A01_6;
-
- --==================================================================--
-
-separate (FA13A00_1.CA13A01_6)
-
--- Subunit GoTo_Penthouse declared in Express Operation.
-
-procedure GoTo_Penthouse is
-begin
- -- Go faster.
-
- Power := V240; -- Reference package with'ed by
- -- the subunit parent's body.
-
- -- Call elevator.
-
- Call (Penthouse, Call_Waiting); -- Reference subprogram declared in
- -- the parent of the subunit
- -- parent's body.
-
- if not Call_Waiting (Penthouse) then -- Reference private part of the
- TC_Operation := false; -- parent of the subunit parent's
- end if; -- body.
-
- -- Move elevator to Penthouse.
-
- FA13A00_1.FA13A00_3.Move_Elevator -- Reference public sibling of the
- (Penthouse, Call_Waiting); -- subunit parent's body.
-
- if Current_Floor /= Penthouse then -- Reference type declared in the
- TC_Operation := false; -- parent of the subunit parent's
- end if; -- body.
-
- -- Return slowly
-
- while Current_Floor /= Floor1 loop -- Reference type, subprogram
- FA13A00_1.FA13A00_2.Down (1); -- declared in the parent of the
- -- subunit parent's body.
- end loop;
-
- if Current_Floor /= Floor1 then -- Reference type declared in
- TC_Operation := false; -- the parent of the subunit
- end if; -- parent's body.
-
- -- Back to normal.
-
- Power := V120; -- Reference package with'ed by
- -- the subunit parent's body.
-
-end GoTo_Penthouse;
-
- --==================================================================--
-
-with FA13A00_1.CA13A01_5; -- Emergency Operation
- -- implicitly with Basic Elevator
- -- Operations
-
-with FA13A00_1.CA13A01_6; -- Express Operation
-
-with Report;
-
-procedure CA13A01 is
-
-begin
-
- Report.Test ("CA13A01", "Check that subunits declared in non-generic " &
- "child units of a public parent have the same visibility " &
- "into its parent, its parent's siblings, and packages on " &
- "which its parent depends");
-
- -- Go to Penthouse.
-
- FA13A00_1.CA13A01_6;
-
- -- Call emergency operation.
-
- FA13A00_1.CA13A01_5.Emergency;
-
- if not FA13A00_1.TC_Operation then
- Report.Failed ("Incorrect elevator operation");
- end if;
-
- Report.Result;
-
-end CA13A01;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca13a02.a b/gcc/testsuite/ada/acats/tests/ca/ca13a02.a
deleted file mode 100644
index 82d1b6ea538..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca13a02.a
+++ /dev/null
@@ -1,301 +0,0 @@
--- CA13A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that subunits declared in generic child units of a public
--- parent have the same visibility into its parent, its siblings
--- (public and private), and packages on which its parent depends
--- as is available at the point of their declaration.
---
--- TEST DESCRIPTION:
--- Declare an outside elevator button operation as a subunit in a
--- generic child package of the basic operation package (FA13A00.A).
--- This procedure has visibility into its parent ancestor and its
--- private sibling.
---
--- In the main program, instantiate the child package. Check that
--- subunits perform as expected.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FA13A00.A
--- CA13A02.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
--- Public generic child package of an elevator application. This package
--- provides outside elevator button operations.
-
-generic -- Instantiate once for each floor.
- Our_Floor : in Floor; -- Reference type declared in parent.
-
-package FA13A00_1.CA13A02_4 is -- Outside Elevator Button Operations
-
- type Light is (Up, Down, Express, Off);
-
- type Direction is (Up, Down, Express);
-
- function Call_Elevator (D : Direction) return Light;
-
- -- other type definitions and procedure declarations in real application.
-
-end FA13A00_1.CA13A02_4;
-
- --==================================================================--
-
--- Context clauses required for visibility needed by separate subunit.
-
-with FA13A00_0; -- Building Manager
-
-with FA13A00_1.FA13A00_2; -- Floor Calculation (private)
-
-with FA13A00_1.FA13A00_3; -- Move Elevator
-
-use FA13A00_0;
-
-package body FA13A00_1.CA13A02_4 is
-
- function Call_Elevator (D : Direction) return Light is separate;
-
-end FA13A00_1.CA13A02_4;
-
- --==================================================================--
-
-separate (FA13A00_1.CA13A02_4)
-
--- Subunit Call_Elevator declared in Outside Elevator Button Operations.
-
-function Call_Elevator (D : Direction) return Light is
- Elevator_Button : Light;
-
-begin
- -- See if power is on.
-
- if Power = Off then -- Reference package with'ed by
- Elevator_Button := Off; -- the subunit parent's body.
-
- else
- case D is
- when Express =>
- FA13A00_1.FA13A00_3.Move_Elevator -- Reference public sibling of
- (Penthouse, Call_Waiting); -- the subunit parent's body.
-
- Elevator_Button := Express;
-
- when Up =>
- if Current_Floor < Our_Floor then
- FA13A00_1.FA13A00_2.Up -- Reference private sibling of
- (Floor'pos (Our_Floor) -- the subunit parent's body.
- - Floor'pos (Current_Floor));
- else
- FA13A00_1.FA13A00_2.Down -- Reference private sibling of
- (Floor'pos (Current_Floor) -- the subunit parent's body.
- - Floor'pos (Our_Floor));
- end if;
-
- -- Call elevator.
-
- Call
- (Current_Floor, Call_Waiting); -- Reference subprogram declared
- -- in the parent of the subunit
- -- parent's body.
- Elevator_Button := Up;
-
- when Down =>
- if Current_Floor > Our_Floor then
- FA13A00_1.FA13A00_2.Down -- Reference private sibling of
- (Floor'pos (Current_Floor) -- the subunit parent's body.
- - Floor'pos (Our_Floor));
- else
- FA13A00_1.FA13A00_2.Up -- Reference private sibling of
- (Floor'pos (Our_Floor) -- the subunit parent's body.
- - Floor'pos (Current_Floor));
- end if;
-
- Elevator_Button := Down;
-
- -- Call elevator.
-
- Call
- (Current_Floor, Call_Waiting); -- Reference subprogram declared
- -- in the parent of the subunit
- -- parent's body.
- end case;
-
- if not Call_Waiting (Current_Floor) -- Reference private part of the
- then -- parent of the subunit parent's
- -- body.
- TC_Operation := false;
- end if;
-
- end if;
-
- return Elevator_Button;
-
-end Call_Elevator;
-
- --==================================================================--
-
-with FA13A00_1.CA13A02_4; -- Outside Elevator Button Operations
- -- implicitly with Basic Elevator
- -- Operations
-with Report;
-
-procedure CA13A02 is
-
-begin
-
- Report.Test ("CA13A02", "Check that subunits declared in generic child " &
- "units of a public parent have the same visibility into " &
- "its parent, its parent's siblings, and packages on " &
- "which its parent depends");
-
--- Going from floor one to penthouse.
-
- Going_To_Penthouse:
- declare
- -- Declare instance of the child generic elevator package for penthouse.
-
- package Call_Elevator_Pkg is new FA13A00_1.CA13A02_4
- (FA13A00_1.Penthouse);
-
- use Call_Elevator_Pkg;
-
- Call_Button_Light : Light;
-
- begin
-
- Call_Button_Light := Call_Elevator (Express);
-
- if not FA13A00_1.TC_Operation or Call_Button_Light /= Express then
- Report.Failed ("Incorrect elevator operation going to penthouse");
- end if;
-
- end Going_To_Penthouse;
-
--- Going from penthouse to basement.
-
- Going_To_Basement:
- declare
- -- Declare instance of the child generic elevator package for basement.
-
- package Call_Elevator_Pkg is new FA13A00_1.CA13A02_4
- (FA13A00_1.Basement);
-
- use Call_Elevator_Pkg;
-
- Call_Button_Light : Light;
-
- begin
-
- Call_Button_Light := Call_Elevator (Down);
-
- if not FA13A00_1.TC_Operation or Call_Button_Light /= Down then
- Report.Failed ("Incorrect elevator operation going to basement");
- end if;
-
- end Going_To_Basement;
-
--- Going from basement to floor three.
-
- Going_To_Floor3:
- declare
- -- Declare instance of the child generic elevator package for floor
- -- three.
-
- package Call_Elevator_Pkg is new FA13A00_1.CA13A02_4
- (FA13A00_1.Floor3);
-
- use Call_Elevator_Pkg;
-
- Call_Button_Light : Light;
-
- begin
-
- Call_Button_Light := Call_Elevator (Up);
-
- if not FA13A00_1.TC_Operation or Call_Button_Light /= Up then
- Report.Failed ("Incorrect elevator operation going to floor 3");
- end if;
-
- end Going_To_Floor3;
-
--- Going from floor three to floor two.
-
- Going_To_Floor2:
- declare
- -- Declare instance of the child generic elevator package for floor two.
-
- package Call_Elevator_Pkg is new FA13A00_1.CA13A02_4
- (FA13A00_1.Floor2);
-
- use Call_Elevator_Pkg;
-
- Call_Button_Light : Light;
-
- begin
-
- Call_Button_Light := Call_Elevator (Up);
-
- if not FA13A00_1.TC_Operation or Call_Button_Light /= Up then
- Report.Failed ("Incorrect elevator operation going to floor 2");
- end if;
-
- end Going_To_Floor2;
-
--- Going to floor one.
-
- Going_To_Floor1:
- declare
- -- Declare instance of the child generic elevator package for floor one.
-
- package Call_Elevator_Pkg is new FA13A00_1.CA13A02_4
- (FA13A00_1.Floor1);
-
- use Call_Elevator_Pkg;
-
- Call_Button_Light : Light;
-
- begin
- -- Calling elevator from floor one.
-
- FA13A00_1.Current_Floor := FA13A00_1.Floor1;
-
- Call_Button_Light := Call_Elevator (Down);
-
- if not FA13A00_1.TC_Operation or Call_Button_Light /= Down then
- Report.Failed ("Incorrect elevator operation going to floor 1");
- end if;
-
- end Going_To_Floor1;
-
- Report.Result;
-
-end CA13A02;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca140230.a b/gcc/testsuite/ada/acats/tests/ca/ca140230.a
deleted file mode 100644
index 95b72b1ab71..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca140230.a
+++ /dev/null
@@ -1,62 +0,0 @@
--- CA140230.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See CA140232.AM.
---
--- TEST DESCRIPTION:
--- See CA140232.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> CA140230.A
--- CA140231.A
--- CA140232.AM
--- CA140233.A
---
--- PASS/FAIL CRITERIA:
--- See CA140232.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
--- 13 SEP 99 RLB Changed to C-test (by AI-00077).
--- 20 MAR 00 RLB Removed special requirements, because there
--- aren't any.
---
---!
-
-package CA14023_0 is
- subtype Little_float is float digits 4 range 0.0..100.0;
- type Data_rec is tagged record
- Data : Little_float;
- end record;
-end CA14023_0;
-
---------------------------------------------------------
-
-generic
- type Data_type is digits <>;
- Floor : Data_type;
-function CA14023_1 (P1, P2 : Data_type) return Data_type;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca140231.a b/gcc/testsuite/ada/acats/tests/ca/ca140231.a
deleted file mode 100644
index 32504b59008..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca140231.a
+++ /dev/null
@@ -1,59 +0,0 @@
--- CA140231.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See CA140232.AM.
---
--- TEST DESCRIPTION:
--- See CA140232.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- CA140230.A
--- -> CA140231.A
--- CA140232.AM
--- CA140233.A
---
--- PASS/FAIL CRITERIA:
--- See CA140232.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
--- 13 SEP 99 RLB Changed to C-test (by AI-00077).
--- 20 MAR 00 RLB Removed special requirements, because there
--- aren't any.
---
---!
-
-function CA14023_1 (P1, P2 : Data_type) return Data_type is
-begin
- if Floor > P1 and Floor > P2 then
- return Floor;
- elsif P2 > P1 then
- return P2;
- else
- return P1;
- end if;
-end CA14023_1;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca140233.a b/gcc/testsuite/ada/acats/tests/ca/ca140233.a
deleted file mode 100644
index a5334379dc9..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca140233.a
+++ /dev/null
@@ -1,68 +0,0 @@
--- CA140233.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See CA140232.AM.
---
--- TEST DESCRIPTION:
--- See CA140232.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- CA140230.A
--- CA140231.A
--- CA140232.AM
--- -> CA140233.A
---
--- PASS/FAIL CRITERIA:
--- See CA140232.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008T baseline version
--- 29 JUN 95 SAIC Initial version
--- 05 MAR 96 SAIC First revision after review
--- 18 NOV 96 SAIC Modified unit names and prologue to conform
--- to coding conventions.
--- 07 DEC 96 SAIC Modified prologue to reflect new test
--- file organization.
--- 13 SEP 99 RLB Changed to C-test (by AI-00077).
--- 20 MAR 00 RLB Removed special requirements, because there
--- aren't any.
---!
-
--- here is the replacement body, correcting "errors" in
--- the original
-
-function CA14023_1 (P1, P2 : Data_type) return Data_type is
-begin
- -- return min rather than max
- if Floor < P1 and Floor < P2 then
- return Floor;
- elsif P2 < P1 then
- return P2;
- else
- return P1;
- end if;
-end CA14023_1;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca140280.a b/gcc/testsuite/ada/acats/tests/ca/ca140280.a
deleted file mode 100644
index 1ffe3cbbf73..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca140280.a
+++ /dev/null
@@ -1,77 +0,0 @@
--- CA140280.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
--- OBJECTIVE:
--- See CA140283.AM.
---
--- TEST DESCRIPTION
--- See CA140283.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> CA140280.A
--- CA140281.A
--- CA140282.A
--- CA140283.AM
---
--- CHANGE HISTORY:
--- JBG 05/28/85 CREATED ORGINAL TEST.
--- RDH 04/18/90 ADDED CASES WHERE SUBPROGRAM PARAMETER TYPES ARE
--- NOT THE SAME.
--- RLB 07/08/99 Reinstated withdrawn test; revised to Ada 95 format.
-
-GENERIC
- C : INTEGER;
-PROCEDURE GENPROC_CA14028 (X : OUT INTEGER);
-
-WITH REPORT; USE REPORT;
-PRAGMA ELABORATE (REPORT);
-PROCEDURE GENPROC_CA14028 (X : OUT INTEGER) IS
-BEGIN
- X := IDENT_INT(C);
-END GENPROC_CA14028;
-
-GENERIC
-FUNCTION GENFUNC_CA14028 RETURN INTEGER;
-
-FUNCTION GENFUNC_CA14028 RETURN INTEGER IS
-BEGIN
- RETURN 2;
-END GENFUNC_CA14028;
-
-WITH GENPROC_CA14028;
-PRAGMA ELABORATE (GENPROC_CA14028);
-PROCEDURE CA14028_PROC1 IS NEW GENPROC_CA14028(1);
-
-WITH GENFUNC_CA14028;
-PRAGMA ELABORATE (GENFUNC_CA14028);
-FUNCTION CA14028_FUNC2 IS NEW GENFUNC_CA14028;
-
-WITH GENPROC_CA14028;
-PRAGMA ELABORATE (GENPROC_CA14028);
-PROCEDURE CA14028_PROC3 IS NEW GENPROC_CA14028(3);
-
-WITH GENFUNC_CA14028;
-PRAGMA ELABORATE (GENFUNC_CA14028);
-FUNCTION CA14028_FUNC3 IS NEW GENFUNC_CA14028;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca140281.a b/gcc/testsuite/ada/acats/tests/ca/ca140281.a
deleted file mode 100644
index 57360c9ebb9..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca140281.a
+++ /dev/null
@@ -1,67 +0,0 @@
--- CA140281.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
--- OBJECTIVE:
--- See CA140283.AM.
---
--- TEST DESCRIPTION
--- See CA140283.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- CA140280.A
--- -> CA140281.A
--- CA140282.A
--- CA140283.AM
---
--- CHANGE HISTORY:
--- JBG 05/28/85 CREATED ORGINAL TEST.
--- RDH 04/18/90 ADDED CASES WHERE SUBPROGRAM PARAMETER TYPES ARE
--- NOT THE SAME.
--- RLB 07/08/99 Reinstated withdrawn test; revised to Ada 95 format.
-
-PROCEDURE CA14028_PROC1 (X : OUT INTEGER) IS
-BEGIN
- X := 3;
-END CA14028_PROC1;
-
-WITH REPORT; USE REPORT;
-PRAGMA ELABORATE (REPORT);
-FUNCTION CA14028_FUNC2 RETURN INTEGER IS
-BEGIN
- RETURN IDENT_INT(4);
-END CA14028_FUNC2;
-
-WITH REPORT; USE REPORT;
-PRAGMA ELABORATE (REPORT);
-PROCEDURE CA14028_PROC3 (X : OUT BOOLEAN; Y : OUT INTEGER) IS
-BEGIN
- X := FALSE;
- Y := IDENT_INT(6);
-END CA14028_PROC3;
-
-FUNCTION CA14028_FUNC3 RETURN BOOLEAN IS
-BEGIN
- RETURN FALSE;
-END CA14028_FUNC3;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca140282.a b/gcc/testsuite/ada/acats/tests/ca/ca140282.a
deleted file mode 100644
index 437f01889c9..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca140282.a
+++ /dev/null
@@ -1,64 +0,0 @@
--- CA140282.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
--- OBJECTIVE:
--- See CA140283.AM.
---
--- TEST DESCRIPTION
--- See CA140283.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- CA140280.A
--- CA140281.A
--- -> CA140282.A
--- CA140283.AM
---
--- CHANGE HISTORY:
--- JBG 05/28/85 CREATED ORIGINAL TEST.
--- RDH 04/18/90 ADDED CASES WHERE SUBPROGRAM PARAMETER TYPES ARE
--- NOT THE SAME.
--- RLB 07/08/99 Reinstated withdrawn test; revised to Ada 95 format.
-
-WITH GENPROC_CA14028;
-PRAGMA ELABORATE (GENPROC_CA14028);
-PROCEDURE CA14028_PROC5 IS NEW GENPROC_CA14028 (5);
-
-WITH GENFUNC_CA14028;
-PRAGMA ELABORATE (GENFUNC_CA14028);
-FUNCTION CA14028_FUNC22 IS NEW GENFUNC_CA14028;
-
-WITH REPORT; USE REPORT;
-PRAGMA ELABORATE (REPORT);
-PROCEDURE CA14028_PROC3 (X : OUT INTEGER) IS
-BEGIN
- X := IDENT_INT(4);
-END CA14028_PROC3;
-
-WITH REPORT; USE REPORT;
-PRAGMA ELABORATE (REPORT);
-FUNCTION CA14028_FUNC3 RETURN INTEGER IS
-BEGIN
- RETURN IDENT_INT(7);
-END CA14028_FUNC3;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca15003.a b/gcc/testsuite/ada/acats/tests/ca/ca15003.a
deleted file mode 100644
index 08fe1516ddf..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca15003.a
+++ /dev/null
@@ -1,161 +0,0 @@
--- CA15003.A
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE
--- Check the requirements of 10.1.5(4) and the modified 10.1.5(5)
--- from Technical Corrigendum 1. (Originally discussed as AI95-00136.)
--- Specifically:
--- Check that program unit pragma for a generic package are accepted
--- when given at the beginning of the package specification.
--- Check that a program unit pragma can be given for a generic
--- instantiation by placing the pragma immediately after the instantation.
---
--- TEST DESCRIPTION
--- This test checks the cases that are *not* forbidden by the RM,
--- and makes sure such legal cases actually work.
---
--- CHANGE HISTORY:
--- 29 JUN 1999 RAD Initial Version
--- 08 JUL 1999 RLB Cleaned up and added to test suite.
--- 27 AUG 1999 RLB Repaired errors introduced by me.
---
---!
-
-with System;
-package CA15003A is
- pragma Pure;
-
- type Big_Int is range -System.Max_Int .. System.Max_Int;
- type Big_Positive is new Big_Int range 1..Big_Int'Last;
-end CA15003A;
-
-generic
- type Int is new Big_Int;
-package CA15003A.Pure is
- pragma Pure;
- function F(X: access Int) return Int;
-end CA15003A.Pure;
-
-with CA15003A.Pure;
-package CA15003A.Pure_Instance is new CA15003A.Pure(Int => Big_Positive);
- pragma Pure(CA15003A.Pure_Instance);
-
-package body CA15003A.Pure is
- function F(X: access Int) return Int is
- begin
- X.all := X.all + 1;
- return X.all;
- end F;
-end CA15003A.Pure;
-
-generic
-package CA15003A.Pure.Preelaborate is
- pragma Preelaborate;
- One: Int := 1;
- function F(X: access Int) return Int;
-end CA15003A.Pure.Preelaborate;
-
-package body CA15003A.Pure.Preelaborate is
- function F(X: access Int) return Int is
- begin
- X.all := X.all + One;
- return X.all;
- end F;
-end CA15003A.Pure.Preelaborate;
-
-with CA15003A.Pure_Instance;
-with CA15003A.Pure.Preelaborate;
-package CA15003A.Pure_Preelaborate_Instance is
- new CA15003A.Pure_Instance.Preelaborate;
- pragma Preelaborate(CA15003A.Pure_Preelaborate_Instance);
-
-package CA15003A.Empty_Pure is
- pragma Pure;
- pragma Elaborate_Body;
-end CA15003A.Empty_Pure;
-
-package body CA15003A.Empty_Pure is
-end CA15003A.Empty_Pure;
-
-package CA15003A.Empty_Preelaborate is
- pragma Preelaborate;
- pragma Elaborate_Body;
- One: Big_Int := 1;
-end CA15003A.Empty_Preelaborate;
-
-package body CA15003A.Empty_Preelaborate is
- function F(X: access Big_Int) return Big_Int is
- begin
- X.all := X.all + One;
- return X.all;
- end F;
-end CA15003A.Empty_Preelaborate;
-
-package CA15003A.Empty_Elaborate_Body is
- pragma Elaborate_Body;
- Three: aliased Big_Positive := 1;
- Two, Tres: Big_Positive'Base := 0;
-end CA15003A.Empty_Elaborate_Body;
-
-with Report; use Report; pragma Elaborate_All(Report);
-with CA15003A.Pure_Instance;
-with CA15003A.Pure_Preelaborate_Instance;
-use CA15003A;
-package body CA15003A.Empty_Elaborate_Body is
-begin
- if Two /= Big_Positive'Base(Ident_Int(0)) then
- Failed ("Two should be zero now");
- end if;
- if Tres /= Big_Positive'Base(Ident_Int(0)) then
- Failed ("Tres should be zero now");
- end if;
- if Two /= Tres then
- Failed ("Tres should be zero now");
- end if;
- Two := Pure_Instance.F(Three'Access);
- Tres := Pure_Preelaborate_Instance.F(Three'Access);
- if Two /= Big_Positive(Ident_Int(2)) then
- Failed ("Two should be 2 now");
- end if;
- if Tres /= Big_Positive(Ident_Int(3)) then
- Failed ("Tres should be 3 now");
- end if;
-end CA15003A.Empty_Elaborate_Body;
-
-with Report; use Report;
-with CA15003A.Empty_Pure;
-with CA15003A.Empty_Preelaborate;
-with CA15003A.Empty_Elaborate_Body; use CA15003A.Empty_Elaborate_Body;
-use type CA15003A.Big_Positive'Base;
-procedure CA15003 is
-begin
- Test("CA15003", "Placement of Program Unit Pragmas in Generic Packages");
- if Two /= 2 then
- Failed ("Two should be 2 now");
- end if;
- if Tres /= 3 then
- Failed ("Tres should be 3 now");
- end if;
- Result;
-end CA15003;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca200020.a b/gcc/testsuite/ada/acats/tests/ca/ca200020.a
deleted file mode 100644
index c9508f4cccb..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca200020.a
+++ /dev/null
@@ -1,70 +0,0 @@
--- CA200020.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
--- F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
--- software and documentation contained herein. Unlimited rights are
--- defined in DFAR 252.227-7013(a)(19). By making this public release,
--- the Government intends to confer upon all recipients unlimited rights
--- equal to those held by the Government. These rights include rights to
--- use, duplicate, release or disclose the released technical data and
--- computer software in whole or in part, in any manner and for any purpose
--- whatsoever, and to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a partition can be created even if the environment contains
--- two units with the same name. (This is rule 10.2(19)).
---
--- TEST DESCRIPTION:
--- Declare the a parent package (CA20002_0). Declare a child package
--- (CA20002_0.CA20002_1). Declare a subunit in the parent package body
--- (CA20002_1). Declare a main subprogram that does NOT include the
--- child package. Insure that this partition can be created.
---
--- This test is intended to test the effects of program maintenance.
--- After the programmer receives an error from creating a partition
--- like that tested in test LA20001, the programmer may then repair
--- the partition by eliminating the reference of the child unit. The
--- partition should be able to be created.
---
--- To build this test:
--- 1) Compile the file CA200020 (and include the results in the
--- program library).
--- 2) Compile the file CA200021 (and include the results in the
--- program library).
--- 3) Compile the file CA200022 (and include the results in the
--- program library).
--- 4) Build an executable image, and run it.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> CA200020.A
--- CA200021.A
--- CA200022.AM
---
--- CHANGE HISTORY:
--- 27 Jan 99 RLB Initial test.
--- 20 Mar 00 RLB Removed special requirements, because there
--- aren't any.
---!
-
-package CA20002_0 is
- procedure Do_a_Little (A : out Integer);
-
-end CA20002_0;
-
-package CA20002_0.CA20002_1 is
- My_Global : Integer;
-end CA20002_0.CA20002_1;
-
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca200021.a b/gcc/testsuite/ada/acats/tests/ca/ca200021.a
deleted file mode 100644
index 0c5de38253b..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca200021.a
+++ /dev/null
@@ -1,66 +0,0 @@
--- CA200021.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
--- F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
--- software and documentation contained herein. Unlimited rights are
--- defined in DFAR 252.227-7013(a)(19). By making this public release,
--- the Government intends to confer upon all recipients unlimited rights
--- equal to those held by the Government. These rights include rights to
--- use, duplicate, release or disclose the released technical data and
--- computer software in whole or in part, in any manner and for any purpose
--- whatsoever, and to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See CA200020.A.
---
--- TEST DESCRIPTION:
--- See CA200020.A.
---
--- TEST FILES:
--- This test consists of the following files:
--- CA200020.A
--- -> CA200021.A
--- CA200022.AM
---
--- PASS/FAIL CRITERIA:
--- See CA200020.A.
---
--- CHANGE HISTORY:
--- 27 JAN 99 RLB Initial version.
--- 20 MAR 00 RLB Removed special requirements, because there
--- aren't any.
---
---!
-
-package body CA20002_0 is
-
- function CA20002_1 return Integer is separate; -- Has the same expanded name
- -- as the child.
- -- Note: An implementation may produce a warning about the child
- -- unit at this point, but it must accept the subunit declaration.
-
- procedure Do_a_Little (A : out Integer) is
- begin
- A := CA20002_1;
- end Do_a_Little;
-
-end CA20002_0;
-
-with Report;
-separate (CA20002_0)
-function CA20002_1 return Integer is
-begin
- return Report.Ident_Int(5);
-end CA20002_1;
diff --git a/gcc/testsuite/ada/acats/tests/ca/ca21001.a b/gcc/testsuite/ada/acats/tests/ca/ca21001.a
deleted file mode 100644
index 1056b65bfcc..00000000000
--- a/gcc/testsuite/ada/acats/tests/ca/ca21001.a
+++ /dev/null
@@ -1,152 +0,0 @@
--- CA21001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
--- F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
--- software and documentation contained herein. Unlimited rights are
--- defined in DFAR 252.227-7013(a)(19). By making this public release,
--- the Government intends to confer upon all recipients unlimited rights
--- equal to those held by the Government. These rights include rights to
--- use, duplicate, release or disclose the released technical data and
--- computer software in whole or in part, in any manner and for any purpose
--- whatsoever, and to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE
--- Check the requirements of the revised 10.2.1(11) from Technical
--- Corrigendum 1 (originally discussed as AI95-00002).
--- A package subunit whose parent is a preelaborated subprogram need
--- not be preelaborable.
---
--- TEST DESCRIPTION
--- We create several preelaborated library procedures with
--- non-preelaborable package body subunits. We try various levels
--- of nesting of package and procedure subunits.
---
--- CHANGE HISTORY:
--- 29 JUN 1999 RAD Initial Version
--- 23 SEP 1999 RLB Improved comments, renamed, issued.
---
---!
-
-procedure CA21001_1(X: out Integer);
- pragma Preelaborate(CA21001_1);
-
-procedure CA21001_1(X: out Integer) is
- function F return Integer is separate;
-
- package Sub is
- function G(X: Integer) return Integer;
- -- Returns X + 1.
- Not_Preelaborable: Integer := F; -- OK, by AI-2.
- end Sub;
-
- package body Sub is separate;
-
-begin
- X := -1;
- X := F;
- X := Sub.G(X);
-end CA21001_1;
-
-separate(CA21001_1)
-package body Sub is
- package Sub_Sub is
- -- Empty.
- end Sub_Sub;
- package body Sub_Sub is separate;
-
- function G(X: Integer) return Integer is separate;
-begin
- Not_Preelaborable := G(F); -- OK, by AI-2.
- if Not_Preelaborable /= 101 then
- raise Program_Error; -- Can't call Report.Failed, here,
- -- because Report is not preelaborated.
- end if;
-end Sub;
-
-separate(CA21001_1.Sub)
-package body Sub_Sub is
-begin
- X := X; -- OK by AI-2.
-end Sub_Sub;
-
-separate(CA21001_1.Sub)
-function G(X: Integer) return Integer is
-
- package G_Sub is
- function H(X: Integer) return Integer;
- -- Returns X + 1.
- Not_Preelaborable: Integer := F; -- OK, by AI-2.
- end G_Sub;
- package body G_Sub is separate;
-
-begin
- return G_Sub.H(X);
-end G;
-
-separate(CA21001_1.Sub.G)
-package body G_Sub is
- function H(X: Integer) return Integer is separate;
-begin
- Not_Preelaborable := H(F); -- OK, by AI-2.
- if Not_Preelaborable /= 101 then
- raise Program_Error; -- Can't call Report.Failed, here,
- -- because Report is not preelaborated.
- end if;
-end G_Sub;
-
-separate(CA21001_1.Sub.G.G_Sub)
-function H(X: Integer) return Integer is
-begin
- return X + 1;
-end H;
-
-separate(CA21001_1)
-function F return Integer is
-
- package F_Sub is
- -- Empty.
- end F_Sub;
-
- package body F_Sub is separate;
-begin
- return 100;
-end F;
-
-separate(CA21001_1.F)
-package body F_Sub is
- True_Var: Boolean;
-begin
- True_Var := True;
- if True_Var then -- OK by AI-2.
- X := X;
- else
- X := X + 2;
- end if;
-end F_Sub;
-
-with Report; use Report;
-with CA21001_1;
-procedure CA21001 is
- X: Integer := 0;
-begin
- Test("CA21001",
- "Test that a package subunit whose parent is a preelaborated"
- & " subprogram need not be preelaborable");
- CA21001_1(X);
- if X /= 101 then
- Failed("Bad value for X");
- end if;
- Result;
-end CA21001;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb10002.a b/gcc/testsuite/ada/acats/tests/cb/cb10002.a
deleted file mode 100644
index f3099d4a26c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb10002.a
+++ /dev/null
@@ -1,128 +0,0 @@
--- CB10002.A
-
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Storage_Error is raised when storage for allocated objects
--- is exceeded.
---
--- TEST DESCRIPTION:
--- This test allocates a very large data structure.
---
--- In order to avoid running forever on virtual memory targets, the
--- data structure is bounded in size, and elements are larger the longer
--- the program runs.
---
--- The program attempts to allocate about 8,600,000 integers, or about
--- 32 Megabytes on a typical 32-bit machine.
---
--- If Storage_Error is raised, the data structure is deallocated.
--- (Otherwise, Report.Result may fail as memory is exhausted).
-
--- CHANGE HISTORY:
--- 30 Aug 85 JRK Ada 83 test created.
--- 14 Sep 99 RLB Created Ada 95 test.
-
-
-with Report;
-with Ada.Unchecked_Deallocation;
-procedure CB10002 is
-
- type Data_Space is array (Positive range <>) of Integer;
-
- type Element (Size : Positive);
-
- type Link is access Element;
-
- type Element (Size : Positive) is
- record
- Parent : Link;
- Child : Link;
- Sibling: Link;
- Data : Data_Space (1 .. Size);
- end record;
-
- procedure Free is new Ada.Unchecked_Deallocation (Element, Link);
-
- Holder : array (1 .. 430) of Link;
- Last_Allocated : Natural := 0;
-
- procedure Allocator (Count : in Positive) is
- begin
- -- Allocate various sized objects similar to what a real application
- -- would do.
- if Count in 1 .. 20 then
- Holder(Count) := new Element (Report.Ident_Int(10));
- elsif Count in 21 .. 40 then
- Holder(Count) := new Element (Report.Ident_Int(79));
- elsif Count in 41 .. 60 then
- Holder(Count) := new Element (Report.Ident_Int(250));
- elsif Count in 61 .. 80 then
- Holder(Count) := new Element (Report.Ident_Int(520));
- elsif Count in 81 .. 100 then
- Holder(Count) := new Element (Report.Ident_Int(1000));
- elsif Count in 101 .. 120 then
- Holder(Count) := new Element (Report.Ident_Int(2048));
- elsif Count in 121 .. 140 then
- Holder(Count) := new Element (Report.Ident_Int(4200));
- elsif Count in 141 .. 160 then
- Holder(Count) := new Element (Report.Ident_Int(7999));
- elsif Count in 161 .. 180 then
- Holder(Count) := new Element (Report.Ident_Int(15000));
- else -- 181..430
- Holder(Count) := new Element (Report.Ident_Int(32000));
- end if;
- Last_Allocated := Count;
- end Allocator;
-
-
-begin
- Report.Test ("CB10002", "Check that Storage_Error is raised when " &
- "storage for allocated objects is exceeded");
-
- begin
- for I in Holder'range loop
- Allocator (I);
- end loop;
- Report.Not_Applicable ("Unable to exhaust memory");
- for I in 1 .. Last_Allocated loop
- Free (Holder(I));
- end loop;
- exception
- when Storage_Error =>
- if Last_Allocated = 0 then
- Report.Failed ("Unable to allocate anything");
- else -- Clean up, so we have enough memory to report on the result.
- for I in 1 .. Last_Allocated loop
- Free (Holder(I));
- end loop;
- Report.Comment (Natural'Image(Last_Allocated) & " items allocated");
- end if;
- when others =>
- Report.Failed ("Wrong exception raised by heap overflow");
- end;
-
- Report.Result;
-
-end CB10002;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb20001.a b/gcc/testsuite/ada/acats/tests/cb/cb20001.a
deleted file mode 100644
index ccfad52e41e..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb20001.a
+++ /dev/null
@@ -1,228 +0,0 @@
--- CB20001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that exceptions can be handled in accept bodies, and that a
--- task object that has an exception handled in an accept body is still
--- viable for future use.
---
--- TEST DESCRIPTION:
--- Declare a task that has exception handlers within an accept
--- statement in the task body. Declare a task object, and make entry
--- calls with data that will cause various exceptions to be raised
--- by the accept statement. Ensure that the exceptions are:
--- 1) raised and handled locally in the accept body
--- 2) raised in the accept body and handled/reraised to be handled
--- by the task body
--- 3) raised in the accept body and propagated to the calling
--- procedure.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-
-package CB20001_0 is
-
- Incorrect_Data,
- Location_Error,
- Off_Screen_Data : exception;
-
- TC_Handled_In_Accept,
- TC_Reraised_In_Accept,
- TC_Handled_In_Task_Block,
- TC_Handled_In_Caller : boolean := False;
-
- type Location_Type is range 0 .. 2000;
-
- task type Submarine_Type is
- entry Contact (Location : in Location_Type);
- end Submarine_Type;
-
- Current_Position : Location_Type := 0;
-
-end CB20001_0;
-
-
- --=================================================================--
-
-
-package body CB20001_0 is
-
-
- task body Submarine_Type is
- begin
- loop
-
- Task_Block:
- begin
- select
- accept Contact (Location : in Location_Type) do
- if Location > 1000 then
- raise Off_Screen_Data;
- elsif (Location > 500) and (Location <= 1000) then
- raise Location_Error;
- elsif (Location > 100) and (Location <= 500) then
- raise Incorrect_Data;
- else
- Current_Position := Location;
- end if;
- exception
- when Off_Screen_Data =>
- TC_Handled_In_Accept := True;
- when Location_Error =>
- TC_Reraised_In_Accept := True;
- raise; -- Reraise the Location_Error exception
- -- in the task block.
- end Contact;
- or
- terminate;
- end select;
-
- exception
-
- when Off_Screen_Data =>
- TC_Handled_In_Accept := False;
- Report.Failed ("Off_Screen_Data exception " &
- "improperly handled in task block");
-
- when Location_Error =>
- TC_Handled_In_Task_Block := True;
- end Task_Block;
-
- end loop;
-
- exception
-
- when Location_Error | Off_Screen_Data =>
- TC_Handled_In_Accept := False;
- TC_Handled_In_Task_Block := False;
- Report.Failed ("Exception improperly propagated out to task body");
- when others =>
- null;
- end Submarine_Type;
-
-end CB20001_0;
-
-
- --=================================================================--
-
-
-with CB20001_0;
-with Report;
-with ImpDef;
-
-procedure CB20001 is
-
- package Submarine_Tracking renames CB20001_0;
-
- Trident : Submarine_Tracking.Submarine_Type; -- Declare task
- Sonar_Contact : Submarine_Tracking.Location_Type;
-
- TC_LEB_Error,
- TC_Main_Handler_Used : Boolean := False;
-
-begin
-
- Report.Test ("CB20001", "Check that exceptions can be handled " &
- "in accept bodies");
-
-
- Off_Screen_Block:
- begin
- Sonar_Contact := 1500;
- Trident.Contact (Sonar_Contact); -- Cause Off_Screen_Data exception
- -- to be raised and handled in a task
- -- accept body.
- exception
- when Submarine_Tracking.Off_Screen_Data =>
- TC_Main_Handler_Used := True;
- Report.Failed ("Off_Screen_Data exception improperly handled " &
- "in calling procedure");
- when others =>
- Report.Failed ("Exception handled unexpectedly in " &
- "Off_Screen_Block");
- end Off_Screen_Block;
-
-
- Location_Error_Block:
- begin
- Sonar_Contact := 700;
- Trident.Contact (Sonar_Contact); -- Cause Location_Error exception
- -- to be raised in task accept body,
- -- propogated to a task block, and
- -- handled there. Corresponding
- -- exception propagated here also.
- Report.Failed ("Expected exception not raised");
- exception
- when Submarine_Tracking.Location_Error =>
- TC_LEB_Error := True;
- when others =>
- Report.Failed ("Exception handled unexpectedly in " &
- "Location_Error_Block");
- end Location_Error_Block;
-
-
- Incorrect_Data_Block:
- begin
- Sonar_Contact := 200;
- Trident.Contact (Sonar_Contact); -- Cause Incorrect_Data exception
- -- to be raised in task accept body,
- -- propogated to calling procedure.
- Report.Failed ("Expected exception not raised");
- exception
- when Submarine_Tracking.Incorrect_Data =>
- Submarine_Tracking.TC_Handled_In_Caller := True;
- when others =>
- Report.Failed ("Exception handled unexpectedly in " &
- "Incorrect_Data_Block");
- end Incorrect_Data_Block;
-
-
- if TC_Main_Handler_Used or
- not (Submarine_Tracking.TC_Handled_In_Caller and -- Check to see that
- Submarine_Tracking.TC_Handled_In_Task_Block and -- all exceptions
- Submarine_Tracking.TC_Handled_In_Accept and -- were handled in
- Submarine_Tracking.TC_Reraised_In_Accept and -- proper locations.
- TC_LEB_Error)
- then
- Report.Failed ("Exceptions handled in incorrect locations");
- end if;
-
- if Integer(Submarine_Tracking.Current_Position) /= 0 then
- Report.Failed ("Variable incorrectly written in task processing");
- end if;
-
- delay ImpDef.Minimum_Task_Switch;
- if Trident'Callable then
- Report.Failed ("Task didn't terminate with exception propagation");
- end if;
-
- Report.Result;
-
-end CB20001;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb20003.a b/gcc/testsuite/ada/acats/tests/cb/cb20003.a
deleted file mode 100644
index daaf9ffe5c5..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb20003.a
+++ /dev/null
@@ -1,286 +0,0 @@
--- CB20003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that exceptions can be raised, reraised, and handled in an
--- accessed subprogram.
---
---
--- TEST DESCRIPTION:
--- Declare a record type, with one component being an access to
--- subprogram type. Various subprograms are defined to fit the profile
--- of this access type, such that the record component can refer to
--- any of the subprograms.
---
--- Each of the subprograms raises a different exception, based on the
--- value of an input parameter. Exceptions are 1) raised, handled with
--- an others handler, reraised and propagated to main to be handled in
--- a specific handler; 2) raised, handled in a specific handler, reraised
--- and propagated to the main to be handled in an others handler there,
--- and 3) raised and propagated directly to the caller by the subprogram.
---
--- Boolean variables are set throughout the test to ensure that correct
--- exception processing has occurred, and these variables are verified at
--- the conclusion of the test.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CB20003_0 is -- package Push_Buttons
-
-
- Non_Default_Priority,
- Non_Alert_Priority,
- Non_Emergency_Priority : exception;
-
- Handled_With_Others,
- Reraised_In_Subprogram,
- Handled_In_Caller : Boolean := False;
-
- subtype Priority_Type is Integer range 1 .. 10;
-
- Default_Priority : Priority_Type := 1;
- Alert_Priority : Priority_Type := 3;
- Emergency_Priority : Priority_Type := 5;
-
-
- type Button is tagged private; -- Private tagged type.
-
- type Button_Response_Ptr is access procedure (P : in Priority_Type;
- B : in out Button);
-
-
- -- Procedures accessible with Button_Response_Ptr type.
-
- procedure Default_Response (P : in Priority_Type;
- B : in out Button);
-
- procedure Alert_Response (P : in Priority_Type;
- B : in out Button);
-
- procedure Emergency_Response (P : in Priority_Type;
- B : in out Button);
-
-
-
- procedure Push (B : in out Button;
- P : in Priority_Type);
-
- procedure Set_Response (B : in out Button;
- R : in Button_Response_Ptr);
-
-private
-
- type Button is tagged
- record
- Priority : Priority_Type := Default_Priority;
- Response : Button_Response_Ptr := Default_Response'Access;
- end record;
-
-
-end CB20003_0; -- package Push_Buttons
-
-
- --=================================================================--
-
-
-with Report;
-
-package body CB20003_0 is -- package Push_Buttons
-
-
- procedure Push (B : in out Button;
- P : in Priority_Type) is
- begin -- Invoking subprogram designated
- B.Response (P, B); -- by access value.
- end Push;
-
-
- procedure Set_Response (B : in out Button;
- R : in Button_Response_Ptr) is
- begin
- B.Response := R; -- Set procedure value in record
- end Set_Response;
-
-
- procedure Default_Response (P : in Priority_Type;
- B : in out Button) is
- begin
- if (P > Default_Priority) then
- raise Non_Default_Priority;
- Report.Failed ("Exception not raised in procedure body");
- else
- B.Priority := P;
- end if;
- exception
- when others => -- Catch exception with others handler
- Handled_With_Others := True; -- Successfully caught with "others"
- raise;
- Report.Failed ("Exception not reraised in handler");
- end Default_Response;
-
-
-
- procedure Alert_Response (P : in Priority_Type;
- B : in out Button) is
- begin
- if (P > Alert_Priority) then
- raise Non_Alert_Priority;
- Report.Failed ("Exception not raised in procedure body");
- else
- B.Priority := P;
- end if;
- exception
- when Non_Alert_Priority =>
- Reraised_In_Subprogram := True;
- raise; -- Propagate to caller.
- Report.Failed ("Exception not reraised in procedure excpt handler");
- when others =>
- Report.Failed ("Incorrect exception raised/handled");
- end Alert_Response;
-
-
-
- procedure Emergency_Response (P : in Priority_type;
- B : in out Button) is
- begin
- if (P > Emergency_Priority) then
- raise Non_Emergency_Priority;
- Report.Failed ("Exception not raised in procedure body");
- else
- B.Priority := P;
- end if;
- -- No exception handler here, exception will be propagated to caller.
- end Emergency_Response;
-
-
-end CB20003_0; -- package Push_Buttons
-
-
- --=================================================================--
-
-
-with Report;
-with CB20003_0; -- package Push_Buttons
-
-procedure CB20003 is
-
- package Push_Buttons renames CB20003_0;
-
- Console_Button : Push_Buttons.Button;
-
-begin
-
- Report.Test ("CB20003", "Check that exceptions can be raised, " &
- "reraised, and handled in a subprogram " &
- "referenced by an access to subprogram value");
-
-
- Default_Response_Processing: -- The exception
- -- Handled_With_Others is to
- -- be caught with an others
- -- handler in Default_Resp.,
- -- reraised, and handled with
- -- a specific handler here.
- begin
-
- Push_Buttons.Push (Console_Button, -- Raise exception that will
- Report.Ident_Int(2)); -- be handled in procedure.
- exception
- when Push_Buttons.Non_Default_Priority =>
- if not Push_Buttons.Handled_With_Others then -- Not reraised in
- -- procedure.
- Report.Failed
- ("Exception not handled/reraised in procedure");
- end if;
- when others =>
- Report.Failed ("Exception handled in " &
- " Default_Response_Processing block");
- end Default_Response_Processing;
-
-
-
- Alert_Response_Processing:
- begin
-
- Push_Buttons.Set_Response (Console_Button,
- Push_Buttons.Alert_Response'access);
-
- Push_Buttons.Push (Console_Button, -- Raise exception that will
- Report.Ident_Int(4)); -- be handled in procedure,
- -- reraised, and propagated
- -- to caller.
- Report.Failed ("Exception not propagated to caller " &
- "in Alert_Response_Processing block");
-
- exception
- when Push_Buttons.Non_Alert_Priority =>
- if not Push_Buttons.Reraised_In_Subprogram then -- Not reraised in
- -- procedure.
- Report.Failed ("Exception not reraised in procedure");
- end if;
- when others =>
- Report.Failed ("Exception handled in " &
- " Alert_Response_Processing block");
- end Alert_Response_Processing;
-
-
-
- Emergency_Response_Processing:
- begin
-
- Push_Buttons.Set_Response (Console_Button,
- Push_Buttons.Emergency_Response'access);
-
- Push_Buttons.Push (Console_Button, -- Raise exception that will
- Report.Ident_Int(6)); -- be propagated directly to
- -- caller.
- Report.Failed ("Exception not propagated to caller " &
- "in Emergency_Response_Processing block");
-
- exception
- when Push_Buttons.Non_Emergency_Priority =>
- Push_Buttons.Handled_In_Caller := True;
- when others =>
- Report.Failed ("Exception handled in " &
- " Emergency_Response_Processing block");
- end Emergency_Response_Processing;
-
-
-
- if not (Push_Buttons.Handled_With_Others and
- Push_Buttons.Reraised_In_Subprogram and
- Push_Buttons.Handled_In_Caller )
- then
- Report.Failed ("Incorrect exception handling in referenced subprograms");
- end if;
-
-
- Report.Result;
-
-end CB20003;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb20004.a b/gcc/testsuite/ada/acats/tests/cb/cb20004.a
deleted file mode 100644
index 42c0d767254..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb20004.a
+++ /dev/null
@@ -1,203 +0,0 @@
--- CB20004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that exceptions propagate correctly from objects of
--- protected types. Check propagation from protected entry bodies.
---
--- TEST DESCRIPTION:
--- Declare a package with a protected type, including entries and private
--- data, simulating a bounded buffer abstraction. In the main procedure,
--- perform entry calls on an object of the protected type that raises
--- exceptions.
--- Ensure that the exceptions are:
--- 1) raised and handled locally in the entry body
--- 2) raised in the entry body and handled/reraised to be handled
--- by the caller.
--- 3) raised in the entry body and propagated directly to the calling
--- procedure.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CB20004_0 is -- Package Buffer.
-
- Max_Buffer_Size : constant := 2;
-
- Handled_In_Body,
- Propagated_To_Caller,
- Handled_In_Caller : Boolean := False;
-
- Data_Over_5,
- Data_Degradation : exception;
-
- type Data_Item is range 0 .. 100;
-
- type Item_Array_Type is array (1 .. Max_Buffer_Size) of Data_Item;
-
- protected type Bounded_Buffer is
- entry Put (Item : in Data_Item);
- entry Get (Item : out Data_Item);
- private
- Item_Array : Item_Array_Type;
- I, J : Integer range 1 .. Max_Buffer_Size := 1;
- Count : Integer range 0 .. Max_Buffer_Size := 0;
- end Bounded_Buffer;
-
-end CB20004_0;
-
- --=================================================================--
-
-with Report;
-
-package body CB20004_0 is -- Package Buffer.
-
- protected body Bounded_Buffer is
-
- entry Put (Item : in Data_Item) when Count < Max_Buffer_Size is
- begin
- if Item > 10 then
- Item_Array (I) := Item * 8; -- Constraint_Error will be raised
- elsif Item > 5 then -- and handled in entry body.
- raise Data_Over_5; -- Exception handled/reraised in
- else -- entry body, propagated to caller.
- Item_Array (I) := Item; -- Store data item in buffer.
- I := (I mod Max_Buffer_Size) + 1;
- Count := Count + 1;
- end if;
- exception
- when Constraint_Error =>
- Handled_In_Body := True;
- when Data_Over_5 =>
- Propagated_To_Caller := True;
- raise; -- Propagate the exception to the caller.
- end Put;
-
-
- entry Get (Item : out Data_Item) when Count > 0 is
- begin
- Item := Item_Array(J);
- J := (J mod Max_Buffer_Size) + 1;
- Count := Count - 1;
- if Count = 0 then
- raise Data_Degradation; -- Exception to propagate to caller.
- end if;
- end Get;
-
- end Bounded_Buffer;
-
-end CB20004_0;
-
-
- --=================================================================--
-
-
-with CB20004_0; -- Package Buffer.
-with Report;
-
-procedure CB20004 is
-
- package Buffer renames CB20004_0;
-
- Data : Buffer.Data_Item := Buffer.Data_Item'First;
- Data_Buffer : Buffer.Bounded_Buffer; -- an object of protected type.
-
- Handled_In_Caller : Boolean := False; -- same name as boolean declared
- -- in package Buffer.
-begin
-
- Report.Test ("CB20004", "Check that exceptions propagate correctly " &
- "from objects of protected types" );
-
- Initial_Data_Block:
- begin -- Data causes Constraint_Error.
- Data_Buffer.Put (CB20004_0.Data_Item(Report.Ident_Int(51)));
-
- exception
- when Constraint_Error =>
- Buffer.Handled_In_Body := False; -- Improper exception handling
- -- in entry body.
- Report.Failed ("Exception propagated to caller " &
- " from Initial_Data_Block");
- when others =>
- Report.Failed ("Exception raised in processing and " &
- "propagated to caller from Initial_Data_Block");
- end Initial_Data_Block;
-
-
- Data_Entry_Block:
- begin
- -- Valid data. No exception.
- Data_Buffer.Put (CB20004_0.Data_Item(Report.Ident_Int(3)));
-
- -- Data will cause exception.
- Data_Buffer.Put (7); -- Call protected object entry,
- -- exception to be handled/
- -- reraised in entry body.
- Report.Failed ("Data_Over_5 Exception not raised in processing");
- exception
- when Buffer.Data_Over_5 =>
- if Buffer.Propagated_To_Caller then -- Reraised in entry body?
- Buffer.Handled_In_Caller := True;
- else
- Report.Failed ("Exception not reraised in entry body");
- end if;
- when others =>
- Report.Failed ("Exception raised in processing and propagated " &
- "to caller from Data_Entry_Block");
- end Data_Entry_Block;
-
-
- Data_Retrieval_Block:
- begin
-
- Data_Buffer.Get (Data); -- Retrieval of buffer data, buffer now empty.
- -- Exception will be raised in entry body, with
- -- propagation to caller.
- Report.Failed ("Data_Degradation Exception not raised in processing");
- exception
- when Buffer.Data_Degradation =>
- Handled_In_Caller := True; -- Local Boolean used here.
- when others =>
- Report.Failed ("Exception raised in processing and propagated " &
- "to caller from Data_Retrieval_Block");
- end Data_Retrieval_Block;
-
-
- if not (Buffer.Handled_In_Body and -- Validate proper exception
- Buffer.Propagated_To_Caller and -- handling in entry bodies.
- Buffer.Handled_In_Caller and
- Handled_In_Caller)
- then
- Report.Failed ("Improper exception handling by entry bodies");
- end if;
-
-
- Report.Result;
-
-end CB20004;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb20005.a b/gcc/testsuite/ada/acats/tests/cb/cb20005.a
deleted file mode 100644
index 898d2a2c644..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb20005.a
+++ /dev/null
@@ -1,210 +0,0 @@
--- CB20005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that exceptions are raised and properly handled locally in
--- protected operations.
---
--- TEST DESCRIPTION:
--- Declare a package with a protected type, including protected operation
--- declarations and private data, simulating a counting semaphore.
--- In the main procedure, perform calls on protected operations
--- of the protected object designed to induce the raising of exceptions.
---
--- Ensure that the exceptions are raised and handled locally in a
--- protected procedures and functions, and that in this case the
--- exceptions will not propagate to the calling unit. Use specific
--- exception handlers in the protected functions.
---
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CB20005_0 is -- Package Semaphore.
-
- Handled_In_Function,
- Handled_In_Procedure : Boolean := False;
-
- Resource_Overflow,
- Resource_Underflow : exception;
-
- protected type Counting_Semaphore (Max_Resources : Integer) is
- procedure Secure;
- function Resource_Limit_Exceeded return Boolean;
- procedure Release;
- private
- Count : Integer := Max_Resources;
- end Counting_Semaphore;
-
-end CB20005_0;
-
- --=================================================================--
-
-with Report;
-
-package body CB20005_0 is -- Package Semaphore.
-
- protected body Counting_Semaphore is
-
- procedure Secure is
- begin
- if (Count = 0) then -- No resources left to secure.
- raise Resource_Underflow;
- Report.Failed
- ("Program control not transferred by raise in Secure");
- else
- Count := Count - 1; -- Avail resources decremented.
- end if;
- exception
- when Resource_Underflow => -- Exception handled locally in
- Handled_In_Procedure := True; -- this protected operation.
- when others =>
- Report.Failed ("Unexpected exception raised in Secure");
- end Secure;
-
-
- function Resource_Limit_Exceeded return Boolean is
- begin
- if (Count > Max_Resources) then
- raise Resource_Overflow; -- Exception used as control flow
- -- mechanism.
- Report.Failed
- ("Program control not transferred by raise in " &
- "Resource_Limit_Exceeded");
- else
- return (False);
- end if;
- exception
- when Resource_Overflow => -- Handle its own raised
- Handled_In_Function := True; -- exception.
- return (True);
- when others =>
- Report.Failed
- ("Unexpected exception raised in Resource_Limit_Exceeded");
- end Resource_Limit_Exceeded;
-
-
- procedure Release is
- begin
- Count := Count + 1; -- Count of resources available
- -- incremented.
- if Resource_Limit_Exceeded then -- Call to protected operation
- Count := Count - 1; -- function that raises/handles
- end if; -- an exception.
- exception
- when Resource_Overflow =>
- Handled_In_Function := False;
- Report.Failed ("Exception propagated to Function Release");
- when others =>
- Report.Failed ("Unexpected exception raised in Function Release");
- end Release;
-
-
- end Counting_Semaphore;
-
-end CB20005_0;
-
-
- --=================================================================--
-
-
-with CB20005_0; -- Package Semaphore.
-with Report;
-
-procedure CB20005 is
-begin
-
- Report.Test ("CB20005", "Check that exceptions are raised and handled " &
- "correctly in protected operations" );
-
- Test_Block:
- declare
-
- package Semaphore renames CB20005_0;
-
- Total_Resources_Available : constant := 1;
-
- Resources : Semaphore.Counting_Semaphore(Total_Resources_Available);
- -- An object of protected type.
-
- begin
-
- Allocate_Resources:
- declare
- Loop_Count : Integer := Total_Resources_Available + 1;
- begin
- for I in 1..Loop_Count loop -- Force exception.
- Resources.Secure;
- end loop;
- exception
- when Semaphore.Resource_Underflow =>
- Semaphore.Handled_In_Procedure := False; -- Excptn not handled
- Report.Failed -- in prot. operation.
- ("Resource_Underflow exception not handled " &
- "in Allocate_Resources");
- when others =>
- Report.Failed
- ("Exception unexpectedly raised during resource allocation");
- end Allocate_Resources;
-
-
- Deallocate_Resources:
- declare
- Loop_Count : Integer := Total_Resources_Available + 1;
- begin
- for I in 1..Loop_Count loop -- Force excptn.
- Resources.Release;
- end loop;
- exception
- when Semaphore.Resource_Overflow =>
- Semaphore.Handled_In_Function := False; -- Exception not handled
- Report.Failed -- in prot. operation.
- ("Resource overflow not handled by function");
- when others =>
- Report.Failed
- ("Exception raised during resource deallocation");
- end Deallocate_Resources;
-
-
- if not (Semaphore.Handled_In_Procedure and -- Incorrect excpt. handling
- Semaphore.Handled_In_Function) -- in protected operations.
- then
- Report.Failed
- ("Improper exception handling by protected operations");
- end if;
-
-
- exception
- when others =>
- Report.Failed ("Exception raised and propagated in test");
-
- end Test_Block;
-
- Report.Result;
-
-end CB20005;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb20006.a b/gcc/testsuite/ada/acats/tests/cb/cb20006.a
deleted file mode 100644
index f2b3c70a911..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb20006.a
+++ /dev/null
@@ -1,217 +0,0 @@
--- CB20006.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that exceptions are raised and properly handled (including
--- propagation by reraise) in protected operations.
---
--- TEST DESCRIPTION:
--- Declare a package with a protected type, including protected operation
--- declarations and private data, simulating a counting semaphore.
--- In the main procedure, perform calls on protected operations
--- of the protected object designed to induce the raising of exceptions.
---
--- The exceptions raised are to be initially handled in the protected
--- operations, but this handling involves the reraise of the exception
--- and the propagation of the exception to the caller.
---
--- Ensure that the exceptions are raised, handled / reraised successfully
--- in protected procedures and functions. Use "others" handlers in the
--- protected operations.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CB20006_0 is -- Package Semaphore.
-
- Reraised_In_Function,
- Reraised_In_Procedure,
- Handled_In_Function_Caller,
- Handled_In_Procedure_Caller : Boolean := False;
-
- Resource_Overflow,
- Resource_Underflow : exception;
-
- protected type Counting_Semaphore (Max_Resources : Integer) is
- procedure Secure;
- function Resource_Limit_Exceeded return Boolean;
- procedure Release;
- private
- Count : Integer := Max_Resources;
- end Counting_Semaphore;
-
-end CB20006_0;
-
- --=================================================================--
-
-with Report;
-
-package body CB20006_0 is -- Package Semaphore.
-
- protected body Counting_Semaphore is
-
- procedure Secure is
- begin
- if (Count = 0) then -- No resources left to secure.
- raise Resource_Underflow;
- Report.Failed
- ("Program control not transferred by raise in Procedure Secure");
- else
- Count := Count - 1; -- Available resources decremented.
- end if;
- exception
- when Resource_Underflow =>
- Reraised_In_Procedure := True;
- raise; -- Exception propagated to caller.
- Report.Failed ("Exception not propagated to caller from Secure");
- when others =>
- Report.Failed ("Unexpected exception raised in Secure");
- end Secure;
-
-
- function Resource_Limit_Exceeded return Boolean is
- begin
- if (Count > Max_Resources) then
- raise Resource_Overflow; -- Exception used as control flow
- -- mechanism.
- Report.Failed
- ("Specific raise did not alter program control" &
- " from Resource_Limit_Exceeded");
- else
- return (False);
- end if;
- exception
- when others =>
- Reraised_In_Function := True;
- raise; -- Exception propagated to caller.
- Report.Failed ("Exception not propagated to caller" &
- " from Resource_Limit_Exceeded");
- end Resource_Limit_Exceeded;
-
-
- procedure Release is
- begin
- Count := Count + 1; -- Count of resources available
- -- incremented.
- if Resource_Limit_Exceeded then -- Call to protected operation
- Count := Count - 1; -- function that raises/reraises
- -- an exception.
- Report.Failed("Resource limit exceeded");
- end if;
-
- exception
- when others =>
- raise; -- Reraised and propagated again.
- Report.Failed ("Exception not reraised by procedure Release");
- end Release;
-
-
- end Counting_Semaphore;
-
-end CB20006_0;
-
-
- --=================================================================--
-
-
-with CB20006_0; -- Package Semaphore.
-with Report;
-
-procedure CB20006 is
-begin
-
- Report.Test ("CB20006", "Check that exceptions are raised and " &
- "handled / reraised and propagated " &
- "correctly by protected operations" );
-
- Test_Block:
- declare
-
- package Semaphore renames CB20006_0;
-
- Total_Resources_Available : constant := 1;
-
- Resources : Semaphore.Counting_Semaphore (Total_Resources_Available);
- -- An object of protected type.
-
- begin
-
- Allocate_Resources:
- declare
- Loop_Count : Integer := Total_Resources_Available + 1;
- begin
- for I in 1..Loop_Count loop -- Force exception
- Resources.Secure;
- end loop;
- Report.Failed
- ("Exception not propagated from protected operation Secure");
- exception
- when Semaphore.Resource_Underflow => -- Exception propagated
- Semaphore.Handled_In_Procedure_Caller := True; -- from protected
- when others => -- procedure.
- Semaphore.Handled_In_Procedure_Caller := False;
- end Allocate_Resources;
-
-
- Deallocate_Resources:
- declare
- Loop_Count : Integer := Total_Resources_Available + 1;
- begin
- for I in 1..Loop_Count loop -- Force exception
- Resources.Release;
- end loop;
- Report.Failed
- ("Exception not propagated from protected operation Release");
- exception
- when Semaphore.Resource_Overflow => -- Exception propagated
- Semaphore.Handled_In_Function_Caller := True; -- from protected
- when others => -- function.
- Semaphore.Handled_In_Function_Caller := False;
- end Deallocate_Resources;
-
-
- if not (Semaphore.Reraised_In_Procedure and
- Semaphore.Reraised_In_Function and
- Semaphore.Handled_In_Procedure_Caller and
- Semaphore.Handled_In_Function_Caller)
- then -- Incorrect excpt. handling
- Report.Failed -- in protected operations.
- ("Improper exception handling/reraising by protected operations");
- end if;
-
- exception
-
- when others =>
- Report.Failed ("Unexpected exception " &
- " raised and propagated in test");
- end Test_Block;
-
- Report.Result;
-
-
-end CB20006;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb20007.a b/gcc/testsuite/ada/acats/tests/cb/cb20007.a
deleted file mode 100644
index 6d052517e3b..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb20007.a
+++ /dev/null
@@ -1,196 +0,0 @@
--- CB20007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that exceptions are raised and can be directly propagated to
--- the calling unit by protected operations.
---
--- TEST DESCRIPTION:
--- Declare a package with a protected type, including protected operation
--- declarations and private data, simulating a counting semaphore.
--- In the main procedure, perform calls on protected operations
--- of the protected object designed to induce the raising of exceptions.
---
--- The exceptions raised are to be propagated directly from the protected
--- operations to the calling unit.
---
--- Ensure that the exceptions are raised and correctly propagated directly
--- to the calling unit from protected procedures and functions.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CB20007_0 is -- Package Semaphore.
-
- Handled_In_Function_Caller,
- Handled_In_Procedure_Caller : Boolean := False;
-
- Resource_Overflow,
- Resource_Underflow : exception;
-
- protected type Counting_Semaphore (Max_Resources : Integer) is
- procedure Secure;
- function Resource_Limit_Exceeded return Boolean;
- procedure Release;
- private
- Count : Integer := Max_Resources;
- end Counting_Semaphore;
-
-end CB20007_0;
-
- --=================================================================--
-
-with Report;
-
-package body CB20007_0 is -- Package Semaphore.
-
- protected body Counting_Semaphore is
-
- procedure Secure is
- begin
- if (Count = 0) then -- No resources left to secure.
- raise Resource_Underflow;
- Report.Failed ("Program control not transferred by raise");
- else
- Count := Count - 1; -- Available resources decremented.
- end if;
- -- No exception handlers here, direct propagation to calling unit.
- end Secure;
-
-
- function Resource_Limit_Exceeded return Boolean is
- begin
- if (Count > Max_Resources) then
- raise Resource_Overflow; -- Exception used as control flow
- -- mechanism.
- Report.Failed ("Program control not transferred by raise");
- else
- return (False);
- end if;
- -- No exception handlers here, direct propagation to calling unit.
- end Resource_Limit_Exceeded;
-
-
- procedure Release is
- begin
- Count := Count + 1; -- Count of resources available
- -- incremented.
- if Resource_Limit_Exceeded then -- Call to protected operation
- Count := Count - 1; -- function that raises an
- -- exception.
- Report.Failed("Resource limit exceeded");
- end if;
- -- No exception handler here for exception raised in function.
- -- Exception will propagate directly to calling unit.
- end Release;
-
-
- end Counting_Semaphore;
-
-end CB20007_0;
-
-
- --=================================================================--
-
-
-with CB20007_0; -- Package Semaphore.
-with Report;
-
-procedure CB20007 is
-begin
-
- Test_Block:
- declare
-
- package Semaphore renames CB20007_0;
-
- Total_Resources_Available : constant := 1;
-
- Resources : Semaphore.Counting_Semaphore (Total_Resources_Available);
- -- An object of protected type.
-
- begin
-
- Report.Test ("CB20007", "Check that exceptions are raised and can " &
- "be directly propagated to the calling unit " &
- "by protected operations" );
-
- Allocate_Resources:
- declare
- Loop_Count : Integer := Total_Resources_Available + 1;
- begin -- Force exception.
- for I in 1..Loop_Count loop
- Resources.Secure;
- end loop;
- Report.Failed ("Exception not propagated from protected " &
- " operation in Allocate_Resources");
- exception
- when Semaphore.Resource_Underflow => -- Exception prop.
- Semaphore.Handled_In_Procedure_Caller := True; -- from protected
- -- procedure.
- when others =>
- Report.Failed ("Unknown exception during resource allocation");
- end Allocate_Resources;
-
-
- Deallocate_Resources:
- declare
- Loop_Count : Integer := Total_Resources_Available + 1;
- begin -- Force exception.
- for I in 1..Loop_Count loop
- Resources.Release;
- end loop;
- Report.Failed ("Exception not propagated from protected " &
- "operation in Deallocate_Resources");
- exception
- when Semaphore.Resource_Overflow => -- Exception prop
- Semaphore.Handled_In_Function_Caller := True; -- from protected
- -- function.
- when others =>
- Report.Failed ("Exception raised during resource deallocation");
- end Deallocate_Resources;
-
-
- if not (Semaphore.Handled_In_Procedure_Caller and -- Incorrect exception
- Semaphore.Handled_In_Function_Caller) -- handling in
- then -- protected ops.
- Report.Failed
- ("Improper exception propagation by protected operations");
- end if;
-
- exception
-
- when others =>
- Report.Failed ("Unexpected exception " &
- " raised and propagated in test");
- end Test_Block;
-
-
- Report.Result;
-
-end CB20007;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb20a02.a b/gcc/testsuite/ada/acats/tests/cb/cb20a02.a
deleted file mode 100644
index 4c8537086cf..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb20a02.a
+++ /dev/null
@@ -1,155 +0,0 @@
--- CB20A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the name and pertinent information about a user defined
--- exception are available to an enclosing program unit even when the
--- enclosing unit has no visibility into the scope where the exception
--- is declared and raised.
---
--- TEST DESCRIPTION:
--- Declare a subprogram nested within the test subprogram. The enclosing
--- subprogram does not have visibility into the nested subprogram.
--- Declare and raise an exception in the nested subprogram, and allow
--- the exception to propagate to the enclosing scope. Use the function
--- Exception_Name in the enclosing subprogram to produce exception
--- specific information when the exception is handled in an others
--- handler.
---
--- TEST FILES:
---
--- This test depends on the following foundation code file:
--- FB20A00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FB20A00; -- Package containing Function Find
-with Ada.Exceptions;
-with Report;
-
-procedure CB20A02 is
-
- Seed_Number : Integer;
- Random_Number : Integer := 0;
-
- --=================================================================--
-
- function Random_Number_Generator (Seed : Integer) return Integer is
-
- Result : Integer := 0;
-
- HighSeedError,
- Mid_Seed_Error,
- L_o_w_S_e_e_d_E_r_r_o_r : exception;
-
- begin -- Random_Number_Generator
-
-
- if (Report.Ident_Int (Seed) > 1000) then
- raise HighSeedError;
- elsif (Report.Ident_Int (Seed) > 100) then
- raise Mid_Seed_Error;
- elsif (Report.Ident_Int (Seed) > 10) then
- raise L_o_w_S_e_e_d_E_r_r_o_r;
- else
- Seed_Number := ((Seed_Number * 417) + 231) mod 53;
- Result := Seed_Number / 52;
- end if;
-
- return Result;
-
- end Random_Number_Generator;
-
- --=================================================================--
-
-begin
-
- Report.Test ("CB20A02", "Check that the name " &
- "of a user defined exception is available " &
- "to an enclosing program unit even when the " &
- "enclosing unit has no visibility into the " &
- "scope where the exception is declared and " &
- "raised" );
-
- High_Seed:
- begin
- -- This seed value will result in the raising of a HighSeedError
- -- exception.
- Seed_Number := 1001;
- Random_Number := Random_Number_Generator (Seed_Number);
- Report.Failed ("Exception not raised in High_Seed block");
- exception
- when Error : others =>
- if not FB20A00.Find (Ada.Exceptions.Exception_Name (Error),
- "HighSeedError")
- then
- Report.Failed ("Expected HighSeedError, but found " &
- Ada.Exceptions.Exception_Name (Error));
- end if;
- end High_Seed;
-
-
- Mid_Seed:
- begin
- -- This seed value will generate a Mid_Seed_Error exception.
- Seed_Number := 101;
- Random_Number := Random_Number_Generator (Seed_Number);
- Report.Failed ("Exception not raised in Mid_Seed block");
- exception
- when Error : others =>
- if not FB20A00.Find (Ada.Exceptions.Exception_Name (Error),
- "Mid_Seed_Error")
- then
- Report.Failed ("Expected Mid_Seed_Error, but found " &
- Ada.Exceptions.Exception_Name (Error));
- end if;
- end Mid_Seed;
-
-
- Low_Seed:
- begin
- -- This seed value will result in the raising of a
- -- L_o_w_S_e_e_d_E_r_r_o_r exception.
- Seed_Number := 11;
- Random_Number := Random_Number_Generator (Seed_Number);
- Report.Failed ("Exception not raised in Low_Seed block");
- exception
- when Error : others =>
- if not FB20A00.Find (Ada.Exceptions.Exception_Name (Error),
- "L_o_w_S_e_e_d_E_r_r_o_r")
- then
- Report.Failed ("Expected L_o_w_S_e_e_d_E_r_r_o_r but found " &
- Ada.Exceptions.Exception_Name (Error));
- end if;
- end Low_Seed;
-
-
- Report.Result;
-
-end CB20A02;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb40005.a b/gcc/testsuite/ada/acats/tests/cb/cb40005.a
deleted file mode 100644
index 681ec18ff28..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb40005.a
+++ /dev/null
@@ -1,339 +0,0 @@
--- CB40005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that exceptions raised in non-generic code can be handled by
--- a procedure in a generic package. Check that the exception identity
--- can be properly retrieved from the generic code and used by the
--- non-generic code.
---
--- TEST DESCRIPTION:
--- This test models a possible usage paradigm for the type:
--- Ada.Exceptions.Exception_Occurrence.
---
--- A generic package takes access to procedure types (allowing it to
--- be used at any accessibility level) and defines a "fail soft"
--- procedure that takes designators to a procedure to call, a
--- procedure to call in the event that it fails, and a function to
--- call to determine the next action.
---
--- In the event an exception occurs on the call to the first procedure,
--- the exception is stored in a stack; along with the designator to the
--- procedure that caused it; allowing the procedure to be called again,
--- or the exception to be re-raised.
---
--- A full implementation of such a tool would use a more robust storage
--- mechanism, and would provide a more flexible interface.
---
---
--- CHANGE HISTORY:
--- 29 MAR 96 SAIC Initial version
--- 12 NOV 96 SAIC Revised for 2.1 release
---
---!
-
------------------------------------------------------------------ CB40005_0
-
-with Ada.Exceptions;
-generic
- type Proc_Pointer is access procedure;
- type Func_Pointer is access function return Proc_Pointer;
-package CB40005_0 is -- Fail_Soft
-
-
- procedure Fail_Soft_Call( Proc_To_Call : Proc_Pointer;
- Proc_To_Call_On_Exception : Proc_Pointer := null;
- Retry_Routine : Func_Pointer := null );
-
- function Top_Event_Exception return Ada.Exceptions.Exception_Occurrence;
-
- function Top_Event_Procedure return Proc_Pointer;
-
- procedure Pop_Event;
-
- function Event_Stack_Size return Natural;
-
-end CB40005_0; -- Fail_Soft
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- CB40005_0
-
-with Report;
-package body CB40005_0 is
-
- type History_Event is record
- Exception_Event : Ada.Exceptions.Exception_Occurrence_Access;
- Procedure_Called : Proc_Pointer;
- end record;
-
- procedure Store_Event( Proc_Called : Proc_Pointer;
- Error : Ada.Exceptions.Exception_Occurrence );
-
- procedure Fail_Soft_Call( Proc_To_Call : Proc_Pointer;
- Proc_To_Call_On_Exception : Proc_Pointer := null;
- Retry_Routine : Func_Pointer := null ) is
-
- Current_Proc_To_Call : Proc_Pointer := Proc_To_Call;
-
- begin
- while Current_Proc_To_Call /= null loop
- begin
- Current_Proc_To_Call.all; -- call procedure through pointer
- Current_Proc_To_Call := null;
- exception
- when Capture: others =>
- Store_Event( Current_Proc_To_Call, Capture );
- if Proc_To_Call_On_Exception /= null then
- Proc_To_Call_On_Exception.all;
- end if;
- if Retry_Routine /= null then
- Current_Proc_To_Call := Retry_Routine.all;
- else
- Current_Proc_To_Call := null;
- end if;
- end;
- end loop;
- end Fail_Soft_Call;
-
- Stack : array(1..10) of History_Event; -- minimal, sufficient for testing
-
- Stack_Top : Natural := 0;
-
- procedure Store_Event( Proc_Called : Proc_Pointer;
- Error : Ada.Exceptions.Exception_Occurrence )
- is
- begin
- Stack_Top := Stack_Top +1;
- Stack(Stack_Top) := ( Ada.Exceptions.Save_Occurrence(Error),
- Proc_Called );
- end Store_Event;
-
- function Top_Event_Exception return Ada.Exceptions.Exception_Occurrence is
- begin
- if Stack_Top > 0 then
- return Stack(Stack_Top).Exception_Event.all;
- else
- return Ada.Exceptions.Null_Occurrence;
- end if;
- end Top_Event_Exception;
-
- function Top_Event_Procedure return Proc_Pointer is
- begin
- if Stack_Top > 0 then
- return Stack(Stack_Top).Procedure_Called;
- else
- return null;
- end if;
- end Top_Event_Procedure;
-
- procedure Pop_Event is
- begin
- if Stack_Top > 0 then
- Stack_Top := Stack_Top -1;
- else
- Report.Failed("Stack Error");
- end if;
- end Pop_Event;
-
- function Event_Stack_Size return Natural is
- begin
- return Stack_Top;
- end Event_Stack_Size;
-
-end CB40005_0;
-
-------------------------------------------------------------------- CB40005
-
-with Report;
-with TCTouch;
-with CB40005_0;
-with Ada.Exceptions;
-procedure CB40005 is
-
- type Proc_Pointer is access procedure;
- type Func_Pointer is access function return Proc_Pointer;
-
- package Fail_Soft is new CB40005_0(Proc_Pointer, Func_Pointer);
-
- procedure Cause_Standard_Exception;
-
- procedure Cause_Visible_Exception;
-
- procedure Cause_Invisible_Exception;
-
- Exception_Procedure_Pointer : Proc_Pointer;
-
- Visible_Exception : exception;
-
- procedure Action_On_Exception;
-
- function Retry_Procedure return Proc_Pointer;
-
- Raise_Error : Boolean;
-
- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- procedure Cause_Standard_Exception is
- begin
- TCTouch.Touch('S'); --------------------------------------------------- S
- if Raise_Error then
- raise Constraint_Error;
- end if;
- end Cause_Standard_Exception;
-
- procedure Cause_Visible_Exception is
- begin
- TCTouch.Touch('V'); --------------------------------------------------- V
- if Raise_Error then
- raise Visible_Exception;
- end if;
- end Cause_Visible_Exception;
-
- procedure Cause_Invisible_Exception is
- Invisible_Exception : exception;
- begin
- TCTouch.Touch('I'); --------------------------------------------------- I
- if Raise_Error then
- raise Invisible_Exception;
- end if;
- end Cause_Invisible_Exception;
-
- procedure Action_On_Exception is
- begin
- TCTouch.Touch('A'); --------------------------------------------------- A
- end Action_On_Exception;
-
- function Retry_Procedure return Proc_Pointer is
- begin
- TCTouch.Touch('R'); --------------------------------------------------- R
- return Action_On_Exception'Access;
- end Retry_Procedure;
-
- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-begin -- Main test procedure.
-
- Report.Test ("CB40005", "Check that exceptions raised in non-generic " &
- "code can be handled by a procedure in a generic " &
- "package. Check that the exception identity can " &
- "be properly retrieved from the generic code and " &
- "used by the non-generic code" );
-
- -- first, check that the no exception cases cause no action on the stack
- Raise_Error := False;
-
- Fail_Soft.Fail_Soft_Call( Cause_Standard_Exception'Access ); -- S
-
- Fail_Soft.Fail_Soft_Call( Cause_Visible_Exception'Access, -- V
- Action_On_Exception'Access,
- Retry_Procedure'Access );
-
- Fail_Soft.Fail_Soft_Call( Cause_Invisible_Exception'Access, -- I
- null,
- Retry_Procedure'Access );
-
- TCTouch.Assert( Fail_Soft.Event_Stack_Size = 0, "Empty stack");
-
- TCTouch.Validate( "SVI", "Non error case check" );
-
- -- second, check that error cases add to the stack
- Raise_Error := True;
-
- Fail_Soft.Fail_Soft_Call( Cause_Standard_Exception'Access ); -- S
-
- Fail_Soft.Fail_Soft_Call( Cause_Visible_Exception'Access, -- V
- Action_On_Exception'Access, -- A
- Retry_Procedure'Access ); -- RA
-
- Fail_Soft.Fail_Soft_Call( Cause_Invisible_Exception'Access, -- I
- null,
- Retry_Procedure'Access ); -- RA
-
- TCTouch.Assert( Fail_Soft.Event_Stack_Size = 3, "Stack = 3");
-
- TCTouch.Validate( "SVARAIRA", "Error case check" );
-
- -- check that the exceptions and procedure were stored correctly
- -- on the stack
- Raise_Error := False;
-
- -- return procedure pointer from top of stack and call the procedure
- -- through that pointer:
-
- Fail_Soft.Top_Event_Procedure.all;
-
- TCTouch.Validate( "I", "Invisible case unwind" );
-
- begin
- Ada.Exceptions.Raise_Exception(
- Ada.Exceptions.Exception_Identity(Fail_Soft.Top_Event_Exception) );
- Report.Failed("1: Exception not raised");
- exception
- when Constraint_Error => Report.Failed("1: Raised Constraint_Error");
- when Visible_Exception => Report.Failed("1: Raised Visible_Exception");
- when others => null; -- expected case
- end;
-
- Fail_Soft.Pop_Event;
-
- -- return procedure pointer from top of stack and call the procedure
- -- through that pointer:
-
- Fail_Soft.Top_Event_Procedure.all;
-
- TCTouch.Validate( "V", "Visible case unwind" );
-
- begin
- Ada.Exceptions.Raise_Exception(
- Ada.Exceptions.Exception_Identity(Fail_Soft.Top_Event_Exception) );
- Report.Failed("2: Exception not raised");
- exception
- when Constraint_Error => Report.Failed("2: Raised Constraint_Error");
- when Visible_Exception => null; -- expected case
- when others => Report.Failed("2: Raised Invisible_Exception");
- end;
-
- Fail_Soft.Pop_Event;
-
- Fail_Soft.Top_Event_Procedure.all;
-
- TCTouch.Validate( "S", "Standard case unwind" );
-
- begin
- Ada.Exceptions.Raise_Exception(
- Ada.Exceptions.Exception_Identity(Fail_Soft.Top_Event_Exception) );
- Report.Failed("3: Exception not raised");
- exception
- when Constraint_Error => null; -- expected case
- when Visible_Exception => Report.Failed("3: Raised Visible_Exception");
- when others => Report.Failed("3: Raised Invisible_Exception");
- end;
-
- Fail_Soft.Pop_Event;
-
- TCTouch.Assert( Fail_Soft.Event_Stack_Size = 0, "Stack empty after pops");
-
- Report.Result;
-
-end CB40005;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb40a01.a b/gcc/testsuite/ada/acats/tests/cb/cb40a01.a
deleted file mode 100644
index 1c569119afb..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb40a01.a
+++ /dev/null
@@ -1,135 +0,0 @@
--- CB40A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a user defined exception is correctly propagated out of
--- a public child package.
---
--- TEST DESCRIPTION:
--- Declare a public child package containing a procedure used to
--- analyze the alphanumeric content of a particular text string.
--- The procedure contains a processing loop that continues until the
--- range of the text string is exceeded, at which time a user defined
--- exception is raised. This exception propagates out of the procedure
--- through the parent package, to the main test program.
---
--- Exception Type Raised:
--- * User Defined
--- Predefined
---
--- Hierarchical Structure Employed For This Test:
--- * Parent Package
--- * Public Child Package
--- Private Child Package
--- Public Child Subprogram
--- Private Child Subprogram
---
--- TEST FILES:
--- This test depends on the following foundation code:
--- FB40A00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
-package FB40A00.CB40A01_0 is -- package Text_Parser.Processing
-
- procedure Process_Text (Text : in String_Pointer_Type);
-
-end FB40A00.CB40A01_0;
-
-
- --=================================================================--
-
-
-with Report;
-
-package body FB40A00.CB40A01_0 is
-
- procedure Process_Text (Text : in String_Pointer_Type) is
- Pos : Natural := Text'First - 1;
- begin
- loop -- Process string, raise exception upon completion.
- Pos := Pos + 1;
- if Pos > Text.all'Last then
- raise Completed_Text_Processing;
- elsif (Text.all (Pos) in 'A' .. 'Z') or
- (Text.all (Pos) in 'a' .. 'z') or
- (Text.all (Pos) in '0' .. '9') then
- Increment_AlphaNumeric_Count;
- else
- Increment_Non_AlphaNumeric_Count;
- end if;
- end loop;
- -- No exception handler here, exception propagates.
- Report.Failed ("No exception raised in child package subprogram");
- end Process_Text;
-
-end FB40A00.CB40A01_0;
-
-
- --=================================================================--
-
-
-with FB40A00.CB40A01_0;
-with Report;
-
-procedure CB40A01 is
-
- String_Pointer : FB40A00.String_Pointer_Type :=
- new String'("'Twas the night before Christmas, " &
- "and all through the house...");
-
-begin
-
- Process_Block:
- begin
-
- Report.Test ("CB40A01", "Check that a user defined exception " &
- "is correctly propagated out of a " &
- "public child package");
-
- FB40A00.CB40A01_0.Process_Text (String_Pointer);
-
- Report.Failed ("Exception should have been handled");
-
- exception
-
- when FB40A00.Completed_Text_Processing => -- Correct exception
- if FB40A00.AlphaNumeric_Count /= 48 then -- propagation.
- Report.Failed ("Incorrect string processing");
- end if;
-
- when others =>
- Report.Failed ("Exception handled in an others handler");
-
- end Process_Block;
-
- Report.Result;
-
-end CB40A01;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb40a020.a b/gcc/testsuite/ada/acats/tests/cb/cb40a020.a
deleted file mode 100644
index 09830b87f5a..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb40a020.a
+++ /dev/null
@@ -1,95 +0,0 @@
--- CB40A020.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See CB40A021.AM.
---
--- TEST DESCRIPTION:
--- See CB40A021.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- FB40A00.A
--- => CB40A020.A
--- CB40A021.AM
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 02 Nov 96 SAIC ACVC 2.1: Modified prologue.
---
---!
-
-
-package FB40A00.CB40A020_0 is -- package Text_Parser.Processing
-
- function Count_AlphaNumerics (Text : in String) return Natural;
-
-end FB40A00.CB40A020_0;
-
-
- --=================================================================--
-
-
--- Text_Parser.Processing.Process_Text
-with Report;
-private procedure FB40A00.CB40A020_0.CB40A020_1 (Text : in String);
-
-procedure FB40A00.CB40A020_0.CB40A020_1 (Text : in String) is
- Pos : Natural := Text'First - 1;
-begin
- loop -- Process string, raise exception upon completion.
- Pos := Pos + 1;
- if Pos > Text'Last then
- raise Completed_Text_Processing;
- elsif (Text (Pos) in 'A' .. 'Z') or
- (Text (Pos) in 'a' .. 'z') or
- (Text (Pos) in '0' .. '9') then
- Increment_AlphaNumeric_Count;
- else
- Increment_Non_AlphaNumeric_Count;
- end if;
- end loop;
- -- No exception handler here, exception propagates.
- Report.Failed ("No exception raised in child package subprogram");
-end FB40A00.CB40A020_0.CB40A020_1;
-
-
- --=================================================================--
-
-
-with FB40A00.CB40A020_0.CB40A020_1; -- "with" of private child subprogram
- -- Text_Parser.Processing.Process_Text
-package body FB40A00.CB40A020_0 is
-
- function Count_AlphaNumerics (Text : in String) return Natural is
- begin
- FB40A00.CB40A020_0.CB40A020_1 (Text); -- Call prvt child proc.
- return (AlphaNumeric_Count); -- Global maintained in parent.
- -- No exception handler here, exception propagates.
- end Count_AlphaNumerics;
-
-end FB40A00.CB40A020_0;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb40a030.a b/gcc/testsuite/ada/acats/tests/cb/cb40a030.a
deleted file mode 100644
index 8b053e2f0af..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb40a030.a
+++ /dev/null
@@ -1,105 +0,0 @@
--- CB40A030.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See CB40A031.AM.
---
--- TEST DESCRIPTION:
--- See CB40A031.AM.
---
--- TEST FILES:
--- This test consists of the following files:
---
--- FB40A00.A
--- => CB40A030.A
--- CB40A031.AM
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 02 Nov 96 SAIC ACVC 2.1: Modified prologue.
---
---!
-
-
-package FB40A00.CB40A030_0 is -- package Text_Parser.Character_Counting
-
- function Count_AlphaNumerics (Text : in String) return Natural;
-
-end FB40A00.CB40A030_0;
-
-
- --=================================================================--
-
-
-private package FB40A00.CB40A030_1 is -- package Text_Parser.Processing
-
- procedure Process_Text (Text : in String);
-
-end FB40A00.CB40A030_1;
-
-
- --=================================================================--
-
-
-package body FB40A00.CB40A030_1 is
-
- procedure Process_Text (Text : in String) is
- Loop_Count : Integer := Text'Length + 1;
- begin
- for Pos in 1..Loop_Count loop -- Process string, force the
- -- raise of Constraint_Error.
- if (Text (Pos) in 'a'..'z') or
- (Text (Pos) in 'A'..'Z') or
- (Text (Pos) in '0'..'9') then
- Increment_AlphaNumeric_Count;
- else
- Increment_Non_AlphaNumeric_Count;
- end if;
-
- end loop;
- -- No exception handler here, exception propagates.
- end Process_Text;
-
-end FB40A00.CB40A030_1;
-
-
- --=================================================================--
-
-
-with FB40A00.CB40A030_1; -- private sibling package Text_Parser.Processing;
-
-package body FB40A00.CB40A030_0 is
-
- function Count_AlphaNumerics (Text : in String) return Natural is
- begin
- FB40A00.CB40A030_1.Process_Text (Text); -- Call proc in prvt child
- -- package that is a
- -- sibling of this package.
- return (AlphaNumeric_Count);
- -- No exception handler here, exception propagates.
- end Count_AlphaNumerics;
-
-end FB40A00.CB40A030_0;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb40a04.a b/gcc/testsuite/ada/acats/tests/cb/cb40a04.a
deleted file mode 100644
index 45209b9beab..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb40a04.a
+++ /dev/null
@@ -1,119 +0,0 @@
--- CB40A04.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a predefined exception is correctly propagated out of a
--- public child function to a client.
---
--- TEST DESCRIPTION:
--- Declare a public child subprogram. Define the processing loop
--- inside the subprogram to expect a string with index starting at 1.
--- From the test procedure, call the child subprogram with a slice
--- from the middle of a string variable. This will cause an exception
--- to be raised in the child and propagated to the caller.
---
--- Exception Type Raised:
--- User Defined
--- * Predefined
---
--- Hierarchical Structure Employed For This Test:
--- * Parent Package
--- Public Child Package
--- Private Child Package
--- * Public Child Subprogram
--- Private Child Subprogram
---
--- TEST FILES:
--- This test depends on the following foundation code:
--- FB40A00.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-
--- Child subprogram Text_Parser.Count_AlphaNumerics
-
-function FB40A00.CB40A04_0 (Text : string) return Natural is
-begin
-
- for I in 1 .. Text'Last loop -- Raise immediate Constraint_Error
- if (Text (I) in 'a'..'z') or -- with String slice passed from
- (Text (I) in 'A'..'Z') or -- caller. (Slice'first /= 1)
- (Text (I) in '0'..'9') then
- Increment_AlphaNumeric_Count;
- else
- Increment_Non_AlphaNumeric_Count;
- end if;
- end loop;
-
- return (AlphaNumeric_Count); -- Global in parent package.
-
- -- No exception handler here, exception propagates.
-
-end FB40A00.CB40A04_0;
-
-
- --=================================================================--
-
-
-with FB40A00.CB40A04_0; -- Explicit "with" of Text_Parser.Count_AlphaNumerics
-with Report; -- Implicit "with" of Text_Parser.
-
-procedure CB40A04 is
-
- String_Var : String (1..19) := "The quick brown fox";
-
- Number_Of_AlphaNumeric_Characters : Natural := 0;
-
-begin
-
- Report.Test ("CB40A04", "Check that a predefined exception is " &
- "correctly propagated out of a public " &
- "child function to a client");
-
- Process_Block:
- begin
-
- Number_Of_AlphaNumeric_Characters := -- Provide slice of string
- FB40A00.CB40A04_0 (String_Var (5..10)); -- to subprogram.
-
- Report.Failed ("Exception should have been handled");
-
- exception
-
- when Constraint_Error => -- Correct exception
- null; -- propagation.
-
- when others =>
- Report.Failed ("Exception handled in an others handler");
-
- end Process_Block;
-
- Report.Result;
-
-end CB40A04;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb41001.a b/gcc/testsuite/ada/acats/tests/cb/cb41001.a
deleted file mode 100644
index 95ad868feaf..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb41001.a
+++ /dev/null
@@ -1,213 +0,0 @@
--- CB41001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the 'Identity attribute returns the unique identity of an
--- exception. Check that the Raise_Exception procedure can raise an
--- exception that is specified through the use of the 'Identity attribute,
--- and that Reraise_Occurrence can re-raise an exception occurrence
--- using an exception choice parameter.
---
--- TEST DESCRIPTION:
--- This test uses the capability of the 'Identity attribute, which
--- returns the unique identity of an exception, as an Exception_Id
--- result. This result is used as an input parameter to the procedure
--- Raise_Exception. The exception that results is handled, propagated
--- using the Reraise_Occurrence procedure, and handled again.
--- The above actions are performed for both a user-defined and a
--- predefined exception.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 11 Nov 96 SAIC ACVC 2.1: Modified Propagate_User_Exception.
---
---!
-
-with Report;
-with Ada.Exceptions;
-
-procedure CB41001 is
-
-begin
-
- Report.Test ("CB41001", "Check that the 'Identity attribute returns " &
- "the unique identity of an exception. Check " &
- "that the 'Identity attribute is of type " &
- "Exception_Id. Check that the " &
- "Raise_Exception procedure can raise an " &
- "exception that is specified through the " &
- "use of the 'Identity attribute");
- Test_Block:
- declare
-
- Check_Points : constant := 5;
-
- type Check_Point_Array_Type is array (1..Check_Points) of Boolean;
-
- -- Global array used to track the processing path through the test.
- TC_Check_Points : Check_Point_Array_Type := (others => False);
-
- A_User_Defined_Exception : Exception;
- An_Exception_ID : Ada.Exceptions.Exception_Id :=
- Ada.Exceptions.Null_Id;
-
- procedure Propagate_User_Exception is
- Hidden_Exception : Exception;
- begin
- -- Use the 'Identity function to store the unique identity of a
- -- user defined exception into a variable of type Exception_Id.
-
- An_Exception_ID := A_User_Defined_Exception'Identity;
-
- -- Raise this user defined exception using the result of the
- -- 'Identity attribute.
-
- Ada.Exceptions.Raise_Exception(E => An_Exception_Id);
-
- Report.Failed("User defined exception not raised by " &
- "procedure Propagate_User_Exception");
-
- exception
- when Proc_Excpt : A_User_Defined_Exception => -- Expected exception.
- begin
-
- -- By raising a different exception at this point, the
- -- information associated with A_User_Defined_Exception must
- -- be correctly stacked internally.
-
- Ada.Exceptions.Raise_Exception(Hidden_Exception'Identity);
- Report.Failed("Hidden_Exception not raised by " &
- "procedure Propagate_User_Exception");
- exception
- when others =>
- TC_Check_Points(1) := True;
-
- -- Reraise the original exception, which will be propagated
- -- outside the scope of this procedure.
-
- Ada.Exceptions.Reraise_Occurrence(Proc_Excpt);
- Report.Failed("User defined exception not reraised");
-
- end;
-
- when others =>
- Report.Failed("Unexpected exception raised by " &
- "Procedure Propagate_User_Exception");
- end Propagate_User_Exception;
-
- begin
-
- User_Exception_Block:
- begin
- -- Call procedure to raise, handle, and reraise a user defined
- -- exception.
- Propagate_User_Exception;
-
- Report.Failed("User defined exception not propagated from " &
- "procedure Propagate_User_Exception");
-
- exception
- when A_User_Defined_Exception => -- Expected exception.
- TC_Check_Points(2) := True;
- when others =>
- Report.Failed
- ("Unexpected exception handled in User_Exception_Block");
- end User_Exception_Block;
-
-
- Predefined_Exception_Block:
- begin
-
- Inner_Block:
- begin
-
- begin
- -- Use the 'Identity attribute as an input parameter to the
- -- Raise_Exception procedure.
-
- Ada.Exceptions.Raise_Exception(Constraint_Error'Identity);
- Report.Failed("Constraint_Error not raised in Inner_Block");
-
- exception
- when Excpt : Constraint_Error => -- Expected exception.
- TC_Check_Points(3) := True;
-
- -- Reraise the exception.
- Ada.Exceptions.Reraise_Occurrence(X => Excpt);
- Report.Failed("Predefined exception not raised from " &
- "within the exception handler - 1");
- when others =>
- Report.Failed("Incorrect result from attempt to raise " &
- "Constraint_Error using the 'Identity " &
- "attribute - 1");
- end;
-
- Report.Failed("Constraint_Error not reraised in Inner_Block");
-
- exception
- when Block_Excpt : Constraint_Error => -- Expected exception.
- TC_Check_Points(4) := True;
-
- -- Reraise the exception in a scope where the exception
- -- was not originally raised.
-
- Ada.Exceptions.Reraise_Occurrence(X => Block_Excpt);
- Report.Failed("Predefined exception not raised from " &
- "within the exception handler - 2");
-
- when others =>
- Report.Failed("Incorrect result from attempt to raise " &
- "Constraint_Error using the 'Identity " &
- "attribute - 2");
- end Inner_Block;
-
- Report.Failed("Exception not propagated from Inner_Block");
-
- exception
- when Constraint_Error => -- Expected exception.
- TC_Check_Points(5) := True;
- when others =>
- Report.Failed("Unexpected exception handled after second " &
- "reraise of Constraint_Error");
- end Predefined_Exception_Block;
-
-
- -- Verify the processing path taken through the test.
-
- for i in 1..Check_Points loop
- if not TC_Check_Points(i) then
- Report.Failed("Incorrect processing path taken through test, " &
- "didn't pass check point #" & Integer'Image(i));
- end if;
- end loop;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CB41001;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb41002.a b/gcc/testsuite/ada/acats/tests/cb/cb41002.a
deleted file mode 100644
index 1b3898154de..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb41002.a
+++ /dev/null
@@ -1,283 +0,0 @@
--- CB41002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the message string input parameter in a call to the
--- Raise_Exception procedure is associated with the raised exception
--- occurrence, and that the message string can be obtained using the
--- Exception_Message function with the associated Exception_Occurrence
--- object. Check that Function Exception_Information is available
--- to provide implementation-defined information about the exception
--- occurrence.
---
--- TEST DESCRIPTION:
--- This test checks that a message associated with a raised exception
--- is propagated with the exception, and can be retrieved using the
--- Exception_Message function. The exception will be raised using the
--- 'Identity attribute as a parameter to the Raise_Exception procedure,
--- and an associated message string will be provided. The exception
--- will be handled, and the message associated with the occurrence will
--- be compared to the original source message (non-default).
---
--- The test also includes a simulated logging procedure
--- (Check_Exception_Information) that checks that Exception_Information
--- can be called.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 22 Jun 00 RLB Added a check at Exception_Information can be
--- called.
---
---!
-
-with Report;
-with Ada.Exceptions;
-
-procedure CB41002 is
-begin
-
- Report.Test ("CB41002", "Check that the message string input parameter " &
- "in a call to the Raise_Exception procedure is " &
- "associated with the raised exception " &
- "occurrence, and that the message string can " &
- "be obtained using the Exception_Message " &
- "function with the associated " &
- "Exception_Occurrence object. Also check that " &
- "the Exception_Information function can be called");
-
- Test_Block:
- declare
-
- Number_Of_Exceptions : constant := 3;
-
- User_Exception_1,
- User_Exception_2,
- User_Exception_3 : exception;
-
- type String_Ptr is access String;
-
- User_Messages : constant array (1..Number_Of_Exceptions)
- of String_Ptr :=
- (new String'("Msg"),
- new String'("This message will override the default " &
- "message provided by the implementation"),
- new String'("The message can be captured by procedure" & -- 200 chars
- " Exception_Message. It is designed to b" &
- "e exactly 200 characters in length, sinc" &
- "e there is a permission concerning the " &
- "truncation of a message over 200 chars. "));
-
- procedure Check_Exception_Information (
- Occur : in Ada.Exceptions.Exception_Occurrence) is
- -- Simulates an error logging routine.
- Info : constant String :=
- Ada.Exceptions.Exception_Information (Occur);
- function Is_Substring_of (Target, Search : in String) return Boolean is
- -- Returns True if Search is a substring of Target, and False
- -- otherwise.
- begin
- for I in Report.Ident_Int(Target'First) ..
- Target'Last - Search'Length + 1 loop
- if Target(I .. I+Search'Length-1) = Search then
- return True;
- end if;
- end loop;
- return False;
- end Is_Substring_of;
- begin
- -- We can't display Info, as it often contains line breaks
- -- (confusing Report), and might look much like the failure of a test
- -- with an unhandled exception (thus confusing grading tools).
- --
- -- We don't particular care if the implementation advice is followed,
- -- but we make these checks to insure that a compiler cannot optimize
- -- away Info or the rest of this routine.
- if not Is_Substring_of (Info,
- Ada.Exceptions.Exception_Name (Occur)) then
- Report.Comment ("Exception_Information does not contain " &
- "Exception_Name - see 11.4.1(19)");
- elsif not Is_Substring_of (Info,
- Ada.Exceptions.Exception_Message (Occur)) then
- Report.Comment ("Exception_Information does not contain " &
- "Exception_Message - see 11.4.1(19)");
- end if;
- end Check_Exception_Information;
-
- begin
-
- for i in 1..Number_Of_Exceptions loop
- begin
-
- -- Raise a user-defined exception with a specific message string.
- case i is
- when 1 =>
- Ada.Exceptions.Raise_Exception(User_Exception_1'Identity,
- User_Messages(i).all);
- when 2 =>
- Ada.Exceptions.Raise_Exception(User_Exception_2'Identity,
- User_Messages(i).all);
- when 3 =>
- Ada.Exceptions.Raise_Exception(User_Exception_3'Identity,
- User_Messages(i).all);
- when others =>
- Report.Failed("Incorrect result from Case statement");
- end case;
-
- Report.Failed
- ("Exception not raised by procedure Exception_With_Message " &
- "for User_Exception #" & Integer'Image(i));
-
- exception
- when Excptn : others =>
-
- begin
- -- The message that is associated with the raising of each
- -- exception is captured here using the Exception_Message
- -- function.
-
- if User_Messages(i).all /=
- Ada.Exceptions.Exception_Message(Excptn)
- then
- Report.Failed
- ("Message captured from exception is not the " &
- "message provided when the exception was raised, " &
- "User_Exception #" & Integer'Image(i));
- end if;
-
- Check_Exception_Information(Excptn);
- end;
- end;
- end loop;
-
-
-
- -- Verify that the exception specific message is carried across
- -- various boundaries:
-
- begin
-
- begin
- Ada.Exceptions.Raise_Exception(User_Exception_1'Identity,
- User_Messages(1).all);
- Report.Failed("User_Exception_1 not raised");
- end;
- Report.Failed("User_Exception_1 not propagated");
- exception
- when Excptn : User_Exception_1 =>
-
- if User_Messages(1).all /=
- Ada.Exceptions.Exception_Message(Excptn)
- then
- Report.Failed("User_Message_1 not found");
- end if;
- Check_Exception_Information(Excptn);
-
- when others => Report.Failed("Unexpected exception handled - 1");
- end;
-
-
-
- begin
-
- begin
- Ada.Exceptions.Raise_Exception(User_Exception_2'Identity,
- User_Messages(2).all);
- Report.Failed("User_Exception_2 not raised");
- exception
- when Exc : User_Exception_2 =>
-
- -- The exception is reraised here; message should propagate
- -- with exception occurrence.
-
- Ada.Exceptions.Reraise_Occurrence(Exc);
- when others => Report.Failed("User_Exception_2 not handled");
- end;
- Report.Failed("User_Exception_2 not propagated");
- exception
- when Excptn : User_Exception_2 =>
-
- if User_Messages(2).all /=
- Ada.Exceptions.Exception_Message(Excptn)
- then
- Report.Failed("User_Message_2 not found");
- end if;
- Check_Exception_Information(Excptn);
-
- when others => Report.Failed("Unexpected exception handled - 2");
- end;
-
-
- -- Check exception and message propagation across task boundaries.
-
- declare
-
- task Raise_An_Exception is -- single task
- entry Raise_It;
- end Raise_An_Exception;
-
- task body Raise_An_Exception is
- begin
- accept Raise_It do
- Ada.Exceptions.Raise_Exception(User_Exception_3'Identity,
- User_Messages(3).all);
- end Raise_It;
- Report.Failed("User_Exception_3 not raised");
- exception
- when Excptn : User_Exception_3 =>
- if User_Messages(3).all /=
- Ada.Exceptions.Exception_Message(Excptn)
- then
- Report.Failed
- ("User_Message_3 not returned inside task body");
- end if;
- Check_Exception_Information(Excptn);
- when others =>
- Report.Failed("Incorrect exception raised in task body");
- end Raise_An_Exception;
-
- begin
- Raise_An_Exception.Raise_It; -- Exception will be propagated here.
- Report.Failed("User_Exception_3 not propagated to caller");
- exception
- when Excptn : User_Exception_3 =>
- if User_Messages(3).all /=
- Ada.Exceptions.Exception_Message(Excptn)
- then
- Report.Failed("User_Message_3 not returned to caller of task");
- end if;
- Check_Exception_Information(Excptn);
- when others =>
- Report.Failed("Incorrect exception raised by task");
- end;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CB41002;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb41003.a b/gcc/testsuite/ada/acats/tests/cb/cb41003.a
deleted file mode 100644
index aee0b094ce5..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb41003.a
+++ /dev/null
@@ -1,358 +0,0 @@
--- CB41003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an exception occurrence can be saved into an object of
--- type Exception_Occurrence using the procedure Save_Occurrence.
--- Check that a saved exception occurrence can be used to reraise
--- another occurrence of the same exception using the procedure
--- Reraise_Occurrence. Check that the function Save_Occurrence will
--- allocate a new object of type Exception_Occurrence_Access, and saves
--- the source exception to the new object which is returned as the
--- function result.
---
--- TEST DESCRIPTION:
--- This test verifies that an occurrence of an exception can be saved,
--- using either of two overloaded versions of Save_Occurrence. The
--- procedure version of Save_Occurrence is used to save an occurrence
--- of a user defined exception into an object of type
--- Exception_Occurrence. This object is then used as an input
--- parameter to procedure Reraise_Occurrence, the expected exception is
--- handled, and the exception id of the handled exception is compared
--- to the id of the originally raised exception.
--- The function version of Save_Occurrence returns a result of
--- Exception_Occurrence_Access, and is used to store the value of another
--- occurrence of the user defined exception. The resulting access value
--- is dereferenced and used as an input to Reraise_Occurrence. The
--- resulting exception is handled, and the exception id of the handled
--- exception is compared to the id of the originally raised exception.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-with Ada.Exceptions;
-
-procedure CB41003 is
-
-begin
-
- Report.Test ("CB41003", "Check that an exception occurrence can " &
- "be saved into an object of type " &
- "Exception_Occurrence using the procedure " &
- "Save_Occurrence");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
-
- User_Exception_1,
- User_Exception_2 : Exception;
-
- Saved_Occurrence : Exception_Occurrence;
- Occurrence_Ptr : Exception_Occurrence_Access;
-
- User_Message : constant String := -- 200 character string.
- "The string returned by Exception_Message may be tr" &
- "uncated (to no less then 200 characters) by the Sa" &
- "ve_Occurrence procedure (not the function), the Re" &
- "raise_Occurrence proc, and the re-raise statement.";
-
- begin
-
- Raise_And_Save_Block_1 :
- begin
-
- -- This nested exception structure is designed to ensure that the
- -- appropriate exception occurrence is saved using the
- -- Save_Occurrence procedure.
-
- raise Program_Error;
- Report.Failed("Program_Error not raised");
-
- exception
- when Program_Error =>
-
- begin
- -- Use the procedure Raise_Exception, along with the 'Identity
- -- attribute to raise the first user defined exception. Note
- -- that a 200 character message is included in the call.
-
- Raise_Exception(User_Exception_1'Identity, User_Message);
- Report.Failed("User_Exception_1 not raised");
-
- exception
- when Exc : User_Exception_1 =>
-
- -- This exception occurrence is saved into a variable using
- -- procedure Save_Occurrence. This saved occurrence should
- -- not be confused with the raised occurrence of
- -- Program_Error above.
-
- Save_Occurrence(Target => Saved_Occurrence, Source => Exc);
-
- when others =>
- Report.Failed("Unexpected exception handled, expecting " &
- "User_Exception_1");
- end;
-
- when others =>
- Report.Failed("Incorrect exception generated by raise statement");
-
- end Raise_And_Save_Block_1;
-
-
- Reraise_And_Handle_Saved_Exception_1 :
- begin
- -- Reraise the exception that was saved in the previous block.
-
- Reraise_Occurrence(X => Saved_Occurrence);
-
- exception
- when Exc : User_Exception_1 => -- Expected exception.
- -- Check the exception id of the handled id by using the
- -- Exception_Identity function, and compare with the id of the
- -- originally raised exception.
-
- if User_Exception_1'Identity /= Exception_Identity(Exc) then
- Report.Failed("Exception_Ids do not match - 1");
- end if;
-
- -- Check that the message associated with this exception occurrence
- -- has not been truncated (it was originally 200 characters).
-
- if User_Message /= Exception_Message(Exc) then
- Report.Failed("Exception messages do not match - 1");
- end if;
-
- when others =>
- Report.Failed
- ("Incorrect exception raised by Reraise_Occurrence - 1");
- end Reraise_And_Handle_Saved_Exception_1;
-
-
- Raise_And_Save_Block_2 :
- begin
-
- Raise_Exception(User_Exception_2'Identity, User_Message);
- Report.Failed("User_Exception_2 not raised");
-
- exception
- when Exc : User_Exception_2 =>
-
- -- This exception occurrence is saved into an access object
- -- using function Save_Occurrence.
-
- Occurrence_Ptr := Save_Occurrence(Source => Exc);
-
- when others =>
- Report.Failed("Unexpected exception handled, expecting " &
- "User_Exception_2");
- end Raise_And_Save_Block_2;
-
-
- Reraise_And_Handle_Saved_Exception_2 :
- begin
- -- Reraise the exception that was saved in the previous block.
- -- Dereference the access object for use as input parameter.
-
- Reraise_Occurrence(X => Occurrence_Ptr.all);
-
- exception
- when Exc : User_Exception_2 => -- Expected exception.
- -- Check the exception id of the handled id by using the
- -- Exception_Identity function, and compare with the id of the
- -- originally raised exception.
-
- if User_Exception_2'Identity /= Exception_Identity(Exc) then
- Report.Failed("Exception_Ids do not match - 2");
- end if;
-
- -- Check that the message associated with this exception occurrence
- -- has not been truncated (it was originally 200 characters).
-
- if User_Message /= Exception_Message(Exc) then
- Report.Failed("Exception messages do not match - 2");
- end if;
-
- when others =>
- Report.Failed
- ("Incorrect exception raised by Reraise_Occurrence - 2");
- end Reraise_And_Handle_Saved_Exception_2;
-
-
- -- Another example of the use of saving an exception occurrence
- -- is demonstrated in the following block, where the ability to
- -- save an occurrence into a data structure, for later processing,
- -- is modeled.
-
- Store_And_Handle_Block:
- declare
-
- Exc_Number : constant := 3;
- Exception_1,
- Exception_2,
- Exception_3 : exception;
-
- Exception_Storage : array (1..Exc_Number) of Exception_Occurrence;
- Messages : array (1..Exc_Number) of String(1..9) :=
- ("Message 1", "Message 2", "Message 3");
-
- begin
-
- Outer_Block:
- begin
-
- Inner_Block:
- begin
-
- for i in 1..Exc_Number loop
- begin
-
- begin
- -- Exceptions all raised in a deep scope.
- if i = 1 then
- Raise_Exception(Exception_1'Identity, Messages(i));
- elsif i = 2 then
- Raise_Exception(Exception_2'Identity, Messages(i));
- elsif i = 3 then
- Raise_Exception(Exception_3'Identity, Messages(i));
- end if;
- Report.Failed("Exception not raised on loop #" &
- Integer'Image(i));
- end;
- Report.Failed("Exception not propagated on loop #" &
- Integer'Image(i));
- exception
- when Exc : others =>
-
- -- Save each occurrence into a storage array for
- -- later processing.
-
- Save_Occurrence(Exception_Storage(i), Exc);
- end;
- end loop;
-
- end Inner_Block;
- end Outer_Block;
-
- -- Raise the exceptions from the stored occurrences, and handle.
-
- for i in 1..Exc_Number loop
- begin
- Reraise_Occurrence(Exception_Storage(i));
- Report.Failed("No exception reraised for " &
- "exception #" & Integer'Image(i));
- exception
- when Exc : others =>
- -- The following sequence of checks ensures that the
- -- correct occurrence was stored, and the associated
- -- exception was raised and handled in the proper order.
- if i = 1 then
- if Exception_1'Identity /= Exception_Identity(Exc) then
- Report.Failed("Exception_1 not raised");
- end if;
- elsif i = 2 then
- if Exception_2'Identity /= Exception_Identity(Exc) then
- Report.Failed("Exception_2 not raised");
- end if;
- elsif i = 3 then
- if Exception_3'Identity /= Exception_Identity(Exc) then
- Report.Failed("Exception_3 not raised");
- end if;
- end if;
-
- if Exception_Message(Exc) /= Messages(i) then
- Report.Failed("Incorrect message associated with " &
- "exception #" & Integer'Image(i));
- end if;
- end;
- end loop;
- exception
- when others =>
- Report.Failed("Unexpected exception in Store_And_Handle_Block");
- end Store_And_Handle_Block;
-
-
- Reraise_Out_Of_Scope:
- declare
-
- TC_Value : constant := 5;
- The_Exception : exception;
- Saved_Exc_Occ : Exception_Occurrence;
-
- procedure Handle_It (Exc_Occ : in Exception_Occurrence) is
- Must_Be_Raised : exception;
- begin
- if Exception_Identity(Exc_Occ) = The_Exception'Identity then
- raise Must_Be_Raised;
- Report.Failed("Exception Must_Be_Raised was not raised");
- else
- Report.Failed("Incorrect exception handled in " &
- "Procedure Handle_It");
- end if;
- end Handle_It;
-
- begin
-
- if Report.Ident_Int(5) = TC_Value then
- raise The_Exception;
- end if;
-
- exception
- when Exc : others =>
- Save_Occurrence (Saved_Exc_Occ, Exc);
- begin
- Handle_It(Saved_Exc_Occ); -- Raise another exception, in a
- exception -- different scope.
- when others => -- Handle this new exception.
- begin
- Reraise_Occurrence (Saved_Exc_Occ); -- Reraise the
- -- original excptn.
- Report.Failed("Saved Exception was not raised");
- exception
- when Exc_2 : others =>
- if Exception_Identity (Exc_2) /=
- The_Exception'Identity
- then
- Report.Failed
- ("Incorrect exception occurrence reraised");
- end if;
- end;
- end;
- end Reraise_Out_Of_Scope;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CB41003;
diff --git a/gcc/testsuite/ada/acats/tests/cb/cb41004.a b/gcc/testsuite/ada/acats/tests/cb/cb41004.a
deleted file mode 100644
index 09dfa9bfabc..00000000000
--- a/gcc/testsuite/ada/acats/tests/cb/cb41004.a
+++ /dev/null
@@ -1,316 +0,0 @@
--- CB41004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Raise_Exception and Reraise_Occurrence have no effect in
--- the case of Null_Id or Null_Occurrence. Check that Exception_Message,
--- Exception_Identity, Exception_Name, and Exception_Information raise
--- Constraint_Error for a Null_Occurrence input parameter.
--- Check that calling the Save_Occurrence subprograms with the
--- Null_Occurrence input parameter saves the Null_Occurrence to the
--- appropriate target object, and does not raise Constraint_Error.
--- Check that Null_Id is the default initial value of type Exception_Id.
---
--- TEST DESCRIPTION:
--- This test performs a series of calls to many of the subprograms
--- defined in package Ada.Exceptions, using either Null_Id or
--- Null_Occurrence (based on their parameter profile). In the cases of
--- Raise_Exception and Reraise_Occurrence, these null input values
--- should result in no exceptions being raised, and Constraint_Error
--- should not be raised in response to these calls. Test failure will
--- result if any exception is raised in these cases.
--- For the Save_Occurrence subprograms, calling them with the
--- Null_Occurrence input parameter does not raise Constraint_Error, but
--- simply results in the Null_Occurrence being saved into the appropriate
--- target (either a Exception_Occurrence out parameter, or as an
--- Exception_Occurrence_Access value).
--- In the cases of the other mentioned subprograms, calls performed with
--- a Null_Occurrence input parameter must result in Constraint_Error
--- being raised. This exception will be handled, with test failure the
--- result if the exception is not raised.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 08 Dec 00 RLB Removed Exception_Identity subtest, pending
--- resolution of AI95-00241.
--- Notes for future: Replace Exception_Identity
--- subtest with whatever the resolution is.
--- Add a subtest for Exception_Name(Null_Id), which
--- is missing from this test.
---!
-
-with Report;
-with Ada.Exceptions;
-
-procedure CB41004 is
-begin
-
- Report.Test ("CB41004", "Check that Null_Id and Null_Occurrence input " &
- "parameters have the appropriate effect when " &
- "used in calls of the subprograms found in " &
- "package Ada.Exceptions");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
-
- -- No initial values given for these two declarations; they default
- -- to Null_Id and Null_Occurrence respectively.
- A_Null_Exception_Id : Ada.Exceptions.Exception_Id;
- A_Null_Exception_Occurrence : Ada.Exceptions.Exception_Occurrence;
-
- TC_Flag : Boolean := False;
-
- begin
-
- -- Verify that Null_Id is the default initial value of type
- -- Exception_Id.
-
- if not (A_Null_Exception_Id = Ada.Exceptions.Null_Id) then
- Report.Failed("The default initial value of an object of type " &
- "Exception_Id was not Null_Id");
- end if;
-
-
- -- Verify that Raise_Exception has no effect in the case of Null_Id.
- begin
- Ada.Exceptions.Raise_Exception(A_Null_Exception_Id);
- TC_Flag := True;
- exception
- when others =>
- Report.Failed("Exception raised by procedure Raise_Exception " &
- "when called with a Null_Id input parameter");
- end;
-
- if not TC_Flag then
- Report.Failed("Incorrect processing following the call to " &
- "Raise_Exception with a Null_Id input parameter");
- end if;
- TC_Flag := False;
-
-
- -- Verify that Reraise_Occurrence has no effect in the case of
- -- Null_Occurrence.
- begin
- Ada.Exceptions.Reraise_Occurrence(A_Null_Exception_Occurrence);
- TC_Flag := True;
- exception
- when others =>
- Report.Failed
- ("Exception raised by procedure Reraise_Occurrence " &
- "when called with a Null_Occurrence input parameter");
- end;
-
- if not TC_Flag then
- Report.Failed("Incorrect processing following the call to " &
- "Reraise_Occurrence with a Null_Occurrence " &
- "input parameter");
- end if;
-
-
- -- Verify that function Exception_Message raises Constraint_Error for
- -- a Null_Occurrence input parameter.
- begin
- declare
- Msg : constant String :=
- Ada.Exceptions.Exception_Message(A_Null_Exception_Occurrence);
- begin
- Report.Failed
- ("Constraint_Error not raised by Function Exception_Message " &
- "when called with a Null_Occurrence input parameter");
- end;
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Unexpected exception raised by Function Exception_Message " &
- "when called with a Null_Occurrence input parameter");
- end;
-
-
--- -- Verify that function Exception_Identity raises Constraint_Error for
--- -- a Null_Occurrence input parameter.
--- -- Note: (RLB, 2000/12/08) This behavior may be modified by AI-00241.
--- -- As such, this test case has been removed pending a resolution.
--- begin
--- declare
--- Id : Ada.Exceptions.Exception_Id :=
--- Ada.Exceptions.Exception_Identity(A_Null_Exception_Occurrence);
--- begin
--- Report.Failed
--- ("Constraint_Error not raised by Function Exception_Identity " &
--- "when called with a Null_Occurrence input parameter");
--- end;
--- exception
--- when Constraint_Error => null; -- OK, expected exception.
--- when others =>
--- Report.Failed
--- ("Unexpected exception raised by Function Exception_Identity " &
--- "when called with a Null_Occurrence input parameter");
--- end;
-
-
- -- Verify that function Exception_Name raises Constraint_Error for
- -- a Null_Occurrence input parameter.
- begin
- declare
- Name : constant String :=
- Ada.Exceptions.Exception_Name(A_Null_Exception_Occurrence);
- begin
- Report.Failed
- ("Constraint_Error not raised by Function Exception_Name " &
- "when called with a Null_Occurrence input parameter");
- end;
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Unexpected exception raised by Function Exception_Null " &
- "when called with a Null_Occurrence input parameter");
- end;
-
-
- -- Verify that function Exception_Information raises Constraint_Error
- -- for a Null_Occurrence input parameter.
- begin
- declare
- Info : constant String :=
- Ada.Exceptions.Exception_Information
- (A_Null_Exception_Occurrence);
- begin
- Report.Failed
- ("Constraint_Error not raised by Function " &
- "Exception_Information when called with a " &
- "Null_Occurrence input parameter");
- end;
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Unexpected exception raised by Function Exception_Null " &
- "when called with a Null_Occurrence input parameter");
- end;
-
-
- -- Verify that calling the Save_Occurrence procedure with a
- -- Null_Occurrence input parameter saves the Null_Occurrence to the
- -- target object, and does not raise Constraint_Error.
- declare
- use Ada.Exceptions;
- Saved_Occurrence : Exception_Occurrence;
- begin
-
- -- Initialize the Saved_Occurrence variable with a value other than
- -- Null_Occurrence (default).
- begin
- raise Program_Error;
- exception
- when Exc : others => Save_Occurrence(Saved_Occurrence, Exc);
- end;
-
- -- Save a Null_Occurrence input parameter.
- begin
- Save_Occurrence(Target => Saved_Occurrence,
- Source => Ada.Exceptions.Null_Occurrence);
- exception
- when others =>
- Report.Failed
- ("Unexpected exception raised by procedure " &
- "Save_Occurrence when called with a Null_Occurrence " &
- "input parameter");
- end;
-
- -- Verify that the occurrence that was saved above is a
- -- Null_Occurrence value.
-
- begin
- Reraise_Occurrence(Saved_Occurrence);
- exception
- when others =>
- Report.Failed("Value saved from Procedure Save_Occurrence " &
- "resulted in an exception, i.e., was not a " &
- "value of Null_Occurrence");
- end;
-
- exception
- when others =>
- Report.Failed("Unexpected exception raised during evaluation " &
- "of Procedure Save_Occurrence");
- end;
-
-
- -- Verify that calling the Save_Occurrence function with a
- -- Null_Occurrence input parameter returns the Null_Occurrence as the
- -- function result, and does not raise Constraint_Error.
- declare
- Occurrence_Ptr : Ada.Exceptions.Exception_Occurrence_Access;
- begin
- -- Save a Null_Occurrence input parameter.
- begin
- Occurrence_Ptr :=
- Ada.Exceptions.Save_Occurrence(Ada.Exceptions.Null_Occurrence);
- exception
- when others =>
- Report.Failed
- ("Unexpected exception raised by function " &
- "Save_Occurrence when called with a Null_Occurrence " &
- "input parameter");
- end;
-
- -- Verify that the occurrence that was saved above is a
- -- Null_Occurrence value.
-
- begin
- -- Dereferenced value of type Exception_Occurrence_Access
- -- should be a Null_Occurrence value, based on the action
- -- of Function Save_Occurrence above. Providing this as an
- -- input parameter to Reraise_Exception should not result in
- -- any exception being raised.
-
- Ada.Exceptions.Reraise_Occurrence(Occurrence_Ptr.all);
-
- exception
- when others =>
- Report.Failed("Value saved from Function Save_Occurrence " &
- "resulted in an exception, i.e., was not a " &
- "value of Null_Occurrence");
- end;
- exception
- when others =>
- Report.Failed("Unexpected exception raised during evaluation " &
- "of Function Save_Occurrence");
- end;
-
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CB41004;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc30001.a b/gcc/testsuite/ada/acats/tests/cc/cc30001.a
deleted file mode 100644
index 69010e421fa..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc30001.a
+++ /dev/null
@@ -1,219 +0,0 @@
--- CC30001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if a non-overriding primitive subprogram is declared for
--- a type derived from a formal derived tagged type, the copy of that
--- subprogram in an instance can override a subprogram inherited from the
--- actual type.
---
--- TEST DESCRIPTION:
--- User writes program to handle both mail messages and system messages.
---
--- Mail messages are created by instantiating a generic "mail" package
--- with a root message type. System messages are created by
--- instantiating the generic with a system message type derived from the
--- root in a separate package. The system message type has a primitive
--- subprogram called Send.
---
--- Inside the generic, a "mail" type is derived from the generic formal
--- derived type, and a "Send" operation is declared.
---
--- Declare a root tagged type T. Declare a generic package with a formal
--- derived type using the root tagged type as ancestor. In the generic,
--- derive a type from the formal derived type and declare a primitive
--- subprogram for it. In a separate package, declare a derivative DT of
--- the root tagged type T and declare a primitive subprogram which is
--- type conformant with (and hence, overridable for) the primitive
--- declared in the generic. Instantiate the generic for DT. Make both
--- dispatching and non-dispatching calls to the primitive subprogram. In
--- both cases the version of the subprogram in the instance should be
--- called (since it overrides the implementation inherited from the
--- actual).
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 13 Apr 95 SAIC Replaced call involving instance for root tagged
--- type with a dispatching call involving instance
--- for derived type. Updated commentary. Moved
--- instantiations (and related commentary) to
--- library-level to avoid accessibility violation.
--- Commented out instantiation for root tagged type.
--- 27 Feb 97 PWB.CTA Added elaboration pragma.
---!
-
-package CC30001_0 is -- Root message type.
-
- type Msg_Type is tagged record
- Text : String (1 .. 20);
- Message_Sent : Boolean;
- end record;
-
-end CC30001_0;
-
-
- --==================================================================--
-
-
-with CC30001_0; -- Root message type.
-generic -- Generic "mail" package.
- type Message is new CC30001_0.Msg_Type with private;
-package CC30001_1 is
-
- type Mail_Type is new Message with record -- Derived from formal type.
- To : String (1 .. 8);
- end record;
-
- procedure Send (M : in out Mail_Type); -- For this test, this version
- -- of Send should be called in
- -- ... Other operations. -- all cases.
-
-end CC30001_1;
-
-
- --==================================================================--
-
-
-package body CC30001_1 is
-
- procedure Send (M : in out Mail_Type) is
- begin
- -- ... Code to send message omitted for brevity.
- M.Message_Sent := True;
- end Send;
-
-end CC30001_1;
-
-
- --==================================================================--
-
-
-with CC30001_0; -- Root message type.
-package CC30001_2 is -- System message type and operations.
-
- type Signal_Type is (Note, Warning, Error);
-
- type Sys_Message is new CC30001_0.Msg_Type with record -- Derived from
- Signal : Signal_Type := Warning; -- root type.
- end record;
-
- procedure Send (Item : in out Sys_Message); -- For this test, this version
- -- of Send should never be
- -- ... Other operations. -- called (it will have been
- -- overridden).
-end CC30001_2;
-
-
- --==================================================================--
-
-
-package body CC30001_2 is
-
- procedure Send (Item : in out Sys_Message) is
- begin
- -- ... Code to send message omitted for brevity.
- Item.Message_Sent := False; -- Ensure this procedure gives a different
- end Send; -- result than CC30001_1.Send.
-
-end CC30001_2;
-
-
- --==================================================================--
-
-
--- User first sets up support for mail messages by instantiating the
--- generic mail package for the root message type. An operation "Send" is
--- declared for the mail message type in the instance.
---
--- with CC30001_0; -- Root message type.
--- with CC30001_1; -- Generic "mail" package.
--- package Mail_Messages is new CC30001_1 (CC30001_0.Msg_Type);
-
-
- --==================================================================--
-
-
--- Next, the user sets up support for system messages by instantiating the
--- generic mail package with the system message type. An operation "Send"
--- is declared for the "system" mail message type in the instance. This
--- operation overrides the "Send" operation inherited from the system
--- message type actual (a situation the user may not have intended).
-
-with CC30001_1; -- Generic "mail" package.
-with CC30001_2; -- System message type and operations.
-pragma Elaborate (CC30001_1);
-package CC30001_3 is new CC30001_1 (CC30001_2.Sys_Message);
-
-
- --==================================================================--
-
-with CC30001_2; -- System message type and operations.
-with CC30001_3; -- Instance with mail type and operations.
-
-with Report;
-procedure CC30001 is
-
- package System_Messages renames CC30001_3;
-
-
- Sys_Msg1 : System_Messages.Mail_Type := (Text => "System shutting down",
- Signal => CC30001_2.Warning,
- To => "AllUsers",
- Message_Sent => False);
-
- Sys_Msg2 : System_Messages.Mail_Type'Class := Sys_Msg1;
-
-
- use System_Messages, CC30001_2; -- All versions of "Send"
- -- directly visible.
-
-begin
-
- Report.Test ("CC30001", "Check that if a non-overriding primitive " &
- "subprogram is declared for a type derived from a formal " &
- "derived tagged type, the copy of that subprogram in an " &
- "instance can override a subprogram inherited from the " &
- "actual type");
-
-
- Send (Sys_Msg1); -- Calls version declared in instance (version declared
- -- in CC30001_2 has been overridden).
-
- if not Sys_Msg1.Message_Sent then
- Report.Failed ("Non-dispatching call: instance operation not called");
- end if;
-
-
- Send (Sys_Msg2); -- Calls version declared in instance (version declared
- -- in CC30001_2 has been overridden).
-
- if not Sys_Msg2.Message_Sent then
- Report.Failed ("Dispatching call: instance operation not called");
- end if;
-
-
- Report.Result;
-end CC30001;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc30002.a b/gcc/testsuite/ada/acats/tests/cc/cc30002.a
deleted file mode 100644
index 5132f8cae90..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc30002.a
+++ /dev/null
@@ -1,349 +0,0 @@
--- CC30002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an explicit declaration in the private part of an instance
--- does not override an implicit declaration in the instance, unless the
--- corresponding explicit declaration in the generic overrides a
--- corresponding implicit declaration in the generic. Check for primitive
--- subprograms of tagged types.
---
--- TEST DESCRIPTION:
--- Consider the following:
---
--- type Ancestor is tagged null record;
--- procedure R (X: in Ancestor);
---
--- generic
--- type Formal is new Ancestor with private;
--- package G is
--- type T is new Formal with null record;
--- -- Implicit procedure R (X: in T);
--- procedure P (X: in T); -- (1)
--- private
--- procedure Q (X: in T); -- (2)
--- procedure R (X: in T); -- (3) Overrides implicit R in generic.
--- end G;
---
--- type Actual is new Ancestor with null record;
--- procedure P (X: in Actual);
--- procedure Q (X: in Actual);
--- procedure R (X: in Actual);
---
--- package Instance is new G (Formal => Actual);
---
--- In the instance, the copy of P at (1) overrides Actual's P, since it
--- is declared in the visible part of the instance. The copy of Q at (2)
--- does not override anything. The copy of R at (3) overrides Actual's
--- R, even though it is declared in the private part, because within
--- the generic the explicit declaration of R overrides an implicit
--- declaration.
---
--- Thus, for calls involving a parameter with tag T:
--- - Calls to P will execute the body declared for T.
--- - Calls to Q from within Instance will execute the body declared
--- for T.
--- - Calls to Q from outside Instance will execute the body declared
--- for Actual.
--- - Calls to R will execute the body declared for T.
---
--- Verify this behavior for both dispatching and nondispatching calls to
--- Q and R.
---
---
--- CHANGE HISTORY:
--- 24 Feb 95 SAIC Initial prerelease version.
---
---!
-
-package CC30002_0 is
-
- type TC_Body_Kind is (Body_Of_Ancestor, Body_In_Instance,
- Body_Of_Actual, Initial_Value);
-
- type Camera is tagged record
- -- ... Camera components.
- TC_Focus_Called : TC_Body_Kind := Initial_Value;
- TC_Shutter_Called : TC_Body_Kind := Initial_Value;
- end record;
-
- procedure Focus (C: in out Camera);
-
- -- ...Other operations.
-
-end CC30002_0;
-
-
- --==================================================================--
-
-
-package body CC30002_0 is
-
- procedure Focus (C: in out Camera) is
- begin
- -- Artificial for testing purposes.
- C.TC_Focus_Called := Body_Of_Ancestor;
- end Focus;
-
-end CC30002_0;
-
-
- --==================================================================--
-
-
-with CC30002_0;
-use CC30002_0;
-generic
- type Camera_Type is new CC30002_0.Camera with private;
-package CC30002_1 is
-
- type Speed_Camera is new Camera_Type with record
- Diag_Code: Positive;
- -- ...Other components.
- end record;
-
- -- Implicit procedure Focus (C: in out Speed_Camera) declared in generic.
- procedure Self_Test_NonDisp (C: in out Speed_Camera);
- procedure Self_Test_Disp (C: in out Speed_Camera'Class);
-
-private
-
- -- The following explicit declaration of Set_Shutter_Speed does NOT override
- -- a corresponding implicit declaration in the generic. Therefore, its copy
- -- does NOT override the implicit declaration (inherited from the actual)
- -- in the instance.
-
- procedure Set_Shutter_Speed (C: in out Speed_Camera);
-
- -- The following explicit declaration of Focus DOES override a
- -- corresponding implicit declaration (inherited from the parent) in the
- -- generic. Therefore, its copy overrides the implicit declaration
- -- (inherited from the actual) in the instance.
-
- procedure Focus (C: in out Speed_Camera); -- Overrides implicit Focus
- -- in generic.
-end CC30002_1;
-
-
- --==================================================================--
-
-
-package body CC30002_1 is
-
- procedure Self_Test_NonDisp (C: in out Speed_Camera) is
- begin
- -- Nondispatching calls:
- Focus (C);
- Set_Shutter_Speed (C);
- end Self_Test_NonDisp;
-
- procedure Self_Test_Disp (C: in out Speed_Camera'Class) is
- begin
- -- Dispatching calls:
- Focus (C);
- Set_Shutter_Speed (C);
- end Self_Test_Disp;
-
- procedure Set_Shutter_Speed (C: in out Speed_Camera) is
- begin
- -- Artificial for testing purposes.
- C.TC_Shutter_Called := Body_In_Instance;
- end Set_Shutter_Speed;
-
- procedure Focus (C: in out Speed_Camera) is
- begin
- -- Artificial for testing purposes.
- C.TC_Focus_Called := Body_In_Instance;
- end Focus;
-
-end CC30002_1;
-
-
- --==================================================================--
-
-
-with CC30002_0;
-package CC30002_2 is
-
- type Aperture_Camera is new CC30002_0.Camera with record
- FStop: Natural;
- -- ...Other components.
- end record;
-
- procedure Set_Shutter_Speed (C: in out Aperture_Camera);
- procedure Focus (C: in out Aperture_Camera);
-
-end CC30002_2;
-
-
- --==================================================================--
-
-
-package body CC30002_2 is
-
- procedure Set_Shutter_Speed (C: in out Aperture_Camera) is
- use CC30002_0;
- begin
- -- Artificial for testing purposes.
- C.TC_Shutter_Called := Body_Of_Actual;
- end Set_Shutter_Speed;
-
- procedure Focus (C: in out Aperture_Camera) is
- use CC30002_0;
- begin
- -- Artificial for testing purposes.
- C.TC_Focus_Called := Body_Of_Actual;
- end Focus;
-
-end CC30002_2;
-
-
- --==================================================================--
-
-
--- Instance declaration.
-
-with CC30002_1;
-with CC30002_2;
-package CC30002_3 is new CC30002_1 (Camera_Type => CC30002_2.Aperture_Camera);
-
-
- --==================================================================--
-
-
-with CC30002_0;
-with CC30002_1;
-with CC30002_2;
-with CC30002_3; -- Instance.
-
-with Report;
-procedure CC30002 is
-
- package Speed_Cameras renames CC30002_3;
-
- use CC30002_0;
-
- TC_Camera1: Speed_Cameras.Speed_Camera;
- TC_Camera2: Speed_Cameras.Speed_Camera'Class := TC_Camera1;
- TC_Camera3: Speed_Cameras.Speed_Camera;
- TC_Camera4: Speed_Cameras.Speed_Camera;
-
-begin
- Report.Test ("CC30002", "Check that an explicit declaration in the " &
- "private part of an instance does not override an implicit " &
- "declaration in the instance, unless the corresponding " &
- "explicit declaration in the generic overrides a " &
- "corresponding implicit declaration in the generic. Check " &
- "for primitive subprograms of tagged types");
-
---
--- Check non-dispatching calls outside instance:
---
-
- -- Non-overriding primitive operation:
-
- Speed_Cameras.Set_Shutter_Speed (TC_Camera1);
- if TC_Camera1.TC_Shutter_Called /= Body_Of_Actual then
- Report.Failed ("Wrong body executed: non-dispatching call to " &
- "Set_Shutter_Speed outside instance");
- end if;
-
-
- -- Overriding primitive operation:
-
- Speed_Cameras.Focus (TC_Camera1);
- if TC_Camera1.TC_Focus_Called /= Body_In_Instance then
- Report.Failed ("Wrong body executed: non-dispatching call to " &
- "Focus outside instance");
- end if;
-
-
---
--- Check dispatching calls outside instance:
---
-
- -- Non-overriding primitive operation:
-
- Speed_Cameras.Set_Shutter_Speed (TC_Camera2);
- if TC_Camera2.TC_Shutter_Called /= Body_Of_Actual then
- Report.Failed ("Wrong body executed: dispatching call to " &
- "Set_Shutter_Speed outside instance");
- end if;
-
-
- -- Overriding primitive operation:
-
- Speed_Cameras.Focus (TC_Camera2);
- if TC_Camera2.TC_Focus_Called /= Body_In_Instance then
- Report.Failed ("Wrong body executed: dispatching call to " &
- "Focus outside instance");
- end if;
-
-
-
---
--- Check non-dispatching calls within instance:
---
-
- Speed_Cameras.Self_Test_NonDisp (TC_Camera3);
-
- -- Non-overriding primitive operation:
-
- if TC_Camera3.TC_Shutter_Called /= Body_In_Instance then
- Report.Failed ("Wrong body executed: non-dispatching call to " &
- "Set_Shutter_Speed inside instance");
- end if;
-
- -- Overriding primitive operation:
-
- if TC_Camera3.TC_Focus_Called /= Body_In_Instance then
- Report.Failed ("Wrong body executed: non-dispatching call to " &
- "Focus inside instance");
- end if;
-
-
-
---
--- Check dispatching calls within instance:
---
-
- Speed_Cameras.Self_Test_Disp (TC_Camera4);
-
- -- Non-overriding primitive operation:
-
- if TC_Camera4.TC_Shutter_Called /= Body_In_Instance then
- Report.Failed ("Wrong body executed: dispatching call to " &
- "Set_Shutter_Speed inside instance");
- end if;
-
- -- Overriding primitive operation:
-
- if TC_Camera4.TC_Focus_Called /= Body_In_Instance then
- Report.Failed ("Wrong body executed: dispatching call to " &
- "Focus inside instance");
- end if;
-
- Report.Result;
-end CC30002;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc40001.a b/gcc/testsuite/ada/acats/tests/cc/cc40001.a
deleted file mode 100644
index bf42470e65b..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc40001.a
+++ /dev/null
@@ -1,403 +0,0 @@
--- CC40001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that adjust is called on the value of a constant object created
--- by the evaluation of a generic association for a formal object of
--- mode in.
---
--- Check that those values are also subsequently finalized.
---
--- TEST DESCRIPTION:
--- Create a backdrop of a controlled type sufficient to check that the
--- correct operations get called at appropriate times. Create a generic
--- unit that takes a formal parameter of a formal type. Create instances
--- of this generic using various "levels" of the controlled type. Check
--- the same case for a generic child unit.
---
--- The cases tested are where the type of the formal object is:
--- a visible classwide type : CC40001_2
--- a formal private type : CC40001_3
--- a formal tagged type : CC40001_4
---
--- To more fully take advantage of the features of the language, and
--- present a test which is "user oriented" this test utilizes multiple
--- aspects of the language in combination. Using Ada.Strings.Unbounded
--- in combination with Ada.Finalization and Ada.Calendar to build layers
--- of an object oriented system will likely be very common in actual
--- practice. A common paradigm in the language will also be the use of
--- a parent package defining "basic" tagged types, and child packages
--- will expand on those types via derivation. The model used in this
--- test is a simple type containing a character identity (used in the
--- identity). The next level of type add a timestamp. Further levels
--- might add location information, etc. however for the purposes of this
--- test we stop at the second layer, as it is sufficient to test the
--- stated objective.
---
---
--- CHANGE HISTORY:
--- 06 FEB 96 SAIC Initial version
--- 30 APR 96 SAIC Added finalization checks for 2.1
--- 13 FEB 97 PWB.CTA Moved global objects into bodies, after Initialize
--- body is elaborated; counted finalizations correctly.
---!
-
------------------------------------------------------------------ CC40001_0
-
-with Ada.Finalization;
-with Ada.Strings.Unbounded;
-package CC40001_0 is
-
- type States is ( Erroneous, Defaulted, Initialized, Reset, Adjusted );
-
- type Simple_Object(ID: Character) is
- new Ada.Finalization.Controlled with
- record
- TC_Current_State : States := Defaulted;
- Name : Ada.Strings.Unbounded.Unbounded_String;
- end record;
-
- procedure User_Operation( COB: in out Simple_Object; Name : String );
- procedure Initialize( COB: in out Simple_Object );
- procedure Adjust ( COB: in out Simple_Object );
- procedure Finalize ( COB: in out Simple_Object );
-
- Finalization_Count : Natural;
-
-end CC40001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-with TCTouch;
-package body CC40001_0 is
-
- procedure User_Operation( COB: in out Simple_Object; Name : String ) is
- begin
- COB.Name := Ada.Strings.Unbounded.To_Unbounded_String(Name);
- end User_Operation;
-
- procedure Initialize( COB: in out Simple_Object ) is
- begin
- COB.TC_Current_State := Initialized;
- end Initialize;
-
- procedure Adjust ( COB: in out Simple_Object ) is
- begin
- COB.TC_Current_State := Adjusted;
- TCTouch.Touch('A'); -------------------------------------------------- A
- TCTouch.Touch(COB.ID); ------------------------------------------------ ID
- -- note that the calls to touch will not be directly validated, it is
- -- expected that some number > 0 of calls will be made to this procedure,
- -- the subtests then clear (Flush) the Touch buffer and perform actions
- -- where an incorrect implementation might call this procedure. Such a
- -- call will fail on the attempt to "Validate" the null string.
- end Adjust;
-
- procedure Finalize ( COB: in out Simple_Object ) is
- begin
- COB.TC_Current_State := Erroneous;
- Finalization_Count := Finalization_Count +1;
- end Finalize;
-
- TC_Global_Object : Simple_Object('G');
-
-end CC40001_0;
-
------------------------------------------------------------------ CC40001_1
-
-with Ada.Calendar;
-package CC40001_0.CC40001_1 is
-
- type Object_In_Time(ID: Character) is
- new Simple_Object(ID) with
- record
- Birth : Ada.Calendar.Time;
- Activity : Ada.Calendar.Time;
- end record;
-
- procedure User_Operation( COB: in out Object_In_Time;
- Name: String );
-
- procedure Initialize( COB: in out Object_In_Time );
- procedure Adjust ( COB: in out Object_In_Time );
- procedure Finalize ( COB: in out Object_In_Time );
-
-end CC40001_0.CC40001_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-with TCTouch;
-package body CC40001_0.CC40001_1 is
-
- procedure Initialize( COB: in out Object_In_Time ) is
- begin
- COB.TC_Current_State := Initialized;
- COB.Birth := Ada.Calendar.Clock;
- end Initialize;
-
- procedure Adjust ( COB: in out Object_In_Time ) is
- begin
- COB.TC_Current_State := Adjusted;
- TCTouch.Touch('a'); ------------------------------------------------ a
- TCTouch.Touch(COB.ID); ------------------------------------------------ ID
- end Adjust;
-
- procedure Finalize ( COB: in out Object_In_Time ) is
- begin
- COB.TC_Current_State := Erroneous;
- Finalization_Count := Finalization_Count +1;
- end Finalize;
-
- procedure User_Operation( COB: in out Object_In_Time;
- Name: String ) is
- begin
- CC40001_0.User_Operation( Simple_Object(COB), Name );
- COB.Activity := Ada.Calendar.Clock;
- COB.TC_Current_State := Reset;
- end User_Operation;
-
- TC_Time_Object : Object_In_Time('g');
-
-end CC40001_0.CC40001_1;
-
------------------------------------------------------------------ CC40001_2
-
-generic
- TC_Check_Object : in CC40001_0.Simple_Object'Class;
-package CC40001_0.CC40001_2 is
- procedure TC_Verify_State;
-end CC40001_0.CC40001_2;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body CC40001_0.CC40001_2 is
-
- procedure TC_Verify_State is
- begin
- if TC_Check_Object.TC_Current_State /= Adjusted then
- Report.Failed( "CC40001_2 : Formal Object not adjusted" );
- end if;
- end TC_Verify_State;
-
-end CC40001_0.CC40001_2;
-
------------------------------------------------------------------ CC40001_3
-
-generic
- type Formal_Private(<>) is private;
- TC_Check_Object : in Formal_Private;
- with function Bad_Status( O: Formal_Private ) return Boolean;
-package CC40001_0.CC40001_3 is
- procedure TC_Verify_State;
-end CC40001_0.CC40001_3;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body CC40001_0.CC40001_3 is
-
- procedure TC_Verify_State is
- begin
- if Bad_Status( TC_Check_Object ) then
- Report.Failed( "CC40001_3 : Formal Object not adjusted" );
- end if;
- end TC_Verify_State;
-
-end CC40001_0.CC40001_3;
-
------------------------------------------------------------------ CC40001_4
-
-generic
- type Formal_Tagged_Private(<>) is tagged private;
- TC_Check_Object : in Formal_Tagged_Private;
- with function Bad_Status( O: Formal_Tagged_Private ) return Boolean;
-package CC40001_0.CC40001_4 is
- procedure TC_Verify_State;
-end CC40001_0.CC40001_4;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body CC40001_0.CC40001_4 is
-
- procedure TC_Verify_State is
- begin
- if Bad_Status( TC_Check_Object ) then
- Report.Failed( "CC40001_4 : Formal Object not adjusted" );
- end if;
- end TC_Verify_State;
-
-end CC40001_0.CC40001_4;
-
-------------------------------------------------------------------- CC40001
-
-with Report;
-with TCTouch;
-with CC40001_0.CC40001_1;
-with CC40001_0.CC40001_2;
-with CC40001_0.CC40001_3;
-with CC40001_0.CC40001_4;
-procedure CC40001 is
-
- function Not_Adjusted( CO : CC40001_0.Simple_Object )
- return Boolean is
- use type CC40001_0.States;
- begin
- return CO.TC_Current_State /= CC40001_0.Adjusted;
- end Not_Adjusted;
-
- function Not_Adjusted( CO : CC40001_0.CC40001_1.Object_In_Time )
- return Boolean is
- use type CC40001_0.States;
- begin
- return CO.TC_Current_State /= CC40001_0.Adjusted;
- end Not_Adjusted;
-
- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Subtest 1
-
- procedure Subtest_1 is
- Object_0 : CC40001_0.Simple_Object('T');
- Object_1 : CC40001_0.CC40001_1.Object_In_Time('t');
-
- package Subtest_1_1 is
- new CC40001_0.CC40001_2( Object_0 ); -- classwide generic formal object
-
- package Subtest_1_2 is
- new CC40001_0.CC40001_2( Object_1 ); -- classwide generic formal object
- begin
- TCTouch.Flush; -- clear out all "A" and "T" entries, no further calls
- -- to Touch should occur before the call to Validate
-
- -- set the objects TC_Current_State to "Reset"
- CC40001_0.User_Operation( Object_0, "Subtest 1" );
- CC40001_0.CC40001_1.User_Operation( Object_1, "Subtest 1" );
-
- -- check that the objects TC_Current_State is "Adjusted"
- Subtest_1_1.TC_Verify_State;
- Subtest_1_2.TC_Verify_State;
-
- TCTouch.Validate( "", "No actions should occur here, subtest 1" );
-
- end Subtest_1;
-
- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Subtest 2
-
- procedure Subtest_2 is
- Object_0 : CC40001_0.Simple_Object('T');
- Object_1 : CC40001_0.CC40001_1.Object_In_Time('t');
-
- package Subtest_2_1 is -- generic formal object is discriminated private
- new CC40001_0.CC40001_3( CC40001_0.Simple_Object,
- Object_0,
- Not_Adjusted );
-
- package Subtest_2_2 is -- generic formal object is discriminated private
- new CC40001_0.CC40001_3( CC40001_0.CC40001_1.Object_In_Time,
- Object_1,
- Not_Adjusted );
-
- begin
- TCTouch.Flush; -- clear out all "A" and "T" entries
-
- -- set the objects state to "Reset"
- CC40001_0.User_Operation( Object_0, "Subtest 2" );
- CC40001_0.CC40001_1.User_Operation( Object_1, "Subtest 2" );
-
- Subtest_2_1.TC_Verify_State;
- Subtest_2_2.TC_Verify_State;
-
- TCTouch.Validate( "", "No actions should occur here, subtest 2" );
-
- end Subtest_2;
-
- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Subtest 3
-
- procedure Subtest_3 is
- Object_0 : CC40001_0.Simple_Object('T');
- Object_1 : CC40001_0.CC40001_1.Object_In_Time('t');
-
- package Subtest_3_1 is -- generic formal object is discriminated tagged
- new CC40001_0.CC40001_4( CC40001_0.Simple_Object,
- Object_0,
- Not_Adjusted );
-
- package Subtest_3_2 is -- generic formal object is discriminated tagged
- new CC40001_0.CC40001_4( CC40001_0.CC40001_1.Object_In_Time,
- Object_1,
- Not_Adjusted );
- begin
- TCTouch.Flush; -- clear out all "A" and "T" entries
-
- -- set the objects state to "Reset"
- CC40001_0.User_Operation( Object_0, "Subtest 3" );
- CC40001_0.CC40001_1.User_Operation( Object_1, "Subtest 3" );
-
- Subtest_3_1.TC_Verify_State;
- Subtest_3_2.TC_Verify_State;
-
- TCTouch.Validate( "", "No actions should occur here, subtest 3" );
-
- end Subtest_3;
-
-begin -- Main test procedure.
-
- Report.Test ("CC40001", "Check that adjust and finalize are called on " &
- "the constant object created by the " &
- "evaluation of a generic association for a " &
- "formal object of mode in" );
-
- -- check that the created constant objects are properly adjusted
- -- and subsequently finalized
-
- CC40001_0.Finalization_Count := 0;
-
- Subtest_1;
-
- if CC40001_0.Finalization_Count < 4 then
- Report.Failed("Insufficient Finalizations for Subtest 1");
- end if;
-
- CC40001_0.Finalization_Count := 0;
-
- Subtest_2;
-
- if CC40001_0.Finalization_Count < 4 then
- Report.Failed("Insufficient Finalizations for Subtest 2");
- end if;
-
- CC40001_0.Finalization_Count := 0;
-
- Subtest_3;
-
- if CC40001_0.Finalization_Count < 4 then
- Report.Failed("Insufficient Finalizations for Subtest 3");
- end if;
-
- Report.Result;
-
-end CC40001;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc50001.a b/gcc/testsuite/ada/acats/tests/cc/cc50001.a
deleted file mode 100644
index 32a1afeb38c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc50001.a
+++ /dev/null
@@ -1,257 +0,0 @@
--- CC50001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, in an instance, each implicit declaration of a predefined
--- operator of a formal tagged private type declares a view of the
--- corresponding predefined operator of the actual type (even if the
--- operator has been overridden for the actual type). Check that the
--- body executed is determined by the type and tag of the operands.
---
--- TEST DESCRIPTION:
--- The formal tagged private type has an unknown discriminant part, and
--- is thus indefinite. This allows both definite and indefinite types
--- to be passed as actuals. For tagged types, definite implies
--- nondiscriminated, and indefinite implies discriminated (with known
--- or unknown discriminants).
---
--- Only nonlimited tagged types are tested, since equality operators
--- are not predefined for limited types.
---
--- A tagged type is passed as an actual to a generic formal tagged
--- private type. The tagged type overrides the predefined equality
--- operator. A subprogram within the generic calls the equality operator
--- of the formal type. In an instance, the equality operator denotes
--- a view of the predefined operator of the actual type, but the
--- call dispatches to the body of the overriding operator.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 21 Nov 95 SAIC ACVC 2.0.1 fixes: Corrected expected result on
--- calls to "=" within the instance. Modified
--- commentary.
---
---!
-
-package CC50001_0 is
-
- type Count_Type is tagged record -- Nondiscriminated
- Count : Integer := 0; -- tagged type.
- end record;
-
- function "="(Left, Right : Count_Type) -- User-defined
- return Boolean; -- equality operator.
-
-
- subtype Str_Len is Natural range 0 .. 100;
- subtype Stu_ID is String (1 .. 5);
- subtype Dept_ID is String (1 .. 4);
- subtype Emp_ID is String (1 .. 9);
- type Status is (Student, Faculty, Staff);
-
- type Person_Type (Stat : Status; -- Discriminated
- NameLen, AddrLen : Str_Len) is -- tagged type.
- tagged record
- Name : String (1 .. NameLen);
- Address : String (1 .. AddrLen);
- case Stat is
- when Student =>
- Student_ID : Stu_ID;
- when Faculty =>
- Department : Dept_ID;
- when Staff =>
- Employee_ID : Emp_ID;
- end case;
- end record;
-
- function "="(Left, Right : Person_Type) -- User-defined
- return Boolean; -- equality operator.
-
-
- -- Testing entities: ------------------------------------------------
-
- TC_Count_Item : constant Count_Type := (Count => 111);
-
- TC_Person_Item : constant Person_Type :=
- (Faculty, 18, 17, "Eccles, John Scott", "Popham House, Lee", "0931");
-
- ---------------------------------------------------------------------
-
-
-end CC50001_0;
-
-
- --===================================================================--
-
-
-package body CC50001_0 is
-
- function "="(Left, Right : Count_Type) return Boolean is
- begin
- return False; -- Return FALSE even if Left = Right.
- end "=";
-
-
- function "="(Left, Right : Person_Type) return Boolean is
- begin
- return False; -- Return FALSE even if Left = Right.
- end "=";
-
-end CC50001_0;
-
-
- --===================================================================--
-
-
-with CC50001_0; -- Tagged (actual) type declarations.
-generic -- Generic stack abstraction.
-
- type Item (<>) is tagged private; -- Formal tagged private type.
-
-package CC50001_1 is
-
- -- Simulate a generic stack abstraction. In a real application, the
- -- second operand of Push might be of type Stack, and type Stack
- -- would have at least one component (pointing to the top stack item).
-
- type Stack is private;
-
- procedure Push (I : in Item; TC_Check : out Boolean);
-
- -- ... Other stack operations.
-
-private
-
- -- ... Stack and ancillary type declarations.
-
- type Stack is record -- Artificial.
- null;
- end record;
-
-end CC50001_1;
-
-
- --===================================================================--
-
-
-package body CC50001_1 is
-
- -- For the sake of brevity, the implementation of Push is completely
- -- artificial; the goal is to model a call of the equality operator within
- -- the generic.
- --
- -- A real application might implement Push such that it does not add new
- -- items to the stack if they are identical to the top item; in that
- -- case, the equality operator would be called as part of an "if"
- -- condition.
-
- procedure Push (I : in Item; TC_Check : out Boolean) is
- begin
- TC_Check := not (I = I); -- Call user-defined "="; should
- -- return FALSE. Negation of
- -- result makes TC_Check TRUE.
- end Push;
-
-end CC50001_1;
-
-
- --==================================================================--
-
-
-with CC50001_0; -- Tagged (actual) type declarations.
-with CC50001_1; -- Generic stack abstraction.
-
-use CC50001_0; -- Overloaded "=" directly visible.
-
-with Report;
-procedure CC50001 is
-
- package Count_Stacks is new CC50001_1 (CC50001_0.Count_Type);
- package Person_Stacks is new CC50001_1 (CC50001_0.Person_Type);
-
- User_Defined_Op_Called : Boolean;
-
-begin
- Report.Test ("CC50001", "Check that, in an instance, each implicit " &
- "declaration of a primitive subprogram of a formal tagged " &
- "private type declares a view of the corresponding " &
- "predefined operator of the actual type (even if the " &
- "operator has been overridden or hidden for the actual type)");
-
---
--- Test which "=" is called inside generic:
---
-
- User_Defined_Op_Called := False;
-
- Count_Stacks.Push (CC50001_0.TC_Count_Item,
- User_Defined_Op_Called);
-
-
- if not User_Defined_Op_Called then
- Report.Failed ("User-defined ""="" not called inside generic for Count");
- end if;
-
-
- User_Defined_Op_Called := False;
-
- Person_Stacks.Push (CC50001_0.TC_Person_Item,
- User_Defined_Op_Called);
-
- if not User_Defined_Op_Called then
- Report.Failed ("User-defined ""="" not called inside generic " &
- "for Person");
- end if;
-
-
---
--- Test which "=" is called outside generic:
---
-
- User_Defined_Op_Called := False;
-
- User_Defined_Op_Called :=
- not (CC50001_0.TC_Count_Item = CC50001_0.TC_Count_Item);
-
- if not User_Defined_Op_Called then
- Report.Failed ("User-defined ""="" not called outside generic "&
- "for Count");
- end if;
-
-
- User_Defined_Op_Called := False;
-
- User_Defined_Op_Called :=
- not (CC50001_0.TC_Person_Item = CC50001_0.TC_Person_Item);
-
- if not User_Defined_Op_Called then
- Report.Failed ("User-defined ""="" not called outside generic "&
- "for Person");
- end if;
-
-
- Report.Result;
-end CC50001;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc50a01.a b/gcc/testsuite/ada/acats/tests/cc/cc50a01.a
deleted file mode 100644
index 4d5dfdfd50d..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc50a01.a
+++ /dev/null
@@ -1,313 +0,0 @@
--- CC50A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a formal parameter of a library-level generic unit may be
--- a formal tagged private type. Check that a nonlimited tagged type may
--- be passed as an actual. Check that if the formal type is indefinite,
--- both indefinite and definite types may be passed as actuals.
---
--- TEST DESCRIPTION:
--- The generic package declares a formal tagged private type (this can
--- be considered the parent "mixin" class). This type is extended in
--- the generic to provide support for stacks of items of any nonlimited
--- tagged type. Stacks are modeled as singly linked lists, with the list
--- nodes being objects of the extended type.
---
--- A generic testing procedure pushes items onto a stack, and pops them
--- back off, verifying the state of the stack at various points along the
--- way. The push and pop routines exercise functionality important to
--- tagged types, such as type conversion toward the root of the derivation
--- class and extension aggregates.
---
--- The formal tagged private type has an unknown discriminant part, and
--- is thus indefinite. This allows both definite and indefinite types
--- to be passed as actuals. For tagged types, definite implies
--- nondiscriminated, and indefinite implies discriminated (with known
--- or unknown discriminants).
---
--- TEST FILES:
--- This test consists of the following files:
---
--- FC50A00.A
--- -> CC50A01.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 21 Nov 95 SAIC ACVC 2.0.1 fixes: Moved instantiations of
--- BC50A01_0 to library level.
--- 11 Aug 96 SAIC ACVC 2.1: Updated prologue. Added pragma
--- Elaborate to context clauses for CC50A01_2 & _3.
---
---!
-
-with FC50A00; -- Tagged (actual) type declarations.
-generic -- Generic stack abstraction.
-
- type Item (<>) is tagged private; -- Formal tagged private type.
- TC_Default_Value : Item; -- Needed in View_Top (see
- -- below).
-package CC50A01_0 is
-
- type Stack is private;
-
--- Note that because the actual type corresponding to Item may be
--- unconstrained, the functions of removing the top item from the stack and
--- returning the value of the top item of the stack have been separated into
--- Pop and View_Top, respectively. This is necessary because otherwise the
--- returned value would have to be an out parameter of Pop, which would
--- require the user (in the unconstrained case) to create an uninitialized
--- unconstrained object to serve as the actual, which is illegal.
-
- procedure Push (I : in Item; S : in out Stack);
- procedure Pop (S : in out Stack);
- function View_Top (S : Stack) return Item;
-
- function Size_Of (S : Stack) return Natural;
-
-private
-
- type Stack_Item;
- type Stack_Ptr is access Stack_Item;
-
- type Stack_Item is new Item with record -- Extends formal type.
- Next : Stack_Ptr := null;
- end record;
-
- type Stack is record
- Top : Stack_Ptr := null;
- Size : Natural := 0;
- end record;
-
-end CC50A01_0;
-
-
- --==================================================================--
-
-
-package body CC50A01_0 is
-
- -- Link NewItem in at the top of the stack (the extension aggregate within
- -- the allocator initializes the inherited portion of NewItem to equal I,
- -- and NewItem.Next to point to what S.Top points to).
-
- procedure Push (I : in Item; S : in out Stack) is
- NewItem : Stack_Ptr;
- begin
- NewItem := new Stack_Item'(I with S.Top); -- Extension aggregate.
- S.Top := NewItem;
- S.Size := S.Size + 1;
- end Push;
-
-
- -- Remove item from top of stack. This procedure only updates the state of
- -- the stack; it does not return the value of the popped item. Hence, in
- -- order to accomplish a "true" pop, both View_Top and Pop must be called
- -- consecutively.
- --
- -- If the stack is empty, the Pop is ignored (for simplicity; in a true
- -- application this might be treated as an error condition).
-
- procedure Pop (S : in out Stack) is
- begin
- if S.Top = null then -- Stack is empty.
- null;
- -- Raise exception.
- else
- S.Top := S.Top.Next;
- S.Size := S.Size - 1;
- -- Deallocate discarded node.
- end if;
- end Pop;
-
-
- -- Return the value of the top item on the stack. This procedure only
- -- returns the value; it does not remove the top item from the stack.
- -- Hence, in order to accomplish a "true" pop, both View_Top and Pop must
- -- be called consecutively.
- --
- -- Since items on the stack are of a type (Stack_Item) derived from Item,
- -- which is a (tagged) private type, type conversion toward the root is the
- -- only way to get a value of type Item for return to the caller.
- --
- -- If the stack is empty, View_Top returns a pre-specified default value.
- -- (In a true application, an exception might be raised instead).
-
- function View_Top (S : Stack) return Item is
- begin
- if S.Top = null then -- Stack is empty.
- return TC_Default_Value; -- Testing artifice.
- -- Raise exception.
- else
- return Item(S.Top.all); -- Type conversion.
- end if;
- end View_Top;
-
-
- function Size_Of (S : Stack) return Natural is
- begin
- return (S.Size);
- end Size_Of;
-
-
-end CC50A01_0;
-
-
- --==================================================================--
-
-
--- The formal package Stacker below is needed to gain access to the
--- appropriate version of the "generic" type Stack. It is provided with an
--- explicit actual part in order to restrict the packages that can be passed
--- as actuals to those which have been instantiated with the same actuals
--- which this generic procedure has been instantiated with.
-
-with CC50A01_0; -- Generic stack abstraction.
-generic
- type Item_Type (<>) is tagged private; -- Formal tagged private type.
- Default : Item_Type;
- with package Stacker is new CC50A01_0 (Item_Type, Default);
-procedure CC50A01_1 (S : in out Stacker.Stack; I : in Item_Type);
-
-
- --==================================================================--
-
---
--- This generic procedure performs all of the testing of the
--- stack abstraction.
---
-
-with Report;
-procedure CC50A01_1 (S : in out Stacker.Stack; I : in Item_Type) is
-begin
- Stacker.Push (I, S); -- Push onto empty stack.
- Stacker.Push (I, S); -- Push onto nonempty stack.
-
- if Stacker.Size_Of (S) /= 2 then
- Report.Failed (" Wrong stack size after 2 Pushes");
- end if;
-
- -- Calls to View_Top must initialize a declared object of type Item_Type
- -- because the type may be unconstrained.
-
- declare
- Buffer1 : Item_Type := Stacker.View_Top (S);
- begin
- Stacker.Pop (S); -- Pop item off nonempty stack.
- if Buffer1 /= I then
- Report.Failed (" Wrong stack item value after 1st Pop");
- end if;
- end;
-
- declare
- Buffer2 : Item_Type := Stacker.View_Top (S);
- begin
- Stacker.Pop (S); -- Pop last item off stack.
- if Buffer2 /= I then
- Report.Failed (" Wrong stack item value after 2nd Pop");
- end if;
- end;
-
- if Stacker.Size_Of (S) /= 0 then
- Report.Failed (" Wrong stack size after 2 Pops");
- end if;
-
- declare
- Buffer3 : Item_Type := Stacker.View_Top (S);
- begin
- if Buffer3 /= Default then
- Report.Failed (" Wrong result after Pop of empty stack");
- end if;
- Stacker.Pop (S); -- Pop off empty stack.
- end;
-
-end CC50A01_1;
-
-
- --==================================================================--
-
-
-with FC50A00;
-
-with CC50A01_0;
-pragma Elaborate (CC50A01_0);
-
-package CC50A01_2 is new CC50A01_0 (FC50A00.Count_Type,
- FC50A00.TC_Default_Count);
-
-
- --==================================================================--
-
-
-with FC50A00;
-
-with CC50A01_0;
-pragma Elaborate (CC50A01_0);
-
-package CC50A01_3 is new CC50A01_0 (FC50A00.Person_Type,
- FC50A00.TC_Default_Person);
-
-
- --==================================================================--
-
-
-with FC50A00; -- Tagged (actual) type declarations.
-with CC50A01_0; -- Generic stack abstraction.
-with CC50A01_1; -- Generic stack testing procedure.
-with CC50A01_2;
-with CC50A01_3;
-
-with Report;
-procedure CC50A01 is
-
- package Count_Stacks renames CC50A01_2;
- package Person_Stacks renames CC50A01_3;
-
-
- procedure TC_Count_Test is new CC50A01_1 (FC50A00.Count_Type,
- FC50A00.TC_Default_Count,
- Count_Stacks);
- Count_Stack : Count_Stacks.Stack;
-
-
- procedure TC_Person_Test is new CC50A01_1 (FC50A00.Person_Type,
- FC50A00.TC_Default_Person,
- Person_Stacks);
- Person_Stack : Person_Stacks.Stack;
-
-begin
- Report.Test ("CC50A01", "Check that a formal parameter of a " &
- "library-level generic unit may be a formal tagged " &
- "private type");
-
- Report.Comment ("Testing definite tagged type..");
- TC_Count_Test (Count_Stack, FC50A00.TC_Count_Item);
-
- Report.Comment ("Testing indefinite tagged type..");
- TC_Person_Test (Person_Stack, FC50A00.TC_Person_Item);
-
- Report.Result;
-end CC50A01;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc50a02.a b/gcc/testsuite/ada/acats/tests/cc/cc50a02.a
deleted file mode 100644
index 6c2bf5fb0fd..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc50a02.a
+++ /dev/null
@@ -1,227 +0,0 @@
--- CC50A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a nonlimited tagged type may be passed as an actual to a
--- formal (non-tagged) private type. Check that if the formal type has
--- an unknown discriminant part, a class-wide type may also be passed as
--- an actual.
---
--- TEST DESCRIPTION:
--- A generic package declares a formal private type and defines a
--- stack abstraction. Stacks are modeled as singly linked lists of
--- pointers to elements. Pointers are used because the elements may
--- be unconstrained.
---
--- A generic testing procedure pushes an item onto a stack, then views
--- the item on top of the stack.
---
--- The formal private type has an unknown discriminant part, and
--- is thus indefinite. This allows both definite and indefinite types
--- (including class-wide types) to be passed as actuals. For tagged types,
--- definite implies nondiscriminated, and indefinite implies discriminated
--- (with known/unknown discriminants).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FC50A00.A
--- -> CC50A02.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Nov 95 SAIC ACVC 2.0.1 fixes: Removed use of formal package
--- exception name in exception choice.
---
---!
-
-generic -- Generic stack abstraction.
- type Item (<>) is private; -- Formal private type.
-package CC50A02_0 is
-
- type Stack is private;
-
- procedure Push (I : in Item; S : in out Stack);
- function View_Top (S : Stack) return Item;
-
- -- ...Other stack operations...
-
- Stack_Empty : exception;
-
-private
-
- type Item_Ptr is access Item;
-
- type Stack_Item;
- type Stack_Ptr is access Stack_Item;
-
- type Stack_Item is record
- Item : Item_Ptr;
- Next : Stack_Ptr;
- end record;
-
- type Stack is record
- Top : Stack_Ptr := null;
- Size : Natural := 0;
- end record;
-
-end CC50A02_0;
-
-
- --==================================================================--
-
-
-package body CC50A02_0 is
-
- -- Link NewItem in at the top of the stack.
-
- procedure Push (I : in Item; S : in out Stack) is
- NewItem : Item_Ptr := new Item'(I);
- Element : Stack_Ptr := new Stack_Item'(Item => NewItem, Next => S.Top);
- begin
- S.Top := Element;
- S.Size := S.Size + 1;
- end Push;
-
-
- -- Return (copy) of top item on stack. Do NOT remove from stack.
-
- function View_Top (S : Stack) return Item is
- begin
- if S.Top = null then
- raise Stack_Empty;
- else
- return S.Top.Item.all;
- end if;
- end View_Top;
-
-end CC50A02_0;
-
-
- --==================================================================--
-
-
--- The formal package Stacker below is needed to gain access to the
--- appropriate version of the "generic" type Stack. It is provided with an
--- explicit actual part in order to restrict the packages that can be passed
--- as actuals to those which have been instantiated with the same actuals
--- which this generic procedure has been instantiated with.
-
-with CC50A02_0; -- Generic stack abstraction.
-generic
- type Item_Type (<>) is private; -- Formal private type.
- with package Stacker is new CC50A02_0 (Item_Type);
-procedure CC50A02_1 (S : in out Stacker.Stack; I : in Item_Type);
-
-
- --==================================================================--
-
---
--- This generic procedure performs all of the testing of the
--- stack abstraction.
---
-
-with Report;
-procedure CC50A02_1 (S : in out Stacker.Stack; I : in Item_Type) is
-begin
- Stacker.Push (I, S); -- Push onto empty stack.
-
- -- Calls to View_Top must initialize a declared object of type Item_Type
- -- because the type may be unconstrained.
-
- declare
- Buffer : Item_Type := Stacker.View_Top (S);
- begin
- if Buffer /= I then
- Report.Failed (" Expected item not on stack");
- end if;
- exception
- when Constraint_Error =>
- Report.Failed (" Unexpected error: Tags of pushed and popped " &
- "items don't match");
- end;
-
-
-exception
- when others =>
- Report.Failed (" Unexpected error: Item not pushed onto stack");
-end CC50A02_1;
-
-
- --==================================================================--
-
-
-with FC50A00; -- Tagged (actual) type declarations.
-with CC50A02_0; -- Generic stack abstraction.
-with CC50A02_1; -- Generic stack testing procedure.
-
-with Report;
-procedure CC50A02 is
-
- --
- -- Pass a nondiscriminated tagged actual:
- --
-
- package Count_Stacks is new CC50A02_0 (FC50A00.Count_Type);
- procedure TC_Count_Test is new CC50A02_1 (FC50A00.Count_Type,
- Count_Stacks);
- Count_Stack : Count_Stacks.Stack;
-
-
- --
- -- Pass a discriminated tagged actual:
- --
-
- package Person_Stacks is new CC50A02_0 (FC50A00.Person_Type);
- procedure TC_Person_Test is new CC50A02_1 (FC50A00.Person_Type,
- Person_Stacks);
- Person_Stack : Person_Stacks.Stack;
-
-
- --
- -- Pass a class-wide actual:
- --
-
- package People_Stacks is new CC50A02_0 (FC50A00.Person_Type'Class);
- procedure TC_People_Test is new CC50A02_1 (FC50A00.Person_Type'Class,
- People_Stacks);
- People_Stack : People_Stacks.Stack;
-
-begin
- Report.Test ("CC50A02", "Check that tagged actuals may be passed " &
- "to a formal (nontagged) private type");
-
- Report.Comment ("Testing definite tagged type..");
- TC_Count_Test (Count_Stack, FC50A00.TC_Count_Item);
-
- Report.Comment ("Testing indefinite tagged type..");
- TC_Person_Test (Person_Stack, FC50A00.TC_Person_Item);
-
- Report.Comment ("Testing class-wide type..");
- TC_People_Test (People_Stack, FC50A00.TC_VIPerson_Item);
-
- Report.Result;
-end CC50A02;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc51001.a b/gcc/testsuite/ada/acats/tests/cc/cc51001.a
deleted file mode 100644
index 6aa76a6f8e6..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc51001.a
+++ /dev/null
@@ -1,186 +0,0 @@
--- CC51001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a formal parameter of a generic package may be a formal
--- derived type. Check that the formal derived type may have an unknown
--- discriminant part. Check that the ancestor type in a formal derived
--- type definition may be a tagged type, and that the actual parameter
--- may be a descendant of the ancestor type. Check that the formal derived
--- type belongs to the derivation class rooted at the ancestor type;
--- specifically, that components of the ancestor type may be referenced
--- within the generic. Check that if a formal derived subtype is
--- indefinite then the actual may be either definite or indefinite.
---
--- TEST DESCRIPTION:
--- Define a class of tagged types with a definite root type. Extend the
--- root type with a discriminated component. Since discriminants of
--- tagged types may not have defaults, the type is indefinite.
---
--- Extend the extension with a second discriminated component, but with
--- a new discriminant part. Declare a generic package with a formal
--- derived type using the root type of the class as ancestor, and an
--- unknown discriminant part. Declare an operation in the generic which
--- accesses the common component of types in the class.
---
--- In the main program, instantiate the generic with each type in the
--- class and verify that the operation correctly accesses the common
--- component.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CC51001_0 is -- Root type for message class.
-
- subtype Msg_String is String (1 .. 20);
-
- type Msg_Type is tagged record -- Root type of
- Text : Msg_String := (others => ' '); -- class (definite).
- end record;
-
-end CC51001_0;
-
-
--- No body for CC51001_0.
-
-
- --==================================================================--
-
-
-with CC51001_0; -- Root type for message class.
-package CC51001_1 is -- Extensions to message class.
-
- subtype Source_Length is Natural range 0 .. 10;
-
- type From_Msg_Type (SLen : Source_Length) is -- Direct derivative
- new CC51001_0.Msg_Type with record -- of root type
- From : String (1 .. SLen); -- (indefinite).
- end record;
-
- subtype Dest_Length is Natural range 0 .. 10;
-
-
-
- type To_From_Msg_Type (DLen : Dest_Length) is -- Indirect
- new From_Msg_Type (SLen => 10) with record -- derivative of
- To : String (1 .. DLen); -- root type
- end record; -- (indefinite).
-
-end CC51001_1;
-
-
--- No body for CC51001_1.
-
-
- --==================================================================--
-
-
-with CC51001_0; -- Root type for message class.
-generic -- I/O operations for message class.
- type Message_Type (<>) is new CC51001_0.Msg_Type with private;
-package CC51001_2 is
-
- -- This subprogram contains an artificial result for testing purposes:
- -- the function returns the text of the message to the caller as a string.
-
- function Print_Message (M : in Message_Type) return String;
-
- -- ... Other operations.
-
-end CC51001_2;
-
-
- --==================================================================--
-
-
-package body CC51001_2 is
-
- -- The implementations of the operations below are purely artificial; the
- -- validity of their implementations in the context of the abstraction is
- -- irrelevant to the feature being tested.
-
- function Print_Message (M : in Message_Type) return String is
- begin
- return M.Text;
- end Print_Message;
-
-end CC51001_2;
-
-
- --==================================================================--
-
-
-with CC51001_0; -- Root type for message class.
-with CC51001_1; -- Extensions to message class.
-with CC51001_2; -- I/O operations for message class.
-
-with Report;
-procedure CC51001 is
-
- -- Instantiate for various types in the class:
-
- package Msgs is new CC51001_2 (CC51001_0.Msg_Type); -- Definite.
- package FMsgs is new CC51001_2 (CC51001_1.From_Msg_Type); -- Indefinite.
- package TFMsgs is new CC51001_2 (CC51001_1.To_From_Msg_Type); -- Indefinite.
-
-
-
- Msg : CC51001_0.Msg_Type := (Text => "This is message #001");
- FMsg : CC51001_1.From_Msg_Type := (Text => "This is message #002",
- SLen => 2,
- From => "Me");
- TFMsg : CC51001_1.To_From_Msg_Type := (Text => "This is message #003",
- From => "You ",
- DLen => 4,
- To => "Them");
-
- Expected_Msg : constant String := "This is message #001";
- Expected_FMsg : constant String := "This is message #002";
- Expected_TFMsg : constant String := "This is message #003";
-
-begin
- Report.Test ("CC51001", "Check that the formal derived type may have " &
- "an unknown discriminant part. Check that the ancestor " &
- "type in a formal derived type definition may be a " &
- "tagged type, and that the actual parameter may be any " &
- "definite or indefinite descendant of the ancestor type");
-
- if (Msgs.Print_Message (Msg) /= Expected_Msg) then
- Report.Failed ("Wrong result for definite root type");
- end if;
-
- if (FMsgs.Print_Message (FMsg) /= Expected_FMsg) then
- Report.Failed ("Wrong result for direct indefinite derivative");
- end if;
-
- if (TFMsgs.Print_Message (TFMsg) /= Expected_TFMsg) then
- Report.Failed ("Wrong result for Indirect indefinite derivative");
- end if;
-
- Report.Result;
-end CC51001;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc51002.a b/gcc/testsuite/ada/acats/tests/cc/cc51002.a
deleted file mode 100644
index 1083d18a8f8..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc51002.a
+++ /dev/null
@@ -1,198 +0,0 @@
--- CC51002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for formal derived tagged types, the formal parameter
--- names and default expressions for a primitive subprogram in an
--- instance are determined by the primitive subprogram of the ancestor
--- type, but that the primitive subprogram body executed is that of the
--- actual type.
---
--- TEST DESCRIPTION:
--- Define a root tagged type in a library-level package and give it a
--- primitive subprogram. Provide a default expression for a non-tagged
--- parameter of the subprogram. Declare a library-level generic subprogram
--- with a formal derived type using the root type as ancestor. Call
--- the primitive subprogram of the root type using named association for
--- the tagged parameter, and provide no actual for the defaulted
--- parameter. Extend the root type in a second package and override the
--- root type's subprogram with one which has different parameter names
--- and no default expression for the non-tagged parameter. Instantiate
--- the generic subprogram for each of the tagged types in the class and
--- call the instances.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CC51002_0 is -- Root message type and operations.
-
- type Recipients is (None, Root, Sysop, Local, Remote);
-
- type Msg_Type is tagged record -- Root type of
- Text : String (1 .. 10); -- class.
- end record;
-
- function Send (Msg : in Msg_Type; -- Primitive
- To : Recipients := Local) return Boolean; -- subprogram.
-
- -- ...Other message operations.
-
-end CC51002_0;
-
-
- --==================================================================--
-
-
-package body CC51002_0 is
-
- -- The implementation of Send is purely artificial; the validity of
- -- its implementation in the context of the abstraction is irrelevant to
- -- the feature being tested.
-
- function Send (Msg : in Msg_Type;
- To : Recipients := Local) return Boolean is
- begin
- return (Msg.Text = "Greetings!" and To = Local);
- end Send;
-
-end CC51002_0;
-
-
- --==================================================================--
-
-
-with CC51002_0; -- Root message type and operations.
-generic -- Message class function.
- type Msg_Block is new CC51002_0.Msg_Type with private;
-function CC51002_1 (M : in Msg_Block) return Boolean;
-
-
- --==================================================================--
-
-
-function CC51002_1 (M : in Msg_Block) return Boolean is
- Okay : Boolean := False;
-begin
-
- -- The call to Send below uses the ancestor type's parameter name, which
- -- should be legal even if the actual subprogram called does not have a
- -- parameter of that name. Furthermore, it uses the ancestor type's default
- -- expression for the second parameter, which should be legal even if the
- -- the actual subprogram called has no such default expression.
-
- Okay := Send (Msg => M);
- -- ...Other processing.
- return Okay;
-
-end CC51002_1;
-
-
- --==================================================================--
-
-
-with CC51002_0; -- Root message type and operations.
-package CC51002_2 is -- Extended message type and operations.
-
- type Sender_Type is (Inside, Outside);
-
- type Who_Msg_Type is new CC51002_0.Msg_Type with record -- Derivative of
- From : Sender_Type; -- root type of
- end record; -- class.
-
-
- -- Note: this overriding version of Send has different parameter names
- -- from the root type's function. It also has no default expression.
-
- function Send (M : Who_Msg_Type; -- Overrides
- R : CC51002_0.Recipients) return Boolean; -- root type's
- -- operation.
- -- ...Other extended message operations.
-
-end CC51002_2;
-
-
- --==================================================================--
-
-
-package body CC51002_2 is
-
- -- The implementation of Send is purely artificial; the validity of
- -- its implementation in the context of the abstraction is irrelevant to
- -- the feature being tested.
-
- function Send (M : Who_Msg_Type; R : CC51002_0.Recipients) return Boolean is
- use type CC51002_0.Recipients;
- begin
- return (M.Text = "Willkommen" and
- M.From = Outside and
- R = CC51002_0.Local);
- end Send;
-
-end CC51002_2;
-
-
- --==================================================================--
-
-
-with CC51002_0; -- Root message type and operations.
-with CC51002_1; -- Message class function.
-with CC51002_2; -- Extended message type and operations.
-
-with Report;
-procedure CC51002 is
-
- function Send_Msg is new CC51002_1 (CC51002_0.Msg_Type);
- function Send_WMsg is new CC51002_1 (CC51002_2.Who_Msg_Type);
-
- Mess : CC51002_0.Msg_Type := (Text => "Greetings!");
- WMess : CC51002_2.Who_Msg_Type := (Text => "Willkommen",
- From => CC51002_2.Outside);
-
- TC_Okay_MStatus : Boolean := False;
- TC_Okay_WMStatus : Boolean := False;
-
-begin
- Report.Test ("CC51002", "Check that, for formal derived tagged types, " &
- "the formal parameter names and default expressions for " &
- "a primitive subprogram in an instance are determined by " &
- "the primitive subprogram of the ancestor type, but that " &
- "the primitive subprogram body executed is that of the" &
- "actual type");
-
- TC_Okay_MStatus := Send_Msg (Mess);
- if not TC_Okay_MStatus then
- Report.Failed ("Wrong result from call to root type's operation");
- end if;
-
- TC_Okay_WMStatus := Send_WMsg (WMess);
- if not TC_Okay_WMStatus then
- Report.Failed ("Wrong result from call to derived type's operation");
- end if;
-
- Report.Result;
-end CC51002;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc51003.a b/gcc/testsuite/ada/acats/tests/cc/cc51003.a
deleted file mode 100644
index 68ea32ebd78..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc51003.a
+++ /dev/null
@@ -1,187 +0,0 @@
--- CC51003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the ancestor type of a formal derived type is a composite
--- type that is not an array type, the formal type inherits components,
--- including discriminants, from the ancestor type.
---
--- Check for the case where the ancestor type is a record type, and the
--- formal derived type is declared in a generic subprogram.
---
--- TEST DESCRIPTION:
--- Define a discriminated record type in a package. Declare a
--- library-level generic subprogram with a formal derived type using the
--- record type as ancestor. Give the generic subprogram an in out
--- parameter of the formal derived type. Inside the generic, use the
--- discriminant component and modify the remaining components of the
--- record parameter. In the main program, declare record objects with two
--- different discriminant values. Derive an indefinite type from the
--- record type with a new discriminant part. Instantiate the generic
--- subprogram for the root record subtype and the derived subtype. Call
--- the root subtype instance with actual parameters having the two
--- discriminant values. Also call the derived subtype instance with
--- an appropriate actual.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 03 Jan 95 SAIC Removed unknown discriminant part from formal
--- derived type.
--- 05 Nov 95 SAIC ACVC 2.0.1 fixes: Removed constrained subtype
--- instantiation and associated declarations.
--- Modified commentary.
---
---!
-
-
--- Simulate a fragment of a matrix manipulation application.
-
-package CC51003_0 is -- Matrix types.
-
- type Matrix is array (Natural range <>, Natural range <>) of Integer;
-
- type Square (Side : Natural) is record
- Mat : Matrix (1 .. Side, 1 .. Side);
- end record;
-
- type Double_Square (Number : Natural) is record
- Left : Square (Number);
- Right : Square (Number);
- end record;
-
-end CC51003_0;
-
-
--- No body for CC51003_0;
-
-
- --==================================================================--
-
-
-with CC51003_0; -- Matrix types.
-generic -- Generic double-matrix "clear" operation.
- type Dbl_Square is new CC51003_0.Double_Square; -- Indefinite
-procedure CC51003_1 (Dbl : in out Dbl_Square); -- formal.
-
-
- --==================================================================--
-
-
-procedure CC51003_1 (Dbl : in out Dbl_Square) is
-begin
- for I in 1 .. Dbl.Number loop -- Discriminants inherited from ancestor
- for J in 1 .. Dbl.Number loop -- type (should work even for derived type
- -- declaring new discriminant part).
- Dbl.Left.Mat (I, J) := 0; -- Other components inherited from
- Dbl.Right.Mat (I, J) := 0; -- ancestor type.
-
- end loop;
- end loop;
-end CC51003_1;
-
-
- --==================================================================--
-
-
-with CC51003_0; -- Matrix types.
-with CC51003_1; -- Generic double-matrix "clear" operation.
-
-with Report;
-procedure CC51003 is
-
- use CC51003_0; -- "/=" operator directly visible for Double_Square.
-
- -- Matrices of root type:
-
- Mat_2x2 : Square(Side => 2) := (Side => 2,
- Mat => ( (1, 2), (3, 4) ));
- Dbl_Mat_2x2 : Double_Square(Number => 2) := (2, Mat_2x2, Mat_2x2);
-
-
- Zero_2x2 : constant Square(2) := (2, Mat => ( (0, 0), (0, 0) ));
- Expected_2x2 : constant Double_Square(2) := (Number => 2,
- others => Zero_2x2);
-
-
-
- Mat_3x3 : Square(Side => 3) := (Side => 3,
- Mat => (1 => (1, 4, 9),
- others => (1 => 5,
- others => 7)));
- Dbl_Mat_3x3 : Double_Square(3) := (Number => 3, others => Mat_3x3);
-
-
- Zero_3x3 : constant Square(3) := (3, Mat => (others => (0,0,0)));
- Expected_3x3 : constant Double_Square(Number => 3) :=
- (3, Zero_3x3, Zero_3x3);
-
-
- -- Derived type with new discriminant part (which constrains parent):
-
- type New_Dbl_Sq (Num : Natural) is new Double_Square(Num);
-
- New_Dbl_2x2 : New_Dbl_Sq (Num => 2) := (2, Mat_2x2, Mat_2x2);
- Expected_New_2x2 : constant New_Dbl_Sq := (Num => 2, others => Zero_2x2);
-
-
-
- -- Instantiations:
-
- procedure Clr_Dbl is new CC51003_1 (Double_Square);
- procedure Clr_New_Dbl is new CC51003_1 (New_Dbl_Sq);
-
-
-begin
- Report.Test ("CC51003", "Check that a formal derived record type " &
- "inherits components, including discriminants, " &
- "from its ancestor type");
-
- -- Simulate use of matrix manipulation operations.
-
- Clr_Dbl (Dbl_Mat_2x2);
-
- if (Dbl_Mat_2x2 /= Expected_2x2) then
- Report.Failed ("Wrong result for root type (2x2 matrix)");
- end if;
-
-
- Clr_Dbl (Dbl_Mat_3x3);
-
- if (Dbl_Mat_3x3 /= Expected_3x3) then
- Report.Failed ("Wrong result for root type (3x3 matrix)");
- end if;
-
-
- Clr_New_Dbl (New_Dbl_2x2);
-
- if (New_Dbl_2x2 /= Expected_New_2x2) then
- Report.Failed ("Wrong result for derived type (2x2 matrix)");
- end if;
-
-
- Report.Result;
-
-end CC51003;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc51004.a b/gcc/testsuite/ada/acats/tests/cc/cc51004.a
deleted file mode 100644
index 09b1b57fae7..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc51004.a
+++ /dev/null
@@ -1,181 +0,0 @@
--- CC51004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if the ancestor type of a formal derived type is a composite
--- type that is not an array type, the formal type inherits components,
--- including discriminants, from the ancestor type.
---
--- Check for the case where the ancestor type is a tagged type, and the
--- formal derived type is declared in a generic subprogram.
---
--- TEST DESCRIPTION:
--- Define a discriminated tagged type in a package. Declare a
--- library-level generic subprogram with a formal derived type using the
--- tagged type as ancestor. Give the generic subprogram an in out
--- parameter of the formal derived type. Inside the generic, use the
--- discriminant component and modify the remaining components of the
--- tagged parameter. In the main program, declare tagged record objects
--- with two different discriminant values. Derive an indefinite type from
--- the tagged type with a new discriminant part. Instantiate the
--- generic subprogram for the root tagged subtype and the derived subtype.
--- Call the root subtype instance with actual parameters having the two
--- discriminant values. Also call the derived subtype instance with an
--- appropriate actual.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 05 Jan 94 SAIC Removed unknown discriminant part from formal
--- derived type. Moved declaration of type
--- New_Dbl_Sq from main subprogram to CC51004_0.
--- 05 Nov 95 SAIC ACVC 2.0.1 fixes: Removed constrained subtype
--- instantiation and associated declarations.
--- Modified commentary.
---
---!
-
--- Simulate a fragment of a matrix manipulation application.
-
-package CC51004_0 is -- Matrix types.
-
- type Matrix is array (Natural range <>, Natural range <>) of Integer;
-
- type Square (Side : Natural) is record
- Mat : Matrix (1 .. Side, 1 .. Side);
- end record;
-
- type Sq_Type (Num1 : Natural) is tagged record
- One : Square (Num1);
- end record;
-
- -- Extended type with new discriminant part (which constrains parent):
-
- type New_Dbl_Sq (Num2 : Natural) is new Sq_Type(Num2) with record
- Two : Square (Num2);
- end record;
-
-end CC51004_0;
-
-
--- No body for CC51004_0;
-
-
- --==================================================================--
-
-
-with CC51004_0; -- Matrix types.
-generic -- Generic matrix "clear" operation.
- type Squares is new CC51004_0.Sq_Type with private; -- Indefinite
-procedure CC51004_1 (Sq : in out Squares); -- formal.
-
-
- --==================================================================--
-
-
-procedure CC51004_1 (Sq : in out Squares) is
-begin
- for I in 1 .. Sq.Num1 loop -- Discriminants inherited from ancestor
- for J in 1 .. Sq.Num1 loop -- type (should work even for derived type
- -- declaring new discriminant part).
- Sq.One.Mat (I, J) := 0; -- Other components inherited from
- -- ancestor type.
- end loop;
- end loop;
-end CC51004_1;
-
-
- --==================================================================--
-
-
-with CC51004_0; -- Matrix types.
-with CC51004_1; -- Generic double-matrix "clear" operation.
-
-with Report;
-procedure CC51004 is
-
- use CC51004_0; -- "/=" operator directly visible for Sq_Type.
-
- -- Matrices of root type:
-
- Mat_2x2 : Square(Side => 2) := (Side => 2, Mat => ( (1, 2), (3, 4) ));
- One_Mat_2x2 : Sq_Type(Num1 => 2) := (2, Mat_2x2);
-
- Zero_2x2 : constant Square(2) := (2, Mat => ( (0, 0), (0, 0) ));
- Expected_2x2 : constant Sq_Type(2) := (Num1 => 2, One => Zero_2x2);
-
-
- Mat_3x3 : Square(Side => 3) := (Side => 3,
- Mat => (1 => (5, 2, 7),
- others => (1 => 4,
- others => 9)));
- One_Mat_3x3 : Sq_Type(3) := (Num1 => 3, One => Mat_3x3);
-
- Zero_3x3 : constant Square(3) := (3, Mat => (others => (0,0,0)));
- Expected_3x3 : constant Sq_Type(Num1 => 3) := (3, Zero_3x3);
-
-
- New_Dbl_2x2 : New_Dbl_Sq(Num2 => 2) := (2, others => Mat_2x2);
- Expected_New_2x2 : constant New_Dbl_Sq := (2, Zero_2x2, Mat_2x2);
-
-
-
- -- Instantiations:
-
- procedure Clr_Mat is new CC51004_1 (Sq_Type);
- procedure Clr_New_Dbl is new CC51004_1 (New_Dbl_Sq);
-
-
-begin
- Report.Test ("CC51004", "Check that a formal derived tagged type " &
- "inherits components, including discriminants, " &
- "from its ancestor type");
-
- -- Simulate use of matrix manipulation operations.
-
-
- Clr_Mat (One_Mat_2x2);
-
- if (One_Mat_2x2 /= Expected_2x2) then
- Report.Failed ("Wrong result root type (2x2 matrix)");
- end if;
-
-
- Clr_Mat (One_Mat_3x3);
-
- if (One_Mat_3x3 /= Expected_3x3) then
- Report.Failed ("Wrong result root type (3x3 matrix)");
- end if;
-
-
- Clr_New_Dbl (New_Dbl_2x2);
-
- if (New_Dbl_2x2 /= Expected_New_2x2) then
- Report.Failed ("Wrong result extended type (2x2 matrix)");
- end if;
-
-
- Report.Result;
-end CC51004;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc51006.a b/gcc/testsuite/ada/acats/tests/cc/cc51006.a
deleted file mode 100644
index b4dc4cdb4d4..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc51006.a
+++ /dev/null
@@ -1,224 +0,0 @@
--- CC51006.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, in an instance, each implicit declaration of a primitive
--- subprogram of a formal (nontagged) derived type declares a view of
--- the corresponding primitive subprogram of the ancestor type, even if
--- the subprogram has been overridden for the actual type. Check that for
--- a formal derived type with no discriminant part, if the ancestor
--- subtype is an unconstrained scalar subtype then the actual may be
--- either constrained or unconstrained.
---
--- TEST DESCRIPTION:
--- The formal derived type has no discriminant part, but the ancestor
--- subtype is unconstrained, making the formal type unconstrained. Since
--- the ancestor subtype is a scalar subtype (not an access or composite
--- subtype), the actual may be either constrained or unconstrained.
---
--- Declare a root type of a class as an unconstrained scalar (use floating
--- point). Declare a primitive subprogram of the root type. Declare a
--- generic package which has a formal derived type with the scalar root
--- type as ancestor. Inside the generic, declare an operation which calls
--- the ancestor type's primitive subprogram. Derive both constrained and
--- unconstrained types from the root type and override the primitive
--- subprogram for each. Declare a constrained subtype of the unconstrained
--- derivative. Instantiate the generic package for the derived types and
--- the subtype and call the "generic" operation for each one. Confirm that
--- in all cases the root type's implementation of the primitive
--- subprogram is called.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-package CC51006_0 is -- Weight class.
-
- type Weight_Type is digits 3; -- Root type of class (unconstrained).
-
- function Weight_To_String (Wt : Weight_Type) return String;
-
- -- ... Other operations.
-
-end CC51006_0;
-
-
- --==================================================================--
-
-
-package body CC51006_0 is
-
- -- The implementations of the operations below are purely artificial; the
- -- validity of their implementations in the context of the abstraction is
- -- irrelevant to the feature being tested.
-
- function Weight_To_String (Wt : Weight_Type) return String is
- begin
- if Wt > 0.0 then -- Always true for this test.
- return ("Root type's implementation called");
- else
- return ("Unexpected result ");
- end if;
- end Weight_To_String;
-
-end CC51006_0;
-
-
- --==================================================================--
-
-
-with CC51006_0; -- Weight class.
-generic -- Generic weight operations.
- type Weight is new CC51006_0.Weight_Type;
-package CC51006_1 is
-
- procedure Output_Weight (Wt : in Weight; TC_Return : out String);
-
- -- ... Other operations.
-
-end CC51006_1;
-
-
- --==================================================================--
-
-
-package body CC51006_1 is
-
-
- -- The implementation of this procedure is purely artificial, and contains
- -- an artificial parameter for testing purposes: the procedure returns the
- -- weight string to the caller.
-
- procedure Output_Weight (Wt : in Weight; TC_Return : out String) is
- begin
- TC_Return := Weight_To_String (Wt); -- Should always call root type's
- end Output_Weight; -- implementation.
-
-
-end CC51006_1;
-
-
- --==================================================================--
-
-
-with CC51006_0; -- Weight class.
-use CC51006_0;
-package CC51006_2 is -- Extensions to weight class.
-
- type Grams is new Weight_Type; -- Unconstrained
- -- derivative.
-
- function Weight_To_String (Wt : Grams) return String; -- Overrides root
- -- type's operation.
-
- subtype Milligrams is Grams -- Constrained
- range 0.0 .. 0.999; -- subtype (of der.).
-
- type Pounds is new Weight_Type -- Constrained
- range 0.0 .. 500.0; -- derivative.
-
- function Weight_To_String (Wt : Pounds) return String; -- Overrides root
- -- type's operation.
-
-end CC51006_2;
-
-
- --==================================================================--
-
-
-package body CC51006_2 is
-
- -- The implementations of the operations below are purely artificial; the
- -- validity of their implementations in the context of the abstraction is
- -- irrelevant to the feature being tested.
-
- function Weight_To_String (Wt : Grams) return String is
- begin
- return ("GRAMS: Should never be called ");
- end Weight_To_String;
-
-
- function Weight_To_String (Wt : Pounds) return String is
- begin
- return ("POUNDS: Should never be called ");
- end Weight_To_String;
-
-end CC51006_2;
-
-
- --==================================================================--
-
-
-with CC51006_1; -- Generic weight operations.
-with CC51006_2; -- Extensions to weight class.
-
-with Report;
-procedure CC51006 is
-
- package Metric_Wts_G is new CC51006_1 (CC51006_2.Grams); -- Unconstr.
- package Metric_Wts_MG is new CC51006_1 (CC51006_2.Milligrams); -- Constr.
- package US_Wts is new CC51006_1 (CC51006_2.Pounds); -- Constr.
-
- Gms : CC51006_2.Grams := 113.451;
- Mgm : CC51006_2.Milligrams := 0.549;
- Lbs : CC51006_2.Pounds := 24.52;
-
-
- subtype TC_Buffers is String (1 .. 33);
-
- TC_Expected : constant TC_Buffers := "Root type's implementation called";
- TC_Buffer : TC_Buffers;
-
-begin
- Report.Test ("CC51006", "Check that, in an instance, each implicit " &
- "declaration of a primitive subprogram of a formal " &
- "(nontagged) type declares a view of the corresponding " &
- "primitive subprogram of the ancestor type");
-
-
- Metric_Wts_G.Output_Weight (Gms, TC_Buffer);
-
- if TC_Buffer /= TC_Expected then
- Report.Failed ("Root operation not called for unconstrained derivative");
- end if;
-
-
- Metric_Wts_MG.Output_Weight (Mgm, TC_Buffer);
-
- if TC_Buffer /= TC_Expected then
- Report.Failed ("Root operation not called for constrained subtype");
- end if;
-
-
- US_Wts.Output_Weight (Lbs, TC_Buffer);
-
- if TC_Buffer /= TC_Expected then
- Report.Failed ("Root operation not called for constrained derivative");
- end if;
-
- Report.Result;
-end CC51006;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc51007.a b/gcc/testsuite/ada/acats/tests/cc/cc51007.a
deleted file mode 100644
index d8f78779dee..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc51007.a
+++ /dev/null
@@ -1,305 +0,0 @@
--- CC51007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a generic formal derived tagged type is a private extension.
--- Specifically, check that, for a generic formal derived type whose
--- ancestor type has abstract primitive subprograms, neither the formal
--- derived type nor its descendants need be abstract. Check that objects
--- and components of the formal derived type and its nonabstract
--- descendants may be declared and allocated, as may nonabstract
--- functions returning these types, and that aggregates of nonabstract
--- descendants of the formal derived type are legal. Check that calls to
--- the abstract primitive subprograms of the ancestor dispatch to the
--- bodies corresponding to the tag of the actual parameters.
---
--- TEST DESCRIPTION:
--- Although the ancestor type is abstract and has abstract primitive
--- subprograms, these subprograms, when inherited by a formal nonabstract
--- derived type, are not abstract, since the formal derived type is a
--- nonabstract private extension.
---
--- Thus, derivatives of the formal derived type need not be abstract,
--- and both the formal derived type and its derivatives are considered
--- nonabstract types.
---
--- This test verifies that the restrictions placed on abstract types do
--- not apply to the formal derived type or its derivatives. Specifically,
--- objects of, components of, allocators of, and nonabstract functions
--- returning the formal derived type or its derivatives are legal. In
--- addition, the test verifies that a call within the instance to a
--- primitive subprogram of the (abstract) ancestor type dispatches to
--- the body corresponding to the tag of the actual parameter.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 23 Dec 94 SAIC Deleted illegal extension aggregate. Corrected
--- dispatching call. Editorial changes to commentary.
--- 05 Nov 95 SAIC ACVC 2.0.1 fixes: Moved instantiation of CC51007_3
--- to library level.
--- 11 Aug 96 SAIC ACVC 2.1: Added pragma Elaborate to context
--- clauses of CC51007_1 and CC51007_4.
---
---!
-
-package CC51007_0 is
-
- Max_Length : constant := 10;
- type Text is new String(1 .. Max_Length);
-
- type Alert is abstract tagged record -- Root type of class
- Message : Text := (others => '*'); -- (abstract).
- end record;
-
- procedure Handle (A: in out Alert) is abstract; -- Abstract dispatching
- -- operation.
-
-end CC51007_0;
-
--- No body for CC51007_0;
-
-
- --===================================================================--
-
-
-with CC51007_0;
-
-with Ada.Calendar;
-pragma Elaborate (Ada.Calendar);
-
-package CC51007_1 is
-
- type Low_Alert is new CC51007_0.Alert with record
- Time_Of_Arrival : Ada.Calendar.Time := Ada.Calendar.Time_Of (1901, 8, 1);
- end record;
-
- procedure Handle (A: in out Low_Alert); -- Overrides parent's
- -- implementation.
- Low : Low_Alert;
-
-end CC51007_1;
-
-
- --===================================================================--
-
-
-package body CC51007_1 is
-
- procedure Handle (A: in out Low_Alert) is -- Artificial for
- begin -- testing.
- A.Time_Of_Arrival := Ada.Calendar.Time_Of (1984, 1, 1);
- A.Message := "Low Alert!";
- end Handle;
-
-end CC51007_1;
-
-
- --===================================================================--
-
-
-with CC51007_1;
-package CC51007_2 is
-
- type Person is (OOD, CO, CinC);
-
- type Medium_Alert is new CC51007_1.Low_Alert with record
- Action_Officer : Person := OOD;
- end record;
-
- procedure Handle (A: in out Medium_Alert); -- Overrides parent's
- -- implementation.
- Med : Medium_Alert;
-
-end CC51007_2;
-
-
- --===================================================================--
-
-
-with Ada.Calendar;
-package body CC51007_2 is
-
- procedure Handle (A: in out Medium_Alert) is -- Artificial for
- begin -- testing.
- A.Action_Officer := CO;
- A.Time_Of_Arrival := Ada.Calendar.Time_Of (2001, 1, 1);
- A.Message := "Med Alert!";
- end Handle;
-
-end CC51007_2;
-
-
- --===================================================================--
-
-
-with CC51007_0;
-generic
- type Alert_Type is new CC51007_0.Alert with private;
- Initial_State : in Alert_Type;
-package CC51007_3 is
-
- function Clear_Message (A: Alert_Type) -- Function returning
- return Alert_Type; -- formal type.
-
-
- Max_Note : Natural := 10;
- type Note is new String (1 .. Max_Note);
-
- type Extended_Alert is new Alert_Type with record
- Addendum : Note := (others => '*');
- end record;
-
- -- In instance, inherits version of Handle from
- -- actual corresponding to formal type.
-
- function Annotate_Alert (A: in Alert_Type'Class) -- Function returning
- return Extended_Alert; -- derived type.
-
-
- Init_Ext_Alert : constant Extended_Alert := -- Object declaration.
- (Initial_State with Addendum => "----------"); -- Aggregate.
-
-
- type Alert_Type_Ptr is access constant Alert_Type;
- type Ext_Alert_Ptr is access Extended_Alert;
-
- Init_Alert_Ptr : Alert_Type_Ptr :=
- new Alert_Type'(Initial_State); -- Allocator.
-
- Init_Ext_Alert_Ptr : Ext_Alert_Ptr :=
- new Extended_Alert'(Init_Ext_Alert); -- Allocator.
-
-
- type Alert_Pair is record
- A : Alert_Type; -- Component.
- EA : Extended_Alert; -- Component.
- end record;
-
-end CC51007_3;
-
-
- --===================================================================--
-
-
-package body CC51007_3 is
-
- function Clear_Message (A: Alert_Type) return Alert_Type is
- Temp : Alert_Type := A; -- Object declaration.
- begin
- Temp.Message := (others => '-');
- return Temp;
- end Clear_Message;
-
- function Annotate_Alert (A: in Alert_Type'Class) return Extended_Alert is
- Temp : Alert_Type'Class := A;
- begin
- Handle (Temp); -- Dispatching call to
- -- operation of ancestor.
- return (Alert_Type(Temp) with Addendum => "No comment");
- end Annotate_Alert;
-
-end CC51007_3;
-
-
- --===================================================================--
-
-
-with CC51007_1;
-
-with CC51007_3;
-pragma Elaborate (CC51007_3);
-
-package CC51007_4 is new CC51007_3 (CC51007_1.Low_Alert, CC51007_1.Low);
-
-
- --===================================================================--
-
-
-with CC51007_1;
-with CC51007_2;
-with CC51007_3;
-with CC51007_4;
-
-with Ada.Calendar;
-with Report;
-procedure CC51007 is
-
- package Alert_Support renames CC51007_4;
-
- Ext : Alert_Support.Extended_Alert;
-
- TC_Result : Alert_Support.Extended_Alert;
-
- TC_Low_Expected : constant Alert_Support.Extended_Alert :=
- (Time_Of_Arrival => Ada.Calendar.Time_Of (1984, 1, 1),
- Message => "Low Alert!",
- Addendum => "No comment");
-
- TC_Med_Expected : constant Alert_Support.Extended_Alert :=
- (Time_Of_Arrival => Ada.Calendar.Time_Of (2001, 1, 1),
- Message => "Med Alert!",
- Addendum => "No comment");
-
- TC_Ext_Expected : constant Alert_Support.Extended_Alert := TC_Low_Expected;
-
-
- use type Alert_Support.Extended_Alert;
-
-begin
- Report.Test ("CC51007", "Check that, for a generic formal derived type " &
- "whose ancestor type has abstract primitive subprograms, " &
- "neither the formal derived type nor its descendants need " &
- "be abstract, and that objects of, components of, " &
- "allocators of, aggregates of, and nonabstract functions " &
- "returning these types are legal. Check that calls to the " &
- "abstract primitive subprograms of the ancestor dispatch " &
- "to the bodies corresponding to the tag of the actual " &
- "parameters");
-
-
- TC_Result := Alert_Support.Annotate_Alert (CC51007_1.Low); -- Dispatching
- -- call.
- if TC_Result /= TC_Low_Expected then
- Report.Failed ("Wrong results from dispatching call (Low_Alert)");
- end if;
-
-
- TC_Result := Alert_Support.Annotate_Alert (CC51007_2.Med); -- Dispatching
- -- call.
- if TC_Result /= TC_Med_Expected then
- Report.Failed ("Wrong results from dispatching call (Medium_Alert)");
- end if;
-
-
- TC_Result := Alert_Support.Annotate_Alert (Ext); -- Results in dispatching
- -- call.
- if TC_Result /= TC_Ext_Expected then
- Report.Failed ("Wrong results from dispatching call (Extended_Alert)");
- end if;
-
-
- Report.Result;
-end CC51007;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc51008.a b/gcc/testsuite/ada/acats/tests/cc/cc51008.a
deleted file mode 100644
index b95ae6cf04d..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc51008.a
+++ /dev/null
@@ -1,124 +0,0 @@
--- CC51008.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE ACAA MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that operations are inherited for a formal derived type whose
--- ancestor is also a formal type as described in the corrigendum.
--- (Defect Report 8652/0038, as reflected in Technical Corrigendum 1,
--- RM95 12.5.1(21/1)).
---
--- CHANGE HISTORY:
--- 29 Jan 2001 PHL Initial version.
--- 30 Apr 2002 RLB Readied for release.
---
---!
-package CC51008_0 is
-
- type R0 is
- record
- C : Float;
- end record;
-
- procedure S (X : R0);
-
-end CC51008_0;
-
-with Report;
-use Report;
-package body CC51008_0 is
- procedure S (X : R0) is
- begin
- Comment ("CC51008_0.S called");
- end S;
-end CC51008_0;
-
-with CC51008_0;
-generic
- type F1 is new CC51008_0.R0;
- type F2 is new F1;
-package CC51008_1 is
- procedure G (O1 : F1; O2 : F2);
-end CC51008_1;
-
-package body CC51008_1 is
- procedure G (O1 : F1; O2 : F2) is
- begin
- S (O1);
- S (O2);
- end G;
-end CC51008_1;
-
-with CC51008_0;
-package CC51008_2 is
- type R2 is new CC51008_0.R0;
- procedure S (X : out R2);
-end CC51008_2;
-
-with Report;
-use Report;
-package body CC51008_2 is
- procedure S (X : out R2) is
- begin
- Failed ("CC51008_2.S called");
- end S;
-end CC51008_2;
-
-with CC51008_2;
-package CC51008_3 is
- type R3 is new CC51008_2.R2;
- procedure S (X : R3);
-end CC51008_3;
-
-with Report;
-use Report;
-package body CC51008_3 is
- procedure S (X : R3) is
- begin
- Failed ("CC51008_3.S called");
- end S;
-end CC51008_3;
-
-with CC51008_1;
-with CC51008_2;
-with CC51008_3;
-with Report;
-use Report;
-procedure CC51008 is
-
- package Inst is new CC51008_1 (CC51008_2.R2,
- CC51008_3.R3);
-
- X2 : constant CC51008_2.R2 := (C => 2.0);
- X3 : constant CC51008_3.R3 := (C => 3.0);
-
-begin
- Test ("CC51008",
- "Check that operations are inherited for a formal derived " &
- "type whose ancestor is also a formal type as described in " &
- "RM95 12.5.1(21/1)");
- Inst.G (X2, X3);
- Result;
-end CC51008;
-
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc51a01.a b/gcc/testsuite/ada/acats/tests/cc/cc51a01.a
deleted file mode 100644
index 60c32be47f2..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc51a01.a
+++ /dev/null
@@ -1,193 +0,0 @@
--- CC51A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, in an instance, each implicit declaration of a user-defined
--- subprogram of a formal derived record type declares a view of the
--- corresponding primitive subprogram of the ancestor, even if the
--- primitive subprogram has been overridden for the actual type.
---
--- TEST DESCRIPTION:
--- Declare a "fraction" type abstraction in a package (foundation code).
--- Declare a "fraction" I/O routine in a generic package with a formal
--- derived type whose ancestor type is the fraction type declared in
--- the first package. Within the I/O routine, call other operations of
--- ancestor type. Derive from the root fraction type in another package
--- and override one of the operations called in the generic I/O routine.
--- Derive from the derivative of the root fraction type. Instantiate
--- the generic package for each of the three types and call the I/O
--- routine.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FC51A00.A
--- CC51A01.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FC51A00; -- Fraction type abstraction.
-generic -- Fraction I/O support.
- type Fraction is new FC51A00.Fraction_Type; -- Formal derived type of a
-package CC51A01_0 is -- (private) record type.
-
- -- Simulate writing a fraction to standard output. In a real application,
- -- this subprogram might be a procedure which uses Text_IO routines. For
- -- the purposes of the test, the "output" is returned to the caller as a
- -- string.
- function Put (Item : in Fraction) return String;
-
- -- ... Other I/O operations for fractions.
-
-end CC51A01_0;
-
-
- --==================================================================--
-
-
-package body CC51A01_0 is
-
- function Put (Item : in Fraction) return String is
- Num : constant String := -- Fraction's primitive subprograms
- Integer'Image (Numerator (Item)); -- are inherited from its parent
- Den : constant String := -- (FC51A00.Fraction_Type) and NOT
- Integer'Image (Denominator (Item)); -- from the actual type.
- begin
- return (Num & '/' & Den);
- end Put;
-
-end CC51A01_0;
-
-
- --==================================================================--
-
-
-with FC51A00; -- Fraction type abstraction.
-package CC51A01_1 is
-
- -- Derive directly from the root type of the class and override one of the
- -- primitive subprograms.
-
- type Pos_Fraction is new FC51A00.Fraction_Type; -- Derived directly from
- -- root type of class.
- -- Inherits "/" from root type.
- -- Inherits "-" from root type.
- -- Inherits Numerator from root type.
- -- Inherits Denominator from root type.
-
- -- Return absolute value of numerator as integer.
- function Numerator (Frac : Pos_Fraction) -- Overrides parent's
- return Integer; -- operation.
-
-end CC51A01_1;
-
-
- --==================================================================--
-
-
-package body CC51A01_1 is
-
- -- This body should never be called.
- --
- -- The test sends the function Numerator a fraction with a negative
- -- numerator, and expects this negative numerator to be returned. This
- -- version of the function returns the absolute value of the numerator.
- -- Thus, a call to this version is detectable by examining the sign
- -- of the return value.
-
- function Numerator (Frac : Pos_Fraction) return Integer is
- Converted_Frac : FC51A00.Fraction_Type := FC51A00.Fraction_Type (Frac);
- Orig_Numerator : Integer := FC51A00.Numerator (Converted_Frac);
- begin
- return abs (Orig_Numerator);
- end Numerator;
-
-end CC51A01_1;
-
-
- --==================================================================--
-
-
-with FC51A00; -- Fraction type abstraction.
-with CC51A01_0; -- Fraction I/O support.
-with CC51A01_1; -- Positive fraction type abstraction.
-
-with Report;
-procedure CC51A01 is
-
- type Distance is new CC51A01_1.Pos_Fraction; -- Derived indirectly from
- -- root type of class.
- -- Inherits "/" indirectly from root type.
- -- Inherits "-" indirectly from root type.
- -- Inherits Numerator directly from parent type.
- -- Inherits Denominator indirectly from root type.
-
- use FC51A00, CC51A01_1; -- All primitive subprograms
- -- directly visible.
-
- package Fraction_IO is new CC51A01_0 (Fraction_Type);
- package Pos_Fraction_IO is new CC51A01_0 (Pos_Fraction);
- package Distance_IO is new CC51A01_0 (Distance);
-
- -- For each of the instances above, the subprogram "Put" should produce
- -- the same result. That is, the primitive subprograms called by Put
- -- should in all cases be those of the type Fraction_Type, which is the
- -- ancestor type for the formal derived type in the generic unit. In
- -- particular, for Pos_Fraction_IO and Distance_IO, the versions of
- -- Numerator called should NOT be those of the actual types, which override
- -- Fraction_Type's version.
-
- TC_Expected_Result : constant String := "-3/ 16";
-
- TC_Root_Type_Of_Class : Fraction_Type := -3/16;
- TC_Direct_Derivative : Pos_Fraction := -3/16;
- TC_Indirect_Derivative : Distance := -3/16;
-
-begin
- Report.Test ("CC51A01", "Check that, in an instance, each implicit " &
- "declaration of a user-defined subprogram of a formal " &
- "derived record type declares a view of the corresponding " &
- "primitive subprogram of the ancestor, even if the " &
- "primitive subprogram has been overridden for the actual " &
- "type");
-
- if (Fraction_IO.Put (TC_Root_Type_Of_Class) /= TC_Expected_Result) then
- Report.Failed ("Wrong result for root type");
- end if;
-
- if (Pos_Fraction_IO.Put (TC_Direct_Derivative) /= TC_Expected_Result) then
- Report.Failed ("Wrong result for direct derivative");
- end if;
-
- if (Distance_IO.Put (TC_Indirect_Derivative) /= TC_Expected_Result) then
- Report.Failed ("Wrong result for INdirect derivative");
- end if;
-
- Report.Result;
-end CC51A01;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc51b03.a b/gcc/testsuite/ada/acats/tests/cc/cc51b03.a
deleted file mode 100644
index 0cbeeb46f63..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc51b03.a
+++ /dev/null
@@ -1,258 +0,0 @@
--- CC51B03.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the attribute S'Definite, where S is an indefinite formal
--- private or derived type, returns true if the actual corresponding to
--- S is definite, and returns false otherwise.
---
--- TEST DESCRIPTION:
--- A definite subtype is any subtype which is not indefinite. An
--- indefinite subtype is either:
--- a) An unconstrained array subtype.
--- b) A subtype with unknown discriminants (this includes class-wide
--- types).
--- c) A subtype with unconstrained discriminants without defaults.
---
--- The possible forms of indefinite formal subtype are as follows:
---
--- Formal derived types:
--- X - Ancestor is an unconstrained array type
--- * - Ancestor is a discriminated record type without defaults
--- X - Ancestor is a discriminated tagged type
--- * - Ancestor type has unknown discriminants
--- - Formal type has an unknown discriminant part
--- * - Formal type has a known discriminant part
---
--- Formal private types:
--- - Formal type has an unknown discriminant part
--- * - Formal type has a known discriminant part
---
--- The formal subtypes preceded by an 'X' above are not covered, because
--- other rules prevent a definite subtype from being passed as an actual.
--- The formal subtypes preceded by an '*' above are not covered, because
--- 'Definite is less likely to be used for these formals.
---
--- The following kinds of actuals are passed to various of the formal
--- types listed above:
---
--- - Undiscriminated type
--- - Type with defaulted discriminants
--- - Type with undefaulted discriminants
--- - Class-wide type
---
--- A typical usage of S'Definite might be algorithm selection in a
--- generic I/O package, e.g., the use of fixed-length or variable-length
--- records depending on whether the actual is definite or indefinite.
--- In such situations, S'Definite would appear in if conditions or other
--- contexts requiring a boolean expression. This test checks S'Definite
--- in such usage contexts but, for brevity, omits any surrounding
--- usage code.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FC51B00.A
--- -> CC51B03.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FC51B00; -- Indefinite subtype declarations.
-package CC51B03_0 is
-
- --
- -- Formal private type cases:
- --
-
- generic
- type Formal (<>) is private; -- Formal has unknown
- package PrivateFormalUnknownDiscriminants is -- discriminant part.
- function Is_Definite return Boolean;
- end PrivateFormalUnknownDiscriminants;
-
-
- --
- -- Formal derived type cases:
- --
-
- generic
- type Formal (<>) is new FC51B00.Vector -- Formal has an unknown disc.
- with private; -- part; ancestor is tagged.
- package TaggedAncestorUnknownDiscriminants is
- function Is_Definite return Boolean;
- end TaggedAncestorUnknownDiscriminants;
-
-
-end CC51B03_0;
-
-
- --==================================================================--
-
-
-package body CC51B03_0 is
-
- package body PrivateFormalUnknownDiscriminants is
- function Is_Definite return Boolean is
- begin
- if Formal'Definite then -- Attribute used in "if"
- -- ...Execute algorithm #1... -- condition inside subprogram.
- return True;
- else
- -- ...Execute algorithm #2...
- return False;
- end if;
- end Is_Definite;
- end PrivateFormalUnknownDiscriminants;
-
-
- package body TaggedAncestorUnknownDiscriminants is
- function Is_Definite return Boolean is
- begin
- return Formal'Definite; -- Attribute used in return
- end Is_Definite; -- statement inside subprogram.
- end TaggedAncestorUnknownDiscriminants;
-
-
-end CC51B03_0;
-
-
- --==================================================================--
-
-
-with FC51B00;
-package CC51B03_1 is
-
- subtype Spin_Type is Natural range 0 .. 3;
-
- type Extended_Vector (Spin : Spin_Type) is -- Tagged type with
- new FC51B00.Vector with null record; -- discriminant (indefinite).
-
-
-end CC51B03_1;
-
-
- --==================================================================--
-
-
-with FC51B00; -- Indefinite subtype declarations.
-with CC51B03_0; -- Generic package declarations.
-with CC51B03_1;
-
-with Report;
-procedure CC51B03 is
-
- --
- -- Instances for formal private type with unknown discriminants:
- --
-
- package PrivateFormal_UndiscriminatedTaggedActual is new
- CC51B03_0.PrivateFormalUnknownDiscriminants (FC51B00.Vector);
-
- package PrivateFormal_ClassWideActual is new
- CC51B03_0.PrivateFormalUnknownDiscriminants (FC51B00.Vector'Class);
-
- package PrivateFormal_DiscriminatedTaggedActual is new
- CC51B03_0.PrivateFormalUnknownDiscriminants (FC51B00.Square_Pair);
-
- package PrivateFormal_DiscriminatedUndefaultedRecordActual is new
- CC51B03_0.PrivateFormalUnknownDiscriminants (FC51B00.Square);
-
-
- subtype Length is Natural range 0 .. 20;
- type Message (Len : Length := 0) is record -- Record type with defaulted
- Text : String (1 .. Len); -- discriminant (definite).
- end record;
-
- package PrivateFormal_DiscriminatedDefaultedRecordActual is new
- CC51B03_0.PrivateFormalUnknownDiscriminants (Message);
-
-
- --
- -- Instances for formal derived tagged type with unknown discriminants:
- --
-
- package DerivedFormal_UndiscriminatedTaggedActual is new
- CC51B03_0.TaggedAncestorUnknownDiscriminants (FC51B00.Vector);
-
- package DerivedFormal_ClassWideActual is new
- CC51B03_0.TaggedAncestorUnknownDiscriminants (FC51B00.Vector'Class);
-
- package DerivedFormal_DiscriminatedTaggedActual is new
- CC51B03_0.TaggedAncestorUnknownDiscriminants (CC51B03_1.Extended_Vector);
-
-
-begin
- Report.Test ("CC51B03", "Check that S'Definite returns true if the " &
- "actual corresponding to S is definite, and false otherwise");
-
-
- if not PrivateFormal_UndiscriminatedTaggedActual.Is_Definite then
- Report.Failed ("Formal private/unknown discriminants: wrong " &
- "result for undiscriminated tagged actual");
- end if;
-
- if PrivateFormal_ClassWideActual.Is_Definite then
- Report.Failed ("Formal private/unknown discriminants: wrong " &
- "result for class-wide actual");
- end if;
-
- if PrivateFormal_DiscriminatedTaggedActual.Is_Definite then
- Report.Failed ("Formal private/unknown discriminants: wrong " &
- "result for discriminated tagged actual");
- end if;
-
- if PrivateFormal_DiscriminatedUndefaultedRecordActual.Is_Definite then
- Report.Failed ("Formal private/unknown discriminants: wrong result " &
- "for record actual with undefaulted discriminants");
- end if;
-
- if not PrivateFormal_DiscriminatedDefaultedRecordActual.Is_Definite then
- Report.Failed ("Formal private/unknown discriminants: wrong result " &
- "for record actual with defaulted discriminants");
- end if;
-
-
- if not DerivedFormal_UndiscriminatedTaggedActual.Is_Definite then
- Report.Failed ("Formal derived/unknown discriminants: wrong result " &
- "for undiscriminated tagged actual");
- end if;
-
- if DerivedFormal_ClassWideActual.Is_Definite then
- Report.Failed ("Formal derived/unknown discriminants: wrong result " &
- "for class-wide actual");
- end if;
-
- if DerivedFormal_DiscriminatedTaggedActual.Is_Definite then
- Report.Failed ("Formal derived/unknown discriminants: wrong result " &
- "for discriminated tagged actual");
- end if;
-
-
- Report.Result;
-end CC51B03;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc51d01.a b/gcc/testsuite/ada/acats/tests/cc/cc51d01.a
deleted file mode 100644
index 63c68c0d4fc..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc51d01.a
+++ /dev/null
@@ -1,262 +0,0 @@
--- CC51D01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, in an instance, each implicit declaration of a user-defined
--- subprogram of a formal private extension declares a view of the
--- corresponding primitive subprogram of the ancestor, and that if the
--- tag in a call is statically determined to be that of the formal type,
--- the body executed will be that corresponding to the actual type.
---
--- Check subprograms declared within a generic formal package. Check for
--- the case where the actual type passed to the formal private extension
--- is a specific tagged type. Check for several types in the same class.
---
---
--- TEST DESCRIPTION:
--- Declare a list abstraction in a generic package which manages lists of
--- elements of any nonlimited type (foundation code). Declare a package
--- which declares a tagged type and a type derived from it. Declare an
--- operation for the root tagged type and override it for the derived
--- type. Derive a type from this derived type, but do not override the
--- operation. Declare a generic subprogram which operates on lists of
--- elements of tagged types. Provide the generic subprogram with two
--- formal parameters: (1) a formal derived tagged type which represents a
--- list element type, and (2) a generic formal package with the list
--- abstraction package as template. Use the formal derived type as the
--- generic formal actual part for the formal package. Within the generic
--- subprogram, call the operation of the root tagged type. In the main
--- program, instantiate the generic list package and the generic
--- subprogram with the root tagged type and each derivative, then call
--- each instance with an object of the appropriate type.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FC51D00.A
--- -> CC51D01.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 04 Jan 95 SAIC Moved declaration of type Ranked_ID_Type from
--- main subprogram to package CC51D01_0. Removed
--- case passing class-wide actual to instance.
--- Updated test description and modified comments.
---
---!
-
-package CC51D01_0 is -- This package simulates support for a personnel
- -- database.
-
- type SSN_Type is new String (1 .. 9);
-
- type Blind_ID_Type is tagged record -- Root type of
- SSN : SSN_Type; -- class.
- -- ... Other components.
- end record;
-
- procedure Update_ID (Item : in out Blind_ID_Type); -- Parent operation.
-
- -- ... Other operations.
-
-
- type Name_Type is new String (1 .. 9);
-
- type Named_ID_Type is new Blind_ID_Type with record -- Direct derivative
- Name : Name_Type := "Doe "; -- of root type.
- -- ... Other components.
- end record;
-
- -- Inherits Update_ID from parent.
-
- procedure Update_ID (Item : in out Named_ID_Type); -- Overrides parent's
- -- implementation.
-
-
- type Ranked_ID_Type is new Named_ID_Type with record
- Level : Integer := 0; -- Indirect derivative
- -- ... Other components. -- of root type.
- end record;
-
- -- Inherits Update_ID from parent.
-
-end CC51D01_0;
-
-
- --==================================================================--
-
-
-package body CC51D01_0 is
-
- -- The implementations of Update_ID are purely artificial; the validity of
- -- their implementations in the context of the abstraction is irrelevant to
- -- the feature being tested.
-
- procedure Update_ID (Item : in out Blind_ID_Type) is
- begin
- Item.SSN := "111223333";
- end Update_ID;
-
-
- procedure Update_ID (Item : in out Named_ID_Type) is
- begin
- Item.SSN := "444556666";
- -- ... Other stuff.
- end Update_ID;
-
-end CC51D01_0;
-
-
- --==================================================================--
-
-
--- --
--- Formal package used here. --
--- --
-
-with FC51D00; -- Generic list abstraction.
-with CC51D01_0; -- Tagged type declarations.
-generic -- This procedure simulates a generic operation for types
- -- in the class rooted at Blind_ID_Type.
- type Elem_Type is new CC51D01_0.Blind_ID_Type with private;
- with package List_Mgr is new FC51D00 (Elem_Type);
-procedure CC51D01_1 (L : in out List_Mgr.List_Type; E : in Elem_Type);
-
-
- --==================================================================--
-
-
--- The implementation of CC51D01_1 is purely artificial; the validity
--- of its implementation in the context of the abstraction is irrelevant
--- to the feature being tested.
---
--- The expected behavior here is as follows: for each actual type corresponding
--- to Elem_Type, the call to Update_ID should invoke the actual type's
--- implementation, which updates the object's SSN field. Write_Element then
--- adds the object to the list.
-
-procedure CC51D01_1 (L : in out List_Mgr.List_Type; E : in Elem_Type) is
- Element : Elem_Type := E; -- Can't update IN parameter.
-begin
- Update_ID (Element); -- Executes actual type's version.
- List_Mgr.Write_Element (1, L, Element); -- Executes actual type's version.
-end CC51D01_1;
-
-
- --==================================================================--
-
-
-with FC51D00; -- Generic list abstraction.
-with CC51D01_0; -- Tagged type declarations.
-with CC51D01_1; -- Generic operation.
-
-with Report;
-procedure CC51D01 is
-
- use CC51D01_0; -- All types & ops
- -- directly visible.
-
- -- Begin test code declarations: -----------------------
-
- TC_Expected_1 : Blind_ID_Type := (SSN => "111223333");
- TC_Expected_2 : Named_ID_Type := ("444556666", "Doe ");
- TC_Expected_3 : Ranked_ID_Type := ("444556666", "Doe ", 0);
-
- TC_Initial_1 : Blind_ID_Type := (SSN => "777889999");
- TC_Initial_2 : Named_ID_Type := ("777889999", "Doe ");
- TC_Initial_3 : Ranked_ID_Type := ("777889999", "Doe ", 0);
-
- -- End test code declarations. -------------------------
-
-
- -- Begin instantiations and list declarations: ---------
-
- -- At this point in an application, the generic list package would be
- -- instantiated for one of the visible tagged types. Next, the generic
- -- subprogram would be instantiated for the same tagged type and the
- -- preceding list package instance.
- --
- -- In order to cover all the important cases, this test instantiates several
- -- packages and subprograms (probably more than would typically appear
- -- in user code).
-
- -- Support for lists of blind IDs:
-
- package Blind_Lists is new FC51D00 (Blind_ID_Type);
- procedure Update_and_Write is new CC51D01_1 (Blind_ID_Type, Blind_Lists);
- Blind_List : Blind_Lists.List_Type;
-
-
- -- Support for lists of named IDs:
-
- package Named_Lists is new FC51D00 (Named_ID_Type);
- procedure Update_and_Write is new -- Overloads subprog
- CC51D01_1 (Elem_Type => Named_ID_Type, -- for Blind_ID_Type.
- List_Mgr => Named_Lists);
- Named_List : Named_Lists.List_Type;
-
-
- -- Support for lists of ranked IDs:
-
- package Ranked_Lists is new FC51D00 (Ranked_ID_Type);
- procedure Update_and_Write is new -- Overloads.
- CC51D01_1 (Elem_Type => Ranked_ID_Type,
- List_Mgr => Ranked_Lists);
- Ranked_List : Ranked_Lists.List_Type;
-
- -- End instantiations and list declarations. -----------
-
-
-begin
- Report.Test ("CC51D01", "Formal private extension, specific tagged " &
- "type actual: body of primitive subprogram executed is " &
- "that of actual type. Check for subprograms declared in " &
- "a formal package");
-
-
- Update_and_Write (Blind_List, TC_Initial_1);
-
- if (Blind_Lists.View_Element (1, Blind_List) /= TC_Expected_1) then
- Report.Failed ("Wrong result for root tagged type");
- end if;
-
-
- Update_and_Write (Named_List, TC_Initial_2);
-
- if (Named_Lists.View_Element (1, Named_List) /= TC_Expected_2) then
- Report.Failed ("Wrong result for type derived directly from root");
- end if;
-
-
- Update_and_Write (Ranked_List, TC_Initial_3);
-
- if (Ranked_Lists.View_Element (1, Ranked_List) /= TC_Expected_3) then
- Report.Failed ("Wrong result for type derived indirectly from root");
- end if;
-
-
- Report.Result;
-end CC51D01;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc51d02.a b/gcc/testsuite/ada/acats/tests/cc/cc51d02.a
deleted file mode 100644
index 52055639179..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc51d02.a
+++ /dev/null
@@ -1,244 +0,0 @@
--- CC51D02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, in an instance, each implicit declaration of a user-defined
--- subprogram of a formal private extension declares a view of the
--- corresponding primitive subprogram of the ancestor, and that if the
--- tag in a call is statically determined to be that of the formal type,
--- the body executed will be that corresponding to the actual type.
---
--- Check subprograms declared within a generic formal package. Check for
--- the case where the actual type passed to the formal private extension
--- is a class-wide type. Check for several types in the same class.
---
---
--- TEST DESCRIPTION:
--- Declare a list abstraction in a generic package which manages lists of
--- elements of any nonlimited type (foundation code). Declare a package
--- which declares a tagged type and a derivative. Declare an operation
--- for the root tagged type and override it for the derivative. Declare
--- a generic subprogram which operates on lists of elements of tagged
--- types. Provide the generic subprogram with two formal parameters: (1)
--- a formal derived tagged type which represents a list element type, and
--- (2) a generic formal package with the list abstraction package as
--- template. Use the formal derived type as the generic formal actual
--- part for the formal package. Within the generic subprogram, call the
--- operation of the root tagged type. In the main program, instantiate
--- the generic list package and the generic subprogram with the class-wide
--- type for the root tagged type.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FC51D00.A
--- -> CC51D02.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 05 Jan 95 SAIC Changed types of TC_Expected_1 and TC_Expected_2
--- from specific to class-wide. Eliminated (illegal)
--- assignment step prior to comparison of
--- TC_Expected_X with item on stack.
---
---!
-
-package CC51D02_0 is -- This package simulates support for a personnel
- -- database.
-
- type SSN_Type is new String (1 .. 9);
-
- type Blind_ID_Type is tagged record -- Root type of
- SSN : SSN_Type; -- class.
- -- ... Other components.
- end record;
-
- procedure Update_ID (Item : in out Blind_ID_Type); -- Parent operation.
-
- -- ... Other operations.
-
-
- type Name_Type is new String (1 .. 9);
-
- type Named_ID_Type is new Blind_ID_Type with record -- Direct derivative
- Name : Name_Type := "Doe "; -- of root type.
- -- ... Other components.
- end record;
-
- -- Inherits Update_ID from parent.
-
- procedure Update_ID (Item : in out Named_ID_Type); -- Overrides parent's
- -- implementation.
-
-end CC51D02_0;
-
-
- --==================================================================--
-
-
-package body CC51D02_0 is
-
- -- The implementations of Update_ID are purely artificial; the validity of
- -- their implementations in the context of the abstraction is irrelevant to
- -- the feature being tested.
-
- procedure Update_ID (Item : in out Blind_ID_Type) is
- begin
- Item.SSN := "111223333";
- end Update_ID;
-
-
- procedure Update_ID (Item : in out Named_ID_Type) is
- begin
- Item.SSN := "444556666";
- -- ... Other stuff.
- end Update_ID;
-
-end CC51D02_0;
-
-
- --==================================================================--
-
-
--- --
--- Formal package used here. --
--- --
-
-with FC51D00; -- Generic list abstraction.
-with CC51D02_0; -- Tagged type declarations.
-generic -- This procedure simulates a generic operation for types
- -- in the class rooted at Blind_ID_Type.
- type Elem_Type (<>) is new CC51D02_0.Blind_ID_Type with private;
- with package List_Mgr is new FC51D00 (Elem_Type);
-procedure CC51D02_1 (L : in out List_Mgr.List_Type; E : in Elem_Type);
-
-
- --==================================================================--
-
-
--- The implementation of CC51D02_1 is purely artificial; the validity
--- of its implementation in the context of the abstraction is irrelevant
--- to the feature being tested.
---
--- The expected behavior here is as follows: for each actual type corresponding
--- to Elem_Type, the call to Update_ID should invoke the actual type's
--- implementation (based on the tag of the actual), which updates the object's
--- SSN field. Write_Element then adds the object to the list.
-
-procedure CC51D02_1 (L : in out List_Mgr.List_Type; E : in Elem_Type) is
- Element : Elem_Type := E; -- Can't update IN parameter.
- -- Initialization of unconstrained variable.
-begin
- Update_ID (Element); -- Executes actual type's version
- -- (for this test, this will be a
- -- dispatching call).
- List_Mgr.Write_Element (1, L, Element); -- Executes actual type's version
- -- (for this test, this will be a
- -- class-wide operation).
-end CC51D02_1;
-
-
- --==================================================================--
-
-
-with FC51D00; -- Generic list abstraction.
-with CC51D02_0; -- Tagged type declarations.
-with CC51D02_1; -- Generic operation.
-
-with Report;
-procedure CC51D02 is
-
- use CC51D02_0; -- All types & ops
- -- directly visible.
-
- -- Begin test code declarations: -----------------------
-
- TC_Expected_1 : Blind_ID_Type'Class :=
- Blind_ID_Type'(SSN => "111223333");
- TC_Expected_2 : Blind_ID_Type'Class :=
- Named_ID_Type'("444556666", "Doe ");
-
-
- TC_Initial_1 : Blind_ID_Type := (SSN => "777889999");
- TC_Initial_2 : Named_ID_Type := ("777889999", "Doe ");
- TC_Initial_3 : Blind_ID_Type'Class := TC_Initial_2;
-
- -- End test code declarations. -------------------------
-
-
- package ID_Class_Lists is new FC51D00 (Blind_ID_Type'Class);
-
- procedure Update_and_Write is new CC51D02_1 (Blind_ID_Type'Class,
- ID_Class_Lists);
-
- Blind_List : ID_Class_Lists.List_Type;
- Named_List : ID_Class_Lists.List_Type;
- Maimed_List : ID_Class_Lists.List_Type;
-
-
-begin
- Report.Test ("CC51D02", "Formal private extension, class-wide actual: " &
- "body of primitive subprogram executed is that of actual " &
- "type. Check for subprograms declared in formal package");
-
-
- Update_and_Write (Blind_List, TC_Initial_1); -- Test root type actual.
-
- if (ID_Class_Lists.View_Element (1, Blind_List) not in Blind_ID_Type) then
- Report.Failed ("Result for root type actual is not in proper class");
- elsif (ID_Class_Lists.View_Element (1, Blind_List) /= TC_Expected_1) then
- Report.Failed ("Wrong result for root type actual");
- end if;
-
-
- Update_and_Write (Named_List, TC_Initial_2); -- Test derived type actual.
-
- if (ID_Class_Lists.View_Element (1, Named_List) not in Named_ID_Type) then
- Report.Failed ("Result for derived type actual is not in proper class");
- elsif (ID_Class_Lists.View_Element (1, Named_List)/= TC_Expected_2) then
- Report.Failed ("Wrong result for derived type actual");
- end if;
-
-
- -- In the subtest below, an object of a class-wide type (TC_Initial_3) is
- -- passed to Update_and_Write. It has been initialized with an object of
- -- type Named_ID_Type, so the result should be identical to
- -- that of the Named_ID_Type subtest (namely TC_Expected_2). Note that
- -- a new list of Named IDs is used (Maimed_List). This is to assure test
- -- validity, since Named_List has already been updated by a previous
- -- subtest.
-
- Update_and_Write (Maimed_List, TC_Initial_3); -- Test class-wide actual.
-
- if (ID_Class_Lists.View_Element (1, Maimed_List) not in Named_ID_Type) then
- Report.Failed ("Result for class-wide actual is not in proper class");
- elsif (ID_Class_Lists.View_Element (1, Maimed_List) /= TC_Expected_2) then
- Report.Failed ("Wrong result for class-wide actual");
- end if;
-
-
- Report.Result;
-end CC51D02;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc54001.a b/gcc/testsuite/ada/acats/tests/cc/cc54001.a
deleted file mode 100644
index eb297d0ecdc..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc54001.a
+++ /dev/null
@@ -1,184 +0,0 @@
--- CC54001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a general access-to-constant type may be passed as an
--- actual to a generic formal access-to-constant type.
---
--- TEST DESCRIPTION:
--- The generic implements a stack of access objects as an array. The
--- designated type of the formal access type is itself a formal private
--- type declared in the same generic formal part.
---
--- The generic is instantiated with an unconstrained subtype of String,
--- which results in a stack which can accommodate strings of varying
--- lengths (ragged array). Furthermore, the access objects to be pushed
--- onto the stack are created both statically and dynamically, utilizing
--- allocators and the 'Access attribute.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Apr 96 SAIC ACVC 2.1: Added pragma Elaborate to context clause
--- preceding CC54001_1.
---
---!
-
-generic
- Size : in Positive;
- type Element_Type (<>) is private;
- type Element_Ptr is access constant Element_Type;
-package CC54001_0 is -- Generic stack of pointers.
-
- type Stack_Type is private;
-
- procedure Push (Stack : in out Stack_Type;
- Elem_Ptr : in Element_Ptr);
-
- procedure Pop (Stack : in out Stack_Type;
- Elem_Ptr : out Element_Ptr);
-
- -- ... Other operations.
-
-private
-
- subtype Index is Positive range 1 .. (Size + 1);
- type Stack_Type is array (Index) of Element_Ptr; -- Last element unused.
-
- Top : Index := 1;
-
-end CC54001_0;
-
-
- --===================================================================--
-
-
-package body CC54001_0 is
-
- procedure Push (Stack : in out Stack_Type;
- Elem_Ptr : in Element_Ptr) is
- begin
- Stack(Top) := Elem_Ptr;
- Top := Top + 1; -- Artificial: no Constraint_Error protection.
- end Push;
-
-
- procedure Pop (Stack : in out Stack_Type;
- Elem_Ptr : out Element_Ptr) is
- begin
- Top := Top - 1; -- Artificial: no Constraint_Error protection.
- Elem_Ptr := Stack(Top);
- end Pop;
-
-end CC54001_0;
-
-
- --===================================================================--
-
-
-with CC54001_0; -- Generic stack of pointers.
-pragma Elaborate (CC54001_0);
-
-package CC54001_1 is
-
- subtype Message is String;
- type Message_Ptr is access constant Message;
-
- Message_Count : constant := 4;
-
- Message_0 : aliased constant Message := "Hello";
- Message_1 : aliased constant Message := "Doctor";
- Message_2 : aliased constant Message := "Name";
- Message_3 : aliased constant Message := "Continue";
-
-
- package Stack_of_Messages is new CC54001_0
- (Element_Type => Message,
- Element_Ptr => Message_Ptr,
- Size => Message_Count);
-
- Message_Stack : Stack_Of_Messages.Stack_Type;
-
-
- procedure Create_Message_Stack;
-
-end CC54001_1;
-
-
- --===================================================================--
-
-
-package body CC54001_1 is
-
- procedure Create_Message_Stack is
- -- Push access objects onto stack. Note that some are statically
- -- allocated, and some are dynamically allocated (using an aliased
- -- object to initialize).
- begin
- Stack_Of_Messages.Push (Message_Stack, Message_0'Access); -- Static.
- Stack_Of_Messages.Push (Message_Stack,
- new Message'(Message_1)); -- Dynamic.
- Stack_Of_Messages.Push (Message_Stack, Message_2'Access); -- Static.
- Stack_Of_Messages.Push (Message_Stack, -- Dynamic.
- new Message'(Message_3));
- end Create_Message_Stack;
-
-end CC54001_1;
-
-
- --===================================================================--
-
-
-with CC54001_1;
-
-with Report;
-procedure CC54001 is
-
- package Messages renames CC54001_1.Stack_Of_Messages;
-
- Msg0, Msg1, Msg2, Msg3 : CC54001_1.Message_Ptr;
-
-begin
- Report.Test ("CC54001", "Check that a general access-to-constant type " &
- "may be passed as an actual to a generic formal " &
- "access-to-constant type");
-
- CC54001_1.Create_Message_Stack;
-
- Messages.Pop (CC54001_1.Message_Stack, Msg3); -- Pop items off stack in the
- Messages.Pop (CC54001_1.Message_Stack, Msg2); -- reverse order that they
- Messages.Pop (CC54001_1.Message_Stack, Msg1); -- were pushed.
- Messages.Pop (CC54001_1.Message_Stack, Msg0);
-
- if Msg0.all /= CC54001_1.Message_0 or else
- Msg1.all /= CC54001_1.Message_1 or else
- Msg2.all /= CC54001_1.Message_2 or else
- Msg3.all /= CC54001_1.Message_3
- then
- Report.Failed ("Items popped off of stack do not match those pushed");
- end if;
-
- Report.Result;
-end CC54001;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc54002.a b/gcc/testsuite/ada/acats/tests/cc/cc54002.a
deleted file mode 100644
index 623f25d6c86..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc54002.a
+++ /dev/null
@@ -1,223 +0,0 @@
--- CC54002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a general access-to-variable type may be passed as an
--- actual to a generic formal general access-to-variable type. Check that
--- designated objects may be read and updated through the access value.
---
--- TEST DESCRIPTION:
--- The generic implements a List of access objects as an array, which
--- is itself a component of a record. The designated type of the formal
--- access type is a formal private type declared in the same generic
--- formal part.
---
--- The access objects to be placed in the List are created both
--- statically and dynamically, utilizing allocators and the 'Access
--- attribute.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Apr 96 SAIC ACVC 2.1: Added pragma Elaborate to context clause
--- preceding CC54002_1.
---
---!
-
-generic
- Size : in Positive;
- type Element_Type (<>) is private;
- type Element_Ptr is access all Element_Type;
-package CC54002_0 is -- Generic list of pointers.
-
- subtype Index is Positive range 1 .. (Size + 1);
-
- type List_Array is array (Index) of Element_Ptr;
-
- type List_Type is record
- Elements : List_Array;
- Next : Index := 1; -- Next available "slot" in list.
- end record;
-
-
- procedure Put (List : in out List_Type;
- Elem_Ptr : in Element_Ptr;
- Location : in Index);
-
- procedure Get (List : in out List_Type;
- Elem_Ptr : out Element_Ptr;
- Location : in Index);
-
- -- ... Other operations.
-
-end CC54002_0;
-
-
- --===================================================================--
-
-
-package body CC54002_0 is
-
- procedure Put (List : in out List_Type;
- Elem_Ptr : in Element_Ptr;
- Location : in Index) is
- begin
- List.Elements(Location) := Elem_Ptr;
- end Put;
-
-
- procedure Get (List : in out List_Type;
- Elem_Ptr : out Element_Ptr;
- Location : in Index) is
- begin -- Artificial: no provision for getting "empty" element.
- Elem_Ptr := List.Elements(Location);
- end Get;
-
-end CC54002_0;
-
-
- --===================================================================--
-
-
-with CC54002_0; -- Generic List of pointers.
-pragma Elaborate (CC54002_0);
-
-package CC54002_1 is
-
- subtype Lengths is Natural range 0 .. 50;
-
- type Subscriber (NLen, ALen: Lengths := 50) is record
- Name : String(1 .. NLen);
- Address : String(1 .. ALen);
- -- ... Other components.
- end record;
-
- type Subscriber_Ptr is access all Subscriber; -- General access-to-
- -- variable type.
-
- package District_Subscription_Lists is new CC54002_0
- (Element_Type => Subscriber,
- Element_Ptr => Subscriber_Ptr,
- Size => 100);
-
- District_01_Subscribers : District_Subscription_Lists.List_Type;
-
-
- New_Subscriber_01 : aliased CC54002_1.Subscriber :=
- (12, 23, "Brown, Silas", "King's Pyland, Dartmoor");
-
- New_Subscriber_02 : aliased CC54002_1.Subscriber :=
- (16, 23, "Hatherly, Victor", "16A Victoria St. London");
-
-end CC54002_1;
-
--- No body for CC54002_1.
-
-
- --===================================================================--
-
-
-with CC54002_1;
-
-with Report;
-procedure CC54002 is
-
- Mod_Subscriber_01 : constant CC54002_1.Subscriber :=
- (12, 23, "Brown, Silas", "Mapleton, Dartmoor ");
-
- TC_Actual_01, TC_Actual_02 : CC54002_1.Subscriber_Ptr;
-
-
- use type CC54002_1.Subscriber; -- "/=" directly visible.
-
-begin
- Report.Test ("CC54002", "Check that a general access-to-variable type " &
- "may be passed as an actual to a generic formal " &
- "access-to-variable type");
-
-
- -- Add elements to the list:
-
- CC54002_1.District_Subscription_Lists.Put -- Element created statically.
- (List => CC54002_1.District_01_Subscribers,
- Elem_Ptr => CC54002_1.New_Subscriber_01'Access,
- Location => 1);
-
- CC54002_1.District_Subscription_Lists.Put -- Element created dynamically.
- (List => CC54002_1.District_01_Subscribers,
- Elem_Ptr => new CC54002_1.Subscriber'(CC54002_1.New_Subscriber_02),
- Location => 2);
-
-
- -- Manipulation of the objects on the list is performed below directly
- -- through the access objects. Although such manipulation is artificial
- -- from the perspective of this usage model, it is not artificial in
- -- general and is necessary in order to test the objective.
-
-
- -- Modify the first list element through the access object:
-
- CC54002_1.District_01_Subscribers.Elements(1).Address := -- Update
- "Mapleton, Dartmoor "; -- Implicit dereference. -- through the
- -- access
- -- object.
- -- Retrieve elements of the list:
-
- CC54002_1.District_Subscription_Lists.Get
- (CC54002_1.District_01_Subscribers,
- TC_Actual_01,
- 1);
-
- CC54002_1.District_Subscription_Lists.Get
- (CC54002_1.District_01_Subscribers,
- TC_Actual_02,
- 2);
-
- -- Verify list contents in two ways: 1st verify the directly-dereferenced
- -- access objects against the dereferenced access objects returned by Get;
- -- 2nd verify them against objects the expected values:
-
- -- Read
- -- through the
- -- access
- -- objects.
-
- if CC54002_1.District_01_Subscribers.Elements(1).all /= TC_Actual_01.all
- or else
- CC54002_1.District_01_Subscribers.Elements(2).all /= TC_Actual_02.all
- then
- Report.Failed ("Wrong results returned by Get");
-
- elsif CC54002_1.District_01_Subscribers.Elements(1).all /=
- Mod_Subscriber_01
- or
- CC54002_1.District_01_Subscribers.Elements(2).all /=
- CC54002_1.New_Subscriber_02
- then
- Report.Failed ("List elements do not have expected values");
- end if;
-
- Report.Result;
-end CC54002;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc54003.a b/gcc/testsuite/ada/acats/tests/cc/cc54003.a
deleted file mode 100644
index d8aaeaf9c81..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc54003.a
+++ /dev/null
@@ -1,234 +0,0 @@
--- CC54003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a general access-to-subprogram type may be passed as an
--- actual to a generic formal access-to-subprogram type. Check that
--- designated subprograms may be called by dereferencing the access
--- values.
---
--- TEST DESCRIPTION:
--- The generic implements a stack of access-to-subprogram objects as an
--- array. The profile of the access-to-subprogram formal corresponds to
--- a function which accepts a parameter of some type and returns an
--- object of the same type.
---
--- For this test, the functions for which access values will be pushed
--- onto the stack accept a parameter of type access-to-string, lengthen
--- the pointed-to string, then return an access object pointing to this
--- lengthened string.
---
--- The instance declares a function Execute_Stack which executes each
--- subprogram on the stack in sequence. This function accepts some initial
--- access-to-string, then returns an access object pointing to the
--- lengthened string resulting from the execution of the stacked
--- subprograms. Access-to-string objects are used rather than strings
--- themselves because the initial string "grows" during each iteration.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Apr 96 SAIC ACVC 2.1: Added pragma Elaborate to context clause
--- preceding CC54003_2.
---
---!
-
-generic
-
- Size : in Positive;
-
- type Item_Type (<>) is private;
- type Item_Ptr is access Item_Type;
-
- type Function_Ptr is access function (Item : Item_Ptr)
- return Item_Ptr;
-
-package CC54003_0 is -- Generic stack of pointers.
-
- type Stack_Type is private;
-
- procedure Push (Stack : in out Stack_Type;
- Func_Ptr : in Function_Ptr);
-
- function Execute_Stack (Stack : Stack_Type;
- Initial_Input : Item_Ptr) return Item_Ptr;
-
- -- ... Other operations.
-
-private
-
- subtype Index is Positive range 1 .. (Size + 1);
- type Stack_Type is array (Index) of Function_Ptr; -- Last slot unused.
-
- Top : Index := 1; -- Top refers to the next available slot.
-
-end CC54003_0;
-
-
- --===================================================================--
-
-
-package body CC54003_0 is
-
- procedure Push (Stack : in out Stack_Type;
- Func_Ptr : in Function_Ptr) is
- begin
- Stack(Top) := Func_Ptr;
- Top := Top + 1; -- Artificial: no Constraint_Error protection.
- end Push;
-
-
- -- Call each subprogram on the stack in sequence. For the first call, pass
- -- Initial_Input. For succeeding calls, pass the result of the previous
- -- call.
-
- function Execute_Stack (Stack : Stack_Type;
- Initial_Input : Item_Ptr) return Item_Ptr is
- Result : Item_Ptr := Initial_Input;
- begin
- for I in reverse Index'First .. (Top - 1) loop -- Artificial: no C_E
- Result := Stack(I)(Result); -- protection.
- end loop;
- return Result;
- end Execute_Stack;
-
-end CC54003_0;
-
-
- --===================================================================--
-
-
-package CC54003_1 is
-
- subtype Message is String;
- type Message_Ptr is access Message;
-
- function Add_Prefix (Msg_Ptr : Message_Ptr) return Message_Ptr;
- function Add_Suffix (Msg_Ptr : Message_Ptr) return Message_Ptr;
-
- -- ...Other operations.
-
-end CC54003_1;
-
-
- --===================================================================--
-
-
-package body CC54003_1 is
-
- function Add_Prefix (Msg_Ptr : Message_Ptr) return Message_Ptr is
- Sender : constant String := "Dummy: "; -- Artificial; in a real
- -- application Sender might
- New_Msg : Message := Sender & Msg_Ptr.all; -- be a call to a function.
- begin
- return new Message'(New_Msg);
- end Add_Prefix;
-
-
- function Add_Suffix (Msg_Ptr : Message_Ptr) return Message_Ptr is
- Time : constant String := " (12:03pm)"; -- Artificial; in a real
- -- application Time might be a
- New_Msg : Message := Msg_Ptr.all & Time; -- be a call to a function.
- begin
- return new Message'(New_Msg);
- end Add_Suffix;
-
-end CC54003_1;
-
-
- --===================================================================--
-
-
-with CC54003_0; -- Generic stack of pointers.
-pragma Elaborate (CC54003_0);
-
-with CC54003_1; -- Message abstraction.
-
-package CC54003_2 is
-
- type Operation_Ptr is access function (Msg_Ptr : CC54003_1.Message_Ptr)
- return CC54003_1.Message_Ptr;
-
- Maximum_Ops : constant := 4; -- Arbitrary.
-
- package Stack_of_Ops is new CC54003_0
- (Item_Type => CC54003_1.Message,
- Item_Ptr => CC54003_1.Message_Ptr,
- Function_Ptr => Operation_Ptr,
- Size => Maximum_Ops);
-
- Operation_Stack : Stack_Of_Ops.Stack_Type;
-
-
- procedure Create_Operation_Stack;
-
-end CC54003_2;
-
- --===================================================================--
-
-
-package body CC54003_2 is
-
- procedure Create_Operation_Stack is
- begin
- Stack_Of_Ops.Push (Operation_Stack, CC54003_1.Add_Prefix'Access);
- Stack_Of_Ops.Push (Operation_Stack, CC54003_1.Add_Suffix'Access);
- end Create_Operation_Stack;
-
-end CC54003_2;
-
-
- --===================================================================--
-
-
-with CC54003_1; -- Message abstraction.
-with CC54003_2; -- Message-operation stack.
-
-with Report;
-procedure CC54003 is
-
- package Msg_Ops renames CC54003_2.Stack_Of_Ops;
-
- Msg : CC54003_1.Message_Ptr := new CC54003_1.Message'("Hello there");
- Expected : CC54003_1.Message := "Dummy: Hello there (12:03pm)";
-
-begin
- Report.Test ("CC54003", "Check that a general access-to-subprogram type " &
- "may be passed as an actual to a generic formal " &
- "access-to-subprogram type");
-
- CC54003_2.Create_Operation_Stack;
-
- declare
- Actual : CC54003_1.Message_Ptr :=
- Msg_Ops.Execute_Stack (CC54003_2.Operation_Stack, Msg);
- begin
- if Actual.all /= Expected then
- Report.Failed ("Wrong result from dereferenced subprogram execution");
- end if;
- end;
-
- Report.Result;
-end CC54003;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc54004.a b/gcc/testsuite/ada/acats/tests/cc/cc54004.a
deleted file mode 100644
index 0023b3a7461..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc54004.a
+++ /dev/null
@@ -1,295 +0,0 @@
--- CC54004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the designated type of a generic formal pool-specific
--- access type may be class-wide. Check that calls to primitive
--- subprograms in the instance dispatch to the appropriate bodies when
--- the controlling operand is a dereference of an object of the access-
--- to-class-wide type.
---
--- TEST DESCRIPTION:
--- A hierarchy of types is declared in two packages. The root type of
--- the class is declared as abstract in a separate package. It possesses
--- an abstract primitive subprogram Handle. A concrete type extends the
--- root type in a second package with a component of an enumeration type.
--- A second type extends this extension in the same package. Both
--- derivatives override the root type's primitive subprogram with a
--- non-abstract subprogram.
---
--- The generic implements a heterogeneous stack of access-to-class-wide
--- objects in the root type's class. A subprogram declared in the
--- generic calls Handle using dereferences of each of the class-wide
--- objects on the stack as operand. Each call to Handle should dispatch
--- to the appropriate body based on the tag of the operand. The
--- overriding versions of Handle each set the component of the type to
--- a different value. The value of the component is checked to verify
--- that the calls dispatched correctly.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Apr 96 SAIC ACVC 2.1: Added pragma Elaborate to context clause
--- preceding CC54004_3.
---
---!
-
-package CC54004_0 is
-
- -- The types and operations defined here are artificial. The component
- -- TC_Code is the only component required for testing purposes.
-
- type TC_Code_Type is (None, Low, Medium);
-
- type Alert is abstract tagged record -- Abstract type.
- TC_Code : TC_Code_Type; -- Testing flag.
- end record;
-
- procedure Handle (A : in out Alert); -- Non-abstract primitive
- -- subprogram.
- -- ...Other operations.
-
- type Alert_Ptr is access Alert'Class; -- Access-to-class-wide
- -- type.
-end CC54004_0;
-
-
- --===================================================================--
-
-
-package body CC54004_0 is
-
- procedure Handle (A : in out Alert) is
- begin
- A.TC_Code := None;
- end Handle;
-
-end CC54004_0;
-
-
- --===================================================================--
-
-
-with CC54004_0;
-use CC54004_0;
-package CC54004_1 is
-
- type Low_Alert is new CC54004_0.Alert with record
- C1 : String (1 .. 5) := "Dummy";
- -- ...Other components.
- end record;
-
- procedure Handle (A : in out Low_Alert); -- Overrides parent's
- -- operations.
- --...Other operations.
-
-
- type Medium_Alert is new Low_Alert with record
- C : Integer := 6;
- -- ...Other components.
- end record;
-
- procedure Handle (A : in out Medium_Alert); -- Overrides parent's
- -- operations.
- --...Other operations.
-
-end CC54004_1;
-
-
- --===================================================================--
-
-package body CC54004_1 is
-
- procedure Handle (A : in out Low_Alert) is
- begin
- A.TC_Code := Low;
- end Handle;
-
- procedure Handle (A : in out Medium_Alert) is
- begin
- A.TC_Code := Medium;
- end Handle;
-
-end CC54004_1;
-
-
- --===================================================================--
-
-
-with CC54004_0;
-generic
- type Element_Type is abstract new CC54004_0.Alert with private;
- type Element_Ptr is access Element_Type'Class;
-package CC54004_2 is
-
- type Stack_Type is private;
-
- procedure Push (Stack : in out Stack_Type;
- Elem_Ptr : in Element_Ptr);
-
- procedure Pop (Stack : in out Stack_Type;
- Elem_Ptr : out Element_Ptr);
-
- procedure Process_Stack (Stack : in out Stack_Type);
-
- -- ... Other operations.
-
-private
-
- subtype Index is Positive range 1 .. 5;
- type Stack_Type is array (Index) of Element_Ptr;
-
- Top : Index := 1;
-
-end CC54004_2;
-
-
- --===================================================================--
-
-
-package body CC54004_2 is
-
- procedure Push (Stack : in out Stack_Type;
- Elem_Ptr : in Element_Ptr) is
- begin
- Stack(Top) := Elem_Ptr;
- Top := Top + 1; -- Artificial: no Constraint_Error protection.
- end Push;
-
-
- procedure Pop (Stack : in out Stack_Type;
- Elem_Ptr : out Element_Ptr)is
- begin
- Top := Top - 1; -- Artificial: no Constraint_Error protection.
- Elem_Ptr := Stack(Top);
- end Pop;
-
-
- -- Call Handle for each element on the stack. Since the dereferenced access
- -- object is of a class-wide type, all calls to Handle are dispatching. The
- -- version of Handle called will be that declared for the type
- -- corresponding to the tag of the operand.
-
- procedure Process_Stack (Stack : in out Stack_Type) is
- begin -- Artificial: no Constraint_Error protection.
- for I in reverse Index'First .. (Top - 1) loop
- Handle (Stack(I).all); -- Call dispatches based on
- end loop; -- tag of operand.
- end Process_Stack;
-
-end CC54004_2;
-
-
- --===================================================================--
-
-
-with CC54004_0;
-with CC54004_1;
-with CC54004_2;
-pragma Elaborate (CC54004_2);
-
-package CC54004_3 is
-
- package Alert_Stacks is new CC54004_2 (Element_Type => CC54004_0.Alert,
- Element_Ptr => CC54004_0.Alert_Ptr);
-
- -- All overriding versions of Handle visible at the point of instantiation.
-
- Alert_List : Alert_Stacks.Stack_Type;
-
- procedure TC_Create_Alert_Stack;
-
-end CC54004_3;
-
-
- --===================================================================--
-
-
-package body CC54004_3 is
-
- procedure TC_Create_Alert_Stack is
- begin
- Alert_Stacks.Push (Alert_List, new CC54004_1.Low_Alert);
- Alert_Stacks.Push (Alert_List, new CC54004_1.Medium_Alert);
- end TC_Create_Alert_Stack;
-
-end CC54004_3;
-
-
- --===================================================================--
-
-
-with CC54004_0;
-with CC54004_1;
-with CC54004_3;
-
-with Report;
-procedure CC54004 is
- TC_Low_Ptr, TC_Med_Ptr : CC54004_0.Alert_Ptr;
- TC_Low_Actual : CC54004_1.Low_Alert;
- TC_Med_Actual : CC54004_1.Medium_Alert;
-
- use type CC54004_0.TC_Code_Type;
-begin
- Report.Test ("CC54004", "Check that the designated type of a generic " &
- "formal pool-specific access type may be class-wide");
-
-
- -- Create stack of elements:
-
- CC54004_3.TC_Create_Alert_Stack;
-
-
- -- Commence dispatching operations on stack elements:
-
- CC54004_3.Alert_Stacks.Process_Stack (CC54004_3.Alert_List);
-
-
- -- Pop "handled" alerts off stack:
-
- CC54004_3.Alert_Stacks.Pop (CC54004_3.Alert_List, TC_Med_Ptr);
- CC54004_3.Alert_Stacks.Pop (CC54004_3.Alert_List, TC_Low_Ptr);
-
-
- -- Verify results:
-
- if TC_Low_Ptr.all not in CC54004_1.Low_Alert or else
- TC_Med_Ptr.all not in CC54004_1.Medium_Alert
- then
- Report.Failed ("Class-wide objects do not have expected tags");
-
- -- The explicit dereference of the "Pop"ed pointers results in views of
- -- the designated objects, the nominal subtypes of which are class-wide.
- -- In order to be able to reference the component TC_Code, these views
- -- must be converted to a specific type possessing that component.
-
- elsif CC54004_1.Low_Alert(TC_Low_Ptr.all).TC_Code /= CC54004_0.Low or
- CC54004_1.Medium_Alert(TC_Med_Ptr.all).TC_Code /= CC54004_0.Medium
- then
- Report.Failed ("Calls did not dispatch to expected operations");
- end if;
-
- Report.Result;
-end CC54004;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc70001.a b/gcc/testsuite/ada/acats/tests/cc/cc70001.a
deleted file mode 100644
index 65681b072e1..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc70001.a
+++ /dev/null
@@ -1,309 +0,0 @@
--- CC70001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the template for a generic formal package may be a child
--- package, and that a child instance which is an instance of the
--- template may be passed as an actual to the formal package. Check that
--- the visible part of the generic formal package includes the first list
--- of basic declarative items of the package specification.
---
--- TEST DESCRIPTION:
--- Declare a list abstraction in a generic package which manages lists of
--- elements of any nonlimited type. Declare a generic child package of
--- this package which defines additional list operations. Declare a
--- generic subprogram which operates on lists of elements of discrete
--- types. Provide the generic subprogram with three formal parameters:
--- (1) a formal discrete type which represents a list element type, (2)
--- a generic formal package with the parent list generic as template, and
--- (3) a generic formal package with the child list generic as template.
--- Use the formal discrete type as the generic formal actual part for the
--- parent formal package. In the main program, declare an instance of
--- parent, then declare an instance of the child which is itself a child
--- the parent's instance. Pass these instances as actuals to the generic
--- subprogram instance.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 05 Nov 95 SAIC ACVC 2.0.1 fixes: Corrected syntax of formal
--- package declaration.
--- 27 Feb 97 PWB.CTA Added an elaboration pragma.
---!
-
-generic
- type Element_Type is private; -- List elems may be of any nonlimited type.
-package CC70001_0 is -- List abstraction.
-
- type List_Type is limited private;
-
-
- -- Return true if current element is last in the list.
- function End_Of_List (L : List_Type) return Boolean;
-
- -- Set "current" pointer to first list element.
- procedure Reset (L : in out List_Type);
-
-private
-
- type Node_Type;
- type Node_Pointer is access Node_Type;
-
- type Node_Type is record
- Item : Element_Type;
- Next : Node_Pointer;
- end record;
-
- type List_Type is record
- First : Node_Pointer;
- Current : Node_Pointer;
- Last : Node_Pointer;
- end record;
-
-end CC70001_0;
-
-
- --==================================================================--
-
-
-package body CC70001_0 is
-
- function End_Of_List (L : List_Type) return Boolean is
- begin
- return (L.Current = null);
- end End_Of_List;
-
-
- procedure Reset (L : in out List_Type) is
- begin
- L.Current := L.First; -- Set "current" pointer to first
- end Reset; -- list element.
-
-end CC70001_0;
-
-
- --==================================================================--
-
-
--- Child must be generic since parent is generic. A formal parameter for
--- "element type" can not be provided here, because then the type of list
--- element assumed by these new operations would be different from that
--- defined by the list type declared in the parent.
-
-generic
-package CC70001_0.CC70001_1 is -- Additional list operations.
-
- -- Read from current element and advance "current" pointer.
- procedure Read_Element (L : in out List_Type; E : out Element_Type);
-
- -- Write to current element and advance "current" pointer.
- procedure Write_Element (L : in out List_Type; E : in Element_Type);
-
- -- Add element to end of list.
- procedure Add_Element (L : in out List_Type; E : in Element_Type);
-
-end CC70001_0.CC70001_1;
-
-
- --==================================================================--
-
-
-package body CC70001_0.CC70001_1 is
-
- procedure Read_Element (L : in out List_Type; E : out Element_Type) is
- begin
- -- ... Error-checking code omitted for brevity.
- E := L.Current.Item; -- Retrieve current element.
- L.Current := L.Current.Next; -- Advance "current" pointer.
- end Read_Element;
-
-
- procedure Write_Element (L : in out List_Type; E : in Element_Type) is
- begin
- -- ... Error-checking code omitted for brevity.
- L.Current.Item := E; -- Write to current element.
- L.Current := L.Current.Next; -- Advance "current" pointer.
- end Write_Element;
-
-
- procedure Add_Element (L : in out List_Type; E : in Element_Type) is
- New_Node : Node_Pointer := new Node_Type'(E, null);
- begin
- if L.First = null then -- No elements in list, so add new
- L.First := New_Node; -- element at beginning of list.
- else
- L.Last.Next := New_Node; -- Add new element at end of list.
- end if;
- L.Last := New_Node; -- Set last-in-list pointer.
- end Add_Element;
-
-end CC70001_0.CC70001_1;
-
-
- --==================================================================--
-
-
-with CC70001_0.CC70001_1; -- Generic list abstraction + additional operations.
-generic
-
- -- Import the list abstraction defined in CC70001_0, as well as the
- -- additional operations defined in CC70001_0.CC70001_1. Declare a formal
- -- discrete type. Restrict this generic procedure to operate only on lists
- -- of discrete elements by passing the formal discrete type as an actual
- -- parameter to the formal (parent) package.
-
- type Elem_Type is (<>); -- Discrete types only.
- with package List_Mgr is new CC70001_0 (Elem_Type);
- with package List_Ops is new List_Mgr.CC70001_1 (<>);
-
-procedure CC70001_2 (L : in out List_Mgr.List_Type);
-
-
- --==================================================================--
-
-
-procedure CC70001_2 (L : in out List_Mgr.List_Type) is
-begin
- List_Mgr.Reset (L);
- while not List_Mgr.End_Of_List (L) loop
- List_Ops.Write_Element (L, Elem_Type'First);
- end loop;
-end CC70001_2;
-
-
- --==================================================================--
-
-
-package CC70001_3 is
-
- type Points is range 0 .. 10;
-
- -- ... Various other types used by the application.
-
-end CC70001_3;
-
-
--- No body for CC70001_3;
-
-
- --==================================================================--
-
-
--- Declare instances of the generic list packages for the discrete type.
--- In order to establish that the type passed as an actual to the parent
--- generic (CC70001_0) is the one utilized by the child generic (CC70001_1),
--- the instance of the child must itself be declared as a child of the
--- instance of the parent. Since only library units may have or be children,
--- both instances must be library units.
-
-with CC70001_0; -- Generic list abstraction.
-with CC70001_3; -- Package containing discrete type declaration.
-pragma Elaborate (CC70001_0);
-package CC70001_4 is new CC70001_0 (CC70001_3.Points);
-
-with CC70001_0.CC70001_1; -- Generic extension to list abstraction.
-with CC70001_4;
-package CC70001_4.CC70001_5 is new CC70001_4.CC70001_1;
-
-
- --==================================================================--
-
-
-with CC70001_2; -- Generic "zeroing" op for lists of discrete types.
-with CC70001_3; -- Types for application.
-with CC70001_4.CC70001_5; -- Discrete list abstraction + additional ops.
-
-with Report;
-procedure CC70001 is
-
- package Lists_Of_Scores renames CC70001_4;
- package Score_Ops renames CC70001_4.CC70001_5;
-
- Scores : Lists_Of_Scores.List_Type; -- List of points.
-
- procedure Reset_All_Scores is new CC70001_2 -- Operation on lists of
- (Elem_Type => CC70001_3.Points, -- points.
- List_Mgr => Lists_Of_Scores,
- List_Ops => Score_Ops);
-
-
- -- Begin test code declarations: -----------------------
-
- type TC_Score_Array is array (1 .. 3) of CC70001_3.Points;
-
- TC_Initial_Values : constant TC_Score_Array := (2, 4, 6);
- TC_Final_Values : constant TC_Score_Array := (0, 0, 0);
-
- TC_Correct_Initial_Values : Boolean := False;
- TC_Correct_Final_Values : Boolean := False;
-
-
- procedure TC_Initialize_List (L : in out Lists_of_Scores.List_Type) is
- begin -- Initial list contains 3 scores
- for I in TC_Score_Array'Range loop -- with the values 2, 4, and 6.
- Score_Ops.Add_Element (L, TC_Initial_Values(I));
- end loop;
- end TC_Initialize_List;
-
-
- procedure TC_Verify_List (L : in out Lists_of_Scores.List_Type;
- Expected : in TC_Score_Array;
- OK : out Boolean) is
- Actual : TC_Score_Array;
- begin -- Verify that all scores have been
- Lists_of_Scores.Reset (L); -- set to zero.
- for I in TC_Score_Array'Range loop
- Score_Ops.Read_Element (L, Actual(I));
- end loop;
- OK := (Actual = Expected);
- end TC_Verify_List;
-
- -- End test code declarations. -------------------------
-
-
-begin
- Report.Test ("CC70001", "Check that the template for a generic formal " &
- "package may be a child package, and that a child instance " &
- "which is an instance of the template may be passed as an " &
- "actual to the formal package. Check that the visible part " &
- "of the generic formal package includes the first list of " &
- "basic declarative items of the package specification");
-
- TC_Initialize_List (Scores);
- TC_Verify_List (Scores, TC_Initial_Values, TC_Correct_Initial_Values);
-
- if not TC_Correct_Initial_Values then
- Report.Failed ("List contains incorrect initial values");
- end if;
-
- Reset_All_Scores (Scores);
- TC_Verify_List (Scores, TC_Final_Values, TC_Correct_Final_Values);
-
- if not TC_Correct_Final_Values then
- Report.Failed ("List contains incorrect final values");
- end if;
-
- Report.Result;
-end CC70001;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc70002.a b/gcc/testsuite/ada/acats/tests/cc/cc70002.a
deleted file mode 100644
index 3e4d9c40b30..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc70002.a
+++ /dev/null
@@ -1,241 +0,0 @@
--- CC70002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a formal package actual part may specify actual parameters
--- for a generic formal package. Check that these actual parameters may
--- be formal types, formal objects, and formal subprograms. Check that
--- the visible part of the generic formal package includes the first list
--- of basic declarative items of the package specification, and that if
--- the formal package actual part is (<>), it also includes the generic
--- formal part of the template for the formal package.
---
--- TEST DESCRIPTION:
--- Declare a generic package which defines a "signature" for mathematical
--- groups. Declare a second generic package which defines a
--- two-dimensional matrix abstraction. Declare a third generic package
--- which provides mathematical group operations for two-dimensional
--- matrices. Provide this third generic with two formal parameters: (1)
--- a generic formal package with the second generic as template and a
--- (<>) actual part, and (2) a generic formal package with the first
--- generic as template and an actual part that takes a formal type,
--- object, and subprogram from the first formal package as actuals.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-generic -- Mathematical group signature.
-
- type Group_Type is private;
-
- Identity : in Group_Type;
-
- with function Operation (Left, Right : Group_Type) return Group_Type;
--- with function Inverse... (omitted for brevity).
-
-package CC70002_0 is
-
- function Power (Left : Group_Type; Right : Integer) return Group_Type;
-
- -- ... Other group operations.
-
-end CC70002_0;
-
-
- --==================================================================--
-
-
-package body CC70002_0 is
-
- -- The implementation of Power is purely artificial; the validity of its
- -- implementation in the context of the abstraction is irrelevant to the
- -- feature being tested.
-
- function Power (Left : Group_Type; Right : Integer) return Group_Type is
- Result : Group_Type := Identity;
- begin
- Result := Operation (Result, Left); -- All this really does is add
- return Result; -- one to each matrix element.
- end Power;
-
-end CC70002_0;
-
-
- --==================================================================--
-
-
-generic -- 2D matrix abstraction.
- type Element_Type is range <>;
-
- type Abscissa is range <>;
- type Ordinate is range <>;
-
- type Matrix_2D is array (Abscissa, Ordinate) of Element_Type;
-package CC70002_1 is
-
- Add_Ident : constant Matrix_2D := (Abscissa => (others => 1));
- -- Artificial for
- -- testing purposes.
- -- ... Other identity matrices.
-
-
- function "+" (A, B : Matrix_2D) return Matrix_2D;
-
- -- ... Other operations.
-
-end CC70002_1;
-
-
- --==================================================================--
-
-
-package body CC70002_1 is
-
- function "+" (A, B : Matrix_2D) return Matrix_2D is
- C : Matrix_2D;
- begin
- for I in Abscissa loop
- for J in Ordinate loop
- C(I,J) := A(I,J) + B(I,J);
- end loop;
- end loop;
- return C;
- end "+";
-
-end CC70002_1;
-
-
- --==================================================================--
-
-
-with CC70002_0; -- Mathematical group signature.
-with CC70002_1; -- 2D matrix abstraction.
-
-generic -- Mathematical 2D matrix addition group.
-
- with package Matrix_Ops is new CC70002_1 (<>);
-
- -- Although the restriction of the formal package below to signatures
- -- describing addition groups, and then only for 2D matrices, is rather
- -- artificial in the context of this "application," the passing of types,
- -- objects, and subprograms as actuals to a formal package is not.
-
- with package Math_Sig is new CC70002_0
- (Group_Type => Matrix_Ops.Matrix_2D,
- Identity => Matrix_Ops.Add_Ident,
- Operation => Matrix_Ops."+");
-
-package CC70002_2 is
-
- -- Add two matrices that are to be multiplied by coefficients:
- -- [ ] = CA*[ ] + CB*[ ].
-
- function Add_Matrices_With_Coefficients (A : Matrix_Ops.Matrix_2D;
- CA : Integer;
- B : Matrix_Ops.Matrix_2D;
- CB : Integer)
- return Matrix_Ops.Matrix_2D;
-
- -- ...Other operations.
-
-end CC70002_2;
-
-
- --==================================================================--
-
-
-package body CC70002_2 is
-
- function Add_Matrices_With_Coefficients (A : Matrix_Ops.Matrix_2D;
- CA : Integer;
- B : Matrix_Ops.Matrix_2D;
- CB : Integer)
- return Matrix_Ops.Matrix_2D is
- Left, Right : Matrix_Ops.Matrix_2D;
- begin
- Left := Math_Sig.Power (A, CA); -- Multiply 1st array by its coeff.
- Right := Math_Sig.Power (B, CB); -- Multiply 2nd array by its coeff.
- return (Matrix_Ops."+" (Left, Right));-- Add these two arrays.
- end Add_Matrices_With_Coefficients;
-
-end CC70002_2;
-
-
- --==================================================================--
-
-
-with CC70002_0; -- Mathematical group signature.
-with CC70002_1; -- 2D matrix abstraction.
-with CC70002_2; -- Mathematical 2D matrix addition group.
-
-with Report;
-procedure CC70002 is
-
- subtype Cell_Type is Positive range 1 .. 3;
- subtype Category_Type is Positive range 1 .. 2;
-
- type Data_Points is new Natural range 0 .. 100;
-
- type Table_Type is array (Cell_Type, Category_Type) of Data_Points;
-
- package Data_Table_Support is new CC70002_1 (Data_Points,
- Cell_Type,
- Category_Type,
- Table_Type);
-
- package Data_Table_Addition_Group is new CC70002_0
- (Group_Type => Table_Type,
- Identity => Data_Table_Support.Add_Ident,
- Operation => Data_Table_Support."+");
-
- package Table_Add_Ops is new CC70002_2
- (Data_Table_Support, Data_Table_Addition_Group);
-
-
- Scores_Table : Table_Type := ( ( 12, 0),
- ( 21, 33),
- ( 49, 9) );
- Expected : Table_Type := ( ( 26, 2),
- ( 44, 68),
- ( 100, 20) );
-
-begin
- Report.Test ("CC70002", "Check that a generic formal package actual " &
- "part may specify formal objects, formal subprograms, " &
- "and formal types");
-
- Scores_Table := Table_Add_Ops.Add_Matrices_With_Coefficients
- (Scores_Table, 2,
- Scores_Table, 1);
-
- if (Scores_Table /= Expected) then
- Report.Failed ("Incorrect result for multi-dimensional array");
- end if;
-
- Report.Result;
-end CC70002;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc70003.a b/gcc/testsuite/ada/acats/tests/cc/cc70003.a
deleted file mode 100644
index d2309fc3695..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc70003.a
+++ /dev/null
@@ -1,212 +0,0 @@
--- CC70003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the actual passed to a formal package may be a formal
--- access-to-subprogram type. Check that the visible part of the generic
--- formal package includes the first list of basic declarative items of
--- the package specification.
---
--- TEST DESCRIPTION:
--- Declare a list abstraction in a generic package which manages lists of
--- elements of any nonlimited type (foundation code). Declare a generic
--- package which supports the execution of lists of operations. Provide
--- the generic package with two formal parameters: (1) a formal access-
--- to-function type, and (2) a generic formal package with the list
--- abstraction package as template. Within a procedure declared in the
--- list-execution package, utilize information about the profile of
--- the functions in the list. Declare a package which declares functions
--- matching the profile of the formal access-to-subprogram type. In the
--- main program, create a list of pointers to the functions declared in
--- the package, instantiate the list abstraction and list-execution
--- packages, and use the list-execution procedure to call each of the
--- functions in the list in sequence.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-generic
- type Element_Type is private;
-package CC70003_0 is -- This package simulates a generic list abstraction.
-
- -- The definition of List_Type below is purely artificial; its validity
- -- in the context of the abstraction is irrelevant to the feature being
- -- tested.
-
- type Element_Ptr is access Element_Type;
-
- subtype List_Size is Natural range 1 .. 2;
- type List_Type is array (List_Size) of Element_Ptr;
-
- function View_Element (I : List_Size; L : List_Type) return Element_Type;
-
- procedure Write_Element (I : in List_Size;
- L : in out List_Type;
- E : in Element_Type);
-
- -- ... Other list operations for Element_Type.
-
-end CC70003_0;
-
-
- --==================================================================--
-
-
-package body CC70003_0 is
-
- -- The implementations of the operations below are purely artificial; the
- -- validity of their implementations in the context of the abstraction is
- -- irrelevant to the feature being tested.
-
- function View_Element (I : List_Size; L : List_Type) return Element_Type is
- begin
- return L(I).all;
- end View_Element;
-
-
- procedure Write_Element (I : in List_Size;
- L : in out List_Type;
- E : in Element_Type) is
- begin
- L(I) := new Element_Type'(E);
- end Write_Element;
-
-end CC70003_0;
-
-
- --==================================================================--
-
-
-with CC70003_0; -- Generic list abstraction.
-generic
- type Elem_Type is access function (F : Float) return Float;
- with package List_Mgr is new CC70003_0 (Elem_Type);
-package CC70003_1 is -- This package simulates support for executing lists
- -- of operations.
-
- procedure Execute_List (L : List_Mgr.List_Type; F : in out Float);
-
- -- ... Other operations.
-
-end CC70003_1;
-
-
- --==================================================================--
-
-
-package body CC70003_1 is
-
- procedure Execute_List (L : List_Mgr.List_Type; F : in out Float) is
- begin
- for I in L'Range loop
- F := List_Mgr.View_Element(I, L)(F); -- Execute next operation in
- end loop; -- list with current value of
- end Execute_List; -- F as operand.
-
-
-end CC70003_1;
-
-
- --==================================================================--
-
-
-package CC70003_2 is
-
- function Sine (F : Float) return Float;
- function Exp (F : Float) return Float;
-
- -- ... Other math functions.
-
-end CC70003_2;
-
-
- --==================================================================--
-
-
-package body CC70003_2 is
-
- -- The implementations of the functions below are purely artificial; the
- -- validity of their implementations in the context of the abstraction is
- -- irrelevant to the feature being tested.
-
- function Sine (F : Float) return Float is
- begin
- return (-0.15);
- end Sine;
-
- function Exp (F : Float) return Float is
- begin
- if (F = 0.0) then
- return (-0.69);
- else
- return (2.0); -- This branch should be taken.
- end if;
- end Exp;
-
-end CC70003_2;
-
-
- --==================================================================--
-
-
-with CC70003_0; -- Generic list abstraction.
-with CC70003_1; -- Generic operation-list abstraction.
-with CC70003_2; -- Math library.
-
-with Report;
-procedure CC70003 is
-
- type Math_Op is access function (F : Float) return Float;
-
- package Math_Op_Lists is new CC70003_0 (Math_Op);
- package Math_Op_List_Support is new CC70003_1 (Math_Op, Math_Op_Lists);
-
- Sin_Ptr : Math_Op := CC70003_2.Sine'Access;
- Exp_Ptr : Math_Op := CC70003_2.Exp'Access;
-
- Op_List : Math_Op_Lists.List_Type;
-
- Operand : Float := 0.0;
- Expected : Float := 2.0;
-
-
-begin
- Report.Test ("CC70003", "Check that the actual passed to a formal " &
- "package may be a formal access-to-subprogram type");
-
- Math_Op_Lists.Write_Element (1, Op_List, Sin_Ptr);
- Math_Op_Lists.Write_Element (2, Op_List, Exp_Ptr);
-
- Math_Op_List_Support.Execute_List (Op_List, Operand);
-
- if (Operand /= Expected) then
- Report.Failed ("Incorrect results from indirect function calls");
- end if;
-
- Report.Result;
-end CC70003;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc70a01.a b/gcc/testsuite/ada/acats/tests/cc/cc70a01.a
deleted file mode 100644
index ac92f437a44..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc70a01.a
+++ /dev/null
@@ -1,208 +0,0 @@
--- CC70A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the visible part of a generic formal package includes the
--- first list of basic declarative items of the package specification.
--- Check for a generic package which declares a formal package with (<>)
--- as its actual part.
---
--- TEST DESCRIPTION:
--- The "first list of basic declarative items" of a package specification
--- is the visible part of the package. Thus, the declarations in the
--- visible part of the actual instance corresponding to a formal
--- package are available in the generic which declares the formal package.
---
--- Declare a generic package which simulates a complex integer abstraction
--- (foundation code).
---
--- Declare a second, library-level generic package which utilizes the
--- first generic package as a generic formal package (with a (<>)
--- actual_part). In the second generic package, declare objects, types,
--- and operations in terms of the objects, types, and operations declared
--- in the first generic package.
---
--- In the main program, instantiate the first generic package, then
--- instantiate the second generic package and pass the first instance
--- to it as a generic actual parameter. Check that the operations in
--- the second instance perform as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FC70A00; -- Generic complex integer operations.
-
-generic -- Generic complex matrix operations.
- with package Complex_Package is new FC70A00 (<>);
-package CC70A01_0 is
-
- type Complex_Matrix_Type is -- 1st index is matrix
- array (Positive range <>, Positive range <>) -- row, 2nd is column.
- of Complex_Package.Complex_Type;
- Dimension_Mismatch : exception;
-
-
- function Identity_Matrix (Size : Positive) -- Create identity matrix
- return Complex_Matrix_Type; -- of specified size.
-
- function "*" (Left : Complex_Matrix_Type; -- Multiply two complex
- Right : Complex_Matrix_Type) -- matrices.
- return Complex_Matrix_Type;
-
-end CC70A01_0;
-
-
- --==================================================================--
-
-
-package body CC70A01_0 is -- Generic complex matrix operations.
-
- use Complex_Package;
-
- --==============================================--
-
- function Inner_Product (Left, Right : Complex_Matrix_Type;
- Row, Column : Positive) -- Compute inner product
- return Complex_Package.Complex_Type is -- for matrix-multiply.
-
- Result : Complex_Type := Zero;
- subtype Vector_Size is Positive range Left'Range(2);
-
- begin -- Inner_Product.
- for I in Vector_Size loop
- Result := Result + -- Complex_Package."+".
- (Left(Row, I) * Right(I, Column)); -- Complex_Package."*".
- end loop;
- return (Result);
- end Inner_Product;
-
- --==============================================--
-
- function Identity_Matrix (Size : Positive) return Complex_Matrix_Type is
- Result : Complex_Matrix_Type (1 .. Size, 1 .. Size) :=
- (others => (others => Zero)); -- Zeroes everywhere...
- begin
- for I in 1 .. Size loop
- Result (I, I) := One; -- Ones on the diagonal.
- end loop;
- return (Result);
- end Identity_Matrix;
-
- --==============================================--
-
- function "*" (Left : Complex_Matrix_Type; Right : Complex_Matrix_Type)
- return Complex_Matrix_Type is
-
- subtype Rows is Positive range Left'Range(1);
- subtype Columns is Positive range Right'Range(2);
-
- Result : Complex_Matrix_Type(Rows, Columns);
- begin
- if Left'Length(2) /= Right'Length(1) then -- # columns of Left must
- -- match # rows of Right.
- raise Dimension_Mismatch;
- else
- for I in Rows loop
- for J in Columns loop
- Result(I, J) := Inner_Product (Left, Right, I, J);
- end loop;
- end loop;
- return (Result);
- end if;
- end "*";
-
-end CC70A01_0;
-
-
- --==================================================================--
-
-
-with Report;
-
-with FC70A00; -- Generic complex integer operations.
-with CC70A01_0; -- Generic complex matrix operations.
-
-procedure CC70A01 is
-
- type My_Integer is range -100 .. 100;
-
- package My_Complex_Package is new FC70A00 (My_Integer);
- package My_Matrix_Package is new CC70A01_0 (My_Complex_Package);
-
- use My_Complex_Package, -- All user-defined
- My_Matrix_Package; -- operators directly
- -- visible.
-
- subtype Matrix_2x2 is Complex_Matrix_Type (1 .. 2, 1 .. 2);
- subtype Matrix_2x3 is Complex_Matrix_Type (1 .. 2, 1 .. 3);
-
- function C (Real, Imag : My_Integer) return Complex_Type renames Complex;
-
-begin -- Main program.
-
- Report.Test ("CC70A01", "Check that the visible part of a generic " &
- "formal package includes the first list of basic " &
- "declarative items of the package specification. Check " &
- "for a generic package where formal package has (<>) " &
- "actual part");
-
- declare
- Identity_2x2 : Matrix_2x2 := Identity_Matrix (Size => 2);
- Operand_2x3 : Matrix_2x3 := ( ( C(1, 2), C(3, 6), C(5, 1) ),
- ( C(0, 3), C(7, 9), C(3, 4) ) );
- Result_2x3 : Matrix_2x3 := ( others => ( others => Zero ) );
- begin
-
- begin -- Block #1.
- Result_2x3 := Identity_2x2 * Operand_2x3; -- Should return
- -- Operand_2x3.
- if (Result_2x3 /= Operand_2x3) then
- Report.Failed ("Incorrect results from matrix multiplication");
- end if;
- exception
- when others =>
- Report.Failed ("Unexpected exception raised - Block #1");
- end; -- Block #1.
-
-
- begin -- Block #2.
- Result_2x3 := Operand_2x3 * Identity_2x2; -- Can't multiply 2x3
- -- by 2x2.
- Report.Failed ("Exception Dimension_Mismatch not raised");
- exception
- when Dimension_Mismatch =>
- null;
- when others =>
- Report.Failed ("Unexpected exception raised - Block #2");
- end; -- Block #2.
-
- end;
-
- Report.Result;
-
-end CC70A01;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc70a02.a b/gcc/testsuite/ada/acats/tests/cc/cc70a02.a
deleted file mode 100644
index 3601ce443e1..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc70a02.a
+++ /dev/null
@@ -1,193 +0,0 @@
--- CC70A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the visible part of a generic formal package includes the
--- first list of basic declarative items of the package specification.
--- Check for a generic subprogram which declares a formal package with
--- (<>) as its actual part.
---
--- TEST DESCRIPTION:
--- The "first list of basic declarative items" of a package specification
--- is the visible part of the package. Thus, the declarations in the
--- visible part of the actual instance corresponding to a formal
--- package are available in the generic which declares the formal package.
---
--- Declare a generic package which simulates a complex integer abstraction
--- (foundation code).
---
--- Declare a second generic package which defines a "signature" for
--- mathematical groups. Declare a generic function within a package
--- which utilizes the second generic package as a generic formal package
--- (with a (<>) actual_part).
---
--- In the main program, instantiate the first generic package, then
--- instantiate the second generic package with objects, types, and
--- operations declared in the first instance.
---
--- Instantiate the generic function and pass the second instance
--- to it as a generic actual parameter. Check that the instance of the
--- generic function performs as expected.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-generic -- Mathematical group signature.
-
- type Group_Type is private;
-
- Identity : in Group_Type;
-
- with function Operation (Left, Right : Group_Type) return Group_Type;
- with function Inverse (Right : Group_Type) return Group_Type;
-
-package CC70A02_0 is end;
-
--- No body for CC70A02_0.
-
-
- --==================================================================--
-
-
-with CC70A02_0; -- Mathematical group signature.
-
-package CC70A02_1 is -- Mathematical group operations.
-
- -- --
- -- Generic formal package used here --
- -- --
-
- generic -- Powers for mathematical groups.
- with package Group is new CC70A02_0 (<>);
- function Power (Left : Group.Group_Type; Right : Integer)
- return Group.Group_Type;
-
-
-end CC70A02_1;
-
-
- --==================================================================--
-
-
-package body CC70A02_1 is -- Mathematical group operations.
-
-
-
- function Power (Left : Group.Group_Type; Right : Integer)
- return Group.Group_Type is
- Result : Group.Group_Type := Group.Identity;
- begin
- for I in 1 .. abs(Right) loop -- Repeat group operations
- Result := Group.Operation (Result, Left); -- the specified number of
- end loop; -- times.
-
- if Right < 0 then -- If specified power is
- return Group.Inverse (Result); -- negative, return the
- else -- inverse of the result.
- return Result; -- If it is zero, return
- end if; -- the identity.
- end Power;
-
-
-end CC70A02_1;
-
-
- --==================================================================--
-
-
-with Report;
-
-with FC70A00; -- Complex integer abstraction.
-with CC70A02_0; -- Mathematical group signature.
-with CC70A02_1; -- Mathematical group operations.
-
-procedure CC70A02 is
-
- -- Declare an instance of complex integers:
-
- type My_Integer is range -100 .. 100;
- package Complex_Integers is new FC70A00 (My_Integer);
-
-
- -- Define an addition group for complex integers:
-
- package Complex_Addition_Group is new CC70A02_0
- (Group_Type => Complex_Integers.Complex_Type, -- For complex integers...
- Identity => Complex_Integers.Zero, -- Additive identity.
- Operation => Complex_Integers."+", -- Additive operation.
- Inverse => Complex_Integers."-"); -- Additive inverse.
-
- function Complex_Multiplication is new -- Multiplication of a
- CC70A02_1.Power(Complex_Addition_Group); -- complex integer by a
- -- constant.
-
-
- -- Define a multiplication group for complex integers:
-
- package Complex_Multiplication_Group is new CC70A02_0
- (Group_Type => Complex_Integers.Complex_Type, -- For complex integers...
- Identity => Complex_Integers.One, -- Multiplicative identity.
- Operation => Complex_Integers."*", -- Multiplicative oper.
- Inverse => Complex_Integers.Reciprocal); -- Multiplicative inverse.
-
- function Complex_Exponentiation is new -- Exponentiation of a
- CC70A02_1.Power(Complex_Multiplication_Group); -- complex integer by a
- -- constant.
-
- use Complex_Integers;
-
-
-begin -- Main program.
-
- Report.Test ("CC70A02", "Check that the visible part of a generic " &
- "formal package includes the first list of basic " &
- "declarative items of the package specification. Check " &
- "for a generic subprogram where formal package has (<>) " &
- "actual part");
-
- declare
- Mult_Operand : constant Complex_Type := Complex ( -4, 9);
- Exp_Operand : constant Complex_Type := Complex ( 0, -7);
-
- Expected_Mult_Result : constant Complex_Type := Complex ( 28, -63);
- Expected_Exp_Result : constant Complex_Type := Complex (-49, 0);
- begin
-
- if Complex_Multiplication (Mult_Operand, -7) /= Expected_Mult_Result then
- Report.Failed ("Incorrect results from complex multiplication");
- end if;
-
- if Complex_Exponentiation (Exp_Operand, 2) /= Expected_Exp_Result then
- Report.Failed ("Incorrect results from complex exponentiation");
- end if;
-
- end;
-
- Report.Result;
-
-end CC70A02;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc70b01.a b/gcc/testsuite/ada/acats/tests/cc/cc70b01.a
deleted file mode 100644
index 6c514e17b06..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc70b01.a
+++ /dev/null
@@ -1,170 +0,0 @@
--- CC70B01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a formal package actual part may specify actual parameters
--- for a generic formal package. Check that a use clause in the generic
--- formal part provides direct visibility of declarations within the
--- generic formal package. Check that the scope of such a use clause
--- extends to the generic subprogram body. Check that the visible part of
--- the generic formal package includes the first list of basic
--- declarative items of the package specification.
---
--- Check the case where the formal package is declared in a generic
--- subprogram.
---
--- TEST DESCRIPTION:
--- Declare a list abstraction in a generic package which manages lists of
--- elements of any nonlimited type (foundation code). Declare a generic
--- subprogram which operates on lists of elements of discrete types.
--- Provide the generic subprogram with two formal parameters: (1) a
--- formal discrete type which represents a list element type, and (2) a
--- generic formal package with the list abstraction package as template.
--- Use the formal discrete type as the generic formal actual part for the
--- formal package. Include a use clause for the formal package in the
--- generic subprogram formal part.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FC70B00.A
--- CC70B01.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
--- Declare a generic subprogram which performs an operation on lists of
--- discrete objects.
-
-with FC70B00; -- Generic list abstraction.
-generic
-
- -- Import the list abstraction defined in FC70B00. To ensure that only
- -- list abstraction instances defining lists of *discrete* elements will be
- -- accepted as actuals to this generic, declare a formal discrete type and
- -- pass it as an actual parameter to the formal package.
- --
- -- Only instances declared for the same discrete type as that used to
- -- instantiate this generic subprogram will be accepted.
-
- type Elem_Type is (<>); -- Discrete types only.
- with package List_Mgr is new FC70B00 (Elem_Type);
-
- use List_Mgr; -- Use clause for formal package.
-
-procedure CC70B01_0 (L : in out List_Type); -- List_Mgr.List_Type directly
- -- visible.
-
-
- --==================================================================--
-
-
-procedure CC70B01_0 (L : in out List_Type) is -- Declarations in List_Mgr
-begin -- still directly visible.
- Reset (L);
- while not End_Of_List (L) loop
- Write_Element (L, Elem_Type'First); -- This statement assumes
- end loop; -- Elem_Type is discrete.
-end CC70B01_0;
-
-
- --==================================================================--
-
-
-with FC70B00; -- Generic list abstraction.
-with CC70B01_0; -- Generic "zeroing" operation for lists of discrete types.
-
-with Report;
-procedure CC70B01 is
-
- type Points is range 0 .. 10; -- Discrete type.
- package Lists_of_Scores is new FC70B00 (Points); -- List-of-points
- -- abstraction.
- Scores : Lists_of_Scores.List_Type; -- List of points.
-
- procedure Reset_All_Scores is new -- Operation on lists of
- CC70B01_0 (Points, Lists_of_Scores); -- points.
-
-
- -- Begin test code declarations: -----------------------
-
- type TC_Score_Array is array (1 .. 3) of Points;
-
- TC_Initial_Values : constant TC_Score_Array := (2, 4, 6);
- TC_Final_Values : constant TC_Score_Array := (0, 0, 0);
-
- TC_Correct_Initial_Values : Boolean := False;
- TC_Correct_Final_Values : Boolean := False;
-
-
- procedure TC_Initialize_List (L : in out Lists_of_Scores.List_Type) is
- begin -- Initial list contains 3 scores
- for I in TC_Score_Array'Range loop -- with the values 2, 4, and 6.
- Lists_of_Scores.Add_Element (L, TC_Initial_Values(I));
- end loop;
- end TC_Initialize_List;
-
-
- procedure TC_Verify_List (L : in out Lists_of_Scores.List_Type;
- Expected : in TC_Score_Array;
- OK : out Boolean) is
- Actual : TC_Score_Array;
- begin -- Verify that all scores have been
- Lists_of_Scores.Reset (L); -- set to zero.
- for I in TC_Score_Array'Range loop
- Lists_of_Scores.Read_Element (L, Actual(I));
- end loop;
- OK := (Actual = Expected);
- end TC_Verify_List;
-
- -- End test code declarations. -------------------------
-
-
-begin
- Report.Test ("CC70B01", "Check that a library-level generic subprogram " &
- "may have a formal package as a formal parameter, and that " &
- "the generic formal actual part may specify explicit actual " &
- "parameters. Check that a use clause is legal in the " &
- "generic formal part");
-
- TC_Initialize_List (Scores);
- TC_Verify_List (Scores, TC_Initial_Values, TC_Correct_Initial_Values);
-
- if not TC_Correct_Initial_Values then
- Report.Failed ("List contains incorrect initial values");
- end if;
-
- Reset_All_Scores (Scores);
- TC_Verify_List (Scores, TC_Final_Values, TC_Correct_Final_Values);
-
- if not TC_Correct_Final_Values then
- Report.Failed ("List contains incorrect final values");
- end if;
-
- Report.Result;
-end CC70B01;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc70b02.a b/gcc/testsuite/ada/acats/tests/cc/cc70b02.a
deleted file mode 100644
index d27eea843f4..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc70b02.a
+++ /dev/null
@@ -1,222 +0,0 @@
--- CC70B02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a formal package actual part may specify actual parameters
--- for a generic formal package. Check that such an actual parameter may
--- be a formal parameter of a previously declared formal package
--- (with a (<>) actual part). Check that a use clause in the generic
--- formal part provides direct visibility of declarations within the
--- generic formal package, including formal parameters (if the formal
--- package has a (<>) actual part). Check that the scope of such a use
--- clause extends to the generic subprogram body. Check that the visible
--- part of the generic formal package includes the first list of basic
--- declarative items of the package specification.
---
--- Check the case where the formal package is declared in a generic
--- package.
---
--- TEST DESCRIPTION:
--- Declare a list abstraction in a generic package which manages lists of
--- elements of any nonlimited type (foundation code). Declare a second
--- generic package which declares operations on discrete types. Declare
--- a third generic package which combines the abstractions of the first
--- two generics and declares operations on lists of elements of discrete
--- types. Provide the third generic package with two formal parameters:
--- (1) a generic formal package with the discrete operation package as
--- template, and (2) a generic formal package with the list abstraction
--- package as template. Use the formal discrete type of the discrete
--- operations generic as the generic formal actual part for the second
--- formal package. Include a use clause for the first formal package in
--- the third generic package formal part.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FC70B00.A
--- CC70B02.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-generic
- type Discrete_Type is (<>); -- Discrete types only.
-package CC70B02_0 is -- Discrete type operations.
-
- procedure Double (Object : in out Discrete_Type);
-
- -- ... Other operations on discrete objects.
-
-end CC70B02_0;
-
-
- --==================================================================--
-
-
-package body CC70B02_0 is
-
- procedure Double (Object : in out Discrete_Type) is
- Doubled_Position : Integer := Discrete_Type'Pos (Object) * 2;
- begin
- -- ... Error-checking code omitted for brevity.
- Object := Discrete_Type'Val (Doubled_Position);
- end Double;
-
-end CC70B02_0;
-
-
- --==================================================================--
-
-
-with CC70B02_0; -- Discrete type operations.
-with FC70B00; -- List abstraction.
-generic
-
- -- Import both the discrete-operation and list abstractions. To ensure that
- -- only list abstraction instances defining lists of *discrete* elements
- -- will be accepted as actuals to this generic, pass the formal discrete
- -- type from the discrete-operation abstraction as an actual parameter to
- -- the list-abstraction formal package.
- --
- -- Only list instances declared for the same discrete type as that used
- -- to instantiate the discrete-operation package will be accepted.
-
- with package Discrete_Ops is new CC70B02_0 (<>);
-
- use Discrete_Ops; -- Discrete_Ops directly visible.
-
- with package List_Mgr is new FC70B00 (Discrete_Type); -- Discrete_Type is
- -- formal parameter
- -- of template for
- -- Discrete_Ops.
-package CC70B02_1 is -- Discrete list operations.
-
- procedure Double_List (L : in out List_Mgr.List_Type);
-
- -- ... Other operations on lists of discrete objects.
-
-end CC70B02_1;
-
-
- --==================================================================--
-
-
-package body CC70B02_1 is
-
- procedure Double_List (L : in out List_Mgr.List_Type) is
- Element : Discrete_Type; -- Formal part of Discrete_Ops template
- begin -- is directly visible here.
- List_Mgr.Reset (L);
- while not List_Mgr.End_Of_List (L) loop
- List_Mgr.View_Element (L, Element);
- Double (Element);
- List_Mgr.Write_Element (L, Element);
- end loop;
- end Double_List;
-
-end CC70B02_1;
-
-
- --==================================================================--
-
-
-with FC70B00; -- Generic list abstraction.
-with CC70B02_0; -- Generic discrete type operations.
-with CC70B02_1; -- Generic discrete list operations.
-
-with Report;
-procedure CC70B02 is
-
- type Points is range 0 .. 100; -- Discrete type.
-
- package Points_Ops is new CC70B02_0 (Points); -- Points-type operations.
- package Lists_of_Points is new FC70B00 (Points); -- Points lists.
- package Points_List_Ops is new -- Points-list operations.
- CC70B02_1 (Points_Ops, Lists_Of_Points);
-
- Scores : Lists_of_Points.List_Type; -- List of points.
-
-
- -- Begin test code declarations: -----------------------
-
- type TC_Score_Array is array (1 .. 3) of Points;
-
- TC_Initial_Values : constant TC_Score_Array := (23, 15, 0);
- TC_Final_Values : constant TC_Score_Array := (46, 30, 0);
-
- TC_Correct_Initial_Values : Boolean := False;
- TC_Correct_Final_Values : Boolean := False;
-
-
- procedure TC_Initialize_List (L : in out Lists_Of_Points.List_Type) is
- begin -- Initial list contains 3 scores
- for I in TC_Score_Array'Range loop -- with the values 23, 15, and 0.
- Lists_Of_Points.Add_Element (L, TC_Initial_Values(I));
- end loop;
- end TC_Initialize_List;
-
-
- procedure TC_Verify_List (L : in out Lists_Of_Points.List_Type;
- Expected : in TC_Score_Array;
- OK : out Boolean) is
- Actual : TC_Score_Array;
- begin -- Verify that all scores have been
- Lists_Of_Points.Reset (L); -- set to zero.
- for I in TC_Score_Array'Range loop
- Lists_Of_Points.Read_Element (L, Actual(I));
- end loop;
- OK := (Actual = Expected);
- end TC_Verify_List;
-
- -- End test code declarations. -------------------------
-
-
-begin
- Report.Test ("CC70B02", "Check that a library-level generic package " &
- "may have a formal package as a formal parameter, and that " &
- "the generic formal actual part may specify explicit actual " &
- "parameters (including a formal parameter of a previously " &
- "declared formal package). Check that a use clause is legal " &
- "in the generic formal part");
-
- TC_Initialize_List (Scores);
- TC_Verify_List (Scores, TC_Initial_Values, TC_Correct_Initial_Values);
-
- if not TC_Correct_Initial_Values then
- Report.Failed ("List contains incorrect initial values");
- end if;
-
- Points_List_Ops.Double_List (Scores);
- TC_Verify_List (Scores, TC_Final_Values, TC_Correct_Final_Values);
-
- if not TC_Correct_Final_Values then
- Report.Failed ("List contains incorrect final values");
- end if;
-
- Report.Result;
-end CC70B02;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc70c01.a b/gcc/testsuite/ada/acats/tests/cc/cc70c01.a
deleted file mode 100644
index f22ad01e76c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc70c01.a
+++ /dev/null
@@ -1,187 +0,0 @@
--- CC70C01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a generic formal package is an instance. Specifically,
--- check that a generic formal package may be passed as an actual
--- parameter in an instantiation of a generic package. Check that the
--- visible part of the generic formal package includes the first list of
--- basic declarative items of the package specification.
---
--- TEST DESCRIPTION:
--- A generic formal package is a package, and is an instance.
---
--- Declare a list type in a generic package for lists of elements of any
--- nonlimited type (foundation code). Declare a second generic package
--- which declares operations for the list type, and parameterize it with
--- a generic formal package with the list-type package as template
--- (foundation code). Declare a third generic package which declares
--- additional operations for the list type, and parameterize it just like
--- the second generic package. Declare an instance of the second generic
--- in the spec of the third generic, passing the formal package as the
--- actual.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FC70C00.A
--- CC70C01.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FC70C00_0; -- List abstraction.
-with FC70C00_1; -- Basic list operations.
-generic
- with package Lists is new FC70C00_0 (<>);
-package CC70C01_0 is -- Additional list operations.
-
- -- Instantiate a generic package (FC70C00_1) with a generic formal package
- -- (Lists). This ensures that the package passed as an actual corresponding
- -- to Lists is the same one passed as an actual to FC70C00_1. Thus, all list
- -- operations from both FC70C00_1 and this package operate on lists of the
- -- same element type.
-
- package Basic_List_Ops is new FC70C00_1 (Lists);
-
-
- End_of_List_Reached : exception;
-
-
- -- Read from current element and advance "current" pointer.
- procedure Read_Element (L : in out Lists.List_Type;
- E : out Lists.Element_Type);
-
- -- Add element to end of list.
- procedure Add_Element (L : in out Lists.List_Type;
- E : in Lists.Element_Type);
-
-end CC70C01_0;
-
-
- --==================================================================--
-
-
-package body CC70C01_0 is
-
- procedure Read_Element (L : in out Lists.List_Type;
- E : out Lists.Element_Type) is
- begin
- if Basic_List_Ops.End_Of_List (L) then -- Use of op from the previous
- raise End_Of_List_Reached; -- generic package.
- else
- E := L.Current.Item; -- Retrieve current element.
- L.Current := L.Current.Next; -- Advance "current" pointer.
- end if;
- end Read_Element;
-
-
- procedure Add_Element (L : in out Lists.List_Type;
- E : in Lists.Element_Type) is
- New_Node : Lists.Node_Pointer := new Lists.Node_Type'(E, null);
- use type Lists.Node_Pointer;
- begin
- if L.First = null then -- No elements in list, so add new
- L.First := New_Node; -- element at beginning of list.
- else
- L.Last.Next := New_Node; -- Add new element at end of list.
- end if;
- L.Last := New_Node; -- Set last-in-list pointer.
- end Add_Element;
-
-
-end CC70C01_0;
-
-
- --==================================================================--
-
-
-with FC70C00_0; -- Generic list abstraction.
-with CC70C01_0; -- Additional generic list operations.
-
-with Report;
-procedure CC70C01 is
-
- type Points is range 0 .. 100; -- Discrete type.
-
- package Lists_of_Points is new FC70C00_0 (Points); -- Points lists.
-
- package Points_List_Ops is new -- Points-list ops.
- CC70C01_0 (Lists_Of_Points);
-
- Scores : Lists_of_Points.List_Type; -- List of points.
-
-
- -- Begin test code declarations: -----------------------
-
- type TC_Score_Array is array (1 .. 3) of Points;
-
- TC_List_Values : constant TC_Score_Array := (23, 15, 0);
-
- TC_Correct_List_Values : Boolean := False;
-
-
- procedure TC_Initialize_List (L : in out Lists_Of_Points.List_Type) is
- begin -- Initial list contains 3 scores
- for I in TC_Score_Array'Range loop -- with the values 23, 15, and 0.
- Points_List_Ops.Add_Element (L, TC_List_Values(I));
- end loop;
- end TC_Initialize_List;
-
-
- procedure TC_Verify_List (L : in out Lists_Of_Points.List_Type;
- Expected : in TC_Score_Array;
- OK : out Boolean) is
- Actual : TC_Score_Array;
- begin
- Points_List_Ops.Basic_List_Ops.Reset (L);
- for I in TC_Score_Array'Range loop
- Points_List_Ops.Read_Element (L, Actual(I));
- end loop;
- OK := (Actual = Expected);
- end TC_Verify_List;
-
- -- End test code declarations. -------------------------
-
-
-begin
-
- Report.Test ("CC70C01", "Check that a generic formal package may be " &
- "passed as an actual in an instantiation of a generic " &
- "package");
-
- TC_Initialize_List (Scores);
- TC_Verify_List (Scores, TC_List_Values, TC_Correct_List_Values);
-
- if not TC_Correct_List_Values then
- Report.Failed ("List contains incorrect values");
- end if;
-
- Report.Result;
-
-end CC70C01;
diff --git a/gcc/testsuite/ada/acats/tests/cc/cc70c02.a b/gcc/testsuite/ada/acats/tests/cc/cc70c02.a
deleted file mode 100644
index f479193b534..00000000000
--- a/gcc/testsuite/ada/acats/tests/cc/cc70c02.a
+++ /dev/null
@@ -1,192 +0,0 @@
--- CC70C02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a generic formal package is an instance. Specifically,
--- check that a generic formal package may be passed as an actual
--- parameter to another generic formal package. Check that the
--- visible part of the generic formal package includes the first list of
--- basic declarative items of the package specification.
---
--- TEST DESCRIPTION:
--- A generic formal package is a package, and is an instance.
---
--- Declare a list type in a generic package for lists of elements of any
--- nonlimited type (foundation code). Declare a second generic package
--- which declares operations for the list type, and parameterize it with
--- a generic formal package with the list-type package as template
--- (foundation code). Declare a third generic package which declares
--- additional operations for the list type, and parameterize it with two
--- generic formal packages, one with the list-type package as template,
--- the other with the second generic package as template. Use the first
--- formal package as the generic formal actual part for the second formal
--- package.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FC70C00.A
--- CC70C02.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FC70C00_0; -- List abstraction.
-with FC70C00_1; -- Basic list operations.
-generic
-
- -- Import both the list-type abstraction defined in FC70C00_0 and the basic
- -- list operations defined in FC70C00_1. To ensure that only basic operation
- -- instances for lists of the same element type as that used to instantiate
- -- the list type are accepted as actuals to this generic, pass the list-type
- -- formal package as an actual parameter to the list-operation formal
- -- package.
-
- with package Lists is new FC70C00_0 (<>);
- with package Basic_List_Ops is new FC70C00_1 (Lists);
-package CC70C02_0 is -- Additional list operations.
-
- End_of_List_Reached : exception;
-
-
- -- Read from current element and advance "current" pointer.
- procedure Read_Element (L : in out Lists.List_Type;
- E : out Lists.Element_Type);
-
- -- Add element to end of list.
- procedure Add_Element (L : in out Lists.List_Type;
- E : in Lists.Element_Type);
-
-end CC70C02_0;
-
-
- --==================================================================--
-
-
-package body CC70C02_0 is
-
- procedure Read_Element (L : in out Lists.List_Type;
- E : out Lists.Element_Type) is
- begin
- if Basic_List_Ops.End_Of_List (L) then -- Use of op from the previous
- raise End_Of_List_Reached; -- generic package.
- else
- E := L.Current.Item; -- Retrieve current element.
- L.Current := L.Current.Next; -- Advance "current" pointer.
- end if;
- end Read_Element;
-
-
- procedure Add_Element (L : in out Lists.List_Type;
- E : in Lists.Element_Type) is
- New_Node : Lists.Node_Pointer := new Lists.Node_Type'(E, null);
- use type Lists.Node_Pointer;
- begin
- if L.First = null then -- No elements in list, so add new
- L.First := New_Node; -- element at beginning of list.
- else
- L.Last.Next := New_Node; -- Add new element at end of list.
- end if;
- L.Last := New_Node; -- Set last-in-list pointer.
- end Add_Element;
-
-
-end CC70C02_0;
-
-
- --==================================================================--
-
-
-with FC70C00_0; -- Generic list type abstraction.
-with FC70C00_1; -- Generic list operations.
-with CC70C02_0; -- Additional generic list operations.
-
-with Report;
-procedure CC70C02 is
-
- type Points is range 0 .. 100; -- Discrete type.
-
- package Lists_of_Points is new FC70C00_0 (Points); -- Points lists.
-
- package Basic_Point_Ops is new -- Basic points-list ops.
- FC70C00_1 (Lists_Of_Points);
-
- package Points_List_Ops is new -- More points-list ops.
- CC70C02_0 (Lists => Lists_Of_Points,
- Basic_List_Ops => Basic_Point_Ops);
-
- Scores : Lists_of_Points.List_Type; -- List of points.
-
-
- -- Begin test code declarations: -----------------------
-
- type TC_Score_Array is array (1 .. 3) of Points;
-
- TC_List_Values : constant TC_Score_Array := (23, 15, 0);
-
- TC_Correct_List_Values : Boolean := False;
-
-
- procedure TC_Initialize_List (L : in out Lists_Of_Points.List_Type) is
- begin -- Initial list contains 3 scores
- for I in TC_Score_Array'Range loop -- with the values 23, 15, and 0.
- Points_List_Ops.Add_Element (L, TC_List_Values(I));
- end loop;
- end TC_Initialize_List;
-
-
- procedure TC_Verify_List (L : in out Lists_Of_Points.List_Type;
- Expected : in TC_Score_Array;
- OK : out Boolean) is
- Actual : TC_Score_Array;
- begin
- Basic_Point_Ops.Reset (L);
- for I in TC_Score_Array'Range loop
- Points_List_Ops.Read_Element (L, Actual(I));
- end loop;
- OK := (Actual = Expected);
- end TC_Verify_List;
-
- -- End test code declarations. -------------------------
-
-
-begin
-
- Report.Test ("CC70C02", "Check that a generic formal package may be " &
- "passed as an actual to another formal package");
-
- TC_Initialize_List (Scores);
- TC_Verify_List (Scores, TC_List_Values, TC_Correct_List_Values);
-
- if not TC_Correct_List_Values then
- Report.Failed ("List contains incorrect values");
- end if;
-
- Report.Result;
-
-end CC70C02;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd10001.a b/gcc/testsuite/ada/acats/tests/cd/cd10001.a
deleted file mode 100644
index 6b44067c904..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd10001.a
+++ /dev/null
@@ -1,300 +0,0 @@
--- CD10001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that representation items may contain nonstatic expressions
--- in the case that each expression in the representation item is a
--- name that statically denotes a constant declared before the entity.
---
---
--- TEST DESCRIPTION:
--- For each of the specific items in the objective, this test checks
--- an example of each of the categories of representation specification
--- that are applicable to that objective, to wit:
--- address clause ....................... Expressions need not be static
--- alignment clause ..................... Expressions must be static
--- bit order clause ..................... Not tested
--- component size clause ................ Expressions must be static
--- enumeration representation clause .... Expressions must be static
--- external tag clause .................. Expressions must be static
--- Import, Export and Convention pragmas Not tested
--- input clause ......................... Not tested
--- output clause ........................ Not tested
--- Pack pragma .......................... Not tested
--- read clause .......................... Not tested
--- record representation clause ......... Expressions must be static
--- size clause .......................... Expressions must be static
--- small clause ......................... Expressions must be static
--- storage pool clause .................. Not tested
--- storage size clause .................. Expressions must be static
--- write clause ......................... Not tested
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute.
---
--- For implementations not validating against Annex C:
--- if this test compiles without error messages at compilation,
--- it must bind and execute.
---
--- PASS/FAIL CRITERIA:
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute, report PASSED, and complete normally,
--- otherwise the test FAILS
---
--- For implementations not validating against Annex C:
--- PASSING behavior is:
--- this test executes, reports PASSED, and completes normally
--- or
--- this test executes and reports NOT_APPLICABLE
--- or
--- this test produces at least one error message at compilation, and
--- the error message is associated with one of the items marked:
--- -- N/A => ERROR.
---
--- All other behaviors are FAILING.
---
-
--- CHANGE HISTORY:
--- 11 JUL 95 SAIC Initial version
--- 10 MAR 97 PWB.CTA Made Nonstatic_Entity nonstatic; changed
--- Tenths'Small from 1.0/32.0 to 1.0/10.0,
--- as expected by the later check; improved
--- internal documentation.
--- 16 FEB 98 EDS Modified test documentation.
--- 24 NOV 98 RLB Changed Tenths'Small to 1.0/32.0, as this is
--- necessary so that all implementations can
--- process this test. (3.5.9(21) means non-binary
--- smalls are optional.)
--- 11 MAR 99 RLB Merged versions. Most EDS changes removed (as
--- they made the test less applicable than the ACAA
--- version).
---!
-
------------------------------------------------------------------ CD10001_0
-
-with System;
-with System.Storage_Elements;
-with Impdef;
-with SPPRT13;
-package CD10001_0 is
-
- -- a few types and objects to work with.
-
- type Int is range -2048 .. 2047;
- My_Int : Int := 1024;
-
- type Enumeration is (First, Second, Third, Fourth, Fifth);
-
- -- a few names that statically denote constants:
-
- Nonstatic_Entity : constant System.Address := -- Non-static
- System.Storage_Elements."+"
- ( SPPRT13.Variable_Address,
- System.Storage_Elements.Storage_Offset'(0) );
-
- Tag_String : constant String := Impdef.External_Tag_Value; -- Static
- -- Check to ensure that Tag_String is static
- Tag_String_Length : constant := Tag_String'Length;
-
- A_Reasonable_Size_Value : constant := System.Storage_Unit; -- Static
-
- Zero : constant := 0; -- Static
- One : constant := 1; -- Static
- Two : constant := 2; -- Static
- Three : constant := 3; -- Static
- Four : constant := 4; -- Static
- Five : constant := 5; -- Static
-
- K : constant Int := My_Int; -- Non-Static
-
--- Check that representation items containing nonstatic expressions are
--- supported in the case that the representation item is a name that
--- statically denotes a constant declared before the entity.
---
--- address clause
--- Expression must be static - RM 13.3(12)
-
- Object_Address : Enumeration;
- for Object_Address'Address use Nonstatic_Entity; -- N/A => ERROR.
-
--- alignment clause
--- Expression must be static - RM 13.3(25)
-
- Object_Alignment : Enumeration;
- for Object_Alignment'Alignment use One; -- N/A => ERROR.
-
--- bit order clause
--- no interesting test can be specified
-
--- component size clause
--- Expression must be static - RM 13.3(69)
-
- type Array_With_Components is array(1..10) of Enumeration;
- for Array_With_Components'Component_Size
- use A_Reasonable_Size_Value; -- N/A => ERROR.
-
--- enumeration representation clause
--- Expressions must be static - RM 13.4(6)
-
- type Enumeration_1 is (First, Second, Third);
- for Enumeration_1 use (First => One, Second => Two, Third => Three);
-
--- external tag clause
--- Expression must be static - RM 13.3(75)
-
- type Some_Tagged_Type is tagged null record;
- for Some_Tagged_Type'External_Tag use Tag_String; -- N/A => ERROR.
-
--- Import, Export and Convention pragmas
--- no interesting test can be specified
-
--- input clause
--- no interesting test can be specified
-
--- output clause
--- no interesting test can be specified
-
--- Pack pragma
--- no interesting test can be specified
-
--- read clause
--- no interesting test can be specified
-
--- record representation clause
--- Expressions must be static - RM 13.3(10)
-
- type Record_To_Layout is record
- Bit_0 : Boolean;
- Bit_1 : Boolean;
- end record;
- for Record_To_Layout use record -- N/A => ERROR.
- Bit_0 at Zero range Zero..Zero; -- N/A => ERROR.
- Bit_1 at Zero range Four..Four; -- N/A => ERROR.
- end record; -- N/A => ERROR.
-
--- size clause
--- Expression must be static - RM 13.3(41)
-
- Object_Size : Enumeration;
- for Object_Size'Size use A_Reasonable_Size_Value; -- N/A => ERROR.
-
--- small clause
--- Expression must be static - RM 3.5.10(2)
-
- type Tenths is delta 0.1 range 0.0..10.0;
- for Tenths'Small use 1.0 / (Two ** Five); -- N/A => ERROR.
-
--- storage pool clause
--- Not tested
-
--- storage size clause
--- Expression may be non-static - RM 13.11(15)
- type Reference is access Record_To_Layout;
- for Reference'Storage_Size use Four * K; -- N/A => ERROR.
-
-
--- write clause
--- no interesting test can be specified
-
- procedure TC_Check_Values;
-
-end CD10001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-package body CD10001_0 is
-
- use type System.Address;
-
- procedure Assert( Truth : Boolean; Message: String ) is
- begin
- if not Truth then
- TCTouch.Implementation_Check( Message );
- end if;
- end Assert;
-
- procedure TC_Check_Values is
- Record_Object : Record_To_Layout;
- begin
-
- Assert(Object_Address'Address = Nonstatic_Entity,
- "Object not at specified address");
-
- Assert(Object_Alignment'Alignment >= One,
- "Object not at specified alignment");
-
- Assert(Array_With_Components'Component_Size = A_Reasonable_Size_Value,
- "Array Components not specified size");
-
--- I don't see how to reliably check this one:
---
--- type Enumeration_1 is (First, Second, Third);
--- for Enumeration_1 use (First => One, Second => Two, Third => Three);
-
- Assert(Some_Tagged_Type'External_Tag = Tag_String,
- "External_Tag not specified value");
- Assert(Record_Object.Bit_0'First_Bit = Zero,
- "Record object First_Bit not zero");
-
- Assert(Record_Object.Bit_1'Last_Bit = Four,
- "Record object Last_Bit not four");
-
- Assert(Object_Size'Size = A_Reasonable_Size_Value,
- "Object size not specified value");
-
- Assert(Tenths'Small = 1.0 / Two ** Five,
- "Tenths small not specified value");
-
- Assert(Reference'Storage_Size = 4096, -- Four * K,
- "Reference storage size not specified value");
-
- end TC_Check_Values;
-
-end CD10001_0;
-
-------------------------------------------------------------------- CD10001
-
-with Report;
-with CD10001_0;
-
-procedure CD10001 is
-
-begin -- Main test procedure.
-
- Report.Test ("CD10001", "Check that representation items containing " &
- "nonstatic expressions are supported in the " &
- "case that the representation item is a name " &
- "that statically denotes a constant declared " &
- "before the entity" );
-
- CD10001_0.TC_Check_Values;
-
- Report.Result;
-
-end CD10001;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd10002.a b/gcc/testsuite/ada/acats/tests/cd/cd10002.a
deleted file mode 100644
index fc56d4299df..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd10002.a
+++ /dev/null
@@ -1,1198 +0,0 @@
--- CD10002.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that operational items are allowed in some contexts where
--- representation items are not:
---
--- 1 - Check that the name of an incompletely defined type can be used
--- when specifying an operational item. (RM95/TC1 7.3(5)).
---
--- 2 - Check that operational items can be specified for a descendant of
--- a generic formal untagged type. (RM95/TC1 13.1(10)).
---
--- 3 - Check that operational items can be specified for a derived
--- untagged type even if the parent type is a by-reference type or
--- has user-defined primitive subprograms. (RM95/TC1 13.1(11/1)).
---
--- (Defect Report 8652/0009, as reflected in Technical Corrigendum 1).
---
--- CHANGE HISTORY:
--- 19 JAN 2001 PHL Initial version.
--- 3 DEC 2001 RLB Reformatted for ACATS.
--- 3 OCT 2002 RLB Corrected incorrect type derivations.
---
---!
-with Ada.Streams;
-use Ada.Streams;
-package CD10002_0 is
-
- type Kinds is (Read, Write, Input, Output);
- type Counts is array (Kinds) of Natural;
-
- generic
- type T is private;
- package Nonlimited_Stream_Ops is
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : T);
- function Input (Stream : access Root_Stream_Type'Class) return T;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out T);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : T);
-
- function Get_Counts return Counts;
-
- end Nonlimited_Stream_Ops;
-
- generic
- type T (<>) is limited private; -- Should be self-initializing.
- C : in out T;
- package Limited_Stream_Ops is
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : T);
- function Input (Stream : access Root_Stream_Type'Class) return T;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out T);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : T);
-
- function Get_Counts return Counts;
-
- end Limited_Stream_Ops;
-
-end CD10002_0;
-
-
-package body CD10002_0 is
-
- package body Nonlimited_Stream_Ops is
- Cnts : Counts := (others => 0);
- X : T; -- Initialized by Write/Output.
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : T) is
- begin
- X := Item;
- Cnts (Write) := Cnts (Write) + 1;
- end Write;
-
- function Input (Stream : access Root_Stream_Type'Class) return T is
- begin
- Cnts (Input) := Cnts (Input) + 1;
- return X;
- end Input;
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out T) is
- begin
- Cnts (Read) := Cnts (Read) + 1;
- Item := X;
- end Read;
-
- procedure Output (Stream : access Root_Stream_Type'Class; Item : T) is
- begin
- X := Item;
- Cnts (Output) := Cnts (Output) + 1;
- end Output;
-
- function Get_Counts return Counts is
- begin
- return Cnts;
- end Get_Counts;
-
- end Nonlimited_Stream_Ops;
-
- package body Limited_Stream_Ops is
- Cnts : Counts := (others => 0);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : T) is
- begin
- Cnts (Write) := Cnts (Write) + 1;
- end Write;
-
- function Input (Stream : access Root_Stream_Type'Class) return T is
- begin
- Cnts (Input) := Cnts (Input) + 1;
- return C;
- end Input;
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out T) is
- begin
- Cnts (Read) := Cnts (Read) + 1;
- end Read;
-
- procedure Output (Stream : access Root_Stream_Type'Class; Item : T) is
- begin
- Cnts (Output) := Cnts (Output) + 1;
- end Output;
-
- function Get_Counts return Counts is
- begin
- return Cnts;
- end Get_Counts;
-
- end Limited_Stream_Ops;
-
-end CD10002_0;
-
-
-with Ada.Streams;
-use Ada.Streams;
-package CD10002_1 is
-
- type Dummy_Stream is new Root_Stream_Type with null record;
- procedure Read (Stream : in out Dummy_Stream;
- Item : out Stream_Element_Array;
- Last : out Stream_Element_Offset);
- procedure Write (Stream : in out Dummy_Stream;
- Item : Stream_Element_Array);
-
-end CD10002_1;
-
-
-with Report;
-use Report;
-package body CD10002_1 is
-
- procedure Read (Stream : in out Dummy_Stream;
- Item : out Stream_Element_Array;
- Last : out Stream_Element_Offset) is
- begin
- Failed ("Unexpected call to the Read operation of Dummy_Stream");
- end Read;
-
- procedure Write (Stream : in out Dummy_Stream;
- Item : Stream_Element_Array) is
- begin
- Failed ("Unexpected call to the Write operation of Dummy_Stream");
- end Write;
-
-end CD10002_1;
-
-
-with Ada.Streams;
-use Ada.Streams;
-with CD10002_0;
-package CD10002_Deriv is
-
- -- Parent has user-defined subprograms.
-
- type T1 is new Boolean;
- function Is_Odd (X : Integer) return T1;
-
- type T2 is
- record
- F : Float;
- end record;
- procedure Print (X : T2);
-
- type T3 is array (Boolean) of Duration;
- function "+" (L, R : T3) return T3;
-
- -- Parent is by-reference. No need to check the case where the parent
- -- is tagged, because the defect report only deals with untagged types.
-
- task type T4 is
- end T4;
-
- protected type T5 is
- end T5;
-
- type T6 (D : access Integer := new Integer'(2)) is limited null record;
-
- type T7 is array (Character) of T6;
-
- package P is
- type T8 is limited private;
- private
- type T8 is new T5;
- end P;
-
- type Nt1 is new T1;
- type Nt2 is new T2;
- type Nt3 is new T3;
- type Nt4 is new T4;
- type Nt5 is new T5;
- type Nt6 is new T6;
- type Nt7 is new T7;
- type Nt8 is new P.T8;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt1'Base);
- function Input (Stream : access Root_Stream_Type'Class) return Nt1'Base;
- procedure Read (Stream : access Root_Stream_Type'Class;
- Item : out Nt1'Base);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt1'Base);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt2);
- function Input (Stream : access Root_Stream_Type'Class) return Nt2;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt2);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt2);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt3);
- function Input (Stream : access Root_Stream_Type'Class) return Nt3;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt3);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt3);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt4);
- function Input (Stream : access Root_Stream_Type'Class) return Nt4;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt4);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt4);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt5);
- function Input (Stream : access Root_Stream_Type'Class) return Nt5;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt5);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt5);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt6);
- function Input (Stream : access Root_Stream_Type'Class) return Nt6;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt6);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt6);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt7);
- function Input (Stream : access Root_Stream_Type'Class) return Nt7;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt7);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt7);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt8);
- function Input (Stream : access Root_Stream_Type'Class) return Nt8;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt8);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt8);
-
- for Nt1'Write use Write;
- for Nt1'Read use Read;
- for Nt1'Output use Output;
- for Nt1'Input use Input;
-
- for Nt2'Write use Write;
- for Nt2'Read use Read;
- for Nt2'Output use Output;
- for Nt2'Input use Input;
-
- for Nt3'Write use Write;
- for Nt3'Read use Read;
- for Nt3'Output use Output;
- for Nt3'Input use Input;
-
- for Nt4'Write use Write;
- for Nt4'Read use Read;
- for Nt4'Output use Output;
- for Nt4'Input use Input;
-
- for Nt5'Write use Write;
- for Nt5'Read use Read;
- for Nt5'Output use Output;
- for Nt5'Input use Input;
-
- for Nt6'Write use Write;
- for Nt6'Read use Read;
- for Nt6'Output use Output;
- for Nt6'Input use Input;
-
- for Nt7'Write use Write;
- for Nt7'Read use Read;
- for Nt7'Output use Output;
- for Nt7'Input use Input;
-
- for Nt8'Write use Write;
- for Nt8'Read use Read;
- for Nt8'Output use Output;
- for Nt8'Input use Input;
-
- -- All these variables are self-initializing.
- C4 : Nt4;
- C5 : Nt5;
- C6 : Nt6;
- C7 : Nt7;
- C8 : Nt8;
-
- package Nt1_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt1'Base);
- package Nt2_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt2);
- package Nt3_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt3);
- package Nt4_Ops is new CD10002_0.Limited_Stream_Ops (Nt4, C4);
- package Nt5_Ops is new CD10002_0.Limited_Stream_Ops (Nt5, C5);
- package Nt6_Ops is new CD10002_0.Limited_Stream_Ops (Nt6, C6);
- package Nt7_Ops is new CD10002_0.Limited_Stream_Ops (Nt7, C7);
- package Nt8_Ops is new CD10002_0.Limited_Stream_Ops (Nt8, C8);
-
-end CD10002_Deriv;
-
-
-package body CD10002_Deriv is
-
- function Is_Odd (X : Integer) return T1 is
- begin
- return True;
- end Is_Odd;
- procedure Print (X : T2) is
- begin
- null;
- end Print;
- function "+" (L, R : T3) return T3 is
- begin
- return (False => L (False) + R (True), True => L (True) + R (False));
- end "+";
- task body T4 is
- begin
- null;
- end T4;
- protected body T5 is
- end T5;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt1'Base)
- renames Nt1_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt1'Base
- renames Nt1_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt1'Base)
- renames Nt1_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt1'Base)
- renames Nt1_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt2)
- renames Nt2_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt2
- renames Nt2_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt2)
- renames Nt2_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt2)
- renames Nt2_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt3)
- renames Nt3_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt3
- renames Nt3_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt3)
- renames Nt3_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt3)
- renames Nt3_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt4)
- renames Nt4_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt4
- renames Nt4_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt4)
- renames Nt4_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt4)
- renames Nt4_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt5)
- renames Nt5_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt5
- renames Nt5_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt5)
- renames Nt5_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt5)
- renames Nt5_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt6)
- renames Nt6_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt6
- renames Nt6_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt6)
- renames Nt6_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt6)
- renames Nt6_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt7)
- renames Nt7_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt7
- renames Nt7_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt7)
- renames Nt7_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt7)
- renames Nt7_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt8)
- renames Nt8_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt8
- renames Nt8_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt8)
- renames Nt8_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt8)
- renames Nt8_Ops.Output;
-
-end CD10002_Deriv;
-
-
-with Ada.Streams;
-use Ada.Streams;
-with CD10002_0;
-generic
- type T1 is (<>);
- type T2 is range <>;
- type T3 is mod <>;
- type T4 is digits <>;
- type T5 is delta <>;
- type T6 is delta <> digits <>;
- type T7 is access T3;
- type T8 is new Boolean;
- type T9 is private;
- type T10 (<>) is limited private; -- Should be self-initializing.
- C10 : in out T10;
- type T11 is array (T1) of T2;
-package CD10002_Gen is
-
- -- Direct descendants.
- type Nt1 is new T1;
- type Nt2 is new T2;
- type Nt3 is new T3;
- type Nt4 is new T4;
- type Nt5 is new T5;
- type Nt6 is new T6;
- type Nt7 is new T7;
- type Nt8 is new T8;
- type Nt9 is new T9;
- type Nt10 is new T10;
- type Nt11 is new T11;
-
- -- Indirect descendants (only pick two, a limited one and a non-limited
- -- one).
- type Nt12 is new Nt10;
- type Nt13 is new Nt11;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt1'Base);
- function Input (Stream : access Root_Stream_Type'Class) return Nt1'Base;
- procedure Read (Stream : access Root_Stream_Type'Class;
- Item : out Nt1'Base);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt1'Base);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt2'Base);
- function Input (Stream : access Root_Stream_Type'Class) return Nt2'Base;
- procedure Read (Stream : access Root_Stream_Type'Class;
- Item : out Nt2'Base);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt2'Base);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt3'Base);
- function Input (Stream : access Root_Stream_Type'Class) return Nt3'Base;
- procedure Read (Stream : access Root_Stream_Type'Class;
- Item : out Nt3'Base);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt3'Base);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt4'Base);
- function Input (Stream : access Root_Stream_Type'Class) return Nt4'Base;
- procedure Read (Stream : access Root_Stream_Type'Class;
- Item : out Nt4'Base);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt4'Base);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt5'Base);
- function Input (Stream : access Root_Stream_Type'Class) return Nt5'Base;
- procedure Read (Stream : access Root_Stream_Type'Class;
- Item : out Nt5'Base);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt5'Base);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt6'Base);
- function Input (Stream : access Root_Stream_Type'Class) return Nt6'Base;
- procedure Read (Stream : access Root_Stream_Type'Class;
- Item : out Nt6'Base);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt6'Base);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt7);
- function Input (Stream : access Root_Stream_Type'Class) return Nt7;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt7);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt7);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt8'Base);
- function Input (Stream : access Root_Stream_Type'Class) return Nt8'Base;
- procedure Read (Stream : access Root_Stream_Type'Class;
- Item : out Nt8'Base);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt8'Base);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt9);
- function Input (Stream : access Root_Stream_Type'Class) return Nt9;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt9);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt9);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt10);
- function Input (Stream : access Root_Stream_Type'Class) return Nt10;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt10);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt10);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt11);
- function Input (Stream : access Root_Stream_Type'Class) return Nt11;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt11);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt11);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt12);
- function Input (Stream : access Root_Stream_Type'Class) return Nt12;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt12);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt12);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt13);
- function Input (Stream : access Root_Stream_Type'Class) return Nt13;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt13);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt13);
-
- for Nt1'Write use Write;
- for Nt1'Read use Read;
- for Nt1'Output use Output;
- for Nt1'Input use Input;
-
- for Nt2'Write use Write;
- for Nt2'Read use Read;
- for Nt2'Output use Output;
- for Nt2'Input use Input;
-
- for Nt3'Write use Write;
- for Nt3'Read use Read;
- for Nt3'Output use Output;
- for Nt3'Input use Input;
-
- for Nt4'Write use Write;
- for Nt4'Read use Read;
- for Nt4'Output use Output;
- for Nt4'Input use Input;
-
- for Nt5'Write use Write;
- for Nt5'Read use Read;
- for Nt5'Output use Output;
- for Nt5'Input use Input;
-
- for Nt6'Write use Write;
- for Nt6'Read use Read;
- for Nt6'Output use Output;
- for Nt6'Input use Input;
-
- for Nt7'Write use Write;
- for Nt7'Read use Read;
- for Nt7'Output use Output;
- for Nt7'Input use Input;
-
- for Nt8'Write use Write;
- for Nt8'Read use Read;
- for Nt8'Output use Output;
- for Nt8'Input use Input;
-
- for Nt9'Write use Write;
- for Nt9'Read use Read;
- for Nt9'Output use Output;
- for Nt9'Input use Input;
-
- for Nt10'Write use Write;
- for Nt10'Read use Read;
- for Nt10'Output use Output;
- for Nt10'Input use Input;
-
- for Nt11'Write use Write;
- for Nt11'Read use Read;
- for Nt11'Output use Output;
- for Nt11'Input use Input;
-
- for Nt12'Write use Write;
- for Nt12'Read use Read;
- for Nt12'Output use Output;
- for Nt12'Input use Input;
-
- for Nt13'Write use Write;
- for Nt13'Read use Read;
- for Nt13'Output use Output;
- for Nt13'Input use Input;
-
- type Null_Record is null record;
-
- package Nt1_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt1'Base);
- package Nt2_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt2'Base);
- package Nt3_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt3'Base);
- package Nt4_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt4'Base);
- package Nt5_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt5'Base);
- package Nt6_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt6'Base);
- package Nt7_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt7);
- package Nt8_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt8'Base);
- package Nt9_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt9);
- package Nt11_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt11);
- package Nt13_Ops is new CD10002_0.Nonlimited_Stream_Ops (Nt13);
-
- function Get_Nt10_Counts return CD10002_0.Counts;
- function Get_Nt12_Counts return CD10002_0.Counts;
-
-end CD10002_Gen;
-
-
-package body CD10002_Gen is
-
- use CD10002_0;
-
- Nt10_Cnts : Counts := (others => 0);
- Nt12_Cnts : Counts := (others => 0);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt1'Base)
- renames Nt1_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt1'Base
- renames Nt1_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt1'Base)
- renames Nt1_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt1'Base)
- renames Nt1_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt2'Base)
- renames Nt2_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt2'Base
- renames Nt2_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt2'Base)
- renames Nt2_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt2'Base)
- renames Nt2_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt3'Base)
- renames Nt3_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt3'Base
- renames Nt3_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt3'Base)
- renames Nt3_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt3'Base)
- renames Nt3_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt4'Base)
- renames Nt4_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt4'Base
- renames Nt4_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt4'Base)
- renames Nt4_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt4'Base)
- renames Nt4_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt5'Base)
- renames Nt5_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt5'Base
- renames Nt5_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt5'Base)
- renames Nt5_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt5'Base)
- renames Nt5_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt6'Base)
- renames Nt6_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt6'Base
- renames Nt6_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt6'Base)
- renames Nt6_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt6'Base)
- renames Nt6_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt7)
- renames Nt7_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt7
- renames Nt7_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt7)
- renames Nt7_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt7)
- renames Nt7_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt8'Base)
- renames Nt8_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt8'Base
- renames Nt8_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt8'Base)
- renames Nt8_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt8'Base)
- renames Nt8_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt9)
- renames Nt9_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt9
- renames Nt9_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt9)
- renames Nt9_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt9)
- renames Nt9_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt10) is
- begin
- Nt10_Cnts (Write) := Nt10_Cnts (Write) + 1;
- end Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt10 is
- begin
- Nt10_Cnts (Input) := Nt10_Cnts (Input) + 1;
- return Nt10 (C10);
- end Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt10) is
- begin
- Nt10_Cnts (Read) := Nt10_Cnts (Read) + 1;
- end Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt10) is
- begin
- Nt10_Cnts (Output) := Nt10_Cnts (Output) + 1;
- end Output;
- function Get_Nt10_Counts return CD10002_0.Counts is
- begin
- return Nt10_Cnts;
- end Get_Nt10_Counts;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt11)
- renames Nt11_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt11
- renames Nt11_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt11)
- renames Nt11_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt11)
- renames Nt11_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt12) is
- begin
- Nt12_Cnts (Write) := Nt12_Cnts (Write) + 1;
- end Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt12 is
- begin
- Nt12_Cnts (Input) := Nt12_Cnts (Input) + 1;
- return Nt12 (C10);
- end Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt12) is
- begin
- Nt12_Cnts (Read) := Nt12_Cnts (Read) + 1;
- end Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt12) is
- begin
- Nt12_Cnts (Output) := Nt12_Cnts (Output) + 1;
- end Output;
- function Get_Nt12_Counts return CD10002_0.Counts is
- begin
- return Nt12_Cnts;
- end Get_Nt12_Counts;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Nt13)
- renames Nt13_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Nt13
- renames Nt13_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Nt13)
- renames Nt13_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Nt13)
- renames Nt13_Ops.Output;
-
-end CD10002_Gen;
-
-
-with Ada.Streams;
-use Ada.Streams;
-with CD10002_0;
-package CD10002_Priv is
-
- External_Tag_1 : constant String := "Isaac Newton";
- External_Tag_2 : constant String := "Albert Einstein";
-
- type T1 is tagged private;
- type T2 is tagged
- record
- C : T1;
- end record;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : T1);
- function Input (Stream : access Root_Stream_Type'Class) return T1;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out T1);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : T1);
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : T2);
- function Input (Stream : access Root_Stream_Type'Class) return T2;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out T2);
- procedure Output (Stream : access Root_Stream_Type'Class; Item : T2);
-
- for T1'Write use Write;
- for T1'Input use Input;
-
- for T2'Read use Read;
- for T2'Output use Output;
- for T2'External_Tag use External_Tag_2;
-
- function Get_T1_Counts return CD10002_0.Counts;
- function Get_T2_Counts return CD10002_0.Counts;
-
-private
-
- for T1'Read use Read;
- for T1'Output use Output;
- for T1'External_Tag use External_Tag_1;
-
- for T2'Write use Write;
- for T2'Input use Input;
-
- type T1 is tagged null record;
-
- package T1_Ops is new CD10002_0.Nonlimited_Stream_Ops (T1);
- package T2_Ops is new CD10002_0.Nonlimited_Stream_Ops (T2);
-
-end CD10002_Priv;
-
-
-package body CD10002_Priv is
- procedure Write (Stream : access Root_Stream_Type'Class; Item : T1)
- renames T1_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return T1
- renames T1_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out T1)
- renames T1_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : T1)
- renames T1_Ops.Output;
-
- procedure Write (Stream : access Root_Stream_Type'Class; Item : T2)
- renames T2_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return T2
- renames T2_Ops.Input;
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out T2)
- renames T2_Ops.Read;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : T2)
- renames T2_Ops.Output;
-
- function Get_T1_Counts return CD10002_0.Counts renames T1_Ops.Get_Counts;
- function Get_T2_Counts return CD10002_0.Counts renames T2_Ops.Get_Counts;
-end CD10002_Priv;
-
-
-with Ada.Streams;
-use Ada.Streams;
-with Report;
-use Report;
-with System;
-with CD10002_0;
-with CD10002_1;
-with CD10002_Deriv;
-with CD10002_Gen;
-with CD10002_Priv;
-procedure CD10002 is
-
- package Deriv renames CD10002_Deriv;
- generic package Gen renames CD10002_Gen;
- package Priv renames CD10002_Priv;
-
- type Stream_Ops is (Read, Write, Input, Output);
- type Counts is array (Stream_Ops) of Natural;
-
- S : aliased CD10002_1.Dummy_Stream;
-
-begin
- Test ("CD10002",
- "Check that operational items are allowed in some contexts " &
- "where representation items are not");
-
- Test_Priv:
- declare
- X1 : Priv.T1;
- X2 : Priv.T2;
- use CD10002_0;
- begin
- Comment
- ("Check that the name of an incompletely defined type can be " &
- "used when specifying an operational item");
-
- -- Partial view of a private type.
- Priv.T1'Write (S'Access, X1);
- Priv.T1'Read (S'Access, X1);
- Priv.T1'Output (S'Access, X1);
- X1 := Priv.T1'Input (S'Access);
-
- if Priv.Get_T1_Counts /= (1, 1, 1, 1) then
- Failed ("Incorrect calls to the stream attributes for Priv.T1");
- elsif Priv.T1'External_Tag /= Priv.External_Tag_1 then
- Failed ("Incorrect external tag for Priv.T1");
- end if;
-
- -- Incompletely defined but not private.
- Priv.T2'Write (S'Access, X2);
- Priv.T2'Read (S'Access, X2);
- Priv.T2'Output (S'Access, X2);
- X2 := Priv.T2'Input (S'Access);
-
- if Priv.Get_T2_Counts /= (1, 1, 1, 1) then
- Failed ("Incorrect calls to the stream attributes for Priv.T2");
- elsif Priv.T2'External_Tag /= Priv.External_Tag_2 then
- Failed ("Incorrect external tag for Priv.T2");
- end if;
-
- end Test_Priv;
-
- Test_Gen:
- declare
-
- type Modular is mod System.Max_Binary_Modulus;
- type Decimal is delta 1.0 digits 1;
- type Access_Modular is access Modular;
- type R9 is null record;
- type R10 (D : access Integer) is limited null record;
- type Arr is array (Character) of Integer;
-
- C10 : R10 (new Integer'(19));
-
- package Inst is new Gen (T1 => Character,
- T2 => Integer,
- T3 => Modular,
- T4 => Float,
- T5 => Duration,
- T6 => Decimal,
- T7 => Access_Modular,
- T8 => Boolean,
- T9 => R9,
- T10 => R10,
- C10 => C10,
- T11 => Arr);
-
- X1 : Inst.Nt1 := 'a';
- X2 : Inst.Nt2 := 0;
- X3 : Inst.Nt3 := 0;
- X4 : Inst.Nt4 := 0.0;
- X5 : Inst.Nt5 := 0.0;
- X6 : Inst.Nt6 := 0.0;
- X7 : Inst.Nt7 := null;
- X8 : Inst.Nt8 := Inst.False;
- X9 : Inst.Nt9 := (null record);
- X10 : Inst.Nt10 (D => new Integer'(5));
- Y10 : Integer;
- X11 : Inst.Nt11 := (others => 0);
- X12 : Inst.Nt12 (D => new Integer'(7));
- Y12 : Integer;
- X13 : Inst.Nt13 := (others => 0);
- use CD10002_0;
- begin
- Comment ("Check that operational items can be specified for a " &
- "descendant of a generic formal untagged type");
-
- Inst.Nt1'Write (S'Access, X1);
- Inst.Nt1'Read (S'Access, X1);
- Inst.Nt1'Output (S'Access, X1);
- X1 := Inst.Nt1'Input (S'Access);
-
- if Inst.Nt1_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt1");
- end if;
-
- Inst.Nt2'Write (S'Access, X2);
- Inst.Nt2'Read (S'Access, X2);
- Inst.Nt2'Output (S'Access, X2);
- X2 := Inst.Nt2'Input (S'Access);
-
- if Inst.Nt2_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt2");
- end if;
-
- Inst.Nt3'Write (S'Access, X3);
- Inst.Nt3'Read (S'Access, X3);
- Inst.Nt3'Output (S'Access, X3);
- X3 := Inst.Nt3'Input (S'Access);
-
- if Inst.Nt3_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt3");
- end if;
-
- Inst.Nt4'Write (S'Access, X4);
- Inst.Nt4'Read (S'Access, X4);
- Inst.Nt4'Output (S'Access, X4);
- X4 := Inst.Nt4'Input (S'Access);
-
- if Inst.Nt4_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt4");
- end if;
-
- Inst.Nt5'Write (S'Access, X5);
- Inst.Nt5'Read (S'Access, X5);
- Inst.Nt5'Output (S'Access, X5);
- X5 := Inst.Nt5'Input (S'Access);
-
- if Inst.Nt5_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt5");
- end if;
-
- Inst.Nt6'Write (S'Access, X6);
- Inst.Nt6'Read (S'Access, X6);
- Inst.Nt6'Output (S'Access, X6);
- X6 := Inst.Nt6'Input (S'Access);
-
- if Inst.Nt6_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt6");
- end if;
-
- Inst.Nt7'Write (S'Access, X7);
- Inst.Nt7'Read (S'Access, X7);
- Inst.Nt7'Output (S'Access, X7);
- X7 := Inst.Nt7'Input (S'Access);
-
- if Inst.Nt7_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt7");
- end if;
-
- Inst.Nt8'Write (S'Access, X8);
- Inst.Nt8'Read (S'Access, X8);
- Inst.Nt8'Output (S'Access, X8);
- X8 := Inst.Nt8'Input (S'Access);
-
- if Inst.Nt8_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt8");
- end if;
-
- Inst.Nt9'Write (S'Access, X9);
- Inst.Nt9'Read (S'Access, X9);
- Inst.Nt9'Output (S'Access, X9);
- X9 := Inst.Nt9'Input (S'Access);
-
- if Inst.Nt9_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt9");
- end if;
-
- Inst.Nt10'Write (S'Access, X10);
- Inst.Nt10'Read (S'Access, X10);
- Inst.Nt10'Output (S'Access, X10);
- Y10 := Inst.Nt10'Input (S'Access).D.all;
-
- if Inst.Get_Nt10_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt10");
- end if;
-
- Inst.Nt11'Write (S'Access, X11);
- Inst.Nt11'Read (S'Access, X11);
- Inst.Nt11'Output (S'Access, X11);
- X11 := Inst.Nt11'Input (S'Access);
-
- if Inst.Nt11_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt11");
- end if;
-
- Inst.Nt12'Write (S'Access, X12);
- Inst.Nt12'Read (S'Access, X12);
- Inst.Nt12'Output (S'Access, X12);
- Y12 := Inst.Nt12'Input (S'Access).D.all;
-
- if Inst.Get_Nt12_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt12");
- end if;
-
- Inst.Nt13'Write (S'Access, X13);
- Inst.Nt13'Read (S'Access, X13);
- Inst.Nt13'Output (S'Access, X13);
- X13 := Inst.Nt13'Input (S'Access);
-
- if Inst.Nt13_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Inst.Nt13");
- end if;
- end Test_Gen;
-
- Test_Deriv:
- declare
- X1 : Deriv.Nt1 := Deriv.False;
- X2 : Deriv.Nt2 := (others => 0.0);
- X3 : Deriv.Nt3 := (others => 0.0);
- X4 : Deriv.Nt4;
- Y4 : Boolean;
- X5 : Deriv.Nt5;
- Y5 : System.Address;
- X6 : Deriv.Nt6;
- Y6 : Integer;
- X7 : Deriv.Nt7;
- Y7 : Integer;
- X8 : Deriv.Nt8;
- Y8 : Integer;
- use CD10002_0;
- begin
- Comment ("Check that operational items can be specified for a " &
- "derived untagged type even if the parent type is a " &
- "by-reference type, or has user-defined primitive " &
- "subprograms");
-
- Deriv.Nt1'Write (S'Access, X1);
- Deriv.Nt1'Read (S'Access, X1);
- Deriv.Nt1'Output (S'Access, X1);
- X1 := Deriv.Nt1'Input (S'Access);
-
- if Deriv.Nt1_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Deriv.Nt1");
- end if;
-
- Deriv.Nt2'Write (S'Access, X2);
- Deriv.Nt2'Read (S'Access, X2);
- Deriv.Nt2'Output (S'Access, X2);
- X2 := Deriv.Nt2'Input (S'Access);
-
- if Deriv.Nt2_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Deriv.Nt2");
- end if;
-
- Deriv.Nt3'Write (S'Access, X3);
- Deriv.Nt3'Read (S'Access, X3);
- Deriv.Nt3'Output (S'Access, X3);
- X3 := Deriv.Nt3'Input (S'Access);
-
- if Deriv.Nt3_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Deriv.Nt3");
- end if;
-
- Deriv.Nt4'Write (S'Access, X4);
- Deriv.Nt4'Read (S'Access, X4);
- Deriv.Nt4'Output (S'Access, X4);
- Y4 := Deriv.Nt4'Input (S'Access)'Terminated;
-
- if Deriv.Nt4_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Deriv.Nt4");
- end if;
-
- Deriv.Nt5'Write (S'Access, X5);
- Deriv.Nt5'Read (S'Access, X5);
- Deriv.Nt5'Output (S'Access, X5);
- Y5 := Deriv.Nt5'Input (S'Access)'Address;
-
- if Deriv.Nt5_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Deriv.Nt5");
- end if;
-
- Deriv.Nt6'Write (S'Access, X6);
- Deriv.Nt6'Read (S'Access, X6);
- Deriv.Nt6'Output (S'Access, X6);
- Y6 := Deriv.Nt6'Input (S'Access).D.all;
-
- if Deriv.Nt6_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Deriv.Nt6");
- end if;
-
- Deriv.Nt7'Write (S'Access, X7);
- Deriv.Nt7'Read (S'Access, X7);
- Deriv.Nt7'Output (S'Access, X7);
- Y7 := Deriv.Nt7'Input (S'Access) ('a').D.all;
-
- if Deriv.Nt7_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Deriv.Nt7");
- end if;
-
- Deriv.Nt8'Write (S'Access, X8);
- Deriv.Nt8'Read (S'Access, X8);
- Deriv.Nt8'Output (S'Access, X8);
- Y8 := Deriv.Nt8'Input (S'Access)'Size;
-
- if Deriv.Nt8_Ops.Get_Counts /= (1, 1, 1, 1) then
- Failed
- ("Incorrect calls to the stream attributes for Deriv.Nt8");
- end if;
- end Test_Deriv;
-
- Result;
-end CD10002;
-
-
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd20001.a b/gcc/testsuite/ada/acats/tests/cd/cd20001.a
deleted file mode 100644
index 21f9738733b..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd20001.a
+++ /dev/null
@@ -1,275 +0,0 @@
--- CD20001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that for packed records the components are packed as tightly
--- as possible subject to the Size of the component subtypes.
--- Specifically check that Boolean objects are packed one to a bit.
---
--- Check that the Component_Size for a packed array type is less than
--- or equal to the smallest of those factors of the word size that are
--- greater than or equal to the Size of the component subtype.
---
--- TEST DESCRIPTION:
--- This test defines and packs several types, and checks that the sizes
--- of the resulting objects is as expected.
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex C:
--- this test may report compile time errors at one or more points
--- indicated by "-- ANX-C RQMT", in which case it may be graded as
--- inapplicable. Otherwise, the test must execute and report PASSED.
---
---
--- CHANGE HISTORY:
--- 22 JUL 95 SAIC Initial version
--- 08 MAY 96 SAIC Strengthened for 2.1
--- 29 JAN 98 EDS Deleted check that Component_Size is really a
--- factor of Word_Size.
---!
-
------------------------------------------------------------------ CD20001_0
-
-with System;
-package CD20001_0 is
-
- type Wordlong_Bool_Array is array(1..System.Word_Size) of Boolean;
- pragma Pack(Wordlong_Bool_Array); -- ANX-C RQMT
-
- type Def_Rep_Components is range 0..2**(System.Storage_Unit-2);
-
- type Spec_Rep_Components is range 0..2**(System.Storage_Unit-2);
- for Spec_Rep_Components'Size use System.Storage_Unit; -- ANX-C RQMT
-
- type Packed_Array_Def_Components is array(1..32) of Def_Rep_Components;
- pragma Pack(Packed_Array_Def_Components); -- ANX-C RQMT
-
- type Packed_Array_Spec_Components is array(1..32) of Spec_Rep_Components;
- pragma Pack(Packed_Array_Spec_Components); -- ANX-C RQMT
-
- procedure TC_Check_Values;
-
-end CD20001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-with TCTouch;
-package body CD20001_0 is
-
- procedure TC_Check_Values is
- My_Word : Wordlong_Bool_Array := (others => False);
-
- Cited_Unit : Spec_Rep_Components := 0;
-
- Packed_Array : Packed_Array_Def_Components := (others => 0);
-
- Cited_Packed : Packed_Array_Spec_Components := (others => 0);
-
- begin
- TCTouch.Assert( My_Word'Size = System.Word_Size,
- "pragma Pack on array of Booleans does not pack one Boolean per bit" );
-
- TCTouch.Assert( My_Word'Component_Size = 1,
- "size of Boolean array component not 1 bit");
-
- TCTouch.Assert( Cited_Unit'Size = System.Storage_Unit,
- "Object specified to be Storage_Unit bits not " &
- "Storage_Unit bits in size");
-
- TCTouch.Assert( Packed_Array'Component_Size <= System.Storage_Unit,
- "Packed array component expected to be less than or " &
- "equal to Storage_Unit bits in size is greater than " &
- "Storage_Unit bits in size");
-
- TCTouch.Assert( Cited_Packed'Component_Size = System.Storage_Unit,
- "Array component specified to be Storage_Unit " &
- "bits not Storage_Unit bits in size");
-
- end TC_Check_Values;
-
-end CD20001_0;
-
------------------------------------------------------------------ CD20001_1
-
-with System;
-package CD20001_1 is
-
- type Bits_2 is range 0..2**2-1;
- for Bits_2'Size use 2; -- ANX-C RQMT
-
- type Bits_3 is range 0..2**3-1;
- for Bits_3'Size use 3; -- ANX-C RQMT
-
- type Bits_7 is range 0..2**7-1;
- for Bits_7'Size use 7; -- ANX-C RQMT
-
- type Bits_8 is range 0..2**8-1;
- for Bits_8'Size use 8; -- ANX-C RQMT
-
- type Bits_9 is range 0..2**9-1;
- for Bits_9'Size use 9; -- ANX-C RQMT
-
- type Bits_15 is range 0..2**15-1;
- for Bits_15'Size use 15; -- ANX-C RQMT
-
- type Pact_Aray_2 is array(0..31) of Bits_2;
- pragma Pack( Pact_Aray_2 ); -- ANX-C RQMT
-
- type Pact_Aray_3 is array(0..31) of Bits_3;
- pragma Pack( Pact_Aray_3 ); -- ANX-C RQMT
-
- type Pact_Aray_7 is array(0..31) of Bits_7;
- pragma Pack( Pact_Aray_7 ); -- ANX-C RQMT
-
- type Pact_Aray_8 is array(0..31) of Bits_8;
- pragma Pack( Pact_Aray_8 ); -- ANX-C RQMT
-
- type Pact_Aray_9 is array(0..31) of Bits_9;
- pragma Pack( Pact_Aray_9 ); -- ANX-C RQMT
-
- type Pact_Aray_15 is array(0..31) of Bits_15;
- pragma Pack( Pact_Aray_15 ); -- ANX-C RQMT
-
-
- procedure TC_Check_Values;
-
-end CD20001_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-with TCTouch;
-package body CD20001_1 is
-
- function Next_Factor ( Value : Positive ) return Integer is
- -- Returns the factor of Word_Size that is next larger than Value.
- -- If Value is greater than Word_Size, then returns Word_Size.
- Test : Integer := Value;
- Found : Boolean := False;
- begin -- Next_Factor
- while not Found and Test <= System.Word_Size loop
- if System.Word_Size mod Test = 0 then
- Found := True;
- else
- Test := Test + 1;
- end if;
- end loop;
- if Found then
- return Test;
- else
- return System.Word_Size;
- end if;
- end Next_Factor;
-
- procedure TC_Check_Values is
- begin
-
- if Pact_Aray_2'Component_Size > Next_Factor ( Bits_2'Size ) then
- Report.Failed
- ( "2 bit element Packed Array'Component_Size too big" );
- end if;
-
- TCTouch.Assert( Pact_Aray_2'Component_Size <= Pact_Aray_2'Size,
- "2 bit Component_Size greater than array size" );
-
- if Pact_Aray_3'Component_Size > Next_Factor ( Bits_3'Size ) then
- Report.Failed
- ( "3 bit element Packed Array'Component_Size too big" );
- end if;
-
- TCTouch.Assert( Pact_Aray_3'Component_Size <= Pact_Aray_3'Size,
- "3 bit Component_Size greater than array size" );
-
- if Pact_Aray_7'Component_Size > Next_Factor ( Bits_7'Size ) then
- Report.Failed
- ( "7 bit element Packed Array'Component_Size too big" );
- end if;
-
- TCTouch.Assert( Pact_Aray_7'Component_Size <= Pact_Aray_7'Size,
- "7 bit Component_Size greater than array size" );
-
- if Pact_Aray_8'Component_Size > Next_Factor ( Bits_8'Size ) then
- Report.Failed
- ( "8 bit element Packed Array'Component_Size too big" );
- end if;
-
- TCTouch.Assert( Pact_Aray_8'Component_Size <= Pact_Aray_8'Size,
- "8 bit Component_Size greater than array size" );
-
- if System.Word_Size > 8 then
-
- if Pact_Aray_9'Component_Size > Next_Factor ( Bits_9'Size ) then
- Report.Failed
- ( "9 bit element Packed Array'Component_Size too big" );
- end if;
-
- TCTouch.Assert( Pact_Aray_9'Component_Size <= Pact_Aray_9'Size,
- "9 bit Component_Size greater than array size" );
-
- if Pact_Aray_15'Component_Size > Next_Factor ( Bits_15'Size ) then
- Report.Failed
- ( "15 bit element Packed Array'Component_Size too big" );
- end if;
-
- TCTouch.Assert( Pact_Aray_15'Component_Size <= Pact_Aray_15'Size,
- "15 bit Component_Size greater than array size" );
-
- end if;
-
- end TC_Check_Values;
-
-end CD20001_1;
-
-------------------------------------------------------------------- CD20001
-
-with Report;
-with CD20001_0;
-with CD20001_1;
-
-procedure CD20001 is
-
-begin -- Main test procedure.
-
- Report.Test ("CD20001", "Check that packed records are packed as tightly " &
- "as possible. Check that Boolean objects are " &
- "packed one to a bit. " &
- "Check that the Component_Size for a packed " &
- "array type is the value which is less than or " &
- "equal to the Size of the component type, " &
- "rounded up to the nearest factor of word_size" );
-
- CD20001_0.TC_Check_Values;
-
- CD20001_1.TC_Check_Values;
-
- Report.Result;
-
-end CD20001;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd30001.a b/gcc/testsuite/ada/acats/tests/cd/cd30001.a
deleted file mode 100644
index d65e1450836..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd30001.a
+++ /dev/null
@@ -1,284 +0,0 @@
--- CD30001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that X'Address produces a useful result when X is an aliased
--- object.
--- Check that X'Address produces a useful result when X is an object of
--- a by-reference type.
--- Check that X'Address produces a useful result when X is an entity
--- whose Address has been specified.
---
--- Check that aliased objects and subcomponents are allocated on storage
--- element boundaries. Check that objects and subcomponents of by
--- reference types are allocated on storage element boundaries.
---
--- Check that for an array X, X'Address points at the first component
--- of the array, and not at the array bounds.
---
--- TEST DESCRIPTION:
--- This test defines a data structure (an array of records) where each
--- aspect of the data structure is aliased. The test checks 'Address
--- for each "layer" of aliased objects.
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex C:
--- this test may report compile time errors at one or more points
--- indicated by "-- ANX-C RQMT", in which case it may be graded as inapplicable.
--- Otherwise, the test must execute and report PASSED.
---
---
--- CHANGE HISTORY:
--- 22 JUL 95 SAIC Initial version
--- 08 MAY 96 SAIC Reinforced for 2.1
--- 16 FEB 98 EDS Modified documentation
---!
-
------------------------------------------------------------------ CD30001_0
-
-with SPPRT13;
-package CD30001_0 is
-
- -- Check that X'Address produces a useful result when X is an aliased
- -- object.
- -- Check that X'Address produces a useful result when X is an object of
- -- a by-reference type.
- -- Check that X'Address produces a useful result when X is an entity
- -- whose Address has been specified.
- -- (using the new form of "for X'Address use ...")
- --
- -- Check that aliased objects and subcomponents are allocated on storage
- -- element boundaries. Check that objects and subcomponents of by
- -- reference types are allocated on storage element boundaries.
-
- type Simple_Enum_Type is (Just, A, Little, Bit);
-
- type Data is record
- Aliased_Comp_1 : aliased Simple_Enum_Type;
- Aliased_Comp_2 : aliased Simple_Enum_Type;
- end record;
-
- type Array_W_Aliased_Comps is array(1..2) of aliased Data;
-
- Aliased_Object : aliased Array_W_Aliased_Comps;
-
- Specific_Object : aliased Array_W_Aliased_Comps;
- for Specific_Object'Address use SPPRT13.Variable_Address2; -- ANX-C RQMT.
-
- procedure TC_Check_Aliased_Addresses;
-
- procedure TC_Check_Specific_Addresses;
-
- procedure TC_Check_By_Reference_Types;
-
-end CD30001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-with System.Storage_Elements;
-with System.Address_To_Access_Conversions;
-package body CD30001_0 is
-
- package Simple_Enum_Type_Ref_Conv is
- new System.Address_To_Access_Conversions(Simple_Enum_Type);
-
- package Data_Ref_Conv is new System.Address_To_Access_Conversions(Data);
-
- package Array_W_Aliased_Comps_Ref_Conv is
- new System.Address_To_Access_Conversions(Array_W_Aliased_Comps);
-
- use type System.Address;
- use type System.Storage_Elements.Integer_Address;
- use type System.Storage_Elements.Storage_Offset;
-
- procedure TC_Check_Aliased_Addresses is
- use type Simple_Enum_Type_Ref_Conv.Object_Pointer;
- use type Data_Ref_Conv.Object_Pointer;
- use type Array_W_Aliased_Comps_Ref_Conv.Object_Pointer;
-
- begin
-
- -- Check the object Aliased_Object
-
- if Aliased_Object'Address not in System.Address then
- Report.Failed("Aliased_Object'Address not an address");
- end if;
-
- if Array_W_Aliased_Comps_Ref_Conv.To_Pointer(Aliased_Object'Address)
- /= Aliased_Object'Unchecked_Access then
- Report.Failed
- ("'Unchecked_Access does not match expected address value");
- end if;
-
- -- Check the element Aliased_Object(1)
-
- if Data_Ref_Conv.To_Address( Aliased_Object(1)'Access )
- /= Aliased_Object(1)'Address then
- Report.Failed
- ("Array element 'Access does not match expected address value");
- end if;
-
- -- Check that Array'Address points at the first component...
-
- if Array_W_Aliased_Comps_Ref_Conv.To_Address( Aliased_Object'Access )
- /= Aliased_Object(1)'Address then
- Report.Failed
- ("Address of array object does not equal address of first component");
- end if;
-
- -- Check the components of Aliased_Object(2)
-
- if Simple_Enum_Type_Ref_Conv.To_Address(
- Aliased_Object(2).Aliased_Comp_1'Unchecked_Access)
- not in System.Address then
- Report.Failed("Component 2 'Unchecked_Access not a valid address");
- end if;
-
- if Aliased_Object(2).Aliased_Comp_2'Address not in System.Address then
- Report.Failed("Component 2 not located at a valid address ");
- end if;
-
- end TC_Check_Aliased_Addresses;
-
- procedure TC_Check_Specific_Addresses is
- use type System.Address;
- use type System.Storage_Elements.Integer_Address;
- use type Simple_Enum_Type_Ref_Conv.Object_Pointer;
- use type Data_Ref_Conv.Object_Pointer;
- use type Array_W_Aliased_Comps_Ref_Conv.Object_Pointer;
- begin
-
- -- Check the object Specific_Object
-
- if System.Storage_Elements.To_Integer(Specific_Object'Address)
- /= System.Storage_Elements.To_Integer(SPPRT13.Variable_Address2) then
- Report.Failed
- ("Specific_Object not at address specified in representation clause");
- end if;
-
- if Array_W_Aliased_Comps_Ref_Conv.To_Pointer(SPPRT13.Variable_Address2)
- /= Specific_Object'Unchecked_Access then
- Report.Failed("Specific_Object'Unchecked_Access not expected value");
- end if;
-
- -- Check the element Specific_Object(1)
-
- if Data_Ref_Conv.To_Address( Specific_Object(1)'Access )
- /= Specific_Object(1)'Address then
- Report.Failed
- ("Specific Array element 'Access does not correspond to the "
- & "elements 'Address");
- end if;
-
- -- Check that Array'Address points at the first component...
-
- if Array_W_Aliased_Comps_Ref_Conv.To_Address( Specific_Object'Access )
- /= Specific_Object(1)'Address then
- Report.Failed
- ("Address of array object does not equal address of first component");
- end if;
-
- -- Check the components of Specific_Object(2)
-
- if Simple_Enum_Type_Ref_Conv.To_Address(
- Specific_Object(1).Aliased_Comp_1'Access)
- not in System.Address then
- Report.Failed("Access value of first record component for object at " &
- "specific address not a valid address");
- end if;
-
- if Specific_Object(2).Aliased_Comp_2'Address not in System.Address then
- Report.Failed("Second record component for object at specific " &
- "address not located at a valid address");
- end if;
-
- end TC_Check_Specific_Addresses;
-
--- Check that X'Address produces a useful result when X is an object of
--- a by-reference type.
-
- type Tagged_But_Not_Exciting is tagged record
- A_Bit_Of_Data : Boolean;
- end record;
-
- Tagged_Object : Tagged_But_Not_Exciting;
-
- procedure Muck_With_Addresses( It : in out Tagged_But_Not_Exciting;
- Its_Address : in System.Address ) is
- begin
- if It'Address /= Its_Address then
- Report.Failed("Address of object passed by reference does not " &
- "match address of object passed" );
- end if;
- end Muck_With_Addresses;
-
- procedure TC_Check_By_Reference_Types is
- begin
- Muck_With_Addresses( Tagged_Object, Tagged_Object'Address );
- end TC_Check_By_Reference_Types;
-
-end CD30001_0;
-
-------------------------------------------------------------------- CD30001
-
-with Report;
-with CD30001_0;
-procedure CD30001 is
-
-begin -- Main test procedure.
-
- Report.Test ("CD30001",
- "Check that X'Address produces a useful result when X is " &
- "an aliased object, or an entity whose Address has been " &
- "specified" );
-
--- Check that X'Address produces a useful result when X is an aliased
--- object.
---
--- Check that aliased objects and subcomponents are allocated on storage
--- element boundaries. Check that objects and subcomponents of by
--- reference types are allocated on storage element boundaries.
-
- CD30001_0.TC_Check_Aliased_Addresses;
-
--- Check that X'Address produces a useful result when X is an entity
--- whose Address has been specified.
-
- CD30001_0.TC_Check_Specific_Addresses;
-
--- Check that X'Address produces a useful result when X is an object of
--- a by-reference type.
-
- CD30001_0.TC_Check_By_Reference_Types;
-
- Report.Result;
-
-end CD30001;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd30002.a b/gcc/testsuite/ada/acats/tests/cd/cd30002.a
deleted file mode 100644
index 7b6fff713ee..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd30002.a
+++ /dev/null
@@ -1,207 +0,0 @@
--- CD30002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the implementation supports Alignments for subtypes and
--- objects specified as factors and multiples of the number of storage
--- elements per word, unless those values cannot be loaded and stored.
--- Check that the largest alignment returned by default is supported.
---
--- Check that the implementation supports Alignments supported by the
--- target linker for stand-alone library-level objects of statically
--- constrained subtypes.
---
--- TEST DESCRIPTION:
--- This test defines several types and objects, specifying various
--- alignments for them (as factors and multiples of the number of
--- storage elements per word). It then checks the alignments by
--- declaring some objects, and checking that the integer values of
--- their addresses is mod the specified alignment. This will not
--- prevent false passes where the lucky compiler gets it right by
--- chance, but will catch compilers that specifically do not obey
--- the alignment clauses.
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex C:
--- this test may report compile time errors at one or more points
--- indicated by "-- ANX-C RQMT", in which case it may be graded as inapplicable.
--- Otherwise, the test must execute and report PASSED.
---
---
--- CHANGE HISTORY:
--- 22 JUL 95 SAIC Initial version
--- 09 MAY 96 SAIC Strengthened for 2.1
--- 26 FEB 97 PWB.CTA Allowed for unexpected word sizes
--- 16 FEB 98 EDS Modified documentation.
--- 26 SEP 98 RLB Fixed value on line 130 so check and dec. match.
--- 30 OCT 98 RLB Split Multiple_Alignment and revised the
--- calculation to work on all targets.
--- 18 JAN 99 RLB Repaired again to work on targets where word size
--- equals storage unit.
---!
-
------------------------------------------------------------------ CD30002_0
-
-with Impdef;
-with System.Storage_Elements;
-package CD30002_0 is
-
- S_Units_per_Word : constant := System.Word_Size/System.Storage_Unit;
- -- Must be 1 or greater.
-
- Multiple_Type_Alignment : constant :=
- Integer'Min ( Impdef.Max_Default_Alignment,
- 2 * S_Units_per_Word );
- -- Calculate a reasonable alignment, but not larger than the
- -- implementation is required to support.
-
- Multiple_Object_Alignment : constant :=
- Integer'Min ( Impdef.Max_Linker_Alignment,
- 2 * S_Units_per_Word );
- -- Calculate a reasonable object alignment, but not larger than
- -- the implementation is required to support.
-
- Small_Alignment : constant :=
- Integer'Max ( S_Units_per_Word / 2, 1);
- -- Calculate a reasonable small alignment, but not less than 1.
- -- (If S_Units_per_Word = 1, 1/2 => 0 which causes problems
- -- verifying alignment.)
-
- subtype Storage_Element is System.Storage_Elements.Storage_Element;
-
- type Some_Stuff is array(1..S_Units_Per_Word) of Storage_Element;
- for Some_Stuff'Alignment
- use Impdef.Max_Default_Alignment; -- ANX-C RQMT.
-
- Library_Level_Object : Some_Stuff;
- for Library_Level_Object'Alignment
- use Impdef.Max_Linker_Alignment; -- ANX-C RQMT.
-
- type Quarter is mod 4; -- two bits
- for Quarter'Alignment use Small_Alignment; -- ANX-C RQMT.
-
- type Half is mod 16; -- nibble
- for Half'Alignment use Multiple_Type_Alignment; -- ANX-C RQMT.
-
- type O_Some_Stuff is array(1..S_Units_Per_Word) of Storage_Element;
-
- type O_Quarter is mod 4; -- two bits
-
- type O_Half is mod 16; -- nibble
-
-end CD30002_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
--- there is no package body CD30002_0
-
-------------------------------------------------------------------- CD30002
-
-with Report;
-with Impdef;
-with CD30002_0;
-with System.Storage_Elements;
-procedure CD30002 is
-
- My_Stuff : CD30002_0.Some_Stuff;
- -- Impdef.Max_Default_Alignment
-
- My_Quarter : CD30002_0.Quarter;
- -- CD30002_0.S_Units_per_Word / 2
-
- My_Half : CD30002_0.Half;
- -- CD30002_0.S_Units_per_Word * 2
-
- Stuff_Object : CD30002_0.O_Some_Stuff;
- for Stuff_Object'Alignment
- use Impdef.Max_Default_Alignment; -- ANX-C RQMT.
-
- Quarter_Object : CD30002_0.O_Quarter;
- for Quarter_Object'Alignment
- use CD30002_0.Small_Alignment; -- ANX-C RQMT.
-
- Half_Object : CD30002_0.O_Half;
- for Half_Object'Alignment
- use CD30002_0.Multiple_Object_Alignment; -- ANX-C RQMT.
-
- subtype IntAdd is System.Storage_Elements.Integer_Address;
- use type System.Storage_Elements.Integer_Address;
-
- function A2I(Value: System.Address) return IntAdd renames
- System.Storage_Elements.To_Integer;
-
- NAC : constant String := " not aligned correctly";
-
-begin -- Main test procedure.
-
- Report.Test ("CD30002", "Check that the implementation supports " &
- "Alignments for subtypes and objects specified " &
- "as factors and multiples of the number of " &
- "storage elements per word, unless those values " &
- "cannot be loaded and stored. Check that the " &
- "largest alignment returned by default is " &
- "supported. Check that the implementation " &
- "supports Alignments supported by the target " &
- "linker for stand-alone library-level objects " &
- "of statically constrained subtypes" );
-
- if A2I(CD30002_0.Library_Level_Object'Address)
- mod Impdef.Max_Linker_Alignment /= 0 then
- Report.Failed("Library_Level_Object" & NAC);
- end if;
-
- if A2I(My_Stuff'Address) mod Impdef.Max_Default_Alignment /= 0 then
- Report.Failed("Max alignment subtype" & NAC);
- end if;
-
- if A2I(My_Quarter'Address) mod (CD30002_0.Small_Alignment) /= 0 then
- Report.Failed("Factor of words subtype" & NAC);
- end if;
-
- if A2I(My_Half'Address) mod (CD30002_0.Multiple_Type_Alignment) /= 0 then
- Report.Failed("Multiple of words subtype" & NAC);
- end if;
-
- if A2I(Stuff_Object'Address) mod Impdef.Max_Default_Alignment /= 0 then
- Report.Failed("Stuff alignment object" & NAC);
- end if;
-
- if A2I(Quarter_Object'Address)
- mod (CD30002_0.Small_Alignment) /= 0 then
- Report.Failed("Factor of words object" & NAC);
- end if;
-
- if A2I(Half_Object'Address) mod (CD30002_0.Multiple_Object_Alignment) /= 0 then
- Report.Failed("Multiple of words object" & NAC);
- end if;
-
- Report.Result;
-
-end CD30002;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd30003.a b/gcc/testsuite/ada/acats/tests/cd/cd30003.a
deleted file mode 100644
index af414490f42..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd30003.a
+++ /dev/null
@@ -1,227 +0,0 @@
--- CD30003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a Size clause for an object is supported if the specified
--- size is at least as large as the subtype's size, and correspond to a
--- size in storage elements that is a multiple of the object's (non-zero)
--- Alignment. RM 13.3(43)
---
--- TEST DESCRIPTION:
--- This test defines several types and then asserts specific sizes for
--- the, it then checks that the size set is reported back.
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex C:
--- this test may report compile time errors at one or more points
--- indicated by "-- ANX-C RQMT", in which case it may be graded as inapplicable.
--- Otherwise, the test must execute and report PASSED.
---
---
--- CHANGE HISTORY:
--- 22 JUL 95 SAIC Initial version
--- 08 MAY 96 SAIC Corrected and strengthened for 2.1
--- 14 FEB 97 PWB.CTA Changed 'Size specifications to multiples
--- of System.Storage_Unit; restricted 'Size spec
--- for enumeration object to max integer size.
--- 16 FEB 98 EDS Modify Documentation.
--- 25 JAN 99 RLB Repaired to properly set and check sizes.
--- 29 JAN 99 RLB Added Pack pragma needed for some implementations.
--- Corrected to support a Storage_Unit size < 8.
---!
-
-------------------------------------------------------------------- CD30003
-
-with Report;
-with System;
-procedure CD30003 is
-
- ---------------------------------------------------------------------------
- -- types and subtypes
- ---------------------------------------------------------------------------
-
- type Bit is mod 2**1;
- for Bit'Size use 1; -- ANX-C RQMT.
-
- type Byte is mod 2**8;
- for Byte'Size use 8; -- ANX-C RQMT.
-
- type Smallword is mod 2**8;
- for Smallword'size use 16; -- ANX-C RQMT.
-
- type Byte_Array is array(1..4) of Byte;
- pragma Pack(Byte_Array); -- ANX-C RQMT.
- -- size should be 32
-
- type Smallword_Array is array(1..4) of Smallword;
- pragma Pack(Smallword_Array); -- Required if Storage_Unit > 16. -- ANX-C RQMT.
-
- -- Use to calulate maximum required size:
- type Max_Modular is mod System.Max_Binary_Modulus;
- type Max_Integer is range System.Min_Int .. System.Max_Int;
- Enum_Size : constant := Integer'Min (32,
- Integer'Min (Max_Modular'Size, Max_Integer'Size));
- type Transmission_Data is ( Empty, Input, Output, IO, Control );
- for Transmission_Data'Size use Enum_Size; -- ANX-C RQMT.
-
- -- Sizes to try:
-
- -- The basic sizes are based on a "normal" Storage_Unit = 8 implementation.
- -- We then use formulas to insure that the specified sizes meet the
- -- the minimum level of support and AI-0051.
-
- Modular_Single_Size : constant := Integer'Min (((8 + (System.Storage_Unit-1))
- /System.Storage_Unit)*System.Storage_Unit, Max_Modular'Size);
- -- Calulate an appropriate, legal, and required to be supported size to
- -- try, which is the size of Byte. Note that object sizes must be
- -- a multiple of the storage unit for the compiler.
-
- Modular_Double_Size : constant := Integer'Min (((16 + (System.Storage_Unit-1))
- /System.Storage_Unit)*System.Storage_Unit, Max_Modular'Size);
-
- Modular_Quad_Size : constant := Integer'Min (((32 + (System.Storage_Unit-1))
- /System.Storage_Unit)*System.Storage_Unit, Max_Modular'Size);
-
- Array_Quad_Size : constant := ((4 * 8 + (System.Storage_Unit-1))
- /System.Storage_Unit)*System.Storage_Unit;
-
- Array_Octo_Size : constant := ((4 * 16 + (System.Storage_Unit-1))
- /System.Storage_Unit)*System.Storage_Unit;
-
- Rounded_Enum_Size : constant := ((Enum_Size + (System.Storage_Unit-1))
- /System.Storage_Unit)*System.Storage_Unit;
-
- Enum_Quad_Size : constant := Integer'Min (((32 + (System.Storage_Unit-1))
- /System.Storage_Unit)*System.Storage_Unit,
- Integer'Min (Max_Modular'Size, Max_Integer'Size));
-
-
- ---------------------------------------------------------------------------
- -- objects
- ---------------------------------------------------------------------------
-
- Bit_8 : Bit :=0;
- for Bit_8'Size use System.Storage_Unit; -- ANX-C RQMT.
-
- Bit_G : Bit :=0;
- for Bit_G'Size use Modular_Double_Size; -- ANX-C RQMT.
-
- Byte_8 : Byte :=0;
- for Byte_8'Size use Modular_Single_Size; -- ANX-C RQMT.
-
- Byte_G : Byte :=0;
- for Byte_G'Size use Modular_Double_Size; -- ANX-C RQMT.
-
- Smallword_1 : Smallword :=0;
- for Smallword_1'Size use Modular_Double_Size; -- ANX-C RQMT.
-
- Smallword_2 : Smallword :=0;
- for Smallword_2'Size use Modular_Quad_Size; -- ANX-C RQMT.
-
- Byte_Array_1 : Byte_Array := (others=>0);
- for Byte_Array_1'Size use Array_Quad_Size; -- ANX-C RQMT.
-
- Smallword_Array_1 : Smallword_Array := (others=>0);
- for Smallword_Array_1'Size use Array_Octo_Size; -- ANX-C RQMT.
-
- Transmission_Data_1 : aliased Transmission_Data := Empty;
-
- Transmission_Data_2 : Transmission_Data := Control;
- for Transmission_Data_2'Size use Enum_Quad_Size; -- ANX-C RQMT.
-
-begin -- Main test procedure.
-
- Report.Test ("CD30003", "Check that Size clauses are supported for " &
- "values at least as large as the subtypes " &
- "size, and correspond to a size in storage " &
- "elements that is a multiple of the objects " &
- "(non-zero) Alignment" );
-
- if Bit_8'Size /= System.Storage_Unit then
- Report.Failed("Expected Bit_8'Size =" & Integer'Image(System.Storage_Unit)
- & " , actually =" & Integer'Image(Bit_8'Size));
- end if;
-
- if Bit_G'Size /= Modular_Double_Size then
- Report.Failed("Expected Bit_G'Size =" & Integer'Image(Modular_Double_Size)
- & " , actually =" & Integer'Image(Bit_G'Size));
- end if;
-
- if Byte_8'Size /= Modular_Single_Size then
- Report.Failed("Expected Byte_8'Size =" & Integer'Image(Modular_Single_Size)
- & " , actually =" & Integer'Image(Byte_8'Size));
- end if;
-
- if Byte_G'Size /= Modular_Double_Size then
- Report.Failed("Expected Bit_G'Size =" & Integer'Image(Modular_Double_Size)
- & " , actually =" & Integer'Image(Byte_G'Size));
- end if;
-
- if Smallword_1'Size /= Modular_Double_Size then
- Report.Failed("Expected Smallword_1'Size =" &
- Integer'Image(Modular_Double_Size) &
- ", actually =" & Integer'Image(Smallword_1'Size));
- end if;
-
- if Smallword_2'Size /= Modular_Quad_Size then
- Report.Failed("Expected Smallword_2'Size =" &
- Integer'Image(Modular_Quad_Size) &
- ", actually =" & Integer'Image(Smallword_2'Size));
- end if;
-
- if Byte_Array_1'Size /= Array_Quad_Size then
- Report.Failed("Expected Byte_Array_1'Size =" &
- Integer'Image(Array_Quad_Size) &
- ", actually =" & Integer'Image(Byte_Array_1'Size));
- end if;
-
- if Smallword_Array_1'Size /= Array_Octo_Size then
- Report.Failed(
- "Expected Smallword_Array_1'Size =" &
- Integer'Image(Array_Octo_Size) &
- ", actually =" & Integer'Image(Smallword_Array_1'Size));
- end if;
-
- if Transmission_Data_1'Size /= Enum_Size and then
- Transmission_Data_1'Size /= Rounded_Enum_Size then
- Report.Failed(
- "Expected Transmission_Data_1'Size =" & Integer'Image(Rounded_Enum_Size) &
- ", actually =" & Integer'Image(Transmission_Data_1'Size));
- end if;
-
- if Transmission_Data_2'Size /= Enum_Quad_Size then
- Report.Failed(
- "Expected Transmission_Data_2'Size =" & Integer'Image(Enum_Quad_Size) &
- ", actually =" & Integer'Image(Transmission_Data_2'Size));
- end if;
-
- Report.Result;
-
-end CD30003;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd30004.a b/gcc/testsuite/ada/acats/tests/cd/cd30004.a
deleted file mode 100644
index 1a1bcff1f5d..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd30004.a
+++ /dev/null
@@ -1,215 +0,0 @@
--- CD30004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
---
---
--- Check that the unspecified Size of static discrete
--- subtypes is the number of bits needed to represent each value
--- belonging to the subtype using an unbiased representation, where
--- space for a sign bit is provided only in the event the subtype
--- contains negative values. Check that for first subtypes specified
--- Sizes are supported reflecting this representation. [ARM 95 13.3(55)].
---
--- TEST DESCRIPTION:
--- This test defines a few types that should have distinctly recognizable
--- sizes. A packed record which should result in very specific bits
--- sizes for it's components is used to check the first part of the
--- objective. The second part of the objective is checked by giving
--- sizes for a similar set of types.
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex C:
--- this test may report compile time errors at one or more points
--- indicated by "-- ANX-C RQMT", in which case it may be graded as inapplicable.
--- Otherwise, the test must execute and report PASSED.
---
--- CHANGE HISTORY:
--- 22 JUL 95 SAIC Initial version
--- 06 MAY 96 SAIC Revised for 2.1
--- 26 FEB 97 PWB.CTA Added pragma Pack for type Check_Record
--- 16 FEB 98 EDS Modified Documentation.
--- 06 JUL 99 RLB Repaired comments, removed junk test cases.
--- Added test cases to test that appropriate Size
--- clauses are allowed.
-
---!
------------------------------------------------------------------ CD30004_0
-
-package CD30004_0 is
-
--- Check that the unspecified Size of static discrete and fixed point
--- subtypes are the number of bits needed to represent each value
--- belonging to the subtype using an unbiased representation, where
--- space for a sign bit is provided only in the event the subtype
--- contains negative values. Check that for first subtypes specified
--- Sizes are supported reflecting this representation.
-
- type Bits_2 is ( Zeroth_Bit, Fiercest_Bit, Secants_Bit, Threadless_Bit );
-
- type Bits_3 is range 0..2**3-1;
-
- type Bits_5 is range -2**4+1..2**4-1; -- allow for 1's comp
-
- type Bits_14 is mod 2**14;
-
- type Check_Record is
- record
- B14 : Bits_14;
- B2 : Bits_2;
- B3 : Bits_3;
- B5 : Bits_5;
- C : Character;
- end record;
- pragma Pack ( Check_Record );
-
- procedure TC_Check_Values;
- procedure TC_Check_Specified_Sizes;
-
-end CD30004_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-with Report;
-with Impdef;
-package body CD30004_0 is
-
- procedure TC_Check_Values is
- begin
-
- if Bits_2'Size /= 2 then
- if Impdef.Validating_Annex_C then
- Report.Failed("Bits_2'Size not 2 bits");
- else -- Recommended levels of support are not binding.
- Report.Comment("Bits_2'Size not 2 bits");
- end if;
- end if;
-
- if Bits_14'Size /= 14 then
- if Impdef.Validating_Annex_C then
- Report.Failed("Bits_14'Size not 14 bits");
- else
- Report.Comment("Bits_14'Size not 14 bits");
- end if;
- end if;
-
- if Bits_3'Size /= 3 then
- if Impdef.Validating_Annex_C then
- Report.Failed("Bits_3'Size not 3 bits");
- else
- Report.Comment("Bits_3'Size not 3 bits");
- end if;
- end if;
-
- if Bits_5'Size /= 5 then
- if Impdef.Validating_Annex_C then
- Report.Failed("Bits_5'Size not 5 bits");
- else
- Report.Comment("Bits_5'Size not 5 bits");
- end if;
- end if;
-
- if Character'Size /= 8 then
- Report.Failed("Character'Size not 8 bits");
- end if;
-
- if Wide_Character'Size /= 16 then
- Report.Failed("Wide_Character'Size not 16 bits");
- end if;
-
- end TC_Check_Values;
-
- type Spec_Bits_2 is ( Zeroth_Bit, Fiercest_Bit, Secants_Bit, Threadless_Bit );
- for Spec_Bits_2'Size use 2; -- ANX-C RQMT.
-
- type Spec_Bits_3 is range 0..2**3-1;
- for Spec_Bits_3'Size use 3; -- ANX-C RQMT.
-
- type Spec_Bits_5 is range -2**4+1..2**4-1; -- allow for 1's comp
- for Spec_Bits_5'Size use 5; -- ANX-C RQMT.
-
- type Spec_Bits_14 is mod 2**14;
- for Spec_Bits_14'Size use 14; -- ANX-C RQMT.
-
- type Spec_Record is new Check_Record;
- for Spec_Record'Size use 64; -- ANX-C RQMT.
-
- procedure TC_Check_Specified_Sizes is
-
- begin
-
- if Spec_Record'Size /= 64 then
- Report.Failed("Spec_Record'Size not 64 bits");
- end if;
-
- if Spec_Bits_2'Size /= 2 then
- Report.Failed("Spec_Bits_2'Size not 2 bits");
- end if;
-
- if Spec_Bits_14'Size /= 14 then
- Report.Failed("Spec_Bits_14'Size not 14 bits");
- end if;
-
- if Spec_Bits_3'Size /= 3 then
- Report.Failed("Spec_Bits_3'Size not 3 bits");
- end if;
-
- if Spec_Bits_5'Size /= 5 then
- Report.Failed("Spec_Bits_5'Size not 5 bits");
- end if;
-
- end TC_Check_Specified_Sizes;
-
-end CD30004_0;
-
-------------------------------------------------------------------- CD30004
-
-with Report;
-with CD30004_0;
-
-procedure CD30004 is
-
-begin -- Main test procedure.
-
- Report.Test ("CD30004", "Check that the unspecified Size of static " &
- "discrete and fixed point subtypes is the number of bits " &
- "needed to represent each value belonging to the subtype " &
- "using an unbiased representation, where space for a sign " &
- "bit is provided only in the event the subtype contains " &
- "negative values. Check that for first subtypes " &
- "specified Sizes are supported reflecting this " &
- "representation.");
-
- CD30004_0.TC_Check_Values;
-
- CD30004_0.TC_Check_Specified_Sizes;
-
- Report.Result;
-
-end CD30004;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd33001.a b/gcc/testsuite/ada/acats/tests/cd/cd33001.a
deleted file mode 100644
index 82555054aef..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd33001.a
+++ /dev/null
@@ -1,139 +0,0 @@
--- CD33001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Component_Sizes that are a factor of the word
--- size are supported.
---
--- Check that for such Component_Sizes arrays contain no gaps between
--- components.
---
--- TEST DESCRIPTION:
--- This test defines three array types and specifies their layouts
--- using representation specifications for the 'Component_Size and
--- pragma Packs for each. It then checks that the implied assumptions
--- about the resulting layout actually can be made.
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex C:
--- this test may report compile time errors at one or more points
--- indicated by "-- ANX-C RQMT", in which case it may be graded as inapplicable.
--- Otherwise, the test must execute and report PASSED.
---
---
--- CHANGE HISTORY:
--- 22 JUL 95 SAIC Initial version
--- 07 MAY 96 SAIC Revised for 2.1
--- 24 AUG 96 SAIC Additional 2.1 revisions
--- 17 FEB 97 PWB.CTA Corrected prefix of 'Component_Size to name
--- array object instead of array subtype
--- 16 FEB 98 EDS Modified documentation.
---!
-
------------------------------------------------------------------ CD33001_0
-
-with System;
-package CD33001_0 is
-
- S_Units_per_Word : constant := System.Word_Size/System.Storage_Unit;
-
- type Nibble is mod 2**4;
-
- type Byte is mod 2**8;
-
- type Half_Stuff is array(Natural range <>) of Nibble;
- for Half_Stuff'Component_Size
- use System.Word_Size / 2; -- factor -- ANX-C RQMT.
- pragma Pack(Half_Stuff); -- ANX-C RQMT.
-
- type Word_Stuff is array(Natural range <>) of Byte;
- for Word_Stuff'Component_Size
- use System.Word_Size; -- ANX-C RQMT.
-
- type Address_Calculator is record
- Item_1 : Nibble;
- Item_2 : Nibble;
- end record;
-
- for Address_Calculator use record
- Item_1 at 0 range 0..3;
- Item_2 at 1 range 0..3;
- end record;
-
- -- given that Item_1 is specified to be at 'Position = 0 and
- -- Item_2 is specified to be at 'Position = 1
- -- by definition (13.5.2(2)) abs(Item_2'Address - Item_1'Address) = 1
-
-end CD33001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
--- there is no package body CD33001_0
-
-------------------------------------------------------------------- CD33001
-
-with Report;
-with System.Storage_Elements;
-with CD33001_0;
-procedure CD33001 is
-
- use type System.Storage_Elements.Storage_Offset;
-
- A_Half : CD33001_0.Half_Stuff(0..15);
-
- A_Word : CD33001_0.Word_Stuff(0..15);
-
- procedure Unexpected( Message : String; Wanted, Got: Integer ) is
- begin
- Report.Failed( Message & " Wanted:"
- & Integer'Image(Wanted) & " Got:" & Integer'Image(Got) );
- end Unexpected;
-
-begin -- Main test procedure.
-
- Report.Test ("CD33001", "Check that Component_Sizes that are factor of " &
- "the word size are supported. Check that for " &
- "such Component_Sizes arrays contain no gaps " &
- "between components" );
-
- if A_Half'Size /= A_Half'Component_Size * 16 then
- Unexpected("Half word Size",
- CD33001_0.Half_Stuff'Component_Size * 16,
- A_Half'Size );
- end if;
-
- if A_Word(1)'Size /= System.Word_Size then
- Unexpected("Word Size", System.Word_Size, A_Word(1)'Size );
- end if;
-
-
- Report.Result;
-
-end CD33001;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd33002.a b/gcc/testsuite/ada/acats/tests/cd/cd33002.a
deleted file mode 100644
index 5b3cdbd5f82..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd33002.a
+++ /dev/null
@@ -1,140 +0,0 @@
--- CD33002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Component_Sizes that are multiples of the word
--- size are supported.
---
--- Check that for such Component_Sizes arrays contain no gaps between
--- components.
---
--- TEST DESCRIPTION:
--- This test defines three array types and specifies their layouts
--- using representation specifications for the 'Component_Size and
--- pragma Packs for each. It then checks that the implied assumptions
--- about the resulting layout actually can be made.
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex C:
--- this test may report compile time errors at one or more points
--- indicated by "-- ANX-C RQMT", in which case it may be graded as inapplicable.
--- Otherwise, the test must execute and report PASSED.
---
---
--- CHANGE HISTORY:
--- 22 JUL 95 SAIC Initial version
--- 07 MAY 96 SAIC Revised for 2.1
--- 24 AUG 96 SAIC Additional 2.1 revisions
--- 16 FEB 98 EDS Modify documentation.
---!
-
------------------------------------------------------------------ CD33002_0
-
-with System;
-package CD33002_0 is
-
- S_Units_per_Word : constant := System.Word_Size/System.Storage_Unit;
-
- type Nibble is mod 2**4;
-
- type Byte is mod 2**8;
-
- type Word_Stuff is array(Natural range <>) of Byte;
- for Word_Stuff'Component_Size
- use System.Word_Size; -- ANX-C RQMT.
- pragma Pack(Word_Stuff); -- ANX-C RQMT.
-
- type Double_Stuff is array(Natural range <>) of Byte;
- for Double_Stuff'Component_Size
- use System.Word_Size * 2; -- multiple -- ANX-C RQMT.
-
- type Address_Calculator is record
- Item_1 : Nibble;
- Item_2 : Nibble;
- end record;
-
- for Address_Calculator use record
- Item_1 at 0 range 0..3;
- Item_2 at 1 range 0..3;
- end record;
-
- -- by definition (13.5.2(2)) abs(Item_2'Address - Item_1'Address) = 1
- -- it therefore follows that:
- -- Address_Calculator'Size = 2 * Addressable_Unit'Size
-
-end CD33002_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
--- there is no package body CD33002_0
-
-------------------------------------------------------------------- CD33002
-
-with Report;
-with TCTouch;
-with System.Storage_Elements;
-with CD33002_0;
-procedure CD33002 is
-
- use type System.Storage_Elements.Storage_Offset;
-
- A_Word : CD33002_0.Word_Stuff(0..15);
-
- A_Double : CD33002_0.Double_Stuff(0..15);
-
- procedure Unexpected( Message : String; Wanted, Got: Integer ) is
- begin
- Report.Failed ( Message & " Wanted:"
- & Integer'Image(Wanted) & " Got:" & Integer'Image(Got) );
- end Unexpected;
-
-begin -- Main test procedure.
-
- Report.Test ("CD33002", "Check that Component_Sizes that are multiples "
- & "of the word size are supported. Check that for "
- & "such Component_Sizes arrays contain no gaps "
- & "between components" );
-
- if A_Word'Size /= CD33002_0.Word_Stuff'Component_Size * 16 then
- Unexpected("Word Size",
- CD33002_0.Word_Stuff'Component_Size * 16,
- A_Word'Size );
- end if;
-
- if A_Double'Size /= CD33002_0.Double_Stuff'Component_Size * 16 then
- Unexpected("Double word Size",
- CD33002_0.Double_Stuff'Component_Size * 16,
- A_Double'Size );
- end if;
-
-
- Report.Result;
-
-end CD33002;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd40001.a b/gcc/testsuite/ada/acats/tests/cd/cd40001.a
deleted file mode 100644
index 273271fdb8e..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd40001.a
+++ /dev/null
@@ -1,181 +0,0 @@
--- CD40001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Enumeration_Representation_Clauses are supported for
--- codes in the range System.Min_Int..System.Max_Int.
---
--- TEST DESCRIPTION:
--- This test defines several types, and checks that the range of the
--- enumeration clause is as expected.
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex C:
--- this test may report compile time errors at one or more points
--- indicated by "-- ANX-C RQMT", in which case it may be graded as inapplicable.
--- Otherwise, the test must execute and report PASSED.
---
---
--- CHANGE HISTORY:
--- 22 JUL 95 SAIC Initial version
--- 07 MAY 96 SAIC Revised for 2.1
--- 16 FEB 98 EDS Modified Documentation.
---!
-
-with System;
-with Ada.Unchecked_Conversion;
-package CD40001_0 is
-
- type Press_The_Bounds is ( Negative_Large, Positive_Large );
-
- for Press_The_Bounds use
- ( Negative_Large => System.Min_Int, -- ANX-C RQMT.
- Positive_Large => System.Max_Int ); -- ANX-C RQMT.
-
- type Add_The_Bounds is
- ( Monday, Tuesday, Wednesday, Thursday, Friday, Saturday);
-
- for Add_The_Bounds use
- ( Monday => System.Min_Int, -- ANX-C RQMT.
- Tuesday => System.Min_Int + 1, -- ANX-C RQMT.
- Wednesday => System.Min_Int + 2, -- ANX-C RQMT.
- Thursday => System.Min_Int + 3, -- ANX-C RQMT.
- Friday => System.Min_Int + 4, -- ANX-C RQMT.
- Saturday => System.Min_Int + 5 ); -- ANX-C RQMT.
-
- type Minus_The_Bounds is ( Jan, Feb, Mar, Apr);
-
- for Minus_The_Bounds use
- ( Apr => System.Max_Int, -- ANX-C RQMT.
- Mar => System.Max_Int - 1, -- ANX-C RQMT.
- Feb => System.Max_Int - 2, -- ANX-C RQMT.
- Jan => System.Max_Int - 3 ); -- ANX-C RQMT.
-
- type TC_Integer is range System.Min_Int..System.Max_Int;
-
- procedure TC_Check_Press;
-
- procedure TC_Check_Add;
-
- procedure TC_Check_Minus;
-
- function TC_Compare_Press is new Ada.Unchecked_Conversion
- (Press_The_Bounds, TC_Integer);
-
- function TC_Compare_Add is new Ada.Unchecked_Conversion
- (Add_The_Bounds, TC_Integer);
-
- function TC_Compare_Minus is new Ada.Unchecked_Conversion
- (Minus_The_Bounds, TC_Integer);
-
-end CD40001_0;
-
- --==================================================================--
-
-with Report;
-package body CD40001_0 is
-
- procedure TC_Check_Press is
- My_Press_First : Press_The_Bounds := Negative_Large;
- My_Press_Last : Press_The_Bounds := Positive_Large;
- begin
- if TC_Compare_Press (My_Press_First) /= System.Min_Int or
- TC_Compare_Press (My_Press_Last) /= System.Max_Int
- then
- Report.Failed
- ("Expected enumeration size of System.Min_Int and System.Max_Int " &
- "not available for this implementation");
- end if;
- end TC_Check_Press;
-
- ---------------------------------------------------------------------------
- procedure TC_Check_Add is
- My_Monday : Add_The_Bounds := Monday;
- My_Tuesday : Add_The_Bounds := Tuesday;
- My_Wednesday : Add_The_Bounds := Wednesday;
- My_Thursday : Add_The_Bounds := Thursday;
- My_Friday : Add_The_Bounds := Friday;
- My_Saturday : Add_The_Bounds := Saturday;
- begin
- if TC_Compare_Add (My_Monday) /= (System.Min_Int) or
- TC_Compare_Add (My_Thursday) /= (System.Min_Int + 3) or
- TC_Compare_Add (My_Wednesday) /= (System.Min_Int + 2) or
- TC_Compare_Add (My_Tuesday) /= (System.Min_Int + 1) or
- TC_Compare_Add (My_Saturday) /= (System.Min_Int + 5) or
- TC_Compare_Add (My_Friday) /= (System.Min_Int + 4)
- then
- Report.Failed
- ("Expected enumeration size of System.Min_Int, System.Min_Int + 1 " &
- "through System.Min_Int + 5 not available for this implementation");
- end if;
- end TC_Check_Add;
-
- ---------------------------------------------------------------------------
- procedure TC_Check_Minus is
- My_Jan : Minus_The_Bounds := Jan;
- My_Feb : Minus_The_Bounds := Feb;
- My_Mar : Minus_The_Bounds := Mar;
- My_Apr : Minus_The_Bounds := Apr;
- begin
- if TC_Compare_Minus (My_Jan) /= (System.Max_Int - 3) or
- TC_Compare_Minus (My_Feb) /= (System.Max_Int - 2) or
- TC_Compare_Minus (My_Mar) /= (System.Max_Int - 1) or
- TC_Compare_Minus (My_Apr) /= (System.Max_Int)
- then
- Report.Failed
- ("Expected enumeration size of System.Max_Int, System.Max_Int - 1 " &
- "through System.Max_Int - 3 not available for this implementation");
- end if;
- end TC_Check_Minus;
-
-end CD40001_0;
-
- --==================================================================--
-
-with Report;
-with CD40001_0;
-
-procedure CD40001 is
-
-begin -- Main test procedure.
-
- Report.Test ("CD40001", "Check that Enumeration_Representation_Clauses " &
- "are supported for codes in the range " &
- "System.Min_Int..System.Max_Int" );
-
- CD40001_0.TC_Check_Press;
-
- CD40001_0.TC_Check_Add;
-
- CD40001_0.TC_Check_Minus;
-
- Report.Result;
-
-end CD40001;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd70001.a b/gcc/testsuite/ada/acats/tests/cd/cd70001.a
deleted file mode 100644
index 48400958804..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd70001.a
+++ /dev/null
@@ -1,201 +0,0 @@
---
--- CD70001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that package System includes Max_Base_Digits, Address,
--- Null_Address, Word_Size, functions "<", "<=", ">", ">=", "="
--- (with Address parameters and Boolean results), Bit_Order,
--- Default_Bit_Order, Any_Priority, Interrupt_Priority,
--- and Default_Priority.
---
--- Check that package System.Storage_Elements includes all required
--- types and operations.
---
--- TEST DESCRIPTION:
--- The test checks for the existence of the names additional
--- to package system above those names tested for in 9Xbasic.
---
--- This test checks that the semantics provided in Storage_Elements
--- are present and operate marginally within expectations (to the best
--- extent possible in a portable implementation independent fashion).
---
---
--- CHANGE HISTORY:
--- 09 MAY 95 SAIC Initial version
--- 27 JAN 96 SAIC Revised for 2.1; Allow negative address delta
---
---!
-
-with Report;
-with Ada.Text_IO;
-with System.Storage_Elements;
-with System.Address_To_Access_Conversions;
-procedure CD70001 is
- use System;
-
- procedure CD70 is
-
- type Int_Max is range Min_Int .. Max_Int;
-
- My_Int : Int_Max := System.Max_Base_Digits + System.Word_Size;
-
- An_Address : Address;
- An_Other_Address : Address := An_Address'Address;
-
- begin -- 7.0
-
-
- if Default_Bit_Order not in High_Order_First..Low_Order_First then
- Report.Failed ("Default_Bit_Order invalid");
- end if;
-
- if Bit_Order'Pos(High_Order_First) /= 0 then
- Report.Failed ("Bit_Order'Pos(High_Order_First) /= 0");
- end if;
-
- if Bit_Order'Pos(Low_Order_First) /= 1 then
- Report.Failed ("Bit_Order'Pos(Low_Order_First) /= 1");
- end if;
-
- An_Address := My_Int'Address;
-
- if An_Address = Null_Address then
- Report.Failed ("Null_Address matched a real address");
- end if;
-
-
- if An_Address'Address /= An_Other_Address then
- Report.Failed("Value set at elaboration not equal to itself");
- end if;
-
- if An_Address'Address > An_Other_Address
- and An_Address'Address < An_Other_Address then
- Report.Failed("Address is both greater and less!");
- end if;
-
- if not (An_Address'Address >= An_Other_Address
- and An_Address'Address <= An_Other_Address) then
- Report.Failed("Address comparisons wrong");
- end if;
-
-
- if Priority'First /= Any_Priority'First then
- Report.Failed ("Priority'First /= Any_Priority'First");
- end if;
-
- if Interrupt_Priority'First /= Priority'Last+1 then
- Report.Failed ("Interrupt_Priority'First /= Priority'Last+1");
- end if;
-
- if Interrupt_Priority'Last /= Any_Priority'Last then
- Report.Failed ("Interrupt_Priority'Last /= Any_Priority'Last");
- end if;
-
- if Default_Priority /= ((Priority'First + Priority'Last)/2) then
- Report.Failed ("Default_Priority wrong value");
- end if;
-
- end CD70;
-
- procedure CD71 is
- use System.Storage_Elements;
-
- Storehouse_1 : Storage_Array(0..127);
- Storehouse_2 : Storage_Array(0..127);
-
- House_Offset : Storage_Offset;
-
- begin -- 7.1
-
-
- if Storage_Count'First /= 0 then
- Report.Failed ("Storage_Count'First /= 0");
- end if;
-
- if Storage_Count'Last /= Storage_Offset'Last then
- Report.Failed ("Storage_Count'Last /= Storage_Offset'Last");
- end if;
-
-
- if Storage_Element'Size /= Storage_Unit then
- Report.Failed ("Storage_Element'Size /= Storage_Unit");
- end if;
-
- if Storage_Array'Component_Size /= Storage_Unit then
- Report.Failed ("Storage_Array'Element_Size /= Storage_Unit");
- end if;
-
- if Storage_Element'Last+1 /= 0 then
- Report.Failed ("Storage_Element not modular");
- end if;
-
-
- -- "+", "-"( Address, Storage_Offset) and inverse
-
- House_Offset := Storehouse_2'Address - Storehouse_1'Address;
- -- Address - Address = Offset
- -- Note that House_Offset may be a negative value
-
- if House_Offset + Storehouse_1'Address /= Storehouse_2'Address then
- -- Offset + Address = Address
- Report.Failed ("Storage arithmetic non-linear O+A");
- end if;
-
- if Storehouse_1'Address + House_Offset /= Storehouse_2'Address then
- -- Address + Offset = Address
- Report.Failed ("Storage arithmetic non-linear A+O");
- end if;
-
- if Storehouse_2'Address - House_Offset /= Storehouse_1'Address then
- -- Address - Offset = Address
- Report.Failed ("Storage arithmetic non-linear A-O");
- end if;
-
- if (Storehouse_2'Address mod abs(House_Offset) > abs(House_Offset)) then
- -- "mod"( Address, Storage_Offset)
- Report.Failed("Mod arithmetic");
- end if;
-
-
- if Storehouse_1'Address
- /= To_Address(To_Integer(Storehouse_1'Address)) then
- Report.Failed("To_Address, To_Integer not symmetric");
- end if;
-
- end CD71;
-
-
-begin -- Main test procedure.
-
- Report.Test ("CD70001", "Check package System" );
-
- CD70;
-
- CD71;
-
- Report.Result;
-
-end CD70001;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd72a01.a b/gcc/testsuite/ada/acats/tests/cd/cd72a01.a
deleted file mode 100644
index 9c98cb0c67e..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd72a01.a
+++ /dev/null
@@ -1,165 +0,0 @@
---
--- CD72A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the package System.Address_To_Access_Conversions may be
--- instantiated for various simple types.
---
--- Check that To_Pointer and To_Address are inverse operations.
---
--- Check that To_Pointer(X'Address) equals X'Unchecked_Access for an
--- X that allows Unchecked_Access.
---
--- Check that To_Pointer(Null_Address) returns null.
---
--- TEST DESCRIPTION:
--- This test checks that the semantics provided in
--- Address_To_Access_Conversions are present and operate
--- within expectations (to the best extent possible in a portable
--- implementation independent fashion).
---
--- The functions Address_To_Hex and Hex_To_Address test the invertability
--- of the To_Integer and To_Address functions, along with a great deal
--- of optimizer chaff and protection from the fact that type
--- Storage_Elements.Integer_Address may be either a modular or a signed
--- integer type.
---
--- This test has some interesting usage paradigms in that users
--- occasionally want to store address information in a transportable
--- fashion, and often resort to some textual representation of values.
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex C:
--- this test may report compile time errors at one or more points
--- indicated by "-- ANX-C RQMT", in which case it may be graded as inapplicable.
--- Otherwise, the test must execute and report PASSED.
---
--- CHANGE HISTORY:
--- 13 JUL 95 SAIC Initial version (CD72001)
--- 08 FEB 96 SAIC Revised (split) version for 2.1
--- 07 MAY 96 SAIC Additional subtest added for 2.1
--- 16 FEB 98 EDS Modified documentation.
---!
-
-with Report;
-with Impdef;
-with FD72A00;
-with System.Storage_Elements;
-with System.Address_To_Access_Conversions;
-procedure CD72A01 is
- use System;
- use FD72A00;
-
- package Number_ATAC is
- new System.Address_To_Access_Conversions(Number); -- ANX-C RQMT
-
- use type Number_ATAC.Object_Pointer;
-
- type Data is record
- One, Two: aliased Number;
- end record;
-
- package Data_ATAC is
- new System.Address_To_Access_Conversions(Data); -- ANX-C RQMT
-
- use type Data_ATAC.Object_Pointer;
-
- type Test_Cases is ( Addr_Type, Record_Type );
-
- type Naive_Dynamic_String is access String;
-
- type String_Store is array(Test_Cases) of Naive_Dynamic_String;
-
- The_Strings : String_Store;
-
- -- create several aliased objects with distinct values
-
- My_Number : aliased Number := Number'First;
- My_Data : aliased Data := (Number'First,Number'Last);
-
- use type System.Storage_Elements.Integer_Address;
-
-begin -- Main test procedure.
-
- Report.Test ("CD72A01", "Check package " &
- "System.Address_To_Access_Conversions " &
- "for simple types" );
-
- -- take several pointer objects, convert them to addresses, and store
- -- the address as a hexadecimal representation for later reconversion
-
- The_Strings(Addr_Type) := new String'(
- Address_To_Hex(Number_ATAC.To_Address(My_Number'Access)) );
-
- The_Strings(Record_Type) := new String'(
- Address_To_Hex(Data_ATAC.To_Address(My_Data'Access)) );
-
- -- now, reconvert the hexadecimal address values back to pointers,
- -- and check that the dereferenced pointer still designates the
- -- value placed at that location. The use of the intermediate
- -- string representation should foil even the cleverest of optimizers
-
- if Number_ATAC.To_Pointer(
- Hex_To_Address(The_Strings(Addr_Type))).all
- /= Number'First then
- Report.Failed("Number reconversion");
- end if;
-
- if Data_ATAC.To_Pointer(Hex_To_Address(The_Strings(Record_Type))).all
- /= (Number'First,Number'Last) then
- Report.Failed("Data reconversion");
- end if;
-
- -- check that the resulting values are equal to the 'Unchecked_Access
- -- of the value
-
- if Number_ATAC.To_Pointer(
- Hex_To_Address(The_Strings(Addr_Type)))
- /= My_Number'Unchecked_Access then
- Report.Failed("Number Unchecked_Access");
- end if;
-
- if Data_ATAC.To_Pointer(Hex_To_Address(The_Strings(Record_Type)))
- /= My_Data'Unchecked_Access then
- Report.Failed("Data Unchecked_Access");
- end if;
-
- if Number_ATAC.To_Pointer(System.Null_Address) /= null then
- Report.Failed("To_Pointer(Null_Address) /= null");
- end if;
-
- if Number_ATAC.To_Address(null) /= System.Null_Address then
- Report.Failed("To_Address(null) /= Null_Address");
- end if;
-
- Report.Result;
-
-end CD72A01;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd72a02.a b/gcc/testsuite/ada/acats/tests/cd/cd72a02.a
deleted file mode 100644
index f396edc19f3..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd72a02.a
+++ /dev/null
@@ -1,225 +0,0 @@
--- CD72A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the package System.Address_To_Access_Conversions may be
--- instantiated for various composite types.
---
--- Check that To_Pointer and To_Address are inverse operations.
---
--- Check that To_Pointer(X'Address) equals X'Unchecked_Access for an
--- X that allows Unchecked_Access.
---
--- Check that To_Pointer(Null_Address) returns null.
---
--- TEST DESCRIPTION:
--- This test is identical to CD72A01 with the exception that it tests
--- the composite types where CD72A01 tests "simple" types.
---
--- This test checks that the semantics provided in
--- Address_To_Access_Conversions are present and operate
--- within expectations (to the best extent possible in a portable
--- implementation independent fashion).
---
--- The functions Address_To_Hex and Hex_To_Address test the invertability
--- of the To_Integer and To_Address functions, along with a great deal
--- of optimizer chaff and protection from the fact that type
--- Storage_Elements.Integer_Address may be either a modular or a signed
--- integer type.
---
--- This test has some interesting usage paradigms in that users
--- occasionally want to store address information in a transportable
--- fashion, and often resort to some textual representation of values.
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex C:
--- this test may report compile time errors at one or more points
--- indicated by "-- ANX-C RQMT", in which case it may be graded as inapplicable.
--- Otherwise, the test must execute and report PASSED.
---
---
--- CHANGE HISTORY:
--- 13 JUL 95 SAIC Initial version (CD72001)
--- 08 FEB 96 SAIC Split from CD72001 by reviewer request for 2.1
--- 12 NOV 96 SAIC Corrected typo in RM ref
--- 16 FEB 98 EDS Modified documentation.
--- 22 JAN 02 RLB Corrected test description.
---!
-
-with Report;
-with Impdef;
-with FD72A00;
-with System.Storage_Elements;
-with System.Address_To_Access_Conversions;
-procedure CD72A02 is
- use System;
- use FD72A00;
-
- type Tagged_Record is tagged record
- Value : Natural;
- end record;
-
- package Class_ATAC is
- new System.Address_To_Access_Conversions(Tagged_Record'Class);
- -- ANX-C RQMT
-
- use type Class_ATAC.Object_Pointer;
-
- task type TC_Task_Type is
- entry E;
- entry F;
- end TC_Task_Type;
-
- package Task_ATAC is
- new System.Address_To_Access_Conversions(TC_Task_Type);
- -- ANX-C RQMT
-
- use type Task_ATAC.Object_Pointer;
-
- task body TC_Task_Type is
- begin
- select
- accept E;
- or
- accept F;
- Report.Failed("Task rendezvoused on wrong path");
- end select;
- end TC_Task_Type;
-
- protected type TC_Protec is
- procedure E;
- procedure F;
- private
- Visited : Boolean := False;
- end TC_Protec;
-
- package Protected_ATAC is
- new System.Address_To_Access_Conversions(TC_Protec);
- -- ANX-C RQMT
-
- use type Protected_ATAC.Object_Pointer;
-
- protected body TC_Protec is
- procedure E is
- begin
- Visited := True;
- end E;
- procedure F is
- begin
- if not Visited then
- Report.Failed("Protected Object took wrong path");
- end if;
- end F;
- end TC_Protec;
-
- type Test_Cases is ( Tagged_Type, Task_Type, Protected_Type );
-
- type Naive_Dynamic_String is access String;
-
- type String_Store is array(Test_Cases) of Naive_Dynamic_String;
-
- The_Strings : String_Store;
-
- -- create several aliased objects with distinct values
-
- My_Rec : aliased Tagged_Record := (Value => Natural'Last);
- My_Task : aliased TC_Task_Type;
- My_Prot : aliased TC_Protec;
-
- use type System.Storage_Elements.Integer_Address;
-
-begin -- Main test procedure.
-
- Report.Test ("CD72A02", "Check package " &
- "System.Address_To_Access_Conversions " &
- "for composite types" );
-
- -- take several pointer objects, convert them to addresses, and store
- -- the address as a hexadecimal representation for later reconversion
-
- The_Strings(Tagged_Type) := new String'(
- Address_To_Hex(Class_ATAC.To_Address(My_Rec'Access)) );
-
- The_Strings(Task_Type) := new String'(
- Address_To_Hex(Task_ATAC.To_Address(My_Task'Access)) );
-
- The_Strings(Protected_Type) := new String'(
- Address_To_Hex(Protected_ATAC.To_Address(My_Prot'Access)) );
-
- -- now, reconvert the hexadecimal address values back to pointers,
- -- and check that the dereferenced pointer still designates the
- -- value placed at that location. The use of the intermediate
- -- string representation should foil even the cleverest of optimizers
-
- if Tagged_Record(Class_ATAC.To_Pointer(
- Hex_To_Address(The_Strings(Tagged_Type))).all)
- /= Tagged_Record'(Value => Natural'Last) then
- Report.Failed("Tagged_Record reconversion");
- end if;
-
- Task_ATAC.To_Pointer(Hex_To_Address(The_Strings(Task_Type))).E;
-
- begin
- select -- allow for task to have completed.
- My_Task.F; -- should not happen, will call Report.Fail in task
- else
- null; -- expected case, "Report.Pass;"
- end select;
- exception
- when Tasking_Error => null; -- task terminated, which is OK
- end;
-
- Protected_ATAC.To_Pointer(
- Hex_To_Address(The_Strings(Protected_Type))).E;
- My_Prot.F; -- checks that call to E occurred
-
-
- -- check that the resulting values are equal to the 'Unchecked_Access
- -- of the value
-
- if Class_ATAC.To_Pointer(Hex_To_Address(The_Strings(Tagged_Type)))
- /= My_Rec'Unchecked_Access then
- Report.Failed("Tagged_Record Unchecked_Access");
- end if;
-
- if Task_ATAC.To_Pointer(Hex_To_Address(The_Strings(Task_Type)))
- /= My_Task'Unchecked_Access then
- Report.Failed("Task Unchecked_Access");
- end if;
-
- if Protected_ATAC.To_Pointer(
- Hex_To_Address(The_Strings(Protected_Type)))
- /= My_Prot'Unchecked_Access then
- Report.Failed("Protected Unchecked_Access");
- end if;
-
- Report.Result;
-
-end CD72A02;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd90001.a b/gcc/testsuite/ada/acats/tests/cd/cd90001.a
deleted file mode 100644
index bd5c070a622..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd90001.a
+++ /dev/null
@@ -1,233 +0,0 @@
--- CD90001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Unchecked_Conversion is supported and is reversible in
--- the cases where:
--- Source'Size = Target'Size
--- Source'Alignment = Target'Alignment
--- Source and Target are both represented contiguously
--- Bit pattern in Source is a meaningful value of Target type
---
--- TEST DESCRIPTION:
--- This test declares an enumeration type with a representation
--- specification that should fit neatly into an 8 bit object; and a
--- modular type that should also be able to fit easily into 8 bits;
--- uses size representation clauses on both of them for 8 bit
--- representations. It then defines two instances of
--- Unchecked_Conversion; to convert both ways between the types.
--- Using several distinctive values, it checks that the conversions
--- are performed, and reversible.
--- As a second case, the above is performed with an integer type and
--- a packed array of booleans.
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex C:
--- this test may report compile time errors at one or more points
--- indicated by "-- ANX-C RQMT", in which case it may be graded as inapplicable.
--- Otherwise, the test must execute and report PASSED.
---
---
--- CHANGE HISTORY:
--- 22 JUL 95 SAIC Initial version
--- 07 MAY 96 SAIC Changed Boolean to Character for 2.1
--- 27 JUL 96 SAIC Allowed for partial N/A to be PASS
--- 14 FEB 97 PWB.CTA Corrected "=" to "/=" in alignment check.
--- 16 FEB 98 EDS Modified documentation.
---!
-
------------------------------------------------------------------ CD90001_0
-
-with Report;
-with Unchecked_Conversion;
-package CD90001_0 is
-
- -- Case 1 : Modular <=> Enumeration
-
- type Eight_Bits is mod 2**8;
- for Eight_Bits'Size use 8;
-
- type User_Enums is ( One, Two, Four, Eight,
- Sixteen, Thirty_Two, Sixty_Four, One_Twenty_Eight );
- for User_Enums'Size use 8;
-
- for User_Enums use
- ( One => 1, -- ANX-C RQMT.
- Two => 2, -- ANX-C RQMT.
- Four => 4, -- ANX-C RQMT.
- Eight => 8, -- ANX-C RQMT.
- Sixteen => 16, -- ANX-C RQMT.
- Thirty_Two => 32, -- ANX-C RQMT.
- Sixty_Four => 64, -- ANX-C RQMT.
- One_Twenty_Eight => 128 ); -- ANX-C RQMT.
-
- function EB_2_UE is new Unchecked_Conversion( Eight_Bits, User_Enums );
-
- function UE_2_EB is new Unchecked_Conversion( User_Enums, Eight_Bits );
-
- procedure TC_Check_Case_1;
-
- -- Case 2 : Integer <=> Packed Character array
-
- type Signed_16 is range -2**15+1 .. 2**15-1;
- -- +1, -1 allows for both 1's and 2's comp
-
- type Bits_16 is array(0..1) of Character;
- pragma Pack(Bits_16); -- ANX-C RQMT.
-
- function S16_2_B16 is new Unchecked_Conversion( Signed_16, Bits_16 );
-
- function B16_2_S16 is new Unchecked_Conversion( Bits_16, Signed_16 );
-
- procedure TC_Check_Case_2;
-
-end CD90001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body CD90001_0 is
-
- Check_List : constant array(1..8) of Eight_Bits
- := ( 1, 2, 4, 8, 16, 32, 64, 128 );
-
- Check_Enum : constant array(1..8) of User_Enums
- := ( One, Two, Four, Eight,
- Sixteen, Thirty_Two, Sixty_Four, One_Twenty_Eight );
-
- procedure TC_Check_Case_1 is
- Mod_Value : Eight_Bits;
- Enum_Val : User_Enums;
- begin
- for I in Check_List'Range loop
-
- if EB_2_UE(Check_List(I)) /= Check_Enum(I) then
- Report.Failed("EB => UE conversion failed");
- end if;
-
- if Check_List(I) /= UE_2_EB(Check_Enum(I)) then
- Report.Failed ("EU => EB conversion failed");
- end if;
-
- end loop;
- end TC_Check_Case_1;
-
- procedure TC_Check_Case_2 is
- S: Signed_16;
- T,U: Signed_16;
- B: Bits_16;
- C,D: Bits_16; -- allow for byte swapping
- begin
- --FDEC_BA98_7654_3210
- S := 2#0011_0000_0111_0111#;
- B := S16_2_B16( S );
- C := ( Character'Val(2#0011_0000#), Character'Val(2#0111_0111#) );
- D := ( Character'Val(2#0111_0111#), Character'Val(2#0011_0000#) );
-
- if (B /= C) and (B /= D) then
- Report.Failed("Int => Chararray conversion failed");
- end if;
-
- B := ( Character'Val(2#0011_1100#), Character'Val(2#0101_0101#) );
- S := B16_2_S16( B );
- T := 2#0011_1100_0101_0101#;
- U := 2#0101_0101_0011_1100#;
-
- if (S /= T) and (S /= U) then
- Report.Failed("Chararray => Int conversion failed");
- end if;
-
- end TC_Check_Case_2;
-
-end CD90001_0;
-
-------------------------------------------------------------------- CD90001
-
-with Report;
-with CD90001_0;
-
-procedure CD90001 is
-
- Eight_NA : Boolean := False;
- Sixteen_NA : Boolean := False;
-
-begin -- Main test procedure.
-
- Report.Test ("CD90001", "Check that Unchecked_Conversion is supported " &
- "and is reversible in appropriate cases" );
- Eight_Bit_Case:
- begin
- if CD90001_0.User_Enums'Size /= CD90001_0.Eight_Bits'Size then
- Report.Comment("The sizes of the 8 bit types used in this test "
- & "do not match" );
- Eight_NA := True;
- elsif CD90001_0.User_Enums'Alignment /= CD90001_0.Eight_Bits'Alignment then
- Report.Comment("The alignments of the 8 bit types used in this "
- & "test do not match" );
- Eight_NA := True;
- else
- CD90001_0.TC_Check_Case_1;
- end if;
-
- exception
- when Constraint_Error =>
- Report.Failed("Constraint_Error raised in 8 bit case");
- when others =>
- Report.Failed("Unexpected exception raised in 8 bit case");
- end Eight_Bit_Case;
-
- Sixteen_Bit_Case:
- begin
- if CD90001_0.Signed_16'Size /= CD90001_0.Bits_16'Size then
- Report.Comment("The sizes of the 16 bit types used in this test "
- & "do not match" );
- Sixteen_NA := True;
- elsif CD90001_0.Signed_16'Alignment = CD90001_0.Bits_16'Alignment then
- Report.Comment("The alignments of the 16 bit types used in this "
- & "test do not match" );
- Sixteen_NA := True;
- else
- CD90001_0.TC_Check_Case_2;
- end if;
-
- exception
- when Constraint_Error =>
- Report.Failed("Constraint_Error raised in 16 bit case");
- when others =>
- Report.Failed("Unexpected exception raised in 16 bit case");
- end Sixteen_Bit_Case;
-
- if Eight_NA and Sixteen_NA then
- Report.Not_Applicable("No cases in this test apply");
- end if;
-
- Report.Result;
-
-end CD90001;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cd92001.a b/gcc/testsuite/ada/acats/tests/cd/cd92001.a
deleted file mode 100644
index d07ff4881a5..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cd92001.a
+++ /dev/null
@@ -1,229 +0,0 @@
--- CD92001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that if X denotes a scalar object, X'Valid
--- yields true if an only if the object denoted by X is normal and
--- has a valid representation.
---
--- TEST DESCRIPTION:
--- Using Unchecked_Conversion, Image and Value attributes, combined
--- with string manipulation, cause valid and invalid values to be
--- stored in various objects. Check their validity with the
--- attribute 'Valid. Invalid objects are created in a loop which
--- performs a simplistic check to ensure that the values being used
--- are indeed not valid, then assigns the value using an instance of
--- Unchecked_Conversion. The creation of the tables of valid values
--- is trivial.
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Systems Programming Annex (C):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex C:
--- this test may report compile time errors at one or more points
--- indicated by "-- N/A => ERROR", in which case it may be graded as
--- inapplicable. Otherwise, the test must execute and report PASSED.
---
---
--- CHANGE HISTORY:
--- 10 MAY 95 SAIC Initial version
--- 07 MAY 96 SAIC Changed U_C to Ada.U_C for 2.1
--- 05 JAN 99 RLB Added Component_Size clauses to compensate
--- for the fact that there is no required size
--- for either the enumeration or modular components.
---!
-
-with Report;
-with Ada.Unchecked_Conversion;
-with System;
-procedure CD92001 is
-
- type Sparse_Enumerated is
- ( Help, Home, Page_Up, Del, EndK,
- Page_Down, Up, Left, Down, Right );
-
- for Sparse_Enumerated use ( Help => 2,
- Home => 4,
- Page_Up => 8,
- Del => 16,
- EndK => 32,
- Page_Down => 64,
- Up => 128,
- Left => 256,
- Down => 512,
- Right => 1024 );
-
- type Mod_10 is mod 10;
-
- type Default_Enumerated is ( Zero, One, Two, Three, Four,
- Five, Six, Seven, Eight, Nine,
- Clear, '=', '/', '*', '-',
- '+', Enter );
- for Default_Enumerated'Size use 8;
-
- Default_Enumerated_Count : constant := 17;
-
- type Mod_By_Enum_Items is mod Default_Enumerated_Count;
-
- type Mod_Same_Size_As_Sparse_Enum is mod 2**12;
- -- Sparse_Enumerated 'Size;
-
- type Mod_Same_Size_As_Def_Enum is mod 2**8;
- -- Default_Enumerated'Size;
-
- subtype Test_Width is Positive range 1..100;
-
- -- Note: There is no required relationship between 'Size and 'Component_Size,
- -- so we must use component_size clauses here.
- -- We use the following expressions to insure that the component size is a
- -- multiple of the Storage_Unit.
- Sparse_Component_Size : constant := ((Sparse_Enumerated'Size / System.Storage_Unit) +
- Boolean'Pos((Sparse_Enumerated'Size mod System.Storage_Unit) /= 0)) *
- System.Storage_Unit;
- Default_Component_Size : constant := ((Default_Enumerated'Size / System.Storage_Unit) +
- Boolean'Pos((Sparse_Enumerated'Size mod System.Storage_Unit) /= 0)) *
- System.Storage_Unit;
-
- type Sparse_Enum_Table is array(Test_Width) of Sparse_Enumerated;
- for Sparse_Enum_Table'Component_Size use Sparse_Component_Size; -- N/A => ERROR.
- type Def_Enum_Table is array(Test_Width) of Default_Enumerated;
- for Def_Enum_Table'Component_Size use Default_Component_Size; -- N/A => ERROR.
-
- type Sparse_Mod_Table is
- array(Test_Width) of Mod_Same_Size_As_Sparse_Enum;
- for Sparse_Mod_Table'Component_Size use Sparse_Component_Size; -- N/A => ERROR.
-
- type Default_Mod_Table is
- array(Test_Width) of Mod_Same_Size_As_Def_Enum;
- for Default_Mod_Table'Component_Size use Default_Component_Size; -- N/A => ERROR.
-
- function UC_Sparse_Mod_Enum is
- new Ada.Unchecked_Conversion( Sparse_Mod_Table, Sparse_Enum_Table );
-
- function UC_Def_Mod_Enum is
- new Ada.Unchecked_Conversion( Default_Mod_Table, Def_Enum_Table );
-
- Valid_Sparse_Values : Sparse_Enum_Table;
- Valid_Def_Values : Def_Enum_Table;
-
- Sample_Enum_Value_Table : Sparse_Mod_Table;
- Sample_Def_Value_Table : Default_Mod_Table;
-
-
- -- fill the Valid tables with valid values for conversion
- procedure Fill_Valid is
- K : Mod_10 := 0;
- P : Mod_By_Enum_Items := 0;
- begin
- for I in Test_Width loop
- Valid_Sparse_Values(I) := Sparse_Enumerated'Val( K );
- Valid_Def_Values(I) := Default_Enumerated'Val( Integer(P) );
- K := K +1;
- P := P +1;
- end loop;
- end Fill_Valid;
-
- -- fill the Sample tables with invalid values for conversion
- procedure Fill_Invalid is
- K : Mod_Same_Size_As_Sparse_Enum := 1;
- P : Mod_Same_Size_As_Def_Enum := 1;
- begin
- for I in Test_Width loop
- K := K +13;
- if K mod 2 = 0 then -- oops, that would be a valid value
- K := K +1;
- end if;
- if P = Mod_Same_Size_As_Def_Enum'Last
- or P < Default_Enumerated_Count then -- that would be valid
- P := Default_Enumerated_Count + 1;
- else
- P := P +1;
- end if;
- Sample_Enum_Value_Table(I) := K;
- Sample_Def_Value_Table(I) := P;
- end loop;
-
- Valid_Sparse_Values := UC_Sparse_Mod_Enum(Sample_Enum_Value_Table);
- Valid_Def_Values := UC_Def_Mod_Enum(Sample_Def_Value_Table);
-
- end Fill_Invalid;
-
- -- fill the tables with second set of valid values for conversion
- procedure Refill_Valid is
- K : Mod_10 := 0;
- P : Mod_By_Enum_Items := 0;
-
- Table : Array(Mod_10) of Mod_Same_Size_As_Sparse_Enum
- := ( 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 );
-
- begin
- for I in Test_Width loop
- Sample_Enum_Value_Table(I) := Table(K);
- Sample_Def_Value_Table(I) := Mod_Same_Size_As_Def_Enum(P);
- K := K +1;
- P := P +1;
- end loop;
- Valid_Sparse_Values := UC_Sparse_Mod_Enum(Sample_Enum_Value_Table);
- Valid_Def_Values := UC_Def_Mod_Enum(Sample_Def_Value_Table);
- end Refill_Valid;
-
- procedure Validate(Expect_Valid: Boolean) is
- begin -- here's where we actually use the tested attribute
-
- for K in Test_Width loop
- if Valid_Sparse_Values(K)'Valid /= Expect_Valid then
- Report.Failed("Expected 'Valid =" & Boolean'Image(Expect_Valid)
- & " for Sparse item " & Integer'Image(K) );
- end if;
- end loop;
-
- for P in Test_Width loop
- if Valid_Def_Values(P)'Valid /= Expect_Valid then
- Report.Failed("Expected 'Valid =" & Boolean'Image(Expect_Valid)
- & " for Default item " & Integer'Image(P) );
- end if;
- end loop;
-
- end Validate;
-
-begin -- Main test procedure.
-
- Report.Test ("CD92001", "Check object attribute: X'Valid" );
-
- Fill_Valid;
- Validate(True);
-
- Fill_Invalid;
- Validate(False);
-
- Refill_Valid;
- Validate(True);
-
- Report.Result;
-
-end CD92001;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cdb0a01.a b/gcc/testsuite/ada/acats/tests/cd/cdb0a01.a
deleted file mode 100644
index 566fad13883..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cdb0a01.a
+++ /dev/null
@@ -1,305 +0,0 @@
--- CDB0A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that a storage pool may be user_determined, and that storage
--- is allocated by calling Allocate.
---
--- Check that a storage.pool may be specified using 'Storage_Pool
--- and that S'Storage_Pool denotes the storage pool of the type S.
---
--- TEST DESCRIPTION:
--- The package System.Storage_Pools is exercised by two very similar
--- packages which define a tree type and exercise it in a simple manner.
--- One package uses a user defined pool. The other package uses a
--- storage pool assigned by the implementation; Storage_Size is
--- specified for this pool.
--- The dispatching procedures Allocate and Deallocate are tested as an
--- intentional side effect of the tree packages.
---
--- For completeness, the actions of the tree packages are checked for
--- correct operation.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FDB0A00.A (foundation code)
--- CDB0A01.A
---
---
--- CHANGE HISTORY:
--- 02 JUN 95 SAIC Initial version
--- 07 MAY 96 SAIC Removed ambiguity with CDB0A02
--- 13 FEB 97 PWB.CTA Corrected lexically ordered string literal
---!
-
----------------------------------------------------------------- CDB0A01_1
-
----------------------------------------------------------- FDB0A00.Pool1
-
-package FDB0A00.Pool1 is
- User_Pool : Stack_Heap( 5_000 );
-end FDB0A00.Pool1;
-
----------------------------------------------------------- FDB0A00.Comparator
-
-with System.Storage_Pools;
-package FDB0A00.Comparator is
-
- function "="( A,B : System.Storage_Pools.Root_Storage_Pool'Class )
- return Boolean;
-
-end FDB0A00.Comparator;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-package body FDB0A00.Comparator is
-
- function "="( A,B : System.Storage_Pools.Root_Storage_Pool'Class )
- return Boolean is
- use type System.Address;
- begin
- return A'Address = B'Address;
- end "=";
-
-end FDB0A00.Comparator;
-
----------------------------------------------------------------- CDB0A01_2
-
-with FDB0A00.Pool1;
-package CDB0A01_2 is
-
- type Cell;
- type User_Pool_Tree is access Cell;
-
- for User_Pool_Tree'Storage_Pool use FDB0A00.Pool1.User_Pool;
-
- type Cell is record
- Data : Character;
- Left,Right : User_Pool_Tree;
- end record;
-
- procedure Insert( Item: Character; On_Tree : in out User_Pool_Tree );
-
- procedure Traverse( The_Tree : User_Pool_Tree );
-
- procedure Defoliate( The_Tree : in out User_Pool_Tree );
-
-end CDB0A01_2;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-with Unchecked_Deallocation;
-package body CDB0A01_2 is
- procedure Deallocate is new Unchecked_Deallocation(Cell,User_Pool_Tree);
-
- -- Sort: zeros on the left, ones on the right...
- procedure Insert( Item: Character; On_Tree : in out User_Pool_Tree ) is
- begin
- if On_Tree = null then
- On_Tree := new Cell'(Item,null,null);
- elsif Item > On_Tree.Data then
- Insert(Item,On_Tree.Right);
- else
- Insert(Item,On_Tree.Left);
- end if;
- end Insert;
-
- procedure Traverse( The_Tree : User_Pool_Tree ) is
- begin
- if The_Tree = null then
- null; -- how very symmetrical
- else
- Traverse(The_Tree.Left);
- TCTouch.Touch(The_Tree.Data);
- Traverse(The_Tree.Right);
- end if;
- end Traverse;
-
- procedure Defoliate( The_Tree : in out User_Pool_Tree ) is
- begin
-
- if The_Tree.Left /= null then
- Defoliate(The_Tree.Left);
- end if;
-
- if The_Tree.Right /= null then
- Defoliate(The_Tree.Right);
- end if;
-
- Deallocate(The_Tree);
-
- end Defoliate;
-
-end CDB0A01_2;
-
----------------------------------------------------------------- CDB0A01_3
-
-with FDB0A00.Pool1;
-package CDB0A01_3 is
-
- type Cell;
- type System_Pool_Tree is access Cell;
-
- for System_Pool_Tree'Storage_Size use 2000;
-
- -- assumptions: Cell is <= 20 storage_units
- -- Tree building exercise requires O(15) cells
- -- 2000 > 20 * 15 by a generous margin
-
- type Cell is record
- Data: Character;
- Left,Right : System_Pool_Tree;
- end record;
-
- procedure Insert( Item: Character; On_Tree : in out System_Pool_Tree );
-
- procedure Traverse( The_Tree : System_Pool_Tree );
-
- procedure Defoliate( The_Tree : in out System_Pool_Tree );
-
-end CDB0A01_3;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-with Unchecked_Deallocation;
-package body CDB0A01_3 is
- procedure Deallocate is new Unchecked_Deallocation(Cell,System_Pool_Tree);
-
- -- Sort: zeros on the left, ones on the right...
- procedure Insert( Item: Character; On_Tree : in out System_Pool_Tree ) is
- begin
- if On_Tree = null then
- On_Tree := new Cell'(Item,null,null);
- elsif Item > On_Tree.Data then
- Insert(Item,On_Tree.Right);
- else
- Insert(Item,On_Tree.Left);
- end if;
- end Insert;
-
- procedure Traverse( The_Tree : System_Pool_Tree ) is
- begin
- if The_Tree = null then
- null; -- how very symmetrical
- else
- Traverse(The_Tree.Left);
- TCTouch.Touch(The_Tree.Data);
- Traverse(The_Tree.Right);
- end if;
- end Traverse;
-
- procedure Defoliate( The_Tree : in out System_Pool_Tree ) is
- begin
-
- if The_Tree.Left /= null then
- Defoliate(The_Tree.Left);
- end if;
-
- if The_Tree.Right /= null then
- Defoliate(The_Tree.Right);
- end if;
-
- Deallocate(The_Tree);
-
- end Defoliate;
-
-end CDB0A01_3;
-
------------------------------------------------------------------- CDB0A01
-
-with Report;
-with TCTouch;
-with FDB0A00.Comparator;
-with FDB0A00.Pool1;
-with CDB0A01_2;
-with CDB0A01_3;
-
-procedure CDB0A01 is
-
- Banyan : CDB0A01_2.User_Pool_Tree;
- Torrey : CDB0A01_3.System_Pool_Tree;
-
- use type CDB0A01_2.User_Pool_Tree;
- use type CDB0A01_3.System_Pool_Tree;
-
- Countess : constant String := "Ada Augusta Lovelace";
- Cenosstu : constant String := " AALaaacdeeglostuuv";
- Insertion : constant String := "AAAAAAAAAAAAAAAAAAAA";
- Deallocation : constant String := "DDDDDDDDDDDDDDDDDDDD";
-
-begin -- Main test procedure.
-
- Report.Test ("CDB0A01", "Check that a storage pool may be " &
- "user_determined, and that storage is " &
- "allocated by calling Allocate. Check that " &
- "a storage.pool may be specified using " &
- "'Storage_Pool and that S'Storage_Pool denotes " &
- "the storage pool of the type S" );
-
--- Check that S'Storage_Pool denotes the storage pool for the type S.
-
- TCTouch.Assert(
- FDB0A00.Comparator."="(FDB0A00.Pool1.User_Pool,
- CDB0A01_2.User_Pool_Tree'Storage_Pool ),
- "'Storage_Pool not correct for CDB0A01_2.User_Pool_Tree");
-
- TCTouch.Assert_Not(
- FDB0A00.Comparator."="(FDB0A00.Pool1.User_Pool,
- CDB0A01_3.System_Pool_Tree'Storage_Pool ),
- "'Storage_Pool not correct for CDB0A01_3.System_Pool_Tree");
-
--- Check that storage is allocated by calling Allocate.
-
- for Count in Countess'Range loop
- CDB0A01_2.Insert( Countess(Count), Banyan );
- end loop;
- TCTouch.Validate(Insertion, "Allocate calls via CDB0A01_2" );
-
- for Count in Countess'Range loop
- CDB0A01_3.Insert( Countess(Count), Torrey );
- end loop;
- TCTouch.Validate("", "Allocate calls via CDB0A01_3" );
-
- CDB0A01_2.Traverse(Banyan);
- TCTouch.Validate(Cenosstu, "Traversal of Banyan" );
-
- CDB0A01_3.Traverse(Torrey);
- TCTouch.Validate(Cenosstu, "Traversal of Torrey" );
-
- CDB0A01_2.Defoliate(Banyan);
- TCTouch.Validate(Deallocation, "Deforestation of Banyan" );
- TCTouch.Assert(Banyan = null, "Banyan Deallocation result not null");
-
- CDB0A01_3.Defoliate(Torrey);
- TCTouch.Validate("", "Deforestation of Torrey" );
- TCTouch.Assert(Torrey = null, "Torrey Deallocation result not null");
-
- Report.Result;
-
-end CDB0A01;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cdb0a02.a b/gcc/testsuite/ada/acats/tests/cd/cdb0a02.a
deleted file mode 100644
index 6a7fca54a2c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cdb0a02.a
+++ /dev/null
@@ -1,329 +0,0 @@
--- CDB0A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that several access types can share the same pool.
---
--- Check that any exception propagated by Allocate is
--- propagated by the allocator.
---
--- Check that for an access type S, S'Max_Size_In_Storage_Elements
--- denotes the maximum values for Size_In_Storage_Elements that will
--- be requested via Allocate.
---
--- TEST DESCRIPTION:
--- After checking correct operation of the tree packages, the limits of
--- the storage pools (first the shared user defined storage pool, then
--- the system storage pool) are intentionally exceeded. The test checks
--- that the correct exception is raised.
---
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FDB0A00.A (foundation code)
--- CDB0A02.A
---
---
--- CHANGE HISTORY:
--- 10 AUG 95 SAIC Initial version
--- 07 MAY 96 SAIC Disambiguated for 2.1
--- 13 FEB 97 PWB.CTA Reduced minimum allowable
--- Max_Size_In_Storage_Units, for implementations
--- with larger storage units
--- 25 JAN 01 RLB Removed dubious checks on Max_Size_In_Storage_Units;
--- tightened important one.
-
---!
-
----------------------------------------------------------- FDB0A00.Pool2
-
-package FDB0A00.Pool2 is
- Pond : Stack_Heap( 5_000 );
-end FDB0A00.Pool2;
-
----------------------------------------------------------------- CDB0A02_2
-
-with FDB0A00.Pool2;
-package CDB0A02_2 is
-
- type Small_Cell;
- type Small_Tree is access Small_Cell;
-
- for Small_Tree'Storage_Pool use FDB0A00.Pool2.Pond; -- first usage
-
- type Small_Cell is record
- Data: Character;
- Left,Right : Small_Tree;
- end record;
-
- procedure Insert( Item: Character; On_Tree : in out Small_Tree );
-
- procedure Traverse( The_Tree : Small_Tree );
-
- procedure Defoliate( The_Tree : in out Small_Tree );
-
- procedure TC_Exceed_Pool;
-
- Pool_Max_Elements : constant := 6000;
- -- to guarantee overflow in TC_Exceed_Pool
-
-end CDB0A02_2;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-with Report;
-with Unchecked_Deallocation;
-package body CDB0A02_2 is
- procedure Deallocate is new Unchecked_Deallocation(Small_Cell,Small_Tree);
-
- -- Sort: zeros on the left, ones on the right...
- procedure Insert( Item: Character; On_Tree : in out Small_Tree ) is
- begin
- if On_Tree = null then
- On_Tree := new Small_Cell'(Item,null,null);
- elsif Item > On_Tree.Data then
- Insert(Item,On_Tree.Right);
- else
- Insert(Item,On_Tree.Left);
- end if;
- end Insert;
-
- procedure Traverse( The_Tree : Small_Tree ) is
- begin
- if The_Tree = null then
- null; -- how very symmetrical
- else
- Traverse(The_Tree.Left);
- TCTouch.Touch(The_Tree.Data);
- Traverse(The_Tree.Right);
- end if;
- end Traverse;
-
- procedure Defoliate( The_Tree : in out Small_Tree ) is
- begin
-
- if The_Tree.Left /= null then
- Defoliate(The_Tree.Left);
- end if;
-
- if The_Tree.Right /= null then
- Defoliate(The_Tree.Right);
- end if;
-
- Deallocate(The_Tree);
-
- end Defoliate;
-
- procedure TC_Exceed_Pool is
- Wild_Branch : Small_Tree;
- begin
- for Ever in 1..Pool_Max_Elements loop
- Wild_Branch := new Small_Cell'('a', Wild_Branch, Wild_Branch);
- TCTouch.Validate("A","Allocating element for overflow");
- end loop;
- Report.Failed(" Pool_Overflow not raised on exceeding user pool size");
- exception
- when FDB0A00.Pool_Overflow => null; -- anticipated case
- when others =>
- Report.Failed("wrong exception raised in user Exceed_Pool");
- end TC_Exceed_Pool;
-
-end CDB0A02_2;
-
----------------------------------------------------------------- CDB0A02_3
-
--- This package is essentially identical to CDB0A02_2, except that the size
--- of a cell is significantly larger. This is used to check that different
--- access types may share a single pool
-
-with FDB0A00.Pool2;
-package CDB0A02_3 is
-
- type Large_Cell;
- type Large_Tree is access Large_Cell;
-
- for Large_Tree'Storage_Pool use FDB0A00.Pool2.Pond; -- second usage
-
- type Large_Cell is record
- Data: Character;
- Extra_Data : String(1..2);
- Left,Right : Large_Tree;
- end record;
-
- procedure Insert( Item: Character; On_Tree : in out Large_Tree );
-
- procedure Traverse( The_Tree : Large_Tree );
-
- procedure Defoliate( The_Tree : in out Large_Tree );
-
-end CDB0A02_3;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with TCTouch;
-with Unchecked_Deallocation;
-package body CDB0A02_3 is
- procedure Deallocate is new Unchecked_Deallocation(Large_Cell,Large_Tree);
-
- -- Sort: zeros on the left, ones on the right...
- procedure Insert( Item: Character; On_Tree : in out Large_Tree ) is
- begin
- if On_Tree = null then
- On_Tree := new Large_Cell'(Item,(Item,Item),null,null);
- elsif Item > On_Tree.Data then
- Insert(Item,On_Tree.Right);
- else
- Insert(Item,On_Tree.Left);
- end if;
- end Insert;
-
- procedure Traverse( The_Tree : Large_Tree ) is
- begin
- if The_Tree = null then
- null; -- how very symmetrical
- else
- Traverse(The_Tree.Left);
- TCTouch.Touch(The_Tree.Data);
- Traverse(The_Tree.Right);
- end if;
- end Traverse;
-
- procedure Defoliate( The_Tree : in out Large_Tree ) is
- begin
-
- if The_Tree.Left /= null then
- Defoliate(The_Tree.Left);
- end if;
-
- if The_Tree.Right /= null then
- Defoliate(The_Tree.Right);
- end if;
-
- Deallocate(The_Tree);
-
- end Defoliate;
-
-end CDB0A02_3;
-
------------------------------------------------------------------- CDB0A02
-
-with Report;
-with TCTouch;
-with System.Storage_Elements;
-with CDB0A02_2;
-with CDB0A02_3;
-with FDB0A00;
-
-procedure CDB0A02 is
-
- Banyan : CDB0A02_2.Small_Tree;
- Torrey : CDB0A02_3.Large_Tree;
-
- use type CDB0A02_2.Small_Tree;
- use type CDB0A02_3.Large_Tree;
-
- Countess1 : constant String := "Ada ";
- Countess2 : constant String := "Augusta ";
- Countess3 : constant String := "Lovelace";
- Cenosstu : constant String := " AALaaacdeeglostuuv";
- Insertion : constant String := "AAAAAAAAAAAAAAAAAAAA"
- & "AAAAAAAAAAAAAAAAAAAA";
- Deallocation : constant String := "DDDDDDDDDDDDDDDDDDDD";
-
-begin -- Main test procedure.
-
- Report.Test ("CDB0A02", "Check that several access types can share " &
- "the same pool. Check that any exception " &
- "propagated by Allocate is propagated by the " &
- "allocator. Check that for an access type S, " &
- "S'Max_Size_In_Storage_Elements denotes the " &
- "maximum values for Size_In_Storage_Elements " &
- "that will be requested via Allocate" );
-
- -- Check that access types can share the same pool.
-
- for Count in Countess1'Range loop
- CDB0A02_2.Insert( Countess1(Count), Banyan );
- end loop;
-
- for Count in Countess1'Range loop
- CDB0A02_3.Insert( Countess1(Count), Torrey );
- end loop;
-
- for Count in Countess2'Range loop
- CDB0A02_2.Insert( Countess2(Count), Banyan );
- end loop;
-
- for Count in Countess2'Range loop
- CDB0A02_3.Insert( Countess2(Count), Torrey );
- end loop;
-
- for Count in Countess3'Range loop
- CDB0A02_2.Insert( Countess3(Count), Banyan );
- end loop;
-
- for Count in Countess3'Range loop
- CDB0A02_3.Insert( Countess3(Count), Torrey );
- end loop;
-
- TCTouch.Validate(Insertion, "Allocate calls via CDB0A02_2" );
-
-
- CDB0A02_2.Traverse(Banyan);
- TCTouch.Validate(Cenosstu, "Traversal of Banyan" );
-
- CDB0A02_3.Traverse(Torrey);
- TCTouch.Validate(Cenosstu, "Traversal of Torrey" );
-
- CDB0A02_2.Defoliate(Banyan);
- TCTouch.Validate(Deallocation, "Deforestation of Banyan" );
- TCTouch.Assert(Banyan = null, "Banyan Deallocation result not null");
-
- CDB0A02_3.Defoliate(Torrey);
- TCTouch.Validate(Deallocation, "Deforestation of Torrey" );
- TCTouch.Assert(Torrey = null, "Torrey Deallocation result not null");
-
- -- Check that for an access type S, S'Max_Size_In_Storage_Elements
- -- denotes the maximum values for Size_In_Storage_Elements that will
- -- be requested via Allocate. (Of course, all we can do is check that
- -- whatever was requested of Allocate did not exceed the values of the
- -- attributes.)
-
- TCTouch.Assert( FDB0A00.TC_Largest_Request in 1 ..
- System.Storage_Elements.Storage_Count'Max (
- CDB0A02_2.Small_Cell'Max_Size_In_Storage_Elements,
- CDB0A02_3.Large_Cell'Max_Size_In_Storage_Elements),
- "An object of excessive size was allocated. Size: "
- & System.Storage_Elements.Storage_Count'Image(FDB0A00.TC_Largest_Request));
-
- -- Check that an exception raised in Allocate is propagated by the allocator.
-
- CDB0A02_2.TC_Exceed_Pool;
-
- Report.Result;
-
-end CDB0A02;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cdd1001.a b/gcc/testsuite/ada/acats/tests/cd/cdd1001.a
deleted file mode 100644
index 3e16f5d4f97..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cdd1001.a
+++ /dev/null
@@ -1,94 +0,0 @@
--- CDD1001.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that components of Stream_Element_Array are aliased. (Defect
--- Report 8652/0044).
---
--- APPLICABILITY CRITERIA:
--- All implementations must attempt to compile this test.
---
--- For implementations for which Stream_Element'Size is a multiple of
--- System.Storage_Unit, this test must execute.
---
--- For other implementations, if this test compiles without error messages
--- at compilation, it must bind and execute.
---
--- PASS/FAIL CRITERIA:
--- For implementations for which Stream_Element'Size is a multiple of
--- System.Storage_Unit, this test must execute, report PASSED, and
--- complete normally, otherwise the test FAILS.
---
--- For other implementations:
--- PASSING behavior is:
--- this test executes, reports PASSED, and completes normally
--- or
--- this test produces at least one error message at compilation, and
--- the error message is associated with one of the items marked:
--- -- N/A => ERROR.
---
--- All other behaviors are FAILING.
---
---
--- CHANGE HISTORY:
--- 12 FEB 2001 PHL Initial version
--- 15 MAR 2001 RLB Readied for release.
-
---!
-with Ada.Streams;
-use Ada.Streams;
-with Report;
-use Report;
-procedure CDD1001 is
-
- type Acc is access all Stream_Element;
-
- A : Stream_Element_Array
- (Stream_Element_Offset (Ident_Int (1)) ..
- Stream_Element_Offset (Ident_Int (10)));
- B : array (A'Range) of Acc;
-begin
- Test ("CDD1001",
- "Check that components of Stream_Element_Array are aliased");
-
- for I in A'Range loop
- A (I) := Stream_Element (Ident_Int (Integer (I)) * Ident_Int (3));
- end loop;
-
- for I in B'Range loop
- B (I) := A (I)'Access; -- N/A => ERROR.
- end loop;
-
- for I in B'Range loop
- if B (I).all /= Stream_Element
- (Ident_Int (Integer (I)) * Ident_Int (3)) then
- Failed ("Unable to build access values desginating elements " &
- "of a Stream_Element_Array");
- end if;
- end loop;
-
- Result;
-end CDD1001;
-
diff --git a/gcc/testsuite/ada/acats/tests/cd/cdd2001.a b/gcc/testsuite/ada/acats/tests/cd/cdd2001.a
deleted file mode 100644
index 3184dded8d4..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cdd2001.a
+++ /dev/null
@@ -1,203 +0,0 @@
--- CDD2001.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the default implementation of Read and Input raise End_Error
--- if the end of stream is reached before the reading of a value is
--- completed. (Defect Report 8652/0045,
--- Technical Corrigendum 13.13.2(35.1/1)).
---
--- CHANGE HISTORY:
--- 12 FEB 2001 PHL Initial version.
--- 29 JUN 2001 RLB Reformatted for ACATS.
---
---!
-
-with Ada.Streams;
-use Ada.Streams;
-package CDD2001_0 is
-
- type My_Stream (Size : Stream_Element_Count) is new Root_Stream_Type with
- record
- First : Stream_Element_Offset := 1;
- Last : Stream_Element_Offset := 0;
- Contents : Stream_Element_Array (1 .. Size);
- end record;
-
- procedure Clear (Stream : in out My_Stream);
-
- procedure Read (Stream : in out My_Stream;
- Item : out Stream_Element_Array;
- Last : out Stream_Element_Offset);
-
- procedure Write (Stream : in out My_Stream; Item : in Stream_Element_Array);
-
-end CDD2001_0;
-
-package body CDD2001_0 is
-
- procedure Clear (Stream : in out My_Stream) is
- begin
- Stream.First := 1;
- Stream.Last := 0;
- end Clear;
-
- procedure Read (Stream : in out My_Stream;
- Item : out Stream_Element_Array;
- Last : out Stream_Element_Offset) is
- begin
- if Item'Length >= Stream.Last - Stream.First + 1 then
- Item (Item'First .. Item'First + Stream.Last - Stream.First) :=
- Stream.Contents (Stream.First .. Stream.Last);
- Last := Item'First + Stream.Last - Stream.First;
- Stream.First := Stream.Last + 1;
- else
- Item := Stream.Contents (Stream.First ..
- Stream.First + Item'Length - 1);
- Last := Item'Last;
- Stream.First := Stream.First + Item'Length;
- end if;
- end Read;
-
- procedure Write (Stream : in out My_Stream;
- Item : in Stream_Element_Array) is
- begin
- Stream.Contents (Stream.Last + 1 .. Stream.Last + Item'Length) := Item;
- Stream.Last := Stream.Last + Item'Length;
- end Write;
-
-end CDD2001_0;
-
-with Ada.Exceptions;
-use Ada.Exceptions;
-with CDD2001_0;
-use CDD2001_0;
-with Io_Exceptions;
-use Io_Exceptions;
-with Report;
-use Report;
-procedure CDD2001 is
-
- subtype Int is Integer range -20 .. 20;
-
- type R (D : Int) is
- record
- C1 : Character := Ident_Char ('a');
- case D is
- when 0 .. 20 =>
- C2 : String (1 .. D) := (others => Ident_Char ('b'));
- when others =>
- C3, C4 : Float := Float (-D);
- end case;
- end record;
-
- S : aliased My_Stream (200);
-
-begin
- Test
- ("CDD2001",
- "Check that the default implementation of Read and Input " &
- "raise End_Error if the end of stream is reached before the " &
- "reading of a value is completed");
-
- Read:
- declare
- X : R (Ident_Int (13));
- begin
- Clear (S);
-
- -- A complete object.
- R'Write (S'Access, X);
- X.C1 := Ident_Char ('A');
- X.C2 := (others => Ident_Char ('B'));
- R'Read (S'Access, X);
- if X.C1 /= Ident_Char ('a') or X.C2 /=
- (1 .. 13 => Ident_Char ('b')) then
- Failed ("Read did not produce the expected result");
- end if;
-
- Clear (S);
-
- -- Not enough data.
- Character'Write (S'Access, 'a');
- String'Write (S'Access, "bbb");
-
- begin
- R'Read (S'Access, X);
- Failed
- ("No exception raised when the end of stream is reached " &
- "before the reading of a value is completed - 1");
- exception
- when End_Error =>
- null;
- when E: others =>
- Failed ("Wrong Exception " & Exception_Name (E) &
- " - " & Exception_Information (E) &
- " - " & Exception_Message (E) & " - 1");
- end;
-
- end Read;
-
- Input:
- declare
- X : R (Ident_Int (-11));
- begin
- Clear (S);
-
- -- A complete object.
- R'Output (S'Access, X);
- X.C1 := Ident_Char ('A');
- X.C3 := 4.0;
- X.C4 := 5.0;
- X := R'Input (S'Access);
- if X.C1 /= Ident_Char ('a') or X.C3 /= 11.0 or X.C4 /= 11.0 then
- Failed ("Input did not produce the expected result");
- end if;
-
- Clear (S);
-
- -- Not enough data.
- Integer'Output (S'Access, Ident_Int (-11)); -- The discriminant
- Character'Output (S'Access, 'a');
- Float'Output (S'Access, 11.0);
-
- begin
- X := R'Input (S'Access);
- Failed
- ("No exception raised when the end of stream is reached " &
- "before the reading of a value is completed - 2");
- exception
- when End_Error =>
- null;
- when E: others =>
- Failed ("Wrong exception " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 2");
- end;
-
- end Input;
-
- Result;
-end CDD2001;
-
diff --git a/gcc/testsuite/ada/acats/tests/cd/cdd2a01.a b/gcc/testsuite/ada/acats/tests/cd/cdd2a01.a
deleted file mode 100644
index 7c8000ce04c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cdd2a01.a
+++ /dev/null
@@ -1,379 +0,0 @@
--- CDD2A01.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the Read and Write attributes for a type extension are created
--- from the parent type's attribute (which may be user-defined) and those
--- for the extension components. Also check that the default Input and
--- Output attributes are used for a type extension, even if the parent
--- type's attribute is user-defined. (Defect Report 8652/0040,
--- as reflected in Technical Corrigendum 1, penultimate sentence of
--- 13.13.2(9/1) and 13.13.2(25/1)).
---
--- CHANGE HISTORY:
--- 30 JUL 2001 PHL Initial version.
--- 5 DEC 2001 RLB Reformatted for ACATS.
---
---!
-with Ada.Streams;
-use Ada.Streams;
-with FDD2A00;
-use FDD2A00;
-with Report;
-use Report;
-procedure CDD2A01 is
-
- Input_Output_Error : exception;
-
- type Int is range 1 .. 1000;
- type Str is array (Int range <>) of Character;
-
- procedure Read (Stream : access Root_Stream_Type'Class;
- Item : out Int'Base);
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Int'Base);
- function Input (Stream : access Root_Stream_Type'Class) return Int'Base;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Int'Base);
-
- for Int'Read use Read;
- for Int'Write use Write;
- for Int'Input use Input;
- for Int'Output use Output;
-
-
- type Parent (D1, D2 : Int; B : Boolean) is tagged
- record
- S : Str (D1 .. D2);
- case B is
- when False =>
- C1 : Integer;
- when True =>
- C2 : Float;
- end case;
- end record;
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Parent);
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Parent);
- function Input (Stream : access Root_Stream_Type'Class) return Parent;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Parent);
-
- for Parent'Read use Read;
- for Parent'Write use Write;
- for Parent'Input use Input;
- for Parent'Output use Output;
-
-
- procedure Actual_Read
- (Stream : access Root_Stream_Type'Class; Item : out Int) is
- begin
- Integer'Read (Stream, Integer (Item));
- end Actual_Read;
-
- procedure Actual_Write
- (Stream : access Root_Stream_Type'Class; Item : Int) is
- begin
- Integer'Write (Stream, Integer (Item));
- end Actual_Write;
-
- function Actual_Input (Stream : access Root_Stream_Type'Class) return Int is
- begin
- return Int (Integer'Input (Stream));
- end Actual_Input;
-
- procedure Actual_Output
- (Stream : access Root_Stream_Type'Class; Item : Int) is
- begin
- Integer'Output (Stream, Integer (Item));
- end Actual_Output;
-
-
- procedure Actual_Read
- (Stream : access Root_Stream_Type'Class; Item : out Parent) is
- begin
- case Item.B is
- when False =>
- Item.C1 := 7;
- when True =>
- Float'Read (Stream, Item.C2);
- end case;
- Str'Read (Stream, Item.S);
- end Actual_Read;
-
- procedure Actual_Write
- (Stream : access Root_Stream_Type'Class; Item : Parent) is
- begin
- case Item.B is
- when False =>
- null; -- Don't write C1
- when True =>
- Float'Write (Stream, Item.C2);
- end case;
- Str'Write (Stream, Item.S);
- end Actual_Write;
-
- function Actual_Input
- (Stream : access Root_Stream_Type'Class) return Parent is
- X : Parent (1, 1, True);
- begin
- raise Input_Output_Error;
- return X;
- end Actual_Input;
-
- procedure Actual_Output
- (Stream : access Root_Stream_Type'Class; Item : Parent) is
- begin
- raise Input_Output_Error;
- end Actual_Output;
-
- package Int_Ops is new Counting_Stream_Ops (T => Int'Base,
- Actual_Write => Actual_Write,
- Actual_Input => Actual_Input,
- Actual_Read => Actual_Read,
- Actual_Output => Actual_Output);
-
- package Parent_Ops is
- new Counting_Stream_Ops (T => Parent,
- Actual_Write => Actual_Write,
- Actual_Input => Actual_Input,
- Actual_Read => Actual_Read,
- Actual_Output => Actual_Output);
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Int'Base)
- renames Int_Ops.Read;
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Int'Base)
- renames Int_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Int'Base
- renames Int_Ops.Input;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Int'Base)
- renames Int_Ops.Output;
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Parent)
- renames Parent_Ops.Read;
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Parent)
- renames Parent_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Parent
- renames Parent_Ops.Input;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Parent)
- renames Parent_Ops.Output;
-
- type Derived1 is new Parent with
- record
- C3 : Int;
- end record;
-
- type Derived2 (D : Int) is new Parent (D1 => D,
- D2 => D,
- B => False) with
- record
- C3 : Int;
- end record;
-
-begin
- Test ("CDD2A01",
- "Check that the Read and Write attributes for a type " &
- "extension are created from the parent type's " &
- "attribute (which may be user-defined) and those for the " &
- "extension components; also check that the default input " &
- "and output attributes are used for a type extension, even " &
- "if the parent type's attribute is user-defined");
-
- Test1:
- declare
- S : aliased My_Stream (1000);
- X1 : Derived1 (D1 => Int (Ident_Int (2)),
- D2 => Int (Ident_Int (5)),
- B => Ident_Bool (True));
- Y1 : Derived1 := (D1 => 3,
- D2 => 6,
- B => False,
- S => Str (Ident_Str ("3456")),
- C1 => Ident_Int (100),
- C3 => Int (Ident_Int (88)));
- X2 : Derived1 (D1 => Int (Ident_Int (2)),
- D2 => Int (Ident_Int (5)),
- B => Ident_Bool (True));
- begin
- X1.S := Str (Ident_Str ("bcde"));
- X1.C2 := Float (Ident_Int (4));
- X1.C3 := Int (Ident_Int (99));
-
- Derived1'Write (S'Access, X1);
- if Int_Ops.Get_Counts /=
- (Read => 0, Write => 1, Input => 0, Output => 0) then
- Failed ("Error writing extension components - 1");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 0, Write => 1, Input => 0, Output => 0) then
- Failed ("Didn't call parent type's Write - 1");
- end if;
-
- Derived1'Read (S'Access, X2);
- if Int_Ops.Get_Counts /=
- (Read => 1, Write => 1, Input => 0, Output => 0) then
- Failed ("Error reading extension components - 1");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 1, Write => 1, Input => 0, Output => 0) then
- Failed ("Didn't call inherited Read - 1");
- end if;
-
- if X2 /= (D1 => 2,
- D2 => 5,
- B => True,
- S => Str (Ident_Str ("bcde")),
- C2 => Float (Ident_Int (4)),
- C3 => Int (Ident_Int (99))) then
- Failed
- ("Inherited Read and Write are not inverses of each other - 1");
- end if;
-
- begin
- Derived1'Output (S'Access, Y1);
- if Int_Ops.Get_Counts /=
- (Read => 1, Write => 4, Input => 0, Output => 0) then
- Failed ("Error writing extension components - 2");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 1, Write => 2, Input => 0, Output => 0) then
- Failed ("Didn't call inherited Write - 2");
- end if;
- exception
- when Input_Output_Error =>
- Failed ("Did call inherited Output - 2");
- end;
-
- begin
- declare
- Y2 : Derived1 := Derived1'Input (S'Access);
- begin
- if Int_Ops.Get_Counts /=
- (Read => 4, Write => 4, Input => 0, Output => 0) then
- Failed ("Error reading extension components - 2");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 2, Write => 2, Input => 0, Output => 0) then
- Failed ("Didn't call inherited Read - 2");
- end if;
- if Y2 /= (D1 => 3,
- D2 => 6,
- B => False,
- S => Str (Ident_Str ("3456")),
- C1 => Ident_Int (7),
- C3 => Int (Ident_Int (88))) then
- Failed
- ("Input and Output are not inverses of each other - 2");
- end if;
- end;
- exception
- when Input_Output_Error =>
- Failed ("Did call inherited Input - 2");
- end;
-
- end Test1;
-
- Test2:
- declare
- S : aliased My_Stream (1000);
- X1 : Derived2 (D => Int (Ident_Int (7)));
- Y1 : Derived2 := (D => 8,
- S => Str (Ident_Str ("8")),
- C1 => Ident_Int (200),
- C3 => Int (Ident_Int (77)));
- X2 : Derived2 (D => Int (Ident_Int (7)));
- begin
- X1.S := Str (Ident_Str ("g"));
- X1.C1 := Ident_Int (4);
- X1.C3 := Int (Ident_Int (666));
-
- Derived2'Write (S'Access, X1);
- if Int_Ops.Get_Counts /=
- (Read => 4, Write => 5, Input => 0, Output => 0) then
- Failed ("Error writing extension components - 3");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 2, Write => 3, Input => 0, Output => 0) then
- Failed ("Didn't call inherited Write - 3");
- end if;
-
- Derived2'Read (S'Access, X2);
- if Int_Ops.Get_Counts /=
- (Read => 5, Write => 5, Input => 0, Output => 0) then
- Failed ("Error reading extension components - 3");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 3, Write => 3, Input => 0, Output => 0) then
- Failed ("Didn't call inherited Read - 3");
- end if;
-
- if X2 /= (D => 7,
- S => Str (Ident_Str ("g")),
- C1 => Ident_Int (7),
- C3 => Int (Ident_Int (666))) then
- Failed ("Read and Write are not inverses of each other - 3");
- end if;
-
- begin
- Derived2'Output (S'Access, Y1);
- if Int_Ops.Get_Counts /=
- (Read => 5, Write => 7, Input => 0, Output => 0) then
- Failed ("Error writing extension components - 4");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 3, Write => 4, Input => 0, Output => 0) then
- Failed ("Didn't call inherited Write - 4");
- end if;
- exception
- when Input_Output_Error =>
- Failed ("Did call inherited Output - 4");
- end;
-
- begin
- declare
- Y2 : Derived2 := Derived2'Input (S'Access);
- begin
- if Int_Ops.Get_Counts /=
- (Read => 7, Write => 7, Input => 0, Output => 0) then
- Failed ("Error reading extension components - 4");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 4, Write => 4, Input => 0, Output => 0) then
- Failed ("Didn't call inherited Read - 4");
- end if;
- if Y2 /= (D => 8,
- S => Str (Ident_Str ("8")),
- C1 => Ident_Int (7),
- C3 => Int (Ident_Int (77))) then
- Failed
- ("Input and Output are not inverses of each other - 4");
- end if;
- end;
- exception
- when Input_Output_Error =>
- Failed ("Did call inherited Input - 4");
- end;
-
- end Test2;
-
- Result;
-end CDD2A01;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cdd2a02.a b/gcc/testsuite/ada/acats/tests/cd/cdd2a02.a
deleted file mode 100644
index 854431c3488..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cdd2a02.a
+++ /dev/null
@@ -1,345 +0,0 @@
--- CDD2A02.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the Read, Write, Input, and Output attributes are inherited
--- for untagged derived types. (Defect Report 8652/0040,
--- as reflected in Technical Corrigendum 1, 13.13.2(8.1/1) and
--- 13.13.2(25/1)).
---
--- CHANGE HISTORY:
--- 30 JUL 2001 PHL Initial version.
--- 5 DEC 2001 RLB Reformatted for ACATS.
---
---!
-with Ada.Streams;
-use Ada.Streams;
-with FDD2A00;
-use FDD2A00;
-with Report;
-use Report;
-procedure CDD2A02 is
-
- type Int is range 1 .. 10;
- type Str is array (Int range <>) of Character;
-
- procedure Read (Stream : access Root_Stream_Type'Class;
- Item : out Int'Base);
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Int'Base);
- function Input (Stream : access Root_Stream_Type'Class) return Int'Base;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Int'Base);
-
- for Int'Read use Read;
- for Int'Write use Write;
- for Int'Input use Input;
- for Int'Output use Output;
-
-
- type Parent (D1, D2 : Int; B : Boolean) is
- record
- S : Str (D1 .. D2);
- case B is
- when False =>
- C1 : Integer;
- when True =>
- C2 : Float;
- end case;
- end record;
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Parent);
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Parent);
- function Input (Stream : access Root_Stream_Type'Class) return Parent;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Parent);
-
- for Parent'Read use Read;
- for Parent'Write use Write;
- for Parent'Input use Input;
- for Parent'Output use Output;
-
-
- procedure Actual_Read
- (Stream : access Root_Stream_Type'Class; Item : out Int) is
- begin
- Integer'Read (Stream, Integer (Item));
- end Actual_Read;
-
- procedure Actual_Write
- (Stream : access Root_Stream_Type'Class; Item : Int) is
- begin
- Integer'Write (Stream, Integer (Item));
- end Actual_Write;
-
- function Actual_Input (Stream : access Root_Stream_Type'Class) return Int is
- begin
- return Int (Integer'Input (Stream));
- end Actual_Input;
-
- procedure Actual_Output
- (Stream : access Root_Stream_Type'Class; Item : Int) is
- begin
- Integer'Output (Stream, Integer (Item));
- end Actual_Output;
-
-
- procedure Actual_Read
- (Stream : access Root_Stream_Type'Class; Item : out Parent) is
- begin
- case Item.B is
- when False =>
- Item.C1 := 7;
- when True =>
- Float'Read (Stream, Item.C2);
- end case;
- Str'Read (Stream, Item.S);
- end Actual_Read;
-
- procedure Actual_Write
- (Stream : access Root_Stream_Type'Class; Item : Parent) is
- begin
- case Item.B is
- when False =>
- null; -- Don't write C1
- when True =>
- Float'Write (Stream, Item.C2);
- end case;
- Str'Write (Stream, Item.S);
- end Actual_Write;
-
- function Actual_Input
- (Stream : access Root_Stream_Type'Class) return Parent is
- D1, D2 : Int;
- B : Boolean;
- begin
- Int'Read (Stream, D2);
- Boolean'Read (Stream, B);
- Int'Read (Stream, D1);
-
- declare
- Item : Parent (D1 => D1, D2 => D2, B => B);
- begin
- Parent'Read (Stream, Item);
- return Item;
- end;
-
- end Actual_Input;
-
- procedure Actual_Output
- (Stream : access Root_Stream_Type'Class; Item : Parent) is
- begin
- Int'Write (Stream, Item.D2);
- Boolean'Write (Stream, Item.B);
- Int'Write (Stream, Item.D1);
- Parent'Write (Stream, Item);
- end Actual_Output;
-
- package Int_Ops is new Counting_Stream_Ops (T => Int'Base,
- Actual_Write => Actual_Write,
- Actual_Input => Actual_Input,
- Actual_Read => Actual_Read,
- Actual_Output => Actual_Output);
-
- package Parent_Ops is
- new Counting_Stream_Ops (T => Parent,
- Actual_Write => Actual_Write,
- Actual_Input => Actual_Input,
- Actual_Read => Actual_Read,
- Actual_Output => Actual_Output);
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Int'Base)
- renames Int_Ops.Read;
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Int'Base)
- renames Int_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Int'Base
- renames Int_Ops.Input;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Int'Base)
- renames Int_Ops.Output;
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Parent)
- renames Parent_Ops.Read;
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Parent)
- renames Parent_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Parent
- renames Parent_Ops.Input;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Parent)
- renames Parent_Ops.Output;
-
-begin
- Test ("CDD2A02", "Check that the Read, Write, Input, and Output " &
- "attributes are inherited for untagged derived types");
-
- Test1:
- declare
- type Derived1 is new Parent;
- S : aliased My_Stream (1000);
- X1 : Derived1 (D1 => Int (Ident_Int (2)),
- D2 => Int (Ident_Int (5)), B => Ident_Bool (True));
- Y1 : Derived1 := (D1 => 3,
- D2 => 6,
- B => False,
- S => Str (Ident_Str ("3456")),
- C1 => Ident_Int (100));
- X2 : Derived1 (D1 => Int (Ident_Int (2)),
- D2 => Int (Ident_Int (5)), B => Ident_Bool (True));
- begin
- X1.S := Str (Ident_Str ("bcde"));
- X1.C2 := Float (Ident_Int (4));
-
- Derived1'Write (S'Access, X1);
- if Int_Ops.Get_Counts /=
- (Read => 0, Write => 0, Input => 0, Output => 0) then
- Failed ("Error writing discriminants - 1");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 0, Write => 1, Input => 0, Output => 0) then
- Failed ("Didn't call inherited Write - 1");
- end if;
-
- Derived1'Read (S'Access, X2);
- if Int_Ops.Get_Counts /=
- (Read => 0, Write => 0, Input => 0, Output => 0) then
- Failed ("Error reading discriminants - 1");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 1, Write => 1, Input => 0, Output => 0) then
- Failed ("Didn't call inherited Read - 1");
- end if;
-
- if X2 /= (D1 => 2,
- D2 => 5,
- B => True,
- S => Str (Ident_Str ("bcde")),
- C2 => Float (Ident_Int (4))) then
- Failed
- ("Inherited Read and Write are not inverses of each other - 1");
- end if;
-
- Derived1'Output (S'Access, Y1);
- if Int_Ops.Get_Counts /=
- (Read => 0, Write => 2, Input => 0, Output => 0) then
- Failed ("Error writing discriminants - 2");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 1, Write => 2, Input => 0, Output => 1) then
- Failed ("Didn't call inherited Output - 2");
- end if;
-
- declare
- Y2 : Derived1 := Derived1'Input (S'Access);
- begin
- if Int_Ops.Get_Counts /=
- (Read => 2, Write => 2, Input => 0, Output => 0) then
- Failed ("Error reading discriminants - 2");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 2, Write => 2, Input => 1, Output => 1) then
- Failed ("Didn't call inherited Input - 2");
- end if;
-
- if Y2 /= (D1 => 3,
- D2 => 6,
- B => False,
- S => Str (Ident_Str ("3456")),
- C1 => Ident_Int (7)) then
- Failed
- ("Inherited Input and Output are not inverses of each other - 2");
- end if;
- end;
- end Test1;
-
- Test2:
- declare
- type Derived2 (D : Int) is new Parent (D1 => D,
- D2 => D,
- B => False);
- S : aliased My_Stream (1000);
- X1 : Derived2 (D => Int (Ident_Int (7)));
- Y1 : Derived2 := (D => 8,
- S => Str (Ident_Str ("8")),
- C1 => Ident_Int (200));
- X2 : Derived2 (D => Int (Ident_Int (7)));
- begin
- X1.S := Str (Ident_Str ("g"));
- X1.C1 := Ident_Int (4);
-
- Derived2'Write (S'Access, X1);
- if Int_Ops.Get_Counts /=
- (Read => 2, Write => 2, Input => 0, Output => 0) then
- Failed ("Error writing discriminants - 3");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 2, Write => 3, Input => 1, Output => 1) then
- Failed ("Didn't call inherited Write - 3");
- end if;
-
- Derived2'Read (S'Access, X2);
- if Int_Ops.Get_Counts /=
- (Read => 2, Write => 2, Input => 0, Output => 0) then
- Failed ("Error reading discriminants - 3");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 3, Write => 3, Input => 1, Output => 1) then
- Failed ("Didn't call inherited Read - 3");
- end if;
-
- if X2 /= (D => 7,
- S => Str (Ident_Str ("g")),
- C1 => Ident_Int (7)) then
- Failed
- ("Inherited Read and Write are not inverses of each other - 3");
- end if;
-
- Derived2'Output (S'Access, Y1);
- if Int_Ops.Get_Counts /=
- (Read => 2, Write => 4, Input => 0, Output => 0) then
- Failed ("Error writing discriminants - 4");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 3, Write => 4, Input => 1, Output => 2) then
- Failed ("Didn't call inherited Output - 4");
- end if;
-
- declare
- Y2 : Derived2 := Derived2'Input (S'Access);
- begin
- if Int_Ops.Get_Counts /=
- (Read => 4, Write => 4, Input => 0, Output => 0) then
- Failed ("Error reading discriminants - 4");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 4, Write => 4, Input => 2, Output => 2) then
- Failed ("Didn't call inherited Input - 4");
- end if;
-
- if Y2 /= (D => 8,
- S => Str (Ident_Str ("8")),
- C1 => Ident_Int (7)) then
- Failed
- ("Inherited Input and Output are not inverses of each other - 4");
- end if;
- end;
- end Test2;
-
- Result;
-end CDD2A02;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cdd2a03.a b/gcc/testsuite/ada/acats/tests/cd/cdd2a03.a
deleted file mode 100644
index b4c2917724d..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cdd2a03.a
+++ /dev/null
@@ -1,325 +0,0 @@
--- CDD2A03.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the default Read and Write attributes for a limited type
--- extension are created from the parent type's attribute (which may be
--- user-defined) and those for the extension components, if the extension
--- components are non-limited or have user-defined attributes. Check that
--- such limited type extension attributes are callable (Defect Report
--- 8652/0040, as reflected in Technical Corrigendum 1, penultimate sentence
--- of 13.13.2(9/1) and 13.13.2(36/1)).
---
--- CHANGE HISTORY:
--- 1 AUG 2001 PHL Initial version.
--- 3 DEC 2001 RLB Reformatted for ACATS.
---
---!
-with Ada.Streams;
-use Ada.Streams;
-with FDD2A00;
-use FDD2A00;
-with Report;
-use Report;
-procedure CDD2A03 is
-
- Input_Output_Error : exception;
-
- type Int is range 1 .. 1000;
- type Str is array (Int range <>) of Character;
-
- procedure Read (Stream : access Root_Stream_Type'Class;
- Item : out Int'Base);
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Int'Base);
- function Input (Stream : access Root_Stream_Type'Class) return Int'Base;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Int'Base);
-
- for Int'Read use Read;
- for Int'Write use Write;
- for Int'Input use Input;
- for Int'Output use Output;
-
-
- type Lim is limited
- record
- C : Int;
- end record;
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Lim);
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Lim);
- function Input (Stream : access Root_Stream_Type'Class) return Lim;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Lim);
-
- for Lim'Read use Read;
- for Lim'Write use Write;
- for Lim'Input use Input;
- for Lim'Output use Output;
-
-
- type Parent (D1, D2 : Int; B : Boolean) is tagged limited
- record
- S : Str (D1 .. D2);
- case B is
- when False =>
- C1 : Integer;
- when True =>
- C2 : Float;
- end case;
- end record;
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Parent);
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Parent);
- function Input (Stream : access Root_Stream_Type'Class) return Parent;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Parent);
-
- for Parent'Read use Read;
- for Parent'Write use Write;
- for Parent'Input use Input;
- for Parent'Output use Output;
-
-
- procedure Actual_Read
- (Stream : access Root_Stream_Type'Class; Item : out Int) is
- begin
- Integer'Read (Stream, Integer (Item));
- end Actual_Read;
-
- procedure Actual_Write
- (Stream : access Root_Stream_Type'Class; Item : Int) is
- begin
- Integer'Write (Stream, Integer (Item));
- end Actual_Write;
-
- function Actual_Input (Stream : access Root_Stream_Type'Class) return Int is
- begin
- return Int (Integer'Input (Stream));
- end Actual_Input;
-
- procedure Actual_Output
- (Stream : access Root_Stream_Type'Class; Item : Int) is
- begin
- Integer'Output (Stream, Integer (Item));
- end Actual_Output;
-
-
- procedure Actual_Read
- (Stream : access Root_Stream_Type'Class; Item : out Lim) is
- begin
- Integer'Read (Stream, Integer (Item.C));
- end Actual_Read;
-
- procedure Actual_Write
- (Stream : access Root_Stream_Type'Class; Item : Lim) is
- begin
- Integer'Write (Stream, Integer (Item.C));
- end Actual_Write;
-
- function Actual_Input (Stream : access Root_Stream_Type'Class) return Lim is
- Result : Lim;
- begin
- Result.C := Int (Integer'Input (Stream));
- return Result;
- end Actual_Input;
-
- procedure Actual_Output
- (Stream : access Root_Stream_Type'Class; Item : Lim) is
- begin
- Integer'Output (Stream, Integer (Item.C));
- end Actual_Output;
-
-
- procedure Actual_Read
- (Stream : access Root_Stream_Type'Class; Item : out Parent) is
- begin
- case Item.B is
- when False =>
- Item.C1 := 7;
- when True =>
- Float'Read (Stream, Item.C2);
- end case;
- Str'Read (Stream, Item.S);
- end Actual_Read;
-
- procedure Actual_Write
- (Stream : access Root_Stream_Type'Class; Item : Parent) is
- begin
- case Item.B is
- when False =>
- null; -- Don't write C1
- when True =>
- Float'Write (Stream, Item.C2);
- end case;
- Str'Write (Stream, Item.S);
- end Actual_Write;
-
- function Actual_Input
- (Stream : access Root_Stream_Type'Class) return Parent is
- X : Parent (1, 1, True);
- begin
- raise Input_Output_Error;
- return X;
- end Actual_Input;
-
- procedure Actual_Output
- (Stream : access Root_Stream_Type'Class; Item : Parent) is
- begin
- raise Input_Output_Error;
- end Actual_Output;
-
- package Int_Ops is new Counting_Stream_Ops (T => Int'Base,
- Actual_Write => Actual_Write,
- Actual_Input => Actual_Input,
- Actual_Read => Actual_Read,
- Actual_Output => Actual_Output);
-
- package Lim_Ops is new Counting_Stream_Ops (T => Lim,
- Actual_Write => Actual_Write,
- Actual_Input => Actual_Input,
- Actual_Read => Actual_Read,
- Actual_Output => Actual_Output);
-
- package Parent_Ops is
- new Counting_Stream_Ops (T => Parent,
- Actual_Write => Actual_Write,
- Actual_Input => Actual_Input,
- Actual_Read => Actual_Read,
- Actual_Output => Actual_Output);
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Int'Base)
- renames Int_Ops.Read;
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Int'Base)
- renames Int_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Int'Base
- renames Int_Ops.Input;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Int'Base)
- renames Int_Ops.Output;
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Lim)
- renames Lim_Ops.Read;
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Lim)
- renames Lim_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Lim
- renames Lim_Ops.Input;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Lim)
- renames Lim_Ops.Output;
-
- procedure Read (Stream : access Root_Stream_Type'Class; Item : out Parent)
- renames Parent_Ops.Read;
- procedure Write (Stream : access Root_Stream_Type'Class; Item : Parent)
- renames Parent_Ops.Write;
- function Input (Stream : access Root_Stream_Type'Class) return Parent
- renames Parent_Ops.Input;
- procedure Output (Stream : access Root_Stream_Type'Class; Item : Parent)
- renames Parent_Ops.Output;
-
- type Derived1 is new Parent with
- record
- C3 : Int;
- end record;
-
- type Derived2 (D : Int) is new Parent (D1 => D,
- D2 => D,
- B => False) with
- record
- C3 : Lim;
- end record;
-
-begin
- Test ("CDD2A03",
- "Check that the default Read and Write attributes for a limited " &
- "type extension are created from the parent type's " &
- "attribute (which may be user-defined) and those for the " &
- "extension components, if the extension components are " &
- "non-limited or have user-defined attributes; check that such " &
- "limited type extension attributes are callable");
-
- Test1:
- declare
- S : aliased My_Stream (1000);
- X1 : Derived1 (D1 => Int (Ident_Int (2)),
- D2 => Int (Ident_Int (5)),
- B => Ident_Bool (True));
- X2 : Derived1 (D1 => Int (Ident_Int (2)),
- D2 => Int (Ident_Int (5)),
- B => Ident_Bool (True));
- begin
- X1.S := Str (Ident_Str ("bcde"));
- X1.C2 := Float (Ident_Int (4));
- X1.C3 := Int (Ident_Int (99));
-
- Derived1'Write (S'Access, X1);
- if Int_Ops.Get_Counts /=
- (Read => 0, Write => 1, Input => 0, Output => 0) then
- Failed ("Error writing extension components - 1");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 0, Write => 1, Input => 0, Output => 0) then
- Failed ("Didn't call parent type's Write - 1");
- end if;
-
- Derived1'Read (S'Access, X2);
- if Int_Ops.Get_Counts /=
- (Read => 1, Write => 1, Input => 0, Output => 0) then
- Failed ("Error reading extension components - 1");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 1, Write => 1, Input => 0, Output => 0) then
- Failed ("Didn't call inherited Read - 1");
- end if;
- end Test1;
-
- Test2:
- declare
- S : aliased My_Stream (1000);
- X1 : Derived2 (D => Int (Ident_Int (7)));
- X2 : Derived2 (D => Int (Ident_Int (7)));
- begin
- X1.S := Str (Ident_Str ("g"));
- X1.C1 := Ident_Int (4);
- X1.C3.C := Int (Ident_Int (666));
-
- Derived2'Write (S'Access, X1);
- if Lim_Ops.Get_Counts /=
- (Read => 0, Write => 1, Input => 0, Output => 0) then
- Failed ("Error writing extension components - 2");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 1, Write => 2, Input => 0, Output => 0) then
- Failed ("Didn't call inherited Write - 2");
- end if;
-
- Derived2'Read (S'Access, X2);
- if Lim_Ops.Get_Counts /=
- (Read => 1, Write => 1, Input => 0, Output => 0) then
- Failed ("Error reading extension components - 2");
- end if;
- if Parent_Ops.Get_Counts /=
- (Read => 2, Write => 2, Input => 0, Output => 0) then
- Failed ("Didn't call inherited Read - 2");
- end if;
- end Test2;
-
- Result;
-end CDD2A03;
diff --git a/gcc/testsuite/ada/acats/tests/cd/cde0001.a b/gcc/testsuite/ada/acats/tests/cd/cde0001.a
deleted file mode 100644
index 59db2256f6f..00000000000
--- a/gcc/testsuite/ada/acats/tests/cd/cde0001.a
+++ /dev/null
@@ -1,324 +0,0 @@
--- CDE0001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the following names can be used in the declaration of a
--- generic formal parameter (object, array type, or access type) without
--- causing freezing of the named type:
--- (1) The name of a private type,
--- (2) A name that denotes a subtype of a private type, and
--- (3) A name that denotes a composite type with a subcomponent of a
--- private type (or subtype).
--- Check for untagged and tagged types.
---
--- TEST DESCRIPTION:
--- This transition test defines private and limited private types,
--- subtypes of these private types, records and arrays of both types and
--- subtypes, a tagged type and a private extension.
--- This test creates examples where the above types are used in the
--- definition of several generic formal type parameters (object, array
--- type, or access type) in both visible and private parts. These
--- visible and private generic packages are instantiated in the body of
--- the public child and the private child, respectively.
--- The main program utilizes the functions declared in the public child
--- to verify results of the instantiations.
---
--- Inspired by B74103F.ADA.
---
---
--- CHANGE HISTORY:
--- 12 Mar 96 SAIC Initial version for ACVC 2.1.
--- 05 Oct 96 SAIC ACVC 2.1: Added pragma Elaborate for CDE0001.
--- 21 Nov 98 RLB Added pragma Elaborate for CDE0001 to CDE0001_3.
---!
-
-package CDE0001_0 is
-
- subtype Small_Int is Integer range 1 .. 2;
-
- type Private_Type is private;
- type Limited_Private is limited private;
-
- subtype Private_Subtype is Private_Type;
- subtype Limited_Private_Subtype is Limited_Private;
-
- type Array_Of_LP_Subtype is array (1..2) of Limited_Private_Subtype;
-
- type Rec_Of_Limited_Private is
- record
- C1 : Limited_Private;
- end record;
-
- type Rec_Of_Private_SubType is
- record
- C1 : Private_SubType;
- end record;
-
- type Tag_Type is tagged
- record
- C1 : Small_Int;
- end record;
-
- type New_TagType is new Tag_Type with private;
-
- generic
-
- Formal_Obj01 : in out Private_Type; -- Formal objects defined
- Formal_Obj02 : in out Limited_Private; -- by names of private
- Formal_Obj03 : in out Private_Subtype; -- types, names that
- Formal_Obj04 : in out Limited_Private_Subtype; -- denotes subtypes of
- Formal_Obj05 : in out New_TagType; -- the private types.
-
- package CDE0001_1 is
- procedure Assign_Objects;
-
- end CDE0001_1;
-
-private
-
- generic
- -- Formal array types of a private type, a composite type with a
- -- subcomponent of a private type.
-
- type Formal_Arr01 is array (Small_Int) of Private_Type;
- type Formal_Arr02 is array (Small_Int) of Rec_Of_Limited_Private;
-
- -- Formal access types of composite types with a subcomponent of
- -- a private subtype.
-
- type Formal_Acc01 is access Rec_Of_Private_Subtype;
- type Formal_Acc02 is access Array_Of_LP_Subtype;
-
- package CDE0001_2 is
-
- procedure Assign_Arrays (P1 : out Formal_Arr01;
- P2 : out Formal_Arr02);
-
- procedure Assign_Access (P1 : out Formal_Acc01;
- P2 : out Formal_Acc02);
-
- end CDE0001_2;
-
- ----------------------------------------------------------
- type Private_Type is range 1 .. 10;
- type Limited_Private is (Eh, Bee, Sea, Dee);
- type New_TagType is new Tag_Type with
- record
- C2 : Private_Type;
- end record;
-
-end CDE0001_0;
-
- --==================================================================--
-
-package body CDE0001_0 is
-
- package body CDE0001_1 is
-
- procedure Assign_Objects is
- begin
- Formal_Obj01 := Private_Type'First;
- Formal_Obj02 := Limited_Private'Last;
- Formal_Obj03 := Private_Subtype'Last;
- Formal_Obj04 := Limited_Private_Subtype'First;
- Formal_Obj05 := New_TagType'(C1 => 2, C2 => Private_Type'Last);
-
- end Assign_Objects;
-
- end CDE0001_1;
-
- --===========================================================--
-
- package body CDE0001_2 is
-
- procedure Assign_Arrays (P1 : out Formal_Arr01;
- P2 : out Formal_Arr02) is
- begin
- P1(1) := Private_Type'Pred(Private_Type'Last);
- P1(2) := Private_Type'Succ(Private_Type'First);
- P2(1).C1 := Limited_Private'Succ(Limited_Private'First);
- P2(2).C1 := Limited_Private'Pred(Limited_Private'Last);
-
- end Assign_Arrays;
-
- -----------------------------------------------------------------
- procedure Assign_Access (P1 : out Formal_Acc01;
- P2 : out Formal_Acc02) is
- begin
- P1 := new Rec_Of_Private_Subtype'(C1 => Private_Subtype'Last);
- P2 := new Array_Of_LP_Subtype'(Eh, Dee);
-
- end Assign_Access;
-
- end CDE0001_2;
-
-end CDE0001_0;
-
- --==================================================================--
-
--- The following private child package instantiates its parent private generic
--- package.
-
-with CDE0001_0;
-pragma Elaborate (CDE0001_0); -- So generic unit can be instantiated.
-private
-package CDE0001_0.CDE0001_3 is
-
- type Arr01 is array (Small_Int) of Private_Type;
- type Arr02 is array (Small_Int) of Rec_Of_Limited_Private;
- type Acc01 is access Rec_Of_Private_Subtype;
- type Acc02 is access Array_Of_LP_Subtype;
-
- package Formal_Types_Pck is new CDE0001_2 (Arr01, Arr02, Acc01, Acc02);
-
- Arr01_Obj : Arr01;
- Arr02_Obj : Arr02;
- Acc01_Obj : Acc01;
- Acc02_Obj : Acc02;
-
-end CDE0001_0.CDE0001_3;
-
- --==================================================================--
-
-package CDE0001_0.CDE0001_4 is
-
- -- The following functions check the private types defined in the parent
- -- and the private child package from within the client program.
-
- function Verify_Objects return Boolean;
-
- function Verify_Arrays return Boolean;
-
- function Verify_Access return Boolean;
-
-end CDE0001_0.CDE0001_4;
-
- --==================================================================--
-
-with CDE0001_0.CDE0001_3; -- private sibling.
-
-pragma Elaborate (CDE0001_0.CDE0001_3);
-
-package body CDE0001_0.CDE0001_4 is
-
- Obj1 : Private_Type := 2;
- Obj2 : Limited_Private := Bee;
- Obj3 : Private_Subtype := 3;
- Obj4 : Limited_Private_Subtype := Sea;
- Obj5 : New_TagType := (1, 5);
-
- -- Instantiate the generic package declared in the visible part of
- -- the parent.
-
- package Formal_Obj_Pck is new CDE0001_1 (Obj1, Obj2, Obj3, Obj4, Obj5);
-
- ---------------------------------------------------
- function Verify_Objects return Boolean is
- Result : Boolean := False;
- begin
- if Obj1 = 1 and
- Obj2 = Dee and
- Obj3 = 10 and
- Obj4 = Eh and
- Obj5.C1 = 2 and
- Obj5.C2 = 10 then
- Result := True;
- end if;
-
- return Result;
-
- end Verify_Objects;
-
- ---------------------------------------------------
- function Verify_Arrays return Boolean is
- Result : Boolean := False;
- begin
- if CDE0001_0.CDE0001_3.Arr01_Obj(1) = 9 and
- CDE0001_0.CDE0001_3.Arr01_Obj(2) = 2 and
- CDE0001_0.CDE0001_3.Arr02_Obj(1).C1 = Bee and
- CDE0001_0.CDE0001_3.Arr02_Obj(2).C1 = Sea then
- Result := True;
- end if;
-
- return Result;
-
- end Verify_Arrays;
-
- ---------------------------------------------------
- function Verify_Access return Boolean is
- Result : Boolean := False;
- begin
- if CDE0001_0.CDE0001_3.Acc01_Obj.C1 = 10 and
- CDE0001_0.CDE0001_3.Acc02_Obj(1) = Eh and
- CDE0001_0.CDE0001_3.Acc02_Obj(2) = Dee then
- Result := True;
- end if;
-
- return Result;
-
- end Verify_Access;
-
-begin
-
- Formal_Obj_Pck.Assign_Objects;
-
- CDE0001_0.CDE0001_3.Formal_Types_Pck.Assign_Arrays
- (CDE0001_0.CDE0001_3.Arr01_Obj, CDE0001_0.CDE0001_3.Arr02_Obj);
- CDE0001_0.CDE0001_3.Formal_Types_Pck.Assign_Access
- (CDE0001_0.CDE0001_3.Acc01_Obj, CDE0001_0.CDE0001_3.Acc02_Obj);
-
-end CDE0001_0.CDE0001_4;
-
- --==================================================================--
-
-with Report;
-with CDE0001_0.CDE0001_4;
-
-procedure CDE0001 is
-
-begin
-
- Report.Test ("CDE0001", "Check that the name of the private type, a " &
- "name that denotes a subtype of the private type, or a " &
- "name that denotes a composite type with a subcomponent " &
- "of a private type can be used in the declaration of a " &
- "generic formal type parameter without causing freezing " &
- "of the named type");
-
- if not CDE0001_0.CDE0001_4.Verify_Objects then
- Report.Failed ("Wrong values for formal objects");
- end if;
-
- if not CDE0001_0.CDE0001_4.Verify_Arrays then
- Report.Failed ("Wrong values for formal array types");
- end if;
-
- if not CDE0001_0.CDE0001_4.Verify_Access then
- Report.Failed ("Wrong values for formal access types");
- end if;
-
- Report.Result;
-
-end CDE0001;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa3001.a b/gcc/testsuite/ada/acats/tests/cxa/cxa3001.a
deleted file mode 100644
index 9c7e25b977c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa3001.a
+++ /dev/null
@@ -1,507 +0,0 @@
--- CXA3001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the character classification functions defined in
--- package Ada.Characters.Handling produce correct results when provided
--- constant arguments from package Ada.Characters.Latin_1.
---
--- TEST DESCRIPTION:
--- This test checks the character classification functions of package
--- Ada.Characters.Handling. In the evaluation of each function, loops
--- are constructed to examine the function with as many values of type
--- Character (Ada.Characters.Latin_1 constants) as possible in an
--- amount of code that is about equal to the amount of code required
--- to examine the function with a few representative input values and
--- endpoint values.
--- The usage paradigm being demonstrated by this test is that of the
--- functions being used to assign to boolean variables, as well as
--- serving as boolean conditions.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 29 Apr 95 SAIC Fixed subtest checking Is_Graphic function.
---
---!
-
-with Ada.Characters.Latin_1;
-with Ada.Characters.Handling;
-with Report;
-
-procedure CXA3001 is
-
-begin
-
- Report.Test ("CXA3001", "Check that the character classification " &
- "functions defined in package " &
- "Ada.Characters.Handling produce " &
- "correct results when provided constant " &
- "arguments from package Ada.Characters.Latin_1");
-
- Test_Block:
- declare
-
- package AC renames Ada.Characters;
- package ACH renames Ada.Characters.Handling;
-
- TC_Boolean : Boolean := False;
-
- begin
-
- -- Over the next six statements/blocks of code, evaluate functions
- -- Is_Control and Is_Graphic with control character and non-control
- -- character values.
-
- for i in Character'Pos(AC.Latin_1.NUL) ..
- Character'Pos(AC.Latin_1.US) loop
- if not ACH.Is_Control(Character'Val(i)) then
- Report.Failed ("Incorrect result from function Is_Control - 1");
- end if;
- if ACH.Is_Graphic(Character'Val(i)) then
- Report.Failed ("Incorrect result from function Is_Graphic - 1");
- end if;
- end loop;
-
-
- for i in Character'Pos(AC.Latin_1.Space) ..
- Character'Pos(AC.Latin_1.Tilde) loop
- if not ACH.Is_Graphic(Character'Val(i)) then
- Report.Failed ("Incorrect result from function Is_Graphic - 2");
- end if;
- if ACH.Is_Control(Character'Val(i)) then
- Report.Failed ("Incorrect result from function Is_Control - 2");
- end if;
- end loop;
-
-
- for i in Character'Pos(AC.Latin_1.Reserved_128) ..
- Character'Pos(AC.Latin_1.APC) loop
- if not ACH.Is_Control(Character'Val(i)) then
- Report.Failed ("Incorrect result from function Is_Control - 3");
- end if;
- TC_Boolean := ACH.Is_Graphic(Character'Val(i));
- if TC_Boolean then
- Report.Failed ("Incorrect result from function Is_Graphic - 3");
- TC_Boolean := False;
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.No_Break_Space) ..
- Character'Pos(AC.Latin_1.LC_Y_Diaeresis) loop
- TC_Boolean := ACH.Is_Control(Character'Val(i));
- if TC_Boolean then
- Report.Failed ("Incorrect result from function Is_Control - 4");
- TC_Boolean := False;
- end if;
- if not ACH.Is_Graphic(Character'Val(i)) then
- Report.Failed ("Incorrect result from function Is_Graphic - 4");
- end if;
- end loop;
-
- -- Check renamed constants.
-
- if not (ACH.Is_Control(AC.Latin_1.IS4) and
- ACH.Is_Control(AC.Latin_1.IS3) and
- ACH.Is_Control(AC.Latin_1.IS2) and
- ACH.Is_Control(AC.Latin_1.IS1)) or
- (ACH.Is_Control(AC.Latin_1.NBSP) or
- ACH.Is_Control(AC.Latin_1.Paragraph_Sign) or
- ACH.Is_Control(AC.Latin_1.Minus_Sign) or
- ACH.Is_Control(AC.Latin_1.Ring_Above))
- then
- Report.Failed ("Incorrect result from function Is_Control - 5");
- end if;
-
- if (ACH.Is_Graphic(AC.Latin_1.IS4) or
- ACH.Is_Graphic(AC.Latin_1.IS3) or
- ACH.Is_Graphic(AC.Latin_1.IS2) or
- ACH.Is_Graphic(AC.Latin_1.IS1)) or
- not (ACH.Is_Graphic(AC.Latin_1.NBSP) and
- ACH.Is_Graphic(AC.Latin_1.Paragraph_Sign) and
- ACH.Is_Graphic(AC.Latin_1.Minus_Sign) and
- ACH.Is_Graphic(AC.Latin_1.Ring_Above))
- then
- Report.Failed ("Incorrect result from function Is_Graphic - 5");
- end if;
-
-
- -- Evaluate function Is_Letter with letter/non-letter inputs.
-
- for i in Character'Pos('A') .. Character'Pos('Z') loop
- if not ACH.Is_Letter(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Letter result - 1");
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.LC_A) ..
- Character'Pos(AC.Latin_1.LC_Z) loop
- if not ACH.Is_Letter(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Letter result - 2");
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.UC_A_Grave) ..
- Character'Pos(AC.Latin_1.UC_O_Diaeresis) loop
- if not ACH.Is_Letter(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Letter result - 3");
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.UC_O_Oblique_Stroke) ..
- Character'Pos(AC.Latin_1.LC_O_Diaeresis) loop
- if not ACH.Is_Letter(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Letter result - 4");
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.LC_O_Oblique_Stroke) ..
- Character'Pos(AC.Latin_1.LC_Y_Diaeresis) loop
- if not ACH.Is_Letter(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Letter result - 5");
- end if;
- end loop;
-
- -- Check for rejection of non-letters.
- for i in Character'Pos(AC.Latin_1.NUL) ..
- Character'Pos(AC.Latin_1.Commercial_At) loop
- if ACH.Is_Letter(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Letter result - 6");
- end if;
- end loop;
-
-
- -- Evaluate function Is_Lower with lower case/non-lower case inputs.
-
- for i in Character'Pos(AC.Latin_1.LC_A) ..
- Character'Pos(AC.Latin_1.LC_Z) loop
- if not ACH.Is_Lower(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Lower result - 1");
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.LC_A_Grave) ..
- Character'Pos(AC.Latin_1.LC_O_Diaeresis) loop
- if not ACH.Is_Lower(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Lower result - 2");
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.LC_O_Oblique_Stroke) ..
- Character'Pos(AC.Latin_1.LC_Y_Diaeresis) loop
- if not ACH.Is_Lower(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Lower result - 3");
- end if;
- end loop;
-
- if ACH.Is_Lower('A') or
- ACH.Is_Lower(AC.Latin_1.UC_Icelandic_Eth) or
- ACH.Is_Lower(AC.Latin_1.Number_Sign) or
- ACH.Is_Lower(AC.Latin_1.Cedilla) or
- ACH.Is_Lower(AC.Latin_1.SYN) or
- ACH.Is_Lower(AC.Latin_1.ESA)
- then
- Report.Failed ("Incorrect Is_Lower result - 4");
- end if;
-
-
- -- Evaluate function Is_Upper with upper case/non-upper case inputs.
-
- for i in Character'Pos('A') .. Character'Pos('Z') loop
- if not ACH.Is_Upper(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Upper result - 1");
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.UC_A_Grave) ..
- Character'Pos(AC.Latin_1.UC_O_Diaeresis) loop
- if not ACH.Is_Upper(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Upper result - 2");
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.UC_O_Oblique_Stroke) ..
- Character'Pos(AC.Latin_1.UC_Icelandic_Thorn) loop
- if not ACH.Is_Upper(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Upper result - 3");
- end if;
- end loop;
-
- if ACH.Is_Upper('8') or
- ACH.Is_Upper(AC.Latin_1.LC_A_Ring ) or
- ACH.Is_Upper(AC.Latin_1.Dollar_Sign) or
- ACH.Is_Upper(AC.Latin_1.Broken_Bar) or
- ACH.Is_Upper(AC.Latin_1.ETB) or
- ACH.Is_Upper(AC.Latin_1.VTS)
- then
- Report.Failed ("Incorrect Is_Upper result - 4");
- end if;
-
-
- for i in Character'Pos('a') .. Character'Pos('z') loop
- if ACH.Is_Upper(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Upper result - 5");
- end if;
- end loop;
-
-
- -- Evaluate function Is_Basic with basic/non-basic inputs.
- -- (Note: Basic letters are those without diacritical marks.)
-
- for i in Character'Pos('A') .. Character'Pos('Z') loop
- if not ACH.Is_Basic(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Basic result - 1");
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.LC_A) ..
- Character'Pos(AC.Latin_1.LC_Z) loop
- if not ACH.Is_Basic(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Basic result - 2");
- end if;
- end loop;
-
-
- if not (ACH.Is_Basic(AC.Latin_1.UC_AE_Diphthong) and
- ACH.Is_Basic(AC.Latin_1.LC_AE_Diphthong) and
- ACH.Is_Basic(AC.Latin_1.LC_German_Sharp_S) and
- ACH.Is_Basic(AC.Latin_1.LC_Icelandic_Eth) and
- ACH.Is_Basic(AC.Latin_1.LC_Icelandic_Thorn) and
- ACH.Is_Basic(AC.Latin_1.UC_Icelandic_Eth) and
- ACH.Is_Basic(AC.Latin_1.UC_Icelandic_Thorn))
- then
- Report.Failed ("Incorrect Is_Basic result - 3");
- end if;
-
- -- Check for rejection of non-basics.
- if ACH.Is_Basic(AC.Latin_1.UC_A_Tilde) or
- ACH.Is_Basic(AC.Latin_1.LC_A_Grave) or
- ACH.Is_Basic(AC.Latin_1.Ampersand) or
- ACH.Is_Basic(AC.Latin_1.Yen_Sign) or
- ACH.Is_Basic(AC.Latin_1.NAK) or
- ACH.Is_Basic(AC.Latin_1.SS2)
- then
- Report.Failed ("Incorrect Is_Basic result - 4");
- end if;
-
-
-
- for i in Character'Pos(AC.Latin_1.NUL) ..
- Character'Pos(AC.Latin_1.Commercial_At) loop
- if ACH.Is_Basic(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Basic result - 5");
- end if;
- end loop;
-
-
- -- Evaluate functions Is_Digit and Is_Decimal_Digit (a rename of
- -- Is_Digit) with decimal digit/non-digit inputs.
-
-
- if not (ACH.Is_Digit('0') and
- ACH.Is_Decimal_Digit('9')) or
- ACH.Is_Digit ('a') or -- Hex digits.
- ACH.Is_Decimal_Digit ('f') or
- ACH.Is_Decimal_Digit ('A') or
- ACH.Is_Digit ('F')
- then
- Report.Failed ("Incorrect Is_Digit/Is_Decimal_Digit result - 1");
- end if;
-
- if ACH.Is_Digit (AC.Latin_1.Full_Stop) or
- ACH.Is_Decimal_Digit (AC.Latin_1.Dollar_Sign) or
- ACH.Is_Digit (AC.Latin_1.Number_Sign) or
- ACH.Is_Decimal_Digit (AC.Latin_1.Left_Parenthesis) or
- ACH.Is_Digit (AC.Latin_1.Right_Parenthesis)
- then
- Report.Failed ("Incorrect Is_Digit/Is_Decimal_Digit result - 2");
- end if;
-
-
- -- Evaluate functions Is_Hexadecimal_Digit with hexadecimal digit and
- -- non-hexadecimal digit inputs.
-
- for i in Character'Pos('0') .. Character'Pos('9') loop
- if not ACH.Is_Hexadecimal_Digit(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Hexadecimal_Digit result - 1");
- end if;
- end loop;
-
- for i in Character'Pos('A') .. Character'Pos('F') loop
- if not ACH.Is_Hexadecimal_Digit(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Hexadecimal_Digit result - 2");
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.LC_A) ..
- Character'Pos(AC.Latin_1.LC_F) loop
- if not ACH.Is_Hexadecimal_Digit(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Hexadecimal_Digit result - 3");
- end if;
- end loop;
-
-
- if ACH.Is_Hexadecimal_Digit (AC.Latin_1.Minus_Sign) or
- ACH.Is_Hexadecimal_Digit (AC.Latin_1.Hyphen) or
- ACH.Is_Hexadecimal_Digit (AC.Latin_1.LC_G) or
- ACH.Is_Hexadecimal_Digit (AC.Latin_1.LC_Z) or
- ACH.Is_Hexadecimal_Digit ('G') or
- ACH.Is_Hexadecimal_Digit (AC.Latin_1.Cent_Sign) or
- ACH.Is_Hexadecimal_Digit (AC.Latin_1.Pound_Sign)
- then
- Report.Failed ("Incorrect Is_HexaDecimal_Digit result - 4");
- end if;
-
-
- -- Evaluate functions Is_Alphanumeric and Is_Special with
- -- letters, digits, and non-alphanumeric inputs.
-
- for i in Character'Pos(AC.Latin_1.NUL) ..
- Character'Pos(AC.Latin_1.US) loop
- if ACH.Is_Alphanumeric(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Alphanumeric result - 1");
- end if;
- TC_Boolean := ACH.Is_Special(Character'Val(i));
- if TC_Boolean then
- Report.Failed ("Incorrect Is_Special result - 1");
- TC_Boolean := False;
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.Reserved_128) ..
- Character'Pos(AC.Latin_1.APC) loop
- TC_Boolean := ACH.Is_Alphanumeric(Character'Val(i));
- if TC_Boolean then
- Report.Failed ("Incorrect Is_Alphanumeric result - 2");
- TC_Boolean := False;
- end if;
- if ACH.Is_Special(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Special result - 2");
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.Space) ..
- Character'Pos(AC.Latin_1.Solidus) loop
- TC_Boolean := ACH.Is_Alphanumeric(Character'Val(i));
- if TC_Boolean then
- Report.Failed ("Incorrect Is_Alphanumeric result - 3");
- TC_Boolean := False;
- end if;
- if not ACH.Is_Special(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Special result - 3");
- end if;
- end loop;
-
- for i in Character'Pos('A') .. Character'Pos('Z') loop
- if not ACH.Is_Alphanumeric(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Alphanumeric result - 4");
- end if;
- TC_Boolean := ACH.Is_Special(Character'Val(i));
- if TC_Boolean then
- Report.Failed ("Incorrect Is_Special result - 4");
- TC_Boolean := False;
- end if;
- end loop;
-
- for i in Character'Pos('0') .. Character'Pos('9') loop
- if not ACH.Is_Alphanumeric(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Alphanumeric result - 5");
- end if;
- TC_Boolean := ACH.Is_Special(Character'Val(i));
- if TC_Boolean then
- Report.Failed ("Incorrect Is_Special result - 5");
- TC_Boolean := False;
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.LC_A) ..
- Character'Pos(AC.Latin_1.LC_Z) loop
- if not ACH.Is_Alphanumeric(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Alphanumeric result - 6");
- end if;
- TC_Boolean := ACH.Is_Special(Character'Val(i));
- if TC_Boolean then
- Report.Failed ("Incorrect Is_Special result - 6");
- TC_Boolean := False;
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.No_Break_Space) ..
- Character'Pos(AC.Latin_1.Inverted_Question) loop
- TC_Boolean := ACH.Is_Alphanumeric(Character'Val(i));
- if TC_Boolean then
- Report.Failed ("Incorrect Is_Alphanumeric result - 7");
- TC_Boolean := False;
- end if;
- if not ACH.Is_Special(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Special result - 7");
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.UC_A_Grave) ..
- Character'Pos(AC.Latin_1.UC_O_Diaeresis) loop
- if not ACH.Is_Alphanumeric(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Alphanumeric result - 8");
- end if;
- TC_Boolean := ACH.Is_Special(Character'Val(i));
- if TC_Boolean then
- Report.Failed ("Incorrect Is_Special result - 8");
- TC_Boolean := False;
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.UC_O_Oblique_Stroke) ..
- Character'Pos(AC.Latin_1.LC_O_Diaeresis) loop
- if not ACH.Is_Alphanumeric(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Alphanumeric result - 9");
- end if;
- TC_Boolean := ACH.Is_Special(Character'Val(i));
- if TC_Boolean then
- Report.Failed ("Incorrect Is_Special result - 9");
- TC_Boolean := False;
- end if;
- end loop;
-
- for i in Character'Pos(AC.Latin_1.LC_O_Oblique_Stroke) ..
- Character'Pos(AC.Latin_1.LC_Y_Diaeresis) loop
- if not ACH.Is_Alphanumeric(Character'Val(i)) then
- Report.Failed ("Incorrect Is_Alphanumeric result - 10");
- end if;
- TC_Boolean := ACH.Is_Special(Character'Val(i));
- if TC_Boolean then
- Report.Failed ("Incorrect Is_Special result - 10");
- TC_Boolean := False;
- end if;
- end loop;
-
-
- exception
- when others => Report.Failed ("Exception raised during processing");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA3001;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa3002.a b/gcc/testsuite/ada/acats/tests/cxa/cxa3002.a
deleted file mode 100644
index 12d98fdfe70..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa3002.a
+++ /dev/null
@@ -1,318 +0,0 @@
--- CXA3002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the conversion functions for Characters and Strings
--- defined in package Ada.Characters.Handling provide correct results
--- when given character/string input parameters.
---
--- TEST DESCRIPTION:
--- This test checks the output of the To_Lower, To_Upper, and
--- To_Basic functions for both Characters and Strings. Each function
--- is called with input parameters that are within the appropriate
--- range of values, and also with values outside the specified
--- range (i.e., lower case 'a' to To_Lower). The functions are also
--- used in combination with one another, with the result of one function
--- providing the actual input parameter value to another.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 22 Dec 94 SAIC Corrected evaluations of Functions In Combination.
---
---!
-
-with Ada.Characters.Latin_1;
-with Ada.Characters.Handling;
-with Report;
-
-procedure CXA3002 is
-
- package AC renames Ada.Characters;
- package ACH renames Ada.Characters.Handling;
-
-begin
-
- Report.Test ("CXA3002", "Check that the conversion functions for " &
- "Characters and Strings defined in package " &
- "Ada.Characters.Handling provide correct " &
- "results when given character/string input " &
- "parameters");
-
-
- Character_Block:
- declare
- Offset : constant Integer := Character'Pos('a') - Character'Pos('A');
- begin
-
- -- Function To_Lower for Characters
-
- if ACH.To_Lower('A') /= 'a' or ACH.To_Lower('Z') /= 'z' then
- Report.Failed ("Incorrect operation of function To_Lower - 1");
- end if;
-
-
- for i in Character'Pos('A') .. Character'Pos('Z') loop
- if ACH.To_Lower(Character'Val(i)) /= Character'Val(i + Offset) then
- Report.Failed ("Incorrect operation of function To_Lower - 2");
- end if;
- end loop;
-
-
- if (ACH.To_Lower(AC.Latin_1.UC_A_Grave) /=
- AC.Latin_1.LC_A_Grave) or
- (ACH.To_Lower(AC.Latin_1.UC_Icelandic_Thorn) /=
- AC.Latin_1.LC_Icelandic_Thorn)
- then
- Report.Failed ("Incorrect operation of function To_Lower - 3");
- end if;
-
-
- if ACH.To_Lower('c') /= 'c' or
- ACH.To_Lower('w') /= 'w' or
- ACH.To_Lower(AC.Latin_1.CR) /= AC.Latin_1.CR or
- ACH.To_Lower(AC.Latin_1.LF) /= AC.Latin_1.LF or
- ACH.To_Lower(AC.Latin_1.Comma) /= AC.Latin_1.Comma or
- ACH.To_Lower(AC.Latin_1.Question) /= AC.Latin_1.Question or
- ACH.To_Lower('0') /= '0' or
- ACH.To_Lower('9') /= '9'
- then
- Report.Failed ("Incorrect operation of function To_Lower - 4");
- end if;
-
-
- --- Function To_Upper for Characters
-
-
- if not (ACH.To_Upper('b') = 'B') and (ACH.To_Upper('y') = 'Y') then
- Report.Failed ("Incorrect operation of function To_Upper - 1");
- end if;
-
-
- for i in Character'Pos(AC.Latin_1.LC_A) ..
- Character'Pos(AC.Latin_1.LC_Z) loop
- if ACH.To_Upper(Character'Val(i)) /= Character'Val(i - Offset) then
- Report.Failed ("Incorrect operation of function To_Upper - 2");
- end if;
- end loop;
-
-
- if (ACH.To_Upper(AC.Latin_1.LC_U_Diaeresis) /=
- AC.Latin_1.UC_U_Diaeresis) or
- (ACH.To_Upper(AC.Latin_1.LC_A_Ring) /=
- AC.Latin_1.UC_A_Ring)
- then
- Report.Failed ("Incorrect operation of function To_Upper - 3");
- end if;
-
-
- if not (ACH.To_Upper('F') = 'F' and
- ACH.To_Upper('U') = 'U' and
- ACH.To_Upper(AC.Latin_1.LC_German_Sharp_S) =
- AC.Latin_1.LC_German_Sharp_S and
- ACH.To_Upper(AC.Latin_1.LC_Y_Diaeresis) =
- AC.Latin_1.LC_Y_Diaeresis)
- then
- Report.Failed ("Incorrect operation of function To_Upper - 4");
- end if;
-
-
- --- Function To_Basic for Characters
-
-
- if ACH.To_Basic(AC.Latin_1.LC_A_Circumflex) /=
- ACH.To_Basic(AC.Latin_1.LC_A_Tilde) or
- ACH.To_Basic(AC.Latin_1.LC_E_Grave) /=
- ACH.To_Basic(AC.Latin_1.LC_E_Acute) or
- ACH.To_Basic(AC.Latin_1.LC_I_Circumflex) /=
- ACH.To_Basic(AC.Latin_1.LC_I_Diaeresis) or
- ACH.To_Basic(AC.Latin_1.UC_O_Tilde) /=
- ACH.To_Basic(AC.Latin_1.UC_O_Acute) or
- ACH.To_Basic(AC.Latin_1.UC_U_Grave) /=
- ACH.To_Basic(AC.Latin_1.UC_U_Acute) or
- ACH.To_Basic(AC.Latin_1.LC_Y_Acute) /=
- ACH.To_Basic(AC.Latin_1.LC_Y_Diaeresis)
- then
- Report.Failed ("Incorrect operation of function To_Basic - 1");
- end if;
-
-
- if ACH.To_Basic('Y') /= 'Y' or
- ACH.To_Basic(AC.Latin_1.LC_E_Acute) /= 'e' or
- ACH.To_Basic('6') /= '6' or
- ACH.To_Basic(AC.Latin_1.LC_R) /= 'r'
- then
- Report.Failed ("Incorrect operation of function To_Basic - 2");
- end if;
-
-
- -- Using Functions (for Characters) in Combination
-
-
- if (ACH.To_Upper(ACH.To_Lower('A')) /= 'A' ) or
- (ACH.To_Upper(ACH.To_Lower(AC.Latin_1.UC_A_Acute)) /=
- AC.Latin_1.UC_A_Acute )
- then
- Report.Failed("Incorrect operation of functions in combination - 1");
- end if;
-
-
- if ACH.To_Basic(ACH.To_Lower(ACH.To_Upper(AC.Latin_1.LC_U_Grave))) /=
- 'u'
- then
- Report.Failed("Incorrect operation of functions in combination - 2");
- end if;
-
-
- if ACH.To_Lower (ACH.To_Basic
- (ACH.To_Upper(AC.Latin_1.LC_O_Diaeresis))) /= 'o'
- then
- Report.Failed("Incorrect operation of functions in combination - 3");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Character_Block");
- end Character_Block;
-
-
- String_Block:
- declare
-
- LC_String : constant String := "az" &
- AC.Latin_1.LC_A_Grave &
- AC.Latin_1.LC_C_Cedilla;
-
- UC_String : constant String := "AZ" &
- AC.Latin_1.UC_A_Grave &
- AC.Latin_1.UC_C_Cedilla;
-
- LC_Basic_String : constant String := "aei" & 'o' & 'u';
-
- LC_NonBasic_String : constant String := AC.Latin_1.LC_A_Diaeresis &
- AC.Latin_1.LC_E_Circumflex &
- AC.Latin_1.LC_I_Acute &
- AC.Latin_1.LC_O_Tilde &
- AC.Latin_1.LC_U_Grave;
-
- UC_Basic_String : constant String := "AEIOU";
-
- UC_NonBasic_String : constant String := AC.Latin_1.UC_A_Tilde &
- AC.Latin_1.UC_E_Acute &
- AC.Latin_1.UC_I_Grave &
- AC.Latin_1.UC_O_Diaeresis &
- AC.Latin_1.UC_U_Circumflex;
-
- LC_Special_String : constant String := "ab" &
- AC.Latin_1.LC_German_Sharp_S &
- AC.Latin_1.LC_Y_Diaeresis;
-
- UC_Special_String : constant String := "AB" &
- AC.Latin_1.LC_German_Sharp_S &
- AC.Latin_1.LC_Y_Diaeresis;
-
- begin
-
- -- Function To_Lower for Strings
-
-
- if ACH.To_Lower (UC_String) /= LC_String or
- ACH.To_Lower (LC_String) /= LC_String
- then
- Report.Failed ("Incorrect result from To_Lower for strings - 1");
- end if;
-
-
- if ACH.To_Lower (UC_Basic_String) /= LC_Basic_String then
- Report.Failed ("Incorrect result from To_Lower for strings - 2");
- end if;
-
-
- -- Function To_Upper for Strings
-
-
- if not (ACH.To_Upper (LC_String) = UC_String) then
- Report.Failed ("Incorrect result from To_Upper for strings - 1");
- end if;
-
-
- if ACH.To_Upper (LC_Basic_String) /= UC_Basic_String or
- ACH.To_Upper (UC_String) /= UC_String
- then
- Report.Failed ("Incorrect result from To_Upper for strings - 2");
- end if;
-
-
- if ACH.To_Upper (LC_Special_String) /= UC_Special_String then
- Report.Failed ("Incorrect result from To_Upper for strings - 3");
- end if;
-
-
-
- -- Function To_Basic for Strings
-
-
- if (ACH.To_Basic (LC_String) /= "azac") or
- (ACH.To_Basic (UC_String) /= "AZAC")
- then
- Report.Failed ("Incorrect result from To_Basic for Strings - 1");
- end if;
-
-
- if ACH.To_Basic (LC_NonBasic_String) /= LC_Basic_String then
- Report.Failed ("Incorrect result from To_Basic for Strings - 2");
- end if;
-
-
- if ACH.To_Basic (UC_NonBasic_String) /= UC_Basic_String then
- Report.Failed ("Incorrect result from To_Basic for Strings - 3");
- end if;
-
-
- -- Using Functions (for Strings) in Combination
-
-
- if ACH.To_Upper(ACH.To_Lower(UC_Basic_String)) /= UC_Basic_String or
- ACH.To_Lower(ACH.To_Upper(LC_Basic_String)) /= LC_Basic_String
- then
- Report.Failed ("Incorrect operation of functions in combination - 4");
- end if;
-
-
- if (ACH.To_Basic(ACH.To_Lower(UC_NonBasic_String)) /= LC_Basic_String) or
- (ACH.To_Basic(ACH.To_Upper(LC_NonBasic_String)) /= UC_Basic_String)
- then
- Report.Failed ("Incorrect operation of functions in combination - 5");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in String_Block");
- end String_Block;
-
-
- Report.Result;
-
-end CXA3002;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa3003.a b/gcc/testsuite/ada/acats/tests/cxa/cxa3003.a
deleted file mode 100644
index f469ef8b539..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa3003.a
+++ /dev/null
@@ -1,243 +0,0 @@
--- CXA3003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functions defined in package Ada.Characters.Handling
--- for use in classifying and converting characters between the ISO 646
--- and type Character sets produce the correct results with both
--- Character and String input values.
---
--- TEST DESCRIPTION:
--- This test is designed to exercise the classification and conversion
--- functions (between Character and ISO_646 types) found in package
--- Ada.Characters.Handling. Two subprograms are defined, a procedure for
--- characters, a function for strings, that will utilize these functions
--- to validate and change characters in variables. In the procedure, if
--- a character argument is found to be outside the subtype ISO_646, this
--- character is evaluated to determine whether it is also a letter.
--- If it is a letter, the character is converted to a basic character and
--- returned. If it is not a letter, the character is exchanged with an
--- asterisk. In the case of the function subprogram designed for strings,
--- if a character component of a string argument is outside the subtype
--- ISO_646, that character is substituted with an asterisk.
---
--- Arguments for the defined subprograms consist of ISO_646 characters,
--- non-ISO_646 characters, strings with only ISO_646 characters, and
--- strings with non-ISO_646 characters. The character and string values
--- are then validated to determine that the expected results were
--- obtained.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 29 Apr 95 SAIC Modified identifier string lengths.
--- 31 Oct 95 SAIC Update and repair for ACVC 2.0.1.
---
---!
-
-with Ada.Characters.Latin_1;
-with Ada.Characters.Handling;
-with Report;
-
-procedure CXA3003 is
-
-begin
-
- Report.Test ("CXA3003", "Check that the functions defined in package " &
- "Ada.Characters.Handling for use in " &
- "classifying and converting characters " &
- "between the ISO 646 and type Character sets " &
- "produce the correct results with both " &
- "Character and String input values" );
-
- Test_Block:
- declare
-
- -- ISO_646 Characters
-
- Char_1,
- TC_Char_1 : Character := Ada.Characters.Latin_1.NUL; -- Control Char
- Char_2,
- TC_Char_2 : Character := Ada.Characters.Latin_1.Colon; -- Graphic Char
- Char_3,
- TC_Char_3 : Character := '4';
- Char_4,
- TC_Char_4 : Character := 'Z';
- Char_5,
- TC_Char_5 : Character := Ada.Characters.Latin_1.LC_W; -- w
-
- New_ISO_646_Char : Character := '*';
-
-
- -- Non-ISO_646 Characters
-
- Char_Array : array (6..10) of Character :=
- (Ada.Characters.Latin_1.SSA,
- Ada.Characters.Latin_1.Cent_Sign,
- Ada.Characters.Latin_1.Cedilla,
- Ada.Characters.Latin_1.UC_A_Ring,
- Ada.Characters.Latin_1.LC_A_Ring);
-
- TC_Char : constant Character := '*';
-
- -- ISO_646 Strings
-
- Str_1,
- TC_Str_1 : String (1..5) := "ABCDE";
-
- Str_2,
- TC_Str_2 : String (1..5) := "#$%^&";
-
-
- -- Non-ISO_646 Strings
-
- Str_3 : String (1..8) := "$123.45" &
- Ada.Characters.Latin_1.Cent_Sign;
- TC_Str_3 : String (1..8) := "$123.45*";
-
- Str_4 : String (1..7) := "abc" &
- Ada.Characters.Latin_1.Cedilla &
- "efg";
- TC_Str_4 : String (1..7) := "abc*efg";
-
- Str_5 : String (1..3) := Ada.Characters.Latin_1.LC_E_Grave &
- Ada.Characters.Latin_1.LC_T &
- Ada.Characters.Latin_1.LC_E_Acute;
- TC_Str_5 : String (1..3) := "*t*";
-
- ---
-
- procedure Validate_Character (Char : in out Character) is
- -- If parameter Char is an ISO_646 character, Char will be returned,
- -- otherwise the following constant will be returned.
- Star : constant Ada.Characters.Handling.ISO_646 :=
- Ada.Characters.Latin_1.Asterisk;
- begin
- if Ada.Characters.Handling.Is_ISO_646(Char) then
- -- Check that the Is_ISO_646 function provide a correct result.
- if Character'Pos(Char) > 127 then
- Report.Failed("Is_ISO_646 returns a false positive result");
- end if;
- else
- if Character'Pos(Char) < 128 then
- Report.Failed("Is_ISO_646 returns a false negative result");
- end if;
- end if;
- -- Cross-check Is_ISO_646 with To_ISO_646. '*' will be returned
- -- if Char is not in the ISO_646 set.
- Char := Ada.Characters.Handling.To_ISO_646(Char, Star);
- exception
- when others => Report.Failed ("Exception in Validate_Character");
- end Validate_Character;
-
- ---
-
- function Validate_String (Str : String) return String is
- New_ISO_646_Char : constant Ada.Characters.Handling.ISO_646 :=
- Ada.Characters.Latin_1.Asterisk;
- begin
- -- Checking that the string contains non-ISO_646 characters at this
- -- point is not strictly necessary, since the function To_ISO_646
- -- will perform that check as part of its processing, and would
- -- return the original string if no modification were necessary.
- -- However, this format allows for the testing of both functions.
-
- if not Ada.Characters.Handling.Is_ISO_646(Str) then
- return Ada.Characters.Handling.To_ISO_646
- (Item => Str, Substitute => New_ISO_646_Char);
- else
- return Str;
- end if;
- exception
- when others => Report.Failed ("Exception in Validate_String");
- return Str;
- end Validate_String;
-
-
- begin
-
- -- Check each character in turn, and if the character does not belong
- -- to the ISO_646 subset of type Character, replace it with an
- -- asterisk. If the character is a member of the subset, the character
- -- should be returned unchanged.
-
- Validate_Character (Char_1);
- Validate_Character (Char_2);
- Validate_Character (Char_3);
- Validate_Character (Char_4);
- Validate_Character (Char_5);
-
- if Char_1 /= TC_Char_1 or Char_2 /= TC_Char_2 or
- Char_3 /= TC_Char_3 or Char_4 /= TC_Char_4 or
- Char_5 /= TC_Char_5
- then
- Report.Failed ("Incorrect ISO_646 character substitution");
- end if;
-
- -- Non-ISO_646 characters
-
- for i in 6..10 loop
- Validate_Character (Char_Array(i));
- end loop;
-
- for i in 6..10 loop
- if Char_Array(i) /= TC_Char then
- Report.Failed ("Character position " & Integer'Image(i) &
- " not replaced correctly");
- end if;
- end loop;
-
-
-
- -- Check each string, and if the string contains characters that do not
- -- belong to the ISO_646 subset of type Character, replace that character
- -- in the string with an asterisk. If the string is comprised of only
- -- ISO_646 characters, the string should be returned unchanged.
-
-
- Str_1 := Validate_String (Str_1);
- Str_2 := Validate_String (Str_2);
- Str_3 := Validate_String (Str_3);
- Str_4 := Validate_String (Str_4);
- Str_5 := Validate_String (Str_5);
-
-
- if Str_1 /= TC_Str_1 or
- Str_2 /= TC_Str_2 or
- Str_3 /= TC_Str_3 or
- Str_4 /= TC_Str_4 or
- Str_5 /= TC_Str_5
- then
- Report.Failed ("Incorrect ISO_646 character substitution in string");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA3003;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa3004.a b/gcc/testsuite/ada/acats/tests/cxa/cxa3004.a
deleted file mode 100644
index ed2023e37e5..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa3004.a
+++ /dev/null
@@ -1,235 +0,0 @@
--- CXA3004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functions defined in package Ada.Characters.Handling
--- for classification of and conversion between Wide_Character and
--- Character values produce correct results when given the appropriate
--- Character and String inputs.
---
--- TEST DESCRIPTION:
--- This test demonstrates the functions defined in package
--- Ada.Characters.Handling which provide for the classification of and
--- conversion between Wide_Characters and Characters, in character
--- variables and strings.
--- Each of the functions is provided with input values that are of the
--- appropriate range. The results of the function processing are
--- subsequently evaluated.
---
--- APPLICABILITY CRITERIA:
--- Applicable to all implementations using the Latin_1 set as the
--- definition of Character.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 27 Dec 94 SAIC Corrected variable names.
---
---!
-
-with Report;
-with Ada.Characters.Handling;
-
-procedure CXA3004 is
-begin
-
- Report.Test ("CXA3004", "Check that the functions defined in package " &
- "Ada.Characters.Handling for classification " &
- "of and conversion between Wide_Character and " &
- "Character values produce correct results " &
- "when given the appropriate Character " &
- "and String inputs");
-
- Test_Block:
- declare
-
- package ACH renames Ada.Characters.Handling;
-
- Char_End : Integer := 255;
- WC_Start : Integer := 256;
- Sub_Char : Character := '*';
-
- Blank : Character := ' ';
- First_Char : Character := Character'First;
- Last_Char : Character := Character'Last;
- F_Char : Character := 'F';
-
-
- First_Wide_Char : Wide_Character := Wide_Character'First;
- Last_Non_Wide_Char : Wide_Character := Wide_Character'Val(Char_End);
- First_Unique_Wide_Char : Wide_Character := Wide_Character'Val(WC_Start);
- Last_Wide_Char : Wide_Character := Wide_Character'Last;
-
- A_String : String (1..3) := First_Char & 'X' & Last_Char;
- A_Wide_String : Wide_String (1..3) := First_Wide_Char &
- ACH.To_Wide_Character('X') &
- ACH.To_Wide_Character(Last_Char);
-
- Unique_Wide_String : Wide_String (1..2) := First_Unique_Wide_Char &
- Last_Wide_Char;
-
- Mixed_Wide_String : Wide_String (1..6) := ACH.To_Wide_Character('A') &
- First_Wide_Char &
- Last_Non_Wide_Char &
- First_Unique_Wide_Char &
- Last_Wide_Char &
- ACH.To_Wide_Character('Z');
-
-
- Basic_Char : Character := 'A';
- Basic_Wide_Char : Wide_Character := 'A';
- Basic_String : String (1..6) := "ABCXYZ";
- Basic_Wide_String : Wide_String (1..6) := "ABCXYZ";
-
- begin
-
-
- -- Function Is_Character
-
-
- if not ACH.Is_Character(First_Wide_Char) then
- Report.Failed ("Incorrect result from Is_Character - 1");
- end if;
-
-
- if ACH.Is_Character(First_Unique_Wide_Char) or
- ACH.Is_Character(Last_Wide_Char)
- then
- Report.Failed ("Incorrect result from Is_Character - 2");
- end if;
-
-
- -- Function Is_String
-
-
- if not ACH.Is_String(A_Wide_String) then
- Report.Failed ("Incorrect result from Is_String - 1");
- end if;
-
-
- if ACH.Is_String(Unique_Wide_String) or
- ACH.Is_String(Mixed_Wide_String)
- then
- Report.Failed ("Incorrect result from Is_String - 2");
- end if;
-
-
- -- Function To_Character
-
-
- -- Use default substitution character in call of To_Character.
-
- if ACH.To_Character(First_Wide_Char) /= First_Char or
- ACH.To_Character(Last_Non_Wide_Char) /= Last_Char
- then
- Report.Failed ("Incorrect result from To_Character - 1");
- end if;
-
-
- -- Provide a substitution character for use with To_Character.
-
- if ACH.To_Character(First_Unique_Wide_Char, Blank) /= Blank or
- ACH.To_Character(First_Unique_Wide_Char, Sub_Char) /= Sub_Char or
- ACH.To_Character(Last_Wide_Char) /= ' ' -- default
- then
- Report.Failed ("Incorrect result from To_Character - 2");
- end if;
-
-
- -- Function To_String
-
-
- if ACH.To_String(A_Wide_String) /= A_String then
- Report.Failed ("Incorrect result from To_String - 1");
- end if;
-
-
- if ACH.To_String(Unique_Wide_String, Sub_Char) /= "**" then
- Report.Failed ("Incorrect result from To_String - 2");
- end if;
-
-
-
- if ACH.To_String(Mixed_Wide_String, Sub_Char) /=
- ('A' & First_Char & Last_Char & "**" & 'Z') or
- ACH.To_String(Mixed_Wide_String, Sub_Char) /=
- (ACH.To_Character(Mixed_Wide_String(1), Sub_Char) &
- ACH.To_Character(Mixed_Wide_String(2), Sub_Char) &
- ACH.To_Character(Mixed_Wide_String(3), Sub_Char) &
- ACH.To_Character(Mixed_Wide_String(4), Sub_Char) &
- ACH.To_Character(Mixed_Wide_String(5), Sub_Char) &
- ACH.To_Character(Mixed_Wide_String(6), Sub_Char))
- then
- Report.Failed ("Incorrect result from To_String - 3");
- end if;
-
-
- -- Function To_Wide_Character
-
-
- if ACH.To_Wide_Character(Basic_Char) /= Basic_Wide_Char then
- Report.Failed ("Incorrect result from To_Wide_Character");
- end if;
-
-
- -- Function To_Wide_String
-
-
- if not (ACH.To_Wide_String(Basic_String) = Basic_Wide_String) then
- Report.Failed ("Incorrect result from To_Wide_String");
- end if;
-
-
- -- Functions Used In Combination
-
- if not ACH.Is_Character (ACH.To_Wide_Character (
- ACH.To_Character(First_Wide_Char)))
- then
- Report.Failed ("Incorrect result from functions in combination - 1");
- end if;
-
-
- if not ACH.Is_String(ACH.To_Wide_String(ACH.To_String(A_Wide_String)))
- then
- Report.Failed ("Incorrect result from functions in combination - 2");
- end if;
-
-
- if ACH.To_String(ACH.To_Wide_Character('A') &
- ACH.To_Wide_Character(F_Char) &
- ACH.To_Wide_Character('Z')) /= "AFZ"
- then
- Report.Failed ("Incorrect result from functions in combination - 3");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA3004;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4001.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4001.a
deleted file mode 100644
index d850acd4a72..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4001.a
+++ /dev/null
@@ -1,218 +0,0 @@
--- CXA4001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the types, operations, and other entities defined within
--- the package Ada.Strings.Maps are available and/or produce correct
--- results.
---
--- TEST DESCRIPTION:
--- This test demonstrates the availability and function of the types and
--- operations defined in package Ada.Strings.Maps. It demonstrates the
--- use of these types and functions as they would be used in common
--- programming practice.
--- Character set creation, assignment, and comparison are evaluated
--- in this test. Each of the functions provided in package
--- Ada.Strings.Maps is utilized in creating or manipulating set objects,
--- and the function results are evaluated for correctness.
--- Character sequences are examined using the functions provided for
--- manipulating objects of this type. Likewise, character maps are
--- created, and their contents evaluated. Exception raising conditions
--- from the function To_Mapping are also created.
--- Note: Throughout this test, the set logical operators are printed in
--- capital letters to enhance their visibility.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Ada.Strings.Maps;
-with Report;
-
-procedure CXA4001 is
-
- use Ada.Strings;
- use type Maps.Character_Set;
-
-begin
-
- Report.Test ("CXA4001", "Check that the types, operations, and other " &
- "entities defined within the package " &
- "Ada.Strings.Maps are available and/or produce " &
- "correct results");
-
- Test_Block:
- declare
-
- MidPoint_Letter : constant := 13;
- Last_Letter : constant := 26;
-
- Vowels : constant Maps.Character_Sequence := "aeiou";
- Quasi_Vowel : constant Character := 'y';
-
- Alphabet : Maps.Character_Sequence (1..Last_Letter);
- Half_Alphabet : Maps.Character_Sequence (1..MidPoint_Letter);
- Inverse_Alphabet : Maps.Character_Sequence (1..Last_Letter);
-
- Alphabet_Set,
- Consonant_Set,
- Vowel_Set,
- Full_Vowel_Set,
- First_Half_Set,
- Second_Half_Set : Maps.Character_Set;
-
- begin
-
- -- Load the alphabet string for use in creating sets.
-
-
- for i in 0..12 loop
- Half_Alphabet(i+1) := Character'Val(Character'Pos('a') + i);
- end loop;
-
- for i in 0..25 loop
- Alphabet(i+1) := Character'Val(Character'Pos('a') + i);
- end loop;
-
-
- -- Initialize a series of Character_Set objects.
-
- Alphabet_Set := Maps.To_Set(Alphabet);
- Vowel_Set := Maps.To_Set(Vowels);
- Full_Vowel_Set := Vowel_Set OR Maps.To_Set(Quasi_Vowel);
- Consonant_Set := Vowel_Set XOR Alphabet_Set;
-
- First_Half_Set := Maps.To_Set(Half_Alphabet);
- Second_Half_Set := Alphabet_Set XOR First_Half_Set;
-
-
- -- Evaluation of Set objects, operators, and functions.
-
- if Alphabet_Set /= (Vowel_Set OR Consonant_Set) then
- Report.Failed("Incorrect set combinations using OR operator");
- end if;
-
-
- for i in 1..5 loop
- if not Maps.Is_In(Vowels(i), Vowel_Set) or
- not Maps.Is_In(Vowels(i), Alphabet_Set) or
- Maps.Is_In(Vowels(i), Consonant_Set)
- then
- Report.Failed("Incorrect function Is_In use with set " &
- "combinations - " & Integer'Image(i));
- end if;
- end loop;
-
-
- if Maps.Is_Subset(Vowel_Set, First_Half_Set) or
- Maps."<="(Vowel_Set, Second_Half_Set) or
- not Maps.Is_Subset(Vowel_Set, Alphabet_Set)
- then
- Report.Failed("Incorrect set evaluation using Is_Subset function");
- end if;
-
-
- if not (Full_Vowel_Set = Maps.To_Set("aeiouy")) then
- Report.Failed("Incorrect result for ""="" set operator");
- end if;
-
-
- if not ((Vowel_Set AND First_Half_Set) OR
- (Full_Vowel_Set AND Second_Half_Set)) = Full_Vowel_Set then
- Report.Failed
- ("Incorrect result for AND, OR, or ""="" set operators");
- end if;
-
-
- if (Alphabet_Set AND Maps.Null_Set) /= Maps.Null_Set or
- (Alphabet_Set OR Maps.Null_Set) /= Alphabet_Set
- then
- Report.Failed("Incorrect result for AND or OR set operators");
- end if;
-
-
- Vowel_Set := Full_Vowel_Set;
- Vowel_Set := Vowel_Set AND (NOT Maps.To_Set(Quasi_Vowel));
-
- if not (Vowels = Maps.To_Sequence(Vowel_Set)) then
- Report.Failed("Incorrect Set to Sequence translation");
- end if;
-
-
- for i in 1..26 loop
- Inverse_Alphabet(i) := Alphabet(27-i);
- end loop;
-
- declare
- Inverse_Map : Maps.Character_Mapping :=
- Maps.To_Mapping(Alphabet, Inverse_Alphabet);
- begin
- if Maps.Value(Maps.Identity, 'b') /= Maps.Value(Inverse_Map,'y')
- then
- Report.Failed("Incorrect Inverse mapping");
- end if;
- end;
-
-
- -- Check that Translation_Error is raised when a character is
- -- repeated in the parameter "From" string.
- declare
- Bad_Map : Maps.Character_Mapping;
- begin
- Bad_Map := Maps.To_Mapping(From => "aa", To => "yz");
- Report.Failed("Exception not raised with repeated character");
- exception
- when Translation_Error => null; -- OK
- when others =>
- Report.Failed("Incorrect exception raised in To_Mapping with " &
- "a repeated character");
- end;
-
-
- -- Check that Translation_Error is raised when the parameters of the
- -- function To_Mapping are of unequal lengths.
- declare
- Bad_Map : Maps.Character_Mapping;
- begin
- Bad_Map := Maps.To_Mapping("abc", "yz");
- Report.Failed("Exception not raised with unequal parameter lengths");
- exception
- when Translation_Error => null; -- OK
- when others =>
- Report.Failed("Incorrect exception raised in To_Mapping with " &
- "unequal parameter lengths");
- end;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4001;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4002.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4002.a
deleted file mode 100644
index 583621ab4d9..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4002.a
+++ /dev/null
@@ -1,182 +0,0 @@
--- CXA4002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Fixed are
--- available, and that they produce correct results. Specifically,
--- check the subprograms Index, "*" (string constructor function),
--- Count, Trim, and Replace_Slice.
---
--- TEST DESCRIPTION:
--- This test demonstrates how certain Fixed string functions are used
--- to eliminate specific substrings from portions of text. A procedure
--- is defined that will take as parameters a source string along with
--- a substring that is to be completely removed from the source string.
--- The source string is parsed using the Index function, and any substring
--- slices are replaced in the source string by a series of X's (based on
--- the length of the substring.)
--- Three lines of text are provided to this procedure, and the resulting
--- substitutions are compared with expected results to validate the
--- string processing.
--- A global accumulator is updated with the number of occurrences of the
--- substring in the source string.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Ada.Strings;
-with Ada.Strings.Fixed;
-with Ada.Strings.Maps;
-with Report;
-
-procedure CXA4002 is
-
-begin
-
- Report.Test ("CXA4002", "Check that the subprograms defined in package " &
- "Ada.Strings.Fixed are available, and that " &
- "they produce correct results");
-
- Test_Block:
- declare
-
- TC_Total : Natural := 0;
- Number_Of_Lines : constant := 3;
-
- type Restricted_Words_Array_Type is array (1..10) of String (1..10);
-
- Restricted_Words : Restricted_Words_Array_Type :=
- (" platoon", " marines ", " Marines ",
- "north ", "south ", " east",
- " beach ", " airport", "airfield ",
- " road ");
-
- subtype Line_Of_Text_Type is String(1..25);
- type Page_Of_Text_Type is array (1..Number_Of_Lines)
- of Line_Of_Text_Type;
-
- Text_Page : Page_Of_Text_Type := ("The platoon of Marines ",
- "moved south on the south ",
- "road to the airfield. ");
-
- TC_Revised_Line_1 : constant String := "The XXXXXXX of XXXXXXX ";
- TC_Revised_Line_2 : constant String := "moved XXXXX on the XXXXX ";
- TC_Revised_Line_3 : constant String := "XXXX to the XXXXXXXX. ";
-
- ---
-
- procedure Censor (Source_String : in out String;
- Pattern_String : in String) is
-
- -- Create a replacement string that is the same length as the
- -- pattern string being removed.
- Replacement : constant String := -- "*"
- Ada.Strings.Fixed."*"(Pattern_String'Length, 'X');
-
- Going : Ada.Strings.Direction := Ada.Strings.Forward;
- Map : constant Ada.Strings.Maps.Character_Mapping :=
- Ada.Strings.Maps.Identity;
- Start_Pos,
- Index : Natural := Source_String'First;
-
-
- begin -- Censor
-
- -- Accumulate count of total replacement operations.
-
- TC_Total := TC_Total + -- Count
- Ada.Strings.Fixed.Count (Source => Source_String,
- Pattern => Pattern_String,
- Mapping => Map);
- loop
-
- Index := Ada.Strings.Fixed.Index -- Index
- (Source_String(Start_Pos..Source_String'Last),
- Pattern_String,
- Going,
- Map);
-
- exit when Index = 0; -- No matches, exit loop.
-
- -- if a match was found, modify the substring.
- Ada.Strings.Fixed.Replace_Slice -- Replace_Slice
- (Source_String,
- Index,
- Index + Pattern_String'Length - 1,
- Replacement);
- Start_Pos := Index + Pattern_String'Length;
-
- end loop;
-
- end Censor;
-
-
- begin
-
- -- Invoke Censor subprogram to cleanse text.
- -- Loop through each line of text, and check for the presence of each
- -- restricted word.
- -- Use the Trim function to eliminate leading or trailing blanks from
- -- the restricted word parameters.
-
- for Line in 1..Number_Of_Lines loop
- for Word in Restricted_Words'Range loop
- Censor (Text_Page(Line),
- Ada.Strings.Fixed.Trim(Restricted_Words(Word), -- Trim
- Ada.Strings.Both));
- end loop;
- end loop;
-
-
- -- Validate results.
-
- if TC_Total /= 6 then
- Report.Failed ("Incorrect number of substitutions performed");
- end if;
-
- if Text_Page(1) /= TC_Revised_Line_1 then
- Report.Failed ("Incorrect substitutions on Line 1");
- end if;
-
- if Text_Page(2) /= TC_Revised_Line_2 then
- Report.Failed ("Incorrect substitutions on Line 2");
- end if;
-
- if Text_Page(3) /= TC_Revised_Line_3 then
- Report.Failed ("Incorrect substitutions on Line 3");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4002;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4003.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4003.a
deleted file mode 100644
index cd57a929616..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4003.a
+++ /dev/null
@@ -1,326 +0,0 @@
--- CXA4003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Fixed are
--- available, and that they produce correct results. Specifically,
--- check the subprograms Index, Index_Non_Blank, Head, Tail, Translate,
--- Find_Token, Move, Overwrite, and Replace_Slice.
---
--- TEST DESCRIPTION:
--- This test demonstrates how certain fixed string operations could be
--- used in string information processing. A procedure is defined that
--- will extract portions of a 50 character string that correspond to
--- certain data items (i.e., name, address, state, zip code). These
--- parsed items will then be added to the appropriate fields of data
--- base elements. These data base elements are then compared for
--- accuracy against a similar set of predefined data base elements.
---
--- A variety of fixed string processing subprograms are used in this
--- test. Each parsing operation uses a different combination
--- of the available subprograms to accomplish the same goal, therefore
--- continuity of approach to string parsing is not seen in this test.
--- However, a wide variety of possible approaches are demonstrated, while
--- exercising a large number of the total predefined subprograms of
--- package Ada.Strings.Fixed.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Ada.Strings.Fixed;
-with Ada.Strings.Maps;
-with Report;
-
-procedure CXA4003 is
-
-begin
-
- Report.Test ("CXA4003", "Check that the subprograms defined in package " &
- "Ada.Strings.Fixed are available, and that they " &
- "produce correct results");
-
- Test_Block:
- declare
-
- Number_Of_Info_Strings : constant Natural := 3;
- DB_Size : constant Natural := Number_Of_Info_Strings;
- Count : Natural := 0;
- Finished_Processing : Boolean := False;
- Blank_String : constant String := " ";
-
- subtype Info_String_Type is String (1..50);
- type Info_String_Storage_Type is
- array (1..Number_Of_Info_Strings) of Info_String_Type;
-
-
- subtype Name_Type is String (1..10);
- subtype Street_Number_Type is String (1..5);
- subtype Street_Name_Type is String (1..10);
- subtype City_Type is String (1..10);
- subtype State_Type is String (1..2);
- subtype Zip_Code_Type is String (1..5);
-
- type Data_Base_Element_Type is
- record
- Name : Name_Type := (others => ' ');
- Street_Number : Street_Number_Type := (others => ' ');
- Street_Name : Street_Name_Type := (others => ' ');
- City : City_Type := (others => ' ');
- State : State_Type := (others => ' ');
- Zip_Code : Zip_Code_Type := (others => ' ');
- end record;
-
- type Data_Base_Type is array (1..DB_Size) of Data_Base_Element_Type;
-
- Data_Base : Data_Base_Type;
-
- ---
-
- Info_String_1 : Info_String_Type :=
- "Joe_Jones 123 Sixth_St San_Diego CA 98765";
-
- Info_String_2 : Info_String_Type :=
- "Sam_Smith 56789 S._Seventh Carlsbad CA 92177";
-
- Info_String_3 : Info_String_Type :=
- "Jane_Brown 1219 Info_Lane Tuscon AZ 85643";
-
-
- Info_Strings : Info_String_Storage_Type := (1 => Info_String_1,
- 2 => Info_String_2,
- 3 => Info_String_3);
-
-
-
- TC_DB_Element_1 : Data_Base_Element_Type :=
- ("Joe Jones ", "123 ", "Sixth St ", "San Diego ", "CA", "98765");
-
- TC_DB_Element_2 : Data_Base_Element_Type :=
- ("Sam Smith ", "56789", "S. Seventh", "Carlsbad ", "CA", "92177");
-
- TC_DB_Element_3 : Data_Base_Element_Type :=
- ("Jane Brown", "1219 ", "Info Lane ", "Tuscon ", "AZ", "85643");
-
- TC_Data_Base : Data_Base_Type := (TC_DB_Element_1,
- TC_DB_Element_2,
- TC_DB_Element_3);
-
- ---
-
-
- procedure Store_Information
- (Info_String : in Info_String_Type;
- DB_Record : in out Data_Base_Element_Type) is
-
- package AS renames Ada.Strings;
- use type AS.Maps.Character_Set;
-
- UnderScore : AS.Maps.Character_Sequence := "_";
- Blank : AS.Maps.Character_Sequence := " ";
-
- Start,
- Stop : Natural := 0;
-
- Underscore_to_Blank_Map : constant AS.Maps.Character_Mapping :=
- AS.Maps.To_Mapping(From => UnderScore,
- To => Blank);
-
- Numeric_Set : constant AS.Maps.Character_Set :=
- AS.Maps.To_Set("0123456789");
-
- Cal : constant AS.Maps.Character_Sequence := "CA";
- California_Set : constant AS.Maps.Character_Set :=
- AS.Maps.To_Set(Cal);
- Arizona_Set : constant AS.Maps.Character_Set :=
- AS.Maps.To_Set("AZ");
- Nevada_Set : constant AS.Maps.Character_Set :=
- AS.Maps.To_Set("NV");
-
- begin
-
- -- Find the starting position of the name field (first non-blank),
- -- then, from that position, find the end of the name field (first
- -- blank).
-
- Start := AS.Fixed.Index_Non_Blank(Info_String);
- Stop := AS.Fixed.Index (Info_String(Start..Info_String'Length),
- AS.Maps.To_Set(' '),
- AS.Inside,
- AS.Forward) - 1 ;
-
- -- Store the name field in the data base element field for "Name".
-
- DB_Record.Name := AS.Fixed.Head(Info_String(1..Stop),
- DB_Record.Name'Length);
-
- -- Replace any underscore characters in the name field
- -- that were used to separate first/middle/last names.
-
- AS.Fixed.Translate (DB_Record.Name, Underscore_to_Blank_Map);
-
-
- -- Continue the extraction process; now find the position of
- -- the street number in the string.
-
- Start := Stop + 1;
-
- AS.Fixed.Find_Token(Info_String(Start..Info_String'Length),
- Numeric_Set,
- AS.Inside,
- Start,
- Stop);
-
- -- Store the street number field in the appropriate data base
- -- element.
- -- No modification of the default parameters of procedure Move
- -- is required.
-
- AS.Fixed.Move(Source => Info_String(Start..Stop),
- Target => DB_Record.Street_Number);
-
-
- -- Continue the extraction process; find the street name in the
- -- info string. Skip blanks to the start of the street name, then
- -- search for the index of the next blank character in the string.
-
- Start :=
- AS.Fixed.Index_Non_Blank(Info_String(Stop+1..Info_String'Length));
-
- Stop :=
- AS.Fixed.Index(Info_String(Start..Info_String'Length),
- Blank_String) - 1;
-
- -- Store the street name in the appropriate data base element field.
-
- AS.Fixed.Overwrite(DB_Record.Street_Name,
- 1,
- Info_String(Start..Stop));
-
- -- Replace any underscore characters in the street name field
- -- that were used as word separation.
-
- DB_Record.Street_Name := AS.Fixed.Translate(DB_Record.Street_Name,
- Underscore_to_Blank_Map);
-
-
- -- Continue the extraction; remove the city name from the string.
-
- Start :=
- AS.Fixed.Index_Non_Blank(Info_String(Stop+1..Info_String'Length));
-
- Stop :=
- AS.Fixed.Index(Info_String(Start..Info_String'Length),
- Blank_String) - 1;
-
- -- Store the city name field in the appropriate data base element.
-
- AS.Fixed.Replace_Slice(DB_Record.City,
- 1,
- DB_Record.City'Length,
- Info_String(Start..Stop));
-
- -- Replace any underscore characters in the city name field
- -- that were used as word separation.
-
- AS.Fixed.Translate (DB_Record.City, Underscore_to_Blank_Map);
-
-
- -- Continue the extraction; remove the state identifier from the
- -- info string.
-
- Start := Stop + 1;
-
- AS.Fixed.Find_Token(Info_String(Start..Info_String'Length),
- AS.Maps."OR"(California_Set,
- AS.Maps."OR"(Nevada_Set, Arizona_Set)),
- AS.Inside,
- Start,
- Stop);
-
- -- Store the state indicator into the data base element.
-
- AS.Fixed.Move(Source => Info_String(Start..Stop),
- Target => DB_Record.State,
- Drop => Ada.Strings.Right,
- Justify => Ada.Strings.Left,
- Pad => AS.Space);
-
-
- -- Continue the extraction process; remove the final data item in
- -- the info string, the zip code, and place it into the
- -- corresponding data base element.
-
- DB_Record.Zip_Code := AS.Fixed.Tail(Info_String,
- DB_Record.Zip_Code'Length);
-
- exception
- when AS.Length_Error =>
- Report.Failed ("Length_Error raised in procedure");
- when AS.Pattern_Error =>
- Report.Failed ("Pattern_Error raised in procedure");
- when AS.Translation_Error =>
- Report.Failed ("Translation_Error raised in procedure");
- when others =>
- Report.Failed ("Exception raised in procedure");
- end Store_Information;
-
-
- begin
-
- -- Loop thru the information strings, extract the name and address
- -- information, place this info into elements of the data base.
-
- while not Finished_Processing loop
-
- Count := Count + 1;
-
- Store_Information (Info_Strings(Count), Data_Base(Count));
-
- Finished_Processing := (Count = Number_Of_Info_Strings);
-
- end loop;
-
-
- -- Verify that the string processing was successful.
-
- for i in 1..DB_Size loop
- if Data_Base(i) /= TC_Data_Base(i) then
- Report.Failed
- ("Data processing error on record " & Integer'Image(i));
- end if;
- end loop;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4003;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4004.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4004.a
deleted file mode 100644
index ec11f7d50f9..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4004.a
+++ /dev/null
@@ -1,431 +0,0 @@
--- CXA4004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Fixed are
--- available, and that they produce correct results. Specifically, check
--- the subprograms Count, Find_Token, Index, Index_Non_Blank, and Move.
---
--- TEST DESCRIPTION:
--- This test, when combined with tests CXA4002,3, and 5 will provide
--- thorough coverage of the functionality found in Ada.Strings.Fixed.
--- This test contains many small, specific test cases, situations that
--- although common in user environments, are often difficult to generate
--- in large numbers in a application-based test.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Apr 95 SAIC Corrected subtest for Move, Drop=Right.
---
---!
-
-with Report;
-with Ada.Strings;
-with Ada.Strings.Fixed;
-with Ada.Strings.Maps;
-
-procedure CXA4004 is
-begin
-
- Report.Test("CXA4004", "Check that the subprograms defined in " &
- "package Ada.Strings.Fixed are available, " &
- "and that they produce correct results");
-
- Test_Block:
- declare
-
- package ASF renames Ada.Strings.Fixed;
- package Maps renames Ada.Strings.Maps;
-
- Result_String : String(1..10) := (others => Ada.Strings.Space);
-
- Source_String1 : String(1..5) := "abcde"; -- odd length string
- Source_String2 : String(1..6) := "abcdef"; -- even length string
- Source_String3 : String(1..12) := "abcdefghijkl";
- Source_String4 : String(1..12) := "abcdefghij "; -- last two ch pad
- Source_String5 : String(1..12) := " cdefghijkl"; -- first two ch pad
- Source_String6 : String(1..12) := "abcdefabcdef";
-
- Location : Natural := 0;
- Slice_Start : Positive;
- Slice_End,
- Slice_Count : Natural := 0;
-
- CD_Set : Maps.Character_Set := Maps.To_Set("cd");
- ABCD_Set : Maps.Character_Set := Maps.To_Set("abcd");
- A_to_F_Set : Maps.Character_Set := Maps.To_Set("abcdef");
-
- CD_to_XY_Map : Maps.Character_Mapping :=
- Maps.To_Mapping(From => "cd", To => "xy");
-
- begin
-
- -- Procedure Move
-
- -- Evaluate the Procedure Move with various combinations of
- -- parameters.
-
- -- Justify = Left (default case)
-
- ASF.Move(Source => Source_String1, -- "abcde"
- Target => Result_String);
-
- if Result_String /= "abcde " then
- Report.Failed("Incorrect result from Move with Justify = Left");
- end if;
-
- -- Justify = Right
-
- ASF.Move(Source => Source_String2, -- "abcdef"
- Target => Result_String,
- Drop => Ada.Strings.Error,
- Justify => Ada.Strings.Right);
-
- if Result_String /= " abcdef" then
- Report.Failed("Incorrect result from Move with Justify = Right");
- end if;
-
- -- Justify = Center (two cases, odd and even pad lengths)
-
- ASF.Move(Source_String1, -- "abcde"
- Result_String,
- Ada.Strings.Error,
- Ada.Strings.Center,
- 'x'); -- non-default padding.
-
- if Result_String /= "xxabcdexxx" then -- Unequal padding added right
- Report.Failed("Incorrect result from Move with Justify = Center-1");
- end if;
-
- ASF.Move(Source_String2, -- "abcdef"
- Result_String,
- Ada.Strings.Error,
- Ada.Strings.Center);
-
- if Result_String /= " abcdef " then -- Equal padding added on L/R.
- Report.Failed("Incorrect result from Move with Justify = Center-2");
- end if;
-
- -- When the source string is longer than the target string, several
- -- cases can be examined, with the results depending on the value of
- -- the Drop parameter.
-
- -- Drop = Left
-
- ASF.Move(Source => Source_String3, -- "abcdefghijkl"
- Target => Result_String,
- Drop => Ada.Strings.Left);
-
- if Result_String /= "cdefghijkl" then
- Report.Failed("Incorrect result from Move with Drop = Left");
- end if;
-
- -- Drop = Right
-
- ASF.Move(Source_String3, Result_String, Ada.Strings.Right);
-
- if Result_String /= "abcdefghij" then
- Report.Failed("Incorrect result from Move with Drop = Right");
- end if;
-
- -- Drop = Error
- -- The effect in this case depends on the value of the justify
- -- parameter, and on whether any characters in Source other than
- -- Pad would fail to be copied.
-
- -- Drop = Error, Justify = Left, right overflow characters are pad.
-
- ASF.Move(Source => Source_String4, -- "abcdefghij "
- Target => Result_String,
- Drop => Ada.Strings.Error,
- Justify => Ada.Strings.Left);
-
- if not(Result_String = "abcdefghij") then -- leftmost 10 characters
- Report.Failed("Incorrect result from Move with Drop = Error - 1");
- end if;
-
- -- Drop = Error, Justify = Right, left overflow characters are pad.
-
- ASF.Move(Source_String5, -- " cdefghijkl"
- Result_String,
- Ada.Strings.Error,
- Ada.Strings.Right);
-
- if Result_String /= "cdefghijkl" then -- rightmost 10 characters
- Report.Failed("Incorrect result from Move with Drop = Error - 2");
- end if;
-
- -- In other cases of Drop=Error, Length_Error is propagated, such as:
-
- begin
-
- ASF.Move(Source_String3, -- 12 characters, no Pad.
- Result_String, -- 10 characters
- Ada.Strings.Error,
- Ada.Strings.Left);
-
- Report.Failed("Length_Error not raised by Move - 1");
-
- exception
- when Ada.Strings.Length_Error => null; -- OK
- when others =>
- Report.Failed("Incorrect exception raised by Move - 1");
- end;
-
-
-
- -- Function Index
- -- (Other usage examples of this function found in CXA4002-3.)
- -- Check when the pattern is not found in the source.
-
- if ASF.Index("abcdef", "gh") /= 0 or
- ASF.Index("abcde", "abcdef") /= 0 or -- pattern > source
- ASF.Index("xyz",
- "abcde",
- Ada.Strings.Backward) /= 0 or
- ASF.Index("", "ab") /= 0 or -- null source string.
- ASF.Index("abcde", " ") /= 0 -- blank pattern.
- then
- Report.Failed("Incorrect result from Index, no pattern match");
- end if;
-
- -- Check that Pattern_Error is raised when the pattern is the
- -- null string.
- begin
- Location := ASF.Index(Source_String6, -- "abcdefabcdef"
- "", -- null pattern string.
- Ada.Strings.Forward);
- Report.Failed("Pattern_Error not raised by Index");
- exception
- when Ada.Strings.Pattern_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Index, null pattern");
- end;
-
- -- Use the search direction "backward" to locate the particular
- -- pattern within the source string.
-
- Location := ASF.Index(Source_String6, -- "abcdefabcdef"
- "de", -- slice 4..5, 10..11
- Ada.Strings.Backward); -- search from right end.
-
- if Location /= 10 then
- Report.Failed("Incorrect result from Index going Backward");
- end if;
-
- -- Using the version of Index testing character set membership,
- -- check combinations of forward/backward, inside/outside parameter
- -- configurations.
-
- if ASF.Index(Source => Source_String1, -- "abcde"
- Set => CD_Set,
- Test => Ada.Strings.Inside,
- Going => Ada.Strings.Forward) /= 3 or -- 'c' at pos 3.
- ASF.Index(Source_String6, -- "abcdefabcdef"
- CD_Set,
- Ada.Strings.Outside,
- Ada.Strings.Backward) /= 12 or -- 'f' at position 12
- ASF.Index(Source_String6, -- "abcdefabcdef"
- CD_Set,
- Ada.Strings.Inside,
- Ada.Strings.Backward) /= 10 or -- 'd' at position 10
- ASF.Index("cdcdcdcdacdcdcdcd",
- CD_Set,
- Ada.Strings.Outside,
- Ada.Strings.Forward) /= 9 -- 'a' at position 9
- then
- Report.Failed("Incorrect result from function Index for sets - 1");
- end if;
-
- -- Additional interesting uses/combinations using Index for sets.
-
- if ASF.Index("cd", -- same size, str-set
- CD_Set,
- Ada.Strings.Inside,
- Ada.Strings.Forward) /= 1 or -- 'c' at position 1
- ASF.Index("abcd", -- same size, str-set,
- Maps.To_Set("efgh"), -- different contents.
- Ada.Strings.Outside,
- Ada.Strings.Forward) /= 1 or
- ASF.Index("abccd", -- set > string
- Maps.To_Set("acegik"),
- Ada.Strings.Inside,
- Ada.Strings.Backward) /= 4 or -- 'c' at position 4
- ASF.Index("abcde",
- Maps.Null_Set) /= 0 or
- ASF.Index("", -- Null string.
- CD_Set) /= 0 or
- ASF.Index("abc ab", -- blank included
- Maps.To_Set("e "), -- in string and set.
- Ada.Strings.Inside,
- Ada.Strings.Backward) /= 4 -- blank in string.
- then
- Report.Failed("Incorrect result from function Index for sets - 2");
- end if;
-
-
-
- -- Function Index_Non_Blank.
- -- (Other usage examples of this function found in CXA4002-3.)
-
-
- if ASF.Index_Non_Blank(Source => Source_String4, -- "abcdefghij "
- Going => Ada.Strings.Backward) /= 10 or
- ASF.Index_Non_Blank("abc def ghi jkl ",
- Ada.Strings.Backward) /= 15 or
- ASF.Index_Non_Blank(" abcdef") /= 3 or
- ASF.Index_Non_Blank(" ") /= 0
- then
- Report.Failed("Incorrect result from Index_Non_Blank");
- end if;
-
-
-
- -- Function Count
- -- (Other usage examples of this function found in CXA4002-3.)
-
- if ASF.Count("abababa", "aba") /= 2 or
- ASF.Count("abababa", "ab" ) /= 3 or
- ASF.Count("babababa", "ab") /= 3 or
- ASF.Count("abaabaaba", "aba") /= 3 or
- ASF.Count("xxxxxxxxxxxxxxxxxxxy", "xy") /= 1 or
- ASF.Count("xxxxxxxxxxxxxxxxxxxx", "x") /= 20
- then
- Report.Failed("Incorrect result from Function Count");
- end if;
-
- -- Determine the number of slices of Source that when mapped to a
- -- non-identity map, match the pattern string.
-
- Slice_Count := ASF.Count(Source_String6, -- "abcdefabcdef"
- "xy",
- CD_to_XY_Map); -- maps 'c' to 'x', 'd' to 'y'
-
- if Slice_Count /= 2 then -- two slices "xy" in "mapped" Source_String6
- Report.Failed("Incorrect result from Count with non-identity map");
- end if;
-
- -- If the pattern supplied to Function Count is the null string, then
- -- Pattern_Error is propagated.
-
- declare
- The_Null_String : constant String := "";
- begin
- Slice_Count := ASF.Count(Source_String6, The_Null_String);
- Report.Failed("Pattern_Error not raised by Function Count");
- exception
- when Ada.Strings.Pattern_Error => null; -- OK
- when others =>
- Report.Failed("Incorrect exception from Count with null pattern");
- end;
-
-
- -- Function Count returning the number of characters in a particular
- -- set that are found in source string.
-
- if ASF.Count(Source_String6, CD_Set) /= 4 then -- 2 'c' and 'd' chars.
- Report.Failed("Incorrect result from Count with set");
- end if;
-
-
-
- -- Function Find_Token.
- -- (Other usage examples of this function found in CXA4002-3.)
-
- ASF.Find_Token(Source => Source_String6, -- First slice with no
- Set => ABCD_Set, -- 'a', 'b', 'c', or 'd'
- Test => Ada.Strings.Outside, -- is "ef" at 5..6.
- First => Slice_Start,
- Last => Slice_End);
-
- if Slice_Start /= 5 or Slice_End /= 6 then
- Report.Failed("Incorrect result from Find_Token - 1");
- end if;
-
- -- If no appropriate slice is contained by the source string, then the
- -- value returned in Last is zero, and the value in First is
- -- Source'First.
-
- ASF.Find_Token(Source_String6, -- "abcdefabcdef"
- A_to_F_Set, -- Set of characters 'a' thru 'f'.
- Ada.Strings.Outside, -- No characters outside this set.
- Slice_Start,
- Slice_End);
-
- if Slice_Start /= Source_String6'First or Slice_End /= 0 then
- Report.Failed("Incorrect result from Find_Token - 2");
- end if;
-
- -- Additional testing of Find_Token.
-
- ASF.Find_Token("eabcdabcddcab",
- ABCD_Set,
- Ada.Strings.Inside,
- Slice_Start,
- Slice_End);
-
- if Slice_Start /= 2 or Slice_End /= 13 then
- Report.Failed("Incorrect result from Find_Token - 3");
- end if;
-
- ASF.Find_Token("efghijklabcdabcd",
- ABCD_Set,
- Ada.Strings.Outside,
- Slice_Start,
- Slice_End);
-
- if Slice_Start /= 1 or Slice_End /= 8 then
- Report.Failed("Incorrect result from Find_Token - 4");
- end if;
-
- ASF.Find_Token("abcdefgabcdabcd",
- ABCD_Set,
- Ada.Strings.Outside,
- Slice_Start,
- Slice_End);
-
- if Slice_Start /= 5 or Slice_End /= 7 then
- Report.Failed("Incorrect result from Find_Token - 5");
- end if;
-
- ASF.Find_Token("abcdcbabcdcba",
- ABCD_Set,
- Ada.Strings.Inside,
- Slice_Start,
- Slice_End);
-
- if Slice_Start /= 1 or Slice_End /= 13 then
- Report.Failed("Incorrect result from Find_Token - 6");
- end if;
-
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4004;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4005.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4005.a
deleted file mode 100644
index d61f853ca0e..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4005.a
+++ /dev/null
@@ -1,683 +0,0 @@
--- CXA4005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Fixed are
--- available, and that they produce correct results. Specifically,
--- check the subprograms Delete, Head, Insert, Overwrite, Replace_Slice,
--- Tail, Trim, and "*".
---
--- TEST DESCRIPTION:
--- This test, when combined with tests CXA4002-4 will provide coverage
--- of the functionality found in Ada.Strings.Fixed.
--- This test contains many small, specific test cases, situations that
--- although common in user environments, are often difficult to generate
--- in large numbers in a application-based test. They represent
--- individual usage paradigms in-the-small.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 11 Apr 95 SAIC Corrected acceptance conditions of certain
--- subtests.
--- 06 Nov 95 SAIC Fixed bugs for ACVC 2.0.1.
--- 22 Feb 01 PHL Check that the lower bound of the result is 1.
--- 13 Mar 01 RLB Fixed a couple of ACATS style violations;
--- removed pointless checks of procedures.
--- Added checks of other functions. These changes
--- were made to test Defect Report 8652/0049, as
--- reflected in Technical Corrigendum 1.
---
---!
-
-with Report;
-with Ada.Strings;
-with Ada.Strings.Fixed;
-with Ada.Strings.Maps;
-
-procedure CXA4005 is
-
- type TC_Name_Holder is access String;
- Name : TC_Name_Holder;
-
- function TC_Check (S : String) return String is
- begin
- if S'First /= 1 then
- Report.Failed ("Lower bound of result of function " & Name.all &
- " is" & Integer'Image (S'First));
- end if;
- return S;
- end TC_Check;
-
- procedure TC_Set_Name (N : String) is
- begin
- Name := new String'(N);
- end TC_Set_Name;
-
-begin
-
- Report.Test("CXA4005", "Check that the subprograms defined in " &
- "package Ada.Strings.Fixed are available, " &
- "and that they produce correct results");
-
- Test_Block:
- declare
-
- package ASF renames Ada.Strings.Fixed;
- package Maps renames Ada.Strings.Maps;
-
- Result_String,
- Delete_String,
- Insert_String,
- Trim_String,
- Overwrite_String : String(1..10) := (others => Ada.Strings.Space);
-
- Source_String1 : String(1..5) := "abcde"; -- odd length string
- Source_String2 : String(1..6) := "abcdef"; -- even length string
- Source_String3 : String(1..12) := "abcdefghijkl";
- Source_String4 : String(1..12) := "abcdefghij "; -- last two ch pad
- Source_String5 : String(1..12) := " cdefghijkl"; -- first two ch pad
- Source_String6 : String(1..12) := "abcdefabcdef";
-
- Location : Natural := 0;
- Slice_Start : Positive;
- Slice_End,
- Slice_Count : Natural := 0;
-
- CD_Set : Maps.Character_Set := Maps.To_Set("cd");
- X_Set : Maps.Character_Set := Maps.To_Set('x');
- ABCD_Set : Maps.Character_Set := Maps.To_Set("abcd");
- A_to_F_Set : Maps.Character_Set := Maps.To_Set("abcdef");
-
- CD_to_XY_Map : Maps.Character_Mapping :=
- Maps.To_Mapping(From => "cd", To => "xy");
-
- begin
-
- -- Procedure Replace_Slice
- -- The functionality of this procedure
- -- is similar to procedure Move, and
- -- is tested here in the same manner, evaluated
- -- with various combinations of parameters.
-
- -- Index_Error propagation when Low > Source'Last + 1
-
- begin
- ASF.Replace_Slice(Result_String,
- Result_String'Last + 2, -- should raise exception
- Result_String'Last,
- "xxxxxxx");
- Report.Failed("Index_Error not raised by Replace_Slice - 1");
- exception
- when Ada.Strings.Index_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception from Replace_Slice - 1");
- end;
-
- -- Index_Error propagation when High < Source'First - 1
-
- begin
- ASF.Replace_Slice(Result_String(5..10),
- 5,
- 3, -- should raise exception since < 'First - 1.
- "xxxxxxx");
- Report.Failed("Index_Error not raised by Replace_Slice - 2");
- exception
- when Ada.Strings.Index_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception from Replace_Slice - 2");
- end;
-
- -- Justify = Left (default case)
-
- Result_String := "XXXXXXXXXX";
-
- ASF.Replace_Slice(Source => Result_String,
- Low => 1,
- High => 10,
- By => Source_String1); -- "abcde"
-
- if Result_String /= "abcde " then
- Report.Failed("Incorrect result from Replace_Slice - Justify = Left");
- end if;
-
- -- Justify = Right
-
- ASF.Replace_Slice(Source => Result_String,
- Low => 1,
- High => Result_String'Last,
- By => Source_String2, -- "abcdef"
- Drop => Ada.Strings.Error,
- Justify => Ada.Strings.Right);
-
- if Result_String /= " abcdef" then
- Report.Failed("Incorrect result from Replace_Slice - Justify=Right");
- end if;
-
- -- Justify = Center (two cases, odd and even pad lengths)
-
- ASF.Replace_Slice(Result_String,
- 1,
- Result_String'Last,
- Source_String1, -- "abcde"
- Ada.Strings.Error,
- Ada.Strings.Center,
- 'x'); -- non-default padding.
-
- if Result_String /= "xxabcdexxx" then -- Unequal padding added right
- Report.Failed("Incorrect result, Replace_Slice - Justify=Center - 1");
- end if;
-
- ASF.Replace_Slice(Result_String,
- 1,
- Result_String'Last,
- Source_String2, -- "abcdef"
- Ada.Strings.Error,
- Ada.Strings.Center);
-
- if Result_String /= " abcdef " then -- Equal padding added on L/R.
- Report.Failed("Incorrect result from Replace_Slice with " &
- "Justify = Center - 2");
- end if;
-
- -- When the source string is longer than the target string, several
- -- cases can be examined, with the results depending on the value of
- -- the Drop parameter.
-
- -- Drop = Left
-
- ASF.Replace_Slice(Result_String,
- 1,
- Result_String'Last,
- Source_String3, -- "abcdefghijkl"
- Drop => Ada.Strings.Left);
-
- if Result_String /= "cdefghijkl" then
- Report.Failed("Incorrect result from Replace_Slice - Drop=Left");
- end if;
-
- -- Drop = Right
-
- ASF.Replace_Slice(Result_String,
- 1,
- Result_String'Last,
- Source_String3, -- "abcdefghijkl"
- Ada.Strings.Right);
-
- if Result_String /= "abcdefghij" then
- Report.Failed("Incorrect result, Replace_Slice with Drop=Right");
- end if;
-
- -- Drop = Error
-
- -- The effect in this case depends on the value of the justify
- -- parameter, and on whether any characters in Source other than
- -- Pad would fail to be copied.
-
- -- Drop = Error, Justify = Left, right overflow characters are pad.
-
- ASF.Replace_Slice(Result_String,
- 1,
- Result_String'Last,
- Source_String4, -- "abcdefghij "
- Drop => Ada.Strings.Error,
- Justify => Ada.Strings.Left);
-
- if not(Result_String = "abcdefghij") then -- leftmost 10 characters
- Report.Failed("Incorrect result, Replace_Slice - Drop = Error - 1");
- end if;
-
- -- Drop = Error, Justify = Right, left overflow characters are pad.
-
- ASF.Replace_Slice(Source => Result_String,
- Low => 1,
- High => Result_String'Last,
- By => Source_String5, -- " cdefghijkl"
- Drop => Ada.Strings.Error,
- Justify => Ada.Strings.Right);
-
- if Result_String /= "cdefghijkl" then -- rightmost 10 characters
- Report.Failed("Incorrect result, Replace_Slice - Drop = Error - 2");
- end if;
-
- -- In other cases of Drop=Error, Length_Error is propagated, such as:
-
- begin
-
- ASF.Replace_Slice(Source => Result_String,
- Low => 1,
- High => Result_String'Last,
- By => Source_String3, -- "abcdefghijkl"
- Drop => Ada.Strings.Error);
-
- Report.Failed("Length_Error not raised by Replace_Slice - 1");
-
- exception
- when Ada.Strings.Length_Error => null; -- OK
- when others =>
- Report.Failed("Incorrect exception from Replace_Slice - 3");
- end;
-
-
- -- Function Replace_Slice
-
- TC_Set_Name ("Replace_Slice");
-
- if TC_Check (ASF.Replace_Slice("abcde", 3, 3, "x"))
- /= "abxde" or -- High = Low
- TC_Check (ASF.Replace_Slice("abc", 2, 3, "xyz")) /= "axyz" or
- TC_Check (ASF.Replace_Slice("abcd", 4, 1, "xy"))
- /= "abcxyd" or -- High < Low
- TC_Check (ASF.Replace_Slice("abc", 2, 3, "x")) /= "ax" or
- TC_Check (ASF.Replace_Slice("a", 1, 1, "z")) /= "z"
- then
- Report.Failed("Incorrect result from Function Replace_Slice - 1");
- end if;
-
- if TC_Check (ASF.Replace_Slice("abcde", 5, 5, "z"))
- /= "abcdz" or -- By length 1
- TC_Check (ASF.Replace_Slice("abc", 1, 3, "xyz"))
- /= "xyz" or -- High > Low
- TC_Check (ASF.Replace_Slice("abc", 3, 2, "xy"))
- /= "abxyc" or -- insert
- TC_Check (ASF.Replace_Slice("a", 1, 1, "xyz")) /= "xyz"
- then
- Report.Failed("Incorrect result from Function Replace_Slice - 2");
- end if;
-
-
-
- -- Function Insert.
-
- TC_Set_Name ("Insert");
-
- declare
- New_String : constant String :=
- TC_Check (
- ASF.Insert(Source => Source_String1(2..5), -- "bcde"
- Before => 3,
- New_Item => Source_String2)); -- "abcdef"
- begin
- if New_String /= "babcdefcde" then
- Report.Failed("Incorrect result from Function Insert - 1");
- end if;
- end;
-
- if TC_Check (ASF.Insert("a", 1, "z")) /= "za" or
- TC_Check (ASF.Insert("abc", 3, "")) /= "abc" or
- TC_Check (ASF.Insert("abc", 1, "z")) /= "zabc"
- then
- Report.Failed("Incorrect result from Function Insert - 2");
- end if;
-
- begin
- if TC_Check (ASF.Insert(Source => Source_String1(2..5), -- "bcde"
- Before => Report.Ident_Int(7),
- New_Item => Source_String2)) -- "abcdef"
- /= "babcdefcde" then
- Report.Failed("Index_Error not raised by Insert - 3A");
- else
- Report.Failed("Index_Error not raised by Insert - 3B");
- end if;
- exception
- when Ada.Strings.Index_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception from Insert - 3");
- end;
-
-
- -- Procedure Insert
-
- -- Drop = Right
-
- ASF.Insert(Source => Insert_String,
- Before => 6,
- New_Item => Source_String2, -- "abcdef"
- Drop => Ada.Strings.Right);
-
- if Insert_String /= " abcde" then -- last char of New_Item dropped.
- Report.Failed("Incorrect result from Insert with Drop = Right");
- end if;
-
- -- Drop = Left
-
- ASF.Insert(Source => Insert_String, -- 10 char string
- Before => 2, -- 9 chars, 2..10 available
- New_Item => Source_String3, -- 12 characters long.
- Drop => Ada.Strings.Left); -- truncate from Left.
-
- if Insert_String /= "l abcde" then -- 10 chars, leading blank.
- Report.Failed("Incorrect result from Insert with Drop=Left");
- end if;
-
- -- Drop = Error
-
- begin
- ASF.Insert(Source => Result_String, -- 10 chars
- Before => Result_String'Last,
- New_Item => "abcdefghijk",
- Drop => Ada.Strings.Error);
- Report.Failed("Exception not raised by Procedure Insert");
- exception
- when Ada.Strings.Length_Error => null; -- OK, expected exception
- when others =>
- Report.Failed("Incorrect exception raised by Procedure Insert");
- end;
-
-
-
- -- Function Overwrite
-
- TC_Set_Name ("Overwrite");
-
- Overwrite_String := TC_Check (
- ASF.Overwrite(Result_String, -- 10 chars
- 1, -- starting at pos=1
- Source_String3(1..10)));
-
- if Overwrite_String /= Source_String3(1..10) then
- Report.Failed("Incorrect result from Function Overwrite - 1");
- end if;
-
-
- if TC_Check (ASF.Overwrite("abcdef", 4, "xyz")) /= "abcxyz" or
- TC_Check (ASF.Overwrite("a", 1, "xyz"))
- /= "xyz" or -- chars appended
- TC_Check (ASF.Overwrite("abc", 3, " "))
- /= "ab " or -- blanks appended
- TC_Check (ASF.Overwrite("abcde", 1, "z" )) /= "zbcde"
- then
- Report.Failed("Incorrect result from Function Overwrite - 2");
- end if;
-
-
-
- -- Procedure Overwrite, with truncation.
-
- ASF.Overwrite(Source => Overwrite_String, -- 10 characters.
- Position => 1,
- New_Item => Source_String3, -- 12 characters.
- Drop => Ada.Strings.Left);
-
- if Overwrite_String /= "cdefghijkl" then
- Report.Failed("Incorrect result from Overwrite with Drop=Left");
- end if;
-
- -- The default drop value is Right, used here.
-
- ASF.Overwrite(Source => Overwrite_String, -- 10 characters.
- Position => 1,
- New_Item => Source_String3); -- 12 characters.
-
- if Overwrite_String /= "abcdefghij" then
- Report.Failed("Incorrect result from Overwrite with Drop=Right");
- end if;
-
- -- Drop = Error
-
- begin
- ASF.Overwrite(Source => Overwrite_String, -- 10 characters.
- Position => 1,
- New_Item => Source_String3, -- 12 characters.
- Drop => Ada.Strings.Error);
- Report.Failed("Exception not raised by Procedure Overwrite");
- exception
- when Ada.Strings.Length_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Incorrect exception raised by Procedure Overwrite");
- end;
-
- Overwrite_String := "ababababab";
- ASF.Overwrite(Overwrite_String, Overwrite_String'Last, "z");
- ASF.Overwrite(Overwrite_String, Overwrite_String'First,"z");
- ASF.Overwrite(Overwrite_String, 5, "zz");
-
- if Overwrite_String /= "zbabzzabaz" then
- Report.Failed("Incorrect result from Procedure Overwrite");
- end if;
-
-
-
- -- Function Delete
-
- TC_Set_Name ("Delete");
-
- declare
- New_String1 : constant String := -- This returns a 4 char string.
- TC_Check (ASF.Delete(Source => Source_String3,
- From => 3,
- Through => 10));
- New_String2 : constant String := -- This returns Source.
- TC_Check (ASF.Delete(Source_String3, 10, 3));
- begin
- if New_String1 /= "abkl" or
- New_String2 /= Source_String3
- then
- Report.Failed("Incorrect result from Function Delete - 1");
- end if;
- end;
-
- if TC_Check (ASF.Delete("a", 1, 1))
- /= "" or -- Source length = 1
- TC_Check (ASF.Delete("abc", 1, 2))
- /= "c" or -- From = Source'First
- TC_Check (ASF.Delete("abc", 3, 3))
- /= "ab" or -- From = Source'Last
- TC_Check (ASF.Delete("abc", 3, 1))
- /= "abc" -- From > Through
- then
- Report.Failed("Incorrect result from Function Delete - 2");
- end if;
-
-
-
- -- Procedure Delete
-
- -- Justify = Left
-
- Delete_String := Source_String3(1..10); -- Initialize to "abcdefghij"
-
- ASF.Delete(Source => Delete_String,
- From => 6,
- Through => Delete_String'Last,
- Justify => Ada.Strings.Left,
- Pad => 'x'); -- pad with char 'x'
-
- if Delete_String /= "abcdexxxxx" then
- Report.Failed("Incorrect result from Delete - Justify = Left");
- end if;
-
- -- Justify = Right
-
- ASF.Delete(Source => Delete_String, -- Remove x"s from end and
- From => 6, -- shift right.
- Through => Delete_String'Last,
- Justify => Ada.Strings.Right,
- Pad => 'x'); -- pad with char 'x' on left.
-
- if Delete_String /= "xxxxxabcde" then
- Report.Failed("Incorrect result from Delete - Justify = Right");
- end if;
-
- -- Justify = Center
-
- ASF.Delete(Source => Delete_String,
- From => 1,
- Through => 5,
- Justify => Ada.Strings.Center,
- Pad => 'z');
-
- if Delete_String /= "zzabcdezzz" then -- extra pad char on right side.
- Report.Failed("Incorrect result from Delete - Justify = Center");
- end if;
-
-
-
- -- Function Trim
- -- Use non-identity character sets to perform the trim operation.
-
- TC_Set_Name ("Trim");
-
- Trim_String := "cdabcdefcd";
-
- -- Remove the "cd" from each end of the string. This will not effect
- -- the "cd" slice at 5..6.
-
- declare
- New_String : constant String :=
- TC_Check (ASF.Trim(Source => Trim_String,
- Left => CD_Set, Right => CD_Set));
- begin
- if New_String /= Source_String2 then -- string "abcdef"
- Report.Failed("Incorrect result from Trim with character sets");
- end if;
- end;
-
- if TC_Check (ASF.Trim("abcdef", Maps.Null_Set, Maps.Null_Set))
- /= "abcdef" then
- Report.Failed("Incorrect result from Trim with Null sets");
- end if;
-
- if TC_Check (ASF.Trim("cdxx", CD_Set, X_Set)) /= "" then
- Report.Failed("Incorrect result from Trim, string removal");
- end if;
-
-
- -- Procedure Trim
-
- -- Justify = Right
-
- ASF.Trim(Source => Trim_String,
- Left => CD_Set,
- Right => CD_Set,
- Justify => Ada.Strings.Right,
- Pad => 'x');
-
- if Trim_String /= "xxxxabcdef" then
- Report.Failed("Incorrect result from Trim with Justify = Right");
- end if;
-
- -- Justify = Left
-
- ASF.Trim(Source => Trim_String,
- Left => X_Set,
- Right => Maps.Null_Set,
- Justify => Ada.Strings.Left,
- Pad => Ada.Strings.Space);
-
- if Trim_String /= "abcdef " then -- Padded with 4 blanks on right.
- Report.Failed("Incorrect result from Trim with Justify = Left");
- end if;
-
- -- Justify = Center
-
- ASF.Trim(Source => Trim_String,
- Left => ABCD_Set,
- Right => CD_Set,
- Justify => Ada.Strings.Center,
- Pad => 'x');
-
- if Trim_String /= "xxef xx" then -- Padded with 2 pad chars on L/R
- Report.Failed("Incorrect result from Trim with Justify = Center");
- end if;
-
-
-
- -- Function Head, demonstrating use of padding.
-
- TC_Set_Name ("Head");
-
- -- Use the characters of Source_String1 ("abcde") and pad the
- -- last five characters of Result_String with 'x' characters.
-
-
- Result_String := TC_CHeck (ASF.Head(Source_String1, 10, 'x'));
-
- if Result_String /= "abcdexxxxx" then
- Report.Failed("Incorrect result from Function Head with padding");
- end if;
-
- if TC_Check (ASF.Head(" ab ", 2)) /= " " or
- TC_Check (ASF.Head("a", 6, 'A')) /= "aAAAAA" or
- TC_Check (ASF.Head("abcdefgh", 3, 'x')) /= "abc" or
- TC_Check (ASF.Head(ASF.Head("abc ", 7, 'x'), 10, 'X'))
- /= "abc xxXXX"
- then
- Report.Failed("Incorrect result from Function Head");
- end if;
-
-
-
- -- Function Tail, demonstrating use of padding.
-
- TC_Set_Name ("Tail");
-
- -- Use the characters of Source_String1 ("abcde") and pad the
- -- first five characters of Result_String with 'x' characters.
-
- Result_String := TC_Check (ASF.Tail(Source_String1, 10, 'x'));
-
- if Result_String /= "xxxxxabcde" then
- Report.Failed("Incorrect result from Function Tail with padding");
- end if;
-
- if TC_Check (ASF.Tail("abcde ", 5))
- /= "cde " or -- blanks, back
- TC_Check (ASF.Tail(" abc ", 8, ' '))
- /= " abc " or -- blanks, front/back
- TC_Check (ASF.Tail("", 5, 'Z'))
- /= "ZZZZZ" or -- pad characters only
- TC_Check (ASF.Tail("abc", 0))
- /= "" or -- null result
- TC_Check (ASF.Tail("abcdefgh", 3))
- /= "fgh" or
- TC_Check (ASF.Tail(ASF.Tail(" abc ", 6, 'x'),
- 10,
- 'X')) /= "XXXXx abc "
- then
- Report.Failed("Incorrect result from Function Tail");
- end if;
-
-
- -- Function "*" - with (Natural, String) parameters
-
- TC_Set_Name ("""*""");
-
- if TC_Check (ASF."*"(3, Source_String1)) /= "abcdeabcdeabcde" or
- TC_Check (ASF."*"(2, Source_String2)) /= Source_String6 or
- TC_Check (ASF."*"(4, Source_String1(1..2))) /= "abababab" or
- TC_Check (ASF."*"(0, Source_String1)) /= ""
- then
- Report.Failed("Incorrect result from Function ""*"" with strings");
- end if;
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4005;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4006.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4006.a
deleted file mode 100644
index e1d7f46f5ae..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4006.a
+++ /dev/null
@@ -1,319 +0,0 @@
--- CXA4006.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Bounded are
--- available, and that they produce correct results. Specifically, check
--- the subprograms Length, Slice, "&", To_Bounded_String, Append, Index,
--- To_String, Replace_Slice, Trim, Overwrite, Delete, Insert, and
--- Translate.
---
--- TEST DESCRIPTION:
--- This test demonstrates the uses of a variety of the string functions
--- found in the package Ada.Strings.Bounded, simulating the operations
--- found in a text processing package.
--- With bounded strings, the length of each "line" of text can vary up
--- to the instantiated maximum, allowing one to view a page of text as
--- a series of expandable lines. This provides flexibility in text
--- formatting of individual lines (strings).
--- Several subprograms are defined, all of which attempt to take advantage
--- of as many different bounded string utilities as possible. Often,
--- an operation that is being performed in a subprogram using a certain
--- bounded string utility could more efficiently be performed using a
--- a different utility. However, in the interest of including as broad
--- coverage as possible, a mixture of utilities is invoked in this test.
--- A simulated page of text is provided as a parameter to the test
--- defined subprograms, and the appropriate processing performed. The
--- processed page of text is then compared to a predefined "finished"
--- page, and test passage/failure is based on the results of this
--- comparison.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Ada.Strings;
-with Ada.Strings.Bounded;
-with Ada.Strings.Maps;
-with Report;
-
-procedure CXA4006 is
-
-begin
-
- Report.Test ("CXA4006", "Check that the subprograms defined in package " &
- "Ada.Strings.Bounded are available, and that " &
- "they produce correct results");
-
- Test_Block:
- declare
-
- Characters_Per_Line : constant Positive := 40;
- Lines_Per_Page : constant Natural := 4;
-
- package BS_40 is new
- Ada.Strings.Bounded.Generic_Bounded_Length(Characters_Per_Line);
- use type BS_40.Bounded_String;
-
- type Page_Type is array (1..Lines_Per_Page) of BS_40.Bounded_String;
-
- -- Note: Misspellings below are intentional.
-
- Line1 : BS_40.Bounded_String :=
- BS_40.To_Bounded_String("ada is a progrraming language designed");
- Line2 : BS_40.Bounded_String :=
- BS_40.To_Bounded_String("to support the construction of long-");
- Line3 : BS_40.Bounded_String :=
- BS_40.To_Bounded_String("lived, highly reliabel software ");
- Line4 : BS_40.Bounded_String :=
- BS_40.To_Bounded_String("systems");
-
- Page : Page_Type := (1 => Line1, 2 => Line2, 3 => Line3, 4 => Line4);
-
- Finished_Page : Page_Type :=
- (BS_40.To_Bounded_String("Ada is a programming language designed"),
- BS_40.To_Bounded_String("to support the construction of long-"),
- BS_40.To_Bounded_String("lived, HIGHLY RELIABLE software systems."),
- BS_40.To_Bounded_String(""));
-
- ---
-
- procedure Compress (Page : in out Page_Type) is
- Clear_Line : Natural := Lines_Per_Page;
- begin
- -- If two consecutive lines on the page are together less than the
- -- maximum line length, then append those two lines, move up all
- -- lower lines on the page, and blank out the last line.
- for i in 1..Lines_Per_Page - 1 loop
- if BS_40.Length(Page(i)) + BS_40.Length(Page(i+1)) <=
- BS_40.Max_Length
- then
- Page(i) := BS_40."&"(Page(i),
- Page(i+1)); -- "&" (bounded, bounded)
-
- for j in i+1..Lines_Per_Page - 1 loop
- Page(j) :=
- BS_40.To_Bounded_String
- (BS_40.Slice(Page(j+1),
- 1,
- BS_40.Length(Page(j+1))));
- Clear_Line := j + 1;
- end loop;
- Page(Clear_Line) := BS_40.Null_Bounded_String;
- end if;
- end loop;
- end Compress;
-
- ---
-
- procedure Format (Page : in out Page_Type) is
- Sm_Ada : BS_40.Bounded_String := BS_40.To_Bounded_String("ada");
- Cap_Ada : constant String := "Ada";
- Char_Pos : Natural := 0;
- Finished : Boolean := False;
- Line : Natural := Page_Type'Last;
- begin
-
- -- Add a period to the end of the last line.
- while Line >= Page_Type'First and not Finished loop
- if Page(Line) /= BS_40.Null_Bounded_String and
- BS_40.Length(Page(Line)) <= BS_40.Max_Length
- then
- Page(Line) := BS_40.Append(Page(Line), '.');
- Finished := True;
- end if;
- Line := Line - 1;
- end loop;
-
- -- Replace all occurrences of "ada" with "Ada".
- for Line in Page_Type'First .. Page_Type'Last loop
- Finished := False;
- while not Finished loop
- Char_Pos := BS_40.Index(Source => Page(Line),
- Pattern => BS_40.To_String(Sm_Ada),
- Going => Ada.Strings.Backward);
- -- A zero is returned by function Index if no occurrences of
- -- the pattern string are found.
- Finished := (Char_Pos = 0);
- if not Finished then
- BS_40.Replace_Slice
- (Source => Page(Line),
- Low => Char_Pos,
- High => Char_Pos + BS_40.Length(Sm_Ada) - 1,
- By => Cap_Ada);
- end if;
- end loop; -- while loop
- end loop; -- for loop
-
- end Format;
-
- ---
-
- procedure Spell_Check (Page : in out Page_Type) is
- type Spelling_Type is (Incorrect, Correct);
- type Word_Array_Type is array (Spelling_Type)
- of BS_40.Bounded_String;
- type Dictionary_Type is array (1..2) of Word_Array_Type;
-
- -- Note that the "words" in the dictionary will require various
- -- amounts of Trimming prior to their use in the string functions.
- Dictionary : Dictionary_Type :=
- (1 => (BS_40.To_Bounded_String(" reliabel "),
- BS_40.To_Bounded_String(" reliable ")),
- 2 => (BS_40.To_Bounded_String(" progrraming "),
- BS_40.To_Bounded_String(" programming ")));
-
- Pos : Natural := Natural'First;
- Finished : Boolean := False;
-
- begin
-
- for Line in Page_Type'Range loop
-
- -- Search for the first incorrectly spelled word in the Dictionary,
- -- if it is found, replace it with the correctly spelled word,
- -- using the Overwrite function.
-
- while not Finished loop
- Pos :=
- BS_40.Index(Page(Line),
- BS_40.To_String(
- BS_40.Trim(Dictionary(1)(Incorrect),
- Ada.Strings.Both)),
- Ada.Strings.Forward);
- Finished := (Pos = 0);
- if not Finished then
- Page(Line) :=
- BS_40.Overwrite(Page(Line),
- Pos,
- BS_40.To_String
- (BS_40.Trim(Dictionary(1)(Correct),
- Ada.Strings.Both)));
- end if;
- end loop;
-
- Finished := False;
-
- -- Search for the second incorrectly spelled word in the
- -- Dictionary, if it is found, replace it with the correctly
- -- spelled word, using the Delete procedure and Insert function.
-
- while not Finished loop
- Pos :=
- BS_40.Index(Page(Line),
- BS_40.To_String(
- BS_40.Trim(Dictionary(2)(Incorrect),
- Ada.Strings.Both)),
- Ada.Strings.Forward);
-
- Finished := (Pos = 0);
-
- if not Finished then
- BS_40.Delete
- (Page(Line),
- Pos,
- Pos + BS_40.To_String
- (BS_40.Trim(Dictionary(2)(Incorrect),
- Ada.Strings.Both))'Length-1);
- Page(Line) :=
- BS_40.Insert(Page(Line),
- Pos,
- BS_40.To_String
- (BS_40.Trim(Dictionary(2)(Correct),
- Ada.Strings.Both)));
- end if;
- end loop;
-
- Finished := False;
-
- end loop;
- end Spell_Check;
-
- ---
-
- procedure Bold (Page : in out Page_Type) is
- Key_Word : constant String := "highly reliable";
- Bold_Mapping : constant Ada.Strings.Maps.Character_Mapping :=
- Ada.Strings.Maps.To_Mapping(From => " abcdefghijklmnopqrstuvwxyz",
- To => " ABCDEFGHIJKLMNOPQRSTUVWXYZ");
- Pos : Natural := Natural'First;
- Finished : Boolean := False;
- begin
- -- This procedure is designed to change the case of the phrase
- -- "highly reliable" into upper case (a type of "Bolding").
- -- All instances of the phrase on all lines of the page will be
- -- modified.
-
- for Line in Page_Type'First .. Page_Type'Last loop
- while not Finished loop
- Pos := BS_40.Index(Page(Line), Key_Word);
- Finished := (Pos = 0);
- if not Finished then
-
- BS_40.Overwrite
- (Page(Line),
- Pos,
- BS_40.To_String
- (BS_40.Translate
- (BS_40.To_Bounded_String
- (BS_40.Slice(Page(Line),
- Pos,
- Pos + Key_Word'Length - 1)),
- Bold_Mapping)));
-
- end if;
- end loop;
- Finished := False;
- end loop;
- end Bold;
-
-
- begin
-
- Compress(Page);
- Format(Page);
- Spell_Check(Page);
- Bold(Page);
-
- for i in 1..Lines_Per_Page loop
- if BS_40.To_String(Page(i)) /= BS_40.To_String(Finished_Page(i)) or
- BS_40.Length(Page(i)) /= BS_40.Length(Finished_Page(i))
- then
- Report.Failed("Incorrect modification of Page, Line " &
- Integer'Image(i));
- end if;
- end loop;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4006;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4007.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4007.a
deleted file mode 100644
index fca15d367b5..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4007.a
+++ /dev/null
@@ -1,334 +0,0 @@
--- CXA4007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Bounded are
--- available, and that they produce correct results. Specifically, check
--- the subprograms Append, Count, Element, Find_Token, Head,
--- Index_Non_Blank, Replace_Element, Replicate, Tail, To_Bounded_String,
--- "&", ">", "<", ">=", "<=", and "*".
---
--- TEST DESCRIPTION:
--- This test, when taken in conjunction with tests CXA400[6,8,9], will
--- constitute a test of all the functionality contained in package
--- Ada.Strings.Bounded. This test uses a variety of the
--- subprograms defined in the bounded string package in ways typical
--- of common usage. Different combinations of available subprograms
--- are used to accomplish similar bounded string processing goals.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 22 Dec 94 SAIC Changed obsolete constant to Ada.Strings.Space.
---
---!
-
-with Ada.Strings;
-with Ada.Strings.Bounded;
-with Ada.Strings.Maps;
-with Report;
-
-procedure CXA4007 is
-
-begin
-
- Report.Test ("CXA4007", "Check that the subprograms defined in package " &
- "Ada.Strings.Bounded are available, and that " &
- "they produce correct results");
-
- Test_Block:
- declare
-
- package BS80 is new Ada.Strings.Bounded.Generic_Bounded_Length(80);
- use type BS80.Bounded_String;
-
- Part1 : constant String := "Rum";
- Part2 : Character := 'p';
- Part3 : BS80.Bounded_String := BS80.To_Bounded_String("el");
- Part4 : Character := 's';
- Part5 : BS80.Bounded_String := BS80.To_Bounded_String("tilt");
- Part6 : String(1..3) := "ski";
-
- Full_Catenate_String,
- Full_Append_String,
- Constructed_String,
- Drop_String,
- Replicated_String,
- Token_String : BS80.Bounded_String;
-
- CharA : Character := 'A';
- CharB : Character := 'B';
- CharC : Character := 'C';
- CharD : Character := 'D';
- CharE : Character := 'E';
- CharF : Character := 'F';
-
- ABStr : String(1..15) := "AAAAABBBBBBBBBB";
- StrB : String(1..2) := "BB";
- StrE : String(1..2) := "EE";
-
-
- begin
-
- -- Evaluation of the overloaded forms of the "&" operator defined
- -- for instantiations of Bounded Strings.
-
- Full_Catenate_String :=
- BS80."&"(Part2, -- Char & Bnd Str
- BS80."&"(Part3, -- Bnd Str & Bnd Str
- BS80."&"(Part4, -- Char & Bnd Str
- BS80."&"(Part5, -- Bnd Str & Bnd Str
- BS80.To_Bounded_String(Part6)))));
-
- Full_Catenate_String :=
- Part1 & Full_Catenate_String; -- Str & Bnd Str
- Full_Catenate_String :=
- Full_Catenate_String & 'n'; -- Bnd Str & Char
-
-
- -- Evaluation of the overloaded forms of function Append.
-
- Full_Append_String :=
- BS80.Append(Part2, -- Char,Bnd
- BS80.Append(Part3, -- Bnd, Bnd
- BS80.Append(Part4, -- Char,Bnd
- BS80.Append(BS80.To_String(Part5), -- Str,Bnd
- BS80.To_Bounded_String(Part6)))));
-
- Full_Append_String :=
- BS80.Append(BS80.To_Bounded_String(Part1), -- Bnd , Str
- BS80.To_String(Full_Append_String));
-
- Full_Append_String :=
- BS80.Append(Left => Full_Append_String,
- Right => 'n'); -- Bnd, Char
-
-
- -- Validate the resulting bounded strings.
-
- if Full_Catenate_String < Full_Append_String or
- Full_Catenate_String > Full_Append_String or
- not (Full_Catenate_String = Full_Append_String and
- Full_Catenate_String <= Full_Append_String and
- Full_Catenate_String >= Full_Append_String)
- then
- Report.Failed("Incorrect results from bounded string catenation" &
- " and comparison");
- end if;
-
-
- -- Evaluate the overloaded forms of the Constructor function "*" and
- -- the Replicate function.
-
- Constructed_String :=
- (2 * CharA) & -- "AA"
- (2 * StrB) & -- "AABBBB"
- (3 * BS80."*"(2, CharC)) & -- "AABBBBCCCCCC"
- BS80.Replicate(3,
- BS80.Replicate(2, CharD)) & -- "AABBBBCCCCCCDDDDDD"
- BS80.Replicate(2, StrE) & -- "AABBBBCCCCCCDDDDDDEEEE"
- BS80.Replicate(2, CharF); -- "AABBBBCCCCCCDDDDDDEEEEFF"
-
-
- -- Use of Function Replicate that involves dropping characters. The
- -- attempt to replicate the 15 character string six times will exceed
- -- the 80 character bound of the string. Therefore, the result should
- -- be the catenation of 5 copies of the 15 character string, followed
- -- by 5 'A' characters (the first five characters of the 6th
- -- replication) with the remaining characters of the 6th replication
- -- dropped.
-
- Drop_String :=
- BS80.Replicate(Count => 6,
- Item => ABStr, -- "AAAAABBBBBBBBBB"
- Drop => Ada.Strings.Right);
-
- if BS80.Element(Drop_String, 1) /= 'A' or
- BS80.Element(Drop_String, 6) /= 'B' or
- BS80.Element(Drop_String, 76) /= 'A' or
- BS80.Element(Drop_String, 80) /= 'A'
- then
- Report.Failed("Incorrect result from Replicate with Drop");
- end if;
-
-
- -- Use function Index_Non_Blank in the evaluation of the
- -- Constructed_String.
-
- if BS80.Index_Non_Blank(Constructed_String, Ada.Strings.Forward) /=
- BS80.To_String(Constructed_String)'First or
- BS80.Index_Non_Blank(Constructed_String, Ada.Strings.Backward) /=
- BS80.Length(Constructed_String)
- then
- Report.Failed("Incorrect results from constructor functions");
- end if;
-
-
-
- declare
-
- -- Define character set objects for use with the Count function.
- -- Constructed_String = "AABBBBCCCCCCDDDDDDEEEEFF" from above.
-
- A_Set : Ada.Strings.Maps.Character_Set :=
- Ada.Strings.Maps.To_Set(BS80.Element(Constructed_String,1));
- B_Set : Ada.Strings.Maps.Character_Set :=
- Ada.Strings.Maps.To_Set(BS80.Element(Constructed_String,3));
- C_Set : Ada.Strings.Maps.Character_Set :=
- Ada.Strings.Maps.To_Set(BS80.Element(Constructed_String,7));
- D_Set : Ada.Strings.Maps.Character_Set :=
- Ada.Strings.Maps.To_Set(BS80.Element(Constructed_String,13));
- E_Set : Ada.Strings.Maps.Character_Set :=
- Ada.Strings.Maps.To_Set(BS80.Element(Constructed_String,19));
- F_Set : Ada.Strings.Maps.Character_Set :=
- Ada.Strings.Maps.To_Set(BS80.Element(Constructed_String,23));
-
-
- Start : Positive;
- Stop : Natural := 0;
-
- begin
-
- -- Evaluate the results from function Count by comparing the number
- -- of A's to the number of F's, B's to E's, and C's to D's in the
- -- Constructed_String.
- -- There should be an equal number of each of the characters that
- -- are being compared (i.e., 2 A's and F's, 4 B's and E's, etc)
-
- if BS80.Count(Constructed_String, A_Set) /=
- BS80.Count(Constructed_String, F_Set) or
- BS80.Count(Constructed_String, B_Set) /=
- BS80.Count(Constructed_String, E_Set) or
- not (BS80.Count(Constructed_String, C_Set) =
- BS80.Count(Constructed_String, D_Set))
- then
- Report.Failed("Incorrect result from function Count");
- end if;
-
-
- -- Evaluate the functions Head, Tail, and Find_Token.
- -- Create the Token_String from the Constructed_String above.
-
- Token_String :=
- BS80.Tail(BS80.Head(Constructed_String, 3), 2) & -- "AB" &
- BS80.Head(BS80.Tail(Constructed_String, 13), 2) & -- "CD" &
- BS80.Head(BS80.Tail(Constructed_String, 3), 2); -- "EF"
-
- if Token_String /= BS80.To_Bounded_String("ABCDEF") then
- Report.Failed("Incorrect result from Catenation of Token_String");
- end if;
-
-
- -- Find the starting/ending position of the first A in the
- -- Token_String (both should be 1, only one A appears in string).
- -- The Function Head uses the default pad character to return a
- -- bounded string longer than its input parameter bounded string.
-
- BS80.Find_Token(BS80.Head(Token_String, 10), -- Default pad.
- A_Set,
- Ada.Strings.Inside,
- Start,
- Stop);
-
- if Start /= 1 and Stop /= 1 then
- Report.Failed("Incorrect result from Find_Token - 1");
- end if;
-
-
- -- Find the starting/ending position of the first non-AB slice in
- -- the "head" five characters of Token_String (slice CDE at
- -- positions 3-5)
-
- BS80.Find_Token(BS80.Head(Token_String, 5), -- "ABCDE"
- Ada.Strings.Maps."OR"(A_Set, B_Set), -- Set (AB)
- Ada.Strings.Outside,
- Start,
- Stop);
-
- if Start /= 3 and Stop /= 5 then
- Report.Failed("Incorrect result from Find_Token - 2");
- end if;
-
-
- -- Find the starting/ending position of the first CD slice in
- -- the "tail" eight characters (including two pad characters)
- -- of Token_String (slice CD at positions 5-6 of the tail
- -- portion specified)
-
- BS80.Find_Token(BS80.Tail(Token_String, 8,
- Ada.Strings.Space), -- " ABCDEF"
- Ada.Strings.Maps."OR"(C_Set, D_Set), -- Set (CD)
- Ada.Strings.Inside,
- Start,
- Stop);
-
- if Start /= 5 and Stop /= 6 then
- Report.Failed("Incorrect result from Find_Token - 3");
- end if;
-
-
- -- Evaluate the Replace_Element procedure.
-
- -- Token_String = "ABCDEF"
-
- BS80.Replace_Element(Token_String, 3, BS80.Element(Token_String,4));
-
- -- Token_String = "ABDDEF"
-
- BS80.Replace_Element(Source => Token_String,
- Index => 2,
- By => BS80.Element(Token_String, 5));
-
- -- Token_String = "AEDDEF"
-
- BS80.Replace_Element(Token_String,
- 1,
- BS80.Element(BS80.Tail(Token_String, 2), 2));
-
- -- Token_String = "FEDDEF"
- -- Evaluate this result.
-
- if BS80.Element(Token_String, BS80.To_String(Token_String)'First) /=
- BS80.Element(Token_String, BS80.To_String(Token_String)'Last) or
- BS80.Count(Token_String, D_Set) /=
- BS80.Count(Token_String, E_Set) or
- BS80.Index_Non_Blank(BS80.Head(Token_String,6)) /=
- BS80.Index_Non_Blank(BS80.Tail(Token_String,6)) or
- BS80.Head(Token_String, 1) /=
- BS80.Tail(Token_String, 1)
- then
- Report.Failed("Incorrect result from operations in combination");
- end if;
-
- end;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4007;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4008.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4008.a
deleted file mode 100644
index 629305f767a..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4008.a
+++ /dev/null
@@ -1,662 +0,0 @@
--- CXA4008.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Bounded are
--- available, and that they produce correct results, especially under
--- conditions where truncation of the result is required. Specifically,
--- check the subprograms Append, Count with non-Identity maps, Index with
--- non-Identity maps, Index with Set parameters, Insert (function and
--- procedure), Replace_Slice (function and procedure), To_Bounded_String,
--- and Translate.
---
--- TEST DESCRIPTION:
--- This test, in conjunction with tests CXA4006, CXA4007, and CXA4009,
--- will provide coverage of the most common usages of the functionality
--- found in the Ada.Strings.Bounded package. It deals in large part
--- with truncation effects and options. This test contains many small,
--- specific test cases, situations that are often difficult to generate
--- in large numbers in an application-based test. These cases represent
--- specific usage paradigms in-the-small.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Apr 95 SAIC Corrected acceptance condition of subtest for
--- Function Append with Truncation = Left.
--- 31 Oct 95 SAIC Update and repair for ACVC 2.0.1.
---
---!
-
-with Report;
-with Ada.Strings.Maps.Constants;
-with Ada.Strings.Bounded;
-with Ada.Strings.Maps;
-
-procedure CXA4008 is
-
-begin
-
- Report.Test("CXA4008", "Check that the subprograms defined in " &
- "package Ada.Strings.Bounded are available, " &
- "and that they produce correct results, " &
- "especially under conditions where " &
- "truncation of the result is required");
-
- Test_Block:
- declare
-
- package AS renames Ada.Strings;
- package ASB renames Ada.Strings.Bounded;
- package ASC renames Ada.Strings.Maps.Constants;
- package Maps renames Ada.Strings.Maps;
-
- package B10 is new ASB.Generic_Bounded_Length(Max => 10);
- use type B10.Bounded_String;
-
- Result_String : B10.Bounded_String;
- Test_String : B10.Bounded_String;
- AtoE_Bnd_Str : B10.Bounded_String := B10.To_Bounded_String("abcde");
- FtoJ_Bnd_Str : B10.Bounded_String := B10.To_Bounded_String("fghij");
- AtoJ_Bnd_Str : B10.Bounded_String :=
- B10.To_Bounded_String("abcdefghij");
-
- Location : Natural := 0;
- Total_Count : Natural := 0;
-
- CD_Set : Maps.Character_Set := Maps.To_Set("cd");
-
- AB_to_YZ_Map : Maps.Character_Mapping :=
- Maps.To_Mapping(From => "ab", To => "yz");
-
- CD_to_XY_Map : Maps.Character_Mapping :=
- Maps.To_Mapping(From => "cd", To => "xy");
-
-
- begin
- -- Function To_Bounded_String with Truncation
- -- Evaluate the function Append with parameters that will
- -- cause the truncation of the result.
-
- -- Drop = Error (default case, Length_Error will be raised)
-
- begin
- Test_String :=
- B10.To_Bounded_String("Much too long for this bounded string");
- Report.Failed("Length Error not raised by To_Bounded_String");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by To_Bounded_String");
- end;
-
- -- Drop = Left
-
- Test_String := B10.To_Bounded_String(Source => "abcdefghijklmn",
- Drop => Ada.Strings.Left);
-
- if Test_String /= B10.To_Bounded_String("efghijklmn") then
- Report.Failed
- ("Incorrect result from To_Bounded_String, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Test_String := B10.To_Bounded_String(Source => "abcdefghijklmn",
- Drop => Ada.Strings.Right);
-
- if not(Test_String = AtoJ_Bnd_Str) then
- Report.Failed
- ("Incorrect result from To_Bounded_String, Drop = Right");
- end if;
-
-
-
-
- -- Function Append with Truncation
- -- Evaluate the function Append with parameters that will
- -- cause the truncation of the result.
-
- -- Drop = Error (default case, Length_Error will be raised)
-
- begin
- -- Append (Bnd Str, Bnd Str);
- Result_String :=
- B10.Append(B10.To_Bounded_String("abcde"),
- B10.To_Bounded_String("fghijk")); -- 11 char
- Report.Failed("Length_Error not raised by Append - 1");
- exception
- when AS.Length_Error => null; -- OK, correct exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Append - 1");
- end;
-
- begin
- -- Append (Str, Bnd Str);
- Result_String := B10.Append(B10.To_String(AtoE_Bnd_Str),
- B10.To_Bounded_String("fghijk"),
- AS.Error);
- Report.Failed("Length_Error not raised by Append - 2");
- exception
- when AS.Length_Error => null; -- OK, correct exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Append - 2");
- end;
-
- begin
- -- Append (Bnd Str, Char);
- Result_String :=
- B10.Append(B10.To_Bounded_String("abcdefghij"), 'k');
- Report.Failed("Length_Error not raised by Append - 3");
- exception
- when AS.Length_Error => null; -- OK, correct exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Append - 3");
- end;
-
- -- Drop = Left
-
- -- Append (Bnd Str, Bnd Str)
- Result_String := B10.Append(B10.To_Bounded_String("abcdefgh"), -- 8 chs
- B10.To_Bounded_String("ijklmn"), -- 6 chs
- Ada.Strings.Left);
-
- if Result_String /= B10.To_Bounded_String("efghijklmn") then -- 10 chars
- Report.Failed("Incorrect truncation performed by Append - 4");
- end if;
-
- -- Append (Bnd Str, Str)
- Result_String :=
- B10.Append(B10.To_Bounded_String("abcdefghij"),
- "xyz",
- Ada.Strings.Left);
-
- if Result_String /= B10.To_Bounded_String("defghijxyz") then
- Report.Failed("Incorrect truncation performed by Append - 5");
- end if;
-
- -- Append (Char, Bnd Str)
-
- Result_String := B10.Append('A',
- B10.To_Bounded_String("abcdefghij"),
- Ada.Strings.Left);
-
- if Result_String /= B10.To_Bounded_String("abcdefghij") then
- Report.Failed("Incorrect truncation performed by Append - 6");
- end if;
-
- -- Drop = Right
-
- -- Append (Bnd Str, Bnd Str)
- Result_String := B10.Append(FtoJ_Bnd_Str,
- AtoJ_Bnd_Str,
- Ada.Strings.Right);
-
- if Result_String /= B10.To_Bounded_String("fghijabcde") then
- Report.Failed("Incorrect truncation performed by Append - 7");
- end if;
-
- -- Append (Str, Bnd Str)
- Result_String := B10.Append(B10.To_String(AtoE_Bnd_Str),
- AtoJ_Bnd_Str,
- Ada.Strings.Right);
-
- if Result_String /= B10.To_Bounded_String("abcdeabcde") then
- Report.Failed("Incorrect truncation performed by Append - 8");
- end if;
-
- -- Append (Char, Bnd Str)
- Result_String := B10.Append('A', AtoJ_Bnd_Str, Ada.Strings.Right);
-
- if Result_String /= B10.To_Bounded_String("Aabcdefghi") then
- Report.Failed("Incorrect truncation performed by Append - 9");
- end if;
-
-
- -- Function Index with non-Identity map.
- -- Evaluate the function Index with a non-identity map
- -- parameter which will cause mapping of the source parameter
- -- prior to the evaluation of the index position search.
-
- Location := B10.Index(Source => AtoJ_Bnd_Str, -- "abcdefghij"
- Pattern => "xy",
- Going => Ada.Strings.Forward,
- Mapping => CD_to_XY_Map); -- change "cd" to "xy"
-
- if Location /= 3 then
- Report.Failed("Incorrect result from Index, non-Identity map - 1");
- end if;
-
- Location := B10.Index(B10.To_Bounded_String("AND IF MAN"),
- "an",
- Ada.Strings.Backward,
- ASC.Lower_Case_Map);
-
- if Location /= 9 then
- Report.Failed("Incorrect result from Index, non-Identity map - 2");
- end if;
-
- Location := B10.Index(Source => B10.To_Bounded_String("The the"),
- Pattern => "the",
- Going => Ada.Strings.Forward,
- Mapping => ASC.Lower_Case_Map);
-
- if Location /= 1 then
- Report.Failed("Incorrect result from Index, non-Identity map - 3");
- end if;
-
-
- if B10.Index(B10.To_Bounded_String("abcd"), -- Pattern = Source
- "abcd") /= 1 or
- B10.Index(B10.To_Bounded_String("abc"), -- Pattern < Source
- "abcd") /= 0 or
- B10.Index(B10.Null_Bounded_String, -- Source = Null
- "abc") /= 0
- then
- Report.Failed("Incorrect result from Index with string patterns");
- end if;
-
-
- -- Function Index (for Sets).
- -- This version of Index uses Sets as the basis of the search.
-
- -- Test = Inside, Going = Forward (Default case).
- Location :=
- B10.Index(Source => B10.To_Bounded_String("abcdeabcde"),
- Set => CD_Set, -- set containing 'c' and 'd'
- Test => Ada.Strings.Inside,
- Going => Ada.Strings.Forward);
-
- if not (Location = 3) then -- position of first 'c' in source.
- Report.Failed("Incorrect result from Index using Sets - 1");
- end if;
-
- -- Test = Inside, Going = Backward.
- Location :=
- B10.Index(Source => B10."&"(AtoE_Bnd_Str, AtoE_Bnd_Str),
- Set => CD_Set, -- set containing 'c' and 'd'
- Test => Ada.Strings.Inside,
- Going => Ada.Strings.Backward);
-
- if not (Location = 9) then -- position of last 'd' in source.
- Report.Failed("Incorrect result from Index using Sets - 2");
- end if;
-
- -- Test = Outside, Going = Forward.
- Location := B10.Index(B10.To_Bounded_String("deddacd"),
- CD_Set,
- Test => Ada.Strings.Outside,
- Going => Ada.Strings.Forward);
-
- if Location /= 2 then -- position of 'e' in source.
- Report.Failed("Incorrect result from Index using Sets - 3");
- end if;
-
- -- Test = Outside, Going = Backward.
- Location := B10.Index(B10.To_Bounded_String("deddacd"),
- CD_Set,
- Ada.Strings.Outside,
- Ada.Strings.Backward);
-
- if Location /= 5 then -- correct position of 'a'.
- Report.Failed("Incorrect result from Index using Sets - 4");
- end if;
-
- if B10.Index(B10.To_Bounded_String("cd"), -- Source = Set
- CD_Set) /= 1 or
- B10.Index(B10.To_Bounded_String("c"), -- Source < Set
- CD_Set) /= 1 or
- B10.Index(B10.Null_Bounded_String, -- Source = Null
- CD_Set) /= 0 or
- B10.Index(AtoE_Bnd_Str, -- "abcde"
- Maps.Null_Set) /= 0 or -- Null set
- B10.Index(AtoE_Bnd_Str,
- Maps.To_Set('x')) /= 0 -- No match.
- then
- Report.Failed("Incorrect result from Index using Sets - 5");
- end if;
-
-
- -- Function Count with non-Identity mapping.
- -- Evaluate the function Count with a non-identity map
- -- parameter which will cause mapping of the source parameter
- -- prior to the evaluation of the number of matching patterns.
-
- Total_Count :=
- B10.Count(Source => B10.To_Bounded_String("abbabaabab"),
- Pattern => "yz",
- Mapping => AB_to_YZ_Map);
-
- if Total_Count /= 4 then
- Report.Failed
- ("Incorrect result from function Count, non-Identity map - 1");
- end if;
-
- -- And a few with identity maps as well.
-
- if B10.Count(B10.To_Bounded_String("ABABABABAB"),
- "ABA",
- Maps.Identity) /= 2 or
- B10.Count(B10.To_Bounded_String("ADCBADABCD"),
- "AB",
- Maps.To_Mapping("CD", "AB")) /= 5 or
- B10.Count(B10.To_Bounded_String("aaaaaaaaaa"),
- "aaa") /= 3 or
- B10.Count(B10.To_Bounded_String("XX"), -- Source < Pattern
- "XXX",
- Maps.Identity) /= 0 or
- B10.Count(AtoE_Bnd_Str, -- Source = Pattern
- "abcde") /= 1 or
- B10.Count(B10.Null_Bounded_String, -- Source = Null
- " ") /= 0
- then
- Report.Failed
- ("Incorrect result from function Count, w,w/o mapping");
- end if;
-
-
- -- Procedure Translate
-
- -- Partial mapping of source.
-
- Test_String := B10.To_Bounded_String("abcdeabcab");
-
- B10.Translate(Source => Test_String, Mapping => AB_to_YZ_Map);
-
- if Test_String /= B10.To_Bounded_String("yzcdeyzcyz") then
- Report.Failed("Incorrect result from procedure Translate - 1");
- end if;
-
- -- Total mapping of source.
-
- Test_String := B10.To_Bounded_String("abbaaababb");
-
- B10.Translate(Source => Test_String, Mapping => ASC.Upper_Case_Map);
-
- if Test_String /= B10.To_Bounded_String("ABBAAABABB") then
- Report.Failed("Incorrect result from procedure Translate - 2");
- end if;
-
- -- No mapping of source.
-
- Test_String := B10.To_Bounded_String("xyzsypcc");
-
- B10.Translate(Source => Test_String, Mapping => AB_to_YZ_Map);
-
- if Test_String /= B10.To_Bounded_String("xyzsypcc") then
- Report.Failed("Incorrect result from procedure Translate - 3");
- end if;
-
- -- Map > 2 characters, partial mapping.
-
- Test_String := B10.To_Bounded_String("have faith");
-
- B10.Translate(Test_String,
- Maps.To_Mapping("aeiou", "AEIOU"));
-
- if Test_String /= B10.To_Bounded_String("hAvE fAIth") then
- Report.Failed("Incorrect result from procedure Translate - 4");
- end if;
-
-
- -- Function Replace_Slice
- -- Evaluate function Replace_Slice with
- -- a variety of Truncation options.
-
- -- Drop = Error (Default)
-
- begin
- Test_String := AtoJ_Bnd_Str;
- Result_String :=
- B10.Replace_Slice(Source => Test_String, -- "abcdefghij"
- Low => 3,
- High => 5, -- 3-5, 3 chars.
- By => "xxxxxx"); -- more than 3.
- Report.Failed("Length_Error not raised by Function Replace_Slice");
- exception
- when AS.Length_Error => null; -- Correct exception raised.
- when others =>
- Report.Failed
- ("Incorrect exception raised by Function Replace_Slice");
- end;
-
- -- Drop = Left
-
- Result_String :=
- B10.Replace_Slice(Source => Test_String, -- "abcdefghij"
- Low => 7,
- High => 10, -- 7-10, 4 chars.
- By => "xxxxxx", -- 6 chars.
- Drop => Ada.Strings.Left);
-
- if Result_String /= B10.To_Bounded_String("cdefxxxxxx") then -- drop a,b
- Report.Failed
- ("Incorrect result from Function Replace Slice, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Result_String :=
- B10.Replace_Slice(Source => Test_String, -- "abcdefghij"
- Low => 2,
- High => 5, -- 2-5, 4 chars.
- By => "xxxxxx", -- 6 chars.
- Drop => Ada.Strings.Right);
-
- if Result_String /= B10.To_Bounded_String("axxxxxxfgh") then -- drop i,j
- Report.Failed
- ("Incorrect result from Function Replace Slice, Drop = Right");
- end if;
-
- -- Low = High = Source'Last, "By" length = 1.
-
- if B10.Replace_Slice(AtoE_Bnd_Str,
- B10.To_String(AtoE_Bnd_Str)'Last,
- B10.To_String(AtoE_Bnd_Str)'Last,
- "X",
- Ada.Strings.Error) /=
- B10.To_Bounded_String("abcdX")
- then
- Report.Failed("Incorrect result from Function Replace_Slice");
- end if;
-
-
-
- -- Procedure Replace_Slice
- -- Evaluate procedure Replace_Slice with
- -- a variety of Truncation options.
-
- -- Drop = Error (Default)
-
- begin
- Test_String := AtoJ_Bnd_Str;
- B10.Replace_Slice(Source => Test_String, -- "abcdefghij"
- Low => 3,
- High => 5, -- 3-5, 3 chars.
- By => "xxxxxx"); -- more than 3.
- Report.Failed("Length_Error not raised by Procedure Replace_Slice");
- exception
- when AS.Length_Error => null; -- Correct exception raised.
- when others =>
- Report.Failed
- ("Incorrect exception raised by Procedure Replace_Slice");
- end;
-
- -- Drop = Left
-
- Test_String := AtoJ_Bnd_Str;
- B10.Replace_Slice(Source => Test_String, -- "abcdefghij"
- Low => 7,
- High => 9, -- 7-9, 3 chars.
- By => "xxxxx", -- 5 chars.
- Drop => Ada.Strings.Left);
-
- if Test_String /= B10.To_Bounded_String("cdefxxxxxj") then -- drop a,b
- Report.Failed
- ("Incorrect result from Procedure Replace Slice, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Test_String := AtoJ_Bnd_Str;
- B10.Replace_Slice(Source => Test_String, -- "abcdefghij"
- Low => 1,
- High => 3, -- 1-3, 3chars.
- By => "xxxx", -- 4 chars.
- Drop => Ada.Strings.Right);
-
- if Test_String /= B10.To_Bounded_String("xxxxdefghi") then -- drop j
- Report.Failed
- ("Incorrect result from Procedure Replace Slice, Drop = Right");
- end if;
-
- -- High = Source'First, Low > High (Insert before Low).
-
- Test_String := AtoE_Bnd_Str;
- B10.Replace_Slice(Source => Test_String, -- "abcde"
- Low => B10.To_String(Test_String)'Last,
- High => B10.To_String(Test_String)'First,
- By => "XXXX", -- 4 chars.
- Drop => Ada.Strings.Right);
-
- if Test_String /= B10.To_Bounded_String("abcdXXXXe") then
- Report.Failed
- ("Incorrect result from Procedure Replace Slice");
- end if;
-
-
-
- -- Function Insert with Truncation
- -- Drop = Error (Default).
-
- begin
- Result_String :=
- B10.Insert(Source => AtoJ_Bnd_Str, -- "abcdefghij"
- Before => 2,
- New_Item => "xyz");
- Report.Failed("Length_Error not raised by Function Insert");
- exception
- when AS.Length_Error => null; -- Correct exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Function Insert");
- end;
-
- -- Drop = Left
-
- Result_String :=
- B10.Insert(Source => AtoJ_Bnd_Str, -- "abcdefghij"
- Before => 5,
- New_Item => "xyz", -- 3 additional chars.
- Drop => Ada.Strings.Left);
-
- if B10.To_String(Result_String) /= "dxyzefghij" then -- drop a, b, c
- Report.Failed("Incorrect result from Function Insert, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Result_String :=
- B10.Insert(Source => B10.To_Bounded_String("abcdef"),
- Before => 2,
- New_Item => "vwxyz", -- 5 additional chars.
- Drop => Ada.Strings.Right);
-
- if B10.To_String(Result_String) /= "avwxyzbcde" then -- drop f.
- Report.Failed("Incorrect result from Function Insert, Drop = Right");
- end if;
-
- -- Additional cases.
-
- if B10.Insert(B10.To_Bounded_String("a"), 1, " B") /=
- B10.To_Bounded_String(" Ba") or
- B10.Insert(B10.Null_Bounded_String, 1, "abcde") /=
- AtoE_Bnd_Str or
- B10.Insert(B10.To_Bounded_String("ab"), 2, "") /=
- B10.To_Bounded_String("ab")
- then
- Report.Failed("Incorrect result from Function Insert");
- end if;
-
-
- -- Procedure Insert
-
- -- Drop = Error (Default).
- begin
- Test_String := AtoJ_Bnd_Str;
- B10.Insert(Source => Test_String, -- "abcdefghij"
- Before => 9,
- New_Item => "wxyz",
- Drop => Ada.Strings.Error);
- Report.Failed("Length_Error not raised by Procedure Insert");
- exception
- when AS.Length_Error => null; -- Correct exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure Insert");
- end;
-
- -- Drop = Left
-
- Test_String := AtoJ_Bnd_Str;
- B10.Insert(Source => Test_String, -- "abcdefghij"
- Before => B10.Length(Test_String), -- before last char
- New_Item => "xyz", -- 3 additional chars.
- Drop => Ada.Strings.Left);
-
- if B10.To_String(Test_String) /= "defghixyzj" then -- drop a, b, c
- Report.Failed("Incorrect result from Procedure Insert, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Test_String := AtoJ_Bnd_Str;
- B10.Insert(Source => Test_String,
- Before => 4,
- New_Item => "yz", -- 2 additional chars.
- Drop => Ada.Strings.Right);
-
- if B10.To_String(Test_String) /= "abcyzdefgh" then -- drop i,j
- Report.Failed
- ("Incorrect result from Procedure Insert, Drop = Right");
- end if;
-
- -- Before = Source'First, New_Item length = 1.
-
- Test_String := B10.To_Bounded_String(" abc ");
- B10.Insert(Test_String,
- B10.To_String(Test_String)'First,
- "Z");
-
- if Test_String /= B10.To_Bounded_String("Z abc ") then
- Report.Failed("Incorrect result from Procedure Insert");
- end if;
-
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4008;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4009.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4009.a
deleted file mode 100644
index f02ef036507..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4009.a
+++ /dev/null
@@ -1,619 +0,0 @@
--- CXA4009.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Bounded are
--- available, and that they produce correct results, especially under
--- conditions where truncation of the result is required. Specifically,
--- check the subprograms Overwrite (function and procedure), Delete,
--- Function Trim (blanks), Trim (Set characters, function and procedure),
--- Head, Tail, and Replicate (characters and strings).
---
--- TEST DESCRIPTION:
--- This test, in conjunction with tests CXA4006, CXA4007, and CXA4008,
--- will provide coverage of the most common usages of the functionality
--- found in the Ada.Strings.Bounded package. It deals in large part
--- with truncation effects and options. This test contains many small,
--- specific test cases, situations that are often difficult to generate
--- in large numbers in an application-based test. These cases represent
--- specific usage paradigms in-the-small.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Apr 95 SAIC Corrected errors in Procedure Overwrite subtests.
--- 01 Nov 95 SAIC Fixed bugs for ACVC 2.0.1.
---
---!
-
-with Report;
-with Ada.Strings.Bounded;
-with Ada.Strings.Maps;
-
-procedure CXA4009 is
-
-begin
-
- Report.Test("CXA4009", "Check that the subprograms defined in " &
- "package Ada.Strings.Bounded are available, " &
- "and that they produce correct results, " &
- "especially under conditions where " &
- "truncation of the result is required");
-
- Test_Block:
- declare
-
- package AS renames Ada.Strings;
- package ASB renames Ada.Strings.Bounded;
- package Maps renames Ada.Strings.Maps;
-
- package B10 is new ASB.Generic_Bounded_Length(Max => 10);
- use type B10.Bounded_String;
-
- Result_String : B10.Bounded_String;
- Test_String : B10.Bounded_String;
- AtoE_Bnd_Str : B10.Bounded_String := B10.To_Bounded_String("abcde");
- FtoJ_Bnd_Str : B10.Bounded_String := B10.To_Bounded_String("fghij");
- AtoJ_Bnd_Str : B10.Bounded_String :=
- B10.To_Bounded_String("abcdefghij");
-
- Location : Natural := 0;
- Total_Count : Natural := 0;
-
- CD_Set : Maps.Character_Set := Maps.To_Set("cd");
- XY_Set : Maps.Character_Set := Maps.To_Set("xy");
-
-
- begin
-
- -- Function Overwrite with Truncation
- -- Drop = Error (Default).
-
- begin
- Test_String := AtoJ_Bnd_Str;
- Result_String :=
- B10.Overwrite(Source => Test_String, -- "abcdefghij"
- Position => 9,
- New_Item => "xyz",
- Drop => AS.Error);
- Report.Failed("Exception not raised by Function Overwrite");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Function Overwrite");
- end;
-
- -- Drop = Left
-
- Result_String :=
- B10.Overwrite(Source => Test_String, -- "abcdefghij"
- Position => B10.Length(Test_String), -- 10
- New_Item => "xyz",
- Drop => Ada.Strings.Left);
-
- if B10.To_String(Result_String) /= "cdefghixyz" then -- drop a,b
- Report.Failed
- ("Incorrect result from Function Overwrite, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Result_String := B10.Overwrite(Test_String, -- "abcdefghij"
- 3,
- "xxxyyyzzz",
- Ada.Strings.Right);
-
- if B10.To_String(Result_String) /= "abxxxyyyzz" then -- one 'z' dropped
- Report.Failed
- ("Incorrect result from Function Overwrite, Drop = Right");
- end if;
-
- -- Additional cases of function Overwrite.
-
- if B10.Overwrite(B10.To_Bounded_String("a"), -- Source length = 1
- 1,
- " abc ") /=
- B10.To_Bounded_String(" abc ") or
- B10.Overwrite(B10.Null_Bounded_String, -- Null source
- 1,
- "abcdefghij") /=
- AtoJ_Bnd_Str or
- B10.Overwrite(AtoE_Bnd_Str,
- B10.To_String(AtoE_Bnd_Str)'First,
- " ") /= -- New_Item = 1
- B10.To_Bounded_String(" bcde")
- then
- Report.Failed("Incorrect result from Function Overwrite");
- end if;
-
-
-
- -- Procedure Overwrite
- -- Correct usage, no truncation.
-
- Test_String := AtoE_Bnd_Str; -- "abcde"
- B10.Overwrite(Test_String, 2, "xyz");
-
- if Test_String /= B10.To_Bounded_String("axyze") then
- Report.Failed("Incorrect result from Procedure Overwrite - 1");
- end if;
-
- Test_String := B10.To_Bounded_String("abc");
- B10.Overwrite(Test_String, 2, ""); -- New_Item is null string.
-
- if Test_String /= B10.To_Bounded_String("abc") then
- Report.Failed("Incorrect result from Procedure Overwrite - 2");
- end if;
-
- -- Drop = Error (Default).
-
- begin
- Test_String := AtoJ_Bnd_Str;
- B10.Overwrite(Source => Test_String, -- "abcdefghij"
- Position => 8,
- New_Item => "uvwxyz");
- Report.Failed("Exception not raised by Procedure Overwrite");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure Overwrite");
- end;
-
- -- Drop = Left
-
- Test_String := AtoJ_Bnd_Str;
- B10.Overwrite(Source => Test_String, -- "abcdefghij"
- Position => B10.Length(Test_String) - 2, -- 8
- New_Item => "uvwxyz",
- Drop => Ada.Strings.Left);
-
- if B10.To_String(Test_String) /= "defguvwxyz" then -- drop a-c
- Report.Failed
- ("Incorrect result from Procedure Overwrite, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Test_String := AtoJ_Bnd_Str;
- B10.Overwrite(Test_String, -- "abcdefghij"
- 3,
- "xxxyyyzzz",
- Ada.Strings.Right);
-
- if B10.To_String(Test_String) /= "abxxxyyyzz" then -- one 'z' dropped
- Report.Failed
- ("Incorrect result from Procedure Overwrite, Drop = Right");
- end if;
-
-
-
- -- Function Delete
-
- if B10.Delete(Source => AtoJ_Bnd_Str, -- "abcdefghij"
- From => 3,
- Through => 8) /=
- B10."&"(B10.Head(AtoJ_Bnd_Str, 2),
- B10.Tail(AtoJ_Bnd_Str, 2)) or
- B10.Delete(AtoJ_Bnd_Str, 6, B10.Length(AtoJ_Bnd_Str)) /=
- AtoE_Bnd_Str or
- B10.Delete(AtoJ_Bnd_Str, 1, 5) /=
- FtoJ_Bnd_Str or
- B10.Delete(AtoE_Bnd_Str, 4, 5) /=
- B10.Delete(AtoJ_Bnd_Str, 4, B10.Length(AtoJ_Bnd_Str))
- then
- Report.Failed("Incorrect result from Function Delete - 1");
- end if;
-
- if B10.Delete(B10.To_Bounded_String("a"), 1, 1) /=
- B10.Null_Bounded_String or
- B10.Delete(AtoE_Bnd_Str,
- 5,
- B10.To_String(AtoE_Bnd_Str)'First) /=
- AtoE_Bnd_Str or
- B10.Delete(AtoE_Bnd_Str,
- B10.To_String(AtoE_Bnd_Str)'Last,
- B10.To_String(AtoE_Bnd_Str)'Last) /=
- B10.To_Bounded_String("abcd")
- then
- Report.Failed("Incorrect result from Function Delete - 2");
- end if;
-
-
-
- -- Function Trim
-
- declare
-
- Text : B10.Bounded_String := B10.To_Bounded_String("Text");
- type Bnd_Array_Type is array (1..5) of B10.Bounded_String;
- Bnd_Array : Bnd_Array_Type :=
- (B10.To_Bounded_String(" Text"),
- B10.To_Bounded_String("Text "),
- B10.To_Bounded_String(" Text "),
- B10.To_Bounded_String("Text Text"), -- Ensure no inter-string
- B10.To_Bounded_String(" Text Text")); -- trimming of blanks.
-
- begin
-
- for i in Bnd_Array_Type'Range loop
- case i is
- when 4 =>
- if B10.Trim(Bnd_Array(i), AS.Both) /=
- Bnd_Array(i) then -- no change
- Report.Failed("Incorrect result from Function Trim - 4");
- end if;
- when 5 =>
- if B10.Trim(Bnd_Array(i), AS.Both) /=
- B10."&"(Text, B10."&"(' ', Text)) then
- Report.Failed("Incorrect result from Function Trim - 5");
- end if;
- when others =>
- if B10.Trim(Bnd_Array(i), AS.Both) /= Text then
- Report.Failed("Incorrect result from Function Trim - " &
- Integer'Image(i));
- end if;
- end case;
- end loop;
-
- end;
-
-
-
- -- Function Trim using Sets
-
- -- Trim characters in sets from both sides of the bounded string.
- if B10.Trim(Source => B10.To_Bounded_String("ddabbaxx"),
- Left => CD_Set,
- Right => XY_Set) /=
- B10.To_Bounded_String("abba")
- then
- Report.Failed
- ("Incorrect result from Fn Trim - Sets, Left & Right side - 1");
- end if;
-
- -- Ensure that the characters in the set provided as the actual to
- -- parameter Right are not trimmed from the left side of the bounded
- -- string; likewise for the opposite side. Only "cd" trimmed from left
- -- side, and only "xy" trimmed from right side.
-
- if B10.Trim(B10.To_Bounded_String("cdxyabcdxy"), CD_Set, XY_Set) /=
- B10.To_Bounded_String("xyabcd")
- then
- Report.Failed
- ("Incorrect result from Fn Trim - Sets, Left & Right side - 2");
- end if;
-
- -- Ensure that characters contained in the sets are not trimmed from
- -- the "interior" of the bounded string, just the appropriate ends.
-
- if B10.Trim(B10.To_Bounded_String("cdabdxabxy"), CD_Set, XY_Set) /=
- B10.To_Bounded_String("abdxab")
- then
- Report.Failed
- ("Incorrect result from Fn Trim - Sets, Left & Right side - 3");
- end if;
-
- -- Trim characters in set from right side only. No change to Left side.
-
- if B10.Trim(B10.To_Bounded_String("abxyzddcd"), XY_Set, CD_Set) /=
- B10.To_Bounded_String("abxyz")
- then
- Report.Failed
- ("Incorrect result from Fn Trim - Sets, Right side");
- end if;
-
- -- Trim no characters on either side of the bounded string.
-
- Result_String := B10.Trim(AtoJ_Bnd_Str, CD_Set, XY_Set);
- if Result_String /= AtoJ_Bnd_Str then
- Report.Failed("Incorrect result from Fn Trim - Sets, Neither side");
- end if;
-
- if B10.Trim(AtoE_Bnd_Str, Maps.Null_Set, Maps.Null_Set) /=
- AtoE_Bnd_Str or
- B10.Trim(B10.To_Bounded_String("dcddcxyyxx"),
- CD_Set,
- XY_Set) /=
- B10.Null_Bounded_String
- then
- Report.Failed("Incorrect result from Function Trim");
- end if;
-
-
-
- -- Procedure Trim using Sets
-
- -- Trim characters in sets from both sides of the bounded string.
-
- Test_String := B10.To_Bounded_String("dcabbayx");
- B10.Trim(Source => Test_String,
- Left => CD_Set,
- Right => XY_Set);
-
- if Test_String /= B10.To_Bounded_String("abba") then
- Report.Failed
- ("Incorrect result from Proc Trim - Sets, Left & Right side - 1");
- end if;
-
- -- Ensure that the characters in the set provided as the actual to
- -- parameter Right are not trimmed from the left side of the bounded
- -- string; likewise for the opposite side. Only "cd" trimmed from left
- -- side, and only "xy" trimmed from right side.
-
- Test_String := B10.To_Bounded_String("cdxyabcdxy");
- B10.Trim(Test_String, CD_Set, XY_Set);
-
- if Test_String /= B10.To_Bounded_String("xyabcd") then
- Report.Failed
- ("Incorrect result from Proc Trim - Sets, Left & Right side - 2");
- end if;
-
- -- Ensure that characters contained in the sets are not trimmed from
- -- the "interior" of the bounded string, just the appropriate ends.
-
- Test_String := B10.To_Bounded_String("cdabdxabxy");
- B10.Trim(Test_String, CD_Set, XY_Set);
-
- if not (Test_String = B10.To_Bounded_String("abdxab")) then
- Report.Failed
- ("Incorrect result from Proc Trim - Sets, Left & Right side - 3");
- end if;
-
- -- Trim characters in set from Left side only. No change to Right side.
-
- Test_String := B10.To_Bounded_String("cccdabxyz");
- B10.Trim(Test_String, CD_Set, XY_Set);
-
- if Test_String /= B10.To_Bounded_String("abxyz") then
- Report.Failed
- ("Incorrect result from Proc Trim for Sets, Left side only");
- end if;
-
- -- Trim no characters on either side of the bounded string.
-
- Test_String := AtoJ_Bnd_Str;
- B10.Trim(Test_String, CD_Set, CD_Set);
-
- if Test_String /= AtoJ_Bnd_Str then
- Report.Failed("Incorrect result from Proc Trim-Sets, Neither side");
- end if;
-
-
-
- -- Function Head with Truncation
- -- Drop = Error (Default).
-
- begin
- Result_String := B10.Head(Source => AtoJ_Bnd_Str, -- max length
- Count => B10.Length(AtoJ_Bnd_Str) + 1,
- Pad => 'X');
- Report.Failed("Length_Error not raised by Function Head");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Function Head");
- end;
-
- -- Drop = Left
-
- -- Pad characters (5) are appended to the right end of the string
- -- (which is initially at its maximum length), then the first five
- -- characters of the intermediate result are dropped to conform to
- -- the maximum size limit of the bounded string (10).
-
- Result_String := B10.Head(B10.To_Bounded_String("ABCDEFGHIJ"),
- 15,
- 'x',
- Ada.Strings.Left);
-
- if Result_String /= B10.To_Bounded_String("FGHIJxxxxx") then
- Report.Failed("Incorrect result from Function Head, Drop = Left");
- end if;
-
- -- Drop = Right
-
- -- Pad characters (6) are appended to the left end of the string
- -- (which is initially at one less than its maximum length), then the
- -- last five characters of the intermediate result are dropped
- -- (which in this case are the pad characters) to conform to the
- -- maximum size limit of the bounded string (10).
-
- Result_String := B10.Head(B10.To_Bounded_String("ABCDEFGHI"),
- 15,
- 'x',
- Ada.Strings.Right);
-
- if Result_String /= B10.To_Bounded_String("ABCDEFGHIx") then
- Report.Failed("Incorrect result from Function Head, Drop = Right");
- end if;
-
- -- Additional cases.
-
- if B10.Head(B10.Null_Bounded_String, 5) /=
- B10.To_Bounded_String(" ") or
- B10.Head(AtoE_Bnd_Str,
- B10.Length(AtoE_Bnd_Str)) /=
- AtoE_Bnd_Str
- then
- Report.Failed("Incorrect result from Function Head");
- end if;
-
-
-
- -- Function Tail with Truncation
- -- Drop = Error (Default Case)
-
- begin
- Result_String := B10.Tail(Source => AtoJ_Bnd_Str, -- max length
- Count => B10.Length(AtoJ_Bnd_Str) + 1,
- Pad => Ada.Strings.Space,
- Drop => Ada.Strings.Error);
- Report.Failed("Length_Error not raised by Function Tail");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Function Tail");
- end;
-
- -- Drop = Left
-
- -- Pad characters (5) are appended to the left end of the string
- -- (which is initially at two less than its maximum length), then
- -- the first three characters of the intermediate result (in this
- -- case, 3 pad characters) are dropped.
-
- Result_String := B10.Tail(B10.To_Bounded_String("ABCDEFGH"), -- 8 ch
- 13,
- 'x',
- Ada.Strings.Left);
-
- if Result_String /= B10.To_Bounded_String("xxABCDEFGH") then
- Report.Failed("Incorrect result from Function Tail, Drop = Left");
- end if;
-
- -- Drop = Right
-
- -- Pad characters (3) are appended to the left end of the string
- -- (which is initially at its maximum length), then the last three
- -- characters of the intermediate result are dropped.
-
- Result_String := B10.Tail(B10.To_Bounded_String("ABCDEFGHIJ"),
- 13,
- 'x',
- Ada.Strings.Right);
-
- if Result_String /= B10.To_Bounded_String("xxxABCDEFG") then
- Report.Failed("Incorrect result from Function Tail, Drop = Right");
- end if;
-
- -- Additional cases.
-
- if B10.Tail(B10.Null_Bounded_String, 3, ' ') /=
- B10.To_Bounded_String(" ") or
- B10.Tail(AtoE_Bnd_Str,
- B10.To_String(AtoE_Bnd_Str)'First) /=
- B10.To_Bounded_String("e")
- then
- Report.Failed("Incorrect result from Function Tail");
- end if;
-
-
-
- -- Function Replicate (#, Char) with Truncation
- -- Drop = Error (Default).
-
- begin
- Result_String := B10.Replicate(Count => B10.Max_Length + 5,
- Item => 'A',
- Drop => AS.Error);
- Report.Failed
- ("Length_Error not raised by Replicate for characters");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed
- ("Incorrect exception raised by Replicate for characters");
- end;
-
- -- Drop = Left, Right
- -- Since this version of Replicate uses character parameters, the
- -- result after truncation from left or right will appear the same.
- -- The result will be a 10 character bounded string, composed of 10
- -- "Item" characters.
-
- if B10.Replicate(Count => 20, Item => 'A', Drop => Ada.Strings.Left) /=
- B10.Replicate(15, 'A', Ada.Strings.Right)
- then
- Report.Failed("Incorrect result from Replicate for characters - 1");
- end if;
-
- -- Blank-filled 10 character bounded strings.
-
- if B10.Replicate(B10.Max_Length + 1, ' ', Drop => Ada.Strings.Left) /=
- B10.Replicate(B10.Max_Length, Ada.Strings.Space)
- then
- Report.Failed("Incorrect result from Replicate for characters - 2");
- end if;
-
- -- Additional cases.
-
- if B10.Replicate(0, 'a') /= B10.Null_Bounded_String or
- B10.Replicate(1, 'a') /= B10.To_Bounded_String("a")
- then
- Report.Failed("Incorrect result from Replicate for characters - 3");
- end if;
-
-
-
- -- Function Replicate (#, String) with Truncation
- -- Drop = Error (Default).
-
- begin
- Result_String := B10.Replicate(Count => 5, -- result would be 15.
- Item => "abc");
- Report.Failed
- ("Length_Error not raised by Replicate for strings");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed
- ("Incorrect exception raised by Replicate for strings");
- end;
-
- -- Drop = Left
-
- Result_String := B10.Replicate(3, "abcd", Drop => Ada.Strings.Left);
-
- if Result_String /= B10.To_Bounded_String("cdabcdabcd") then
- Report.Failed
- ("Incorrect result from Replicate for strings, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Result_String := B10.Replicate(3, "abcd", Drop => Ada.Strings.Right);
-
- if Result_String /= B10.To_Bounded_String("abcdabcdab") then
- Report.Failed
- ("Incorrect result from Replicate for strings, Drop = Right");
- end if;
-
- -- Additional cases.
-
- if B10.Replicate(10, "X") /= B10.To_Bounded_String("XXXXXXXXXX") or
- B10.Replicate(10, "") /= B10.Null_Bounded_String or
- B10.Replicate( 0, "ab") /= B10.Null_Bounded_String
- then
- Report.Failed("Incorrect result from Replicate for strings");
- end if;
-
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4009;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4010.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4010.a
deleted file mode 100644
index 8646b12b5e4..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4010.a
+++ /dev/null
@@ -1,275 +0,0 @@
--- CXA4010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Unbounded
--- are available, and that they produce correct results. Specifically,
--- check the subprograms To_String, To_Unbounded_String, Insert, "&",
--- "*", Length, Slice, Replace_Slice, Overwrite, Index, Index_Non_Blank,
--- Head, Tail, and "=", "<=", ">=".
---
--- TEST DESCRIPTION:
--- This test demonstrates the uses of many of the subprograms defined
--- in package Ada.Strings.Unbounded for use with unbounded strings.
--- The test simulates how unbounded strings could be used
--- to simulate paragraphs of text. Modifications could be easily be
--- performed using the provided subprograms (although in this test, the
--- main modification performed was the addition of more text to the
--- string). One would not have to worry about the formatting of the
--- paragraph until it was finished and correct in content. Then, once
--- all required editing is complete, the unbounded strings can be divided
--- up into the appropriate lengths based on particular formatting
--- requirements. The test then compares the formatted text product
--- with a predefined "finished product".
---
--- This test uses a large number of the subprograms provided
--- by package Ada.Strings.Unbounded. Often, the processing involved
--- could have been performed more efficiently using a minimum number
--- of the subprograms, in conjunction with loops, etc. However, for
--- testing purposes, and in the interest of minimizing the number of
--- tests developed, subprogram variety and feature mixing was stressed.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-with Ada.Strings.Maps;
-with Ada.Strings.Unbounded;
-
-procedure CXA4010 is
-begin
-
- Report.Test ("CXA4010", "Check that the subprograms defined in " &
- "package Ada.Strings.Unbounded are available, " &
- "and that they produce correct results");
-
- Test_Block:
- declare
-
- package ASUnb renames Ada.Strings.Unbounded;
- use type ASUnb.Unbounded_String;
- use Ada.Strings;
-
- Pamphlet_Paragraph_Count : constant := 2;
- Lines : constant := 4;
- Line_Length : constant := 40;
-
- type Document_Type is array (Positive range <>)
- of ASUnb.Unbounded_String;
-
- type Camera_Ready_Copy_Type is array (1..Lines)
- of String (1..Line_Length);
-
- Pamphlet : Document_Type (1..Pamphlet_Paragraph_Count);
-
- Camera_Ready_Copy : Camera_Ready_Copy_Type :=
- (others => (others => Ada.Strings.Space));
-
- TC_Finished_Product : Camera_Ready_Copy_Type :=
- ( 1 => "Ada is a programming language designed ",
- 2 => "to support long-lived, reliable software",
- 3 => " systems. ",
- 4 => "Go with Ada! ");
-
- -----
-
-
- procedure Enter_Text_Into_Document (Document : in out Document_Type) is
- begin
-
- -- Fill in both "paragraphs" of the document. Each unbounded string
- -- functions as an individual paragraph, containing an unspecified
- -- number of characters.
- -- Use a variety of different unbounded string subprograms to load
- -- the data.
-
- Document(1) := ASUnb.To_Unbounded_String("Ada is a language");
-
- -- Insert the word "programming" prior to "language".
- Document(1) :=
- ASUnb.Insert(Document(1),
- ASUnb.Index(Document(1),
- "language"),
- ASUnb.To_String("progra" & -- Str &
- ASUnb."*"(2,'m') & -- Unbd &
- "ing ")); -- Str
-
-
- -- Overwrite the word "language" with "language" + additional text.
- Document(1) :=
- ASUnb.Overwrite(Document(1),
- ASUnb.Index(Document(1),
- ASUnb.To_String(
- ASUnb.Tail(Document(1), 8, ' ')),
- Ada.Strings.Backward),
- "language designed to support long-lifed");
-
-
- -- Replace the word "lifed" with "lived".
- Document(1) :=
- ASUnb.Replace_Slice(Document(1),
- ASUnb.Index(Document(1), "lifed"),
- ASUnb.Length(Document(1)),
- "lived");
-
-
- -- Overwrite the word "lived" with "lived" + additional text.
- Document(1) :=
- ASUnb.Overwrite(Document(1),
- ASUnb.Index(Document(1),
- ASUnb.To_String(
- ASUnb.Tail(Document(1), 5, ' ')),
- Ada.Strings.Backward),
- "lived, reliable software systems.");
-
-
- -- Use several of the overloaded versions of "&" to form this
- -- unbounded string.
-
- Document(2) := 'G' &
- ASUnb.To_Unbounded_String("o ") &
- ASUnb.To_Unbounded_String("with") &
- ' ' &
- "Ada!";
-
- end Enter_Text_Into_Document;
-
-
- -----
-
-
- procedure Create_Camera_Ready_Copy
- (Document : in Document_Type;
- Camera_Copy : out Camera_Ready_Copy_Type) is
- begin
- -- Break the unbounded strings into fixed lengths.
-
- -- Search the first unbounded string for portions of text that
- -- are less than or equal to the length of a string in the
- -- Camera_Ready_Copy_Type object.
-
- Camera_Copy(1) := -- Take characters 1-39,
- ASUnb.Slice(Document(1), -- and append a blank space.
- 1,
- ASUnb.Index(ASUnb.To_Unbounded_String(
- ASUnb.Slice(Document(1),
- 1,
- Line_Length)),
- Ada.Strings.Maps.To_Set(' '),
- Ada.Strings.Inside,
- Ada.Strings.Backward)) & ' ';
-
- Camera_Copy(2) := -- Take characters 40-79.
- ASUnb.Slice(Document(1),
- 40,
- (ASUnb.Index_Non_Blank -- Should return 79
- (ASUnb.To_Unbounded_String
- (ASUnb.Slice(Document(1), -- Slice (40..79)
- 40,
- 79)),
- Ada.Strings.Backward) + 39)); -- Increment since
- -- this slice starts
- -- at 40.
-
- Camera_Copy(3)(1..9) := ASUnb.Slice(Document(1), -- Characters 80-88
- 80,
- ASUnb.Length(Document(1)));
-
-
- -- Break the second unbounded string into the appropriate length.
- -- It is only twelve characters in length, so the entire unbounded
- -- string will be placed on one string of the output object.
-
- Camera_Copy(4)(1..ASUnb.Length(Document(2))) :=
- ASUnb.To_String(ASUnb.Head(Document(2),
- ASUnb.Length(Document(2))));
-
- end Create_Camera_Ready_Copy;
-
-
- -----
-
-
- function Valid_Proofread (Draft, Master : Camera_Ready_Copy_Type)
- return Boolean is
- begin
-
- -- Evaluate strings for equality, using the operators defined in
- -- package Ada.Strings.Unbounded. The less than/greater than or
- -- equal comparisons should evaluate to "equals => True".
-
- if ASUnb.To_Unbounded_String(Draft(1)) = -- "="(Unb,Unb)
- ASUnb.To_Unbounded_String(Master(1)) and
- ASUnb.To_Unbounded_String(Draft(2)) <= -- "<="(Unb,Unb)
- ASUnb.To_Unbounded_String(Master(2)) and
- ASUnb.To_Unbounded_String(Draft(3)) >= -- ">="(Unb,Unb)
- ASUnb.To_Unbounded_String(Master(3)) and
- ASUnb.To_Unbounded_String(Draft(4)) = -- "="(Unb,Unb)
- ASUnb.To_Unbounded_String(Master(4))
- then
- return True;
- else
- return False;
- end if;
-
- end Valid_Proofread;
-
-
- -----
-
-
- begin
-
- -- Enter text into the unbounded string paragraphs of the document.
-
- Enter_Text_Into_Document (Pamphlet);
-
-
- -- Reformat the unbounded strings into fixed string format.
-
- Create_Camera_Ready_Copy (Document => Pamphlet,
- Camera_Copy => Camera_Ready_Copy);
-
-
- -- Verify the conversion process.
-
- if not Valid_Proofread (Draft => Camera_Ready_Copy,
- Master => TC_Finished_Product)
- then
- Report.Failed ("Incorrect string processing result");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4010;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4011.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4011.a
deleted file mode 100644
index 05388a04ba7..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4011.a
+++ /dev/null
@@ -1,376 +0,0 @@
--- CXA4011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Unbounded
--- are available, and that they produce correct results. Specifically,
--- check the subprograms To_Unbounded_String, "&", ">", "<", Element,
--- Replace_Element, Count, Find_Token, Translate, Trim, Delete, and
--- "*".
---
--- TEST DESCRIPTION:
--- This test demonstrates the uses of many of the subprograms defined
--- in package Ada.Strings.Unbounded for use with unbounded strings.
--- The test simulates how unbounded strings could be processed in a
--- user environment, using the subprograms provided in this package.
---
--- This test uses a variety of the subprograms defined in the unbounded
--- string package in ways typical of common usage, with different
--- combinations of available subprograms being used to accomplish
--- similar unbounded string processing goals.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 27 Feb 95 SAIC Test description modification.
--- 01 Nov 95 SAIC Update and repair for ACVC 2.0.1.
---
---!
-
-with Report;
-with Ada.Strings.Maps;
-with Ada.Strings.Unbounded;
-
-procedure CXA4011 is
-begin
-
- Report.Test ("CXA4011", "Check that the subprograms defined in " &
- "package Ada.Strings.Unbounded are available, " &
- "and that they produce correct results");
-
- Test_Block:
- declare
-
- package ASUnb renames Ada.Strings.Unbounded;
- use Ada.Strings;
- use type Maps.Character_Set;
- use type ASUnb.Unbounded_String;
-
- Cad_String : ASUnb.Unbounded_String :=
- ASUnb.To_Unbounded_String("cad");
-
- Complete_String : ASUnb.Unbounded_String :=
- ASUnb.To_Unbounded_String("Incomplete") &
- Ada.Strings.Space &
- ASUnb.To_Unbounded_String("String");
-
- Incomplete_String : ASUnb.Unbounded_String :=
- ASUnb.To_Unbounded_String("ncomplete Strin");
-
- Incorrect_Spelling : ASUnb.Unbounded_String :=
- ASUnb.To_Unbounded_String("Guob Dai");
-
- Magic_String : ASUnb.Unbounded_String :=
- ASUnb.To_Unbounded_String("abracadabra");
-
- Incantation : ASUnb.Unbounded_String := Magic_String;
-
-
- A_Small_G : Character := 'g';
- A_Small_D : Character := 'd';
-
- ABCD_Set : Maps.Character_Set := Maps.To_Set("abcd");
- B_Set : Maps.Character_Set := Maps.To_Set('b');
- AB_Set : Maps.Character_Set := Maps."OR"(Maps.To_Set('a'), B_Set);
-
- Code_Map : Maps.Character_Mapping :=
- Maps.To_Mapping(From => "abcd", To => "wxyz");
- Reverse_Code_Map : Maps.Character_Mapping :=
- Maps.To_Mapping(From => "wxyz", To => "abcd");
- Non_Existent_Map : Maps.Character_Mapping :=
- Maps.To_Mapping(From => "jkl", To => "mno");
-
-
- Token_Start : Positive;
- Token_End : Natural := 0;
- Matching_Letters : Natural := 0;
-
-
- begin
-
- -- "&"
-
- -- Prepend an 'I' and append a 'g' to the string.
- Incomplete_String := ASUnb."&"('I', Incomplete_String); -- Char & Unb
- Incomplete_String := ASUnb."&"(Incomplete_String,
- A_Small_G); -- Unb & Char
-
- if Incomplete_String < Complete_String or
- Incomplete_String > Complete_String or
- Incomplete_String /= Complete_String
- then
- Report.Failed("Incorrect result from use of ""&"" operator");
- end if;
-
-
- -- Element
-
- -- Last element of the unbounded string should be a 'g'.
- if ASUnb.Element(Incomplete_String, ASUnb.Length(Incomplete_String)) /=
- A_Small_G
- then
- Report.Failed("Incorrect result from use of Function Element - 1");
- end if;
-
- if ASUnb.Element(Incomplete_String, 2) /=
- ASUnb.Element(ASUnb.Tail(Incomplete_String, 2), 1) or
- ASUnb.Element(ASUnb.Head(Incomplete_String, 4), 2) /=
- ASUnb.Element(ASUnb.To_Unbounded_String("wnqz"), 2)
- then
- Report.Failed("Incorrect result from use of Function Element - 2");
- end if;
-
-
- -- Replace_Element
-
- -- The unbounded string Incorrect_Spelling starts as "Guob Dai", and
- -- is transformed by the following three procedure calls to "Good Day".
-
- ASUnb.Replace_Element(Incorrect_Spelling, 2, 'o');
-
- ASUnb.Replace_Element(Incorrect_Spelling,
- ASUnb.Index(Incorrect_Spelling, B_Set),
- A_Small_D);
-
- ASUnb.Replace_Element(Source => Incorrect_Spelling,
- Index => ASUnb.Length(Incorrect_Spelling),
- By => 'y');
-
- if Incorrect_Spelling /= ASUnb.To_Unbounded_String("Good Day") then
- Report.Failed("Incorrect result from Procedure Replace_Element");
- end if;
-
-
- -- Count
-
- -- Determine the number of characters in the unbounded string that
- -- are contained in the set.
-
- Matching_Letters := ASUnb.Count(Source => Magic_String,
- Set => ABCD_Set);
-
- if Matching_Letters /= 9 then
- Report.Failed
- ("Incorrect result from Function Count with Set parameter");
- end if;
-
- -- Determine the number of occurrences of the following pattern strings
- -- in the unbounded string Magic_String.
-
- if ASUnb.Count(Magic_String, "ab") /=
- (ASUnb.Count(Magic_String, "ac") + ASUnb.Count(Magic_String, "ad")) or
- ASUnb.Count(Magic_String, "ab") /= 2
- then
- Report.Failed
- ("Incorrect result from Function Count with String parameter");
- end if;
-
-
- -- Find_Token
-
- ASUnb.Find_Token(Magic_String, -- Find location of first "ab".
- AB_Set, -- Should be (1..2).
- Ada.Strings.Inside,
- Token_Start,
- Token_End);
-
- if Natural(Token_Start) /= ASUnb.To_String(Magic_String)'First or
- Token_End /= ASUnb.Index(Magic_String, B_Set)
- then
- Report.Failed("Incorrect result from Procedure Find_Token - 1");
- end if;
-
-
- ASUnb.Find_Token(Source => Magic_String, -- Find location of char 'r'
- Set => ABCD_Set, -- in string, should be (3..3)
- Test => Ada.Strings.Outside,
- First => Token_Start,
- Last => Token_End);
-
- if Natural(Token_Start) /= 3 or
- Token_End /= 3 then
- Report.Failed("Incorrect result from Procedure Find_Token - 2");
- end if;
-
-
- ASUnb.Find_Token(Magic_String, -- No 'g' is in the string, so
- Maps.To_Set(A_Small_G), -- the result parameters should
- Ada.Strings.Inside, -- be First = Source'First and
- First => Token_Start, -- Last = 0.
- Last => Token_End);
-
- if Token_Start /= ASUnb.To_String(Magic_String)'First or
- Token_End /= 0
- then
- Report.Failed("Incorrect result from Procedure Find_Token - 3");
- end if;
-
-
- -- Translate
-
- -- Use a mapping ("abcd" -> "wxyz") to transform the contents of
- -- the unbounded string.
- -- Magic_String = "abracadabra"
-
- Incantation := ASUnb.Translate(Magic_String, Code_Map);
-
- if Incantation /= ASUnb.To_Unbounded_String("wxrwywzwxrw") then
- Report.Failed("Incorrect result from Function Translate");
- end if;
-
- -- Use the inverse mapping of the one above to return the "translated"
- -- unbounded string to its original form.
-
- ASUnb.Translate(Incantation, Reverse_Code_Map);
-
- -- The map contained in the following call to Translate contains one
- -- element, and this element is not found in the unbounded string, so
- -- this call to Translate should have no effect on the unbounded string.
-
- if Incantation /= ASUnb.Translate(Magic_String, Non_Existent_Map) then
- Report.Failed("Incorrect result from Procedure Translate");
- end if;
-
-
- -- Trim
-
- Trim_Block:
- declare
-
- XYZ_Set : Maps.Character_Set := Maps.To_Set("xyz");
- PQR_Set : Maps.Character_Set := Maps.To_Set("pqr");
-
- Pad : constant ASUnb.Unbounded_String :=
- ASUnb.To_Unbounded_String("Pad");
-
- The_New_Ada : constant ASUnb.Unbounded_String :=
- ASUnb.To_Unbounded_String("Ada9X");
-
- Space_Array : array (1..4) of ASUnb.Unbounded_String :=
- (ASUnb.To_Unbounded_String(" Pad "),
- ASUnb.To_Unbounded_String("Pad "),
- ASUnb.To_Unbounded_String(" Pad"),
- Pad);
-
- String_Array : array (1..5) of ASUnb.Unbounded_String :=
- (ASUnb.To_Unbounded_String("xyzxAda9Xpqr"),
- ASUnb.To_Unbounded_String("Ada9Xqqrp"),
- ASUnb.To_Unbounded_String("zxyxAda9Xqpqr"),
- ASUnb.To_Unbounded_String("xxxyAda9X"),
- The_New_Ada);
-
- begin
-
- -- Examine the version of Trim that removes blanks from
- -- the left and/or right of a string.
-
- for i in 1..4 loop
- if ASUnb.Trim(Space_Array(i), Ada.Strings.Both) /= Pad then
- Report.Failed("Incorrect result from Trim for spaces - " &
- Integer'Image(i));
- end if;
- end loop;
-
- -- Examine the version of Trim that removes set characters from
- -- the left and right of a string.
-
- for i in 1..5 loop
- if ASUnb.Trim(String_Array(i),
- Left => XYZ_Set,
- Right => PQR_Set) /= The_New_Ada then
- Report.Failed
- ("Incorrect result from Trim for set characters - " &
- Integer'Image(i));
- end if;
- end loop;
-
- end Trim_Block;
-
-
- -- Delete
-
- -- Use the Delete function to remove the first four and last four
- -- characters from the string.
-
- if ASUnb.Delete(Source => ASUnb.Delete(Magic_String,
- 8,
- ASUnb.Length(Magic_String)),
- From => ASUnb.To_String(Magic_String)'First,
- Through => 4) /=
- Cad_String
- then
- Report.Failed("Incorrect results from Function Delete");
- end if;
-
-
- -- Constructors ("*")
-
- Constructor_Block:
- declare
-
- SOS : ASUnb.Unbounded_String;
-
- Dot : constant ASUnb.Unbounded_String :=
- ASUnb.To_Unbounded_String("Dot_");
- Dash : constant String := "Dash_";
-
- Distress : ASUnb.Unbounded_String :=
- ASUnb.To_Unbounded_String("Dot_Dot_Dot_") &
- ASUnb.To_Unbounded_String("Dash_Dash_Dash_") &
- ASUnb.To_Unbounded_String("Dot_Dot_Dot");
-
- Repeat : constant Natural := 3;
- Separator : constant Character := '_';
-
- Separator_Set : Maps.Character_Set := Maps.To_Set(Separator);
-
- begin
-
- -- Use the following constructor forms to construct the string
- -- "Dot_Dot_Dot_Dash_Dash_Dash_Dot_Dot_Dot". Note that the
- -- trailing underscore in the string is removed in the call to
- -- Trim in the If statement condition.
-
- SOS := ASUnb."*"(Repeat, Dot); -- "*"(#, Unb Str)
-
- SOS := SOS &
- ASUnb."*"(Repeat, Dash) & -- "*"(#, Str)
- ASUnb."*"(Repeat, Dot); -- "*"(#, Unb Str)
-
- if ASUnb.Trim(SOS, Maps.Null_Set, Separator_Set) /= Distress then
- Report.Failed("Incorrect results from Function ""*""");
- end if;
-
- end Constructor_Block;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4011;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4012.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4012.a
deleted file mode 100644
index 5ab12b6dfa9..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4012.a
+++ /dev/null
@@ -1,305 +0,0 @@
--- CXA4012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the types, operations, and other entities defined within
--- the package Ada.Strings.Wide_Maps are available and produce correct
--- results.
---
--- TEST DESCRIPTION:
--- This test demonstrates the availability and function of the types and
--- operations defined in package Ada.Strings.Wide_Maps. It demonstrates
--- the use of these types and functions as they would be used in common
--- programming practice.
--- Wide_Character set creation, assignment, and comparison are evaluated
--- in this test. Each of the functions provided in package
--- Ada.Strings.Wide_Maps is utilized in creating or manipulating set
--- objects, and the function results are evaluated for correctness.
--- Wide_Character sequences are examined using the functions provided for
--- manipulating objects of this type. Likewise, Wide_Character maps are
--- created, and their contents evaluated. Exception raising conditions
--- from the function To_Mapping are also created.
--- Note: Throughout this test, the set logical operators are printed in
--- capital letters to enhance their visibility.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 01 Nov 95 SAIC Update and repair for ACVC 2.0.1.
---
---!
-
-with Ada.Characters.Handling;
-with Ada.Strings.Wide_Maps;
-
-package CXA40120 is
-
- function Equiv (Ch : Character) return Wide_Character;
- function Equiv (Str : String)
- return Ada.Strings.Wide_Maps.Wide_Character_Sequence;
- function X_Map(From : Wide_Character) return Wide_Character;
-
-end CXA40120;
-
-package body CXA40120 is
-
- -- The following two functions are used to translate character and string
- -- values to "Wide" values. They will be applied to certain Wide_Map
- -- subprogram parameters to simulate the use of Wide_Characters and
- -- Wide_Character_Sequences in actual practice.
- -- Note: These functions do not actually return "equivalent" wide
- -- characters to their character inputs, just "non-character"
- -- wide characters.
-
- function Equiv (Ch : Character) return Wide_Character is
- C : Character := Ch;
- begin
- if Ch = ' ' then
- return Ada.Characters.Handling.To_Wide_Character(C);
- else
- return Wide_Character'Val(Character'Pos(Ch) +
- Character'Pos(Character'Last) + 1);
- end if;
- end Equiv;
-
- function Equiv (Str : String)
- return Ada.Strings.Wide_Maps.Wide_Character_Sequence is
- use Ada.Strings;
- WS : Wide_Maps.Wide_Character_Sequence(Str'First..Str'Last);
- begin
- for i in Str'First..Str'Last loop
- WS(i) := Equiv(Str(i));
- end loop;
- return WS;
- end Equiv;
-
- function X_Map(From : Wide_Character) return Wide_Character is
- begin
- return Equiv('X');
- end X_Map;
-
-end CXA40120;
-
-
-
-with CXA40120;
-with Ada.Characters.Handling;
-with Ada.Strings.Wide_Maps;
-with Report;
-
-procedure CXA4012 is
-
- use CXA40120;
- use Ada.Strings;
-
-begin
-
- Report.Test ("CXA4012", "Check that the types, operations, and other " &
- "entities defined within the package " &
- "Ada.Strings.Wide_Maps are available and " &
- "produce correct results");
-
- Test_Block:
- declare
-
- use type Wide_Maps.Wide_Character_Set;
-
- MidPoint_Letter : constant := 13;
- Last_Letter : constant := 26;
-
- Vowels : constant Wide_Maps.Wide_Character_Sequence :=
- Equiv("aeiou");
- Quasi_Vowel : constant Wide_Character := Equiv('y');
-
- Alphabet : Wide_Maps.Wide_Character_Sequence(1..Last_Letter);
- Half_Alphabet : Wide_Maps.Wide_Character_Sequence(1..MidPoint_Letter);
- Inverse_Alphabet : Wide_Maps.Wide_Character_Sequence(1..Last_Letter);
-
- Alphabet_Set,
- Consonant_Set,
- Vowel_Set,
- Full_Vowel_Set,
- First_Half_Set,
- Second_Half_Set : Wide_Maps.Wide_Character_Set := Wide_Maps.Null_Set;
-
- begin
-
- -- Load the alphabet string for use in creating sets.
-
- for i in 0..MidPoint_Letter-1 loop
- Half_Alphabet(i+1) :=
- Wide_Character'Val(Wide_Character'Pos(Equiv('a')) + i);
- end loop;
-
- for i in 0..Last_Letter-1 loop
- Alphabet(i+1) :=
- Wide_Character'Val(Wide_Character'Pos(Equiv('a')) + i);
- end loop;
-
-
- -- Initialize a series of Wide_Character_Set objects.
-
- Alphabet_Set := Wide_Maps.To_Set(Alphabet);
- Vowel_Set := Wide_Maps.To_Set(Vowels);
- Full_Vowel_Set := Vowel_Set OR Wide_Maps.To_Set(Quasi_Vowel);
- Consonant_Set := Vowel_Set XOR Alphabet_Set;
-
- First_Half_Set := Wide_Maps.To_Set(Half_Alphabet);
- Second_Half_Set := Alphabet_Set XOR First_Half_Set;
-
-
- -- Evaluation of Set objects, operators, and functions.
-
- if Alphabet_Set /= (Vowel_Set OR Consonant_Set) then
- Report.Failed("Incorrect set combinations using OR operator");
- end if;
-
-
- for i in Vowels'First .. Vowels'Last loop
- if not Wide_Maps.Is_In(Vowels(i), Vowel_Set) or
- not Wide_Maps.Is_In(Vowels(i), Alphabet_Set) or
- Wide_Maps.Is_In(Vowels(i), Consonant_Set)
- then
- Report.Failed("Incorrect function Is_In use with set " &
- "combinations - " & Integer'Image(i));
- end if;
- end loop;
-
-
- if Wide_Maps.Is_Subset(Vowel_Set, First_Half_Set) or
- Wide_Maps."<="(Vowel_Set, Second_Half_Set) or
- not Wide_Maps.Is_Subset(Vowel_Set, Alphabet_Set)
- then
- Report.Failed
- ("Incorrect set evaluation using Is_Subset function");
- end if;
-
-
- if not (Full_Vowel_Set = Wide_Maps.To_Set(Equiv("aeiouy"))) then
- Report.Failed("Incorrect result for ""="" set operator");
- end if;
-
-
- if not ((Vowel_Set AND First_Half_Set) OR
- (Full_Vowel_Set AND Second_Half_Set)) = Full_Vowel_Set then
- Report.Failed
- ("Incorrect result for AND, OR, or ""="" set operators");
- end if;
-
-
- if (Alphabet_Set AND Wide_Maps.Null_Set) /= Wide_Maps.Null_Set or
- (Alphabet_Set OR Wide_Maps.Null_Set) /= Alphabet_Set
- then
- Report.Failed("Incorrect result for AND or OR set operators");
- end if;
-
-
- Vowel_Set := Full_Vowel_Set;
- Vowel_Set := Vowel_Set AND (NOT Wide_Maps.To_Set(Quasi_Vowel));
-
- if not (Vowels = Wide_Maps.To_Sequence(Vowel_Set)) then
- Report.Failed("Incorrect Set to Sequence translation");
- end if;
-
-
- for i in 0..Last_Letter-1 loop
- Inverse_Alphabet(i+1) := Alphabet(Last_Letter-i);
- end loop;
-
-
- -- Wide_Character_Mapping
-
- declare
- Inverse_Map : Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.To_Mapping(Alphabet, Inverse_Alphabet);
- begin
- if Wide_Maps.Value(Wide_Maps.Identity, Equiv('b')) /=
- Wide_Maps.Value(Inverse_Map, Equiv('y'))
- then
- Report.Failed("Incorrect Inverse mapping");
- end if;
- end;
-
-
- -- Check that Translation_Error is raised when a character is
- -- repeated in the parameter "From" string.
- declare
- Bad_Map : Wide_Maps.Wide_Character_Mapping;
- begin
- Bad_Map := Wide_Maps.To_Mapping(From => Equiv("aa"),
- To => Equiv("yz"));
- Report.Failed("Exception not raised with repeated character");
- exception
- when Translation_Error => null; -- OK
- when others =>
- Report.Failed("Incorrect exception raised in To_Mapping with " &
- "a repeated character");
- end;
-
-
- -- Check that Translation_Error is raised when the parameters of the
- -- function To_Mapping are of unequal lengths.
- declare
- Bad_Map : Wide_Maps.Wide_Character_Mapping;
- begin
- Bad_Map := Wide_Maps.To_Mapping(Equiv("abc"), Equiv("yz"));
- Report.Failed
- ("Exception not raised with unequal parameter lengths");
- exception
- when Translation_Error => null; -- OK
- when others =>
- Report.Failed("Incorrect exception raised in To_Mapping with " &
- "unequal parameter lengths");
- end;
-
-
- -- Check that the access-to-subprogram type is defined and available.
- -- This provides for one Wide_Character mapping capability only.
- -- The actual mapping functionality will be tested in conjunction with
- -- the tests of subprograms defined for Wide_String handling.
-
- declare
-
- X_Map_Ptr : Wide_Maps.Wide_Character_Mapping_Function :=
- X_Map'Access;
-
- begin
- if X_Map_Ptr(Equiv('A')) /= -- both return 'X'
- X_Map_Ptr.all(Equiv('Q'))
- then
- Report.Failed
- ("Incorrect result using access-to-subprogram values");
- end if;
- end;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4012;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4013.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4013.a
deleted file mode 100644
index 0f93e9dc8d1..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4013.a
+++ /dev/null
@@ -1,203 +0,0 @@
--- CXA4013.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Wide_Fixed
--- are available, and that they produce correct results. Specifically,
--- check the subprograms Index, "*" (Wide_String constructor function),
--- Count, Trim, and Replace_Slice.
---
--- TEST DESCRIPTION:
--- This test demonstrates how certain Wide_Fixed string functions
--- are used to eliminate specific substrings from portions of text.
--- A procedure is defined that will take as parameters a source
--- Wide_String along with a substring that is to be completely removed
--- from the source string. The source Wide_String is parsed using the
--- Index function, and any substring slices are replaced in the source
--- Wide_String by a series of X's (based on the length of the substring.)
--- Three lines of text are provided to this procedure, and the resulting
--- substitutions are compared with expected results to validate the
--- string processing.
--- A global accumulator is updated with the number of occurrences of the
--- substring in the source string.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Ada.Strings;
-with Ada.Strings.Wide_Fixed;
-with Ada.Strings.Wide_Maps;
-with Report;
-
-procedure CXA4013 is
-
-begin
-
- Report.Test ("CXA4013", "Check that the subprograms defined in package " &
- "Ada.Strings.Wide_Fixed are available, and that " &
- "they produce correct results");
-
- Test_Block:
- declare
-
- TC_Total : Natural := 0;
- Number_Of_Lines : constant := 3;
- WC : Wide_Character :=
- Wide_Character'Val(Character'Pos('X') +
- Character'Pos(Character'Last) +
- 1 );
-
- subtype WS is Wide_String (1..25);
-
- type Restricted_Words_Array_Type is
- array (1..10) of Wide_String (1..10);
-
- Restricted_Words : Restricted_Words_Array_Type :=
- (" platoon", " marines ", " Marines ",
- "north ", "south ", " east",
- " beach ", " airport", "airfield ",
- " road ");
-
- type Page_Of_Text_Type is array (1..Number_Of_Lines) of WS;
-
- Text_Page : Page_Of_Text_Type := ("The platoon of Marines ",
- "moved south on the south ",
- "road to the airfield. ");
-
- TC_Revised_Line_1 : constant Wide_String := "The XXXXXXX of XXXXXXX ";
- TC_Revised_Line_2 : constant Wide_String := "moved XXXXX on the XXXXX ";
- TC_Revised_Line_3 : constant Wide_String := "XXXX to the XXXXXXXX. ";
-
-
- function Equivalent (Left : WS; Right : Wide_String)
- return Boolean is
- begin
- for i in WS'range loop
- if Left(i) /= Right(i) then
- if Left(i) /= WC or Right(i) /= 'X' then
- return False;
- end if;
- end if;
- end loop;
- return True;
- end Equivalent;
-
- ---
-
- procedure Censor (Source_String : in out Wide_String;
- Pattern_String : in Wide_String) is
-
- use Ada.Strings.Wide_Fixed; -- allows infix notation of "*" below.
-
- -- Create a replacement string that is the same length as the
- -- pattern string being removed. Use the infix notation of the
- -- wide string constructor function.
-
- Replacement : constant Wide_String :=
- Pattern_String'Length * WC; -- "*"
-
- Going : Ada.Strings.Direction := Ada.Strings.Forward;
- Start_Pos,
- Index : Natural := Source_String'First;
-
- begin -- Censor
-
- -- Accumulate count of total replacement operations.
-
- TC_Total := TC_Total +
- Ada.Strings.Wide_Fixed.Count -- Count
- (Source => Source_String,
- Pattern => Pattern_String,
- Mapping => Ada.Strings.Wide_Maps.Identity);
- loop
-
- Index := Ada.Strings.Wide_Fixed.Index -- Index
- (Source_String(Start_Pos..Source_String'Last),
- Pattern_String,
- Going,
- Ada.Strings.Wide_Maps.Identity);
-
- exit when Index = 0; -- No matches, exit loop.
-
- -- if a match was found, modify the substring.
- Ada.Strings.Wide_Fixed.Replace_Slice -- Replace_Slice
- (Source_String,
- Index,
- Index + Pattern_String'Length - 1,
- Replacement);
- Start_Pos := Index + Pattern_String'Length;
-
- end loop;
-
- end Censor;
-
-
- begin
-
- -- Invoke Censor subprogram to cleanse text.
- -- Loop through each line of text, and check for the presence of each
- -- restricted word.
- -- Use the Trim function to eliminate leading or trailing blanks from
- -- the restricted word parameters.
-
- for Line in 1..Number_Of_Lines loop
- for Word in Restricted_Words'Range loop
- Censor (Text_Page(Line), -- Trim
- Ada.Strings.Wide_Fixed.Trim(Restricted_Words(Word),
- Ada.Strings.Both));
- end loop;
- end loop;
-
-
- -- Validate results.
-
- if TC_Total /= 6 then
- Report.Failed ("Incorrect number of substitutions performed");
- end if;
-
- if not Equivalent (Text_Page(1), TC_Revised_Line_1) then
- Report.Failed ("Incorrect substitutions on Line 1");
- end if;
-
- if not Equivalent (Text_Page(2), TC_Revised_Line_2) then
- Report.Failed ("Incorrect substitutions on Line 2");
- end if;
-
- if not Equivalent (Text_Page(3), TC_Revised_Line_3) then
- Report.Failed ("Incorrect substitutions on Line 3");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4013;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4014.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4014.a
deleted file mode 100644
index 6e26a0330d5..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4014.a
+++ /dev/null
@@ -1,359 +0,0 @@
--- CXA4014.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Wide_Fixed
--- are available, and that they produce correct results. Specifically,
--- check the subprograms Find_Token, Head, Index, Index_Non_Blank, Move,
--- Overwrite, and Replace_Slice, Tail, and Translate.
--- Use the access-to-subprogram mapping version of Translate (function
--- and procedure).
---
--- TEST DESCRIPTION:
--- This test demonstrates how certain wide fixed string operations could
--- be used in wide string information processing. A procedure is defined
--- that will extract portions of a 50 character string that correspond to
--- certain data items (i.e., name, address, state, zip code). These
--- parsed items will then be added to the appropriate fields of data
--- base elements. These data base elements are then compared for
--- accuracy against a similar set of predefined data base
--- elements.
--- A variety of wide fixed string processing subprograms are used in this
--- test. Each parsing operation attempts to use a different combination
--- of the available subprograms to accomplish the same goal, therefore
--- continuity of approach to wide string parsing is not seen in this
--- test.
--- However, a wide variety of possible approaches are demonstrated, while
--- exercising a large number of the total predefined subprograms of
--- package Ada.Strings.Wide_Fixed.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 02 Nov 95 SAIC Update and repair for ACVC 2.0.1.
---
---!
-
-package CXA40140 is
-
- UnderScore : Wide_Character := '_';
- Blank : Wide_Character := ' ';
-
- -- Function providing a mapping to a blank Wide_Character.
- function US_to_Blank_Map (From : Wide_Character) return Wide_Character;
-
-end CXA40140;
-
-package body CXA40140 is
-
- function US_to_Blank_Map (From : Wide_Character) return Wide_Character is
- begin
- if From = UnderScore then
- return Blank;
- else
- return From;
- end if;
- end US_to_Blank_Map;
-
-end CXA40140;
-
-
-with CXA40140;
-with Ada.Strings.Wide_Fixed;
-with Ada.Strings.Wide_Maps;
-with Report;
-
-procedure CXA4014 is
- use CXA40140;
-begin
-
- Report.Test ("CXA4014", "Check that the subprograms defined in package " &
- "Ada.Strings.Wide_Fixed are available, and that " &
- "they produce correct results");
-
- Test_Block:
- declare
-
- Number_Of_Info_Strings : constant Natural := 3;
- DB_Size : constant Natural := Number_Of_Info_Strings;
- Count : Natural := 0;
- Finished_Processing : Boolean := False;
- Blank_Wide_String : constant Wide_String := " ";
-
- subtype Info_Wide_String_Type is Wide_String (1..50);
- type Info_Wide_String_Storage_Type is
- array (1..Number_Of_Info_Strings) of Info_Wide_String_Type;
-
-
- subtype Name_Type is Wide_String (1..10);
- subtype Street_Number_Type is Wide_String (1..5);
- subtype Street_Name_Type is Wide_String (1..10);
- subtype City_Type is Wide_String (1..10);
- subtype State_Type is Wide_String (1..2);
- subtype Zip_Code_Type is Wide_String (1..5);
-
- type Data_Base_Element_Type is
- record
- Name : Name_Type := (others => ' ');
- Street_Number : Street_Number_Type := (others => ' ');
- Street_Name : Street_Name_Type := (others => ' ');
- City : City_Type := (others => ' ');
- State : State_Type := (others => ' ');
- Zip_Code : Zip_Code_Type := (others => ' ');
- end record;
-
- type Data_Base_Type is array (1..DB_Size) of Data_Base_Element_Type;
-
- Data_Base : Data_Base_Type;
-
- ---
-
- Info_String_1 : Info_Wide_String_Type :=
- "Joe_Jones 123 Sixth_St San_Diego CA 98765";
-
- Info_String_2 : Info_Wide_String_Type :=
- "Sam_Smith 56789 S._Seventh Carlsbad CA 92177";
-
- Info_String_3 : Info_Wide_String_Type :=
- "Jane_Brown 1219 Info_Lane Tuscon AZ 85643";
-
-
- Info_Strings : Info_Wide_String_Storage_Type :=
- (1 => Info_String_1,
- 2 => Info_String_2,
- 3 => Info_String_3);
-
-
-
- TC_DB_Element_1 : Data_Base_Element_Type :=
- ("Joe Jones ", "123 ", "Sixth St ", "San Diego ", "CA", "98765");
-
- TC_DB_Element_2 : Data_Base_Element_Type :=
- ("Sam Smith ", "56789", "S. Seventh", "Carlsbad ", "CA", "92177");
-
- TC_DB_Element_3 : Data_Base_Element_Type :=
- ("Jane Brown", "1219 ", "Info Lane ", "Tuscon ", "AZ", "85643");
-
- TC_Data_Base : Data_Base_Type := (TC_DB_Element_1,
- TC_DB_Element_2,
- TC_DB_Element_3);
-
- ---
-
-
- procedure Store_Information
- (Info_String : in Info_Wide_String_Type;
- DB_Record : in out Data_Base_Element_Type) is
-
- package AS renames Ada.Strings;
- use type AS.Wide_Maps.Wide_Character_Set;
-
- Start,
- Stop : Natural := 0;
-
- Numeric_Set : constant AS.Wide_Maps.Wide_Character_Set :=
- AS.Wide_Maps.To_Set("0123456789");
-
- Cal : constant
- AS.Wide_Maps.Wide_Character_Sequence := "CA";
- California_Set : constant AS.Wide_Maps.Wide_Character_Set :=
- AS.Wide_Maps.To_Set(Cal);
- Arizona_Set : constant AS.Wide_Maps.Wide_Character_Set :=
- AS.Wide_Maps.To_Set("AZ");
- Nevada_Set : constant AS.Wide_Maps.Wide_Character_Set :=
- AS.Wide_Maps.To_Set("NV");
-
- Blank_Ftn_Ptr : AS.Wide_Maps.Wide_Character_Mapping_Function :=
- US_to_Blank_Map'Access;
-
- begin
-
- -- Find the starting position of the name field (first non-blank),
- -- then, from that position, find the end of the name field (first
- -- blank).
-
- Start := AS.Wide_Fixed.Index_Non_Blank(Info_String);
- Stop := AS.Wide_Fixed.Index (Info_String(Start..Info_String'Length),
- AS.Wide_Maps.To_Set(Blank),
- AS.Inside,
- AS.Forward) - 1 ;
-
- -- Store the name field in the data base element field for "Name".
-
- DB_Record.Name := AS.Wide_Fixed.Head(Info_String(1..Stop),
- DB_Record.Name'Length);
-
- -- Replace any underscore characters in the name field
- -- that were used to separate first/middle/last names.
- -- Use the overloaded version of Translate that takes an
- -- access-to-subprogram value.
-
- AS.Wide_Fixed.Translate (DB_Record.Name, Blank_Ftn_Ptr);
-
-
- -- Continue the extraction process; now find the position of
- -- the street number in the string.
-
- Start := Stop + 1;
-
- AS.Wide_Fixed.Find_Token(Info_String(Start..Info_String'Length),
- Numeric_Set,
- AS.Inside,
- Start,
- Stop);
-
- -- Store the street number field in the appropriate data base
- -- element.
- -- No modification of the default parameters of procedure Move
- -- is required.
-
- AS.Wide_Fixed.Move(Source => Info_String(Start..Stop),
- Target => DB_Record.Street_Number);
-
-
- -- Continue the extraction process; find the street name in the
- -- info string. Skip blanks to the start of the street name, then
- -- search for the index of the next blank character in the string.
-
- Start := AS.Wide_Fixed.Index_Non_Blank
- (Info_String(Stop+1..Info_String'Length));
-
- Stop :=
- AS.Wide_Fixed.Index(Info_String(Start..Info_String'Length),
- Blank_Wide_String) - 1;
-
- -- Store the street name in the appropriate data base element field.
-
- AS.Wide_Fixed.Overwrite(DB_Record.Street_Name,
- 1,
- Info_String(Start..Stop));
-
- -- Replace any underscore characters in the street name field
- -- that were used as word separation with blanks. Again, use the
- -- access-to-subprogram value to provide the mapping.
-
- DB_Record.Street_Name :=
- AS.Wide_Fixed.Translate(DB_Record.Street_Name,
- Blank_Ftn_Ptr);
-
-
- -- Continue the extraction; remove the city name from the string.
-
- Start := AS.Wide_Fixed.Index_Non_Blank
- (Info_String(Stop+1..Info_String'Length));
-
- Stop :=
- AS.Wide_Fixed.Index(Info_String(Start..Info_String'Length),
- Blank_Wide_String) - 1;
-
- -- Store the city name field in the appropriate data base element.
-
- AS.Wide_Fixed.Replace_Slice(DB_Record.City,
- 1,
- DB_Record.City'Length,
- Info_String(Start..Stop));
-
- -- Replace any underscore characters in the city name field
- -- that were used as word separation.
-
- AS.Wide_Fixed.Translate (DB_Record.City,
- Blank_Ftn_Ptr);
-
-
- -- Continue the extraction; remove the state identifier from the
- -- info string.
-
- Start := Stop + 1;
-
- AS.Wide_Fixed.Find_Token(Info_String(Start..Info_String'Length),
- AS.Wide_Maps."OR"(California_Set,
- AS.Wide_Maps."OR"(Nevada_Set,
- Arizona_Set)),
- AS.Inside,
- Start,
- Stop);
-
- -- Store the state indicator into the data base element.
-
- AS.Wide_Fixed.Move(Source => Info_String(Start..Stop),
- Target => DB_Record.State,
- Drop => Ada.Strings.Right,
- Justify => Ada.Strings.Left,
- Pad => AS.Wide_Space);
-
-
- -- Continue the extraction process; remove the final data item in
- -- the info string, the zip code, and place it into the
- -- corresponding data base element.
-
- DB_Record.Zip_Code :=
- AS.Wide_Fixed.Tail(Info_String, DB_Record.Zip_Code'Length);
-
- exception
- when AS.Length_Error =>
- Report.Failed ("Length_Error raised in procedure");
- when AS.Pattern_Error =>
- Report.Failed ("Pattern_Error raised in procedure");
- when AS.Translation_Error =>
- Report.Failed ("Translation_Error raised in procedure");
- when others =>
- Report.Failed ("Exception raised in procedure");
- end Store_Information;
-
-
- begin
-
- -- Loop thru the information strings, extract the name and address
- -- information, place this info into elements of the data base.
-
- while not Finished_Processing loop
-
- Count := Count + 1;
-
- Store_Information (Info_Strings(Count), Data_Base(Count));
-
- Finished_Processing := (Count = Number_Of_Info_Strings);
-
- end loop;
-
-
- -- Verify that the string processing was successful.
-
- for i in 1..DB_Size loop
- if Data_Base(i) /= TC_Data_Base(i) then
- Report.Failed
- ("Data processing error on record " & Integer'Image(i));
- end if;
- end loop;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4014;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4015.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4015.a
deleted file mode 100644
index 83fad3af866..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4015.a
+++ /dev/null
@@ -1,580 +0,0 @@
--- CXA4015.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Wide_Fixed
--- are available, and that they produce correct results. Specifically,
--- check the subprograms Count, Find_Token, Index, Index_Non_Blank, and
--- Move.
---
--- TEST DESCRIPTION:
--- This test, when combined with tests CXA4013,14,16 will provide
--- coverage of the functionality found in Ada.Strings.Wide_Fixed.
--- This test contains many small, specific test cases, situations that
--- although common in user environments, are often difficult to generate
--- in large numbers in a application-based test.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 02 Nov 95 SAIC Corrected various accesssibility problems and
--- expected result strings for ACVC 2.0.1.
---
---!
-
-package CXA40150 is
-
- -- Wide Character mapping function defined for use with specific
- -- versions of functions Index and Count.
-
- function AK_to_ZQ_Mapping (From : Wide_Character) return Wide_Character;
-
-end CXA40150;
-
-package body CXA40150 is
-
- function AK_to_ZQ_Mapping (From : Wide_Character)
- return Wide_Character is
- begin
- if From = 'a' then
- return 'z';
- elsif From = 'k' then
- return 'q';
- else
- return From;
- end if;
- end AK_to_ZQ_Mapping;
-
-end CXA40150;
-
-
-with CXA40150;
-with Report;
-with Ada.Strings;
-with Ada.Strings.Wide_Fixed;
-with Ada.Strings.Wide_Maps;
-
-procedure CXA4015 is
-begin
-
- Report.Test("CXA4015", "Check that the subprograms defined in " &
- "package Ada.Strings.Wide_Fixed are available, " &
- "and that they produce correct results");
-
-
- Test_Block:
- declare
-
- use CXA40150;
-
- package ASF renames Ada.Strings.Wide_Fixed;
- package Maps renames Ada.Strings.Wide_Maps;
-
- Result_String : Wide_String(1..10) :=
- (others => Ada.Strings.Wide_Space);
-
- Source_String1 : Wide_String(1..5) := "abcde"; -- odd len Wide_String
- Source_String2 : Wide_String(1..6) := "abcdef"; -- even len Wide_String
- Source_String3 : Wide_String(1..12) := "abcdefghijkl";
- Source_String4 : Wide_String(1..12) := "abcdefghij "; -- last 2 ch pad
- Source_String5 : Wide_String(1..12) := " cdefghijkl"; -- first 2 ch pad
- Source_String6 : Wide_String(1..12) := "abcdefabcdef";
-
- Location : Natural := 0;
- Slice_Start : Positive;
- Slice_End,
- Slice_Count : Natural := 0;
-
- CD_Set : Maps.Wide_Character_Set := Maps.To_Set("cd");
- ABCD_Set : Maps.Wide_Character_Set := Maps.To_Set("abcd");
- A_to_F_Set : Maps.Wide_Character_Set := Maps.To_Set("abcdef");
-
- CD_to_XY_Map : Maps.Wide_Character_Mapping :=
- Maps.To_Mapping(From => "cd", To => "xy");
-
-
- -- Access-to-Subprogram object defined for use with specific versions of
- -- functions Index and Count.
-
- Map_Ptr : Maps.Wide_Character_Mapping_Function :=
- AK_to_ZQ_Mapping'Access;
-
-
- begin
-
-
- -- Procedure Move
- -- Evaluate the Procedure Move with various combinations of
- -- parameters.
-
- -- Justify = Left (default case)
-
- ASF.Move(Source => Source_String1, -- "abcde"
- Target => Result_String);
-
- if Result_String /= "abcde " then
- Report.Failed("Incorrect result from Move with Justify = Left");
- end if;
-
- -- Justify = Right
-
- ASF.Move(Source => Source_String2, -- "abcdef"
- Target => Result_String,
- Drop => Ada.Strings.Error,
- Justify => Ada.Strings.Right);
-
- if Result_String /= " abcdef" then
- Report.Failed("Incorrect result from Move with Justify = Right");
- end if;
-
- -- Justify = Center (two cases, odd and even pad lengths)
-
- ASF.Move(Source_String1, -- "abcde"
- Result_String,
- Ada.Strings.Error,
- Ada.Strings.Center,
- 'x'); -- non-default padding.
-
- if Result_String /= "xxabcdexxx" then -- Unequal padding added right
- Report.Failed("Incorrect result from Move with Justify = Center-1");
- end if;
-
- ASF.Move(Source_String2, -- "abcdef"
- Result_String,
- Ada.Strings.Error,
- Ada.Strings.Center);
-
- if Result_String /= " abcdef " then -- Equal padding added on L/R.
- Report.Failed("Incorrect result from Move with Justify = Center-2");
- end if;
-
- -- When the source Wide_String is longer than the target Wide_String,
- -- several cases can be examined, with the results depending on the
- -- value of the Drop parameter.
-
- -- Drop = Left
-
- ASF.Move(Source => Source_String3, -- "abcdefghijkl"
- Target => Result_String,
- Drop => Ada.Strings.Left);
-
- if Result_String /= "cdefghijkl" then
- Report.Failed("Incorrect result from Move with Drop = Left");
- end if;
-
- -- Drop = Right
-
- ASF.Move(Source_String3, Result_String, Ada.Strings.Right);
-
- if Result_String /= "abcdefghij" then
- Report.Failed("Incorrect result from Move with Drop = Right");
- end if;
-
- -- Drop = Error
- -- The effect in this case depends on the value of the justify
- -- parameter, and on whether any characters in Source other than
- -- Pad would fail to be copied.
-
- -- Drop = Error, Justify = Left, right overflow characters are pad.
-
- ASF.Move(Source => Source_String4, -- "abcdefghij "
- Target => Result_String,
- Drop => Ada.Strings.Error,
- Justify => Ada.Strings.Left);
-
- if not(Result_String = "abcdefghij") then -- leftmost 10 characters
- Report.Failed("Incorrect result from Move with Drop = Error - 1");
- end if;
-
- -- Drop = Error, Justify = Right, left overflow characters are pad.
-
- ASF.Move(Source_String5, -- " cdefghijkl"
- Result_String,
- Ada.Strings.Error,
- Ada.Strings.Right);
-
- if Result_String /= "cdefghijkl" then -- rightmost 10 characters
- Report.Failed("Incorrect result from Move with Drop = Error - 2");
- end if;
-
- -- In other cases of Drop=Error, Length_Error is propagated, such as:
-
- begin
-
- ASF.Move(Source_String3, -- 12 characters, no Pad.
- Result_String, -- 10 characters
- Ada.Strings.Error,
- Ada.Strings.Left);
-
- Report.Failed("Length_Error not raised by Move - 1");
-
- exception
- when Ada.Strings.Length_Error => null; -- OK
- when others =>
- Report.Failed("Incorrect exception raised by Move - 1");
- end;
-
-
-
- -- Function Index
- -- (Other usage examples of this function found in CXA4013-14.)
- -- Check when the pattern is not found in the source.
-
- if ASF.Index("abcdef", "gh") /= 0 or
- ASF.Index("abcde", "abcdef") /= 0 or -- pattern > source
- ASF.Index("xyz",
- "abcde",
- Ada.Strings.Backward) /= 0 or
- ASF.Index("", "ab") /= 0 or -- null source Wide_String.
- ASF.Index("abcde", " ") /= 0 -- blank pattern.
- then
- Report.Failed("Incorrect result from Index, no pattern match");
- end if;
-
- -- Check that Pattern_Error is raised when the pattern is the
- -- null Wide_String.
- begin
- Location := ASF.Index(Source_String6, -- "abcdefabcdef"
- "", -- null pattern Wide_String.
- Ada.Strings.Forward);
- Report.Failed("Pattern_Error not raised by Index");
- exception
- when Ada.Strings.Pattern_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Index, null pattern");
- end;
-
- -- Use the search direction "backward" to locate the particular
- -- pattern within the source Wide_String.
-
- Location := ASF.Index(Source_String6, -- "abcdefabcdef"
- "de", -- slice 4..5, 10..11
- Ada.Strings.Backward); -- search from right end.
-
- if Location /= 10 then
- Report.Failed("Incorrect result from Index going Backward");
- end if;
-
-
-
- -- Function Index
- -- Use the version of Index that takes a Wide_Character_Mapping_Function
- -- parameter.
- -- Use the search directions Forward and Backward to locate the
- -- particular pattern wide string within the source wide string.
-
- Location := ASF.Index("akzqefakzqef",
- "qzq", -- slice 8..10
- Ada.Strings.Backward,
- Map_Ptr); -- perform 'a' to 'z', 'k' to 'q'
- -- translation.
- if Location /= 8 then
- Report.Failed
- ("Incorrect result from Index w/map ptr going Backward");
- end if;
-
- Location := ASF.Index("ddkkddakcdakdefcadckdfzaaqd",
- "zq", -- slice 7..8
- Ada.Strings.Forward,
- Map_Ptr); -- perform 'a' to 'z', 'k' to 'q'
- -- translation.
- if Location /= 7 then
- Report.Failed
- ("Incorrect result from Index w/map ptr going Forward");
- end if;
-
-
- if ASF.Index("aakkzq", "zq", Ada.Strings.Forward, Map_Ptr) /= 2 or
- ASF.Index("qzedka", "qz", Ada.Strings.Backward, Map_Ptr) /= 5 or
- ASF.Index("zazaza", "zzzz", Ada.Strings.Backward, Map_Ptr) /= 3 or
- ASF.Index("kka", "qqz", Ada.Strings.Forward, Map_Ptr) /= 1
- then
- Report.Failed("Incorrect result from Index w/map ptr");
- end if;
-
-
- -- Check when the pattern wide string is not found in the source.
-
- if ASF.Index("akzqef", "kzq", Ada.Strings.Forward, Map_Ptr) /= 0 or
- ASF.Index("abcde", "abcdef", Ada.Strings.Backward, Map_Ptr) /= 0 or
- ASF.Index("xyz", "akzde", Ada.Strings.Backward, Map_Ptr) /= 0 or
- ASF.Index("", "zq", Ada.Strings.Forward, Map_Ptr) /= 0 or
- ASF.Index("akcde", " ", Ada.Strings.Backward, Map_Ptr) /= 0
- then
- Report.Failed
- ("Incorrect result from Index w/map ptr, no pattern match");
- end if;
-
- -- Check that Pattern_Error is raised when the pattern is a
- -- null Wide_String.
- begin
- Location := ASF.Index("akzqefakqzef",
- "", -- null pattern Wide_String.
- Ada.Strings.Forward,
- Map_Ptr);
- Report.Failed("Pattern_Error not raised by Index w/map ptr");
- exception
- when Ada.Strings.Pattern_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Incorrect exception raised by Index w/map ptr, null pattern");
- end;
-
-
-
- -- Function Index
- -- Using the version of Index testing wide character set membership,
- -- check combinations of forward/backward, inside/outside parameter
- -- configurations.
-
- if ASF.Index(Source => Source_String1, -- "abcde"
- Set => CD_Set,
- Test => Ada.Strings.Inside,
- Going => Ada.Strings.Forward) /= 3 or -- 'c' at pos 3.
- ASF.Index(Source_String6, -- "abcdefabcdef"
- CD_Set,
- Ada.Strings.Outside,
- Ada.Strings.Backward) /= 12 or -- 'f' at position 12
- ASF.Index(Source_String6, -- "abcdefabcdef"
- CD_Set,
- Ada.Strings.Inside,
- Ada.Strings.Backward) /= 10 or -- 'd' at position 10
- ASF.Index("cdcdcdcdacdcdcdcd",
- CD_Set,
- Ada.Strings.Outside,
- Ada.Strings.Forward) /= 9 -- 'a' at position 9
- then
- Report.Failed("Incorrect result from function Index for sets - 1");
- end if;
-
- -- Additional interesting uses/combinations using Index for sets.
-
- if ASF.Index("cd", -- same size, str-set
- CD_Set,
- Ada.Strings.Inside,
- Ada.Strings.Forward) /= 1 or -- 'c' at position 1
- ASF.Index("abcd", -- same size, str-set,
- Maps.To_Set("efgh"), -- different contents.
- Ada.Strings.Outside,
- Ada.Strings.Forward) /= 1 or
- ASF.Index("abccd", -- set > Wide_String
- Maps.To_Set("acegik"),
- Ada.Strings.Inside,
- Ada.Strings.Backward) /= 4 or -- 'c' at position 4
- ASF.Index("abcde",
- Maps.Null_Set) /= 0 or
- ASF.Index("", -- Null string.
- CD_Set) /= 0 or
- ASF.Index("abc ab", -- blank included
- Maps.To_Set("e "), -- in Wide_String and
- Ada.Strings.Inside, -- set.
- Ada.Strings.Backward) /= 4 -- blank in Wide_Str.
- then
- Report.Failed("Incorrect result from function Index for sets - 2");
- end if;
-
-
-
- -- Function Index_Non_Blank.
- -- (Other usage examples of this function found in CXA4013-14.)
-
-
- if ASF.Index_Non_Blank(Source => Source_String4, -- "abcdefghij "
- Going => Ada.Strings.Backward) /= 10 or
- ASF.Index_Non_Blank("abc def ghi jkl ",
- Ada.Strings.Backward) /= 15 or
- ASF.Index_Non_Blank(" abcdef") /= 3 or
- ASF.Index_Non_Blank(" ") /= 0
- then
- Report.Failed("Incorrect result from Index_Non_Blank");
- end if;
-
-
-
- -- Function Count
- -- (Other usage examples of this function found in CXA4013-14.)
-
- if ASF.Count("abababa", "aba") /= 2 or
- ASF.Count("abababa", "ab" ) /= 3 or
- ASF.Count("babababa", "ab") /= 3 or
- ASF.Count("abaabaaba", "aba") /= 3 or
- ASF.Count("xxxxxxxxxxxxxxxxxxxy", "xy") /= 1 or
- ASF.Count("xxxxxxxxxxxxxxxxxxxx", "x") /= 20
- then
- Report.Failed("Incorrect result from Function Count");
- end if;
-
- -- Determine the number of slices of Source that when mapped to a
- -- non-identity map, match the pattern Wide_String.
-
- Slice_Count := ASF.Count(Source_String6, -- "abcdefabcdef"
- "xy",
- CD_to_XY_Map); -- maps 'c' to 'x', 'd' to 'y'
-
- if Slice_Count /= 2 then -- two slices "xy" in "mapped" Source_String6
- Report.Failed("Incorrect result from Count with non-identity map");
- end if;
-
- -- If the pattern supplied to Function Count is the null Wide_String,
- -- then Pattern_Error is propagated.
- declare
- The_Null_Wide_String : constant Wide_String := "";
- begin
- Slice_Count := ASF.Count(Source_String6, The_Null_Wide_String);
- Report.Failed("Pattern_Error not raised by Function Count");
- exception
- when Ada.Strings.Pattern_Error => null; -- OK
- when others =>
- Report.Failed("Incorrect exception from Count with null pattern");
- end;
-
-
-
-
- -- Function Count
- -- Use the version of Count that takes a Wide_Character_Mapping_Function
- -- value as the basis of its source mapping.
-
- if ASF.Count("akakaka", "zqz", Map_Ptr) /= 2 or
- ASF.Count("akakaka", "qz", Map_Ptr) /= 3 or
- ASF.Count("kakakaka", "q", Map_Ptr) /= 4 or
- ASF.Count("zzqaakzaqzzk", "zzq", Map_Ptr) /= 4 or
- ASF.Count(" ", "z", Map_Ptr) /= 0 or
- ASF.Count("", "qz", Map_Ptr) /= 0 or
- ASF.Count("abbababab", "zq", Map_Ptr) /= 0 or
- ASF.Count("aaaaaaaaaaaaaaaaaakk", "zqq", Map_Ptr) /= 1 or
- ASF.Count("azaazaazzzaaaaazzzza", "z", Map_Ptr) /= 20
- then
- Report.Failed("Incorrect result from Function Count w/map ptr");
- end if;
-
- -- If the pattern supplied to Function Count is a null Wide_String,
- -- then Pattern_Error is propagated.
- declare
- The_Null_Wide_String : constant Wide_String := "";
- begin
- Slice_Count := ASF.Count(Source_String6,
- The_Null_Wide_String,
- Map_Ptr);
- Report.Failed
- ("Pattern_Error not raised by Function Count w/map ptr");
- exception
- when Ada.Strings.Pattern_Error => null; -- OK
- when others =>
- Report.Failed
- ("Incorrect exception from Count w/map ptr, null pattern");
- end;
-
-
-
-
- -- Function Count returning the number of characters in a particular
- -- set that are found in source Wide_String.
-
- if ASF.Count(Source_String6, CD_Set) /= 4 or -- 2 'c' and 'd' chars.
- ASF.Count("cddaccdaccdd", CD_Set) /= 10
- then
- Report.Failed("Incorrect result from Count with set");
- end if;
-
-
-
- -- Function Find_Token.
- -- (Other usage examples of this function found in CXA4013-14.)
-
- ASF.Find_Token(Source => Source_String6, -- First slice with no
- Set => ABCD_Set, -- 'a', 'b', 'c', or 'd'
- Test => Ada.Strings.Outside, -- is "ef" at 5..6.
- First => Slice_Start,
- Last => Slice_End);
-
- if Slice_Start /= 5 or Slice_End /= 6 then
- Report.Failed("Incorrect result from Find_Token - 1");
- end if;
-
- -- If no appropriate slice is contained by the source Wide_String,
- -- then the value returned in Last is zero, and the value in First is
- -- Source'First.
-
- ASF.Find_Token(Source_String6, -- "abcdefabcdef"
- A_to_F_Set, -- Set of characters 'a' thru 'f'.
- Ada.Strings.Outside, -- No characters outside this set.
- Slice_Start,
- Slice_End);
-
- if Slice_Start /= Source_String6'First or Slice_End /= 0 then
- Report.Failed("Incorrect result from Find_Token - 2");
- end if;
-
- -- Additional testing of Find_Token.
-
- ASF.Find_Token("eabcdabcddcab",
- ABCD_Set,
- Ada.Strings.Inside,
- Slice_Start,
- Slice_End);
-
- if Slice_Start /= 2 or Slice_End /= 13 then
- Report.Failed("Incorrect result from Find_Token - 3");
- end if;
-
- ASF.Find_Token("efghijklabcdabcd",
- ABCD_Set,
- Ada.Strings.Outside,
- Slice_Start,
- Slice_End);
-
- if Slice_Start /= 1 or Slice_End /= 8 then
- Report.Failed("Incorrect result from Find_Token - 4");
- end if;
-
- ASF.Find_Token("abcdefgabcdabcd",
- ABCD_Set,
- Ada.Strings.Outside,
- Slice_Start,
- Slice_End);
-
- if Slice_Start /= 5 or Slice_End /= 7 then
- Report.Failed("Incorrect result from Find_Token - 5");
- end if;
-
- ASF.Find_Token("abcdcbabcdcba",
- ABCD_Set,
- Ada.Strings.Inside,
- Slice_Start,
- Slice_End);
-
- if Slice_Start /= 1 or Slice_End /= 13 then
- Report.Failed("Incorrect result from Find_Token - 6");
- end if;
-
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4015;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4016.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4016.a
deleted file mode 100644
index 00dcdcdbd00..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4016.a
+++ /dev/null
@@ -1,685 +0,0 @@
--- CXA4016.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Wide_Fixed
--- are available, and that they produce correct results. Specifically,
--- check the subprograms Delete, Head, Insert, Overwrite, Replace_Slice,
--- Tail, Trim, and "*".
---
--- TEST DESCRIPTION:
--- This test, when combined with tests CXA4013-15 will provide
--- coverage of the functionality found in package Ada.Strings.Wide_Fixed.
--- This test contains many small, specific test cases, situations that
--- although common in user environments, are often difficult to generate
--- in large numbers in a application-based test. They represent
--- individual usage paradigms in-the-small.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 10 Apr 94 SAIC Modified comments in a subtest failure message.
--- 06 Nov 95 SAIC Corrected subtest results for ACVC 2.0.1
--- 14 Mar 01 RLB Added checks that the lower bound is 1, similar
--- to CXA4005. These changes were made to test
--- Defect Report 8652/0049, as reflected in
--- Technical Corrigendum 1.
---
---!
-
-with Report;
-with Ada.Strings;
-with Ada.Strings.Wide_Fixed;
-with Ada.Strings.Wide_Maps;
-
-procedure CXA4016 is
-
- type TC_Name_Holder is access String;
- Name : TC_Name_Holder;
-
- function TC_Check (S : Wide_String) return Wide_String is
- begin
- if S'First /= 1 then
- Report.Failed ("Lower bound of result of function " & Name.all &
- " is" & Integer'Image (S'First));
- end if;
- return S;
- end TC_Check;
-
- procedure TC_Set_Name (N : String) is
- begin
- Name := new String'(N);
- end TC_Set_Name;
-
-begin
-
- Report.Test("CXA4016", "Check that the subprograms defined in " &
- "package Ada.Strings.Wide_Fixed are available, " &
- "and that they produce correct results");
-
- Test_Block:
- declare
-
- package ASW renames Ada.Strings.Wide_Fixed;
- package Wide_Maps renames Ada.Strings.Wide_Maps;
-
- Result_String,
- Delete_String,
- Insert_String,
- Trim_String,
- Overwrite_String : Wide_String(1..10) :=
- (others => Ada.Strings.Wide_Space);
- Replace_String : Wide_String(10..30) :=
- (others => Ada.Strings.Wide_Space);
-
- Source_String1 : Wide_String(1..5) := "abcde"; -- odd len wd str
- Source_String2 : Wide_String(1..6) := "abcdef"; -- even len wd str
- Source_String3 : Wide_String(1..12) := "abcdefghijkl";
- Source_String4 : Wide_String(1..12) := "abcdefghij "; -- last two ch pad
- Source_String5 : Wide_String(1..12) := " cdefghijkl"; -- first two ch pad
- Source_String6 : Wide_String(1..12) := "abcdefabcdef";
-
- Location : Natural := 0;
- Slice_Start : Positive;
- Slice_End,
- Slice_Count : Natural := 0;
-
- CD_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps.To_Set("cd");
- X_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps.To_Set('x');
- ABCD_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps.To_Set("abcd");
- A_to_F_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps.To_Set("abcdef");
-
- CD_to_XY_Map : Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.To_Mapping(From => "cd", To => "xy");
-
- begin
-
- -- Procedure Replace_Slice
- -- The functionality of this procedure is similar to procedure Move,
- -- and is tested here in the same manner, evaluated with various
- -- combinations of parameters.
-
- -- Index_Error propagation when Low > Source'Last + 1
-
- begin
- ASW.Replace_Slice(Result_String,
- Result_String'Last + 2, -- should raise exception
- Result_String'Last,
- "xxxxxxx");
- Report.Failed("Index_Error not raised by Replace_Slice - 1");
- exception
- when Ada.Strings.Index_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception from Replace_Slice - 1");
- end;
-
- -- Index_Error propagation when High < Source'First - 1
-
- begin
- ASW.Replace_Slice(Replace_String(20..30),
- Replace_String'First,
- Replace_String'First - 2, -- should raise exception
- "xxxxxxx");
- Report.Failed("Index_Error not raised by Replace_Slice - 2");
- exception
- when Ada.Strings.Index_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception from Replace_Slice - 2");
- end;
-
- -- Justify = Left (default case)
-
- Result_String := "XXXXXXXXXX";
-
- ASW.Replace_Slice(Source => Result_String,
- Low => 1,
- High => 10,
- By => Source_String1); -- "abcde"
-
- if Result_String /= "abcde " then
- Report.Failed("Incorrect result from Replace_Slice - Justify = Left");
- end if;
-
- -- Justify = Right
-
- ASW.Replace_Slice(Source => Result_String,
- Low => 1,
- High => Result_String'Last,
- By => Source_String2, -- "abcdef"
- Drop => Ada.Strings.Error,
- Justify => Ada.Strings.Right);
-
- if Result_String /= " abcdef" then
- Report.Failed("Incorrect result from Replace_Slice - Justify=Right");
- end if;
-
- -- Justify = Center (two cases, odd and even pad lengths)
-
- ASW.Replace_Slice(Result_String,
- 1,
- Result_String'Last,
- Source_String1, -- "abcde"
- Ada.Strings.Error,
- Ada.Strings.Center,
- 'x'); -- non-default padding.
-
- if Result_String /= "xxabcdexxx" then -- Unequal padding added right
- Report.Failed("Incorrect result, Replace_Slice - Justify=Center - 1");
- end if;
-
- ASW.Replace_Slice(Result_String,
- 1,
- Result_String'Last,
- Source_String2, -- "abcdef"
- Ada.Strings.Error,
- Ada.Strings.Center);
-
- if Result_String /= " abcdef " then -- Equal padding added on L/R.
- Report.Failed("Incorrect result from Replace_Slice with " &
- "Justify = Center - 2");
- end if;
-
- -- When the source string is longer than the target string, several
- -- cases can be examined, with the results depending on the value of
- -- the Drop parameter.
-
- -- Drop = Left
-
- ASW.Replace_Slice(Result_String,
- 1,
- Result_String'Last,
- Source_String3, -- "abcdefghijkl"
- Drop => Ada.Strings.Left);
-
- if Result_String /= "cdefghijkl" then
- Report.Failed("Incorrect result from Replace_Slice - Drop=Left");
- end if;
-
- -- Drop = Right
-
- ASW.Replace_Slice(Result_String,
- 1,
- Result_String'Last,
- Source_String3, -- "abcdefghijkl"
- Ada.Strings.Right);
-
- if Result_String /= "abcdefghij" then
- Report.Failed("Incorrect result, Replace_Slice with Drop=Right");
- end if;
-
- -- Drop = Error
-
- -- The effect in this case depends on the value of the justify
- -- parameter, and on whether any characters in Source other than
- -- Pad would fail to be copied.
-
- -- Drop = Error, Justify = Left, right overflow characters are pad.
-
- ASW.Replace_Slice(Result_String,
- 1,
- Result_String'Last,
- Source_String4, -- "abcdefghij "
- Drop => Ada.Strings.Error,
- Justify => Ada.Strings.Left);
-
- if not(Result_String = "abcdefghij") then -- leftmost 10 characters
- Report.Failed("Incorrect result, Replace_Slice - Drop = Error - 1");
- end if;
-
- -- Drop = Error, Justify = Right, left overflow characters are pad.
-
- ASW.Replace_Slice(Source => Result_String,
- Low => 1,
- High => Result_String'Last,
- By => Source_String5, -- " cdefghijkl"
- Drop => Ada.Strings.Error,
- Justify => Ada.Strings.Right);
-
- if Result_String /= "cdefghijkl" then -- rightmost 10 characters
- Report.Failed("Incorrect result, Replace_Slice - Drop = Error - 2");
- end if;
-
- -- In other cases of Drop=Error, Length_Error is propagated, such as:
-
- begin
-
- ASW.Replace_Slice(Source => Result_String,
- Low => 1,
- High => Result_String'Last,
- By => Source_String3, -- "abcdefghijkl"
- Drop => Ada.Strings.Error);
-
- Report.Failed("Length_Error not raised by Replace_Slice - 1");
-
- exception
- when Ada.Strings.Length_Error => null; -- OK
- when others =>
- Report.Failed("Incorrect exception from Replace_Slice - 3");
- end;
-
-
- -- Function Replace_Slice
-
- TC_Set_Name ("Replace_Slice");
-
- if TC_Check (ASW.Replace_Slice("abcde", 3, 3, "x"))
- /= "abxde" or -- High = Low
- TC_Check (ASW.Replace_Slice("abc", 2, 3, "xyz")) /= "axyz" or
- TC_Check (ASW.Replace_Slice("abcd", 4, 1, "xy"))
- /= "abcxyd" or -- High < Low
- TC_Check (ASW.Replace_Slice("abc", 2, 3, "x")) /= "ax" or
- TC_Check (ASW.Replace_Slice("a", 1, 1, "z")) /= "z"
- then
- Report.Failed("Incorrect result from Function Replace_Slice - 1");
- end if;
-
- if TC_Check (ASW.Replace_Slice("abcde", 5, 5, "z"))
- /= "abcdz" or -- By length 1
- TC_Check (ASW.Replace_Slice("abc", 1, 3, "xyz"))
- /= "xyz" or -- High > Low
- TC_Check (ASW.Replace_Slice("abc", 3, 2, "xy"))
- /= "abxyc" or -- insert
- TC_Check (ASW.Replace_Slice("a", 1, 1, "xyz")) /= "xyz"
- then
- Report.Failed("Incorrect result from Function Replace_Slice - 2");
- end if;
-
-
-
- -- Function Insert.
-
- TC_Set_Name ("Insert");
-
- declare
- New_String : constant Wide_String :=
- TC_Check (
- ASW.Insert(Source => Source_String1(2..5), -- "bcde"
- Before => 2,
- New_Item => Source_String2)); -- "abcdef"
- begin
- if New_String /= "abcdefbcde" then
- Report.Failed("Incorrect result from Function Insert - 1");
- end if;
- end;
-
- if TC_Check (ASW.Insert("a", 1, "z")) /= "za" or
- TC_Check (ASW.Insert("abc", 3, "")) /= "abc" or
- TC_Check (ASW.Insert("abc", 4, "z")) /= "abcz"
- then
- Report.Failed("Incorrect result from Function Insert - 2");
- end if;
-
- begin
- if TC_Check (ASW.Insert(Source => Source_String1(2..5), -- "bcde"
- Before => Report.Ident_Int(7),
- New_Item => Source_String2)) -- "abcdef"
- /= "babcdefcde" then
- Report.Failed("Index_Error not raised by Insert - 3A");
- else
- Report.Failed("Index_Error not raised by Insert - 3B");
- end if;
- exception
- when Ada.Strings.Index_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception from Insert - 3");
- end;
-
-
- -- Procedure Insert
-
- -- Drop = Right
-
- ASW.Insert(Source => Insert_String,
- Before => 6,
- New_Item => Source_String2, -- "abcdef"
- Drop => Ada.Strings.Right);
-
- if Insert_String /= " abcde" then -- last char of New_Item dropped.
- Report.Failed("Incorrect result from Insert with Drop = Right");
- end if;
-
- -- Drop = Left
-
- ASW.Insert(Source => Insert_String, -- 10 char string
- Before => 2, -- 9 chars, 2..10 available
- New_Item => Source_String3, -- 12 characters long.
- Drop => Ada.Strings.Left); -- truncate from Left.
-
- if Insert_String /= "l abcde" then -- 10 chars, leading blank.
- Report.Failed("Incorrect result from Insert with Drop=Left");
- end if;
-
- -- Drop = Error
-
- begin
- ASW.Insert(Source => Result_String, -- 10 chars
- Before => Result_String'Last,
- New_Item => "abcdefghijk",
- Drop => Ada.Strings.Error);
- Report.Failed("Exception not raised by Procedure Insert");
- exception
- when Ada.Strings.Length_Error => null; -- OK, expected exception
- when others =>
- Report.Failed("Incorrect exception raised by Procedure Insert");
- end;
-
-
-
- -- Function Overwrite
-
- TC_Set_Name ("Overwrite");
-
- Overwrite_String := TC_Check (
- ASW.Overwrite(Result_String, -- 10 chars
- 1, -- starting at pos=1
- Source_String3(1..10)));
-
- if Overwrite_String /= Source_String3(1..10) then
- Report.Failed("Incorrect result from Function Overwrite - 1");
- end if;
-
-
- if TC_Check (ASW.Overwrite("abcdef", 4, "xyz")) /= "abcxyz" or
- TC_Check (ASW.Overwrite("a", 1, "xyz"))
- /= "xyz" or -- chars appended
- TC_Check (ASW.Overwrite("abc", 3, " "))
- /= "ab " or -- blanks appended
- TC_Check (ASW.Overwrite("abcde", 1, "z" )) /= "zbcde"
- then
- Report.Failed("Incorrect result from Function Overwrite - 2");
- end if;
-
-
-
- -- Procedure Overwrite, with truncation.
-
- ASW.Overwrite(Source => Overwrite_String, -- 10 characters.
- Position => 1,
- New_Item => Source_String3, -- 12 characters.
- Drop => Ada.Strings.Left);
-
- if Overwrite_String /= "cdefghijkl" then
- Report.Failed("Incorrect result from Overwrite with Drop=Left");
- end if;
-
- -- The default drop value is Right, used here.
-
- ASW.Overwrite(Source => Overwrite_String, -- 10 characters.
- Position => 1,
- New_Item => Source_String3); -- 12 characters.
-
- if Overwrite_String /= "abcdefghij" then
- Report.Failed("Incorrect result from Overwrite with Drop=Right");
- end if;
-
- -- Drop = Error
-
- begin
- ASW.Overwrite(Source => Overwrite_String, -- 10 characters.
- Position => 1,
- New_Item => Source_String3, -- 12 characters.
- Drop => Ada.Strings.Error);
- Report.Failed("Exception not raised by Procedure Overwrite");
- exception
- when Ada.Strings.Length_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Incorrect exception raised by Procedure Overwrite");
- end;
-
- Overwrite_String := "ababababab";
- ASW.Overwrite(Overwrite_String, Overwrite_String'Last, "z");
- ASW.Overwrite(Overwrite_String, Overwrite_String'First,"z");
- ASW.Overwrite(Overwrite_String, 5, "zz");
-
- if Overwrite_String /= "zbabzzabaz" then
- Report.Failed("Incorrect result from Procedure Overwrite");
- end if;
-
-
-
- -- Function Delete
-
- TC_Set_Name ("Delete");
-
- declare
- New_String1 : constant Wide_String := -- Returns a 4 char wide str.
- TC_Check (ASW.Delete(Source => Source_String3,
- From => 3,
- Through => 10));
- New_String2 : constant Wide_String := -- This returns Source.
- TC_Check (ASW.Delete(Source_String3, 10, 3));
- begin
- if New_String1 /= "abkl" or
- New_String2 /= Source_String3
- then
- Report.Failed("Incorrect result from Function Delete - 1");
- end if;
- end;
-
- if TC_Check (ASW.Delete("a", 1, 1))
- /= "" or -- Source length = 1
- TC_Check (ASW.Delete("abc", 1, 2))
- /= "c" or -- From = Source'First
- TC_Check (ASW.Delete("abc", 3, 3))
- /= "ab" or -- From = Source'Last
- TC_Check (ASW.Delete("abc", 3, 1))
- /= "abc" -- From > Through
- then
- Report.Failed("Incorrect result from Function Delete - 2");
- end if;
-
-
-
- -- Procedure Delete
-
- -- Justify = Left
-
- Delete_String := Source_String3(1..10); -- Initialize to "abcdefghij"
-
- ASW.Delete(Source => Delete_String,
- From => 6,
- Through => Delete_String'Last,
- Justify => Ada.Strings.Left,
- Pad => 'x'); -- pad with char 'x'
-
- if Delete_String /= "abcdexxxxx" then
- Report.Failed("Incorrect result from Delete - Justify = Left");
- end if;
-
- -- Justify = Right
-
- ASW.Delete(Source => Delete_String, -- Remove x"s from end and
- From => 6, -- shift right.
- Through => Delete_String'Last,
- Justify => Ada.Strings.Right,
- Pad => 'x'); -- pad with char 'x' on left.
-
- if Delete_String /= "xxxxxabcde" then
- Report.Failed("Incorrect result from Delete - Justify = Right");
- end if;
-
- -- Justify = Center
-
- ASW.Delete(Source => Delete_String,
- From => 1,
- Through => 5,
- Justify => Ada.Strings.Center,
- Pad => 'z');
-
- if Delete_String /= "zzabcdezzz" then -- extra pad char on right side.
- Report.Failed("Incorrect result from Delete - Justify = Center");
- end if;
-
-
-
- -- Function Trim
- -- Use non-identity character sets to perform the trim operation.
-
- TC_Set_Name ("Trim");
-
- Trim_String := "cdabcdefcd";
-
- -- Remove the "cd" from each end of the string. This will not effect
- -- the "cd" slice at 5..6.
-
- declare
- New_String : constant Wide_String :=
- TC_Check (ASW.Trim(Source => Trim_String,
- Left => CD_Set, Right => CD_Set));
- begin
- if New_String /= Source_String2 then -- string "abcdef"
- Report.Failed
- ("Incorrect result from Trim with wide character sets");
- end if;
- end;
-
- if TC_Check (ASW.Trim("abcdef", Wide_Maps.Null_Set, Wide_Maps.Null_Set))
- /= "abcdef" then
- Report.Failed("Incorrect result from Trim with Null sets");
- end if;
-
- if TC_Check (ASW.Trim("cdxx", CD_Set, X_Set)) /= "" then
- Report.Failed("Incorrect result from Trim, wide string removal");
- end if;
-
-
- -- Procedure Trim
-
- -- Justify = Right
-
- ASW.Trim(Source => Trim_String,
- Left => CD_Set,
- Right => CD_Set,
- Justify => Ada.Strings.Right,
- Pad => 'x');
-
- if Trim_String /= "xxxxabcdef" then
- Report.Failed("Incorrect result from Trim with Justify = Right");
- end if;
-
- -- Justify = Left
-
- ASW.Trim(Source => Trim_String,
- Left => X_Set,
- Right => Wide_Maps.Null_Set,
- Justify => Ada.Strings.Left,
- Pad => ' ');
-
- if Trim_String /= "abcdef " then -- Padded with 4 blanks on right.
- Report.Failed("Incorrect result from Trim with Justify = Left");
- end if;
-
- -- Justify = Center
-
- ASW.Trim(Source => Trim_String,
- Left => ABCD_Set,
- Right => CD_Set,
- Justify => Ada.Strings.Center,
- Pad => 'x');
-
- if Trim_String /= "xxef xx" then -- Padded with 4 pad chars on L/R
- Report.Failed("Incorrect result from Trim with Justify = Center");
- end if;
-
-
-
- -- Function Head, testing use of padding.
-
- TC_Set_Name ("Head");
-
- -- Use the wide characters of Source_String1 ("abcde") and pad the
- -- last five wide characters of Result_String with 'x' wide characters.
-
- Result_String := TC_CHeck (ASW.Head(Source_String1, 10, 'x'));
-
- if Result_String /= "abcdexxxxx" then
- Report.Failed("Incorrect result from Function Head with padding");
- end if;
-
- if TC_Check (ASW.Head(" ab ", 2)) /= " " or
- TC_Check (ASW.Head("a", 6, 'A')) /= "aAAAAA" or
- TC_Check (ASW.Head(ASW.Head("abc ", 7, 'x'), 10, 'X'))
- /= "abc xxXXX"
- then
- Report.Failed("Incorrect result from Function Head");
- end if;
-
-
-
- -- Function Tail, testing use of padding.
-
- TC_Set_Name ("Tail");
-
- -- Use the wide characters of Source_String1 ("abcde") and pad the
- -- first five wide characters of Result_String with 'x' wide characters.
-
- Result_String := TC_Check (ASW.Tail(Source_String1, 10, 'x'));
-
- if Result_String /= "xxxxxabcde" then
- Report.Failed("Incorrect result from Function Tail with padding");
- end if;
-
- if TC_Check (ASW.Tail("abcde ", 5))
- /= "cde " or -- blanks, back
- TC_Check (ASW.Tail(" abc ", 8, ' '))
- /= " abc " or -- blanks, front/back
- TC_Check (ASW.Tail("", 5, 'Z'))
- /= "ZZZZZ" or -- pad characters only
- TC_Check (ASW.Tail("abc", 0))
- /= "" or -- null result
- TC_Check (ASW.Tail(ASW.Tail(" abc ", 6, 'x'),
- 10,
- 'X')) /= "XXXXx abc "
- then
- Report.Failed("Incorrect result from Function Tail");
- end if;
-
-
-
- -- Function "*" - with (Natural, Wide_String) parameters
-
- TC_Set_Name ("""*""");
-
- if TC_Check (ASW."*"(3, Source_String1)) /= "abcdeabcdeabcde" or
- TC_Check (ASW."*"(2, Source_String2)) /= Source_String6 or
- TC_Check (ASW."*"(4, Source_String1(1..2))) /= "abababab" or
- TC_Check (ASW."*"(0, Source_String1)) /= ""
- then
- Report.Failed
- ("Incorrect result from Function ""*"" with wide strings");
- end if;
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4016;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4017.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4017.a
deleted file mode 100644
index 8d6886897ad..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4017.a
+++ /dev/null
@@ -1,337 +0,0 @@
--- CXA4017.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Wide_Bounded
--- are available, and that they produce correct results. Specifically,
--- check the subprograms Append, Delete, Index, Insert , Length,
--- Overwrite, Replace_Slice, Slice, "&", To_Bounded_Wide_String,
--- To_Wide_String, Translate, and Trim.
---
--- TEST DESCRIPTION:
--- This test demonstrates the uses of a variety of the Wide_String
--- functions found in the package Ada.Strings.Wide_Bounded, simulating
--- the operations found in a text processing environment.
--- With bounded wide strings, the length of each "line" of text can vary
--- up to the instantiated maximum, allowing one to view a page of text as
--- a series of expandable lines. This provides flexibility in text
--- formatting of individual lines (wide strings).
--- Several subprograms are defined, all of which attempt to take
--- advantage of as many different bounded wide string utilities as
--- possible. Often, an operation that is being performed in a subprogram
--- using a certain bounded wide string utility could more efficiently be
--- performed using a different utility. However, in the interest of
--- including as broad coverage as possible, a mixture of utilities is
--- invoked in this test.
--- A simulated page of text is provided as a parameter to the test
--- defined subprograms, and the appropriate processing performed. The
--- processed page of text is then compared to a predefined "finished"
--- page, and test passage/failure is based on the results of this
--- comparison.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 06 Nov 95 SAIC Corrected initialization error for ACVC 2.0.1.
---
---!
-
-with Ada.Strings;
-with Ada.Strings.Wide_Bounded;
-with Ada.Strings.Wide_Maps;
-with Report;
-
-procedure CXA4017 is
-
-begin
-
- Report.Test ("CXA4017", "Check that the subprograms defined in package " &
- "Ada.Strings.Wide_Bounded are available, and " &
- "that they produce correct results");
-
- Test_Block:
- declare
-
- Characters_Per_Line : constant Positive := 40;
- Lines_Per_Page : constant Natural := 4;
-
-
- package BS_40 is new
- Ada.Strings.Wide_Bounded.Generic_Bounded_Length(Characters_Per_Line);
-
- use type BS_40.Bounded_Wide_String;
-
- type Page_Type is array (1..Lines_Per_Page) of
- BS_40.Bounded_Wide_String;
-
- -- Note: Misspellings below are intentional.
-
- Line1 : BS_40.Bounded_Wide_String :=
- BS_40.To_Bounded_Wide_String
- ("ada is a progrraming language designed");
- Line2 : BS_40.Bounded_Wide_String :=
- BS_40.To_Bounded_Wide_String("to support the construction of long-");
- Line3 : BS_40.Bounded_Wide_String :=
- BS_40.To_Bounded_Wide_String("lived, highly reliabel software ");
- Line4 : BS_40.Bounded_Wide_String :=
- BS_40.To_Bounded_Wide_String("systems");
-
- Page : Page_Type := (1 => Line1, 2 => Line2, 3 => Line3, 4 => Line4);
-
- Finished_Page : Page_Type :=
- (BS_40.To_Bounded_Wide_String
- ("Ada is a programming language designed"),
- BS_40.To_Bounded_Wide_String("to support the construction of long-"),
- BS_40.To_Bounded_Wide_String
- ("lived, HIGHLY RELIABLE software systems."),
- BS_40.To_Bounded_Wide_String(""));
-
- ---
-
- procedure Compress (Page : in out Page_Type) is
- Clear_Line : Natural := Lines_Per_Page;
- begin
- -- If two consecutive lines on the page are together less than the
- -- maximum line length, then append those two lines, move up all
- -- lower lines on the page, and blank out the last line.
- -- This algorithm works one time through the page, does not perform
- -- repetitive compression, and is designed for use with this test
- -- program only.
- for i in 1..Lines_Per_Page - 1 loop
- if BS_40.Length(Page(i)) + BS_40.Length(Page(i+1)) <=
- BS_40.Max_Length
- then
- Page(i) := BS_40."&"(Page(i),
- Page(i+1)); -- "&" (wd bnd, wd bnd)
-
- for j in i+1..Lines_Per_Page - 1 loop
- Page(j) :=
- BS_40.To_Bounded_Wide_String
- (BS_40.Slice(Page(j+1),
- 1,
- BS_40.Length(Page(j+1))));
- Clear_Line := j + 1;
- end loop;
- Page(Clear_Line) := BS_40.Null_Bounded_Wide_String;
- end if;
- end loop;
- end Compress;
-
- ---
-
- procedure Format (Page : in out Page_Type) is
- Sm_Ada : BS_40.Bounded_Wide_String :=
- BS_40.To_Bounded_Wide_String("ada");
- Cap_Ada : constant Wide_String := "Ada";
- Char_Pos : Natural := 0;
- Finished : Boolean := False;
- Line : Natural := Page_Type'Last;
- begin
-
- -- Add a period to the end of the last line.
- while Line >= Page_Type'First and not Finished loop
- if Page(Line) /= BS_40.Null_Bounded_Wide_String and
- BS_40.Length(Page(Line)) <= BS_40.Max_Length
- then
- Page(Line) := BS_40.Append(Page(Line), '.');
- Finished := True;
- end if;
- Line := Line - 1;
- end loop;
-
- -- Replace all occurrences of "ada" with "Ada".
- for Line in Page_Type'First .. Page_Type'Last loop
- Finished := False;
- while not Finished loop
- Char_Pos :=
- BS_40.Index (Source => Page(Line),
- Pattern => BS_40.To_Wide_String(Sm_Ada),
- Going => Ada.Strings.Backward);
- -- A zero is returned by function Index if no occurrences of
- -- the pattern wide string are found.
- Finished := (Char_Pos = 0);
- if not Finished then
- BS_40.Replace_Slice
- (Source => Page(Line),
- Low => Char_Pos,
- High => Char_Pos + BS_40.Length(Sm_Ada) - 1,
- By => Cap_Ada);
- end if;
- end loop; -- while loop
- end loop; -- for loop
-
- end Format;
-
- ---
-
- procedure Spell_Check (Page : in out Page_Type) is
- type Spelling_Type is (Incorrect, Correct);
- type Word_Array_Type is array (Spelling_Type)
- of BS_40.Bounded_Wide_String;
- type Dictionary_Type is array (1..2) of Word_Array_Type;
-
- -- Note that the "words" in the dictionary will require various
- -- amounts of Trimming prior to their use in the bounded wide string
- -- functions.
- Dictionary : Dictionary_Type :=
- (1 => (BS_40.To_Bounded_Wide_String(" reliabel "),
- BS_40.To_Bounded_Wide_String(" reliable ")),
- 2 => (BS_40.To_Bounded_Wide_String(" progrraming "),
- BS_40.To_Bounded_Wide_String(" programming ")));
-
- Pos : Natural := Natural'First;
- Finished : Boolean := False;
-
- begin
-
- for Line in Page_Type'Range loop
-
- -- Search for the first incorrectly spelled word in the
- -- Dictionary, if it is found, replace it with the correctly
- -- spelled word, using the Overwrite function.
-
- while not Finished loop
- Pos :=
- BS_40.Index(Page(Line),
- BS_40.To_Wide_String
- (BS_40.Trim(Dictionary(1)(Incorrect),
- Ada.Strings.Both)),
- Ada.Strings.Forward);
- Finished := (Pos = 0);
- if not Finished then
- Page(Line) :=
- BS_40.Overwrite(Page(Line),
- Pos,
- BS_40.To_Wide_String
- (BS_40.Trim(Dictionary(1)(Correct),
- Ada.Strings.Both)));
- end if;
- end loop;
-
- Finished := False;
-
- -- Search for the second incorrectly spelled word in the
- -- Dictionary, if it is found, replace it with the correctly
- -- spelled word, using the Delete procedure and Insert function.
-
- while not Finished loop
- Pos :=
- BS_40.Index(Page(Line),
- BS_40.To_Wide_String(
- BS_40.Trim(Dictionary(2)(Incorrect),
- Ada.Strings.Both)),
- Ada.Strings.Forward);
-
- Finished := (Pos = 0);
-
- if not Finished then
- BS_40.Delete
- (Page(Line),
- Pos,
- Pos + BS_40.To_Wide_String
- (BS_40.Trim(Dictionary(2)(Incorrect),
- Ada.Strings.Both))'Length-1);
- Page(Line) :=
- BS_40.Insert(Page(Line),
- Pos,
- BS_40.To_Wide_String
- (BS_40.Trim(Dictionary(2)(Correct),
- Ada.Strings.Both)));
- end if;
- end loop;
-
- Finished := False;
-
- end loop;
- end Spell_Check;
-
- ---
-
- procedure Bold (Page : in out Page_Type) is
- Key_Word : constant Wide_String := "highly reliable";
- Bold_Mapping : constant
- Ada.Strings.Wide_Maps.Wide_Character_Mapping :=
- Ada.Strings.Wide_Maps.To_Mapping
- (From => " abcdefghijklmnopqrstuvwxyz",
- To => " ABCDEFGHIJKLMNOPQRSTUVWXYZ");
- Pos : Natural := Natural'First;
- Finished : Boolean := False;
- begin
- -- This procedure is designed to change the case of the phrase
- -- "highly reliable" into upper case (a type of "Bolding").
- -- All instances of the phrase on all lines of the page will be
- -- modified.
-
- for Line in Page_Type'First .. Page_Type'Last loop
- while not Finished loop
- Pos := BS_40.Index(Page(Line), Key_Word);
- Finished := (Pos = 0);
- if not Finished then
-
- BS_40.Overwrite
- (Page(Line),
- Pos,
- BS_40.To_Wide_String
- (BS_40.Translate
- (BS_40.To_Bounded_Wide_String
- (BS_40.Slice(Page(Line),
- Pos,
- Pos + Key_Word'Length - 1)),
- Bold_Mapping)));
-
- end if;
- end loop;
- Finished := False;
- end loop;
- end Bold;
-
-
- begin
-
- Compress(Page);
- Format(Page);
- Spell_Check(Page);
- Bold(Page);
-
- for i in 1..Lines_Per_Page loop
- if BS_40.To_Wide_String(Page(i)) /=
- BS_40.To_Wide_String(Finished_Page(i)) or
- BS_40.Length(Page(i)) /=
- BS_40.Length(Finished_Page(i))
- then
- Report.Failed("Incorrect modification of Page, Line " &
- Integer'Image(i));
- end if;
- end loop;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4017;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4018.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4018.a
deleted file mode 100644
index 98e0ded4a2c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4018.a
+++ /dev/null
@@ -1,379 +0,0 @@
--- CXA4018.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package
--- Ada.Strings.Wide_Bounded are available, and that they produce
--- correct results. Specifically, check the subprograms Append,
--- Count, Element, Find_Token, Head, Index_Non_Blank, Replace_Element,
--- Replicate, Tail, To_Bounded_Wide_String, "&", ">", "<", ">=", "<=",
--- and "*".
---
--- TEST DESCRIPTION:
--- This test, when taken in conjunction with test CXA40[17,19,20], will
--- constitute a test of all the functionality contained in package
--- Ada.Strings.Wide_Bounded. This test uses a variety of the
--- subprograms defined in the wide bounded string package in ways typical
--- of common usage. Different combinations of available subprograms
--- are used to accomplish similar wide bounded string processing goals.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 22 Dec 94 SAIC Changed obsolete constant to Strings.Wide_Space.
--- 06 Nov 95 SAIC Corrected evaluation string used in Head/Tail
--- subtests for ACVC 2.0.1.
---
---!
-
-with Ada.Strings;
-with Ada.Strings.Wide_Bounded;
-with Ada.Characters.Handling;
-with Ada.Strings.Wide_Maps;
-with Report;
-
-procedure CXA4018 is
-
- -- The following two functions are used to translate character and string
- -- values to "Wide" values. They will be applied to all the Wide_Bounded
- -- subprogram parameters to simulate the use of Wide_Characters and
- -- Wide_Strings in actual practice. Blanks are translated to Wide_Character
- -- blanks and all other characters are translated into Wide_Characters with
- -- position values 256 greater than their (narrow) character position
- -- values.
-
- function Translate (Ch : Character) return Wide_Character is
- C : Character := Ch;
- begin
- if Ch = ' ' then
- return Ada.Characters.Handling.To_Wide_Character(C);
- else
- return Wide_Character'Val(Character'Pos(Ch) +
- Character'Pos(Character'Last) + 1);
- end if;
- end Translate;
-
- function Translate (Str : String) return Wide_String is
- WS : Wide_String(Str'First..Str'Last);
- begin
- for i in Str'First..Str'Last loop
- WS(i) := Translate(Str(i));
- end loop;
- return WS;
- end Translate;
-
-
-begin
-
- Report.Test ("CXA4018", "Check that the subprograms defined in package " &
- "Ada.Strings.Wide_Bounded are available, and " &
- "that they produce correct results");
-
- Test_Block:
- declare
-
- package BS80 is new Ada.Strings.Wide_Bounded.Generic_Bounded_Length(80);
- use type BS80.Bounded_Wide_String;
-
- Part1 : constant Wide_String := Translate("Rum");
- Part2 : Wide_Character := Translate('p');
- Part3 : BS80.Bounded_Wide_String :=
- BS80.To_Bounded_Wide_String(Translate("el"));
- Part4 : Wide_Character := Translate('s');
- Part5 : BS80.Bounded_Wide_String :=
- BS80.To_Bounded_Wide_String(Translate("tilt"));
- Part6 : Wide_String(1..3) := Translate("ski");
-
- Full_Catenate_String,
- Full_Append_String,
- Constructed_String,
- Drop_String,
- Replicated_String,
- Token_String : BS80.Bounded_Wide_String;
-
- CharA : Wide_Character := Translate('A');
- CharB : Wide_Character := Translate('B');
- CharC : Wide_Character := Translate('C');
- CharD : Wide_Character := Translate('D');
- CharE : Wide_Character := Translate('E');
- CharF : Wide_Character := Translate('F');
-
- ABStr : Wide_String(1..15) := Translate("AAAAABBBBBBBBBB");
- StrB : Wide_String(1..2) := Translate("BB");
- StrE : Wide_String(1..2) := Translate("EE");
-
-
- begin
-
- -- Evaluation of the overloaded forms of the "&" operator.
-
- Full_Catenate_String :=
- BS80."&"(Part2, -- WChar & Bnd WStr
- BS80."&"(Part3, -- Bnd WStr & Bnd WStr
- BS80."&"(Part4, -- WChar & Bnd WStr
- BS80."&"(Part5, -- Bnd WStr & Bnd WStr
- BS80.To_Bounded_Wide_String
- (Part6)))));
-
- Full_Catenate_String :=
- BS80."&"(Part1, Full_Catenate_String); -- WStr & Bnd WStr
- Full_Catenate_String :=
- BS80."&"(Left => Full_Catenate_String,
- Right => Translate('n')); -- Bnd WStr & WChar
-
-
- -- Evaluation of the overloaded forms of function Append.
-
- Full_Append_String :=
- BS80.Append(Part2, -- WChar,Bnd WStr
- BS80.Append(Part3, -- Bnd WStr, Bnd WStr
- BS80.Append(Part4, -- WChar,Bnd WStr
- BS80.Append(BS80.To_Wide_String(Part5), -- WStr,Bnd WStr
- BS80.To_Bounded_Wide_String(Part6)))));
-
- Full_Append_String :=
- BS80.Append(BS80.To_Bounded_Wide_String(Part1), -- Bnd WStr, WStr
- BS80.To_Wide_String(Full_Append_String));
-
- Full_Append_String :=
- BS80.Append(Left => Full_Append_String,
- Right => Translate('n')); -- Bnd WStr, WChar
-
-
- -- Validate the resulting bounded wide strings.
-
- if BS80."<"(Full_Catenate_String, Full_Append_String) or
- BS80.">"(Full_Catenate_String, Full_Append_String) or
- not (Full_Catenate_String = Full_Append_String and
- BS80."<="(Full_Catenate_String, Full_Append_String) and
- BS80.">="(Full_Catenate_String, Full_Append_String))
- then
- Report.Failed
- ("Incorrect results from bounded wide string catenation" &
- " and comparison");
- end if;
-
-
- -- Evaluate the overloaded forms of the Constructor function "*" and
- -- the Replicate function.
-
- Constructed_String :=
- BS80."*"(2,CharA) & -- "AA"
- BS80."*"(2,StrB) & -- "AABBBB"
- BS80."*"(3, BS80."*"(2, CharC)) & -- "AABBBBCCCCCC"
- BS80.Replicate(3,
- BS80.Replicate(2, CharD)) & -- "AABBBBCCCCCCDDDDDD"
- BS80.Replicate(2, StrE) & -- "AABBBBCCCCCCDDDDDDEEEE"
- BS80.Replicate(2, CharF); -- "AABBBBCCCCCCDDDDDDEEEEFF"
-
-
- -- Use of Function Replicate that involves dropping wide characters.
- -- The attempt to replicate the 15 character wide string six times will
- -- exceed the 80 wide character bound of the wide string. Therefore,
- -- the result should be the catenation of 5 copies of the 15 character
- -- wide string, followed by 5 'A' wide characters (the first five wide
- -- characters of the 6th replication) with the remaining wide
- -- characters of the 6th replication dropped.
-
- Drop_String :=
- BS80.Replicate(Count => 6,
- Item => ABStr, -- "AAAAABBBBBBBBBB"
- Drop => Ada.Strings.Right);
-
- if BS80.Element(Drop_String, 1) /= Translate('A') or
- BS80.Element(Drop_String, 6) /= Translate('B') or
- BS80.Element(Drop_String, 76) /= Translate('A') or
- BS80.Element(Drop_String, 80) /= Translate('A')
- then
- Report.Failed("Incorrect result from Replicate with Drop");
- end if;
-
-
- -- Use function Index_Non_Blank in the evaluation of the
- -- Constructed_String.
-
- if BS80.Index_Non_Blank(Constructed_String, Ada.Strings.Forward) /=
- BS80.To_Wide_String(Constructed_String)'First or
- BS80.Index_Non_Blank(Constructed_String, Ada.Strings.Backward) /=
- BS80.Length(Constructed_String)
- then
- Report.Failed("Incorrect results from constructor functions");
- end if;
-
-
-
- declare
-
- -- Define wide character set objects for use with the Count function.
- -- Constructed_String = "AABBBBCCCCCCDDDDDDEEEEFF" from above.
-
- A_Set : Ada.Strings.Wide_Maps.Wide_Character_Set :=
- Ada.Strings.Wide_Maps.To_Set(BS80.Element(Constructed_String,
- 1));
- B_Set : Ada.Strings.Wide_Maps.Wide_Character_Set :=
- Ada.Strings.Wide_Maps.To_Set(BS80.Element(Constructed_String,
- 3));
- C_Set : Ada.Strings.Wide_Maps.Wide_Character_Set :=
- Ada.Strings.Wide_Maps.To_Set(BS80.Element(Constructed_String,
- 7));
- D_Set : Ada.Strings.Wide_Maps.Wide_Character_Set :=
- Ada.Strings.Wide_Maps.To_Set(BS80.Element(Constructed_String,
- 13));
- E_Set : Ada.Strings.Wide_Maps.Wide_Character_Set :=
- Ada.Strings.Wide_Maps.To_Set(BS80.Element(Constructed_String,
- 19));
- F_Set : Ada.Strings.Wide_Maps.Wide_Character_Set :=
- Ada.Strings.Wide_Maps.To_Set(BS80.Element(Constructed_String,
- 23));
- Start : Positive;
- Stop : Natural := 0;
-
- begin
-
- -- Evaluate the results from function Count by comparing the number
- -- of A's to the number of F's, B's to E's, and C's to D's in the
- -- Constructed_String.
- -- There should be an equal number of each of the wide characters that
- -- are being compared (i.e., 2 A's and F's, 4 B's and E's, etc)
-
- if BS80.Count(Constructed_String, A_Set) /=
- BS80.Count(Constructed_String, F_Set) or
- BS80.Count(Constructed_String, B_Set) /=
- BS80.Count(Constructed_String, E_Set) or
- not (BS80.Count(Constructed_String, C_Set) =
- BS80.Count(Constructed_String, D_Set))
- then
- Report.Failed("Incorrect result from function Count");
- end if;
-
-
- -- Evaluate the functions Head, Tail, and Find_Token.
- -- Create the Token_String from the Constructed_String above.
-
- Token_String :=
- BS80.Tail(BS80.Head(Constructed_String, 3), 2) & -- "AB" &
- BS80.Head(BS80.Tail(Constructed_String, 13), 2) & -- "CD" &
- BS80.Head(BS80.Tail(Constructed_String, 3), 2); -- "EF"
-
- if Token_String /=
- BS80.To_Bounded_Wide_String(Translate("ABCDEF")) then
- Report.Failed("Incorrect result from Catenation of Token_String");
- end if;
-
-
- -- Find the starting/ending position of the first A in the
- -- Token_String (both should be 1, only one A appears in string).
- -- The Function Head uses the default pad character to return a
- -- bounded wide string longer than its input parameter bounded
- -- wide string.
-
- BS80.Find_Token(BS80.Head(Token_String, 10), -- Default pad.
- A_Set,
- Ada.Strings.Inside,
- Start,
- Stop);
-
- if Start /= 1 and Stop /= 1 then
- Report.Failed("Incorrect result from Find_Token - 1");
- end if;
-
-
- -- Find the starting/ending position of the first non-AB slice in
- -- the "head" five wide characters of Token_String (slice CDE at
- -- positions 3-5)
-
- BS80.Find_Token(BS80.Head(Token_String, 5), -- "ABCDE"
- Ada.Strings.Wide_Maps."OR"(A_Set, B_Set), -- Set (AB)
- Ada.Strings.Outside,
- Start,
- Stop);
-
- if Start /= 3 and Stop /= 5 then
- Report.Failed("Incorrect result from Find_Token - 2");
- end if;
-
-
- -- Find the starting/ending position of the first CD slice in
- -- the "tail" eight wide characters (including two pad wide
- -- characters) of Token_String (slice CD at positions 5-6 of
- -- the tail portion specified)
-
- BS80.Find_Token(BS80.Tail(Token_String, 8,
- Ada.Strings.Wide_Space),
- Ada.Strings.Wide_Maps."OR"(C_Set, D_Set),
- Ada.Strings.Inside,
- Start,
- Stop);
-
- if Start /= 5 and Stop /= 6 then
- Report.Failed("Incorrect result from Find_Token - 3");
- end if;
-
-
- -- Evaluate the Replace_Element function.
-
- -- Token_String = "ABCDEF"
-
- BS80.Replace_Element(Token_String, 3, BS80.Element(Token_String,4));
-
- -- Token_String = "ABDDEF"
-
- BS80.Replace_Element(Source => Token_String,
- Index => 2,
- By => BS80.Element(Token_String, 5));
-
- -- Token_String = "AEDDEF"
-
- BS80.Replace_Element(Token_String,
- 1,
- BS80.Element(BS80.Tail(Token_String, 2), 2));
-
- -- Token_String = "FEDDEF"
- -- Evaluate this result.
-
- if BS80.Element(Token_String,
- BS80.To_Wide_String(Token_String)'First) /=
- BS80.Element(Token_String,
- BS80.To_Wide_String(Token_String)'Last) or
- BS80.Count(Token_String, D_Set) /=
- BS80.Count(Token_String, E_Set) or
- BS80.Index_Non_Blank(BS80.Head(Token_String,6)) /=
- BS80.Index_Non_Blank(BS80.Tail(Token_String,6)) or
- BS80.Head(Token_String, 1) /=
- BS80.Tail(Token_String, 1)
- then
- Report.Failed("Incorrect result from operations in combination");
- end if;
-
- end;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4018;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4019.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4019.a
deleted file mode 100644
index 943e3e73b88..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4019.a
+++ /dev/null
@@ -1,1027 +0,0 @@
--- CXA4019.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Wide_Bounded
--- are available, and that they produce correct results, especially
--- under conditions where truncation of the result is required.
--- Specifically, check the subprograms Append, Count with non-Identity
--- maps, Index with non-Identity maps, Index with Set parameters,
--- Insert (function and procedure), Replace_Slice (function and
--- procedure), To_Bounded_Wide_String, and Translate (function and
--- procedure).
---
--- TEST DESCRIPTION:
--- This test, in conjunction with tests CXA4017, CXA4018, and CXA4020,
--- will provide coverage of the most common usages of the functionality
--- found in the Ada.Strings.Wide_Bounded package. It deals in large part
--- with truncation effects and options. This test contains many small,
--- specific test cases, situations that are often difficult to generate
--- in large numbers in an application-based test. These cases represent
--- specific usage paradigms in-the-small.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 06 Nov 95 SAIC Corrected expected result string in subtest for
--- ACVC 2.0.1.
--- Moved function Dog_to_Cat_Mapping to library
--- level to correct accessibility problem in test.
--- 22 Aug 96 SAIC Corrected three subtests identified in reviewer
--- comments.
--- 17 Feb 97 PWB.CTA Corrected result strings for Translate and Insert
---
---!
-
-package CXA40190 is
-
- -- Wide Character mapping function defined for use with specific
- -- versions of functions Index and Count.
-
- function Dog_to_Cat_Mapping (From : Wide_Character)
- return Wide_Character;
-
-end CXA40190;
-
-package body CXA40190 is
-
- -- Translates "dog" to "cat".
- function Dog_to_Cat_Mapping (From : Wide_Character)
- return Wide_Character is
- begin
- if From = 'd' then
- return 'c';
- elsif From = 'o' then
- return 'a';
- elsif From = 'g' then
- return 't';
- else
- return From;
- end if;
- end Dog_to_Cat_Mapping;
-
-end CXA40190;
-
-
-with CXA40190;
-with Report;
-with Ada.Characters.Handling;
-with Ada.Strings.Wide_Bounded;
-with Ada.Strings.Wide_Maps;
-with Ada.Strings.Wide_Maps.Wide_Constants;
-
-procedure CXA4019 is
-
- -- The following two functions are used to translate character and string
- -- values to "Wide" values. They will be applied to all the Wide_Bounded
- -- subprogram parameters to simulate the use of Wide_Characters and
- -- Wide_Strings in actual practice.
-
- function Equiv (Ch : Character) return Wide_Character is
- C : Character := Ch;
- begin
- if Ch = ' ' then
- return Ada.Characters.Handling.To_Wide_Character(C);
- else
- return Wide_Character'Val(Character'Pos(Ch) +
- Character'Pos(Character'Last) + 1);
- end if;
- end Equiv;
-
-
- function Equiv (Str : String) return Wide_String is
- WS : Wide_String(Str'First..Str'Last);
- begin
- for i in Str'First..Str'Last loop
- WS(i) := Equiv(Str(i));
- end loop;
- return WS;
- end Equiv;
-
-begin
-
- Report.Test("CXA4019", "Check that the subprograms defined in " &
- "package Ada.Strings.Wide_Bounded are " &
- "available, and that they produce correct " &
- "results, especially under conditions where " &
- "truncation of the result is required");
-
- Test_Block:
- declare
-
- use CXA40190;
-
- package AS renames Ada.Strings;
- package ASB renames Ada.Strings.Wide_Bounded;
- package ASWC renames Ada.Strings.Wide_Maps.Wide_Constants;
- package Maps renames Ada.Strings.Wide_Maps;
-
- package B10 is new ASB.Generic_Bounded_Length(Max => 10);
- use type B10.Bounded_Wide_String;
-
- Result_String : B10.Bounded_Wide_String;
- Test_String : B10.Bounded_Wide_String;
- AtoE_Bnd_Str : B10.Bounded_Wide_String :=
- B10.To_Bounded_Wide_String(Equiv("abcde"));
- FtoJ_Bnd_Str : B10.Bounded_Wide_String :=
- B10.To_Bounded_Wide_String(Equiv("fghij"));
- AtoJ_Bnd_Str : B10.Bounded_Wide_String :=
- B10.To_Bounded_Wide_String(Equiv("abcdefghij"));
-
- Location : Natural := 0;
- Total_Count : Natural := 0;
-
- CD_Set : Maps.Wide_Character_Set := Maps.To_Set("cd");
- Wide_CD_Set : Maps.Wide_Character_Set := Maps.To_Set(Equiv("cd"));
-
- AB_to_YZ_Map : Maps.Wide_Character_Mapping :=
- Maps.To_Mapping(From => "ab", To => "yz");
-
- Wide_AB_to_YZ_Map : Maps.Wide_Character_Mapping :=
- Maps.To_Mapping(From => Equiv("ab"),
- To => Equiv("yz"));
-
- CD_to_XY_Map : Maps.Wide_Character_Mapping :=
- Maps.To_Mapping(From => "cd", To => "xy");
-
- Wide_CD_to_XY_Map : Maps.Wide_Character_Mapping :=
- Maps.To_Mapping(From => Equiv("cd"),
- To => Equiv("xy"));
-
-
- -- Access-to-Subprogram object defined for use with specific versions of
- -- functions Index, Count Translate, and procedure Translate.
-
- Map_Ptr : Maps.Wide_Character_Mapping_Function :=
- Dog_to_Cat_Mapping'Access;
-
-
-
- begin
-
- -- Function To_Bounded_Wide_String with Truncation
- -- Evaluate the function Append with parameters that will
- -- cause the truncation of the result.
-
- -- Drop = Error (default case, Length_Error will be raised)
-
- begin
- Test_String :=
- B10.To_Bounded_Wide_String
- (Equiv("Much too long for this bounded wide string"));
- Report.Failed("Length Error not raised by To_Bounded_Wide_String");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed
- ("Incorrect exception raised by To_Bounded_Wide_String");
- end;
-
- -- Drop = Left
-
- Test_String :=
- B10.To_Bounded_Wide_String(Source => Equiv("abcdefghijklmn"),
- Drop => Ada.Strings.Left);
-
- if Test_String /= B10.To_Bounded_Wide_String(Equiv("efghijklmn")) then
- Report.Failed
- ("Incorrect result from To_Bounded_Wide_String, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Test_String :=
- B10.To_Bounded_Wide_String(Source => Equiv("abcdefghijklmn"),
- Drop => Ada.Strings.Right);
-
- if not(Test_String = AtoJ_Bnd_Str) then
- Report.Failed
- ("Incorrect result from To_Bounded_Wide_String, Drop = Right");
- end if;
-
-
-
-
- -- Function Append with Truncation
- -- Evaluate the function Append with parameters that will
- -- cause the truncation of the result.
-
- -- Drop = Error (default case, Length_Error will be raised)
-
- begin
- -- Append (Bnd Str, Bnd Str);
- Result_String :=
- B10.Append(B10.To_Bounded_Wide_String(Equiv("abcde")),
- B10.To_Bounded_Wide_String(Equiv("fghijk"))); -- 11 char
- Report.Failed("Length_Error not raised by Append - 1");
- exception
- when AS.Length_Error => null; -- OK, correct exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Append - 1");
- end;
-
- begin
- -- Append (Str, Bnd Str);
- Result_String :=
- B10.Append(B10.To_Wide_String(AtoE_Bnd_Str),
- B10.To_Bounded_Wide_String(Equiv("fghijk")),
- AS.Error);
- Report.Failed("Length_Error not raised by Append - 2");
- exception
- when AS.Length_Error => null; -- OK, correct exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Append - 2");
- end;
-
- begin
- -- Append (Bnd Str, Char);
- Result_String :=
- B10.Append(B10.To_Bounded_Wide_String("abcdefghij"), 'k');
- Report.Failed("Length_Error not raised by Append - 3");
- exception
- when AS.Length_Error => null; -- OK, correct exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Append - 3");
- end;
-
- -- Drop = Left
-
- -- Append (Bnd Str, Bnd Str)
- Result_String :=
- B10.Append(B10.To_Bounded_Wide_String(Equiv("abcdefgh")), -- 8 chs
- B10.To_Bounded_Wide_String(Equiv("ijklmn")), -- 6 chs
- Ada.Strings.Left);
-
- if Result_String /=
- B10.To_Bounded_Wide_String(Equiv("efghijklmn")) -- 10 chars
- then
- Report.Failed("Incorrect truncation performed by Append - 4");
- end if;
-
- -- Append (Bnd Str, Str)
- Result_String :=
- B10.Append(B10.To_Bounded_Wide_String("abcdefghij"),
- "xyz",
- Ada.Strings.Left);
-
- if Result_String /= B10.To_Bounded_Wide_String("defghijxyz") then
- Report.Failed("Incorrect truncation performed by Append - 5");
- end if;
-
- -- Append (Char, Bnd Str)
-
- Result_String :=
- B10.Append(Equiv('A'),
- B10.To_Bounded_Wide_String(Equiv("abcdefghij")),
- Ada.Strings.Left);
-
- if Result_String /= B10.To_Bounded_Wide_String(Equiv("abcdefghij"))
- then
- Report.Failed("Incorrect truncation performed by Append - 6");
- end if;
-
- -- Drop = Right
-
- -- Append (Bnd Str, Bnd Str)
- Result_String := B10.Append(FtoJ_Bnd_Str,
- AtoJ_Bnd_Str,
- Ada.Strings.Right);
-
- if Result_String /=
- B10.To_Bounded_Wide_String(Equiv("fghijabcde"))
- then
- Report.Failed("Incorrect truncation performed by Append - 7");
- end if;
-
- -- Append (Str, Bnd Str)
- Result_String := B10.Append(B10.To_Wide_String(AtoE_Bnd_Str),
- AtoJ_Bnd_Str,
- Ada.Strings.Right);
-
- if Result_String /=
- B10.To_Bounded_Wide_String(Equiv("abcdeabcde"))
- then
- Report.Failed("Incorrect truncation performed by Append - 8");
- end if;
-
- -- Append (Char, Bnd Str)
- Result_String := B10.Append(Equiv('A'), AtoJ_Bnd_Str, Ada.Strings.Right);
-
- if Result_String /= B10.To_Bounded_Wide_String(Equiv("Aabcdefghi")) then
- Report.Failed("Incorrect truncation performed by Append - 9");
- end if;
-
-
-
- -- Function Index with non-Identity map.
- -- Evaluate the function Index with a non-identity map
- -- parameter which will cause mapping of the source parameter
- -- prior to the evaluation of the index position search.
-
- Location :=
- B10.Index(Source => B10.To_Bounded_Wide_String("foxy fox 2"),
- Pattern => "FOX",
- Going => Ada.Strings.Backward,
- Mapping => ASWC.Upper_Case_Map);
-
- if Location /= 6 then
- Report.Failed("Incorrect result from Index, non-Identity map - 1");
- end if;
-
- Location :=
- B10.Index(B10.To_Bounded_Wide_String("THE QUICK "),
- "quick",
- Ada.Strings.Forward,
- Ada.Strings.Wide_Maps.Wide_Constants.Lower_Case_Map);
-
- if Location /= 5 then
- Report.Failed("Incorrect result from Index, non-Identity map - 2");
- end if;
-
- Location := B10.Index(Source => B10.To_Bounded_Wide_String("The the"),
- Pattern => "the",
- Going => Ada.Strings.Forward,
- Mapping => ASWC.Lower_Case_Map);
-
- if Location /= 1 then
- Report.Failed("Incorrect result from Index, non-Identity map - 3");
- end if;
-
-
-
- if B10.Index(B10.To_Bounded_Wide_String("abcd"), -- Pattern = Source
- "abcd") /= 1 or
- B10.Index(B10.To_Bounded_Wide_String("abc"), -- Pattern < Source
- "abcd") /= 0 or
- B10.Index(B10.Null_Bounded_Wide_String, -- Source = Null
- "abc") /= 0
- then
- Report.Failed("Incorrect result from Index with string patterns");
- end if;
-
-
-
- -- Function Index with access-to-subprogram mapping value.
- -- Evaluate the function Index with a wide character mapping function
- -- object that performs the mapping operation.
-
- Location := B10.Index(Source => B10.To_Bounded_Wide_String("My dog"),
- Pattern => "cat",
- Going => Ada.Strings.Forward,
- Mapping => Map_Ptr); -- change "dog" to "cat"
-
- if Location /= 4 then
- Report.Failed("Incorrect result from Index, w/map ptr - 1");
- end if;
-
- Location := B10.Index(B10.To_Bounded_Wide_String("cat or dog"),
- "cat",
- Ada.Strings.Backward,
- Map_Ptr);
-
- if Location /= 8 then
- Report.Failed("Incorrect result from Index, w/map ptr - 2");
- end if;
-
- if B10.Index(B10.To_Bounded_Wide_String("dog"), -- Pattern = Source
- "cat",
- Ada.Strings.Forward,
- Map_Ptr) /= 1 or
- B10.Index(B10.To_Bounded_Wide_String("dog"), -- Pattern < Source
- "cats",
- Ada.Strings.Backward,
- Map_Ptr) /= 0 or
- B10.Index(B10.Null_Bounded_Wide_String, -- Source = Null
- "cat",
- Ada.Strings.Forward,
- Map_Ptr) /= 0 or
- B10.Index(B10.To_Bounded_Wide_String("hot dog"),
- "dog",
- Ada.Strings.Backward,
- Map_Ptr) /= 0 or
- B10.Index(B10.To_Bounded_Wide_String(" cat dog "),
- " cat",
- Ada.Strings.Backward,
- Map_Ptr) /= 5 or
- B10.Index(B10.To_Bounded_Wide_String("dog CatDog"),
- "cat",
- Ada.Strings.Backward,
- Map_Ptr) /= 1 or
- B10.Index(B10.To_Bounded_Wide_String("CatandDog"),
- "cat",
- Ada.Strings.Forward,
- Map_Ptr) /= 0 or
- B10.Index(B10.To_Bounded_Wide_String("dddd"),
- "ccccc",
- Ada.Strings.Backward,
- Map_Ptr) /= 0
- then
- Report.Failed("Incorrect result from Index w/map ptr - 3");
- end if;
-
-
-
- -- Function Index (for Sets).
- -- This version of Index uses Sets as the basis of the search.
-
- -- Test = Inside, Going = Forward (Default case).
- Location :=
- B10.Index(Source => B10.To_Bounded_Wide_String(Equiv("abcdeabcde")),
- Set => Wide_CD_Set,
- Test => Ada.Strings.Inside,
- Going => Ada.Strings.Forward);
-
- if not (Location = 3) then -- position of first 'c' equivalent in source.
- Report.Failed("Incorrect result from Index using Sets - 1");
- end if;
-
- -- Test = Inside, Going = Backward.
- Location :=
- B10.Index(Source => B10."&"(AtoE_Bnd_Str, AtoE_Bnd_Str),
- Set => Wide_CD_Set,
- Test => Ada.Strings.Inside,
- Going => Ada.Strings.Backward);
-
- if not (Location = 9) then -- position of last 'd' in source.
- Report.Failed("Incorrect result from Index using Sets - 2");
- end if;
-
- -- Test = Outside, Going = Forward.
- Location := B10.Index(B10.To_Bounded_Wide_String("deddacd"),
- CD_Set,
- Test => Ada.Strings.Outside,
- Going => Ada.Strings.Forward);
-
- if Location /= 2 then -- position of 'e' in source.
- Report.Failed("Incorrect result from Index using Sets - 3");
- end if;
-
- -- Test = Outside, Going = Backward.
- Location := B10.Index(B10.To_Bounded_Wide_String(Equiv("deddacd")),
- Wide_CD_Set,
- Ada.Strings.Outside,
- Ada.Strings.Backward);
-
- if Location /= 5 then -- position of 'a', correct.
- Report.Failed("Incorrect result from Index using Sets - 4");
- end if;
-
- if B10.Index(B10.To_Bounded_Wide_String("cd"), -- Source = Set
- CD_Set) /= 1 or
- B10.Index(B10.To_Bounded_Wide_String("c"), -- Source < Set
- CD_Set) /= 1 or
- B10.Index(B10.Null_Bounded_Wide_String, -- Source = Null
- Wide_CD_Set) /= 0 or
- B10.Index(AtoE_Bnd_Str,
- Maps.To_Set('x')) /= 0 -- No match.
- then
- Report.Failed("Incorrect result from Index using Sets - 5");
- end if;
-
-
-
- -- Function Count with non-Identity mapping.
- -- Evaluate the function Count with a non-identity map
- -- parameter which will cause mapping of the source parameter
- -- prior to the evaluation of the number of matching patterns.
-
- Total_Count :=
- B10.Count(Source => B10.To_Bounded_Wide_String("THE THE TH"),
- Pattern => "th",
- Mapping => ASWC.Lower_Case_Map);
-
- if Total_Count /= 3 then
- Report.Failed
- ("Incorrect result from function Count, non-Identity map - 1");
- end if;
-
- -- And a few with identity maps as well.
-
- if B10.Count(B10.To_Bounded_Wide_String(Equiv("ABABABABAB")),
- Equiv("ABA"),
- Maps.Identity) /= 2 or
- B10.Count(B10.To_Bounded_Wide_String("ADCBADABCD"),
- "AB",
- Maps.To_Mapping("CD", "AB")) /= 5 or
- B10.Count(B10.To_Bounded_Wide_String(Equiv("aaaaaaaaaa")),
- Equiv("aaa")) /= 3 or
- B10.Count(B10.To_Bounded_Wide_String(Equiv("XX")),
- Equiv("XXX"),
- Maps.Identity) /= 0 or
- B10.Count(AtoE_Bnd_Str, -- Source = Pattern
- Equiv("abcde")) /= 1 or
- B10.Count(B10.Null_Bounded_Wide_String, -- Source = Null
- " ") /= 0
- then
- Report.Failed
- ("Incorrect result from function Count, w,w/o mapping");
- end if;
-
-
-
-
-
- -- Function Count with access-to-subprogram mapping.
- -- Evaluate the version function Count that uses an access-to-subprogram
- -- map parameter.
-
- Total_Count :=
- B10.Count(Source => B10.To_Bounded_Wide_String("dogdogdo"),
- Pattern => "ca",
- Mapping => Map_Ptr);
-
- if Total_Count /= 3 then
- Report.Failed
- ("Incorrect result from function Count, w/map ptr - 1");
- end if;
-
-
- if B10.Count(B10.To_Bounded_Wide_String("DdOoGgod"),
- "c",
- Map_Ptr) /= 2 or
- B10.Count(B10.To_Bounded_Wide_String("dododododo"),
- "do",
- Map_Ptr) /= 0 or
- B10.Count(B10.To_Bounded_Wide_String("Dog or dog"),
- "cat",
- Map_Ptr) /= 1 or
- B10.Count(B10.To_Bounded_Wide_String("dddddddddd"),
- "ccccc",
- Map_Ptr) /= 2 or
- B10.Count(B10.To_Bounded_Wide_String("do"), -- Source < Pattern
- "cat",
- Map_Ptr) /= 0 or
- B10.Count(B10.To_Bounded_Wide_String(" dog "), -- Source = Pattern
- " cat ",
- Map_Ptr) /= 1 or
- B10.Count(B10.Null_Bounded_Wide_String, -- Source = Null
- " ",
- Map_Ptr) /= 0
- then
- Report.Failed
- ("Incorrect result from function Count, w/map ptr - 2");
- end if;
-
-
-
-
- -- Procedure Translate
-
- -- Partial mapping of source.
-
- Test_String := B10.To_Bounded_Wide_String("abcdeabcab");
-
- B10.Translate(Source => Test_String, Mapping => AB_to_YZ_Map);
-
- if Test_String /= B10.To_Bounded_Wide_String("yzcdeyzcyz") then
- Report.Failed("Incorrect result from procedure Translate - 1");
- end if;
-
- -- Total mapping of source.
-
- Test_String := B10.To_Bounded_Wide_String("abbaaababb");
-
- B10.Translate(Source => Test_String, Mapping => ASWC.Upper_Case_Map);
-
- if Test_String /= B10.To_Bounded_Wide_String("ABBAAABABB") then
- Report.Failed("Incorrect result from procedure Translate - 2");
- end if;
-
- -- No mapping of source.
-
- Test_String := B10.To_Bounded_Wide_String(Equiv("xyzsypcc"));
-
- B10.Translate(Source => Test_String, Mapping => Wide_AB_to_YZ_Map);
-
- if Test_String /= B10.To_Bounded_Wide_String(Equiv("xyzsypcc")) then
- Report.Failed("Incorrect result from procedure Translate - 3");
- end if;
-
- -- Map > 2 characters, partial mapping.
-
- Test_String := B10.To_Bounded_Wide_String("opabcdelmn");
-
- B10.Translate(Test_String,
- Maps.To_Mapping("abcde", "lmnop"));
-
- if Test_String /= B10.To_Bounded_Wide_String("oplmnoplmn") then
- Report.Failed("Incorrect result from procedure Translate - 4");
- end if;
-
-
-
-
- -- Procedure Translate with access-to-subprogram mapping.
- -- Use the version of Procedure Translate that takes an
- -- access-to-subprogram parameter to perform the Source mapping.
-
- -- Partial mapping of source.
-
- Test_String := B10.To_Bounded_Wide_String("dogeatdog");
-
- B10.Translate(Source => Test_String, Mapping => Map_Ptr);
-
- if Test_String /= B10.To_Bounded_Wide_String("cateatcat") then
- Report.Failed
- ("Incorrect result from procedure Translate w/map ptr - 1");
- end if;
-
- Test_String := B10.To_Bounded_Wide_String("odogcatlmn");
-
- B10.Translate(Test_String, Map_Ptr);
-
- if Test_String /= B10.To_Bounded_Wide_String("acatcatlmn") then
- Report.Failed
- ("Incorrect result from procedure Translate w/map ptr - 2");
- end if;
-
-
- -- Total mapping of source.
-
- Test_String := B10.To_Bounded_Wide_String("gggooooddd");
-
- B10.Translate(Source => Test_String, Mapping => Map_Ptr);
-
- if Test_String /= B10.To_Bounded_Wide_String("tttaaaaccc") then
- Report.Failed
- ("Incorrect result from procedure Translate w/map ptr- 3");
- end if;
-
- -- No mapping of source.
-
- Test_String := B10.To_Bounded_Wide_String(" DOG cat ");
-
- B10.Translate(Source => Test_String, Mapping => Map_Ptr);
-
- if Test_String /= B10.To_Bounded_Wide_String(" DOG cat ") then
- Report.Failed
- ("Incorrect result from procedure Translate w/map ptr - 4");
- end if;
-
- Test_String := B10.Null_Bounded_Wide_String;
-
- B10.Translate(Source => Test_String, Mapping => Map_Ptr);
-
- if Test_String /= B10.To_Bounded_Wide_String("") then
- Report.Failed
- ("Incorrect result from procedure Translate w/map ptr - 5");
- end if;
-
-
-
-
- -- Function Translate with access-to-subprogram mapping.
- -- Use the version of Function Translate that takes an
- -- access-to-subprogram parameter to perform the Source mapping.
-
- -- Partial mapping of source.
-
- if B10.Translate(Source => B10.To_Bounded_Wide_String("cateatdog"),
- Mapping => Map_Ptr) /=
- B10.To_Bounded_Wide_String("cateatcat")
- then
- Report.Failed
- ("Incorrect result from function Translate w/map ptr - 1");
- end if;
-
- if B10.Translate(B10.To_Bounded_Wide_String("cadogtac"),
- Map_Ptr) /=
- B10.To_Bounded_Wide_String("cacattac")
- then
- Report.Failed
- ("Incorrect result from function Translate w/map ptr - 2");
- end if;
-
- -- Total mapping of source.
-
- if B10.Translate(Source => B10.To_Bounded_Wide_String("dogodggdo"),
- Mapping => Map_Ptr) /=
- B10.To_Bounded_Wide_String("catacttca")
- then
- Report.Failed
- ("Incorrect result from function Translate w/map ptr- 3");
- end if;
-
- -- No mapping of source.
-
- if B10.Translate(Source => B10.To_Bounded_Wide_String(" DOG cat "),
- Mapping => Map_Ptr) /=
- B10.To_Bounded_Wide_String(" DOG cat ")
- then
- Report.Failed
- ("Incorrect result from function Translate w/map ptr - 4");
- end if;
-
- if B10.Translate(B10.To_Bounded_Wide_String("d "), Map_Ptr) /=
- B10.To_Bounded_Wide_String("c ") or
- B10.Translate(B10.To_Bounded_Wide_String(" god"), Map_Ptr) /=
- B10.To_Bounded_Wide_String(" tac") or
- B10.Translate(B10.To_Bounded_Wide_String("d o g D og"), Map_Ptr) /=
- B10.To_Bounded_Wide_String("c a t D at") or
- B10.Translate(B10.To_Bounded_Wide_String(" "), Map_Ptr) /=
- B10.To_Bounded_Wide_String(" ") or
- B10.Translate(B10.To_Bounded_Wide_String("dddddddddd"), Map_Ptr) /=
- B10.To_Bounded_Wide_String("cccccccccc")
- then
- Report.Failed
- ("Incorrect result from function Translate w/map ptr - 5");
- end if;
-
- if B10.Translate(Source => B10.Null_Bounded_Wide_String,
- Mapping => Map_Ptr) /=
- B10.To_Bounded_Wide_String("")
- then
- Report.Failed
- ("Incorrect result from function Translate w/map ptr - 6");
- end if;
-
-
-
-
- -- Function Replace_Slice
- -- Evaluate function Replace_Slice with
- -- a variety of Truncation options.
-
- -- Drop = Error (Default)
-
- begin
- Test_String := AtoJ_Bnd_Str;
- Result_String :=
- B10.Replace_Slice(Source => Test_String,
- Low => 3,
- High => 5, -- 3-5, 3 chars.
- By => Equiv("xxxxxx")); -- more than 3.
- Report.Failed("Length_Error not raised by Function Replace_Slice");
- exception
- when AS.Length_Error => null; -- Correct exception raised.
- when others =>
- Report.Failed
- ("Incorrect exception raised by Function Replace_Slice");
- end;
-
- -- Drop = Left
-
- Result_String :=
- B10.Replace_Slice(Source => Test_String,
- Low => 7,
- High => 10, -- 7-10, 4 chars.
- By => Equiv("xxxxxx"), -- 6 chars.
- Drop => Ada.Strings.Left);
-
- if Result_String /=
- B10.To_Bounded_Wide_String(Equiv("cdefxxxxxx")) -- drop a,b
- then
- Report.Failed
- ("Incorrect result from Function Replace Slice, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Result_String :=
- B10.Replace_Slice(Source => Test_String,
- Low => 2,
- High => 5, -- 2-5, 4 chars.
- By => Equiv("xxxxxx"), -- 6 chars.
- Drop => Ada.Strings.Right);
-
- if Result_String /=
- B10.To_Bounded_Wide_String(Equiv("axxxxxxfgh")) -- drop i,j
- then
- Report.Failed
- ("Incorrect result from Function Replace Slice, Drop = Right");
- end if;
-
- -- Low = High = Source'Last, "By" length = 1.
-
- if B10.Replace_Slice(AtoE_Bnd_Str,
- B10.To_Wide_String(AtoE_Bnd_Str)'Last,
- B10.To_Wide_String(AtoE_Bnd_Str)'Last,
- Equiv("X"),
- Ada.Strings.Error) /=
- B10.To_Bounded_Wide_String(Equiv("abcdX"))
- then
- Report.Failed("Incorrect result from Function Replace_Slice");
- end if;
-
- -- Index_Error raised when High < Source'First - 1.
- begin
- Test_String :=
- B10.Replace_Slice(AtoE_Bnd_Str,
- B10.To_Wide_String(AtoE_Bnd_Str)'First,
- B10.To_Wide_String(AtoE_Bnd_Str)'First - 2,
- Equiv("hijklm"));
- Report.Failed("Index_Error not raised by Function Replace_Slice");
- exception
- when AS.Index_Error => null; -- OK, expected exception
- when Constraint_Error => null; -- Also OK, since RM is not clear
- when others =>
- Report.Failed
- ("Incorrect exception raised by Function Replace_Slice");
- end;
-
-
-
- -- Procedure Replace_Slice
- -- Evaluate procedure Replace_Slice with
- -- a variety of Truncation options.
-
- -- Drop = Error (Default)
-
- begin
- Test_String := AtoJ_Bnd_Str;
- B10.Replace_Slice(Source => Test_String,
- Low => 3,
- High => 5, -- 3-5, 3 chars.
- By => Equiv("xxxxxx")); -- more than 3.
- Report.Failed("Length_Error not raised by Procedure Replace_Slice");
- exception
- when AS.Length_Error => null; -- Correct exception raised.
- when others =>
- Report.Failed
- ("Incorrect exception raised by Procedure Replace_Slice");
- end;
-
- -- Drop = Left
-
- Test_String := AtoJ_Bnd_Str;
- B10.Replace_Slice(Source => Test_String,
- Low => 7,
- High => 9, -- 7-9, 3 chars.
- By => Equiv("xxxxx"), -- 5 chars.
- Drop => Ada.Strings.Left);
-
- if Test_String /=
- B10.To_Bounded_Wide_String(Equiv("cdefxxxxxj")) -- drop a,b
- then
- Report.Failed
- ("Incorrect result from Procedure Replace Slice, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Test_String := AtoJ_Bnd_Str;
- B10.Replace_Slice(Source => Test_String,
- Low => 1,
- High => 3, -- 1-3, 3chars.
- By => Equiv("xxxx"), -- 4 chars.
- Drop => Ada.Strings.Right);
-
- if Test_String /=
- B10.To_Bounded_Wide_String(Equiv("xxxxdefghi")) -- drop j
- then
- Report.Failed
- ("Incorrect result from Procedure Replace Slice, Drop = Right");
- end if;
-
- -- High = Source'First, Low > High (Insert before Low).
-
- Test_String := AtoE_Bnd_Str;
- B10.Replace_Slice(Source => Test_String,
- Low => B10.To_Wide_String(Test_String)'Last,
- High => B10.To_Wide_String(Test_String)'First,
- By => Equiv("XXXX"), -- 4 chars.
- Drop => Ada.Strings.Right);
-
- if Test_String /= B10.To_Bounded_Wide_String(Equiv("abcdXXXXe")) then
- Report.Failed
- ("Incorrect result from Procedure Replace Slice");
- end if;
-
-
-
-
- -- Function Insert with Truncation
- -- Drop = Error (Default).
-
- begin
- Result_String :=
- B10.Insert(Source => AtoJ_Bnd_Str, -- "abcdefghij"
- Before => 2,
- New_Item => Equiv("xyz"));
- Report.Failed("Length_Error not raised by Function Insert");
- exception
- when AS.Length_Error => null; -- Correct exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Function Insert");
- end;
-
- -- Drop = Left
-
- Result_String :=
- B10.Insert(Source => AtoJ_Bnd_Str, -- "abcdefghij"
- Before => 5,
- New_Item => Equiv("xyz"), -- 3 additional chars.
- Drop => Ada.Strings.Left);
-
- if B10.To_Wide_String(Result_String) /= Equiv("dxyzefghij") then
- Report.Failed("Incorrect result from Function Insert, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Result_String :=
- B10.Insert(Source => B10.To_Bounded_Wide_String("abcdef"),
- Before => 2,
- New_Item => "vwxyz", -- 5 additional chars.
- Drop => Ada.Strings.Right);
-
- if B10.To_Wide_String(Result_String) /= "avwxyzbcde" then -- drop f.
- Report.Failed("Incorrect result from Function Insert, Drop = Right");
- end if;
-
- -- Additional cases.
-
- if B10.Insert(B10.To_Bounded_Wide_String("a"), 1, " B") /=
- B10.To_Bounded_Wide_String(" Ba") or
- B10.Insert(B10.Null_Bounded_Wide_String, 1, Equiv("abcde")) /=
- AtoE_Bnd_Str or
- B10.Insert(B10.To_Bounded_Wide_String("ab"), 2, "") /=
- B10.To_Bounded_Wide_String("ab")
- then
- Report.Failed("Incorrect result from Function Insert");
- end if;
-
-
-
- -- Procedure Insert
-
- -- Drop = Error (Default).
- begin
- Test_String := AtoJ_Bnd_Str;
- B10.Insert(Source => Test_String,
- Before => 9,
- New_Item => Equiv("wxyz"),
- Drop => Ada.Strings.Error);
- Report.Failed("Length_Error not raised by Procedure Insert");
- exception
- when AS.Length_Error => null; -- Correct exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure Insert");
- end;
-
- -- Drop = Left
-
- Test_String := AtoJ_Bnd_Str;
- B10.Insert(Source => Test_String,
- Before => B10.Length(Test_String), -- before last char
- New_Item => Equiv("xyz"), -- 3 additional chars.
- Drop => Ada.Strings.Left);
-
- if B10.To_Wide_String(Test_String) /= Equiv("defghixyzj") then
- Report.Failed("Incorrect result from Procedure Insert, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Test_String := AtoJ_Bnd_Str;
- B10.Insert(Source => Test_String,
- Before => 4,
- New_Item => Equiv("yz"), -- 2 additional chars.
- Drop => Ada.Strings.Right);
-
- if B10.To_Wide_String(Test_String) /= Equiv("abcyzdefgh") then
- Report.Failed
- ("Incorrect result from Procedure Insert, Drop = Right");
- end if;
-
- -- Before = Source'First, New_Item length = 1.
-
- Test_String := B10.To_Bounded_Wide_String(" abc ");
- B10.Insert(Test_String,
- B10.To_Wide_String(Test_String)'First,
- "Z");
-
- if Test_String /= B10.To_Bounded_Wide_String("Z abc ") then
- Report.Failed("Incorrect result from Procedure Insert");
- end if;
-
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4019;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4020.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4020.a
deleted file mode 100644
index 24036f17103..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4020.a
+++ /dev/null
@@ -1,688 +0,0 @@
--- CXA4020.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Wide_Bounded
--- are available, and that they produce correct results, especially under
--- conditions where truncation of the result is required. Specifically,
--- check the subprograms Overwrite (function and procedure), Delete,
--- Function Trim (blanks), Trim (Set wide characters, function and
--- procedure), Head, Tail, and Replicate (wide characters and wide
--- strings).
---
--- TEST DESCRIPTION:
--- This test, in conjunction with tests CXA4017, CXA4018, CXA4019,
--- will provide coverage of the most common usages of the functionality
--- found in the Ada.Strings.Wide_Bounded package. It deals in large part
--- with truncation effects and options. This test contains many small,
--- specific test cases, situations that are often difficult to generate
--- in large numbers in an application-based test. These cases represent
--- specific usage paradigms in-the-small.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 22 Dec 94 SAIC Changed obsolete constant to Strings.Wide_Space.
--- 13 Apr 95 SAIC Corrected certain subtest acceptance conditions.
---
---!
-
-with Report;
-with Ada.Characters.Handling;
-with Ada.Strings.Wide_Bounded;
-with Ada.Strings.Wide_Maps;
-
-procedure CXA4020 is
-
- -- The following two functions are used to translate character and string
- -- values to "Wide" values. They will be applied to all the Wide_Bounded
- -- subprogram parameters to simulate the use of Wide_Characters and
- -- Wide_Strings in actual practice. Blanks are translated to Wide_Character
- -- blanks and all other characters are translated into Wide_Characters with
- -- position values 256 greater than their (narrow) character position
- -- values.
-
- function Translate (Ch : Character) return Wide_Character is
- C : Character := Ch;
- begin
- if Ch = ' ' then
- return Ada.Characters.Handling.To_Wide_Character(C);
- else
- return Wide_Character'Val(Character'Pos(Ch) +
- Character'Pos(Character'Last) + 1);
- end if;
- end Translate;
-
-
- function Translate (Str : String) return Wide_String is
- WS : Wide_String(Str'First..Str'Last);
- begin
- for i in Str'First..Str'Last loop
- WS(i) := Translate(Str(i));
- end loop;
- return WS;
- end Translate;
-
-
-begin
-
- Report.Test("CXA4020", "Check that the subprograms defined in " &
- "package Ada.Strings.Wide_Bounded are " &
- "available, and that they produce correct " &
- "results, especially under conditions where " &
- "truncation of the result is required");
-
- Test_Block:
- declare
-
- package AS renames Ada.Strings;
- package ASW renames Ada.Strings.Wide_Bounded;
- package Maps renames Ada.Strings.Wide_Maps;
-
- package B10 is new ASW.Generic_Bounded_Length(Max => 10);
- use type B10.Bounded_Wide_String;
-
- Result_String : B10.Bounded_Wide_String;
- Test_String : B10.Bounded_Wide_String;
- AtoE_Bnd_Str : B10.Bounded_Wide_String :=
- B10.To_Bounded_Wide_String(Translate("abcde"));
- FtoJ_Bnd_Str : B10.Bounded_Wide_String :=
- B10.To_Bounded_Wide_String(Translate("fghij"));
- AtoJ_Bnd_Str : B10.Bounded_Wide_String :=
- B10.To_Bounded_Wide_String(Translate("abcdefghij"));
-
- Location : Natural := 0;
- Total_Count : Natural := 0;
-
- CD_Set : Maps.Wide_Character_Set := Maps.To_Set(Translate("cd"));
- XY_Set : Maps.Wide_Character_Set := Maps.To_Set(Translate("xy"));
-
-
- begin
-
- -- Function Overwrite with Truncation
- -- Drop = Error (Default).
-
- begin
- Test_String := AtoJ_Bnd_Str;
- Result_String :=
- B10.Overwrite(Source => Test_String, -- "abcdefghij"
- Position => 9,
- New_Item => Translate("xyz"),
- Drop => AS.Error);
- Report.Failed("Exception not raised by Function Overwrite");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Function Overwrite");
- end;
-
- -- Drop = Left
-
- Result_String :=
- B10.Overwrite(Source => Test_String, -- "abcdefghij"
- Position => B10.Length(Test_String), -- 10
- New_Item => Translate("xyz"),
- Drop => Ada.Strings.Left);
-
- if B10.To_Wide_String(Result_String) /=
- Translate("cdefghixyz") then -- drop a,b
- Report.Failed
- ("Incorrect result from Function Overwrite, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Result_String := B10.Overwrite(Test_String, -- "abcdefghij"
- 3,
- Translate("xxxyyyzzz"),
- Ada.Strings.Right);
-
- if B10.To_Wide_String(Result_String) /=
- Translate("abxxxyyyzz")
- then
- Report.Failed
- ("Incorrect result from Function Overwrite, Drop = Right");
- end if;
-
- -- Additional cases of function Overwrite.
-
- if B10.Overwrite(B10.To_Bounded_Wide_String(Translate("a")),
- 1, -- Source length = 1
- Translate(" abc ")) /=
- B10.To_Bounded_Wide_String(Translate(" abc ")) or
- B10.Overwrite(B10.Null_Bounded_Wide_String, -- Null source
- 1,
- Translate("abcdefghij")) /=
- AtoJ_Bnd_Str or
- B10.Overwrite(AtoE_Bnd_Str,
- B10.To_Wide_String(AtoE_Bnd_Str)'First,
- Translate(" ")) /= -- New_Item = 1
- B10.To_Bounded_Wide_String(Translate(" bcde"))
- then
- Report.Failed("Incorrect result from Function Overwrite");
- end if;
-
-
-
- -- Procedure Overwrite
- -- Correct usage, no truncation.
-
- Test_String := AtoE_Bnd_Str; -- "abcde"
- B10.Overwrite(Test_String, 2, Translate("xyz"));
-
- if Test_String /= B10.To_Bounded_Wide_String(Translate("axyze")) then
- Report.Failed("Incorrect result from Procedure Overwrite - 1");
- end if;
-
- Test_String := B10.To_Bounded_Wide_String(Translate("abc"));
- B10.Overwrite(Test_String, 2, ""); -- New_Item is null string.
-
- if Test_String /= B10.To_Bounded_Wide_String(Translate("abc")) then
- Report.Failed("Incorrect result from Procedure Overwrite - 2");
- end if;
-
- -- Drop = Error (Default).
-
- begin
- Test_String := AtoJ_Bnd_Str;
- B10.Overwrite(Source => Test_String, -- "abcdefghij"
- Position => 8,
- New_Item => Translate("uvwxyz"));
- Report.Failed("Exception not raised by Procedure Overwrite");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure Overwrite");
- end;
-
- -- Drop = Left
-
- Test_String := AtoJ_Bnd_Str;
- B10.Overwrite(Source => Test_String, -- "abcdefghij"
- Position => B10.Length(Test_String) - 2, -- 8
- New_Item => Translate("uvwxyz"),
- Drop => Ada.Strings.Left);
-
- if B10.To_Wide_String(Test_String) /=
- Translate("defguvwxyz")
- then
- Report.Failed
- ("Incorrect result from Procedure Overwrite, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Test_String := AtoJ_Bnd_Str;
- B10.Overwrite(Test_String, -- "abcdefghij"
- 3,
- Translate("xxxyyyzzz"),
- Ada.Strings.Right);
-
- if B10.To_Wide_String(Test_String) /= Translate("abxxxyyyzz") then
- Report.Failed
- ("Incorrect result from Procedure Overwrite, Drop = Right");
- end if;
-
-
-
- -- Function Delete
-
- if B10.Delete(Source => AtoJ_Bnd_Str, -- "abcdefghij"
- From => 3,
- Through => 8) /=
- B10."&"(B10.Head(AtoJ_Bnd_Str, 2),
- B10.Tail(AtoJ_Bnd_Str, 2)) or
- B10.Delete(AtoJ_Bnd_Str, 6, B10.Length(AtoJ_Bnd_Str)) /=
- AtoE_Bnd_Str or
- B10.Delete(AtoJ_Bnd_Str, 1, 5) /=
- FtoJ_Bnd_Str
- then
- Report.Failed("Incorrect result from Function Delete - 1");
- end if;
-
- if B10.Delete(B10.To_Bounded_Wide_String(Translate("a")), 1, 1) /=
- B10.Null_Bounded_Wide_String or
- B10.Delete(AtoE_Bnd_Str,
- 5,
- B10.To_Wide_String(AtoE_Bnd_Str)'First) /=
- AtoE_Bnd_Str or
- B10.Delete(AtoE_Bnd_Str,
- B10.To_Wide_String(AtoE_Bnd_Str)'Last,
- B10.To_Wide_String(AtoE_Bnd_Str)'Last) /=
- B10.To_Bounded_Wide_String(Translate("abcd"))
- then
- Report.Failed("Incorrect result from Function Delete - 2");
- end if;
-
-
-
- -- Function Trim
-
- declare
-
- Text : B10.Bounded_Wide_String :=
- B10.To_Bounded_Wide_String(Translate("Text"));
- type Bnd_Array_Type is array (1..5) of B10.Bounded_Wide_String;
- Bnd_Array : Bnd_Array_Type :=
- (B10.To_Bounded_Wide_String(Translate(" Text")),
- B10.To_Bounded_Wide_String(Translate("Text ")),
- B10.To_Bounded_Wide_String(Translate(" Text ")),
- B10.To_Bounded_Wide_String(Translate("Text Text")),
- B10.To_Bounded_Wide_String(Translate(" Text Text")));
-
- begin
-
- for i in Bnd_Array_Type'Range loop
- case i is
- when 4 =>
- if B10.Trim(Bnd_Array(i), AS.Both) /=
- Bnd_Array(i) then -- no change
- Report.Failed("Incorrect result from Function Trim - 4");
- end if;
- when 5 =>
- if B10.Trim(Bnd_Array(i), AS.Both) /=
- B10."&"(Text, B10."&"(Translate(' '), Text))
- then
- Report.Failed("Incorrect result from Function Trim - 5");
- end if;
- when others =>
- if B10.Trim(Bnd_Array(i), AS.Both) /= Text then
- Report.Failed("Incorrect result from Function Trim - " &
- Integer'Image(i));
- end if;
- end case;
- end loop;
-
- end;
-
-
-
- -- Function Trim using Sets
-
- -- Trim characters in sets from both sides of the bounded wide string.
- if B10.Trim(Source => B10.To_Bounded_Wide_String(Translate("ddabbaxx")),
- Left => CD_Set,
- Right => XY_Set) /=
- B10.To_Bounded_Wide_String(Translate("abba"))
- then
- Report.Failed
- ("Incorrect result from Fn Trim - Sets, Left & Right side - 1");
- end if;
-
- -- Ensure that the characters in the set provided as the actual to
- -- parameter Right are not trimmed from the left side of the bounded
- -- wide string; likewise for the opposite side. Only "cd" trimmed
- -- from left side, and only "xy" trimmed from right side.
-
- if B10.Trim(B10.To_Bounded_Wide_String(Translate("cdxyabcdxy")),
- CD_Set,
- XY_Set) /=
- B10.To_Bounded_Wide_String(Translate("xyabcd"))
- then
- Report.Failed
- ("Incorrect result from Fn Trim - Sets, Left & Right side - 2");
- end if;
-
- -- Ensure that characters contained in the sets are not trimmed from
- -- the "interior" of the bounded wide string, just the appropriate ends.
-
- if B10.Trim(B10.To_Bounded_Wide_String(Translate("cdabdxabxy")),
- CD_Set,
- XY_Set) /=
- B10.To_Bounded_Wide_String(Translate("abdxab"))
- then
- Report.Failed
- ("Incorrect result from Fn Trim - Sets, Left & Right side - 3");
- end if;
-
- -- Trim characters in set from right side only. No change to Left side.
-
- if B10.Trim(B10.To_Bounded_Wide_String(Translate("abxyzddcd")),
- XY_Set,
- CD_Set) /=
- B10.To_Bounded_Wide_String(Translate("abxyz"))
- then
- Report.Failed
- ("Incorrect result from Fn Trim - Sets, Right side");
- end if;
-
- -- Trim no characters on either side of the bounded string.
-
- Result_String := B10.Trim(AtoJ_Bnd_Str, CD_Set, XY_Set);
- if Result_String /= AtoJ_Bnd_Str then
- Report.Failed("Incorrect result from Fn Trim - Sets, Neither side");
- end if;
-
- if B10.Trim(AtoE_Bnd_Str, Maps.Null_Set, Maps.Null_Set) /=
- AtoE_Bnd_Str or
- B10.Trim(B10.To_Bounded_Wide_String(Translate("dcddcxyyxx")),
- CD_Set,
- XY_Set) /=
- B10.Null_Bounded_Wide_String
- then
- Report.Failed("Incorrect result from Function Trim");
- end if;
-
-
-
- -- Procedure Trim using Sets
-
- -- Trim characters in sets from both sides of the bounded wide string.
-
- Test_String := B10.To_Bounded_Wide_String(Translate("dcabbayx"));
- B10.Trim(Source => Test_String,
- Left => CD_Set,
- Right => XY_Set);
-
- if Test_String /= B10.To_Bounded_Wide_String(Translate("abba")) then
- Report.Failed
- ("Incorrect result from Proc Trim - Sets, Left & Right side - 1");
- end if;
-
- -- Ensure that the characters in the set provided as the actual to
- -- parameter Right are not trimmed from the left side of the bounded
- -- wide string; likewise for the opposite side. Only "cd" trimmed
- -- from left side, and only "xy" trimmed from right side.
-
- Test_String := B10.To_Bounded_Wide_String(Translate("cdxyabcdxy"));
- B10.Trim(Test_String, CD_Set, XY_Set);
-
- if Test_String /= B10.To_Bounded_Wide_String(Translate("xyabcd")) then
- Report.Failed
- ("Incorrect result from Proc Trim - Sets, Left & Right side - 2");
- end if;
-
- -- Ensure that characters contained in the sets are not trimmed from
- -- the "interior" of the bounded wide string, just the appropriate ends.
-
- Test_String := B10.To_Bounded_Wide_String(Translate("cdabdxabxy"));
- B10.Trim(Test_String, CD_Set, XY_Set);
-
- if not
- (Test_String = B10.To_Bounded_Wide_String(Translate("abdxab"))) then
- Report.Failed
- ("Incorrect result from Proc Trim - Sets, Left & Right side - 3");
- end if;
-
- -- Trim characters in set from Left side only. No change to Right side.
-
- Test_String := B10.To_Bounded_Wide_String(Translate("cccdabxyz"));
- B10.Trim(Test_String, CD_Set, XY_Set);
-
- if Test_String /= B10.To_Bounded_Wide_String(Translate("abxyz")) then
- Report.Failed
- ("Incorrect result from Proc Trim for Sets, Left side only");
- end if;
-
- -- Trim no characters on either side of the bounded wide string.
-
- Test_String := AtoJ_Bnd_Str;
- B10.Trim(Test_String, CD_Set, CD_Set);
-
- if Test_String /= AtoJ_Bnd_Str then
- Report.Failed("Incorrect result from Proc Trim-Sets, Neither side");
- end if;
-
-
-
- -- Function Head with Truncation
- -- Drop = Error (Default).
-
- begin
- Result_String := B10.Head(Source => AtoJ_Bnd_Str, -- max length
- Count => B10.Length(AtoJ_Bnd_Str) + 1,
- Pad => Translate('X'));
- Report.Failed("Length_Error not raised by Function Head");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Function Head");
- end;
-
- -- Drop = Left
-
- -- Pad characters (5) are appended to the right end of the bounded
- -- wide string (which is initially at its maximum length), then the
- -- first five characters of the intermediate result are dropped to
- -- conform to the maximum size limit of the bounded wide string (10).
-
- Result_String :=
- B10.Head(B10.To_Bounded_Wide_String(Translate("ABCDEFGHIJ")),
- 15,
- Translate('x'),
- Ada.Strings.Left);
-
- if Result_String /=
- B10.To_Bounded_Wide_String(Translate("FGHIJxxxxx"))
- then
- Report.Failed("Incorrect result from Function Head, Drop = Left");
- end if;
-
- -- Drop = Right
-
- -- Pad characters (6) are appended to the left end of the bounded
- -- wide string (which is initially at one less than its maximum length),
- -- then the last five characters of the intermediate result are dropped
- -- (which in this case are the pad characters) to conform to the
- -- maximum size limit of the bounded wide string (10).
-
- Result_String :=
- B10.Head(B10.To_Bounded_Wide_String(Translate("ABCDEFGHI")),
- 15,
- Translate('x'),
- Ada.Strings.Right);
-
- if Result_String /=
- B10.To_Bounded_Wide_String(Translate("ABCDEFGHIx"))
- then
- Report.Failed("Incorrect result from Function Head, Drop = Right");
- end if;
-
- -- Additional cases.
-
- if B10.Head(B10.Null_Bounded_Wide_String, 5, Translate('a')) /=
- B10.To_Bounded_Wide_String(Translate("aaaaa")) or
- B10.Head(AtoE_Bnd_Str,
- B10.Length(AtoE_Bnd_Str)) /=
- AtoE_Bnd_Str
- then
- Report.Failed("Incorrect result from Function Head");
- end if;
-
-
-
- -- Function Tail with Truncation
- -- Drop = Error (Default Case)
-
- begin
- Result_String := B10.Tail(Source => AtoJ_Bnd_Str, -- max length
- Count => B10.Length(AtoJ_Bnd_Str) + 1,
- Pad => Ada.Strings.Wide_Space,
- Drop => Ada.Strings.Error);
- Report.Failed("Length_Error not raised by Function Tail");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed("Incorrect exception raised by Function Tail");
- end;
-
- -- Drop = Left
-
- -- Pad characters (5) are appended to the left end of the bounded wide
- -- string (which is initially at two less than its maximum length),
- -- then the first three characters of the intermediate result (in this
- -- case, 3 pad characters) are dropped.
-
- Result_String :=
- B10.Tail(B10.To_Bounded_Wide_String(Translate("ABCDEFGH")),
- 13,
- Translate('x'),
- Ada.Strings.Left);
-
- if Result_String /=
- B10.To_Bounded_Wide_String(Translate("xxABCDEFGH"))
- then
- Report.Failed("Incorrect result from Function Tail, Drop = Left");
- end if;
-
- -- Drop = Right
-
- -- Pad characters (3) are appended to the left end of the bounded wide
- -- string (which is initially at its maximum length), then the last
- -- three characters of the intermediate result are dropped.
-
- Result_String :=
- B10.Tail(B10.To_Bounded_Wide_String(Translate("ABCDEFGHIJ")),
- 13,
- Translate('x'),
- Ada.Strings.Right);
-
- if Result_String /=
- B10.To_Bounded_Wide_String(Translate("xxxABCDEFG"))
- then
- Report.Failed("Incorrect result from Function Tail, Drop = Right");
- end if;
-
- -- Additional cases.
-
- if B10.Tail(B10.Null_Bounded_Wide_String, 3, Translate(' ')) /=
- B10.To_Bounded_Wide_String(Translate(" ")) or
- B10.Tail(AtoE_Bnd_Str,
- B10.To_Wide_String(AtoE_Bnd_Str)'First) /=
- B10.To_Bounded_Wide_String(Translate("e"))
- then
- Report.Failed("Incorrect result from Function Tail");
- end if;
-
-
-
- -- Function Replicate (#, Char) with Truncation
- -- Drop = Error (Default).
-
- begin
- Result_String := B10.Replicate(Count => B10.Max_Length + 5,
- Item => Translate('A'),
- Drop => AS.Error);
- Report.Failed
- ("Length_Error not raised by Replicate for characters");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed
- ("Incorrect exception raised by Replicate for characters");
- end;
-
- -- Drop = Left, Right
- -- Since this version of Replicate uses wide character parameters, the
- -- result after truncation from left or right will appear the same.
- -- The result will be a 10 character bounded wide string, composed of
- -- 10 "Item" wide characters.
-
- if B10.Replicate(Count => 20,
- Item => Translate('A'),
- Drop => Ada.Strings.Left) /=
- B10.Replicate(15, Translate('A'), Ada.Strings.Right)
- then
- Report.Failed("Incorrect result from Replicate for characters - 1");
- end if;
-
- -- Blank-filled, 10 character bounded wide strings.
-
- if B10.Replicate(B10.Max_Length + 1,
- Translate(' '),
- Drop => Ada.Strings.Left) /=
- B10.Replicate(B10.Max_Length, Ada.Strings.Wide_Space)
- then
- Report.Failed("Incorrect result from Replicate for characters - 2");
- end if;
-
- -- Additional cases.
-
- if B10.Replicate(0, Translate('a')) /= B10.Null_Bounded_Wide_String or
- B10.Replicate(1, Translate('a')) /=
- B10.To_Bounded_Wide_String(Translate("a"))
- then
- Report.Failed("Incorrect result from Replicate for characters - 3");
- end if;
-
-
-
- -- Function Replicate (#, String) with Truncation
- -- Drop = Error (Default).
-
- begin
- Result_String := B10.Replicate(Count => 5, -- result would be 15.
- Item => Translate("abc"));
- Report.Failed
- ("Length_Error not raised by Replicate for wide strings");
- exception
- when AS.Length_Error => null; -- Expected exception raised.
- when others =>
- Report.Failed
- ("Incorrect exception raised by Replicate for wide strings");
- end;
-
- -- Drop = Left
-
- Result_String := B10.Replicate(3, Translate("abcd"), Ada.Strings.Left);
-
- if Result_String /=
- B10.To_Bounded_Wide_String(Translate("cdabcdabcd"))
- then
- Report.Failed
- ("Incorrect result from Replicate for wide strings, Drop = Left");
- end if;
-
- -- Drop = Right
-
- Result_String := B10.Replicate(3, Translate("abcd"), Ada.Strings.Right);
-
- if Result_String /=
- B10.To_Bounded_Wide_String(Translate("abcdabcdab")) then
- Report.Failed
- ("Incorrect result from Replicate for wide strings, Drop = Right");
- end if;
-
- -- Additional cases.
-
- if B10.Replicate(5, Translate("X")) /=
- B10.To_Bounded_Wide_String(Translate("XXXXX")) or
- B10.Replicate(10, "") /=
- B10.Null_Bounded_Wide_String or
- B10.Replicate(0, Translate("ab")) /=
- B10.Null_Bounded_Wide_String
- then
- Report.Failed("Incorrect result from Replicate for wide strings");
- end if;
-
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4020;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4021.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4021.a
deleted file mode 100644
index 345a77c68d0..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4021.a
+++ /dev/null
@@ -1,311 +0,0 @@
--- CXA4021.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package
--- Ada.Strings.Wide_Unbounded are available, and that they produce
--- correct results. Specifically, check the subprograms Head, Index,
--- Index_Non_Blank, Insert, Length, Overwrite, Replace_Slice, Slice,
--- Tail, To_Wide_String, To_Unbounded_Wide_String, "*", "&",
--- and "=", "<=", ">=".
---
--- TEST DESCRIPTION:
--- This test demonstrates the uses of many of the subprograms defined
--- in package Ada.Strings.Wide_Unbounded for use with unbounded wide
--- strings.
--- The test attempts to simulate how unbounded wide strings could be used
--- to simulate paragraphs of text. Modifications could be easily be
--- performed using the provided subprograms (although in this test, the
--- main modification performed was the addition of more text to the
--- string). One would not have to worry about the formatting of the
--- paragraph until it was finished and correct in content. Then, once
--- all required editing is complete, the unbounded strings can be divided
--- up into the appropriate lengths based on particular formatting
--- requirements. The test then compares the formatted text product
--- with a predefined "finished product".
---
--- This test attempts to use a large number of the subprograms provided
--- by package Ada.Strings.Wide_Unbounded. Often, the processing involved
--- could have been performed more efficiently using a minimum number
--- of the subprograms, in conjunction with loops, etc. However, for
--- testing purposes, and in the interest of minimizing the number of
--- tests developed, subprogram variety and feature mixing was stressed.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Report;
-with Ada.Characters.Handling;
-with Ada.Strings.Wide_Maps;
-with Ada.Strings.Wide_Unbounded;
-
-procedure CXA4021 is
-
- -- The following two functions are used to translate character and string
- -- values to "Wide" values. They will be applied to all the Wide_Bounded
- -- subprogram character and string parameters to simulate the use of non-
- -- character Wide_Characters and Wide_Strings in actual practice.
- -- Note: These functions do not actually return "equivalent" wide
- -- characters to their character inputs, just "non-character"
- -- wide characters.
-
- function Equiv (Ch : Character) return Wide_Character is
- C : Character := Ch;
- begin
- if Ch = ' ' then
- return Ada.Characters.Handling.To_Wide_Character(C);
- else
- return Wide_Character'Val(Character'Pos(Ch) +
- Character'Pos(Character'Last) + 1);
- end if;
- end Equiv;
-
-
- function Equiv (Str : String) return Wide_String is
- WS : Wide_String(Str'First..Str'Last);
- begin
- for i in Str'First..Str'Last loop
- WS(i) := Equiv(Str(i));
- end loop;
- return WS;
- end Equiv;
-
-begin
-
- Report.Test ("CXA4021", "Check that the subprograms defined in " &
- "package Ada.Strings.Wide_Unbounded are " &
- "available, and that they produce correct " &
- "results");
-
- Test_Block:
- declare
-
- package ASW renames Ada.Strings.Wide_Unbounded;
- use type ASW.Unbounded_Wide_String;
- use Ada.Strings;
-
- Pamphlet_Paragraph_Count : constant := 2;
- Lines : constant := 4;
- Line_Length : constant := 40;
-
- type Document_Type is array (Positive range <>)
- of ASW.Unbounded_Wide_String;
-
- type Camera_Ready_Copy_Type is array (1..Lines)
- of Wide_String (1..Line_Length);
-
- Pamphlet : Document_Type (1..Pamphlet_Paragraph_Count);
-
- Camera_Ready_Copy : Camera_Ready_Copy_Type :=
- (others => (others => Ada.Strings.Wide_Space));
-
- TC_Finished_Product : Camera_Ready_Copy_Type :=
- ( 1 => Equiv("Ada is a programming language designed "),
- 2 => Equiv("to support long-lived, reliable software"),
- 3 => Equiv(" systems. "),
- 4 => Equiv("Go with Ada! "));
-
- -----
-
-
- procedure Enter_Text_Into_Document (Document : in out Document_Type) is
- begin
-
- -- Fill in both "paragraphs" of the document. Each unbounded wide
- -- string functions as an individual paragraph, containing an
- -- unspecified number of characters.
- -- Use a variety of different unbounded wide string subprograms to
- -- load the data.
-
- Document(1) :=
- ASW.To_Unbounded_Wide_String(Equiv("Ada is a language"));
-
- -- Insert the word "programming" prior to "language".
- Document(1) :=
- ASW.Insert(Document(1),
- ASW.Index(Document(1),
- Equiv("language")),
- ASW.To_Wide_String(Equiv("progra") & -- Wd Str &
- ASW."*"(2,Equiv('m')) & -- Wd Unbd &
- Equiv("ing "))); -- Wd Str
-
-
- -- Overwrite the word "language" with "language" + additional text.
- Document(1) :=
- ASW.Overwrite(Document(1),
- ASW.Index(Document(1),
- ASW.To_Wide_String(
- ASW.Tail(Document(1), 8, Equiv(' '))),
- Ada.Strings.Backward),
- Equiv("language designed to support long-lifed"));
-
-
- -- Replace the word "lifed" with "lived".
- Document(1) :=
- ASW.Replace_Slice(Document(1),
- ASW.Index(Document(1), Equiv("lifed")),
- ASW.Length(Document(1)),
- Equiv("lived"));
-
-
- -- Overwrite the word "lived" with "lived" + additional text.
- Document(1) :=
- ASW.Overwrite(Document(1),
- ASW.Index(Document(1),
- ASW.To_Wide_String
- (ASW.Tail(Document(1), 5, Equiv(' '))),
- Ada.Strings.Backward),
- Equiv("lived, reliable software systems."));
-
-
- -- Use several of the overloaded versions of "&" to form this
- -- unbounded wide string.
-
- Document(2) := Equiv('G') &
- ASW.To_Unbounded_Wide_String(Equiv("o ")) &
- ASW.To_Unbounded_Wide_String(Equiv("with")) &
- Equiv(' ') &
- Equiv("Ada!");
-
- end Enter_Text_Into_Document;
-
-
- -----
-
-
- procedure Create_Camera_Ready_Copy
- (Document : in Document_Type;
- Camera_Copy : out Camera_Ready_Copy_Type) is
- begin
- -- Break the unbounded wide strings into fixed lengths.
-
- -- Search the first unbounded wide string for portions of text that
- -- are less than or equal to the length of a wide string in the
- -- Camera_Ready_Copy_Type object.
-
- Camera_Copy(1) := -- Take characters 1-39,
- ASW.Slice(Document(1), -- and append a blank space.
- 1,
- ASW.Index(ASW.To_Unbounded_Wide_String
- (ASW.Slice(Document(1),
- 1,
- Line_Length)),
- Ada.Strings.Wide_Maps.To_Set(Equiv(' ')),
- Ada.Strings.Inside,
- Ada.Strings.Backward)) & Equiv(' ');
-
- Camera_Copy(2) := -- Take characters 40-79.
- ASW.Slice(Document(1),
- 40,
- (ASW.Index_Non_Blank -- Should return 79
- (ASW.To_Unbounded_Wide_String
- (ASW.Slice(Document(1), -- Slice (40..79)
- 40,
- 79)),
- Ada.Strings.Backward) + 39)); -- Increment since
- -- this slice starts
- -- at 40.
-
- Camera_Copy(3)(1..9) := ASW.Slice(Document(1), -- Characters 80-88
- 80,
- ASW.Length(Document(1)));
-
-
- -- Break the second unbounded wide string into the appropriate
- -- length. It is only twelve characters in length, so the entire
- -- unbounded wide string will be placed on one string of the output
- -- object.
-
- Camera_Copy(4)(1..ASW.Length(Document(2))) :=
- ASW.To_Wide_String(ASW.Head(Document(2),
- ASW.Length(Document(2))));
-
- end Create_Camera_Ready_Copy;
-
-
- -----
-
-
- function Valid_Proofread (Draft, Master : Camera_Ready_Copy_Type)
- return Boolean is
- begin
-
- -- Evaluate wide strings for equality, using the operators defined
- -- in package Ada.Strings.Wide_Unbounded. The less than/greater
- -- than or equal comparisons should evaluate to "equals => True".
-
- if ASW.To_Unbounded_Wide_String(Draft(1)) = -- "="(WUnb,WUnb)
- ASW.To_Unbounded_Wide_String(Master(1)) and
- ASW.To_Unbounded_Wide_String(Draft(2)) <= -- "<="(WUnb,WUnb)
- ASW.To_Unbounded_Wide_String(Master(2)) and
- ASW.To_Unbounded_Wide_String(Draft(3)) >= -- ">="(WUnb,WUnb)
- ASW.To_Unbounded_Wide_String(Master(3)) and
- ASW.To_Unbounded_Wide_String(Draft(4)) = -- "="(WUnb,WUnb)
- ASW.To_Unbounded_Wide_String(Master(4))
- then
- return True;
- else
- return False;
- end if;
-
- end Valid_Proofread;
-
-
- -----
-
-
- begin
-
- -- Enter text into the unbounded wide string paragraphs of the document.
-
- Enter_Text_Into_Document (Pamphlet);
-
-
- -- Reformat the unbounded wide strings into fixed wide string format.
-
- Create_Camera_Ready_Copy (Document => Pamphlet,
- Camera_Copy => Camera_Ready_Copy);
-
-
- -- Verify the conversion process.
-
- if not Valid_Proofread (Draft => Camera_Ready_Copy,
- Master => TC_Finished_Product)
- then
- Report.Failed ("Incorrect unbounded wide string processing result");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4021;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4022.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4022.a
deleted file mode 100644
index 3c649a1a294..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4022.a
+++ /dev/null
@@ -1,531 +0,0 @@
--- CXA4022.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package
--- Ada.Strings.Wide_Unbounded are available, and that they produce
--- correct results. Specifically, check the subprograms Count, Element,
--- Index, Replace_Element, To_Unbounded_Wide_String, and "&", ">", "<".
---
--- TEST DESCRIPTION:
--- This test demonstrates the uses of many of the subprograms defined
--- in package Ada.Strings.Wide_Unbounded for use with unbounded wide
--- strings. The test simulates how unbounded wide strings
--- will be processed in a user environment, using the subprograms
--- provided in this package.
---
--- Taken in conjunction with tests CXA4021 and CXA4023, this test will
--- constitute a test of the functionality contained in package
--- Ada.Strings.Wide Unbounded. This test uses a variety
--- of the subprograms defined in the unbounded wide string package
--- in ways typical of common usage, with different combinations of
--- available subprograms being used to accomplish similar
--- unbounded wide string processing goals.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 08 Nov 95 SAIC Corrected accessibility level, type visibility,
--- and subtest acceptance criteria problems for
--- ACVC 2.0.1
---
---!
-
-with Ada.Characters.Handling;
-with Ada.Strings;
-
-package CXA40220 is
-
- -- The following two functions are used to translate character and string
- -- values to "Wide" values. They will be applied to all the Wide_Bounded
- -- subprogram character and string parameters to simulate the use of non-
- -- character Wide_Characters and Wide_Strings in actual practice.
- -- Note: These functions do not actually return "equivalent" wide
- -- characters to their character inputs, just "non-character"
- -- wide characters.
-
- function Equiv (Ch : Character) return Wide_Character;
-
- function Equiv (Str : String) return Wide_String;
-
-
- -- Functions and access-to-subprogram value used to supply mapping
- -- capability to the appropriate versions of Count, Index, and
- -- Translate.
-
- function AB_to_US_Mapping_Function (From : Wide_Character)
- return Wide_Character;
-
- function AB_to_Blank_Mapping_Function (From : Wide_Character)
- return Wide_Character;
-
-end CXA40220;
-
-package body CXA40220 is
-
- function Equiv (Ch : Character) return Wide_Character is
- C : Character := Ch;
- begin
- if Ch = ' ' then
- return Ada.Characters.Handling.To_Wide_Character(C);
- else
- return Wide_Character'Val(Character'Pos(Ch) +
- Character'Pos(Character'Last) + 1);
- end if;
- end Equiv;
-
-
- function Equiv (Str : String) return Wide_String is
- WS : Wide_String(Str'First..Str'Last);
- begin
- for i in Str'First..Str'Last loop
- WS(i) := Equiv(Str(i));
- end loop;
- return WS;
- end Equiv;
-
-
- function AB_to_US_Mapping_Function (From : Wide_Character)
- return Wide_Character is
- UnderScore : constant Wide_Character := Equiv('_');
- begin
- if From = Equiv('a') or From = Equiv('b') then
- return UnderScore;
- else
- return From;
- end if;
- end AB_to_US_Mapping_Function;
-
-
- function AB_to_Blank_Mapping_Function (From : Wide_Character)
- return Wide_Character is
- begin
- if From = Equiv('a') or From = Equiv('b') then
- return Ada.Strings.Wide_Space;
- else
- return From;
- end if;
- end AB_to_Blank_Mapping_Function;
-
-end CXA40220;
-
-
-with CXA40220;
-with Report;
-with Ada.Characters.Handling;
-with Ada.Strings.Wide_Maps;
-with Ada.Strings.Wide_Unbounded;
-
-procedure CXA4022 is
-begin
-
- Report.Test ("CXA4022", "Check that the subprograms defined in " &
- "package Ada.Strings.Wide_Unbounded are " &
- "available, and that they produce correct " &
- "results");
-
- Test_Block:
- declare
-
- use CXA40220;
-
- package ASW renames Ada.Strings.Wide_Unbounded;
- use Ada.Strings;
- use type Wide_Maps.Wide_Character_Set;
- use type ASW.Unbounded_Wide_String;
-
- Test_String : ASW.Unbounded_Wide_String;
- AtoE_Str : ASW.Unbounded_Wide_String :=
- ASW.To_Unbounded_Wide_String(Equiv("abcde"));
-
- Complete_String : ASW.Unbounded_Wide_String :=
- ASW."&"(ASW.To_Unbounded_Wide_String(Equiv("Incomplete")),
- ASW."&"(Ada.Strings.Wide_Space,
- ASW.To_Unbounded_Wide_String(Equiv("String"))));
-
- Incomplete_String : ASW.Unbounded_Wide_String :=
- ASW.To_Unbounded_Wide_String
- (Equiv("ncomplete Strin"));
-
- Incorrect_Spelling : ASW.Unbounded_Wide_String :=
- ASW.To_Unbounded_Wide_String(Equiv("Guob Dai"));
-
- Magic_String : ASW.Unbounded_Wide_String :=
- ASW.To_Unbounded_Wide_String(Equiv("abracadabra"));
-
- Incantation : ASW.Unbounded_Wide_String := Magic_String;
-
-
- A_Small_G : Wide_Character := Equiv('g');
- A_Small_D : Wide_Character := Equiv('d');
-
- ABCD_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps.To_Set(Equiv("abcd"));
- B_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps.To_Set(Equiv('b'));
- CD_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps.To_Set(Equiv("cd"));
-
- CD_to_XY_Map : Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.To_Mapping(From => Equiv("cd"),
- To => Equiv("xy"));
- AB_to_YZ_Map : Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.To_Mapping(Equiv("ab"), Equiv("yz"));
-
-
- Matching_Letters : Natural := 0;
- Location,
- Total_Count : Natural := 0;
-
-
- Map_Ptr : Wide_Maps.Wide_Character_Mapping_Function :=
- AB_to_US_Mapping_Function'Access;
-
-
- begin
-
-
- -- Function "&"
-
- -- Prepend an 'I' and append a 'g' to the wide string.
- Incomplete_String := ASW."&"(Equiv('I'),
- Incomplete_String); -- Ch & W Unb
- Incomplete_String := ASW."&"(Incomplete_String,
- A_Small_G); -- W Unb & Ch
-
- if ASW."<"(Incomplete_String, Complete_String) or
- ASW.">"(Incomplete_String, Complete_String) or
- Incomplete_String /= Complete_String
- then
- Report.Failed("Incorrect result from use of ""&"" operator");
- end if;
-
-
-
- -- Function Element
-
- -- Last element of the unbounded wide string should be a 'g'.
- if ASW.Element(Incomplete_String, ASW.Length(Incomplete_String)) /=
- A_Small_G
- then
- Report.Failed("Incorrect result from use of Function Element - 1");
- end if;
-
- if ASW.Element(Incomplete_String, 2) /=
- ASW.Element(ASW.Tail(Incomplete_String, 2), 1) or
- ASW.Element(ASW.Head(Incomplete_String, 4), 2) /=
- ASW.Element(ASW.To_Unbounded_Wide_String(Equiv("wnqz")), 2)
- then
- Report.Failed("Incorrect result from use of Function Element - 2");
- end if;
-
-
-
- -- Procedure Replace_Element
-
- -- The unbounded wide string Incorrect_Spelling starts as "Guob Dai",
- -- and is transformed by the following three procedure calls to
- -- "Good Day".
-
- ASW.Replace_Element(Incorrect_Spelling, 2, Equiv('o'));
-
- ASW.Replace_Element(Incorrect_Spelling,
- ASW.Index(Incorrect_Spelling, B_Set),
- A_Small_D);
-
- ASW.Replace_Element(Source => Incorrect_Spelling,
- Index => ASW.Length(Incorrect_Spelling),
- By => Equiv('y'));
-
- if Incorrect_Spelling /=
- ASW.To_Unbounded_Wide_String(Equiv("Good Day"))
- then
- Report.Failed("Incorrect result from Procedure Replace_Element");
- end if;
-
-
-
- -- Function Index with non-Identity map.
- -- Evaluate the function Index with a non-identity map
- -- parameter which will cause mapping of the source parameter
- -- prior to the evaluation of the index position search.
-
- Location := ASW.Index(Source => ASW.To_Unbounded_Wide_String
- (Equiv("abcdefghij")),
- Pattern => Equiv("xy"),
- Going => Ada.Strings.Forward,
- Mapping => CD_to_XY_Map); -- change "cd" to "xy"
-
- if Location /= 3 then
- Report.Failed("Incorrect result from Index, non-Identity map - 1");
- end if;
-
- Location := ASW.Index(ASW.To_Unbounded_Wide_String(Equiv("abcdabcdab")),
- Equiv("yz"),
- Ada.Strings.Backward,
- AB_to_YZ_Map); -- change all "ab" to "yz"
-
- if Location /= 9 then
- Report.Failed("Incorrect result from Index, non-Identity map - 2");
- end if;
-
- -- A couple with identity maps (default) as well.
-
- if ASW.Index(ASW.To_Unbounded_Wide_String(Equiv("abcd")), -- Pat = Src
- Equiv("abcd")) /= 1 or
- ASW.Index(ASW.To_Unbounded_Wide_String(Equiv("abc")), -- Pat < Src
- Equiv("abcd")) /= 0 or
- ASW.Index(ASW.Null_Unbounded_Wide_String, -- Src = Null
- Equiv("abc")) /= 0
- then
- Report.Failed
- ("Incorrect result from Index with wide string patterns");
- end if;
-
-
-
- -- Function Index (for Sets).
- -- This version of Index uses Sets as the basis of the search.
-
- -- Test = Inside, Going = Forward (Default case).
- Location :=
- ASW.Index(Source => ASW.To_Unbounded_Wide_String(Equiv("abcdeabcde")),
- Set => CD_Set); -- set containing 'c' and 'd'
-
- if not (Location = 3) then -- position of first 'c' in source.
- Report.Failed("Incorrect result from Index using Sets - 1");
- end if;
-
- -- Test = Inside, Going = Backward.
- Location :=
- ASW.Index(Source => ASW."&"(AtoE_Str, AtoE_Str),
- Set => CD_Set, -- set containing 'c' and 'd'
- Test => Ada.Strings.Inside,
- Going => Ada.Strings.Backward);
-
- if not (Location = 9) then -- position of last 'd' in source.
- Report.Failed("Incorrect result from Index using Sets - 2");
- end if;
-
- -- Test = Outside, Going = Forward, Backward
- if ASW.Index(ASW.To_Unbounded_Wide_String(Equiv("deddacd")),
- Wide_Maps.To_Set(Equiv("xydcgf")),
- Test => Ada.Strings.Outside,
- Going => Ada.Strings.Forward) /= 2 or
- ASW.Index(ASW.To_Unbounded_Wide_String(Equiv("deddacd")),
- Wide_Maps.To_Set(Equiv("xydcgf")),
- Test => Ada.Strings.Outside,
- Going => Ada.Strings.Backward) /= 5 or
- ASW.Index(ASW.To_Unbounded_Wide_String(Equiv("deddacd")),
- CD_Set,
- Ada.Strings.Outside,
- Ada.Strings.Backward) /= 5
- then
- Report.Failed("Incorrect result from Index using Sets - 3");
- end if;
-
- -- Default direction (forward) and mapping (identity).
-
- if ASW.Index(ASW.To_Unbounded_Wide_String(Equiv("cd")), -- Source = Set
- CD_Set) /= 1 or
- ASW.Index(ASW.To_Unbounded_Wide_String(Equiv("c")), -- Source < Set
- CD_Set) /= 1 or
- ASW.Index(ASW.Null_Unbounded_Wide_String, -- Source = Null
- CD_Set) /= 0 or
- ASW.Index(AtoE_Str,
- Wide_Maps.Null_Set) /= 0 or -- Null set
- ASW.Index(AtoE_Str,
- Wide_Maps.To_Set(Equiv('x'))) /= 0 -- No match.
- then
- Report.Failed("Incorrect result from Index using Sets - 4");
- end if;
-
-
-
- -- Function Index using access-to-subprogram mapping.
- -- Evaluate the function Index with an access value that supplies the
- -- mapping function for this version of Index.
-
- Map_Ptr := AB_to_US_Mapping_Function'Access;
-
- Location := ASW.Index(Source => ASW.To_Unbounded_Wide_String
- (Equiv("xAxabbxax xaax _cx")),
- Pattern => Equiv("_x"),
- Going => Ada.Strings.Forward,
- Mapping => Map_Ptr); -- change 'a'or 'b' to '_'
-
- if Location /= 6 then -- location of "bx" substring
- Report.Failed("Incorrect result from Index, access value map - 1");
- end if;
-
- Map_Ptr := AB_to_Blank_Mapping_Function'Access;
-
- Location := ASW.Index(ASW.To_Unbounded_Wide_String
- (Equiv("ccacdcbbcdacc")),
- Equiv("cd "),
- Ada.Strings.Backward,
- Map_Ptr); -- change 'a' or 'b' to ' '
-
- if Location /= 9 then
- Report.Failed("Incorrect result from Index, access value map - 2");
- end if;
-
- if ASW.Index(ASW.To_Unbounded_Wide_String(Equiv("abcd")),
- Equiv(" cd"),
- Ada.Strings.Forward,
- Map_Ptr) /= 1 or
- ASW.Index(ASW.To_Unbounded_Wide_String(Equiv("abc")),
- Equiv(" c "), -- No match
- Ada.Strings.Backward,
- Map_Ptr) /= 0
- then
- Report.Failed("Incorrect result from Index, access value map - 3");
- end if;
-
-
-
- -- Function Count
-
- -- Determine the number of characters in the unbounded wide string that
- -- are contained in the set.
-
- Matching_Letters := ASW.Count(Source => Magic_String,
- Set => ABCD_Set);
-
- if Matching_Letters /= 9 then
- Report.Failed
- ("Incorrect result from Function Count with Set parameter");
- end if;
-
- -- Determine the number of occurrences of the following pattern wide
- -- strings in the unbounded wide string Magic_String.
-
- if ASW.Count(Magic_String, Equiv("ab")) /=
- (ASW.Count(Magic_String, Equiv("ac")) +
- ASW.Count(Magic_String, Equiv("ad"))) or
- ASW.Count(Magic_String, Equiv("ab")) /= 2
- then
- Report.Failed
- ("Incorrect result from Function Count, wide string parameter");
- end if;
-
-
-
- -- Function Count with non-Identity mapping.
- -- Evaluate the function Count with a non-identity map
- -- parameter which will cause mapping of the source parameter
- -- prior to the evaluation of the number of matching patterns.
-
- Total_Count :=
- ASW.Count(ASW.To_Unbounded_Wide_String(Equiv("abbabbabbabba")),
- Pattern => Equiv("yz"),
- Mapping => AB_to_YZ_Map);
-
- if Total_Count /= 4 then
- Report.Failed
- ("Incorrect result from function Count, non-Identity map - 1");
- end if;
-
- if ASW.Count(ASW.To_Unbounded_Wide_String(Equiv("ADCBADABCD")),
- Equiv("AB"),
- Wide_Maps.To_Mapping(Equiv("CD"), Equiv("AB"))) /= 5 or
- ASW.Count(ASW.To_Unbounded_Wide_String(Equiv("dcccddcdccdddccccd")),
- Equiv("xxy"),
- CD_to_XY_Map) /= 3
- then
- Report.Failed
- ("Incorrect result from function Count, non-Identity map - 2");
- end if;
-
- -- And a few with identity Wide_Maps as well.
-
- if ASW.Count(ASW.To_Unbounded_Wide_String(Equiv("ABABABABAB")),
- Equiv("ABA"),
- Wide_Maps.Identity) /= 2 or
- ASW.Count(ASW.To_Unbounded_Wide_String(Equiv("aaaaaaaaaa")),
- Equiv("aaa")) /= 3 or
- ASW.Count(ASW.To_Unbounded_Wide_String(Equiv("XX")), -- Src < Pat
- Equiv("XXX"),
- Wide_Maps.Identity) /= 0 or
- ASW.Count(AtoE_Str, -- Source = Pattern
- Equiv("abcde")) /= 1 or
- ASW.Count(ASW.Null_Unbounded_Wide_String, -- Source = Null
- Equiv(" ")) /= 0
- then
- Report.Failed
- ("Incorrect result from function Count, w,w/o mapping");
- end if;
-
-
-
- -- Function Count using access-to-subprogram mapping.
- -- Evaluate the function Count with an access value specifying the
- -- mapping that is going to occur to Source.
-
- Map_Ptr := AB_to_US_Mapping_Function'Access;
-
- Total_Count :=
- ASW.Count(ASW.To_Unbounded_Wide_String(Equiv("abcbacbadbaAbbB")),
- Pattern => Equiv("__"),
- Mapping => Map_Ptr); -- change 'a' and 'b' to '_'
-
- if Total_Count /= 5 then
- Report.Failed
- ("Incorrect result from function Count, access value map - 1");
- end if;
-
- Map_Ptr := AB_to_Blank_Mapping_Function'Access;
-
- if ASW.Count(ASW.To_Unbounded_Wide_String(Equiv("cccaccBcbcaccacAc")),
- Equiv("c c"),
- Map_Ptr) /= 3 or
- ASW.Count(ASW.To_Unbounded_Wide_String
- (Equiv("aBBAAABaBBBBAaBABBABaBBbBB")),
- Equiv(" BB"),
- Map_Ptr) /= 4 or
- ASW.Count(ASW.To_Unbounded_Wide_String(Equiv("aaaaaaaaaa")),
- Equiv(" "),
- Map_Ptr) /= 3 or
- ASW.Count(ASW.To_Unbounded_Wide_String(Equiv("XX")), -- Src < Pat
- Equiv("XX "),
- Map_Ptr) /= 0 or
- ASW.Count(AtoE_Str, -- Source'Length = Pattern'Length
- Equiv(" cde"),
- Map_Ptr) /= 1
- then
- Report.Failed
- ("Incorrect result from function Count, access value map - 3");
- end if;
-
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4022;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4023.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4023.a
deleted file mode 100644
index d0325fc88ec..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4023.a
+++ /dev/null
@@ -1,585 +0,0 @@
--- CXA4023.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package
--- Ada.Strings.Wide_Unbounded are available, and that they produce
--- correct results. Specifically, check the subprograms Delete,
--- Find_Token, Translate, Trim, and "*".
---
--- TEST DESCRIPTION:
--- This test demonstrates the uses of many of the subprograms defined
--- in package Ada.Strings.Wide_Unbounded for use with unbounded wide
--- strings. The test simulates how unbounded wide strings
--- will be processed in a user environment, using the subprograms
--- provided in this package.
---
--- This test, when taken in conjunction with tests CXA4021-22, will
--- constitute a test of the functionality contained in package
--- Ada.Strings.Wide_Unbounded. This test uses a variety
--- of the subprograms defined in the unbounded wide string package
--- in ways typical of common usage, with different combinations of
--- available subprograms being used to accomplish similar
--- unbounded wide string processing goals.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 08 Nov 95 SAIC Corrected accessibility level and type
--- visibility problems for ACVC 2.0.1.
---
---!
-
-with Ada.Characters.Handling;
-with Ada.Strings;
-
-package CXA40230 is
-
- -- The following two functions are used to translate character and string
- -- values to non-character "Wide" values. They will be applied to all the
- -- Wide_Bounded subprogram character and string parameters to simulate the
- -- use of Wide_Characters and Wide_Strings in actual practice.
- -- Note: These functions do not actually return "equivalent" wide
- -- characters to their character inputs, just "non-character"
- -- wide characters.
-
- function Equiv (Ch : Character) return Wide_Character;
-
- function Equiv (Str : String) return Wide_String;
-
- -- Functions and access-to-subprogram object used to supply mapping
- -- capability to the appropriate versions of Translate.
-
- function AB_to_US_Mapping_Function (From : Wide_Character)
- return Wide_Character;
-
- function AB_to_Blank_Mapping_Function (From : Wide_Character)
- return Wide_Character;
-
-end CXA40230;
-
-
-package body CXA40230 is
-
- function Equiv (Ch : Character) return Wide_Character is
- C : Character := Ch;
- begin
- if Ch = ' ' then
- return Ada.Characters.Handling.To_Wide_Character(C);
- else
- return Wide_Character'Val(Character'Pos(Ch) +
- Character'Pos(Character'Last) + 1);
- end if;
- end Equiv;
-
-
- function Equiv (Str : String) return Wide_String is
- WS : Wide_String(Str'First..Str'Last);
- begin
- for i in Str'First..Str'Last loop
- WS(i) := Equiv(Str(i));
- end loop;
- return WS;
- end Equiv;
-
-
- function AB_to_US_Mapping_Function (From : Wide_Character)
- return Wide_Character is
- UnderScore : constant Wide_Character := Equiv('_');
- begin
- if From = Equiv('a') or From = Equiv('b') then
- return UnderScore;
- else
- return From;
- end if;
- end AB_to_US_Mapping_Function;
-
-
- function AB_to_Blank_Mapping_Function (From : Wide_Character)
- return Wide_Character is
- begin
- if From = Equiv('a') or From = Equiv('b') then
- return Ada.Strings.Wide_Space;
- else
- return From;
- end if;
- end AB_to_Blank_Mapping_Function;
-
-end CXA40230;
-
-
-with CXA40230;
-with Report;
-with Ada.Characters.Handling;
-with Ada.Strings.Wide_Maps;
-with Ada.Strings.Wide_Unbounded;
-
-procedure CXA4023 is
-begin
-
- Report.Test ("CXA4023", "Check that the subprograms defined in " &
- "package Ada.Strings.Wide_Unbounded are " &
- "available, and that they produce correct " &
- "results");
-
- Test_Block:
- declare
-
- use CXA40230;
-
- package ASW renames Ada.Strings.Wide_Unbounded;
- use Ada.Strings;
- use type Wide_Maps.Wide_Character_Set;
- use type ASW.Unbounded_Wide_String;
-
- Test_String : ASW.Unbounded_Wide_String;
- AtoE_Str : ASW.Unbounded_Wide_String :=
- ASW.To_Unbounded_Wide_String(Equiv("abcde"));
-
- Cad_String : ASW.Unbounded_Wide_String :=
- ASW.To_Unbounded_Wide_String(Equiv("cad"));
-
- Magic_String : ASW.Unbounded_Wide_String :=
- ASW.To_Unbounded_Wide_String(Equiv("abracadabra"));
-
- Incantation : ASW.Unbounded_Wide_String := Magic_String;
-
-
- A_Small_G : Wide_Character := Equiv('g');
-
- ABCD_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps.To_Set(Equiv("abcd"));
- B_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps.To_Set(Equiv('b'));
- AB_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps."OR"(Wide_Maps.To_Set(Equiv('a')), B_Set);
-
-
- AB_to_YZ_Map : Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.To_Mapping(From => Equiv("ab"),
- To => Equiv("yz"));
- Code_Map : Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.To_Mapping(Equiv("abcd"), Equiv("wxyz"));
- Reverse_Code_Map : Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.To_Mapping(Equiv("wxyz"), Equiv("abcd"));
- Non_Existent_Map : Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.To_Mapping(Equiv("jkl"), Equiv("mno"));
-
-
- Token_Start : Positive;
- Token_End : Natural := 0;
-
- Map_Ptr : Wide_Maps.Wide_Character_Mapping_Function :=
- AB_to_US_Mapping_Function'Access;
-
-
- begin
-
- -- Find_Token
-
- ASW.Find_Token(Magic_String, -- Find location of first "ab" equiv.
- AB_Set, -- Should be (1..2).
- Ada.Strings.Inside,
- Token_Start,
- Token_End);
-
- if Natural(Token_Start) /= ASW.To_Wide_String(Magic_String)'First or
- Token_End /= ASW.Index(Magic_String, B_Set) or
- Token_End /= 2
- then
- Report.Failed("Incorrect result from Procedure Find_Token - 1");
- end if;
-
-
- ASW.Find_Token(Source => Magic_String, -- Find location of char 'r'equiv
- Set => ABCD_Set, -- in wide str, should be (3..3)
- Test => Ada.Strings.Outside,
- First => Token_Start,
- Last => Token_End);
-
- if Natural(Token_Start) /= 3 or Token_End /= 3 then
- Report.Failed("Incorrect result from Procedure Find_Token - 2");
- end if;
-
-
- ASW.Find_Token(Magic_String, -- No 'g' "equivalent in
- Wide_Maps.To_Set(A_Small_G), -- the wide str, so the
- Ada.Strings.Inside, -- result params should be
- First => Token_Start, -- First = Source'First and
- Last => Token_End); -- Last = 0.
-
-
- if Token_Start /= ASW.To_Wide_String(Magic_String)'First or
- Token_End /= 0
- then
- Report.Failed("Incorrect result from Procedure Find_Token - 3");
- end if;
-
-
- ASW.Find_Token(ASW.To_Unbounded_Wide_String(Equiv("abpqpqrttrcpqr")),
- Wide_Maps.To_Set(Equiv("trpq")),
- Ada.Strings.Inside,
- Token_Start,
- Token_End);
-
- if Token_Start /= 3 or
- Token_End /= 10
- then
- Report.Failed("Incorrect result from Procedure Find_Token - 4");
- end if;
-
- ASW.Find_Token(ASW.To_Unbounded_Wide_String(Equiv("abpqpqrttrcpqr")),
- Wide_Maps.To_Set(Equiv("abpq")),
- Ada.Strings.Outside,
- Token_Start,
- Token_End);
-
- if Token_Start /= 7 or
- Token_End /= 11
- then
- Report.Failed("Incorrect result from Procedure Find_Token - 5");
- end if;
-
-
-
- -- Translate
-
- -- Use a mapping ("abcd" -> "wxyz") to transform the contents of
- -- the unbounded wide string.
- -- Magic_String = "abracadabra"
-
- Incantation := ASW.Translate(Magic_String, Code_Map);
-
- if Incantation /=
- ASW.To_Unbounded_Wide_String(Equiv("wxrwywzwxrw"))
- then
- Report.Failed("Incorrect result from Function Translate - 1");
- end if;
-
- -- (Note: See below for additional testing of Function Translate)
-
- -- Use the inverse mapping of the one above to return the "translated"
- -- unbounded wide string to its original form.
-
- ASW.Translate(Incantation, Reverse_Code_Map);
-
- -- The map contained in the following call to Translate contains three
- -- elements, and these elements are not found in the unbounded wide
- -- string, so this call to Translate should have no effect on it.
-
- if Incantation /= ASW.Translate(Magic_String, Non_Existent_Map) then
- Report.Failed("Incorrect result from Procedure Translate - 1");
- end if;
-
- -- Partial mapping of source.
-
- Test_String := ASW.To_Unbounded_Wide_String(Equiv("abcdeabcab"));
-
- ASW.Translate(Source => Test_String, Mapping => AB_to_YZ_Map);
-
- if Test_String /= ASW.To_Unbounded_Wide_String(Equiv("yzcdeyzcyz")) then
- Report.Failed("Incorrect result from Procedure Translate - 2");
- end if;
-
- -- Total mapping of source.
-
- Test_String := ASW.To_Unbounded_Wide_String(Equiv("abbaaababb"));
-
- ASW.Translate(Source => Test_String, Mapping => AB_to_YZ_Map);
-
- if Test_String /= ASW.To_Unbounded_Wide_String(Equiv("yzzyyyzyzz")) then
- Report.Failed("Incorrect result from Procedure Translate - 3");
- end if;
-
- -- No mapping of source.
-
- Test_String := ASW.To_Unbounded_Wide_String(Equiv("xyzsypcc"));
-
- ASW.Translate(Source => Test_String, Mapping => AB_to_YZ_Map);
-
- if Test_String /= ASW.To_Unbounded_Wide_String(Equiv("xyzsypcc")) then
- Report.Failed("Incorrect result from Procedure Translate - 4");
- end if;
-
- -- Map > 2 characters, partial mapping.
-
- Test_String := ASW.To_Unbounded_Wide_String(Equiv("opabcdelmn"));
-
- ASW.Translate(Test_String,
- Wide_Maps.To_Mapping(Equiv("abcde"), Equiv("lmnop")));
-
- if Test_String /= ASW.To_Unbounded_Wide_String(Equiv("oplmnoplmn")) then
- Report.Failed("Incorrect result from Procedure Translate - 5");
- end if;
-
-
-
- -- Various degrees of mapping of source (full, partial, none) used
- -- with Function Translate.
-
- if ASW.Translate(
- ASW.To_Unbounded_Wide_String(Equiv("abcdeabcabbbaaacaa")),
- AB_to_YZ_Map) /=
- ASW.To_Unbounded_Wide_String(Equiv("yzcdeyzcyzzzyyycyy")) or
-
- ASW.Translate(
- ASW.To_Unbounded_Wide_String(Equiv("abbaaababbaaaaba")),
- AB_to_YZ_Map) /=
- ASW.To_Unbounded_Wide_String(Equiv("yzzyyyzyzzyyyyzy")) or
-
- ASW.Translate(ASW.To_Unbounded_Wide_String(Equiv("cABcABBAc")),
- Mapping => AB_to_YZ_Map) /=
- ASW.To_Unbounded_Wide_String(Equiv("cABcABBAc")) or
-
- ASW.Translate(ASW.To_Unbounded_Wide_String("opabcdelmnddeaccabec"),
- Wide_Maps.To_Mapping("abcde", "lmnop")) /=
- ASW.To_Unbounded_Wide_String("oplmnoplmnooplnnlmpn")
- then
- Report.Failed("Incorrect result from Function Translate - 2");
- end if;
-
-
-
- -- Procedure Translate using access-to-subprogram mapping.
- -- Partial mapping of source.
-
- Map_Ptr := AB_to_Blank_Mapping_Function'Access;
-
- Test_String := ASW.To_Unbounded_Wide_String(Equiv("abABaABbaBAbba"));
-
- ASW.Translate(Source => Test_String, -- change equivalent of 'a' and
- Mapping => Map_Ptr); -- 'b' to ' '
-
- if Test_String /=
- ASW.To_Unbounded_Wide_String(Equiv(" AB AB BA "))
- then
- Report.Failed
- ("Incorrect result from Proc Translate, w/ access value map - 1");
- end if;
-
- -- Total mapping of source to blanks.
-
- Test_String := ASW.To_Unbounded_Wide_String(Equiv("abbbab"));
-
- ASW.Translate(Source => Test_String,
- Mapping => Map_Ptr);
-
- if Test_String /=
- ASW.To_Unbounded_Wide_String(Equiv(" "))
- then
- Report.Failed
- ("Incorrect result from Proc Translate, w/ access value map - 2");
- end if;
-
- -- No mapping of source.
-
- Map_Ptr := AB_to_US_Mapping_Function'Access;
-
- Test_String := ASW.To_Unbounded_Wide_String(Equiv("xyzsypcc"));
-
- ASW.Translate(Source => Test_String,
- Mapping => Map_Ptr);
-
- if Test_String /=
- ASW.To_Unbounded_Wide_String(Equiv("xyzsypcc")) -- no change
- then
- Report.Failed
- ("Incorrect result from Proc Translate, w/ access value map - 3");
- end if;
-
-
- -- Function Translate using access-to-subprogram mapping value.
-
- Map_Ptr := AB_to_Blank_Mapping_Function'Access;
-
- Test_String := ASW.To_Unbounded_Wide_String(Equiv("abAbBBAabbacD"));
-
- if ASW.Translate(ASW.Translate(Test_String, Map_Ptr), Map_Ptr) /=
- ASW.To_Unbounded_Wide_String(Equiv(" A BBA cD"))
- then
- Report.Failed
- ("Incorrect result from Function Translate, access value map - 1");
- end if;
-
- if ASW.Translate(Source => ASW.To_Unbounded_Wide_String(Equiv("a")),
- Mapping => Map_Ptr) /=
- ASW.To_Unbounded_Wide_String(Equiv(" ")) or
- ASW.Translate(ASW.To_Unbounded_Wide_String
- (Equiv(" aa Aa A AAaaa a aA")),
- Map_Ptr) /=
- ASW.To_Unbounded_Wide_String(Equiv(" A A AA A")) or
- ASW.Translate(Source => ASW.To_Unbounded_Wide_String(Equiv("a ")),
- Mapping => Map_Ptr) /=
- ASW.To_Unbounded_Wide_String(Equiv(" ")) or
- ASW.Translate(Source => ASW.To_Unbounded_Wide_String(Equiv("xyz")),
- Mapping => Map_Ptr) /=
- ASW.To_Unbounded_Wide_String(Equiv("xyz"))
- then
- Report.Failed
- ("Incorrect result from Function Translate, access value map - 2");
- end if;
-
-
-
- -- Trim
-
- Trim_Block:
- declare
-
- XYZ_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps.To_Set(Equiv("xyz"));
- PQR_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps.To_Set(Equiv("pqr"));
-
- Pad : constant ASW.Unbounded_Wide_String :=
- ASW.To_Unbounded_Wide_String(Equiv("Pad"));
-
- The_New_Ada : constant ASW.Unbounded_Wide_String :=
- ASW.To_Unbounded_Wide_String(Equiv("Ada9X"));
-
- Space_Array : array (1..4) of ASW.Unbounded_Wide_String :=
- (ASW.To_Unbounded_Wide_String(Equiv(" Pad ")),
- ASW.To_Unbounded_Wide_String(Equiv("Pad ")),
- ASW.To_Unbounded_Wide_String(Equiv(" Pad")),
- Pad);
-
- String_Array : array (1..5) of ASW.Unbounded_Wide_String :=
- (ASW.To_Unbounded_Wide_String(Equiv("xyzxAda9Xpqr")),
- ASW.To_Unbounded_Wide_String(Equiv("Ada9Xqqrp")),
- ASW.To_Unbounded_Wide_String(Equiv("zxyxAda9Xqpqr")),
- ASW.To_Unbounded_Wide_String(Equiv("xxxyAda9X")),
- The_New_Ada);
-
- begin
-
- -- Examine the version of Trim that removes blanks from
- -- the left and/or right of a wide string.
-
- for i in 1..4 loop
- if ASW.Trim(Space_Array(i), Ada.Strings.Both) /= Pad then
- Report.Failed("Incorrect result from Trim for spaces - " &
- Integer'Image(i));
- end if;
- end loop;
-
- -- Examine the version of Trim that removes set characters from
- -- the left and right of a wide string.
-
- for i in 1..5 loop
- if ASW.Trim(String_Array(i),
- Left => XYZ_Set,
- Right => PQR_Set) /= The_New_Ada then
- Report.Failed
- ("Incorrect result from Trim for set characters - " &
- Integer'Image(i));
- end if;
- end loop;
-
- -- No trimming.
-
- if ASW.Trim(
- ASW.To_Unbounded_Wide_String(Equiv("prqqprAda9Xyzzxyzzyz")),
- XYZ_Set,
- PQR_Set) /=
- ASW.To_Unbounded_Wide_String(Equiv("prqqprAda9Xyzzxyzzyz"))
- then
- Report.Failed
- ("Incorrect result from Trim for set, no trimming");
- end if;
-
- end Trim_Block;
-
-
-
- -- Delete
-
- -- Use the Delete function to remove the first four and last four
- -- characters from the wide string.
-
- if ASW.Delete(Source => ASW.Delete(Magic_String,
- 8,
- ASW.Length(Magic_String)),
- From => ASW.To_Wide_String(Magic_String)'First,
- Through => 4) /=
- Cad_String
- then
- Report.Failed("Incorrect results from Function Delete");
- end if;
-
-
-
- -- Constructors ("*")
-
- Constructor_Block:
- declare
-
- SOS : ASW.Unbounded_Wide_String;
-
- Dot : constant ASW.Unbounded_Wide_String :=
- ASW.To_Unbounded_Wide_String(Equiv("Dot_"));
- Dash : constant Wide_String := Equiv("Dash_");
-
- Distress : ASW.Unbounded_Wide_String :=
- ASW."&"(ASW.To_Unbounded_Wide_String
- (Equiv("Dot_Dot_Dot_")),
- ASW."&"(ASW.To_Unbounded_Wide_String
- (Equiv("Dash_Dash_Dash_")),
- ASW.To_Unbounded_Wide_String
- (Equiv("Dot_Dot_Dot"))));
-
- Repeat : constant Natural := 3;
- Separator : constant Wide_Character := Equiv('_');
-
- Separator_Set : Wide_Maps.Wide_Character_Set :=
- Wide_Maps.To_Set(Separator);
-
- begin
-
- -- Use the following constructor forms to construct the wide string
- -- "Dot_Dot_Dot_Dash_Dash_Dash_Dot_Dot_Dot". Note that the
- -- trailing underscore in the wide string is removed in the call to
- -- Trim in the If statement condition.
-
- SOS := ASW."*"(Repeat, Dot); -- "*"(#, W Unb Str)
-
- SOS := ASW."&"(SOS,
- ASW."&"(ASW."*"(Repeat, Dash), -- "*"(#, W Str)
- ASW."*"(Repeat, Dot))); -- "*"(#, W Unb Str)
-
- if ASW.Trim(SOS, Wide_Maps.Null_Set, Separator_Set) /= Distress then
- Report.Failed("Incorrect results from Function ""*""");
- end if;
-
- end Constructor_Block;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4023;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4024.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4024.a
deleted file mode 100644
index 1b0af9ce978..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4024.a
+++ /dev/null
@@ -1,350 +0,0 @@
--- CXA4024.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the function "-", To_Ranges, To_Domain, and To_Range are
--- available in the package Ada.Strings.Maps, and that they produce
--- correct results based on the Character_Set/Character_Mapping input
--- provided.
---
--- TEST DESCRIPTION:
--- This test examines the operation of four functions from within the
--- Ada.Strings.Maps package. A variety of Character_Sequence,
--- Character_Set, and Character_Mapping objects are created and
--- initialized for use with these functions. In each subtest of
--- function operation, specific inputs are provided to the functions as
--- input parameters, and the results are evaluated against expected
--- values. Wherever appropriate, additional characteristics of the
--- function results are verified against the prescribed result
--- characteristics.
---
---
--- CHANGE HISTORY:
--- 03 Feb 95 SAIC Initial prerelease version
--- 10 Mar 95 SAIC Incorporated reviewer comments.
--- 15 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 05 Oct 96 SAIC Incorporated reviewer comments for ACVC 2.1.
---
---!
-
-with Ada.Strings.Maps;
-with Ada.Strings.Maps.Constants;
-with Ada.Characters.Latin_1;
-with Report;
-
-procedure CXA4024 is
-
-begin
-
- Report.Test ("CXA4024", "Check that the function ""-"", To_Ranges, " &
- "To_Domain, and To_Range are available in " &
- "the package Ada.Strings.Maps, and that " &
- "they produce correct results");
-
- Test_Block:
- declare
-
- use Ada.Strings, Ada.Strings.Maps;
- use type Maps.Character_Set; -- To allow logical set operator
- -- infix notation.
- package ACL1 renames Ada.Characters.Latin_1;
-
- MidPoint_Letter : constant := 13;
- Last_Letter : constant := 26;
-
- Vowels : constant Maps.Character_Sequence := "aeiou";
- Quasi_Vowel : constant Character := 'y';
-
- Alphabet : Maps.Character_Sequence (1..Last_Letter);
- Half_Alphabet : Maps.Character_Sequence (1..MidPoint_Letter);
-
- Alphabet_Set,
- Consonant_Set,
- Vowel_Set,
- First_Half_Set,
- Second_Half_Set : Maps.Character_Set;
-
-
- begin
-
- -- Load the alphabet strings for use in creating sets.
- for i in 0..12 loop
- Half_Alphabet(i+1) := Character'Val(Character'Pos('a') + i);
- end loop;
-
- for i in 0..25 loop
- Alphabet(i+1) := Character'Val(Character'Pos('a') + i);
- end loop;
-
- -- Initialize a series of Character_Set objects.
-
- Alphabet_Set := Maps.To_Set(Alphabet);
- Vowel_Set := Maps.To_Set(Vowels);
- Consonant_Set := Vowel_Set XOR Alphabet_Set;
- First_Half_Set := Maps.To_Set(Half_Alphabet);
- Second_Half_Set := Alphabet_Set XOR First_Half_Set;
-
-
-
- -- Evaluation of Set operator "-".
-
- if Consonant_Set /= "-"(Alphabet_Set, Vowel_Set) or
- Vowel_Set /= (Alphabet_Set - Consonant_Set) or
- Alphabet_Set /= Alphabet_Set - Maps.Null_Set or
- First_Half_Set /= "-"(Alphabet_Set, Second_Half_Set) or
- (Alphabet_Set - Vowel_Set) /= "AND"(Alphabet_Set, "NOT"(Vowel_Set))
- then
- Report.Failed("Incorrect result from ""-"" operator for sets");
- end if;
-
-
-
- -- Evaluation of Function "To_Ranges".
-
- declare
-
- use type Maps.Character_Range;
- use type Maps.Character_Ranges;
-
- Set_A_to_C : Maps.Character_Set := Maps.To_Set("ABC");
- Set_J : Maps.Character_Set := Maps.To_Set("J");
- Set_M_to_P : Maps.Character_Set := Maps.To_Set("MNOP");
- Set_X_to_Z : Maps.Character_Set := Maps.To_Set("XYZ");
- Set_Of_Five : Maps.Character_Set := Set_A_to_C OR -- Union of the
- Set_M_to_P OR -- five sets.
- Set_X_to_Z OR
- Set_J OR
- Maps.Null_Set;
-
- TC_Range_A_to_C : Maps.Character_Range := (Low => 'A', High => 'C');
- TC_Range_J : Maps.Character_Range := ('J', 'J');
- TC_Range_M_to_P : Maps.Character_Range := ('M', 'P');
- TC_Range_X_to_Z : Maps.Character_Range := (Low => 'X', High => 'Z');
-
- TC_Ranges : Maps.Character_Ranges (1..4) :=
- (1 => TC_Range_A_to_C,
- 2 => TC_Range_J,
- 3 => TC_Range_M_to_P,
- 4 => TC_Range_X_to_Z);
-
- begin
-
- -- Based on input of a set containing four separate "spans" of
- -- character sequences, Function To_Ranges is required to produce
- -- the shortest array of contiguous ranges of Character values in
- -- the input set, in increasing order of Low.
-
- declare
-
- -- This Character_Ranges constant should consist of array
- -- components, each component being a Character_Range from Low
- -- to High containing the appropriate characters.
-
- Ranges_Result : constant Maps.Character_Ranges :=
- Maps.To_Ranges(Set => Set_Of_Five);
- begin
-
- -- Check the structure and components of the Character_Ranges
- -- constant.
-
- if Ranges_Result(1) /= TC_Range_A_to_C or
- Ranges_Result(1).Low /= TC_Ranges(1).Low or
- Ranges_Result(2) /= TC_Range_J or
- Ranges_Result(2).High /= TC_Ranges(2).High or
- Ranges_Result(3) /= TC_Range_M_to_P or
- Ranges_Result(3).Low /= TC_Ranges(3).Low or
- Ranges_Result(3).High /= TC_Ranges(3).High or
- Ranges_Result(4) /= TC_Range_X_To_Z or
- Ranges_Result(4).Low /= TC_Ranges(4).Low or
- Ranges_Result(4).High /= TC_Ranges(4).High
- then
- Report.Failed ("Incorrect structure or components in " &
- "Character_Ranges constant");
- end if;
-
- exception
- when others =>
- Report.Failed("Exception raised using the Function To_Ranges " &
- "to initialize a Character_Ranges constant");
- end;
- end;
-
-
-
- -- Evaluation of Functions To_Domain and To_Range.
-
- declare
-
- Null_Sequence : constant Maps.Character_Sequence := "";
-
- TC_Upper_Case_Sequence : constant Maps.Character_Sequence :=
- "ZYXWVUTSRQPONMABCDEFGHIJKL";
- TC_Lower_Case_Sequence : constant Maps.Character_Sequence :=
- "zyxwvutsrqponmabcdefghijkl";
- TC_Unordered_Sequence : Maps.Character_Sequence(1..6) :=
- "BxACzy";
-
- TC_Upper_to_Lower_Map : Maps.Character_Mapping :=
- Maps.To_Mapping(TC_Upper_Case_Sequence,
- TC_Lower_Case_Sequence);
-
- TC_Lower_to_Upper_Map : Maps.Character_Mapping :=
- Maps.To_Mapping(TC_Lower_Case_Sequence,
- TC_Upper_Case_Sequence);
-
- TC_Unordered_Map : Maps.Character_Mapping :=
- Maps.To_Mapping(TC_Unordered_Sequence,
- "ikglja");
- begin
-
- declare
-
- TC_Domain_1 : constant Maps.Character_Sequence :=
- Maps.To_Domain(TC_Upper_to_Lower_Map);
-
- TC_Domain_2 : constant Maps.Character_Sequence :=
- Maps.To_Domain(TC_Lower_to_Upper_Map);
-
- TC_Domain_3 : Maps.Character_Sequence(1..6);
-
- TC_Range_1 : constant Maps.Character_Sequence :=
- Maps.To_Range(TC_Upper_to_Lower_Map);
-
- TC_Range_2 : constant Maps.Character_Sequence :=
- Maps.To_Range(TC_Lower_to_Upper_Map);
-
- TC_Range_3 : Maps.Character_Sequence(1..6);
-
- begin
-
- -- Function To_Domain returns the shortest Character_Sequence
- -- value such that each character not in the result maps to
- -- itself, and all characters in the result are in ascending
- -- order.
-
- TC_Domain_3 := Maps.To_Domain(TC_Unordered_Map);
-
- -- Check contents of result of To_Domain, must be in ascending
- -- order.
-
- if TC_Domain_1 /= "ABCDEFGHIJKLMNOPQRSTUVWXYZ" then
- Report.Failed("Incorrect result from To_Domain with " &
- "TC_Upper_to_Lower_Map as input");
- end if;
-
- if TC_Domain_2 /= "abcdefghijklmnopqrstuvwxyz" then
- Report.Failed("Incorrect result from To_Domain with " &
- "TC_Lower_to_Upper_Map as input");
- end if;
-
- if TC_Domain_3 /= "ABCxyz" then
- Report.Failed("Incorrect result from To_Domain with " &
- "an unordered mapping as input");
- end if;
-
-
- -- The lower bound on the returned Character_Sequence value
- -- from To_Domain must be 1.
-
- if TC_Domain_1'First /= 1 or
- TC_Domain_2'First /= 1 or
- TC_Domain_3'First /= 1
- then
- Report.Failed("Incorrect lower bound returned from To_Domain");
- end if;
-
-
- -- Check contents of result of To_Range.
-
- TC_Range_3 := Maps.To_Range(TC_Unordered_Map);
-
- if TC_Range_1 /= "abcdefghijklmnopqrstuvwxyz" then
- Report.Failed("Incorrect result from To_Range with " &
- "TC_Upper_to_Lower_Map as input");
- end if;
-
- if TC_Range_2 /= "ABCDEFGHIJKLMNOPQRSTUVWXYZ" then
- Report.Failed("Incorrect result from To_Range with " &
- "TC_Lower_to_Upper_Map as input");
- end if;
-
- if TC_Range_3 /= "gilkaj" then
- Report.Failed("Incorrect result from To_Range with " &
- "an unordered mapping as input");
- end if;
-
-
- -- The lower bound on the returned Character_Sequence value
- -- must be 1.
-
- if TC_Range_1'First /= 1 or
- TC_Range_2'First /= 1 or
- TC_Range_3'First /= 1
- then
- Report.Failed("Incorrect lower bound returned from To_Range");
- end if;
-
-
- -- The upper bound on the returned Character_Sequence value
- -- must be Map'Length.
-
- if TC_Range_1'Last /= TC_Lower_Case_Sequence'Length or
- TC_Range_2'Last /= TC_Upper_Case_Sequence'Length or
- TC_Range_3'Last /= TC_Unordered_Sequence'Length
- then
- Report.Failed("Incorrect upper bound returned from To_Range");
- end if;
-
- end;
-
- -- Both function To_Domain and To_Range return the null string
- -- when provided the Identity character map as an input parameter.
-
- if Maps.To_Domain(Maps.Identity) /= Null_Sequence then
- Report.Failed("Function To_Domain did not return the null " &
- "string when provided the Identity map as " &
- "input");
- end if;
-
- if Maps.To_Range(Maps.Identity) /= Null_Sequence then
- Report.Failed("Function To_Range did not return the null " &
- "string when provided the Identity map as " &
- "input");
- end if;
-
- exception
- when others =>
- Report.Failed("Exception raised during the evaluation of " &
- "Function To_Domain and To_Range");
- end;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4024;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4025.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4025.a
deleted file mode 100644
index 1665f7a46e8..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4025.a
+++ /dev/null
@@ -1,376 +0,0 @@
--- CXA4025.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functionality found in packages Ada.Strings.Wide_Maps,
--- Ada.Strings.Wide_Fixed, and Ada.Strings.Wide_Maps.Wide_Constants
--- is available and produces correct results.
---
--- TEST DESCRIPTION:
--- This test validates the subprograms found in the various Wide_Map
--- and Wide_String packages. It is based on the tests CXA4024 and
--- CXA4026, which are tests for the complementary "non-wide" packages.
---
--- The functions found in CXA4025_0 provide mapping capability, when
--- used in conjunction with Wide_Character_Mapping_Function objects.
---
---
--- CHANGE HISTORY:
--- 23 Jun 95 SAIC Initial prerelease version.
--- 15 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
---
---!
-
-package CXA4025_0 is
- -- Functions used to supply mapping capability.
- function Map_To_Lower_Case (From : Wide_Character) return Wide_Character;
- function Map_To_Upper_Case (From : Wide_Character) return Wide_Character;
-end CXA4025_0;
-
-with Ada.Characters.Handling;
-package body CXA4025_0 is
- -- Function Map_To_Lower_Case will return the lower case form of
- -- Wide_Characters in the range 'A'..'Z' only, and return the input
- -- wide_character otherwise.
-
- function Map_To_Lower_Case (From : Wide_Character)
- return Wide_Character is
- begin
- return Ada.Characters.Handling.To_Wide_Character(
- Ada.Characters.Handling.To_Lower(
- Ada.Characters.Handling.To_Character(From)));
- end Map_To_Lower_Case;
-
- -- Function Map_To_Upper_Case will return the upper case form of
- -- Wide_Characters in the range 'a'..'z', or whose position is in one
- -- of the ranges 223..246 or 248..255, provided the wide_character has
- -- an upper case form.
-
- function Map_To_Upper_Case (From : Wide_Character)
- return Wide_Character is
- begin
- return Ada.Characters.Handling.To_Wide_Character(
- Ada.Characters.Handling.To_Upper(
- Ada.Characters.Handling.To_Character(From)));
- end Map_To_Upper_Case;
-
-end CXA4025_0;
-
-
-with CXA4025_0;
-with Report;
-with Ada.Characters.Handling;
-with Ada.Characters.Latin_1;
-with Ada.Exceptions;
-with Ada.Strings;
-with Ada.Strings.Wide_Maps;
-with Ada.Strings.Wide_Maps.Wide_Constants;
-with Ada.Strings.Wide_Fixed;
-
-procedure CXA4025 is
-begin
- Report.Test ("CXA4025",
- "Check that subprograms defined in packages " &
- "Ada.Strings.Wide_Maps and Ada.Strings.Wide_Fixed " &
- "produce correct results");
-
- Test_Block:
- declare
-
- package ACL1 renames Ada.Characters.Latin_1;
-
- use Ada.Characters, Ada.Strings;
- use Ada.Exceptions;
- use type Wide_Maps.Wide_Character_Set;
-
- subtype LC_Characters is Wide_Character range 'a'..'z';
-
- Last_Letter : constant := 26;
- Vowels : constant Wide_Maps.Wide_Character_Sequence := "aeiou";
- TC_String : constant Wide_String := "A Standard String";
-
- Alphabet : Wide_Maps.Wide_Character_Sequence (1..Last_Letter);
- Alphabet_Set,
- Consonant_Set,
- Vowel_Set : Wide_Maps.Wide_Character_Set;
-
- String_20 : Wide_String(1..20) := "ABCDEFGHIJKLMNOPQRST";
- String_40 : Wide_String(1..40) := "abcdefghijklmnopqrst" &
- String_20;
- String_80 : Wide_String(1..80) := String_40 & String_40;
- TC_String_5 : Wide_String(1..5) := "ABCDE";
-
- -- The following strings are used in examination of the Translation
- -- subprograms.
- New_Character_String : Wide_String(1..12) :=
- Handling.To_Wide_String(
- ACL1.LC_A_Grave & ACL1.LC_A_Ring & ACL1.LC_AE_Diphthong &
- ACL1.LC_C_Cedilla & ACL1.LC_E_Acute & ACL1.LC_I_Circumflex &
- ACL1.LC_Icelandic_Eth & ACL1.LC_N_Tilde &
- ACL1.LC_O_Oblique_Stroke & ACL1.LC_Icelandic_Thorn &
- ACL1.LC_German_Sharp_S & ACL1.LC_Y_Diaeresis);
-
- -- Note that there is no upper case version of the last two
- -- characters from above.
-
- TC_New_Character_String : Wide_String(1..12) :=
- Handling.To_Wide_String(
- ACL1.UC_A_Grave & ACL1.UC_A_Ring & ACL1.UC_AE_Diphthong &
- ACL1.UC_C_Cedilla & ACL1.UC_E_Acute & ACL1.UC_I_Circumflex &
- ACL1.UC_Icelandic_Eth & ACL1.UC_N_Tilde &
- ACL1.UC_O_Oblique_Stroke & ACL1.UC_Icelandic_Thorn &
- ACL1.LC_German_Sharp_S & ACL1.LC_Y_Diaeresis);
-
- -- Access objects that will be provided as parameters to the
- -- subprograms.
- Map_To_Lower_Case_Ptr : Wide_Maps.Wide_Character_Mapping_Function :=
- CXA4025_0.Map_To_Lower_Case'Access;
- Map_To_Upper_Case_Ptr : Wide_Maps.Wide_Character_Mapping_Function :=
- CXA4025_0.Map_To_Upper_Case'Access;
-
- begin
-
- --
- -- Testing of functionality found in Package Ada.Strings.Wide_Maps.
- --
-
- -- Load the alphabet strings for use in creating sets.
- for i in 0..25 loop
- Alphabet(i+1) := Wide_Character'Val(Wide_Character'Pos('a')+i);
- end loop;
-
- -- Initialize a series of Character_Set objects.
- Alphabet_Set := Wide_Maps.To_Set(Alphabet);
- Vowel_Set := Wide_Maps.To_Set(Vowels);
- Consonant_Set := Vowel_Set XOR Alphabet_Set;
-
- -- Evaluation of Set operator "-".
- if
- (Alphabet_Set - Consonant_Set) /=
- "AND"(Alphabet_Set, "NOT"(Consonant_Set)) or
- (Alphabet_Set - Vowel_Set) /= "AND"(Alphabet_Set, "NOT"(Vowel_Set))
- then
- Report.Failed("Incorrect result from ""-"" operator for sets");
- end if;
-
- -- Evaluation of Functions To_Domain and To_Range.
- declare
- Null_Sequence : constant Wide_Maps.Wide_Character_Sequence := "";
- TC_UC_Sequence : constant Wide_Maps.Wide_Character_Sequence :=
- "ZYXWVUTSRQPONMABCDEFGHIJKL";
- TC_LC_Sequence : constant Wide_Maps.Wide_Character_Sequence :=
- "zyxwvutsrqponmabcdefghijkl";
- TC_Upper_to_Lower_Map : Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.To_Mapping(TC_UC_Sequence,
- TC_LC_Sequence);
- TC_Lower_to_Upper_Map : Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.To_Mapping(TC_LC_Sequence,
- TC_UC_Sequence);
- begin
- declare
- TC_Domain : constant Wide_Maps.Wide_Character_Sequence :=
- Wide_Maps.To_Domain(TC_Upper_to_Lower_Map);
- TC_Range : constant Wide_Maps.Wide_Character_Sequence :=
- Wide_Maps.To_Range(TC_Lower_to_Upper_Map);
- begin
- -- Function To_Domain returns the shortest Wide_Character_Sequence
- -- value such that each wide character not in the result maps to
- -- itself, and all wide characters in the result are in ascending
- -- order.
- if TC_Domain /= "ABCDEFGHIJKLMNOPQRSTUVWXYZ" then
- Report.Failed("Incorrect result from To_Domain with " &
- "TC_Upper_to_Lower_Map as input");
- end if;
-
- -- The lower bound on the returned Wide_Character_Sequence value
- -- from To_Domain must be 1.
- if TC_Domain'First /= 1 then
- Report.Failed("Incorrect lower bound returned from To_Domain");
- end if;
-
- -- Check contents of result of To_Range.
- if TC_Range /= "ABCDEFGHIJKLMNOPQRSTUVWXYZ" then
- Report.Failed("Incorrect result from To_Range with " &
- "TC_Lower_to_Upper_Map as input");
- end if;
-
- -- The lower bound on the returned Character_Sequence value
- -- must be 1.
- if TC_Range'First /= 1 then
- Report.Failed("Incorrect lower bound returned from To_Range");
- end if;
-
- if TC_Range'Last /= TC_LC_Sequence'Length then
- Report.Failed("Incorrect upper bound returned from To_Range");
- end if;
- end;
-
- -- Both function To_Domain and To_Range return the null string
- -- when provided the Identity character map as an input parameter.
- if Wide_Maps.To_Domain(Wide_Maps.Identity) /= Null_Sequence or
- Wide_Maps.To_Range(Wide_Maps.Identity) /= Null_Sequence
- then
- Report.Failed("Null sequence not returned from To_Domain or " &
- "To_Range when provided the Identity map as input");
- end if;
- exception
- when others =>
- Report.Failed("Exception raised during the evaluation of " &
- "Function To_Domain and To_Range");
- end;
-
- -- Testing of functionality found in Package Ada.Strings.Wide_Fixed.
- --
- -- Function Index, Forward direction search.
-
- if Wide_Fixed.Index("CoMpLeTeLy MiXeD CaSe StRiNg",
- "MIXED CASE STRING",
- Ada.Strings.Forward,
- Map_To_Upper_Case_Ptr) /= 12 or
- Wide_Fixed.Index("STRING WITH NO MATCHING PATTERNS",
- "WITH",
- Ada.Strings.Forward,
- Map_To_Lower_Case_Ptr) /= 0
- then
- Report.Failed("Incorrect results from Function Index, going " &
- "in Forward direction, using a Character Mapping " &
- "Function parameter");
- end if;
-
- -- Function Index, Backward direction search.
- if Wide_Fixed.Index("Case of a Mixed Case String",
- "case",
- Ada.Strings.Backward,
- Map_To_Lower_Case_Ptr) /= 17 or
- Wide_Fixed.Index("WOULD MATCH BUT FOR THE CASE",
- "WOULD MATCH BUT FOR THE CASE",
- Ada.Strings.Backward,
- Map_To_Lower_Case_Ptr) /= 0
- then
- Report.Failed("Incorrect results from Function Index, going " &
- "in Backward direction, using a Character Mapping " &
- "Function parameter");
- end if;
-
- -- Function Count.
- if Wide_Fixed.Count("ABABABA", "ABA", Map_To_Upper_Case_Ptr) /= 2 or
- Wide_Fixed.Count("", "match", Map_To_Lower_Case_Ptr) /= 0
- then
- Report.Failed("Incorrect results from Function Count, using " &
- "a Character Mapping Function parameter");
- end if;
-
- -- Function Translate.
- if Wide_Fixed.Translate(Source => "A Sample Mixed Case String",
- Mapping => Map_To_Lower_Case_Ptr) /=
- "a sample mixed case string" or
- Wide_Fixed.Translate(New_Character_String,
- Map_To_Upper_Case_Ptr) /=
- TC_New_Character_String
- then
- Report.Failed("Incorrect results from Function Translate, using " &
- "a Wide_Character Mapping Function parameter");
- end if;
-
- -- Procedure Translate.
- declare
- use Ada.Strings.Wide_Fixed;
- Str : Wide_String(1..19) := "A Mixed Case String";
- begin
- Translate(Source => Str, Mapping => Map_To_Lower_Case_Ptr);
- if Str /= "a mixed case string" then
- Report.Failed("Incorrect result from Procedure Translate - 1");
- end if;
-
- Translate(New_Character_String, Map_To_Upper_Case_Ptr);
- if New_Character_String /= TC_New_Character_String then
- Report.Failed("Incorrect result from Procedure Translate - 2");
- end if;
- end;
-
- -- Procedure Trim.
- declare
- use Ada.Strings.Wide_Fixed;
- Trim_String : Wide_String(1..30) := " A string of characters ";
- begin
- Trim(Trim_String, Ada.Strings.Left, Ada.Strings.Right, 'x');
- if Trim_String /= "xxxxA string of characters " then
- Report.Failed("Incorrect result from Procedure Trim, trim " &
- "side = left, justify = right, pad = x");
- end if;
-
- Trim(Trim_String, Ada.Strings.Right, Ada.Strings.Center);
- if Trim_String /= " xxxxA string of characters " then
- Report.Failed("Incorrect result from Procedure Trim, trim " &
- "side = right, justify = center, default pad");
- end if;
- end;
-
- -- Procedure Head.
- declare
- Fixed_String : Wide_String(1..20) := "A sample test string";
- begin
- Wide_Fixed.Head(Source => Fixed_String, Count => 14,
- Justify => Ada.Strings.Center, Pad => '$');
- if Fixed_String /= "$$$A sample test $$$" then
- Report.Failed("Incorrect result from Procedure Head, " &
- "justify = center, pad = $");
- end if;
-
- Wide_Fixed.Head(Fixed_String, 11, Ada.Strings.Right);
- if Fixed_String /= " $$$A sample" then
- Report.Failed("Incorrect result from Procedure Head, " &
- "justify = right, default pad");
- end if;
- end;
-
- -- Procedure Tail.
- declare
- use Ada.Strings.Wide_Fixed;
- Tail_String : Wide_String(1..20) := "ABCDEFGHIJKLMNOPQRST";
- begin
- -- Default left justify.
- Tail(Source => Tail_String, Count => 10, Pad => '-');
- if Tail_String /= "KLMNOPQRST----------" then
- Report.Failed("Incorrect result from Procedure Tail, " &
- "default justify, pad = -");
- end if;
-
- Tail(Tail_String, 6, Ada.Strings.Center, 'a');
- if Tail_String /= "aaaaaaa------aaaaaaa" then
- Report.Failed("Incorrect result from Procedure Tail, " &
- "justify = center, pad = a");
- end if;
- end;
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXA4025;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4026.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4026.a
deleted file mode 100644
index 766979ad057..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4026.a
+++ /dev/null
@@ -1,526 +0,0 @@
--- CXA4026.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Ada.Strings.Fixed procedures Head, Tail, and Trim, as well
--- as the versions of subprograms Translate (procedure and function),
--- Index, and Count, available in the package which use a
--- Maps.Character_Mapping_Function input parameter, produce correct
--- results.
---
--- TEST DESCRIPTION:
--- This test examines the operation of several subprograms contained in
--- the Ada.Strings.Fixed package.
--- This includes procedure versions of Head, Tail, and Trim, as well as
--- four subprograms that use a Character_Mapping_Function as a parameter
--- to provide the mapping capability.
---
--- Two functions are defined to provide the mapping. Access values
--- are defined to refer to these functions. One of the functions will
--- map upper case characters in the range 'A'..'Z' to their lower case
--- counterparts, while the other function will map lower case characters
--- ('a'..'z', or a character whose position is in one of the ranges
--- 223..246 or 248..255, provided the character has an upper case form)
--- to their upper case form.
---
--- Function Index uses the mapping function access value to map the input
--- string prior to searching for the appropriate index value to return.
--- Function Count uses the mapping function access value to map the input
--- string prior to counting the occurrences of the pattern string.
--- Both the Procedure and Function version of Translate use the mapping
--- function access value to perform the translation.
---
--- Results of all subprograms are compared with expected results.
---
---
--- CHANGE HISTORY:
--- 10 Feb 95 SAIC Initial prerelease version
--- 21 Apr 95 SAIC Modified definition of string variable Str_2.
---
---!
-
-
-package CXA4026_0 is
-
- -- Function Map_To_Lower_Case will return the lower case form of
- -- Characters in the range 'A'..'Z' only, and return the input
- -- character otherwise.
-
- function Map_To_Lower_Case (From : Character) return Character;
-
-
- -- Function Map_To_Upper_Case will return the upper case form of
- -- Characters in the range 'a'..'z', or whose position is in one
- -- of the ranges 223..246 or 248..255, provided the character has
- -- an upper case form.
-
- function Map_To_Upper_Case (From : Character) return Character;
-
-end CXA4026_0;
-
-
-with Ada.Characters.Handling;
-package body CXA4026_0 is
-
- function Map_To_Lower_Case (From : Character) return Character is
- begin
- if From in 'A'..'Z' then
- return Character'Val(Character'Pos(From) -
- (Character'Pos('A') - Character'Pos('a')));
- else
- return From;
- end if;
- end Map_To_Lower_Case;
-
- function Map_To_Upper_Case (From : Character) return Character is
- begin
- return Ada.Characters.Handling.To_Upper(From);
- end Map_To_Upper_Case;
-
-end CXA4026_0;
-
-
-with CXA4026_0;
-with Ada.Strings.Fixed;
-with Ada.Strings.Maps;
-with Ada.Characters.Handling;
-with Ada.Characters.Latin_1;
-with Report;
-
-procedure CXA4026 is
-
-begin
-
- Report.Test ("CXA4026", "Check that procedures Trim, Head, and Tail, " &
- "as well as the versions of subprograms " &
- "Translate, Index, and Count, which use the " &
- "Character_Mapping_Function input parameter," &
- "produce correct results");
-
- Test_Block:
- declare
-
- use Ada.Strings, CXA4026_0;
-
- -- The following strings are used in examination of the Translation
- -- subprograms.
-
- New_Character_String : String(1..10) :=
- Ada.Characters.Latin_1.LC_A_Grave &
- Ada.Characters.Latin_1.LC_A_Ring &
- Ada.Characters.Latin_1.LC_AE_Diphthong &
- Ada.Characters.Latin_1.LC_C_Cedilla &
- Ada.Characters.Latin_1.LC_E_Acute &
- Ada.Characters.Latin_1.LC_I_Circumflex &
- Ada.Characters.Latin_1.LC_Icelandic_Eth &
- Ada.Characters.Latin_1.LC_N_Tilde &
- Ada.Characters.Latin_1.LC_O_Oblique_Stroke &
- Ada.Characters.Latin_1.LC_Icelandic_Thorn;
-
-
- TC_New_Character_String : String(1..10) :=
- Ada.Characters.Latin_1.UC_A_Grave &
- Ada.Characters.Latin_1.UC_A_Ring &
- Ada.Characters.Latin_1.UC_AE_Diphthong &
- Ada.Characters.Latin_1.UC_C_Cedilla &
- Ada.Characters.Latin_1.UC_E_Acute &
- Ada.Characters.Latin_1.UC_I_Circumflex &
- Ada.Characters.Latin_1.UC_Icelandic_Eth &
- Ada.Characters.Latin_1.UC_N_Tilde &
- Ada.Characters.Latin_1.UC_O_Oblique_Stroke &
- Ada.Characters.Latin_1.UC_Icelandic_Thorn;
-
-
- -- Functions used to supply mapping capability.
-
-
- -- Access objects that will be provided as parameters to the
- -- subprograms.
-
- Map_To_Lower_Case_Ptr : Maps.Character_Mapping_Function :=
- Map_To_Lower_Case'Access;
-
- Map_To_Upper_Case_Ptr : Maps.Character_Mapping_Function :=
- Map_To_Upper_Case'Access;
-
-
- begin
-
- -- Function Index, Forward direction search.
- -- Note: Several of the following cases use the default value
- -- Forward for the Going parameter.
-
- if Fixed.Index(Source => "The library package Strings.Fixed",
- Pattern => "fix",
- Going => Ada.Strings.Forward,
- Mapping => Map_To_Lower_Case_Ptr) /= 29 or
- Fixed.Index("THE RAIN IN SPAIN FALLS MAINLY ON THE PLAIN",
- "ain",
- Mapping => Map_To_Lower_Case_Ptr) /= 6 or
- Fixed.Index("maximum number",
- "um",
- Ada.Strings.Forward,
- Map_To_Lower_Case_Ptr) /= 6 or
- Fixed.Index("CoMpLeTeLy MiXeD CaSe StRiNg",
- "MIXED CASE STRING",
- Ada.Strings.Forward,
- Map_To_Upper_Case_Ptr) /= 12 or
- Fixed.Index("STRING WITH NO MATCHING PATTERNS",
- "WITH",
- Ada.Strings.Forward,
- Map_To_Lower_Case_Ptr) /= 0 or
- Fixed.Index("THIS STRING IS IN UPPER CASE",
- "IS",
- Ada.Strings.Forward,
- Map_To_Upper_Case_Ptr) /= 3 or
- Fixed.Index("", -- Null string.
- "is",
- Mapping => Map_To_Lower_Case_Ptr) /= 0 or
- Fixed.Index("AAABBBaaabbb",
- "aabb",
- Mapping => Map_To_Lower_Case_Ptr) /= 2
- then
- Report.Failed("Incorrect results from Function Index, going " &
- "in Forward direction, using a Character Mapping " &
- "Function parameter");
- end if;
-
-
-
- -- Function Index, Backward direction search.
-
- if Fixed.Index("Case of a Mixed Case String",
- "case",
- Ada.Strings.Backward,
- Map_To_Lower_Case_Ptr) /= 17 or
- Fixed.Index("Case of a Mixed Case String",
- "CASE",
- Ada.Strings.Backward,
- Map_To_Upper_Case_Ptr) /= 17 or
- Fixed.Index("rain, Rain, and more RAIN",
- "rain",
- Ada.Strings.Backward,
- Map_To_Lower_Case_Ptr) /= 22 or
- Fixed.Index("RIGHT place, right time",
- "RIGHT",
- Ada.Strings.Backward,
- Map_To_Upper_Case_Ptr) /= 14 or
- Fixed.Index("WOULD MATCH BUT FOR THE CASE",
- "WOULD MATCH BUT FOR THE CASE",
- Ada.Strings.Backward,
- Map_To_Lower_Case_Ptr) /= 0
- then
- Report.Failed("Incorrect results from Function Index, going " &
- "in Backward direction, using a Character Mapping " &
- "Function parameter");
- end if;
-
-
-
- -- Function Index, Pattern_Error if Pattern = Null_String
-
- declare
- use Ada.Strings.Fixed;
- Null_Pattern_String : constant String := "";
- TC_Natural : Natural := 1000;
- begin
- TC_Natural := Index("A Valid String",
- Null_Pattern_String,
- Ada.Strings.Forward,
- Map_To_Lower_Case_Ptr);
- Report.Failed("Pattern_Error not raised by Function Index when " &
- "given a null pattern string");
- exception
- when Pattern_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function Index " &
- "using a Character Mapping Function parameter " &
- "when given a null pattern string");
- end;
-
-
-
- -- Function Count.
-
- if Fixed.Count(Source => "ABABABA",
- Pattern => "aba",
- Mapping => Map_To_Lower_Case_Ptr) /= 2 or
- Fixed.Count("ABABABA", "ABA", Map_To_Lower_Case_Ptr) /= 0 or
- Fixed.Count("This IS a MISmatched issue",
- "is",
- Map_To_Lower_Case_Ptr) /= 4 or
- Fixed.Count("ABABABA", "ABA", Map_To_Upper_Case_Ptr) /= 2 or
- Fixed.Count("This IS a MISmatched issue",
- "is",
- Map_To_Upper_Case_Ptr) /= 0 or
- Fixed.Count("She sells sea shells by the sea shore",
- "s",
- Map_To_Lower_Case_Ptr) /= 8 or
- Fixed.Count("", -- Null string.
- "match",
- Map_To_Upper_Case_Ptr) /= 0
- then
- Report.Failed("Incorrect results from Function Count, using " &
- "a Character Mapping Function parameter");
- end if;
-
-
-
- -- Function Count, Pattern_Error if Pattern = Null_String
-
- declare
- use Ada.Strings.Fixed;
- Null_Pattern_String : constant String := "";
- TC_Natural : Natural := 1000;
- begin
- TC_Natural := Count("A Valid String",
- Null_Pattern_String,
- Map_To_Lower_Case_Ptr);
- Report.Failed("Pattern_Error not raised by Function Count using " &
- "a Character Mapping Function parameter when " &
- "given a null pattern string");
- exception
- when Pattern_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function Count " &
- "using a Character Mapping Function parameter " &
- "when given a null pattern string");
- end;
-
-
-
- -- Function Translate.
-
- if Fixed.Translate(Source => "A Sample Mixed Case String",
- Mapping => Map_To_Lower_Case_Ptr) /=
- "a sample mixed case string" or
-
- Fixed.Translate("ALL LOWER CASE",
- Map_To_Lower_Case_Ptr) /=
- "all lower case" or
-
- Fixed.Translate("end with lower case",
- Map_To_Lower_Case_Ptr) /=
- "end with lower case" or
-
- Fixed.Translate("", Map_To_Lower_Case_Ptr) /=
- "" or
-
- Fixed.Translate("start with lower case",
- Map_To_Upper_Case_Ptr) /=
- "START WITH LOWER CASE" or
-
- Fixed.Translate("ALL UPPER CASE STRING",
- Map_To_Upper_Case_Ptr) /=
- "ALL UPPER CASE STRING" or
-
- Fixed.Translate("LoTs Of MiXeD CaSe ChArAcTeRs",
- Map_To_Upper_Case_Ptr) /=
- "LOTS OF MIXED CASE CHARACTERS" or
-
- Fixed.Translate("", Map_To_Upper_Case_Ptr) /=
- "" or
-
- Fixed.Translate(New_Character_String,
- Map_To_Upper_Case_Ptr) /=
- TC_New_Character_String
- then
- Report.Failed("Incorrect results from Function Translate, using " &
- "a Character Mapping Function parameter");
- end if;
-
-
-
- -- Procedure Translate.
-
- declare
-
- use Ada.Strings.Fixed;
-
- Str_1 : String(1..24) := "AN ALL UPPER CASE STRING";
- Str_2 : String(1..19) := "A Mixed Case String";
- Str_3 : String(1..32) := "a string with lower case letters";
- TC_Str_1 : constant String := Str_1;
- TC_Str_3 : constant String := Str_3;
-
- begin
-
- Translate(Source => Str_1, Mapping => Map_To_Lower_Case_Ptr);
-
- if Str_1 /= "an all upper case string" then
- Report.Failed("Incorrect result from Procedure Translate - 1");
- end if;
-
- Translate(Source => Str_1, Mapping => Map_To_Upper_Case_Ptr);
-
- if Str_1 /= TC_Str_1 then
- Report.Failed("Incorrect result from Procedure Translate - 2");
- end if;
-
- Translate(Source => Str_2, Mapping => Map_To_Lower_Case_Ptr);
-
- if Str_2 /= "a mixed case string" then
- Report.Failed("Incorrect result from Procedure Translate - 3");
- end if;
-
- Translate(Source => Str_2, Mapping => Map_To_Upper_Case_Ptr);
-
- if Str_2 /= "A MIXED CASE STRING" then
- Report.Failed("Incorrect result from Procedure Translate - 4");
- end if;
-
- Translate(Source => Str_3, Mapping => Map_To_Lower_Case_Ptr);
-
- if Str_3 /= TC_Str_3 then
- Report.Failed("Incorrect result from Procedure Translate - 5");
- end if;
-
- Translate(Source => Str_3, Mapping => Map_To_Upper_Case_Ptr);
-
- if Str_3 /= "A STRING WITH LOWER CASE LETTERS" then
- Report.Failed("Incorrect result from Procedure Translate - 6");
- end if;
-
- Translate(New_Character_String, Map_To_Upper_Case_Ptr);
-
- if New_Character_String /= TC_New_Character_String then
- Report.Failed("Incorrect result from Procedure Translate - 6");
- end if;
-
- end;
-
-
- -- Procedure Trim.
-
- declare
- Use Ada.Strings.Fixed;
- Trim_String : String(1..30) := " A string of characters ";
- begin
-
- Trim(Source => Trim_String,
- Side => Ada.Strings.Left,
- Justify => Ada.Strings.Right,
- Pad => 'x');
-
- if Trim_String /= "xxxxA string of characters " then
- Report.Failed("Incorrect result from Procedure Trim, trim " &
- "side = left, justify = right, pad = x");
- end if;
-
- Trim(Trim_String, Ada.Strings.Right, Ada.Strings.Center);
-
- if Trim_String /= " xxxxA string of characters " then
- Report.Failed("Incorrect result from Procedure Trim, trim " &
- "side = right, justify = center, default pad");
- end if;
-
- Trim(Trim_String, Ada.Strings.Both, Pad => '*');
-
- if Trim_String /= "xxxxA string of characters****" then
- Report.Failed("Incorrect result from Procedure Trim, trim " &
- "side = both, default justify, pad = *");
- end if;
-
- end;
-
-
- -- Procedure Head.
-
- declare
- Fixed_String : String(1..20) := "A sample test string";
- begin
-
- Fixed.Head(Source => Fixed_String,
- Count => 14,
- Justify => Ada.Strings.Center,
- Pad => '$');
-
- if Fixed_String /= "$$$A sample test $$$" then
- Report.Failed("Incorrect result from Procedure Head, " &
- "justify = center, pad = $");
- end if;
-
- Fixed.Head(Fixed_String, 11, Ada.Strings.Right);
-
- if Fixed_String /= " $$$A sample" then
- Report.Failed("Incorrect result from Procedure Head, " &
- "justify = right, default pad");
- end if;
-
- Fixed.Head(Fixed_String, 9, Pad => '*');
-
- if Fixed_String /= " ***********" then
- Report.Failed("Incorrect result from Procedure Head, " &
- "default justify, pad = *");
- end if;
-
- end;
-
-
- -- Procedure Tail.
-
- declare
- Use Ada.Strings.Fixed;
- Tail_String : String(1..20) := "ABCDEFGHIJKLMNOPQRST";
- begin
-
- Tail(Source => Tail_String, Count => 10, Pad => '-');
-
- if Tail_String /= "KLMNOPQRST----------" then
- Report.Failed("Incorrect result from Procedure Tail, " &
- "default justify, pad = -");
- end if;
-
- Tail(Tail_String, 6, Justify => Ada.Strings.Center, Pad => 'a');
-
- if Tail_String /= "aaaaaaa------aaaaaaa" then
- Report.Failed("Incorrect result from Procedure Tail, " &
- "justify = center, pad = a");
- end if;
-
- Tail(Tail_String, 1, Ada.Strings.Right);
-
- if Tail_String /= " a" then
- Report.Failed("Incorrect result from Procedure Tail, " &
- "justify = right, default pad");
- end if;
-
- Tail(Tail_String, 19, Ada.Strings.Right, 'A');
-
- if Tail_String /= "A a" then
- Report.Failed("Incorrect result from Procedure Tail, " &
- "justify = right, pad = A");
- end if;
-
- end;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA4026;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4027.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4027.a
deleted file mode 100644
index 05c66d4cc9f..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4027.a
+++ /dev/null
@@ -1,342 +0,0 @@
--- CXA4027.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that versions of Ada.Strings.Bounded subprograms Translate,
--- (procedure and function), Index, and Count, which use the
--- Maps.Character_Mapping_Function input parameter, produce correct
--- results.
---
--- TEST DESCRIPTION:
--- This test examines the operation of several subprograms from within
--- the Ada.Strings.Bounded package that use the
--- Character_Mapping_Function mapping parameter to provide a mapping
--- capability.
---
--- Two functions are defined to provide the mapping. Access values
--- are defined to refer to these functions. One of the functions will
--- map upper case characters in the range 'A'..'Z' to their lower case
--- counterparts, while the other function will map lower case characters
--- ('a'..'z', or a character whose position is in one of the ranges
--- 223..246 or 248..255, provided the character has an upper case form)
--- to their upper case form.
---
--- Function Index uses the mapping function access value to map the input
--- string prior to searching for the appropriate index value to return.
--- Function Count uses the mapping function access value to map the input
--- string prior to counting the occurrences of the pattern string.
--- Both the Procedure and Function version of Translate use the mapping
--- function access value to perform the translation.
---
---
--- CHANGE HISTORY:
--- 16 FEB 95 SAIC Initial prerelease version
--- 17 Jul 95 SAIC Incorporated reviewer comments. Replaced two
--- internally declared functions with two library
--- level functions to eliminate accessibility
--- problems.
---
---!
-
-
--- Function CXA4027_0 will return the lower case form of
--- the character input if it is in upper case, and return the input
--- character otherwise.
-
-with Ada.Characters.Handling;
-function CXA4027_0 (From : Character) return Character;
-
-function CXA4027_0 (From : Character) return Character is
-begin
- return Ada.Characters.Handling.To_Lower(From);
-end CXA4027_0;
-
-
-
--- Function CXA4027_1 will return the upper case form of
--- Characters in the range 'a'..'z', or whose position is in one
--- of the ranges 223..246 or 248..255, provided the character has
--- an upper case form.
-
-with Ada.Characters.Handling;
-function CXA4027_1 (From : Character) return Character;
-
-function CXA4027_1 (From : Character) return Character is
-begin
- return Ada.Characters.Handling.To_Upper(From);
-end CXA4027_1;
-
-
-with CXA4027_0, CXA4027_1;
-with Ada.Strings.Bounded;
-with Ada.Strings.Maps;
-with Ada.Characters.Handling;
-with Report;
-
-procedure CXA4027 is
-begin
-
- Report.Test ("CXA4027", "Check that Ada.Strings.Bounded subprograms " &
- "Translate, Index, and Count, which use the " &
- "Character_Mapping_Function input parameter, " &
- "produce correct results");
-
- Test_Block:
- declare
-
- use Ada.Strings;
-
- -- Functions used to supply mapping capability.
-
- function Map_To_Lower_Case (From : Character) return Character
- renames CXA4027_0;
-
- function Map_To_Upper_Case (From : Character) return Character
- renames CXA4027_1;
-
- Map_To_Lower_Case_Ptr : Maps.Character_Mapping_Function :=
- Map_To_Lower_Case'Access;
-
- Map_To_Upper_Case_Ptr : Maps.Character_Mapping_Function :=
- Map_To_Upper_Case'Access;
-
-
- -- Instantiations of Bounded String generic package.
-
- package BS1 is new Ada.Strings.Bounded.Generic_Bounded_Length(1);
- package BS20 is new Ada.Strings.Bounded.Generic_Bounded_Length(20);
- package BS40 is new Ada.Strings.Bounded.Generic_Bounded_Length(40);
- package BS80 is new Ada.Strings.Bounded.Generic_Bounded_Length(80);
-
- use type BS1.Bounded_String, BS20.Bounded_String,
- BS40.Bounded_String, BS80.Bounded_String;
-
- String_1 : String(1..1) := "A";
- String_20 : String(1..20) := "ABCDEFGHIJKLMNOPQRST";
- String_40 : String(1..40) := "abcdefghijklmnopqrst" & String_20;
- String_80 : String(1..80) := String_40 & String_40;
-
- BString_1 : BS1.Bounded_String := BS1.Null_Bounded_String;
- BString_20 : BS20.Bounded_String := BS20.Null_Bounded_String;
- BString_40 : BS40.Bounded_String := BS40.Null_Bounded_String;
- BString_80 : BS80.Bounded_String := BS80.Null_Bounded_String;
-
-
- begin
-
- -- Function Index.
-
- if BS40.Index(BS40.To_Bounded_String("Package Strings.Bounded"),
- Pattern => "s.b",
- Going => Ada.Strings.Forward,
- Mapping => Map_To_Lower_Case_Ptr) /= 15 or
- BS80.Index(BS80.To_Bounded_String("STRING TRANSLATIONS SUBPROGRAMS"),
- "tr",
- Mapping => Map_To_Lower_Case_Ptr) /= 2 or
- BS20.Index(BS20.To_Bounded_String("maximum number"),
- "um",
- Ada.Strings.Backward,
- Map_To_Lower_Case_Ptr) /= 10 or
- BS80.Index(BS80.To_Bounded_String("CoMpLeTeLy MiXeD CaSe StRiNg"),
- "MIXED CASE STRING",
- Ada.Strings.Forward,
- Map_To_Upper_Case_Ptr) /= 12 or
- BS40.Index(BS40.To_Bounded_String("STRING WITH NO MATCHING PATTERN"),
- "WITH",
- Ada.Strings.Backward,
- Map_To_Lower_Case_Ptr) /= 0 or
- BS80.Index(BS80.To_Bounded_String("THIS STRING IS IN UPPER CASE"),
- "I",
- Ada.Strings.Backward,
- Map_To_Upper_Case_Ptr) /= 16 or
- BS1.Index(BS1.Null_Bounded_String,
- "i",
- Mapping => Map_To_Lower_Case_Ptr) /= 0 or
- BS40.Index(BS40.To_Bounded_String("AAABBBaaabbb"),
- "aabb",
- Mapping => Map_To_Lower_Case_Ptr) /= 2 or
- BS80.Index(BS80.To_Bounded_String("WOULD MATCH BUT FOR THE CASE"),
- "WOULD MATCH BUT FOR THE CASE",
- Ada.Strings.Backward,
- Map_To_Lower_Case_Ptr) /= 0
- then
- Report.Failed("Incorrect results from Function Index, using a " &
- "Character Mapping Function parameter");
- end if;
-
-
- -- Function Index, Pattern_Error if Pattern = Null_String
-
- declare
- use BS20;
- TC_Natural : Natural := 1000;
- begin
- TC_Natural := Index(To_Bounded_String("A Valid String"),
- "",
- Ada.Strings.Forward,
- Map_To_Lower_Case_Ptr);
- Report.Failed("Pattern_Error not raised by Function Index when " &
- "given a null pattern string");
- exception
- when Pattern_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function Index " &
- "using a Character_Mapping_Function parameter " &
- "when given a null pattern string");
- end;
-
-
- -- Function Count.
-
- if BS20.Count(BS20.To_Bounded_String("ABABABA"),
- Pattern => "aba",
- Mapping => Map_To_Lower_Case_Ptr) /= 2 or
- BS20.Count(BS20.To_Bounded_String("ABABABA"),
- "ABA",
- Map_To_Lower_Case_Ptr) /= 0 or
- BS40.Count(BS40.To_Bounded_String("This IS a MISmatched issue"),
- "is",
- Map_To_Lower_Case_Ptr) /= 4 or
- BS80.Count(BS80.To_Bounded_String("ABABABA"),
- "ABA",
- Map_To_Upper_Case_Ptr) /= 2 or
- BS40.Count(BS40.To_Bounded_String("This IS a MISmatched issue"),
- "is",
- Map_To_Upper_Case_Ptr) /= 0 or
- BS80.Count(BS80.To_Bounded_String
- ("Peter Piper and his Pickled Peppers"),
- "p",
- Map_To_Lower_Case_Ptr) /= 7 or
- BS20.Count(BS20.To_Bounded_String("She sells sea shells"),
- "s",
- Map_To_Upper_Case_Ptr) /= 0 or
- BS80.Count(BS80.To_Bounded_String("No matches what-so-ever"),
- "matches",
- Map_To_Upper_Case_Ptr) /= 0
- then
- Report.Failed("Incorrect results from Function Count, using " &
- "a Character_Mapping_Function parameter");
- end if;
-
-
- -- Function Count, Pattern_Error if Pattern = Null_String
-
- declare
- use BS80;
- TC_Natural : Natural := 1000;
- begin
- TC_Natural := Count(To_Bounded_String("A Valid String"),
- "",
- Map_To_Lower_Case_Ptr);
- Report.Failed("Pattern_Error not raised by Function Count using " &
- "a Character_Mapping_Function parameter when " &
- "given a null pattern string");
- exception
- when Pattern_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function Count " &
- "using a Character_Mapping_Function parameter " &
- "when given a null pattern string");
- end;
-
-
- -- Function Translate.
-
- if BS40.Translate(BS40.To_Bounded_String("A Mixed Case String"),
- Mapping => Map_To_Lower_Case_Ptr) /=
- BS40.To_Bounded_String("a mixed case string") or
-
- BS20."/="(BS20.Translate(BS20.To_Bounded_String("ALL LOWER CASE"),
- Map_To_Lower_Case_Ptr),
- "all lower case") or
-
- BS20."/="("end with lower case",
- BS20.Translate(
- BS20.To_Bounded_String("end with lower case"),
- Map_To_Lower_Case_Ptr)) or
-
- BS1.Translate(BS1.Null_Bounded_String,
- Map_To_Lower_Case_Ptr) /=
- BS1.Null_Bounded_String or
-
- BS80."/="(BS80.Translate(BS80.To_Bounded_String
- ("start with lower case, end with upper case"),
- Map_To_Upper_Case_Ptr),
- "START WITH LOWER CASE, END WITH UPPER CASE") or
-
- BS40.Translate(BS40.To_Bounded_String("ALL UPPER CASE STRING"),
- Map_To_Upper_Case_Ptr) /=
- BS40.To_Bounded_String("ALL UPPER CASE STRING") or
-
- BS80."/="(BS80.Translate(BS80.To_Bounded_String
- ("LoTs Of MiXeD CaSe ChArAcTeRs In ThE StRiNg"),
- Map_To_Upper_Case_Ptr),
- "LOTS OF MIXED CASE CHARACTERS IN THE STRING")
-
- then
- Report.Failed("Incorrect results from Function Translate, using " &
- "a Character_Mapping_Function parameter");
- end if;
-
-
- -- Procedure Translate.
-
- BString_1 := BS1.To_Bounded_String("A");
-
- BS1.Translate(Source => BString_1, Mapping => Map_To_Lower_Case_Ptr);
-
- if not BS1."="(BString_1, "a") then -- "=" for Bounded_String, String
- Report.Failed("Incorrect result from Procedure Translate - 1");
- end if;
-
- BString_20 := BS20.To_Bounded_String(String_20);
- BS20.Translate(BString_20, Mapping => Map_To_Lower_Case_Ptr);
-
- if BString_20 /= BS20.To_Bounded_String("abcdefghijklmnopqrst") then
- Report.Failed("Incorrect result from Procedure Translate - 2");
- end if;
-
- BString_40 := BS40.To_Bounded_String("String needing highlighting");
- BS40.Translate(BString_40, Map_To_Upper_Case_Ptr);
-
- if not (BString_40 = "STRING NEEDING HIGHLIGHTING") then
- Report.Failed("Incorrect result from Procedure Translate - 3");
- end if;
-
- BString_80 := BS80.Null_Bounded_String;
- BS80.Translate(BString_80, Map_To_Upper_Case_Ptr);
-
- if not (BString_80 = BS80.Null_Bounded_String) then
- Report.Failed("Incorrect result from Procedure Translate - 4");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4027;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4028.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4028.a
deleted file mode 100644
index bc6cac14c5e..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4028.a
+++ /dev/null
@@ -1,331 +0,0 @@
--- CXA4028.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Ada.Strings.Bounded procedures Append, Head, Tail, and
--- Trim, and relational operator functions "=", ">", ">=", "<", "<="
--- with parameter combinations of type String and Bounded_String,
--- produce correct results.
---
--- TEST DESCRIPTION:
--- This test examines the operation of several subprograms from within
--- the Ada.Strings.Bounded package. Four different instantiations of
--- Ada.Strings.Bounded.Generic_Bounded_Length provide packages defined
--- to manipulate bounded strings of lengths 1, 20, 40, and 80.
--- Examples of the above mentioned procedures and relational operators
--- from each of these instantiations are tested, with results compared
--- against expected output.
---
--- Testing of the function versions of many of the subprograms tested
--- here is performed in tests CXA4006-CXA4009.
---
---
--- CHANGE HISTORY:
--- 16 Feb 95 SAIC Initial prerelease version
--- 10 Mar 95 SAIC Incorporated reviewer comments.
--- 15 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
---
---!
-
-with Ada.Exceptions;
-with Ada.Strings.Bounded;
-with Report;
-
-procedure CXA4028 is
-
-begin
-
- Report.Test ("CXA4028", "Check that Ada.Strings.Bounded procedures " &
- "Append, Head, Tail, and Trim, and relational " &
- "operator functions =, >, >=, <, <= with " &
- "parameter combinations of type String and " &
- "Bounded_String, produce correct results");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
- use Ada.Strings;
-
- -- Instantiations of Bounded String generic package.
-
- package BS1 is new Ada.Strings.Bounded.Generic_Bounded_Length(1);
- package BS20 is new Ada.Strings.Bounded.Generic_Bounded_Length(20);
- package BS40 is new Ada.Strings.Bounded.Generic_Bounded_Length(40);
- package BS80 is new Ada.Strings.Bounded.Generic_Bounded_Length(80);
-
- use type BS1.Bounded_String, BS20.Bounded_String,
- BS40.Bounded_String, BS80.Bounded_String;
-
- String_1 : String(1..1) := "A";
- String_20 : String(1..20) := "ABCDEFGHIJKLMNOPQRST";
- String_40 : String(1..40) := "abcdefghijklmnopqrst" & String_20;
- String_80 : String(1..80) := String_40 & String_40;
-
- BString_1 : BS1.Bounded_String := BS1.Null_Bounded_String;
- BString_20 : BS20.Bounded_String := BS20.Null_Bounded_String;
- BString_40 : BS40.Bounded_String := BS40.Null_Bounded_String;
- BString_80 : BS80.Bounded_String := BS80.Null_Bounded_String;
-
- begin
-
- -- Procedure Append.
-
- declare
- use BS1, BS20;
- begin
- Append(Source => BString_1, New_Item => To_Bounded_String("A"));
- Append(BString_1, "B", Ada.Strings.Left);
- Append(BString_1, 'C', Drop => Ada.Strings.Right); -- Drop appended
- -- character.
- if BString_1 /= To_Bounded_String("B") then
- Report.Failed("Incorrect results from BS1 versions of " &
- "procedure Append");
- end if;
-
- Append(BString_20, 'T'); -- Character.
- Append(BString_20, "his string"); -- String.
- Append(BString_20,
- To_Bounded_String(" is complete."), -- Bounded string.
- Drop => Ada.Strings.Right); -- Drop 4 characters.
-
- if BString_20 /= To_Bounded_String("This string is compl") then
- Report.Failed("Incorrect results from BS20 versions of " &
- "procedure Append");
- end if;
- end;
-
-
- -- Operator "=".
-
- BString_40 := BS40.To_Bounded_String(String_40);
- BString_80 := BS80.To_Bounded_String(
- BS40.To_String(BString_40) &
- BS40.To_String(BString_40));
-
- if not (BString_40 = String_40 and -- (Bounded_String, String)
- BS80."="(String_80, BString_80)) -- (String, Bounded_String)
- then
- Report.Failed("Incorrect results from function ""="" with " &
- "string - bounded string parameter combinations");
- end if;
-
-
- -- Operator "<".
-
- BString_1 := BS1.To_Bounded_String("cat", -- string "c" only.
- Drop => Ada.Strings.Right);
- BString_20 := BS20.To_Bounded_String("Santa Claus");
-
- if BString_1 < "C" or -- (Bounded_String, String)
- BS1."<"(BString_1,"c") or -- (Bounded_String, String)
- "x" < BString_1 or -- (String, Bounded_String)
- BString_20 < "Santa " or -- (Bounded_String, String)
- "Santa and his Elves" < BString_20 -- (String, Bounded_String)
- then
- Report.Failed("Incorrect results from function ""<"" with " &
- "string - bounded string parameter combinations");
- end if;
-
-
- -- Operator "<=".
-
- BString_20 := BS20.To_Bounded_String("Sample string");
-
- if BString_20 <= "Sample strin" or -- (Bounded_String, String)
- "sample string" <= BString_20 or -- (String, Bounded_String)
- not("Sample string" <= BString_20) -- (String, Bounded_String)
- then
- Report.Failed("Incorrect results from function ""<="" with " &
- "string - bounded string parameter combinations");
- end if;
-
-
- -- Operator ">".
-
- BString_40 := BS40.To_Bounded_String("A MUCH LONGER SAMPLE STRING.");
-
- if BString_40 > "A much longer sample string" or -- (Bnd_Str, Str)
- String_20 > BS40.To_Bounded_String(String_40) or -- (Str, Bnd_Str)
- BS40.To_Bounded_String("ABCDEFGH") > "abcdefgh" -- (Str, Bnd_Str)
- then
- Report.Failed("Incorrect results from function "">"" with " &
- "string - bounded string parameter combinations");
- end if;
-
-
- -- Operator ">=".
-
- BString_80 := BS80.To_Bounded_String(String_80);
-
- if not (BString_80 >= String_80 and
- BS80.To_Bounded_String("Programming") >= "PROGRAMMING" and
- "test" >= BS80.To_Bounded_String("tess"))
- then
- Report.Failed("Incorrect results from function "">="" with " &
- "string - bounded string parameter combinations");
- end if;
-
-
- -- Procedure Trim
-
- BString_20 := BS20.To_Bounded_String(" Left Spaces ");
- BS20.Trim(Source => BString_20,
- Side => Ada.Strings.Left);
-
- if "Left Spaces " /= BString_20 then
- Report.Failed("Incorrect results from Procedure Trim with " &
- "Side = Left");
- end if;
-
- BString_40 := BS40.To_Bounded_String(" Right Spaces ");
- BS40.Trim(BString_40, Side => Ada.Strings.Right);
-
- if BString_40 /= " Right Spaces" then
- Report.Failed("Incorrect results from Procedure Trim with " &
- "Side = Right");
- end if;
-
- BString_20 := BS20.To_Bounded_String(" Both Sides ");
- BS20.Trim(BString_20, Ada.Strings.Both);
-
- if BString_20 /= BS20.To_Bounded_String("Both Sides") then
- Report.Failed("Incorrect results from Procedure Trim with " &
- "Side = Both");
- end if;
-
- BString_80 := BS80.To_Bounded_String("Centered Spaces");
- BS80.Trim(BString_80, Ada.Strings.Both);
-
- if BString_80 /= BS80.To_Bounded_String("Centered Spaces") then
- Report.Failed("Incorrect results from Procedure Trim with " &
- "no blank spaces on the ends of the string");
- end if;
-
-
- -- Procedure Head
-
- BString_40 := BS40.To_Bounded_String("Test String");
- BS40.Head(Source => BString_40,
- Count => 4); -- Count < Source'Length
-
- if BString_40 /= BS40.To_Bounded_String("Test") then
- Report.Failed("Incorrect results from Procedure Head with " &
- "the Count parameter less than Source'Length");
- end if;
-
- BString_1 := BS1.To_Bounded_String("X");
- BS1.Head(BString_1, BS1.Length(BString_1)); -- Count = Source'Length
-
- if BString_1 /= "X" then
- Report.Failed("Incorrect results from Procedure Head with " &
- "the Count parameter equal to Source'Length");
- end if;
-
- BString_20 := BS20.To_Bounded_String("Sample string");
- BS20.Head(BString_20,
- Count => BS20.Max_Length, -- Count > Source'Length
- Pad => '*');
-
- if BString_20 /= BS20.To_Bounded_String("Sample string*******") then
- Report.Failed("Incorrect results from Procedure Head with " &
- "the Count parameter greater than Source'Length");
- end if;
-
- BString_20 := BS20.To_Bounded_String("Twenty Characters 20");
- BS20.Head(BString_20, 22, Pad => '*', Drop => Ada.Strings.Left);
-
- if BString_20 /= "enty Characters 20**" then
- Report.Failed("Incorrect results from Procedure Head with " &
- "the Count parameter greater than Source'Length, " &
- "and the Drop parameter = Left");
- end if;
-
- BString_20 := BS20.To_Bounded_String("Short String");
- BS20.Head(BString_20, 23, '-', Ada.Strings.Right);
-
- if ("Short String--------") /= BString_20 then
- Report.Failed("Incorrect results from Procedure Head with " &
- "the Count parameter greater than Source'Length, " &
- "and the Drop parameter = Right");
- end if;
-
-
- -- Procedure Tail
-
- BString_40 := BS40.To_Bounded_String("Test String");
- BS40.Tail(Source => BString_40,
- Count => 6); -- Count < Source'Length
-
- if BString_40 /= BS40.To_Bounded_String("String") then
- Report.Failed("Incorrect results from Procedure Tail with " &
- "the Count parameter less than Source'Length");
- end if;
-
- BString_1 := BS1.To_Bounded_String("X");
- BS1.Tail(BString_1, BS1.Length(BString_1)); -- Count = Source'Length
-
- if BString_1 /= "X" then
- Report.Failed("Incorrect results from Procedure Tail with " &
- "the Count parameter equal to Source'Length");
- end if;
-
- BString_20 := BS20.To_Bounded_String("Sample string");
- BS20.Tail(BString_20,
- Count => BS20.Max_Length, -- Count > Source'Length
- Pad => '*');
-
- if BString_20 /= BS20.To_Bounded_String("*******Sample string") then
- Report.Failed("Incorrect results from Procedure Tail with " &
- "the Count parameter greater than Source'Length");
- end if;
-
- BString_20 := BS20.To_Bounded_String("Twenty Characters"); -- Len = 17
- BS20.Tail(BString_20, 22, Pad => '*', Drop => Ada.Strings.Left);
-
- if BString_20 /= "***Twenty Characters" then
- Report.Failed("Incorrect results from Procedure Tail with " &
- "the Count parameter greater than Source'Length, " &
- "and the Drop parameter = Left");
- end if;
-
- BString_20 := BS20.To_Bounded_String("Maximum Length Chars");
- BS20.Tail(BString_20, 23, '-', Ada.Strings.Right);
-
- if ("---Maximum Length Ch") /= BString_20 then
- Report.Failed("Incorrect results from Procedure Tail with " &
- "the Count parameter greater than Source'Length, " &
- "and the Drop parameter = Right");
- end if;
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXA4028;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4029.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4029.a
deleted file mode 100644
index 7140674544a..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4029.a
+++ /dev/null
@@ -1,333 +0,0 @@
--- CXA4029.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functionality found in packages Ada.Strings.Wide_Maps,
--- Ada.Strings.Wide_Bounded, and Ada.Strings.Wide_Maps.Wide_Constants
--- is available and produces correct results.
---
--- TEST DESCRIPTION:
--- This test tests the subprograms found in the
--- Ada.Strings.Wide_Bounded package. It is based on the tests
--- CXA4027-28, which are tests for the complementary "non-wide"
--- packages.
---
--- The functions found in CXA4029_0 provide mapping capability, when
--- used in conjunction with Wide_Character_Mapping_Function objects.
---
---
--- CHANGE HISTORY:
--- 23 Jun 95 SAIC Initial prerelease version.
--- 18 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
---
---!
-
-package CXA4029_0 is
- -- Functions used to supply mapping capability.
- function Map_To_Lower_Case (From : Wide_Character) return Wide_Character;
- function Map_To_Upper_Case (From : Wide_Character) return Wide_Character;
-end CXA4029_0;
-
-with Ada.Characters.Handling;
-package body CXA4029_0 is
- -- Function Map_To_Lower_Case will return the lower case form of
- -- Wide_Characters in the range 'A'..'Z' only, and return the input
- -- wide_character otherwise.
-
- function Map_To_Lower_Case (From : Wide_Character)
- return Wide_Character is
- begin
- return Ada.Characters.Handling.To_Wide_Character(
- Ada.Characters.Handling.To_Lower(
- Ada.Characters.Handling.To_Character(From)));
- end Map_To_Lower_Case;
-
- -- Function Map_To_Upper_Case will return the upper case form of
- -- Wide_Characters in the range 'a'..'z', or whose position is in one
- -- of the ranges 223..246 or 248..255, provided the wide_character has
- -- an upper case form.
-
- function Map_To_Upper_Case (From : Wide_Character)
- return Wide_Character is
- begin
- return Ada.Characters.Handling.To_Wide_Character(
- Ada.Characters.Handling.To_Upper(
- Ada.Characters.Handling.To_Character(From)));
- end Map_To_Upper_Case;
-
-end CXA4029_0;
-
-
-with CXA4029_0;
-with Report;
-with Ada.Characters.Handling;
-with Ada.Characters.Latin_1;
-with Ada.Strings;
-with Ada.Strings.Wide_Maps;
-with Ada.Strings.Wide_Maps.Wide_Constants;
-with Ada.Strings.Wide_Fixed;
-with Ada.Strings.Wide_Bounded;
-
-procedure CXA4029 is
-begin
- Report.Test ("CXA4029",
- "Check that subprograms defined in package " &
- "Ada.Strings.Wide_Bounded produce correct results");
-
- Test_Block:
- declare
-
- package ACL1 renames Ada.Characters.Latin_1;
- package BS1 is new Ada.Strings.Wide_Bounded.Generic_Bounded_Length(1);
- package BS20 is new Ada.Strings.Wide_Bounded.Generic_Bounded_Length(20);
- package BS40 is new Ada.Strings.Wide_Bounded.Generic_Bounded_Length(40);
- package BS80 is new Ada.Strings.Wide_Bounded.Generic_Bounded_Length(80);
-
- subtype LC_Characters is Wide_Character range 'a'..'z';
-
- use Ada.Characters, Ada.Strings;
- use type Wide_Maps.Wide_Character_Set;
- use type BS1.Bounded_Wide_String, BS20.Bounded_Wide_String,
- BS40.Bounded_Wide_String, BS80.Bounded_Wide_String;
-
- TC_String : constant Wide_String := "A Standard String";
-
- BString_1 : BS1.Bounded_Wide_String :=
- BS1.Null_Bounded_Wide_String;
- BString_20 : BS20.Bounded_Wide_String :=
- BS20.Null_Bounded_Wide_String;
- BString_40 : BS40.Bounded_Wide_String :=
- BS40.Null_Bounded_Wide_String;
- BString_80 : BS80.Bounded_Wide_String :=
- BS80.Null_Bounded_Wide_String;
- String_20 : Wide_String(1..20) := "ABCDEFGHIJKLMNOPQRST";
- String_40 : Wide_String(1..40) := "abcdefghijklmnopqrst" &
- String_20;
- String_80 : Wide_String(1..80) := String_40 & String_40;
- TC_String_5 : Wide_String(1..5) := "ABCDE";
-
- -- The following strings are used in examination of the Translation
- -- subprograms.
- New_Character_String : Wide_String(1..10) :=
- Handling.To_Wide_String(
- ACL1.LC_A_Grave & ACL1.LC_A_Ring & ACL1.LC_AE_Diphthong &
- ACL1.LC_C_Cedilla & ACL1.LC_E_Acute & ACL1.LC_I_Circumflex &
- ACL1.LC_Icelandic_Eth & ACL1.LC_N_Tilde &
- ACL1.LC_O_Oblique_Stroke & ACL1.LC_Icelandic_Thorn);
-
- TC_New_Character_String : Wide_String(1..10) :=
- Handling.To_Wide_String(
- ACL1.UC_A_Grave & ACL1.UC_A_Ring & ACL1.UC_AE_Diphthong &
- ACL1.UC_C_Cedilla & ACL1.UC_E_Acute & ACL1.UC_I_Circumflex &
- ACL1.UC_Icelandic_Eth & ACL1.UC_N_Tilde &
- ACL1.UC_O_Oblique_Stroke & ACL1.UC_Icelandic_Thorn);
-
- -- Access objects that will be provided as parameters to the
- -- subprograms.
- Map_To_Lower_Case_Ptr : Wide_Maps.Wide_Character_Mapping_Function :=
- CXA4029_0.Map_To_Lower_Case'Access;
- Map_To_Upper_Case_Ptr : Wide_Maps.Wide_Character_Mapping_Function :=
- CXA4029_0.Map_To_Upper_Case'Access;
-
- begin
-
- -- Testing of functionality found in Package Ada.Strings.Wide_Bounded.
- --
- -- Function Index.
-
- if BS80.Index(BS80.To_Bounded_Wide_String("CoMpLeTeLy MiXeD CaSe"),
- "MIXED CASE",
- Ada.Strings.Forward,
- Map_To_Upper_Case_Ptr) /= 12 or
- BS1.Index(BS1.Null_Bounded_Wide_String,
- "i",
- Mapping => Map_To_Lower_Case_Ptr) /= 0
- then
- Report.Failed("Incorrect results from BND Function Index, going " &
- "in Forward direction, using a Character Mapping " &
- "Function parameter");
- end if;
-
- -- Function Count.
- if BS40.Count(BS40.To_Bounded_Wide_String("This IS a MISmatched issue"),
- "is",
- Map_To_Lower_Case_Ptr) /= 4 or
- BS80.Count(BS80.To_Bounded_Wide_String("ABABABA"),
- "ABA",
- Map_To_Upper_Case_Ptr) /= 2
- then
- Report.Failed("Incorrect results from BND Function Count, using " &
- "a Character_Mapping_Function parameter");
- end if;
-
- -- Function Translate.
- if BS40.Translate(BS40.To_Bounded_Wide_String("A Mixed Case String"),
- Mapping => Map_To_Lower_Case_Ptr) /=
- BS40.To_Bounded_Wide_String("a mixed case string") or
- BS20."/="("end with lower case",
- BS20.Translate(
- BS20.To_Bounded_Wide_String("end with lower case"),
- Map_To_Lower_Case_Ptr))
- then
- Report.Failed("Incorrect results from BND Function Translate, " &
- "using a Character_Mapping_Function parameter");
- end if;
-
- -- Procedure Translate.
- BString_20 := BS20.To_Bounded_Wide_String(String_20);
- BS20.Translate(BString_20, Mapping => Map_To_Lower_Case_Ptr);
- if BString_20 /= BS20.To_Bounded_Wide_String("abcdefghijklmnopqrst")
- then
- Report.Failed("Incorrect result from BND Procedure Translate - 1");
- end if;
-
- BString_80 := BS80.Null_Bounded_Wide_String;
- BS80.Translate(BString_80, Map_To_Upper_Case_Ptr);
- if not (BString_80 = BS80.Null_Bounded_Wide_String) then
- Report.Failed("Incorrect result from BND Procedure Translate - 2");
- end if;
-
- -- Procedure Append.
- declare
- use BS20;
- begin
- BString_20 := BS20.Null_Bounded_Wide_String;
- Append(BString_20, 'T');
- Append(BString_20, "his string");
- Append(BString_20,
- To_Bounded_Wide_String(" is complete."),
- Drop => Ada.Strings.Right); -- Drop 4 characters.
- if BString_20 /= To_Bounded_Wide_String("This string is compl") then
- Report.Failed("Incorrect results from BS20 versions of " &
- "procedure Append");
- end if;
- exception
- when others => Report.Failed("Exception raised in block checking " &
- "BND Procedure Append");
- end;
-
- -- Operator "=".
- BString_40 := BS40.To_Bounded_Wide_String(String_40);
- BString_80 := BS80.To_Bounded_Wide_String(
- BS40.To_Wide_String(BString_40) &
- BS40.To_Wide_String(BString_40));
- if not (BString_40 = String_40 and
- BS80."="(String_80, BString_80)) then
- Report.Failed("Incorrect results from BND Function ""="" with " &
- "string - bounded string parameter combinations");
- end if;
-
- -- Operator "<".
- BString_1 := BS1.To_Bounded_Wide_String("cat",
- Drop => Ada.Strings.Right);
- BString_20 := BS20.To_Bounded_Wide_String("Santa Claus");
- if BString_1 < "C" or
- BS1."<"(BString_1,"c") or
- BS1."<"("x", BString_1) or
- BS20."<"(BString_20,"Santa ") or
- BS20."<"("Santa and his Elves", BString_20)
- then
- Report.Failed("Incorrect results from BND Function ""<"" with " &
- "string - bounded string parameter combinations");
- end if;
-
- -- Operator "<=".
- BString_20 := BS20.To_Bounded_Wide_String("Sample string");
- if BS20."<="(BString_20,"Sample strin") or
- not(BS20."<="("Sample string",BString_20))
- then
- Report.Failed("Incorrect results from BND Function ""<="" with " &
- "string - bounded string parameter combinations");
- end if;
-
- -- Operator ">".
- BString_40 := BS40.To_Bounded_Wide_String(
- "A MUCH LONGER SAMPLE STRING.");
- if BString_40 > "A much longer sample string" or
- BS40.To_Bounded_Wide_String("ABCDEFGH") > "abcdefgh"
- then
- Report.Failed("Incorrect results from BND Function "">"" with " &
- "string - bounded string parameter combinations");
- end if;
-
- -- Operator ">=".
- BString_80 := BS80.To_Bounded_Wide_String(String_80);
- if not (BString_80 >= String_80 and
- BS80.To_Bounded_Wide_String("Programming") >= "PROGRAMMING" and
- BS80.">="("test", BS80.To_Bounded_Wide_String("tess")))
- then
- Report.Failed("Incorrect results from BND Function "">="" with " &
- "string - bounded string parameter combinations");
- end if;
-
- -- Procedure Trim
- BString_20 := BS20.To_Bounded_Wide_String(" Both Sides ");
- BS20.Trim(BString_20, Ada.Strings.Both);
- if BString_20 /= BS20.To_Bounded_Wide_String("Both Sides") then
- Report.Failed("Incorrect results from BND Procedure Trim with " &
- "Side = Both");
- end if;
-
- -- Procedure Head
- BString_40 := BS40.To_Bounded_Wide_String("Test String");
- BS40.Head(Source => BString_40,
- Count => 4); -- Count < Source'Length
- if BString_40 /= BS40.To_Bounded_Wide_String("Test") then
- Report.Failed("Incorrect results from BND Procedure Head with " &
- "the Count parameter less than Source'Length");
- end if;
-
- BString_20 := BS20.To_Bounded_Wide_String("Short String");
- BS20.Head(BString_20, 23, '-', Ada.Strings.Right);
- if BS20.To_Bounded_Wide_String("Short String--------") /= BString_20 then
- Report.Failed("Incorrect results from BND Procedure Head with " &
- "the Count parameter greater than Source'Length, " &
- "and the Drop parameter = Right");
- end if;
-
- -- Procedure Tail
- BString_40 := BS40.To_Bounded_Wide_String("Test String");
- BS40.Tail(Source => BString_40,
- Count => 6);
- if BString_40 /= BS40.To_Bounded_Wide_String("String") then
- Report.Failed("Incorrect results from BND Procedure Tail with " &
- "the Count parameter less than Source'Length");
- end if;
-
- BString_20 := BS20.To_Bounded_Wide_String("Maximum Length Chars");
- BS20.Tail(BString_20, 23, '-', Ada.Strings.Right);
- if BS20.To_Bounded_Wide_String("---Maximum Length Ch") /= BString_20 then
- Report.Failed("Incorrect results from BND Procedure Tail with " &
- "the Count parameter greater than Source'Length, " &
- "and the Drop parameter = Right");
- end if;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4029;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4030.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4030.a
deleted file mode 100644
index 475d0089921..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4030.a
+++ /dev/null
@@ -1,414 +0,0 @@
--- CXA4030.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Ada.Strings.Unbounded versions of subprograms Translate
--- (procedure and function), Index, and Count, which use a
--- Maps.Character_Mapping_Function input parameter, produce correct
--- results.
---
--- TEST DESCRIPTION:
--- This test examines the operation of the four subprograms contained
--- in the Ada.Strings.Unbounded package that use a
--- Character_Mapping_Function parameter to provide the mapping
--- capability.
--- Two Character_Mapping_Function objects are defined that reference
--- subprograms contained in the Ada.Characters.Handling package;
--- To_Lower will return the lower-case form of the character provided
--- as the input parameter, To_Upper will return the upper-case form
--- of the character input parameter (provided there is an upper-case
--- form).
--- In several instances in this test, the character handling functions
--- are referenced directly in the parameter list of the subprograms
--- under test, demonstrating another form of expected common usage.
---
--- Results of all subprograms are compared with expected results.
---
--- This test, when taken in conjunction with tests CXA4010, CXA4011,
--- CXA4031, and CXA4032 will constitute a test of all the functionality
--- contained in package Ada.Strings.Unbounded. This test uses a variety
--- of the subprograms defined in the unbounded string package in ways
--- typical of common usage.
---
---
--- CHANGE HISTORY:
--- 21 Feb 95 SAIC Initial prerelease version
--- 21 Apr 95 SAIC Modified header commentary.
---
---!
-
-with Ada.Strings.Unbounded;
-with Ada.Strings.Maps;
-with Ada.Characters.Handling;
-with Ada.Characters.Latin_1;
-with Report;
-
-procedure CXA4030 is
-
-begin
-
- Report.Test ("CXA4030", "Check that Ada.Strings.Unbounded versions " &
- "of subprograms Translate (procedure and " &
- "function), Index, and Count, which use a " &
- "Maps.Character_Mapping_Function input " &
- "parameter, produce correct results");
-
- Test_Block:
- declare
-
- package Unb renames Ada.Strings.Unbounded;
- use type Unb.Unbounded_String;
- use Ada.Strings;
- use Ada.Characters;
-
-
- -- The following strings are used in examination of the Translation
- -- subprograms.
-
- New_Character_String : Unb.Unbounded_String :=
- Unb.To_Unbounded_String(
- Latin_1.LC_A_Grave &
- Latin_1.LC_A_Ring &
- Latin_1.LC_AE_Diphthong &
- Latin_1.LC_C_Cedilla &
- Latin_1.LC_E_Acute &
- Latin_1.LC_I_Circumflex &
- Latin_1.LC_Icelandic_Eth &
- Latin_1.LC_N_Tilde &
- Latin_1.LC_O_Oblique_Stroke &
- Latin_1.LC_Icelandic_Thorn);
-
-
- TC_New_Character_String : Unb.Unbounded_String :=
- Unb.To_Unbounded_String(
- Latin_1.UC_A_Grave &
- Latin_1.UC_A_Ring &
- Latin_1.UC_AE_Diphthong &
- Latin_1.UC_C_Cedilla &
- Latin_1.UC_E_Acute &
- Latin_1.UC_I_Circumflex &
- Latin_1.UC_Icelandic_Eth &
- Latin_1.UC_N_Tilde &
- Latin_1.UC_O_Oblique_Stroke &
- Latin_1.UC_Icelandic_Thorn);
-
-
- -- In this test, access objects are defined to refer to two functions
- -- from the Ada.Characters.Handling package. These access objects
- -- will be provided as parameters to the subprograms under test.
- -- Note: There will be several examples in this test of these character
- -- handling functions being referenced directly within the
- -- parameter list of the subprograms under test.
-
- Map_To_Lower_Case_Ptr : Maps.Character_Mapping_Function :=
- Handling.To_Lower'Access;
-
- Map_To_Upper_Case_Ptr : Maps.Character_Mapping_Function :=
- Handling.To_Upper'Access;
-
- begin
-
- -- Function Index, Forward direction search.
- -- Note: Several of the following cases use the default value
- -- Forward for the Going parameter.
-
- if Unb.Index(Source => Unb.To_Unbounded_String(
- "The library package Strings.Unbounded"),
- Pattern => "unb",
- Going => Ada.Strings.Forward,
- Mapping => Map_To_Lower_Case_Ptr) /= 29 or
-
- Unb.Index(Unb.To_Unbounded_String(
- "THE RAIN IN SPAIN FALLS MAINLY ON THE PLAIN"),
- "ain",
- Mapping => Map_To_Lower_Case_Ptr) /= 6 or
-
- Unb.Index(Unb.To_Unbounded_String("maximum number"),
- "um",
- Ada.Strings.Forward,
- Handling.To_Lower'Access) /= 6 or
-
- Unb.Index(Unb.To_Unbounded_String("CoMpLeTeLy MiXeD CaSe StRiNg"),
- "MIXED CASE STRING",
- Ada.Strings.Forward,
- Map_To_Upper_Case_Ptr) /= 12 or
-
- Unb.Index(Unb.To_Unbounded_String(
- "STRING WITH NO MATCHING PATTERNS"),
- "WITH",
- Mapping => Map_To_Lower_Case_Ptr) /= 0 or
-
- Unb.Index(Unb.To_Unbounded_String("THIS STRING IS IN UPPER CASE"),
- "IS",
- Ada.Strings.Forward,
- Handling.To_Upper'Access) /= 3 or
-
- Unb.Index(Unb.Null_Unbounded_String,
- "is",
- Mapping => Map_To_Lower_Case_Ptr) /= 0 or
-
- Unb.Index(Unb.To_Unbounded_String("AAABBBaaabbb"),
- "aabb",
- Mapping => Handling.To_Lower'Access) /= 2
- then
- Report.Failed("Incorrect results from Function Index, going " &
- "in Forward direction, using a Character Mapping " &
- "Function parameter");
- end if;
-
-
-
- -- Function Index, Backward direction search.
-
- if Unb.Index(Unb.To_Unbounded_String("Case of a Mixed Case String"),
- "case",
- Ada.Strings.Backward,
- Map_To_Lower_Case_Ptr) /= 17 or
-
- Unb.Index(Unb.To_Unbounded_String("Case of a Mixed Case String"),
- "CASE",
- Ada.Strings.Backward,
- Mapping => Map_To_Upper_Case_Ptr) /= 17 or
-
- Unb.Index(Unb.To_Unbounded_String("rain, Rain, and more RAIN"),
- "rain",
- Ada.Strings.Backward,
- Handling.To_Lower'Access) /= 22 or
-
- Unb.Index(Unb.To_Unbounded_String("RIGHT place, right time"),
- "RIGHT",
- Ada.Strings.Backward,
- Handling.To_Upper'Access) /= 14 or
-
- Unb.Index(Unb.To_Unbounded_String("WOULD MATCH BUT FOR THE CASE"),
- "WOULD MATCH BUT FOR THE CASE",
- Going => Ada.Strings.Backward,
- Mapping => Map_To_Lower_Case_Ptr) /= 0
- then
- Report.Failed("Incorrect results from Function Index, going " &
- "in Backward direction, using a Character Mapping " &
- "Function parameter");
- end if;
-
-
-
- -- Function Index, Pattern_Error if Pattern = Null_String
-
- declare
- use Unbounded;
- Null_String : constant String := "";
- TC_Natural : Natural := 1000;
- begin
- TC_Natural := Index(To_Unbounded_String("A Valid Unbounded String"),
- Null_String,
- Going => Ada.Strings.Forward,
- Mapping => Handling.To_Lower'Access);
- Report.Failed("Pattern_Error not raised by Function Index when " &
- "given a null pattern string");
- exception
- when Pattern_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function Index " &
- "using a Character Mapping Function parameter " &
- "when given a null pattern string");
- end;
-
-
-
- -- Function Count.
-
- if Unb.Count(Source => Unb.To_Unbounded_String("ABABABA"),
- Pattern => "aba",
- Mapping => Map_To_Lower_Case_Ptr) /= 2 or
-
- Unb.Count(Unb.To_Unbounded_String("ABABABA"),
- "ABA",
- Mapping => Map_To_Lower_Case_Ptr) /= 0 or
-
- Unb.Count(Unb.To_Unbounded_String("This IS a MISmatched issue"),
- "is",
- Handling.To_Lower'Access) /= 4 or
-
- Unb.Count(Unb.To_Unbounded_String("ABABABA"),
- "ABA",
- Map_To_Upper_Case_Ptr) /= 2 or
-
- Unb.Count(Unb.To_Unbounded_String("This IS a MISmatched issue"),
- "is",
- Mapping => Map_To_Upper_Case_Ptr) /= 0 or
-
- Unb.Count(Unb.To_Unbounded_String(
- "She sells sea shells by the sea shore"),
- "s",
- Handling.To_Lower'Access) /= 8 or
-
- Unb.Count(Unb.Null_Unbounded_String,
- "match",
- Map_To_Upper_Case_Ptr) /= 0
- then
- Report.Failed("Incorrect results from Function Count, using " &
- "a Character Mapping Function parameter");
- end if;
-
-
-
- -- Function Count, Pattern_Error if Pattern = Null_String
-
- declare
- use Ada.Strings.Unbounded;
- Null_Pattern_String : constant String := "";
- TC_Natural : Natural := 1000;
- begin
- TC_Natural := Count(To_Unbounded_String("A Valid String"),
- Null_Pattern_String,
- Map_To_Lower_Case_Ptr);
- Report.Failed("Pattern_Error not raised by Function Count using " &
- "a Character Mapping Function parameter when " &
- "given a null pattern string");
- exception
- when Pattern_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function Count " &
- "using a Character Mapping Function parameter " &
- "when given a null pattern string");
- end;
-
-
-
- -- Function Translate.
-
- if Unb.Translate(Source => Unb.To_Unbounded_String(
- "A Sample Mixed Case String"),
- Mapping => Map_To_Lower_Case_Ptr) /=
- Unb.To_Unbounded_String("a sample mixed case string") or
-
- Unb.Translate(Unb.To_Unbounded_String("ALL LOWER CASE"),
- Handling.To_Lower'Access) /=
- Unb.To_Unbounded_String("all lower case") or
-
- Unb.Translate(Unb.To_Unbounded_String("end with lower case"),
- Map_To_Lower_Case_Ptr) /=
- Unb.To_Unbounded_String("end with lower case") or
-
- Unb.Translate(Unb.Null_Unbounded_String,
- Handling.To_Lower'Access) /=
- Unb.Null_Unbounded_String or
-
- Unb.Translate(Unb.To_Unbounded_String("start with lower case"),
- Map_To_Upper_Case_Ptr) /=
- Unb.To_Unbounded_String("START WITH LOWER CASE") or
-
- Unb.Translate(Unb.To_Unbounded_String("ALL UPPER CASE STRING"),
- Handling.To_Upper'Access) /=
- Unb.To_Unbounded_String("ALL UPPER CASE STRING") or
-
- Unb.Translate(Unb.To_Unbounded_String(
- "LoTs Of MiXeD CaSe ChArAcTeRs"),
- Map_To_Upper_Case_Ptr) /=
- Unb.To_Unbounded_String("LOTS OF MIXED CASE CHARACTERS") or
-
- Unb.Translate(New_Character_String,
- Handling.To_Upper'Access) /=
- TC_New_Character_String
-
- then
- Report.Failed("Incorrect results from Function Translate, using " &
- "a Character Mapping Function parameter");
- end if;
-
-
-
- -- Procedure Translate.
-
- declare
-
- use Ada.Strings.Unbounded;
- use Ada.Characters.Handling;
-
- Str_1 : Unbounded_String :=
- To_Unbounded_String("AN ALL UPPER CASE STRING");
- Str_2 : Unbounded_String :=
- To_Unbounded_String("A Mixed Case String");
- Str_3 : Unbounded_String :=
- To_Unbounded_String("a string with lower case letters");
- TC_Str_1 : constant Unbounded_String := Str_1;
- TC_Str_3 : constant Unbounded_String := Str_3;
-
- begin
-
- Translate(Source => Str_1, Mapping => Map_To_Lower_Case_Ptr);
-
- if Str_1 /= To_Unbounded_String("an all upper case string") then
- Report.Failed("Incorrect result from Procedure Translate - 1");
- end if;
-
- Translate(Source => Str_1, Mapping => Map_To_Upper_Case_Ptr);
-
- if Str_1 /= TC_Str_1 then
- Report.Failed("Incorrect result from Procedure Translate - 2");
- end if;
-
- Translate(Str_2, Mapping => Map_To_Lower_Case_Ptr);
-
- if Str_2 /= To_Unbounded_String("a mixed case string") then
- Report.Failed("Incorrect result from Procedure Translate - 3");
- end if;
-
- Translate(Str_2, Mapping => To_Upper'Access);
-
- if Str_2 /= To_Unbounded_String("A MIXED CASE STRING") then
- Report.Failed("Incorrect result from Procedure Translate - 4");
- end if;
-
- Translate(Str_3, To_Lower'Access);
-
- if Str_3 /= TC_Str_3 then
- Report.Failed("Incorrect result from Procedure Translate - 5");
- end if;
-
- Translate(Str_3, To_Upper'Access);
-
- if Str_3 /=
- To_Unbounded_String("A STRING WITH LOWER CASE LETTERS")
- then
- Report.Failed("Incorrect result from Procedure Translate - 6");
- end if;
-
- Translate(New_Character_String, Map_To_Upper_Case_Ptr);
-
- if New_Character_String /= TC_New_Character_String then
- Report.Failed("Incorrect result from Procedure Translate - 6");
- end if;
-
- end;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4030;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4031.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4031.a
deleted file mode 100644
index 91bc68ce6e7..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4031.a
+++ /dev/null
@@ -1,291 +0,0 @@
--- CXA4031.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Strings.Unbounded
--- are available, and that they produce correct results. Specifically,
--- check the functions To_Unbounded_String (version with Length
--- parameter), "=", "<", "<=", ">", ">=" (all with String-Unbounded
--- String parameter mix), as well as three versions of Procedure Append.
---
--- TEST DESCRIPTION:
--- This test demonstrates the uses of many of the subprograms defined
--- in package Ada.Strings.Unbounded for use with unbounded strings.
--- The test simulates how unbounded strings could be processed in a
--- user environment, using the subprograms provided in this package.
---
--- This test, when taken in conjunction with tests CXA4010, CXA4011,
--- CXA4030, and CXA4032 will constitute a test of all the functionality
--- contained in package Ada.Strings.Unbounded. This test uses a variety
--- of the subprograms defined in the unbounded string package in ways
--- typical of common usage.
---
---
--- CHANGE HISTORY:
--- 27 Feb 95 SAIC Initial prerelease version.
--- 18 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
---
---!
-
-with Report;
-with Ada.Exceptions;
-with Ada.Strings.Maps;
-with Ada.Strings.Unbounded;
-
-procedure CXA4031 is
-begin
-
- Report.Test ("CXA4031", "Check that the subprograms defined in " &
- "package Ada.Strings.Unbounded are available, " &
- "and that they produce correct results");
-
- Test_Block:
- declare
-
- package Unb renames Ada.Strings.Unbounded;
- use Unb;
- use Ada.Exceptions;
-
- subtype LC_Characters is Character range 'a'..'z';
-
- Null_String : constant String := "";
- TC_String : constant String := "A Standard String";
-
- TC_Unb_String,
- TC_New_Unb_String : Unb.Unbounded_String := Unb.Null_Unbounded_String;
-
- begin
-
- -- Function To_Unbounded_String (version with Length parameter)
- -- returns an unbounded string that represents an uninitialized String
- -- whose length is Length.
- -- Note: Unbounded_String length can vary conceptually between 0 and
- -- Natural'Last.
-
- if Unb.Length(Unb.To_Unbounded_String(Length => 10)) /= 10 or
- Unb.Length(Unb.To_Unbounded_String(1)) /= 1 or
- Unb.Length(Unb.To_Unbounded_String(0)) /= 0 or
- Unb.Length(Unb."&"(Unb.To_Unbounded_String(Length => 10),
- Unb."&"(Unb.To_Unbounded_String(1),
- Unb.To_Unbounded_String(0) ))) /= 10+1+0
- then
- Report.Failed
- ("Incorrect results from Function To_Unbounded_String with " &
- "Length parameter");
- end if;
-
-
- -- Procedure Append (Unbounded - Unbounded)
- -- Note: For each of the Append procedures, the resulting string
- -- represented by the Source parameter is given by the
- -- concatenation of the original value of Source and the value
- -- of New_Item.
-
- TC_Unb_String := Unb.To_Unbounded_String("Sample string of length L");
- TC_New_Unb_String := Unb.To_Unbounded_String(" and then some");
-
- Unb.Append(Source => TC_Unb_String, New_Item => TC_New_Unb_String);
-
- if TC_Unb_String /=
- Unb.To_Unbounded_String("Sample string of length L and then some")
- then
- Report.Failed("Incorrect results from Procedure Append with " &
- "unbounded string parameters - 1");
- end if;
-
-
- TC_Unb_String := Unb.To_Unbounded_String("Sample string of length L");
- TC_New_Unb_String := Unb.Null_Unbounded_String;
-
- Unb.Append(TC_Unb_String, TC_New_Unb_String);
-
- if TC_Unb_String /=
- Unb.To_Unbounded_String("Sample string of length L")
- then
- Report.Failed("Incorrect results from Procedure Append with " &
- "unbounded string parameters - 2");
- end if;
-
-
- TC_Unb_String := Unb.Null_Unbounded_String;
-
- Unb.Append(TC_Unb_String,
- Unb.To_Unbounded_String("New Unbounded String"));
-
- if TC_Unb_String /=
- Unb.To_Unbounded_String("New Unbounded String")
- then
- Report.Failed("Incorrect results from Procedure Append with " &
- "unbounded string parameters - 3");
- end if;
-
-
- -- Procedure Append (Unbounded - String)
-
- TC_Unb_String := Unb.To_Unbounded_String("An Unbounded String and ");
-
- Unb.Append(Source => TC_Unb_String, New_Item => TC_String);
-
- if TC_Unb_String /=
- Unb.To_Unbounded_String("An Unbounded String and A Standard String")
- then
- Report.Failed("Incorrect results from Procedure Append with " &
- "an unbounded string parameter and a string " &
- "parameter - 1");
- end if;
-
-
- TC_Unb_String := Unb.To_Unbounded_String("An Unbounded String");
-
- Unb.Append(TC_Unb_String, New_Item => Null_String);
-
- if TC_Unb_String /=
- Unb.To_Unbounded_String("An Unbounded String")
- then
- Report.Failed("Incorrect results from Procedure Append with " &
- "an unbounded string parameter and a string " &
- "parameter - 2");
- end if;
-
-
- TC_Unb_String := Unb.Null_Unbounded_String;
-
- Unb.Append(TC_Unb_String, TC_String);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("A Standard String") then
- Report.Failed("Incorrect results from Procedure Append with " &
- "an unbounded string parameter and a string " &
- "parameter - 3");
- end if;
-
-
- -- Procedure Append (Unbounded - Character)
-
- TC_Unb_String := Unb.To_Unbounded_String("Lower Case = ");
-
- for i in LC_Characters'Range loop
- Unb.Append(Source => TC_Unb_String, New_Item => LC_Characters(i));
- end loop;
-
- if TC_Unb_String /=
- Unb.To_Unbounded_String("Lower Case = abcdefghijklmnopqrstuvwxyz")
- then
- Report.Failed("Incorrect results from Procedure Append with " &
- "an unbounded string parameter and a character " &
- "parameter - 1");
- end if;
-
-
- TC_Unb_String := Unb.Null_Unbounded_String;
-
- Unb.Append(TC_Unb_String, New_Item => 'a');
-
- if TC_Unb_String /= Unb.To_Unbounded_String("a") then
- Report.Failed("Incorrect results from Procedure Append with " &
- "an unbounded string parameter and a character " &
- "parameter - 2");
- end if;
-
-
- -- Function "="
-
- TC_Unb_String := Unb.To_Unbounded_String(TC_String);
-
- if not (TC_Unb_String = TC_String) or -- (Unb_Str, Str)
- not Unb."="("A Standard String", TC_Unb_String) or -- (Str, Unb_Str)
- not ((Unb.Null_Unbounded_String = "") and -- (Unb_Str, Str)
- ("Test String" = -- (Str, Unb_Str)
- Unb.To_Unbounded_String("Test String")))
- then
- Report.Failed("Incorrect results from function ""="" with " &
- "string - unbounded string parameter combinations");
- end if;
-
-
- -- Function "<"
-
- if not ("Extra Space" < Unb.To_Unbounded_String("Extra Space ") and
- Unb.To_Unbounded_String("tess") < "test" and
- Unb.To_Unbounded_String("best") < "test") or
- Unb.Null_Unbounded_String < Null_String or
- " leading blank" < Unb.To_Unbounded_String(" leading blank") or
- "ending blank " < Unb.To_Unbounded_String("ending blank ")
- then
- Report.Failed("Incorrect results from function ""<"" with " &
- "string - unbounded string parameter combinations");
- end if;
-
-
- -- Function "<="
-
- TC_Unb_String := Unb.To_Unbounded_String("Sample string");
-
- if TC_Unb_String <= "Sample strin" or -- (Unb_Str, Str)
- "sample string" <= TC_Unb_String or -- (Str, Unb_Str)
- not(Unb.Null_Unbounded_String <= "") or -- (Unb_Str, Str)
- not("Sample string" <= TC_Unb_String) -- (Str, Unb_Str)
- then
- Report.Failed("Incorrect results from function ""<="" with " &
- "string - unbounded string parameter combinations");
- end if;
-
-
- -- Function ">"
-
- TC_Unb_String := Unb.To_Unbounded_String("A MUCH LONGER STRING");
-
- if not ("A much longer string" > TC_Unb_String and
- Unb.To_Unbounded_String(TC_String) > "A Standard Strin" and
- "abcdefgh" > Unb.To_Unbounded_String("ABCDEFGH")) or
- Unb.Null_Unbounded_String > Null_String
- then
- Report.Failed("Incorrect results from function "">"" with " &
- "string - unbounded string parameter combinations");
- end if;
-
-
- -- Function ">="
-
- TC_Unb_String := Unb.To_Unbounded_String(TC_String);
-
- if not (TC_Unb_String >= TC_String and
- Null_String >= Unb.Null_Unbounded_String and
- "test" >= Unb.To_Unbounded_String("tess") and
- Unb.To_Unbounded_String("Programming") >= "PROGRAMMING")
- then
- Report.Failed("Incorrect results from function "">="" with " &
- "string - unbounded string parameter combinations");
- end if;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXA4031;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4032.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4032.a
deleted file mode 100644
index 031d01c6cb7..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4032.a
+++ /dev/null
@@ -1,457 +0,0 @@
--- CXA4032.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that procedures defined in package Ada.Strings.Unbounded
--- are available, and that they produce correct results. Specifically,
--- check the procedures Replace_Slice, Insert, Overwrite, Delete,
--- Trim (2 versions), Head, and Tail.
---
--- TEST DESCRIPTION:
--- This test demonstrates the uses of many of the procedures defined
--- in package Ada.Strings.Unbounded for use with unbounded strings.
--- The test simulates how unbounded strings could be processed in a
--- user environment, using the procedures provided in this package.
---
--- This test, when taken in conjunction with tests CXA4010, CXA4011,
--- CXA4030, and CXA4031 will constitute a test of all the functionality
--- contained in package Ada.Strings.Unbounded. This test uses a variety
--- of the procedures defined in the unbounded string package in ways
--- typical of common usage.
---
---
--- CHANGE HISTORY:
--- 02 Mar 95 SAIC Initial prerelease version.
---
---!
-
-with Report;
-with Ada.Strings;
-with Ada.Strings.Maps;
-with Ada.Strings.Maps.Constants;
-with Ada.Strings.Unbounded;
-
-procedure CXA4032 is
-begin
-
- Report.Test ("CXA4032", "Check that the subprograms defined in " &
- "package Ada.Strings.Unbounded are available, " &
- "and that they produce correct results");
-
- Test_Block:
- declare
-
- package Unb renames Ada.Strings.Unbounded;
- use Unb;
- use Ada.Strings;
-
- TC_Null_String : constant String := "";
- TC_String_5 : String(1..5) := "ABCDE";
-
- TC_Unb_String : Unb.Unbounded_String :=
- Unb.To_Unbounded_String("Test String");
-
- begin
-
- -- Procedure Replace_Slice
-
- begin -- Low > Source'Last+1
- Unb.Replace_Slice(Source => TC_Unb_String,
- Low => Unb.Length(TC_Unb_String) + 2,
- High => Unb.Length(TC_Unb_String),
- By => TC_String_5);
- Report.Failed("Index_Error not raised by Replace_Slice when Low " &
- "> Source'Last+1");
- exception
- when Index_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Replace_Slice" &
- "when Low > Source'Last+1");
- end;
-
- -- High >= Low
-
- TC_Unb_String := Unb.To_Unbounded_String("Test String");
-
- Unb.Replace_Slice(TC_Unb_String, 5, 5, TC_String_5);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("TestABCDEString") then
- Report.Failed("Incorrect results from Replace_Slice - 1");
- end if;
-
- Unb.Replace_Slice(TC_Unb_String, 1, 4, TC_String_5);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("ABCDEABCDEString") then
- Report.Failed("Incorrect results from Replace_Slice - 2");
- end if;
-
- Unb.Replace_Slice(TC_Unb_String,
- 11,
- Unb.Length(TC_Unb_String),
- TC_Null_String);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("ABCDEABCDE") then
- Report.Failed("Incorrect results from Replace_Slice - 3");
- end if;
-
- -- High < Low
-
- Unb.Replace_Slice(TC_Unb_String, Low => 4, High => 1, By => "xxx");
-
- if TC_Unb_String /= Unb.To_Unbounded_String("ABCxxxDEABCDE") then
- Report.Failed("Incorrect results from Replace_Slice - 4");
- end if;
-
- Unb.Replace_Slice(TC_Unb_String, Low => 1, High => 0, By => "yyy");
-
- if TC_Unb_String /= Unb.To_Unbounded_String("yyyABCxxxDEABCDE") then
- Report.Failed("Incorrect results from Replace_Slice - 5");
- end if;
-
- Unb.Replace_Slice(TC_Unb_String,
- Unb.Length(TC_Unb_String) + 1,
- Unb.Length(TC_Unb_String),
- By => "zzz");
-
- if TC_Unb_String /= Unb.To_Unbounded_String("yyyABCxxxDEABCDEzzz") then
- Report.Failed("Incorrect results from Replace_Slice - 6");
- end if;
-
-
- -- Procedure Insert
-
- TC_Unb_String := Unb.To_Unbounded_String("Test String");
-
- begin -- Before not in Source'First..Source'Last + 1
- Unb.Insert(Source => TC_Unb_String,
- Before => Unb.Length(TC_Unb_String) + 2,
- New_Item => TC_String_5);
- Report.Failed("Index_Error not raised by Insert when Before " &
- "not in the range Source'First..Source'Last+1");
- exception
- when Index_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Unexpected exception raised by Insert when Before not in " &
- "the range Source'First..Source'Last+1");
- end;
-
- Unb.Insert(TC_Unb_String, 1, "**");
-
- if TC_Unb_String /= Unb.To_Unbounded_String("**Test String") then
- Report.Failed("Incorrect results from Insert - 1");
- end if;
-
- Unb.Insert(TC_Unb_String, Unb.Length(TC_Unb_String)+1, "**");
-
- if TC_Unb_String /= Unb.To_Unbounded_String("**Test String**") then
- Report.Failed("Incorrect results from Insert - 2");
- end if;
-
- Unb.Insert(TC_Unb_String, 8, "---");
-
- if TC_Unb_String /= Unb.To_Unbounded_String("**Test ---String**") then
- Report.Failed("Incorrect results from Insert - 3");
- end if;
-
- Unb.Insert(TC_Unb_String, 3, TC_Null_String);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("**Test ---String**") then
- Report.Failed("Incorrect results from Insert - 4");
- end if;
-
-
- -- Procedure Overwrite
-
- begin -- Position not in Source'First..Source'Last + 1
- Unb.Overwrite(Source => TC_Unb_String,
- Position => Unb.Length(TC_Unb_String) + 2,
- New_Item => TC_String_5);
- Report.Failed("Index_Error not raised by Overwrite when Position " &
- "not in the range Source'First..Source'Last+1");
- exception
- when Index_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Unexpected exception raised by Overwrite when Position not " &
- "in the range Source'First..Source'Last+1");
- end;
-
- TC_Unb_String := Unb.To_Unbounded_String("Test String");
-
- Unb.Overwrite(Source => TC_Unb_String,
- Position => 1,
- New_Item => "XXXX");
-
- if TC_Unb_String /= Unb.To_Unbounded_String("XXXX String") then
- Report.Failed("Incorrect results from Overwrite - 1");
- end if;
-
- Unb.Overwrite(TC_Unb_String, Unb.Length(TC_Unb_String)+1, "**");
-
- if TC_Unb_String /= Unb.To_Unbounded_String("XXXX String**") then
- Report.Failed("Incorrect results from Overwrite - 2");
- end if;
-
- Unb.Overwrite(TC_Unb_String, 3, TC_Null_String);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("XXXX String**") then
- Report.Failed("Incorrect results from Overwrite - 3");
- end if;
-
- Unb.Overwrite(TC_Unb_String, 1, "abcdefghijklmn");
-
- if TC_Unb_String /= Unb.To_Unbounded_String("abcdefghijklmn") then
- Report.Failed("Incorrect results from Overwrite - 4");
- end if;
-
-
- -- Procedure Delete
-
- TC_Unb_String := Unb.To_Unbounded_String("Test String");
-
- -- From > Through (No change to Source)
-
- Unb.Delete(Source => TC_Unb_String,
- From => Unb.Length(TC_Unb_String),
- Through => Unb.Length(TC_Unb_String)-1);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("Test String") then
- Report.Failed("Incorrect results from Delete - 1");
- end if;
-
- Unb.Delete(TC_Unb_String, 1, 0);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("Test String") then
- Report.Failed("Incorrect results from Delete - 2");
- end if;
-
- -- From <= Through
-
- Unb.Delete(TC_Unb_String, 1, 5);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("String") then
- Report.Failed("Incorrect results from Delete - 3");
- end if;
-
- Unb.Delete(TC_Unb_String, 3, 3);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("Sting") then
- Report.Failed("Incorrect results from Delete - 4");
- end if;
-
-
- -- Procedure Trim
-
- TC_Unb_String := Unb.To_Unbounded_String("No Spaces");
-
- Unb.Trim(Source => TC_Unb_String, Side => Ada.Strings.Both);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("No Spaces") then
- Report.Failed("Incorrect results from Trim - 1");
- end if;
-
- TC_Unb_String := Unb.To_Unbounded_String(" Leading Spaces ");
-
- Unb.Trim(TC_Unb_String, Ada.Strings.Left);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("Leading Spaces ") then
- Report.Failed("Incorrect results from Trim - 2");
- end if;
-
- TC_Unb_String := Unb.To_Unbounded_String(" Ending Spaces ");
-
- Unb.Trim(TC_Unb_String, Ada.Strings.Right);
-
- if TC_Unb_String /= Unb.To_Unbounded_String(" Ending Spaces") then
- Report.Failed("Incorrect results from Trim - 3");
- end if;
-
- TC_Unb_String :=
- Unb.To_Unbounded_String(" Spaces on both ends ");
-
- Unb.Trim(TC_Unb_String, Ada.Strings.Both);
-
- if TC_Unb_String /=
- Unb.To_Unbounded_String("Spaces on both ends")
- then
- Report.Failed("Incorrect results from Trim - 4");
- end if;
-
-
- -- Procedure Trim (with Character Set parameters)
-
- TC_Unb_String := Unb.To_Unbounded_String("lowerCASEletters");
-
- Unb.Trim(Source => TC_Unb_String,
- Left => Ada.Strings.Maps.Constants.Lower_Set,
- Right => Ada.Strings.Maps.Constants.Lower_Set);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("CASE") then
- Report.Failed("Incorrect results from Trim with Sets - 1");
- end if;
-
- TC_Unb_String := Unb.To_Unbounded_String("lowerCASEletters");
-
- Unb.Trim(TC_Unb_String,
- Ada.Strings.Maps.Constants.Upper_Set,
- Ada.Strings.Maps.Constants.Upper_Set);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("lowerCASEletters") then
- Report.Failed("Incorrect results from Trim with Sets - 2");
- end if;
-
- TC_Unb_String := Unb.To_Unbounded_String("012abcdefghGFEDCBA789ab");
-
- Unb.Trim(TC_Unb_String,
- Ada.Strings.Maps.Constants.Hexadecimal_Digit_Set,
- Ada.Strings.Maps.Constants.Hexadecimal_Digit_Set);
-
- if TC_Unb_String /= Unb.To_Unbounded_String("ghG") then
- Report.Failed("Incorrect results from Trim with Sets - 3");
- end if;
-
-
- -- Procedure Head
-
- -- Count <= Source'Length
-
- TC_Unb_String := Unb.To_Unbounded_String("Test String");
-
- Unb.Head(Source => TC_Unb_String,
- Count => 0,
- Pad => '*');
-
- if TC_Unb_String /= Unb.Null_Unbounded_String then
- Report.Failed("Incorrect results from Head - 1");
- end if;
-
- TC_Unb_String := Unb.To_Unbounded_String("Test String");
-
- Unb.Head(Source => TC_Unb_String,
- Count => 4,
- Pad => '*');
-
- if TC_Unb_String /= Unb.To_Unbounded_String("Test") then
- Report.Failed("Incorrect results from Head - 2");
- end if;
-
- TC_Unb_String := Unb.To_Unbounded_String("Test String");
-
- Unb.Head(Source => TC_Unb_String,
- Count => Unb.Length(TC_Unb_String),
- Pad => '*');
-
- if TC_Unb_String /= Unb.To_Unbounded_String("Test String") then
- Report.Failed("Incorrect results from Head - 3");
- end if;
-
- -- Count > Source'Length
-
- TC_Unb_String := Unb.To_Unbounded_String("Test String");
-
- Unb.Head(Source => TC_Unb_String,
- Count => Unb.Length(TC_Unb_String) + 4,
- Pad => '*');
-
- if TC_Unb_String /= Unb.To_Unbounded_String("Test String****") then
- Report.Failed("Incorrect results from Head - 4");
- end if;
-
- TC_Unb_String := Unb.Null_Unbounded_String;
-
- Unb.Head(Source => TC_Unb_String,
- Count => Unb.Length(TC_Unb_String) + 3,
- Pad => '*');
-
- if TC_Unb_String /= Unb.To_Unbounded_String("***") then
- Report.Failed("Incorrect results from Head - 5");
- end if;
-
-
- -- Procedure Tail
-
- -- Count <= Source'Length
-
- TC_Unb_String := Unb.To_Unbounded_String("Test String");
-
- Unb.Tail(Source => TC_Unb_String,
- Count => 0,
- Pad => '*');
-
- if TC_Unb_String /= Unb.Null_Unbounded_String then
- Report.Failed("Incorrect results from Tail - 1");
- end if;
-
- TC_Unb_String := Unb.To_Unbounded_String("Test String");
-
- Unb.Tail(Source => TC_Unb_String,
- Count => 6,
- Pad => '*');
-
- if TC_Unb_String /= Unb.To_Unbounded_String("String") then
- Report.Failed("Incorrect results from Tail - 2");
- end if;
-
- TC_Unb_String := Unb.To_Unbounded_String("Test String");
-
- Unb.Tail(Source => TC_Unb_String,
- Count => Unb.Length(TC_Unb_String),
- Pad => '*');
-
- if TC_Unb_String /= Unb.To_Unbounded_String("Test String") then
- Report.Failed("Incorrect results from Tail - 3");
- end if;
-
- -- Count > Source'Length
-
- TC_Unb_String := Unb.To_Unbounded_String("Test String");
-
- Unb.Tail(Source => TC_Unb_String,
- Count => Unb.Length(TC_Unb_String) + 5,
- Pad => 'x');
-
- if TC_Unb_String /= Unb.To_Unbounded_String("xxxxxTest String") then
- Report.Failed("Incorrect results from Tail - 4");
- end if;
-
- TC_Unb_String := Unb.Null_Unbounded_String;
-
- Unb.Tail(Source => TC_Unb_String,
- Count => Unb.Length(TC_Unb_String) + 3,
- Pad => 'X');
-
- if TC_Unb_String /= Unb.To_Unbounded_String("XXX") then
- Report.Failed("Incorrect results from Tail - 5");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4032;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4033.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4033.a
deleted file mode 100644
index 8f39b4cff05..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4033.a
+++ /dev/null
@@ -1,405 +0,0 @@
--- CXA4033.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functionality found in packages Ada.Strings.Wide_Maps,
--- Ada.Strings.Wide_Unbounded, and Ada.Strings.Wide_Maps.Wide_Constants
--- is available and produces correct results.
---
--- TEST DESCRIPTION:
--- This test tests the subprograms found in the
--- Ada.Strings.Wide_Unbounded package. It is based on the tests
--- CXA4030-32, which are tests for the complementary "non-wide"
--- packages.
---
--- The functions found in CXA4033_0 provide mapping capability, when
--- used in conjunction with Wide_Character_Mapping_Function objects.
---
---
--- CHANGE HISTORY:
--- 23 Jun 95 SAIC Initial prerelease version.
--- 24 Feb 97 PWB.CTA Removed attempt to create wide string of length
--- Natural'Last
---!
-
-package CXA4033_0 is
- -- Functions used to supply mapping capability.
- function Map_To_Lower_Case (From : Wide_Character) return Wide_Character;
- function Map_To_Upper_Case (From : Wide_Character) return Wide_Character;
-end CXA4033_0;
-
-with Ada.Characters.Handling;
-package body CXA4033_0 is
- -- Function Map_To_Lower_Case will return the lower case form of
- -- Wide_Characters in the range 'A'..'Z' only, and return the input
- -- wide_character otherwise.
-
- function Map_To_Lower_Case (From : Wide_Character)
- return Wide_Character is
- begin
- return Ada.Characters.Handling.To_Wide_Character(
- Ada.Characters.Handling.To_Lower(
- Ada.Characters.Handling.To_Character(From)));
- end Map_To_Lower_Case;
-
- -- Function Map_To_Upper_Case will return the upper case form of
- -- Wide_Characters in the range 'a'..'z', or whose position is in one
- -- of the ranges 223..246 or 248..255, provided the wide_character has
- -- an upper case form.
-
- function Map_To_Upper_Case (From : Wide_Character)
- return Wide_Character is
- begin
- return Ada.Characters.Handling.To_Wide_Character(
- Ada.Characters.Handling.To_Upper(
- Ada.Characters.Handling.To_Character(From)));
- end Map_To_Upper_Case;
-
-end CXA4033_0;
-
-
-with CXA4033_0;
-with Report;
-with Ada.Characters.Handling;
-with Ada.Characters.Latin_1;
-with Ada.Strings;
-with Ada.Strings.Wide_Maps;
-with Ada.Strings.Wide_Maps.Wide_Constants;
-with Ada.Strings.Wide_Fixed;
-with Ada.Strings.Wide_Unbounded;
-
-procedure CXA4033 is
-begin
- Report.Test ("CXA4033",
- "Check that subprograms defined in the package " &
- "Ada.Strings.Wide_Unbounded produce correct results");
-
- Test_Block:
- declare
-
- package ACL1 renames Ada.Characters.Latin_1;
- package Unb renames Ada.Strings.Wide_Unbounded;
-
- subtype LC_Characters is Wide_Character range 'a'..'z';
-
- use Ada.Characters, Ada.Strings, Unb;
- use type Wide_Maps.Wide_Character_Set;
-
- TC_String : constant Wide_String := "A Standard String";
-
- String_20 : Wide_String(1..20) := "ABCDEFGHIJKLMNOPQRST";
- String_40 : Wide_String(1..40) := "abcdefghijklmnopqrst" &
- String_20;
- String_80 : Wide_String(1..80) := String_40 & String_40;
- TC_String_5 : Wide_String(1..5) := "ABCDE";
- TC_Unb_String : Unbounded_Wide_String := Null_Unbounded_Wide_String;
-
- -- The following strings are used in examination of the Translation
- -- subprograms.
- New_Character_String : Wide_String(1..10) :=
- Handling.To_Wide_String(
- ACL1.LC_A_Grave & ACL1.LC_A_Ring & ACL1.LC_AE_Diphthong &
- ACL1.LC_C_Cedilla & ACL1.LC_E_Acute & ACL1.LC_I_Circumflex &
- ACL1.LC_Icelandic_Eth & ACL1.LC_N_Tilde &
- ACL1.LC_O_Oblique_Stroke & ACL1.LC_Icelandic_Thorn);
-
- TC_New_Character_String : Wide_String(1..10) :=
- Handling.To_Wide_String(
- ACL1.UC_A_Grave & ACL1.UC_A_Ring & ACL1.UC_AE_Diphthong &
- ACL1.UC_C_Cedilla & ACL1.UC_E_Acute & ACL1.UC_I_Circumflex &
- ACL1.UC_Icelandic_Eth & ACL1.UC_N_Tilde &
- ACL1.UC_O_Oblique_Stroke & ACL1.UC_Icelandic_Thorn);
-
- New_UB_Character_String : Unbounded_Wide_String :=
- To_Unbounded_Wide_String(New_Character_String);
-
- TC_New_UB_Character_String : Unbounded_Wide_String :=
- To_Unbounded_Wide_String(TC_New_Character_String);
-
- -- Access objects that will be provided as parameters to the
- -- subprograms.
- Map_To_Lower_Case_Ptr : Wide_Maps.Wide_Character_Mapping_Function :=
- CXA4033_0.Map_To_Lower_Case'Access;
- Map_To_Upper_Case_Ptr : Wide_Maps.Wide_Character_Mapping_Function :=
- CXA4033_0.Map_To_Upper_Case'Access;
-
- begin
-
- -- Testing functionality found in Package Ada.Strings.Wide_Unbounded.
- --
- -- Function Index.
-
- if Index(To_Unbounded_Wide_String("AAABBBaaabbb"),
- "aabb",
- Mapping => Map_To_Lower_Case_Ptr) /= 2 or
- Index(To_Unbounded_Wide_String("Case of a Mixed Case String"),
- "case",
- Ada.Strings.Backward,
- Map_To_Lower_Case_Ptr) /= 17
- then
- Report.Failed("Incorrect results from Function Index, " &
- "using a Wide Character Mapping Function parameter");
- end if;
-
- -- Function Count.
- if Count(Source => To_Unbounded_Wide_String("ABABABA"),
- Pattern => "aba",
- Mapping => Map_To_Lower_Case_Ptr) /= 2 or
- Count(Null_Unbounded_Wide_String, "mat", Map_To_Upper_Case_Ptr) /= 0
- then
- Report.Failed("Incorrect results from Function Count, using " &
- "a Character Mapping Function parameter");
- end if;
-
- -- Function Translate.
- if Translate(To_Unbounded_Wide_String("A Sample Mixed Case String"),
- Mapping => Map_To_Lower_Case_Ptr) /=
- To_Unbounded_Wide_String("a sample mixed case string") or
- Translate(New_UB_Character_String, Map_To_Upper_Case_Ptr) /=
- TC_New_UB_Character_String
- then
- Report.Failed("Incorrect results from Function Translate, " &
- "using a Character Mapping Function parameter");
- end if;
-
- -- Procedure Translate.
- declare
- use Ada.Characters.Handling;
- Str : Unbounded_Wide_String :=
- To_Unbounded_Wide_String("AN ALL UPPER CASE STRING");
- begin
- Translate(Source => Str, Mapping => Map_To_Lower_Case_Ptr);
- if Str /= To_Unbounded_Wide_String("an all upper case string") then
- Report.Failed("Incorrect result from Procedure Translate 1");
- end if;
-
- Translate(New_UB_Character_String, Map_To_Upper_Case_Ptr);
- if New_UB_Character_String /= TC_New_UB_Character_String then
- Report.Failed("Incorrect result from Procedure Translate 2");
- end if;
- end;
-
- -- Function To_Unbounded_Wide_String (version with Length parameter)
- if Length(To_Unbounded_Wide_String(Length => 10)) /= 10 or
- Length(To_Unbounded_Wide_String(0)) /= 0 or
- Length( To_Unbounded_Wide_String(10) &
- To_Unbounded_Wide_String(1) &
- To_Unbounded_Wide_String(0) ) /= 10 + 1 + 0
- then
- Report.Failed
- ("Incorrect results from Function To_Unbounded_Wide_String " &
- "with Length parameter");
- end if;
-
- -- Procedure Append (Wide_Unbounded - Wide_Unbounded)
- TC_Unb_String := Null_Unbounded_Wide_String;
- Append(TC_Unb_String, To_Unbounded_Wide_String("New Unbounded String"));
- if TC_Unb_String /= To_Unbounded_Wide_String("New Unbounded String")
- then
- Report.Failed("Incorrect results from Procedure Append with " &
- "unbounded wide string parameters");
- end if;
-
-
- -- Procedure Append (Wide_Unbounded - Wide_String)
- TC_Unb_String := To_Unbounded_Wide_String("An Unbounded String and ");
- Append(Source => TC_Unb_String, New_Item => TC_String);
- if TC_Unb_String /=
- To_Unbounded_Wide_String("An Unbounded String and A Standard String")
- then
- Report.Failed("Incorrect results from Procedure Append with " &
- "an unbounded wide string parameter and a wide " &
- "string parameter");
- end if;
-
- -- Procedure Append (Wide_Unbounded - Wide_Character)
- TC_Unb_String := To_Unbounded_Wide_String("Lower Case = ");
- for i in LC_Characters'Range loop
- Append(Source => TC_Unb_String, New_Item => LC_Characters(i));
- end loop;
- if TC_Unb_String /=
- Unb.To_Unbounded_Wide_String
- ("Lower Case = abcdefghijklmnopqrstuvwxyz")
- then
- Report.Failed("Incorrect results from Procedure Append with " &
- "an unbounded wide string parameter and a wide " &
- "character parameter");
- end if;
-
- -- Function "="
- TC_Unb_String := To_Unbounded_Wide_String(TC_String);
- if not (TC_Unb_String = TC_String) or
- not "="("A Standard String", TC_Unb_String) or
- not ((Null_Unbounded_Wide_String = "") and
- ("Test String" = To_Unbounded_Wide_String("Test String")))
- then
- Report.Failed("Incorrect results from Function ""="" with " &
- "wide_string - unbounded wide string parameters");
- end if;
-
- -- Function "<"
- if not ("Extra Space" < To_Unbounded_Wide_String("Extra Space ") and
- To_Unbounded_Wide_String("tess") < "test" and
- To_Unbounded_Wide_String("best") < "test")
- then
- Report.Failed("Incorrect results from Function ""<"" with " &
- "wide string - unbounded wide string parameters");
- end if;
-
- -- Function "<="
- TC_Unb_String := To_Unbounded_Wide_String("Sample string");
- if TC_Unb_String <= "Sample strin" or
- not("Sample string" <= TC_Unb_String)
- then
- Report.Failed("Incorrect results from Function ""<="" with " &
- "wide string - unbounded wide string parameters");
- end if;
-
- -- Function ">"
- TC_Unb_String := To_Unbounded_Wide_String("A MUCH LONGER STRING");
- if not ("A much longer string" > TC_Unb_String and
- To_Unbounded_Wide_String(TC_String) > "A Standard Strin" and
- "abcdefgh" > To_Unbounded_Wide_String("ABCDEFGH"))
- then
- Report.Failed("Incorrect results from Function "">"" with " &
- "wide string - unbounded wide string parameters");
- end if;
-
- -- Function ">="
- TC_Unb_String := To_Unbounded_Wide_String(TC_String);
- if not (TC_Unb_String >= TC_String and
- "test" >= To_Unbounded_Wide_String("tess") and
- To_Unbounded_Wide_String("Programming") >= "PROGRAMMING")
- then
- Report.Failed("Incorrect results from Function "">="" with " &
- "wide string - unbounded wide string parameters");
- end if;
-
- -- Procedure Replace_Slice
- TC_Unb_String := To_Unbounded_Wide_String("Test String");
- Replace_Slice(TC_Unb_String, 5, 5, TC_String_5);
- if TC_Unb_String /= To_Unbounded_Wide_String("TestABCDEString") then
- Report.Failed("Incorrect results from Replace_Slice - 1");
- end if;
-
- Replace_Slice(TC_Unb_String, 1, 4, TC_String_5);
- if TC_Unb_String /= To_Unbounded_Wide_String("ABCDEABCDEString") then
- Report.Failed("Incorrect results from Replace_Slice - 2");
- end if;
-
- -- Procedure Insert
- TC_Unb_String := To_Unbounded_Wide_String("Test String");
- Insert(TC_Unb_String, 1, "**");
- if TC_Unb_String /= To_Unbounded_Wide_String("**Test String") then
- Report.Failed("Incorrect results from Procedure Insert - 1");
- end if;
-
- Insert(TC_Unb_String, Length(TC_Unb_String)+1, "**");
- if TC_Unb_String /= To_Unbounded_Wide_String("**Test String**") then
- Report.Failed("Incorrect results from Procedure Insert - 2");
- end if;
-
- -- Procedure Overwrite
- TC_Unb_String := To_Unbounded_Wide_String("Test String");
- Overwrite(TC_Unb_String, 1, New_Item => "XXXX");
- if TC_Unb_String /= To_Unbounded_Wide_String("XXXX String") then
- Report.Failed("Incorrect results from Procedure Overwrite - 1");
- end if;
-
- Overwrite(TC_Unb_String, Length(TC_Unb_String)+1, "**");
- if TC_Unb_String /= To_Unbounded_Wide_String("XXXX String**") then
- Report.Failed("Incorrect results from Procedure Overwrite - 2");
- end if;
-
- -- Procedure Delete
- TC_Unb_String := To_Unbounded_Wide_String("Test String");
- Delete(TC_Unb_String, 1, 0);
- if TC_Unb_String /= To_Unbounded_Wide_String("Test String") then
- Report.Failed("Incorrect results from Procedure Delete - 1");
- end if;
-
- Delete(TC_Unb_String, 1, 5);
- if TC_Unb_String /= To_Unbounded_Wide_String("String") then
- Report.Failed("Incorrect results from Procedure Delete - 2");
- end if;
-
- -- Procedure Trim
- TC_Unb_String := To_Unbounded_Wide_String(" Leading Spaces ");
- Trim(TC_Unb_String, Ada.Strings.Left);
- if TC_Unb_String /= To_Unbounded_Wide_String("Leading Spaces ") then
- Report.Failed("Incorrect results from Procedure Trim - 1");
- end if;
-
- TC_Unb_String :=
- To_Unbounded_Wide_String(" Spaces on both ends ");
- Trim(TC_Unb_String, Ada.Strings.Both);
- if TC_Unb_String /=
- To_Unbounded_Wide_String("Spaces on both ends")
- then
- Report.Failed("Incorrect results from Procedure Trim - 2");
- end if;
-
- -- Procedure Trim (with Wide_Character_Set parameters)
- TC_Unb_String := To_Unbounded_Wide_String("012abcdefghGFEDCBA789ab");
- Trim(TC_Unb_String,
- Ada.Strings.Wide_Maps.Wide_Constants.Hexadecimal_Digit_Set,
- Ada.Strings.Wide_Maps.Wide_Constants.Hexadecimal_Digit_Set);
- if TC_Unb_String /= To_Unbounded_Wide_String("ghG") then
- Report.Failed("Incorrect results from Procedure Trim with Sets");
- end if;
-
- -- Procedure Head
- TC_Unb_String := To_Unbounded_Wide_String("Test String");
- Head(Source => TC_Unb_String, Count => 0, Pad => '*');
- if TC_Unb_String /= Null_Unbounded_Wide_String then
- Report.Failed("Incorrect results from Procedure Head - 1");
- end if;
-
- TC_Unb_String := To_Unbounded_Wide_String("Test String");
- Head(Source => TC_Unb_String, Count => 4, Pad => '*');
- if TC_Unb_String /= To_Unbounded_Wide_String("Test") then
- Report.Failed("Incorrect results from Procedure Head - 2");
- end if;
-
- -- Procedure Tail
- TC_Unb_String := To_Unbounded_Wide_String("Test String");
- Tail(Source => TC_Unb_String, Count => 0, Pad => '*');
- if TC_Unb_String /= Null_Unbounded_Wide_String then
- Report.Failed("Incorrect results from Procedure Tail - 1");
- end if;
-
- TC_Unb_String := To_Unbounded_Wide_String("Test String");
- Tail(TC_Unb_String, Length(TC_Unb_String) + 5, 'x');
- if TC_Unb_String /= To_Unbounded_Wide_String("xxxxxTest String") then
- Report.Failed("Incorrect results from Procedure Tail - 2");
- end if;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA4033;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa4034.a b/gcc/testsuite/ada/acats/tests/cxa/cxa4034.a
deleted file mode 100644
index a1ed53de0f7..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa4034.a
+++ /dev/null
@@ -1,281 +0,0 @@
--- CXA4034.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Ada.Strings.Bounded.Slice raises Index_Error if
--- High > Length (Source) or Low > Length (Source) + 1.
--- (Defect Report 8652/0049).
---
--- Check that Ada.Strings.Wide_Bounded.Slice raises Index_Error if
--- High > Length (Source) or Low > Length (Source) + 1.
---
--- CHANGE HISTORY:
--- 12 FEB 2001 PHL Initial version
--- 14 MAR 2001 RLB Added Wide_Bounded subtest.
---
---!
-with Ada.Exceptions;
-use Ada.Exceptions;
-with Ada.Strings.Bounded;
-with Ada.Strings.Wide_Bounded;
-use Ada.Strings;
-with Report;
-use Report;
-procedure CXA4034 is
-
- package Bs is new Ada.Strings.Bounded.Generic_Bounded_Length (40);
-
- package WBs is new Ada.Strings.Wide_Bounded.Generic_Bounded_Length (32);
-
- Source : String (Ident_Int (1) .. Ident_Int (30));
-
- Wide_Source : Wide_String (Ident_Int (1) .. Ident_Int (24));
-
- X : Bs.Bounded_String;
-
- WX : WBs.Bounded_Wide_String;
-
-begin
- Test ("CXA4034",
- "Check that Slice raises Index_Error if either Low or High is " &
- "greater than the Length(Source) for Ada.Strings.Bounded and " &
- "Ada.Strings.Wide_Bounded");
-
- -- Fill Source with "ABC..."
- for I in Source'Range loop
- Source (I) := Ident_Char (Character'Val (I +
- Character'Pos ('A') - Source'First));
- end loop;
- -- and W with "ABC..."
- for I in Wide_Source'Range loop
- Wide_Source (I) := Ident_Wide_Char (Wide_Character'Val (I +
- Wide_Character'Pos ('A') - Wide_Source'First));
- end loop;
-
- X := Bs.To_Bounded_String (Source);
-
- begin
- declare
- S : constant String :=
- Bs.Slice (X, Low => Ident_Int (28), High => Ident_Int (41));
- begin
- Failed ("No exception raised by Slice - 1");
- if S = Source then
- Comment ("Don't optimize S");
- end if;
- end;
- exception
- when Index_Error =>
- null; -- Expected exception.
- when E: others =>
- Failed ("Exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 1");
- end;
-
- begin
- declare
- S : constant String :=
- Bs.Slice (X, Low => Ident_Int (8), High => Ident_Int (31));
- begin
- Failed ("No exception raised by Slice - 2");
- if S = Source then
- Comment ("Don't optimize S");
- end if;
- end;
- exception
- when Index_Error =>
- null; -- Expected exception.
- when E: others =>
- Failed ("Exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 2");
- end;
-
- begin
- declare
- S : constant String :=
- Bs.Slice (X, Low => Ident_Int (15), High => Ident_Int (30));
- begin
- if S /= Source(15..30) then
- Failed ("Wrong result - 3");
- end if;
- end;
- exception
- when E: others =>
- Failed ("Exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 3");
- end;
-
- begin
- declare
- S : constant String :=
- Bs.Slice (X, Low => Ident_Int (42), High => Ident_Int (28));
- begin
- Failed ("No exception raised by Slice - 4");
- if S = Source then
- Comment ("Don't optimize S");
- end if;
- end;
- exception
- when Index_Error =>
- null; -- Expected exception.
- when E: others =>
- Failed ("Exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 4");
- end;
-
- begin
- declare
- S : constant String :=
- Bs.Slice (X, Low => Ident_Int (31), High => Ident_Int (28));
- begin
- if S /= "" then
- Failed ("Wrong result - 5");
- end if;
- end;
- exception
- when E: others =>
- Failed ("Exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 5");
- end;
-
- begin
- declare
- S : constant String :=
- Bs.Slice (X, Low => Ident_Int (30), High => Ident_Int (30));
- begin
- if S /= Source(30..30) then
- Failed ("Wrong result - 6");
- end if;
- end;
- exception
- when E: others =>
- Failed ("Exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 6");
- end;
-
- WX := WBs.To_Bounded_Wide_String (Wide_Source);
-
- begin
- declare
- W : constant Wide_String :=
- WBs.Slice (WX, Low => Ident_Int (21), High => Ident_Int (33));
- begin
- Failed ("No exception raised by Slice - 7");
- if W = Wide_Source then
- Comment ("Don't optimize W");
- end if;
- end;
- exception
- when Index_Error =>
- null; -- Expected exception.
- when E: others =>
- Failed ("Exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 7");
- end;
-
- begin
- declare
- W : constant Wide_String :=
- WBs.Slice (WX, Low => Ident_Int (8), High => Ident_Int (25));
- begin
- Failed ("No exception raised by Slice - 8");
- if W = Wide_Source then
- Comment ("Don't optimize W");
- end if;
- end;
- exception
- when Index_Error =>
- null; -- Expected exception.
- when E: others =>
- Failed ("Exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 8");
- end;
-
- begin
- declare
- W : constant Wide_String :=
- WBs.Slice (WX, Low => Ident_Int (15), High => Ident_Int (24));
- begin
- if W /= Wide_Source(15..24) then
- Failed ("Wrong result - 8");
- end if;
- end;
- exception
- when E: others =>
- Failed ("Exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 9");
- end;
-
- begin
- declare
- W : constant Wide_String :=
- WBs.Slice (WX, Low => Ident_Int (36), High => Ident_Int (20));
- begin
- Failed ("No exception raised by Slice - 10");
- if W = Wide_Source then
- Comment ("Don't optimize W");
- end if;
- end;
- exception
- when Index_Error =>
- null; -- Expected exception.
- when E: others =>
- Failed ("Exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 10");
- end;
-
- begin
- declare
- W : constant Wide_String :=
- WBs.Slice (WX, Low => Ident_Int (25), High => Ident_Int (21));
- begin
- if W /= "" then
- Failed ("Wrong result - 11");
- end if;
- end;
- exception
- when E: others =>
- Failed ("Exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 11");
- end;
-
- begin
- declare
- W : constant Wide_String :=
- WBs.Slice (WX, Low => Ident_Int (24), High => Ident_Int (24));
- begin
- if W /= Wide_Source(24..24) then
- Failed ("Wrong result - 12");
- end if;
- end;
- exception
- when E: others =>
- Failed ("Exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E) & " - 12");
- end;
-
- Result;
-end CXA4034;
-
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5011.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5011.a
deleted file mode 100644
index c9a007e524f..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5011.a
+++ /dev/null
@@ -1,471 +0,0 @@
--- CXA5011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for both Float_Random and Discrete_Random packages,
--- the following are true:
--- 1) two objects of type Generator are initialized to the same state.
--- 2) when the Function Reset is used to reset two generators
--- to different time-dependent states, the resulting random values
--- from each generator are different.
--- 3) when the Function Reset uses the same integer initiator
--- to reset two generators to the same state, the resulting random
--- values from each generator are identical.
--- 4) when the Function Reset uses different integer initiator
--- values to reset two generators, the resulting random numbers are
--- different.
---
--- TEST DESCRIPTION:
--- This test evaluates components of the Ada.Numerics.Float_Random and
--- Ada.Numerics.Discrete_Random packages.
--- This test checks to see that objects of type Generator are initialized
--- to the same state. In addition, the functionality of Function Reset is
--- validated.
--- For each of the objectives above, evaluation of the various generators
--- is performed using each of the following techniques. When the states of
--- two generators are to be compared, each state is saved, then
--- transformed to a bounded-string variable. The bounded-strings can
--- then be compared for equality. In this case, matching bounded-strings
--- are evidence that the states of two generators are the same.
--- In addition, two generators are compared by evaluating a series of
--- random numbers they produce. A matching series of random numbers
--- implies that the generators were in the same state prior to producing
--- the numbers.
---
---
--- CHANGE HISTORY:
--- 20 Apr 95 SAIC Initial prerelease version.
--- 07 Jul 95 SAIC Incorporated reviewer comments/suggestions.
--- 22 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 17 Aug 96 SAIC Deleted Subtest #2.
--- 09 Feb 01 RLB Repaired to work on implementations with a 16-bit
--- Integer.
-
---!
-
-with Ada.Exceptions;
-with Ada.Numerics.Float_Random;
-with Ada.Numerics.Discrete_Random;
-with Ada.Strings.Bounded;
-with ImpDef;
-with Report;
-
-procedure CXA5011 is
-begin
-
- Report.Test ("CXA5011", "Check the effect of Function Reset on the " &
- "state of random number generators");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
- use Ada.Numerics;
- use Ada.Strings.Bounded;
-
- -- Declare an modular subtype, and use it to instantiate the discrete
- -- random number generator generic package.
-
- type Discrete_Range is mod 2**(Integer'Size-1);
- package Discrete_Package is new Discrete_Random(Discrete_Range);
-
- -- Declaration of random number generator objects.
-
- Discrete_Generator_1,
- Discrete_Generator_2 : Discrete_Package.Generator;
- Float_Generator_1,
- Float_Generator_2 : Float_Random.Generator;
-
- -- Declaration of bounded string packages instantiated with the
- -- value of Max_Image_Width constant from each random number generator
- -- package, and bounded string variables used to hold the image of
- -- random number generator states.
-
- package Discrete_String_Pack is
- new Generic_Bounded_Length(Discrete_Package.Max_Image_Width);
-
- package Float_String_Pack is
- new Generic_Bounded_Length(Float_Random.Max_Image_Width);
-
- use Discrete_String_Pack, Float_String_Pack;
-
- TC_Seed : Integer;
- TC_Max_Loop_Count : constant Natural := 1000;
- Allowed_Matches : constant Natural := 2;
- --
- -- In a sequence of TC_Max_Loop_Count random numbers that should
- -- not match, some may match by chance. Up to Allowed_Matches
- -- numbers may match before the test is considered to fail.
- --
-
-
- procedure Check_Float_State (Gen_1, Gen_2 : Float_Random.Generator;
- Sub_Test : Integer;
- States_Should_Match : Boolean) is
-
- use type Float_Random.State;
-
- State_1,
- State_2 : Float_Random.State;
-
- State_String_1,
- State_String_2 : Float_String_Pack.Bounded_String :=
- Float_String_Pack.Null_Bounded_String;
- begin
-
- Float_Random.Save(Gen => Gen_1, To_State => State_1);
- Float_Random.Save(Gen_2, State_2);
-
- State_String_1 :=
- Float_String_Pack.To_Bounded_String(Source =>
- Float_Random.Image(Of_State => State_1));
-
- State_String_2 :=
- Float_String_Pack.To_Bounded_String(Float_Random.Image(State_2));
-
- case States_Should_Match is
- when True =>
- if State_1 /= State_2 then
- Report.Failed("Subtest #" & Integer'Image(Sub_Test) &
- " State values from Float generators " &
- "are not the same");
- end if;
- if State_String_1 /= State_String_2 then
- Report.Failed("Subtest #" & Integer'Image(Sub_Test) &
- " State strings from Float generators " &
- "are not the same");
- end if;
- when False =>
- if State_1 = State_2 then
- Report.Failed("Subtest #" & Integer'Image(Sub_Test) &
- " State values from Float generators " &
- "are the same");
- end if;
- if State_String_1 = State_String_2 then
- Report.Failed("Subtest #" & Integer'Image(Sub_Test) &
- " State strings from Float generators " &
- "are the same");
- end if;
- end case;
- end Check_Float_State;
-
-
-
- procedure Check_Discrete_State (Gen_1,
- Gen_2 : Discrete_Package.Generator;
- Sub_Test : Integer;
- States_Should_Match : Boolean) is
-
- use type Discrete_Package.State;
-
- State_1, State_2 : Discrete_Package.State;
-
- State_String_1,
- State_String_2 : Discrete_String_Pack.Bounded_String :=
- Discrete_String_Pack.Null_Bounded_String;
- begin
-
- Discrete_Package.Save(Gen => Gen_1,
- To_State => State_1);
- Discrete_Package.Save(Gen_2, To_State => State_2);
-
- State_String_1 :=
- Discrete_String_Pack.To_Bounded_String(Source =>
- Discrete_Package.Image(Of_State => State_1));
-
- State_String_2 :=
- Discrete_String_Pack.To_Bounded_String(Source =>
- Discrete_Package.Image(Of_State => State_2));
-
- case States_Should_Match is
- when True =>
- if State_1 /= State_2 then
- Report.Failed("Subtest #" & Integer'Image(Sub_Test) &
- " State values from Discrete " &
- "generators are not the same");
- end if;
- if State_String_1 /= State_String_2 then
- Report.Failed("Subtest #" & Integer'Image(Sub_Test) &
- " State strings from Discrete " &
- "generators are not the same");
- end if;
- when False =>
- if State_1 = State_2 then
- Report.Failed("Subtest #" & Integer'Image(Sub_Test) &
- " State values from Discrete " &
- "generators are the same");
- end if;
- if State_String_1 = State_String_2 then
- Report.Failed("Subtest #" & Integer'Image(Sub_Test) &
- " State strings from Discrete " &
- "generators are the same");
- end if;
- end case;
- end Check_Discrete_State;
-
-
-
- procedure Check_Float_Values (Gen_1, Gen_2 : Float_Random.Generator;
- Sub_Test : Integer;
- Values_Should_Match : Boolean) is
- Matches : Natural := 0;
- Check_Failed : Boolean := False;
- begin
- case Values_Should_Match is
- when True =>
- for i in 1..TC_Max_Loop_Count loop
- if Float_Random.Random(Gen_1) /= Float_Random.Random(Gen_2)
- then
- Check_Failed := True;
- exit;
- end if;
- end loop;
- if Check_Failed then
- Report.Failed("Sub_Test # " & Integer'Image(Sub_Test) &
- " Random numbers from Float generators " &
- "Failed check");
- end if;
- when False =>
- for i in 1..TC_Max_Loop_Count loop
- if Float_Random.Random(Gen_1) = Float_Random.Random(Gen_2)
- then
- Matches := Matches + 1;
- end if;
- end loop;
- end case;
-
- if (Values_Should_Match and Check_Failed) or
- (not Values_Should_Match and Matches > Allowed_Matches)
- then
- Report.Failed("Sub_Test # " & Integer'Image(Sub_Test) &
- " Random numbers from Float generators " &
- "Failed check");
- end if;
-
- end Check_Float_Values;
-
-
-
- procedure Check_Discrete_Values (Gen_1,
- Gen_2 : Discrete_Package.Generator;
- Sub_Test : Integer;
- Values_Should_Match : Boolean) is
- Matches : Natural := 0;
- Check_Failed : Boolean := False;
- begin
- case Values_Should_Match is
- when True =>
- for i in 1..TC_Max_Loop_Count loop
- if Discrete_Package.Random(Gen_1) /=
- Discrete_Package.Random(Gen_2)
- then
- Check_Failed := True;
- exit;
- end if;
- end loop;
- when False =>
- for i in 1..TC_Max_Loop_Count loop
- if Discrete_Package.Random(Gen_1) =
- Discrete_Package.Random(Gen_2)
- then
- Matches := Matches + 1;
- end if;
- end loop;
- end case;
-
- if (Values_Should_Match and Check_Failed) or
- (not Values_Should_Match and Matches > Allowed_Matches)
- then
- Report.Failed("Sub_Test # " & Integer'Image(Sub_Test) &
- " Random numbers from Discrete generators " &
- "Failed check");
- end if;
-
- end Check_Discrete_Values;
-
-
-
- begin
-
- Sub_Test_1:
- -- Check that two objects of type Generator are initialized to the
- -- same state.
- begin
-
- -- Since the discrete and float random generators are in the initial
- -- state, using Procedure Save to save the states of the generator
- -- objects, and transforming these states into strings using
- -- Function Image, should yield identical strings.
-
- Check_Discrete_State (Discrete_Generator_1,
- Discrete_Generator_2,
- Sub_Test => 1,
- States_Should_Match => True);
-
- Check_Float_State (Float_Generator_1,
- Float_Generator_2,
- Sub_Test => 1,
- States_Should_Match => True);
-
- -- Since the two random generator objects are in their initial
- -- state, the values produced from each (upon calls to Random)
- -- should be identical.
-
- Check_Discrete_Values (Discrete_Generator_1,
- Discrete_Generator_2,
- Sub_Test => 1,
- Values_Should_Match => True);
-
- Check_Float_Values (Float_Generator_1,
- Float_Generator_2,
- Sub_Test => 1,
- Values_Should_Match => True);
-
- end Sub_Test_1;
-
-
-
- Sub_Test_3:
- -- Check that when the Function Reset uses the same integer
- -- initiator to reset two generators to the same state, the
- -- resulting random values and the state from each generator
- -- are identical.
- declare
- use Discrete_Package, Float_Random;
- begin
-
- -- Reset the generators to the same states, using the version of
- -- Function Reset with both generator parameter and initiator
- -- specified.
-
- TC_Seed := Integer(Random(Discrete_Generator_1));
- Reset(Gen => Discrete_Generator_1, Initiator => TC_Seed);
- Reset(Discrete_Generator_2, Initiator => TC_Seed);
- Reset(Float_Generator_1, TC_Seed);
- Reset(Float_Generator_2, TC_Seed);
-
- -- Since the random generators have been reset to identical states,
- -- bounded string images of these states should yield identical
- -- strings.
-
- Check_Discrete_State (Discrete_Generator_1,
- Discrete_Generator_2,
- Sub_Test => 3,
- States_Should_Match => True);
-
- Check_Float_State (Float_Generator_1,
- Float_Generator_2,
- Sub_Test => 3,
- States_Should_Match => True);
-
- -- Since the random generators have been reset to identical states,
- -- the values produced from each (upon calls to Random) should
- -- be identical.
-
- Check_Discrete_Values (Discrete_Generator_1,
- Discrete_Generator_2,
- Sub_Test => 3,
- Values_Should_Match => True);
-
- Check_Float_Values (Float_Generator_1,
- Float_Generator_2,
- Sub_Test => 3,
- Values_Should_Match => True);
-
- end Sub_Test_3;
-
-
-
- Sub_Test_4:
- -- Check that when the Function Reset uses different integer
- -- initiator values to reset two generators, the resulting random
- -- numbers and states are different.
- begin
-
- -- Reset the generators to different states.
-
- TC_Seed :=
- Integer(Discrete_Package.Random(Discrete_Generator_1));
-
- Discrete_Package.Reset(Gen => Discrete_Generator_1,
- Initiator => TC_Seed);
-
- -- Set the seed value to a different value for the second call
- -- to Reset.
- -- Note: A second call to Random could be made, as above, but that
- -- would not ensure that the resulting seed value was
- -- different from the first.
-
- if TC_Seed /= Integer'Last then
- TC_Seed := TC_Seed + 1;
- else
- TC_Seed := TC_Seed - 1;
- end if;
-
- Discrete_Package.Reset(Gen => Discrete_Generator_2,
- Initiator => TC_Seed);
-
- Float_Random.Reset(Float_Generator_1, 16#FF#); -- 255
- Float_Random.Reset(Float_Generator_2, 2#1110_0000#); -- 224
-
- -- Since the two float random generators are in different
- -- states, the bounded string images depicting their states should
- -- differ.
-
- Check_Discrete_State (Discrete_Generator_1,
- Discrete_Generator_2,
- Sub_Test => 4,
- States_Should_Match => False);
-
- Check_Float_State (Float_Generator_1,
- Float_Generator_2,
- Sub_Test => 4,
- States_Should_Match => False);
-
- -- Since the two discrete random generator objects were reset
- -- to different states, the values produced from each (upon calls
- -- to Random) should differ.
-
- Check_Discrete_Values (Discrete_Generator_1,
- Discrete_Generator_2,
- Sub_Test => 4,
- Values_Should_Match => False);
-
- Check_Float_Values (Float_Generator_1,
- Float_Generator_2,
- Sub_Test => 4,
- Values_Should_Match => False);
-
- end Sub_Test_4;
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXA5011;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5012.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5012.a
deleted file mode 100644
index a286fa71ed0..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5012.a
+++ /dev/null
@@ -1,536 +0,0 @@
--- CXA5012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that, for both Float_Random and Discrete_Random packages,
--- the following are true:
--- 1) the procedures Save and Reset can be used to save the
--- specific state of a random number generator, and then restore
--- the specific state to the generator following some intermediate
--- generator activity.
--- 2) the Function Image can be used to obtain a string
--- representation of the state of a generator; and that the
--- Function Value will transform a string representation of the
--- state of a random number generator into the actual state object.
--- 3) a call to Function Value, with a string value that is
--- not the image of any generator state, is a bounded error. This
--- error either raises Constraint_Error or Program_Error, or is
--- accepted. (See Technical Corrigendum 1).
---
--- TEST DESCRIPTION:
--- This test evaluates components of the Ada.Numerics.Float_Random and
--- Ada.Numerics.Discrete_Random packages.
--- The first objective block of this test uses Procedure Save to
--- save the particular state of a random number generator. The random
--- number generator then generates a series of random numbers. The
--- saved state variable is then used to reset (using Procedure Reset)
--- the generator back to the state it was in at the point of the call
--- to Save. Random values are then generated from this restored
--- generator, and compared with expected values.
--- The second objective block of this test uses Function Image to
--- provide a string representation of a state code. This string is
--- then transformed back to a state code value, and used to reset a
--- random number generator to the saved state. Random values are
--- likewise generated from this restored generator, and compared with
--- expected values.
---
---
--- CHANGE HISTORY:
--- 25 Apr 95 SAIC Initial prerelease version.
--- 17 Jul 95 SAIC Incorporated reviewer comments.
--- 17 Dec 97 EDS Change subtype upper limit from 100_000 to 10_000.
--- 16 Sep 99 RLB Updated objective 3 for Technical Corrigendum 1
--- changes.
-
---!
-
-with Ada.Numerics.Float_Random;
-with Ada.Numerics.Discrete_Random;
-with Ada.Strings.Bounded;
-with ImpDef;
-with Report;
-
-procedure CXA5012 is
-
-begin
-
- Report.Test ("CXA5012", "Check the effect of Procedures Save and " &
- "Reset, and Functions Image and Value " &
- "from the Ada.Numerics.Discrete_Random " &
- "and Float_Random packages");
-
- Test_Block:
- declare
-
- use Ada.Numerics, Ada.Strings.Bounded;
-
- -- Declare an integer subtype and an enumeration subtype, and use them
- -- to instantiate the discrete random number generator generic package.
-
- subtype Discrete_Range is Integer range 1..10_000;
- type Suit_Of_Cards is (Ace, One, Two, Three, Four, Five, Six,
- Seven, Eight, Nine, Ten, Jack, Queen, King);
- package Discrete_Pack is new Discrete_Random(Discrete_Range);
- package Card_Pack is new Discrete_Random(Suit_Of_Cards);
-
- -- Declaration of random number generator objects.
-
- DGen_1, DGen_2 : Discrete_Pack.Generator;
- EGen_1, EGen_2 : Card_Pack.Generator;
- FGen_1, FGen_2 : Float_Random.Generator;
-
- -- Variables declared to hold random numbers over the inclusive range
- -- of their corresponding type.
-
- DVal_1, DVal_2 : Discrete_Range;
- EVal_1, EVal_2 : Suit_Of_Cards;
- FVal_1, FVal_2 : Float_Random.Uniformly_Distributed;
-
- -- Declaration of State variables used to hold the state of the
- -- random number generators.
-
- DState_1, DState_2 : Discrete_Pack.State;
- EState_1, EState_2 : Card_Pack.State;
- FState_1, FState_2 : Float_Random.State;
-
- -- Declaration of bounded string packages instantiated with the
- -- value of Max_Image_Width constant, and bounded string variables
- -- used to hold the image of random number generator states.
-
- package DString_Pack is
- new Generic_Bounded_Length(Discrete_Pack.Max_Image_Width);
- package EString_Pack is
- new Generic_Bounded_Length(Card_Pack.Max_Image_Width);
- package FString_Pack is
- new Generic_Bounded_Length(Float_Random.Max_Image_Width);
-
- use DString_Pack, EString_Pack, FString_Pack;
-
- DString_1, DString_2 : DString_Pack.Bounded_String :=
- DString_Pack.Null_Bounded_String;
- EString_1, EString_2 : EString_Pack.Bounded_String :=
- EString_Pack.Null_Bounded_String;
- FString_1, FString_2 : FString_Pack.Bounded_String :=
- FString_Pack.Null_Bounded_String;
-
- -- Test variables.
-
- TC_Count : Natural;
- TC_Discrete_Check_Failed,
- TC_Enum_Check_Failed,
- TC_Float_Check_Failed : Boolean := False;
- TC_Seed : Integer;
-
- begin
-
- Objective_1:
- -- Check that the procedures Save and Reset can be used to save the
- -- specific state of a random number generator, and then restore the
- -- specific state to the generator following some intermediate
- -- generator activity.
- declare
-
- First_Row : constant := 1;
- Second_Row : constant := 2;
- TC_Max_Values : constant := 100;
-
- TC_Discrete_Array : array (First_Row..Second_Row, 1..TC_Max_Values)
- of Discrete_Range;
- TC_Enum_Array : array (First_Row..Second_Row, 1..TC_Max_Values)
- of Suit_Of_Cards;
- TC_Float_Array : array (First_Row..Second_Row, 1..TC_Max_Values)
- of Float_Random.Uniformly_Distributed;
- begin
-
- -- The state of the random number generators are saved to state
- -- variables using the procedure Save.
-
- Discrete_Pack.Save(Gen => DGen_1, To_State => DState_1);
- Card_Pack.Save (Gen => EGen_1, To_State => EState_1);
- Float_Random.Save (Gen => FGen_1, To_State => FState_1);
-
- -- Random number generators are used to fill the first half of the
- -- first row of the arrays with randomly generated values.
-
- for i in 1..TC_Max_Values/2 loop
- TC_Discrete_Array(First_Row, i) := Discrete_Pack.Random(DGen_1);
- TC_Enum_Array(First_Row, i) := Card_Pack.Random(EGen_1);
- TC_Float_Array(First_Row, i) := Float_Random.Random(FGen_1);
- end loop;
-
- -- The random number generators are reset to the states saved in the
- -- state variables, using the procedure Reset.
-
- Discrete_Pack.Reset(Gen => DGen_1, From_State => DState_1);
- Card_Pack.Reset (Gen => EGen_1, From_State => EState_1);
- Float_Random.Reset (Gen => FGen_1, From_State => FState_1);
-
- -- The same random number generators are used to fill the first half
- -- of the second row of the arrays with randomly generated values.
-
- for i in 1..TC_Max_Values/2 loop
- TC_Discrete_Array(Second_Row, i) := Discrete_Pack.Random(DGen_1);
- TC_Enum_Array(Second_Row, i) := Card_Pack.Random(EGen_1);
- TC_Float_Array(Second_Row, i) := Float_Random.Random(FGen_1);
- end loop;
-
- -- Run the random number generators many times (not using results).
-
- for i in Discrete_Range'Range loop
- DVal_1 := Discrete_Pack.Random(DGen_1);
- EVal_1 := Card_Pack.Random(EGen_1);
- FVal_1 := Float_Random.Random(FGen_1);
- end loop;
-
- -- The states of the random number generators are saved to state
- -- variables using the procedure Save.
-
- Discrete_Pack.Save(Gen => DGen_1, To_State => DState_1);
- Card_Pack.Save(Gen => EGen_1, To_State => EState_1);
- Float_Random.Save (Gen => FGen_1, To_State => FState_1);
-
- -- The last half of the first row of the arrays are filled with
- -- values generated from the same random number generators.
-
- for i in (TC_Max_Values/2 + 1)..TC_Max_Values loop
- TC_Discrete_Array(First_Row, i) := Discrete_Pack.Random(DGen_1);
- TC_Enum_Array(First_Row, i) := Card_Pack.Random(EGen_1);
- TC_Float_Array(First_Row, i) := Float_Random.Random(FGen_1);
- end loop;
-
- -- The random number generators are reset to the states saved in the
- -- state variables, using the procedure Reset.
-
- Discrete_Pack.Reset(Gen => DGen_1, From_State => DState_1);
- Card_Pack.Reset(Gen => EGen_1, From_State => EState_1);
- Float_Random.Reset (Gen => FGen_1, From_State => FState_1);
-
- -- The last half of the second row of the arrays are filled with
- -- values generated from the same random number generator.
- -- These values should exactly mirror the values in the last half
- -- of the first row of the arrays that had been previously generated.
-
- for i in (TC_Max_Values/2 + 1)..TC_Max_Values loop
- TC_Discrete_Array(Second_Row, i) := Discrete_Pack.Random(DGen_1);
- TC_Enum_Array(Second_Row, i) := Card_Pack.Random(EGen_1);
- TC_Float_Array(Second_Row, i) := Float_Random.Random(FGen_1);
- end loop;
-
- -- Check that the values in the two rows of the arrays are identical.
-
- for i in 1..TC_Max_Values loop
- if TC_Discrete_Array(First_Row,i) /=
- TC_Discrete_Array(Second_Row,i)
- then
- TC_Discrete_Check_Failed := True;
- exit;
- end if;
- end loop;
-
- for i in 1..TC_Max_Values loop
- if TC_Enum_Array(First_Row,i) /= TC_Enum_Array(Second_Row,i) then
- TC_Enum_Check_Failed := True;
- exit;
- end if;
- end loop;
-
- for i in 1..TC_Max_Values loop
- if TC_Float_Array(First_Row,i) /= TC_Float_Array(Second_Row,i)
- then
- TC_Float_Check_Failed := True;
- exit;
- end if;
- end loop;
-
- if TC_Discrete_Check_Failed then
- Report.Failed("Discrete random values generated following use " &
- "of procedures Save and Reset were not the same");
- TC_Discrete_Check_Failed := False;
- end if;
-
- if TC_Enum_Check_Failed then
- Report.Failed("Enumeration random values generated following " &
- "use of procedures Save and Reset were not the " &
- "same");
- TC_Enum_Check_Failed := False;
- end if;
-
- if TC_Float_Check_Failed then
- Report.Failed("Float random values generated following use " &
- "of procedures Save and Reset were not the same");
- TC_Float_Check_Failed := False;
- end if;
-
- end Objective_1;
-
-
-
- Objective_2:
- -- Check that the Function Image can be used to obtain a string
- -- representation of the state of a generator.
- -- Check that the Function Value will transform a string
- -- representation of the state of a random number generator
- -- into the actual state object.
- begin
-
- -- Use two discrete and float random number generators to generate
- -- a series of values (so that the generators are no longer in their
- -- initial states, and they have generated the same number of
- -- random values).
-
- TC_Seed := Integer(Discrete_Pack.Random(DGen_1));
- Discrete_Pack.Reset(DGen_1, TC_Seed);
- Discrete_Pack.Reset(DGen_2, TC_Seed);
- Card_Pack.Reset (EGen_1, TC_Seed);
- Card_Pack.Reset (EGen_2, TC_Seed);
- Float_Random.Reset (FGen_1, TC_Seed);
- Float_Random.Reset (FGen_2, TC_Seed);
-
- for i in 1..1000 loop
- DVal_1 := Discrete_Pack.Random(DGen_1);
- DVal_2 := Discrete_Pack.Random(DGen_2);
- EVal_1 := Card_Pack.Random(EGen_1);
- EVal_2 := Card_Pack.Random(EGen_2);
- FVal_1 := Float_Random.Random(FGen_1);
- FVal_2 := Float_Random.Random(FGen_2);
- end loop;
-
- -- Use the Procedure Save to save the states of the generators
- -- to state variables.
-
- Discrete_Pack.Save(Gen => DGen_1, To_State => DState_1);
- Discrete_Pack.Save(DGen_2, To_State => DState_2);
- Card_Pack.Save (Gen => EGen_1, To_State => EState_1);
- Card_Pack.Save (EGen_2, To_State => EState_2);
- Float_Random.Save (FGen_1, To_State => FState_1);
- Float_Random.Save (FGen_2, FState_2);
-
- -- Use the Function Image to produce a representation of the state
- -- codes as (bounded) string objects.
-
- DString_1 := DString_Pack.To_Bounded_String(
- Discrete_Pack.Image(Of_State => DState_1));
- DString_2 := DString_Pack.To_Bounded_String(
- Discrete_Pack.Image(DState_2));
- EString_1 := EString_Pack.To_Bounded_String(
- Card_Pack.Image(Of_State => EState_1));
- EString_2 := EString_Pack.To_Bounded_String(
- Card_Pack.Image(EState_2));
- FString_1 := FString_Pack.To_Bounded_String(
- Float_Random.Image(Of_State => FState_1));
- FString_2 := FString_Pack.To_Bounded_String(
- Float_Random.Image(FState_2));
-
- -- Compare the bounded string objects for equality.
-
- if DString_1 /= DString_2 then
- Report.Failed("String values returned from Function Image " &
- "depict different states of Discrete generators");
- end if;
- if EString_1 /= EString_2 then
- Report.Failed("String values returned from Function Image " &
- "depict different states of Enumeration " &
- "generators");
- end if;
- if FString_1 /= FString_2 then
- Report.Failed("String values returned from Function Image " &
- "depict different states of Float generators");
- end if;
-
- -- The string representation of a state code is transformed back
- -- to a state code variable using the Function Value.
-
- DState_1 := Discrete_Pack.Value(Coded_State =>
- DString_Pack.To_String(DString_1));
- EState_1 := Card_Pack.Value(EString_Pack.To_String(EString_1));
- FState_1 := Float_Random.Value(FString_Pack.To_String(FString_1));
-
- -- One of the (pair of each type of ) generators is used to generate
- -- a series of random values, getting them "out of synch" with the
- -- specific generation sequence of the other generators.
-
- for i in 1..100 loop
- DVal_1 := Discrete_Pack.Random(DGen_1);
- EVal_1 := Card_Pack.Random(EGen_1);
- FVal_1 := Float_Random.Random (FGen_1);
- end loop;
-
- -- The "out of synch" generators are reset to the previous state they
- -- had when their states were saved, and they should now have the same
- -- states as the generators that did not generate the values above.
-
- Discrete_Pack.Reset(Gen => DGen_1, From_State => DState_1);
- Card_Pack.Reset (Gen => EGen_1, From_State => EState_1);
- Float_Random.Reset (Gen => FGen_1, From_State => FState_1);
-
- -- All generators should now be in the same state, so the
- -- random values they produce should be the same.
-
- for i in 1..1000 loop
- if Discrete_Pack.Random(DGen_1) /= Discrete_Pack.Random(DGen_2)
- then
- TC_Discrete_Check_Failed := True;
- exit;
- end if;
- end loop;
-
- for i in 1..1000 loop
- if Card_Pack.Random(EGen_1) /= Card_Pack.Random(EGen_2) then
- TC_Enum_Check_Failed := True;
- exit;
- end if;
- end loop;
-
- for i in 1..1000 loop
- if Float_Random.Random(FGen_1) /= Float_Random.Random(FGen_2)
- then
- TC_Float_Check_Failed := True;
- exit;
- end if;
- end loop;
-
- if TC_Discrete_Check_Failed then
- Report.Failed("Random values generated following use of " &
- "procedures Image and Value were not the same " &
- "for Discrete generator");
- end if;
- if TC_Enum_Check_Failed then
- Report.Failed("Random values generated following use of " &
- "procedures Image and Value were not the same " &
- "for Enumeration generator");
- end if;
- if TC_Float_Check_Failed then
- Report.Failed("Random values generated following use of " &
- "procedures Image and Value were not the same " &
- "for Float generator");
- end if;
-
- end Objective_2;
-
-
-
- Objective_3:
- -- Check that a call to Function Value, with a string value that is
- -- not the image of any generator state, is a bounded error. This
- -- error either raises Constraint_Error or Program_Error, or is
- -- accepted. (See Technical Corrigendum 1).
- declare
- Not_A_State : constant String := ImpDef.Non_State_String;
- begin
-
- begin
- DState_1 := Discrete_Pack.Value(Not_A_State);
- if Not_A_State /= "**NONE**" then
- Report.Failed("Exception not raised by Function " &
- "Ada.Numerics.Discrete_Random.Value when " &
- "provided a string input that does not " &
- "represent the state of a random number " &
- "generator");
- else
- Report.Comment("All strings represent states for Function " &
- "Ada.Numerics.Discrete_Random.Value");
- end if;
- Discrete_Pack.Reset(DGen_1, DState_1);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- Report.Comment("Constraint_Error raised by Function " &
- "Ada.Numerics.Discrete_Random.Value when " &
- "provided a string input that does not " &
- "represent the state of a random number " &
- "generator");
- when Program_Error => -- OK, expected exception.
- Report.Comment("Program_Error raised by Function " &
- "Ada.Numerics.Discrete_Random.Value when " &
- "provided a string input that does not " &
- "represent the state of a random number " &
- "generator");
- when others =>
- Report.Failed("Unexpected exception raised by Function " &
- "Ada.Numerics.Discrete_Random.Value when " &
- "provided a string input that does not " &
- "represent the state of a random number " &
- "generator");
- end;
-
- begin
- EState_1 := Card_Pack.Value(Not_A_State);
- if Not_A_State /= "**NONE**" then
- Report.Failed("Exception not raised by Function " &
- "Ada.Numerics.Discrete_Random.Value when " &
- "provided a string input that does not " &
- "represent the state of an enumeration " &
- "random number generator");
- else
- Report.Comment("All strings represent states for Function " &
- "Ada.Numerics.Discrete_Random.Value");
- end if;
- Card_Pack.Reset(EGen_1, EState_1);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when Program_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function " &
- "Ada.Numerics.Discrete_Random.Value when " &
- "provided a string input that does not " &
- "represent the state of an enumeration " &
- "random number generator");
- end;
-
- begin
- FState_1 := Float_Random.Value(Not_A_State);
- if Not_A_State /= "**NONE**" then
- Report.Failed("Exception not raised by an " &
- "instantiated version of " &
- "Ada.Numerics.Float_Random.Value when " &
- "provided a string input that does not " &
- "represent the state of a random number " &
- "generator");
- else
- Report.Comment("All strings represent states for Function " &
- "Ada.Numerics.Float_Random.Value");
- end if;
- Float_Random.Reset(FGen_1, FState_1);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when Program_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by an " &
- "instantiated version of " &
- "Ada.Numerics.Float_Random.Value when " &
- "provided a string input that does not " &
- "represent the state of a random number " &
- "generator");
- end;
-
- end Objective_3;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA5012;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5015.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5015.a
deleted file mode 100644
index e1035db271b..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5015.a
+++ /dev/null
@@ -1,342 +0,0 @@
--- CXA5015.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the following representation-oriented attributes are
--- available and that the produce correct results:
--- 'Denorm, 'Signed_Zeros, 'Exponent 'Fraction, 'Compose, 'Scaling,
--- 'Floor, 'Ceiling, 'Rounding, 'Unbiased_Rounding, 'Truncation,
--- 'Remainder, 'Adjacent, 'Copy_Sign, 'Leading_Part, 'Machine, and
--- 'Model_Small.
---
--- TEST DESCRIPTION:
--- This test checks whether certain attributes of floating point types
--- are available from an implementation. Where attribute correctness
--- can be verified in a straight forward manner, the appropriate checks
--- are included here. However, this test is not intended to ensure the
--- correctness of the results returned from all of the attributes
--- examined in this test; that process will occur in the tests of the
--- Numerics_Annex.
---
---
--- CHANGE HISTORY:
--- 26 Jun 95 SAIC Initial prerelease version.
--- 29 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 01 DEC 97 EDS Fix value for checking the S'Adjacent attribute
---!
-
-with Report;
-
-procedure CXA5015 is
-
- subtype Float_Subtype is Float range -10.0..10.0;
- type Derived_Float_1 is digits 8;
- type Derived_Float_2 is new Derived_Float_1 range -10.0..10.0E10;
-
- use type Float, Float_Subtype, Derived_Float_1, Derived_Float_2;
-
- TC_Boolean : Boolean;
- TC_Float : Float;
- TC_SFloat : Float_Subtype;
- TC_DFloat_1 : Derived_Float_1;
- TC_DFloat_2 : Derived_Float_2;
- TC_Tolerance : Float := 0.001;
-
- function Not_Equal (Actual_Result, Expected_Result, Tolerance : Float)
- return Boolean is
- begin
- return abs(Actual_Result - Expected_Result) > Tolerance;
- end Not_Equal;
-
-
-begin
-
- Report.Test ("CXA5015", "Check that certain representation-oriented " &
- "attributes are available and that they " &
- "produce correct results");
-
- -- New Representation-Oriented Attributes.
- --
- -- Check the S'Denorm attribute.
-
- TC_Boolean := Float'Denorm;
- TC_Boolean := Float_Subtype'Denorm;
- TC_Boolean := Derived_Float_1'Denorm;
- TC_Boolean := Derived_Float_2'Denorm;
-
-
- -- Check the S'Signed_Zeroes attribute.
-
- TC_Boolean := Float'Signed_Zeros;
- TC_Boolean := Float_Subtype'Signed_Zeros;
- TC_Boolean := Derived_Float_1'Signed_Zeros;
- TC_Boolean := Derived_Float_2'Signed_Zeros;
-
-
- -- New Primitive Function Attributes.
- --
- -- Check the S'Exponent attribute.
-
- TC_Float := 0.5;
- TC_SFloat := 0.99;
- TC_DFloat_1 := 2.45;
- TC_DFloat_2 := 2.65;
-
- if Float'Exponent(TC_Float) > Float_Subtype'Exponent(TC_SFloat) or
- Float'Exponent(TC_Float) > 2
- then
- Report.Failed("Incorrect result from the 'Exponent attribute");
- end if;
-
-
- -- Check the S'Fraction attribute.
-
- if Not_Equal
- (Float'Fraction(TC_Float),
- TC_Float * Float(Float'Machine_Radix)**(-Float'Exponent(TC_Float)),
- TC_Tolerance)
- then
- Report.Failed("Incorrect result from the 'Fraction attribute - 1");
- end if;
-
- if Float'Fraction(TC_Float) <
- (1.0/Float(Float'Machine_Radix)) - TC_Tolerance or
- Float'Fraction(TC_Float) >= 1.0 - TC_Tolerance
- then
- Report.Failed("Incorrect result from the 'Fraction attribute - 2");
- end if;
-
-
- -- Check the S'Compose attribute.
-
- if Not_Equal
- (Float'Compose(TC_Float, 3),
- TC_Float * Float(Float'Machine_Radix)**(3-Float'Exponent(TC_Float)),
- TC_Tolerance)
- then
- Report.Failed("Incorrect result from the 'Compose attribute");
- end if;
-
-
- -- Check the S'Scaling attribute.
-
- if Not_Equal
- (Float'Scaling(TC_Float, 2),
- TC_Float * Float(Float'Machine_Radix)**2,
- TC_Tolerance)
- then
- Report.Failed("Incorrect result from the 'Scaling attribute");
- end if;
-
-
- -- Check the S'Floor attribute.
-
- TC_Float := 0.99;
- TC_SFloat := 1.00;
- TC_DFloat_1 := 2.50;
- TC_DFloat_2 := -2.50;
-
- if Float'Floor(TC_Float) /= 0.0 or
- Float_Subtype'Floor(TC_SFloat) /= 1.0 or
- Derived_Float_1'Floor(TC_DFloat_1) /= 2.0 or
- Derived_Float_2'Floor(TC_DFloat_2) /= -3.0
- then
- Report.Failed("Incorrect result from the 'Floor attribute");
- end if;
-
-
- -- Check the S'Ceiling attribute.
-
- TC_Float := 0.99;
- TC_SFloat := 1.00;
- TC_DFloat_1 := 2.50;
- TC_DFloat_2 := -2.99;
-
- if Float'Ceiling(TC_Float) /= 1.0 or
- Float_Subtype'Ceiling(TC_SFloat) /= 1.0 or
- Derived_Float_1'Ceiling(TC_DFloat_1) /= 3.0 or
- Derived_Float_2'Ceiling(TC_DFloat_2) /= -2.0
- then
- Report.Failed("Incorrect result from the 'Ceiling attribute");
- end if;
-
-
- -- Check the S'Rounding attribute.
-
- TC_Float := 0.49;
- TC_SFloat := 1.00;
- TC_DFloat_1 := 2.50;
- TC_DFloat_2 := -2.50;
-
- if Float'Rounding(TC_Float) /= 0.0 or
- Float_Subtype'Rounding(TC_SFloat) /= 1.0 or
- Derived_Float_1'Rounding(TC_DFloat_1) /= 3.0 or
- Derived_Float_2'Rounding(TC_DFloat_2) /= -3.0
- then
- Report.Failed("Incorrect result from the 'Rounding attribute");
- end if;
-
-
- -- Check the S'Unbiased_Rounding attribute.
-
- TC_Float := 0.50;
- TC_SFloat := 1.50;
- TC_DFloat_1 := 2.50;
- TC_DFloat_2 := -2.50;
-
- if Float'Unbiased_Rounding(TC_Float) /= 0.0 or
- Float_Subtype'Unbiased_Rounding(TC_SFloat) /= 2.0 or
- Derived_Float_1'Unbiased_Rounding(TC_DFloat_1) /= 2.0 or
- Derived_Float_2'Unbiased_Rounding(TC_DFloat_2) /= -2.0
- then
- Report.Failed("Incorrect result from the 'Unbiased_Rounding " &
- "attribute");
- end if;
-
-
- -- Check the S'Truncation attribute.
-
- TC_Float := -0.99;
- TC_SFloat := 1.50;
- TC_DFloat_1 := 2.99;
- TC_DFloat_2 := -2.50;
-
- if Float'Truncation(TC_Float) /= 0.0 or
- Float_Subtype'Truncation(TC_SFloat) /= 1.0 or
- Derived_Float_1'Truncation(TC_DFloat_1) /= 2.0 or
- Derived_Float_2'Truncation(TC_DFloat_2) /= -2.0
- then
- Report.Failed("Incorrect result from the 'Truncation attribute");
- end if;
-
-
- -- Check the S'Remainder attribute.
-
- TC_Float := 9.0;
- TC_SFloat := 7.5;
- TC_DFloat_1 := 5.0;
- TC_DFloat_2 := 8.0;
-
- if Float'Remainder(TC_Float, 2.0) /= 1.0 or
- Float_Subtype'Remainder(TC_SFloat, 3.0) /= 1.5 or
- Derived_Float_1'Remainder(TC_DFloat_1, 2.0) /= 1.0 or
- Derived_Float_2'Remainder(TC_DFloat_2, 4.0) /= 0.0
- then
- Report.Failed("Incorrect result from the 'Remainder attribute");
- end if;
-
-
- -- Check the S'Adjacent attribute.
-
- TC_Float := 4.0;
- TC_SFloat := -1.0;
-
- if Float'Adjacent(TC_Float, TC_Float) /= TC_Float or
- Float_Subtype'Adjacent(TC_SFloat, -1.0) /= TC_SFloat
- then
- Report.Failed("Incorrect result from the 'Adjacent attribute");
- end if;
-
-
- -- Check the S'Copy_Sign attribute.
-
- TC_Float := 0.0;
- TC_SFloat := -1.0;
- TC_DFloat_1 := 5.0;
- TC_DFloat_2 := -2.5;
-
- if Float'Copy_Sign(TC_Float, -2.0) /= 0.0 or
- Float_Subtype'Copy_Sign(TC_SFloat, 4.0) /= 1.0 or
- Derived_Float_1'Copy_Sign(TC_DFloat_1, -2.0) /= -5.0 or
- Derived_Float_2'Copy_Sign(TC_DFloat_2, -2.0) /= -2.5
- then
- Report.Failed("Incorrect result from the 'Copy_Sign attribute");
- end if;
-
-
- -- Check the S'Leading_Part attribute.
-
- TC_Float := 0.0;
- TC_SFloat := -1.0;
- TC_DFloat_1 := 5.88;
- TC_DFloat_2 := -2.52;
-
- -- Leading part obtained in the variables.
- TC_Float := Float'Leading_Part(TC_Float, 2);
- TC_SFloat := Float_Subtype'Leading_Part(TC_SFloat, 2);
- TC_DFloat_1 := Derived_Float_1'Leading_Part(TC_DFloat_1, 2);
- TC_DFloat_2 := Derived_Float_2'Leading_Part(TC_DFloat_2, 2);
-
- -- Checking for the leading part of the variables at this point should
- -- produce the same values.
- if Float'Leading_Part(TC_Float, 2) /= TC_Float or
- Float_Subtype'Leading_Part(TC_SFloat, 2) /= TC_SFloat or
- Derived_Float_1'Leading_Part(TC_DFloat_1, 2) /= TC_DFloat_1 or
- Derived_Float_2'Leading_Part(TC_DFloat_2, 2) /= TC_DFloat_2
- then
- Report.Failed("Incorrect result from the 'Leading_Part attribute");
- end if;
-
-
- -- Check the S'Machine attribute.
-
- TC_Float := 0.0;
- TC_SFloat := -1.0;
- TC_DFloat_1 := 5.88;
- TC_DFloat_2 := -2.52;
-
- -- Closest machine number obtained in the variables.
- TC_Float := Float'Machine(TC_Float);
- TC_SFloat := Float_Subtype'Machine(TC_SFloat);
- TC_DFloat_1 := Derived_Float_1'Machine(TC_DFloat_1);
- TC_DFloat_2 := Derived_Float_2'Machine(TC_DFloat_2);
-
- -- Checking for the closest machine number to each of the variables at
- -- this point should produce the same values.
- if Float'Machine(TC_Float) /= TC_Float or
- Float_Subtype'Machine(TC_SFloat) /= TC_SFloat or
- Derived_Float_1'Machine(TC_DFloat_1) /= TC_DFloat_1 or
- Derived_Float_2'Machine(TC_DFloat_2) /= TC_DFloat_2
- then
- Report.Failed("Incorrect result from the 'Machine attribute");
- end if;
-
-
- -- New Model-Oriented Attributes.
- --
- -- Check the S'Model_Small attribute.
-
- if Not_Equal
- (Float'Model_Small,
- Float(Float'Machine_Radix)**(Float'Model_Emin-1),
- TC_Tolerance)
- then
- Report.Failed("Incorrect result from the 'Model_Small attribute");
- end if;
-
-
- Report.Result;
-
-end CXA5015;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5a01.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5a01.a
deleted file mode 100644
index 12db5e7e108..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5a01.a
+++ /dev/null
@@ -1,338 +0,0 @@
--- CXA5A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functions Sin and Sinh provide correct results.
---
--- TEST DESCRIPTION:
--- This test examines both the version of Sin and Sinh resulting from
--- the instantiation of the Ada.Numerics.Generic_Elementary_Functions
--- with a type derived from type Float, as well as the preinstantiated
--- version of this package for type Float.
--- Prescribed results, as well as instances prescribed to raise
--- exceptions, are examined in the test cases. In addition,
--- certain evaluations are performed where the actual function result
--- is compared with the expected result (within an epsilon range of
--- accuracy).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXA5A00.A (foundation code)
--- CXA5A01.A
---
---
--- CHANGE HISTORY:
--- 06 Mar 95 SAIC Initial prerelease version.
--- 13 Jun 95 SAIC Incorporated use of Dont_Optimize procedure, and
--- use of Result_Within_Range function overloaded for
--- FXA5A00.New_Float_Type.
--- 26 Jun 98 EDS Protected exception tests by first testing
--- for 'Machine_Overflows
---!
-
-with Ada.Numerics.Elementary_Functions;
-with Ada.Numerics.Generic_Elementary_Functions;
-with FXA5A00;
-with Report;
-
-procedure CXA5A01 is
-begin
-
- Report.Test ("CXA5A01", "Check that the functions Sin and Sinh provide " &
- "correct results");
-
- Test_Block:
- declare
-
- use Ada.Numerics;
- use FXA5A00;
-
- package GEF is new Ada.Numerics.Generic_Elementary_Functions(New_Float);
- package EF renames Ada.Numerics.Elementary_Functions;
-
- The_Result : Float;
- New_Float_Result : New_Float;
-
- procedure Dont_Optimize_Float is new Dont_Optimize(Float);
- procedure Dont_Optimize_New_Float is new Dont_Optimize(New_Float);
-
- begin
-
- -- Testing of Sin Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that no exception occurs on computing the Sin with very
- -- large (positive and negative) input values.
-
- begin
- New_Float_Result := GEF.Sin (New_Float(FXA5A00.Large));
- Dont_Optimize_New_Float(New_Float_Result, 1);
- exception
- when others =>
- Report.Failed("Unexpected exception on GEF.Sin with large " &
- "positive value");
- end;
-
- begin
- The_Result := EF.Sin (FXA5A00.Minus_Large);
- Dont_Optimize_Float(The_Result, 2);
- exception
- when others =>
- Report.Failed("Unexpected exception on GEF.Sin with large " &
- "negative value");
- end;
-
-
- -- Test of Sin for prescribed result at zero.
-
- if GEF.Sin (0.0) /= 0.0 or
- EF.Sin (0.0) /= 0.0
- then
- Report.Failed("Incorrect value returned from Sin(0.0)");
- end if;
-
-
- -- Test of Sin with expected result value between 0.0 and 1.0.
-
- if not (GEF.Sin (Ada.Numerics.Pi/4.0) < 1.0) or
- not ( EF.Sin (Ada.Numerics.Pi/4.0) < 1.0) or
- not FXA5A00.Result_Within_Range(GEF.Sin(0.35), 0.343, 0.001) or
- not FXA5A00.Result_Within_Range( EF.Sin(1.18), 0.924, 0.001)
- then
- Report.Failed("Incorrect value returned from Sin function when " &
- "the expected result is between 0.0 and 1.0");
- end if;
-
-
- -- Test of Sin with expected result value between -1.0 and 0.0.
-
- if not (GEF.Sin (-Ada.Numerics.Pi/4.0) > -1.0) or
- not ( EF.Sin (-Ada.Numerics.Pi/4.0) > -1.0) or
- not FXA5A00.Result_Within_Range(GEF.Sin(-0.24), -0.238, 0.001) or
- not FXA5A00.Result_Within_Range( EF.Sin(-1.00), -0.841, 0.001)
- then
- Report.Failed("Incorrect value returned from Sin function when " &
- "the expected result is between -1.0 and 0.0");
- end if;
-
-
- -- Testing of the Sin function with Cycle parameter.
-
- -- Check that Argument_Error is raised when the value of the Cycle
- -- parameter is zero.
-
- begin
- New_Float_Result := GEF.Sin (X => 1.0, Cycle => 0.0);
- Report.Failed("Argument_Error not raised by GEF.Sin function " &
- "when the Cycle parameter is zero");
- Dont_Optimize_New_Float(New_Float_Result, 3);
- exception
- when Ada.Numerics.Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by GEF.Sin function " &
- "when the Cycle parameter is zero");
- end;
-
- begin
- The_Result := EF.Sin (X => 0.34, Cycle => 0.0);
- Report.Failed("Argument_Error not raised by EF.Sin function when " &
- "the Cycle parameter is zero");
- Dont_Optimize_Float(The_Result, 4);
- exception
- when Ada.Numerics.Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by EF.Sin function " &
- "when the Cycle parameter is zero");
- end;
-
- -- Check that Argument_Error is raised when the value of the Cycle
- -- parameter is negative.
-
- begin
- New_Float_Result := GEF.Sin (X => 0.45, Cycle => -1.0);
- Report.Failed("Argument_Error not raised by GEF.Sin function " &
- "when the Cycle parameter is negative");
- Dont_Optimize_New_Float(New_Float_Result, 5);
- exception
- when Ada.Numerics.Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by GEF.Sin function " &
- "when the Cycle parameter is negative");
- end;
-
- begin
- The_Result := EF.Sin (X => 0.10, Cycle => -4.0);
- Report.Failed("Argument_Error not raised by EF.Sin function when " &
- "the Cycle parameter is negative");
- Dont_Optimize_Float(The_Result, 6);
- exception
- when Ada.Numerics.Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by EF.Sin function " &
- "when the Cycle parameter is negative");
- end;
-
-
- -- Check that no exception occurs on computing the Sin with very
- -- large (positive and negative) input values and Cycle parameter.
-
- begin
- New_Float_Result := GEF.Sin (New_Float(FXA5A00.Large), 360.0);
- Dont_Optimize_New_Float(New_Float_Result, 7);
- exception
- when others =>
- Report.Failed("Unexpected exception on GEF.Sin with large " &
- "positive value and Cycle parameter");
- end;
-
- begin
- The_Result := EF.Sin (FXA5A00.Minus_Large, 720.0);
- Dont_Optimize_Float(The_Result, 8);
- exception
- when others =>
- Report.Failed("Unexpected exception on EF.Sin with large " &
- "negative value and Cycle parameter");
- end;
-
-
- -- Test of Sin with Cycle parameter for prescribed result at zero.
-
- if GEF.Sin (0.0, 360.0) /= 0.0 or
- EF.Sin (0.0, 180.0) /= 0.0
- then
- Report.Failed("Incorrect value returned from Sin function with " &
- "cycle parameter for a zero input parameter value");
- end if;
-
-
- -- Tests of Sin function with Cycle parameter for prescribed results.
-
- if GEF.Sin(0.0, 360.0) /= 0.0 or
- EF.Sin(180.0, 360.0) /= 0.0 or
- GEF.Sin(90.0, 360.0) /= 1.0 or
- EF.Sin(450.0, 360.0) /= 1.0 or
- GEF.Sin(270.0, 360.0) /= -1.0 or
- EF.Sin(630.0, 360.0) /= -1.0
- then
- Report.Failed("Incorrect result from the Sin function with " &
- "various cycle values for prescribed results");
- end if;
-
-
- -- Testing of Sinh Function, both instantiated and pre-instantiated
- -- version.
-
- -- Test for Constraint_Error on parameter with large positive magnitude.
-
- begin
-
- if New_Float'Machine_Overflows then
- New_Float_Result := GEF.Sinh (New_Float(FXA5A00.Large));
- Report.Failed("Constraint_Error not raised when the GEF.Sinh " &
- "function is provided a parameter with a large " &
- "positive value");
- Dont_Optimize_New_Float(New_Float_Result, 9);
- end if;
-
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Constraint_Error not raised when the GEF.Sinh " &
- "function is provided a parameter with a large " &
- "positive value");
- end;
-
- -- Test for Constraint_Error on parameter with large negative magnitude.
-
- begin
-
- if Float'Machine_Overflows then
- The_Result := EF.Sinh (FXA5A00.Minus_Large);
- Report.Failed("Constraint_Error not raised when the EF.Sinh " &
- "function is provided a parameter with a " &
- "large negative value");
- Dont_Optimize_Float(The_Result, 10);
- end if;
-
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Constraint_Error not raised when the EF.Sinh " &
- "function is provided a parameter with a " &
- "large negative value");
- end;
-
-
- -- Test that no exception occurs when the Sinh function is provided a
- -- very small positive or negative value.
-
- begin
- New_Float_Result := GEF.Sinh (New_Float(FXA5A00.Small));
- Dont_Optimize_New_Float(New_Float_Result, 11);
- exception
- when others =>
- Report.Failed("Unexpected exception on GEF.Sinh with a very" &
- "small positive value");
- end;
-
- begin
- The_Result := EF.Sinh (-FXA5A00.Small);
- Dont_Optimize_Float(The_Result, 12);
- exception
- when others =>
- Report.Failed("Unexpected exception on EF.Sinh with a very" &
- "small negative value");
- end;
-
-
- -- Test for prescribed 0.0 result of Function Sinh with 0.0 parameter.
-
- if GEF.Sinh (0.0) /= 0.0 or
- EF.Sinh (0.0) /= 0.0
- then
- Report.Failed("Incorrect value returned from Sinh(0.0)");
- end if;
-
-
- -- Test of Sinh function with various input parameters.
-
- if not FXA5A00.Result_Within_Range(GEF.Sinh(0.01), 0.010, 0.001) or
- not FXA5A00.Result_Within_Range( EF.Sinh(0.61), 0.649, 0.001) or
- not FXA5A00.Result_Within_Range(GEF.Sinh(1.70), 2.65, 0.01) or
- not FXA5A00.Result_Within_Range( EF.Sinh(3.15), 11.65, 0.01)
- then
- Report.Failed("Incorrect result returned from Sinh function " &
- "with various input parameters");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA5A01;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5a02.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5a02.a
deleted file mode 100644
index 9e6c575dd2c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5a02.a
+++ /dev/null
@@ -1,328 +0,0 @@
--- CXA5A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functions Cos and Cosh provide correct results.
---
--- TEST DESCRIPTION:
--- This test examines both the version of Cos and Cosh resulting from
--- the instantiation of the Ada.Numerics.Generic_Elementary_Functions
--- with type derived from type Float, as well as the pre-instantiated
--- version of this package for type Float.
--- Prescribed results, including instances prescribed to raise
--- exceptions, are examined in the test cases. In addition,
--- certain evaluations are performed where the actual function result
--- is compared with the expected result (within an epsilon range of
--- accuracy).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXA5A00.A (foundation code)
--- CXA5A02.A
---
---
--- CHANGE HISTORY:
--- 09 Mar 95 SAIC Initial prerelease version.
--- 03 Apr 95 SAIC Removed reference to derived type.
--- 13 Jun 95 SAIC Incorporated use of Dont_Optimize procedure, and
--- use of Result_Within_Range function overloaded for
--- FXA5A00.New_Float_Type.
--- 28 Feb 97 PWB.CTA Removed checks specifying Cycle => 2.0 * Pi
--- 26 Jun 98 EDS Protected exception checks by first testing
--- for 'Machine_Overflows. Removed code deleted
--- by comment.
--- CHANGE NOTE:
--- According to Ken Dritz, author of the Numerics Annex of the RM,
--- one should never specify the cycle 2.0*Pi for the trigonometric
--- functions. In particular, if the machine number for the first
--- argument is not an exact multiple of the machine number for the
--- explicit cycle, then the specified exact results cannot be
--- reasonably expected. The affected checks have been deleted.
---!
-
-with Ada.Numerics.Elementary_Functions;
-with Ada.Numerics.Generic_Elementary_Functions;
-with FXA5A00;
-with Report;
-
-procedure CXA5A02 is
-begin
-
- Report.Test ("CXA5A02", "Check that the functions Cos and Cosh provide " &
- "correct results");
-
- Test_Block:
- declare
-
- use Ada.Numerics;
- use FXA5A00;
-
- package GEF is new Ada.Numerics.Generic_Elementary_Functions(New_Float);
- package EF renames Ada.Numerics.Elementary_Functions;
-
- The_Result : Float;
- New_Float_Result : New_Float;
-
- procedure Dont_Optimize_Float is new Dont_Optimize(Float);
- procedure Dont_Optimize_New_Float is new Dont_Optimize(New_Float);
-
- begin
-
- -- Testing of Cos Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that no exception occurs on computing the Cos with very
- -- large (positive and negative) input values.
-
- begin
- New_Float_Result := GEF.Cos (New_Float(FXA5A00.Large));
- Dont_Optimize_New_Float(New_Float_Result, 1);
- exception
- when others =>
- Report.Failed("Unexpected exception on GEF.Cos with large " &
- "positive value");
- end;
-
- begin
- The_Result := EF.Cos (FXA5A00.Minus_Large);
- Dont_Optimize_Float(The_Result, 2);
- exception
- when others =>
- Report.Failed("Unexpected exception on GEF.Cos with large " &
- "negative value");
- end;
-
-
- -- Test of Cos for prescribed result at zero.
-
- if GEF.Cos (0.0) /= 1.0 or
- EF.Cos (0.0) /= 1.0
- then
- Report.Failed("Incorrect value returned from Cos(0.0)");
- end if;
-
-
- -- Test of Cos with expected result value between 1.0 and -1.0.
-
- if not (Result_Within_Range( EF.Cos(Ada.Numerics.Pi/3.0),
- 0.500,
- 0.001) and
- Result_Within_Range(GEF.Cos(0.6166), 0.816, 0.001) and
- Result_Within_Range(GEF.Cos(0.1949), 0.981, 0.001) and
- Result_Within_Range( EF.Cos(Ada.Numerics.Pi/2.0),
- 0.00,
- 0.001) and
- Result_Within_Range( EF.Cos(2.0*Ada.Numerics.Pi/3.0),
- -0.500,
- 0.001) and
- Result_Within_Range(GEF.Cos(New_Float(Ada.Numerics.Pi)),
- -1.00,
- 0.001))
- then
- Report.Failed("Incorrect value returned from Cos function when " &
- "the expected result is between 1.0 and -1.0");
- end if;
-
-
- -- Testing of the Cos function with Cycle parameter.
-
- -- Check that Argument_Error is raised when the value of the Cycle
- -- parameter is zero.
-
- begin
- New_Float_Result := GEF.Cos (X => 1.0, Cycle => 0.0);
- Report.Failed("Argument_Error not raised by GEF.Cos function " &
- "when the Cycle parameter is zero");
- Dont_Optimize_New_Float(New_Float_Result, 3);
- exception
- when Ada.Numerics.Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by GEF.cos function " &
- "when the Cycle parameter is zero");
- end;
-
- begin
- The_Result := EF.Cos (X => 0.55, Cycle => 0.0);
- Report.Failed("Argument_Error not raised by EF.Cos function when " &
- "the Cycle parameter is zero");
- Dont_Optimize_Float(The_Result, 4);
- exception
- when Ada.Numerics.Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by EF.Cos function " &
- "when the Cycle parameter is zero");
- end;
-
- -- Check that Argument_Error is raised when the value of the Cycle
- -- parameter is negative.
-
- begin
- New_Float_Result := GEF.Cos (X => 0.45, Cycle => -2.0*Pi);
- Report.Failed("Argument_Error not raised by GEF.Cos function " &
- "when the Cycle parameter is negative");
- Dont_Optimize_New_Float(New_Float_Result, 5);
- exception
- when Ada.Numerics.Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by GEF.Cos function " &
- "when the Cycle parameter is negative");
- end;
-
- begin
- The_Result := EF.Cos (X => 0.10, Cycle => -Pi/2.0);
- Report.Failed("Argument_Error not raised by EF.Cos function when " &
- "the Cycle parameter is negative");
- Dont_Optimize_Float(The_Result, 6);
- exception
- when Ada.Numerics.Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by EF.Cos function " &
- "when the Cycle parameter is negative");
- end;
-
- -- Test of Cos with Cycle parameter for prescribed result at zero.
-
- if GEF.Cos (0.0, 360.0) /= 1.0 or
- EF.Cos (0.0, 360.0) /= 1.0
- then
- Report.Failed("Incorrect value returned from Cos function with " &
- "cycle parameter for a zero input parameter value");
- end if;
-
-
- -- Tests of Cos function with specified Cycle, using various input
- -- parameter values for prescribed results.
-
- if GEF.Cos(0.0, 360.0) /= 1.0 or
- EF.Cos(360.0, 360.0) /= 1.0 or
- GEF.Cos(90.0, 360.0) /= 0.0 or
- EF.Cos(270.0, 360.0) /= 0.0 or
- GEF.Cos(180.0, 360.0) /= -1.0 or
- EF.Cos(540.0, 360.0) /= -1.0
- then
- Report.Failed("Incorrect result from the Cos function with " &
- "specified cycle for prescribed results");
- end if;
-
-
-
- -- Testing of Cosh Function, both instantiated and pre-instantiated
- -- version.
-
- -- Test for Constraint_Error on parameter with large positive magnitude.
-
- begin
-
- if New_Float'Machine_Overflows then
-
- New_Float_Result := GEF.Cosh (New_Float(FXA5A00.Large));
- Report.Failed("Constraint_Error not raised when the GEF.Cosh " &
- "function is provided a parameter with a large " &
- "positive value");
- Dont_Optimize_New_Float(New_Float_Result, 9);
- end if;
-
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Constraint_Error not raised when the GEF.Cosh " &
- "function is provided a parameter with a large " &
- "positive value");
- end;
-
- -- Test for Constraint_Error on parameter with large negative magnitude.
-
- begin
-
- if Float'Machine_Overflows then
- The_Result := EF.Cosh (FXA5A00.Minus_Large);
- Report.Failed("Constraint_Error not raised when the EF.Cosh " &
- "function is provided a parameter with a " &
- "large negative value");
- Dont_Optimize_Float(The_Result, 10);
- end if;
-
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Constraint_Error not raised when the EF.Cosh " &
- "function is provided a parameter with a " &
- "large negative value");
- end;
-
-
- -- Test that no exception occurs when the Cosh function is provided a
- -- very small positive or negative value.
-
- begin
- New_Float_Result := GEF.Cosh (New_Float(FXA5A00.Small));
- Dont_Optimize_New_Float(New_Float_Result, 11);
- exception
- when others =>
- Report.Failed("Unexpected exception on GEF.Cosh with a very" &
- "small positive value");
- end;
-
- begin
- The_Result := EF.Cosh (-FXA5A00.Small);
- Dont_Optimize_Float(The_Result, 12);
- exception
- when others =>
- Report.Failed("Unexpected exception on EF.Cosh with a very" &
- "small negative value");
- end;
-
-
- -- Test for prescribed 1.0 result of Function Cosh with 0.0 parameter.
-
- if GEF.Cosh (0.0) /= 1.0 or
- EF.Cosh (0.0) /= 1.0
- then
- Report.Failed("Incorrect value returned from Cosh(0.0)");
- end if;
-
-
- -- Test of Cosh function with various input parameters.
-
- if not FXA5A00.Result_Within_Range(GEF.Cosh(0.24), 1.029, 0.001) or
- not FXA5A00.Result_Within_Range( EF.Cosh(0.59), 1.179, 0.001) or
- not FXA5A00.Result_Within_Range(GEF.Cosh(1.06), 1.616, 0.001) or
- not FXA5A00.Result_Within_Range( EF.Cosh(1.50), 2.352, 0.001) or
- not FXA5A00.Result_Within_Range(GEF.Cosh(1.84), 3.228, 0.001) or
- not FXA5A00.Result_Within_Range( EF.Cosh(3.40), 14.99, 0.01)
- then
- Report.Failed("Incorrect result from Cosh function with " &
- "various input parameters");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA5A02;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5a03.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5a03.a
deleted file mode 100644
index d99ba9bdcf0..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5a03.a
+++ /dev/null
@@ -1,426 +0,0 @@
--- CXA5A03.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functions Tan, Tanh, and Arctanh provide correct
--- results.
---
--- TEST DESCRIPTION:
--- This test examines both the version of Tan, Tanh, and Arctanh
--- the instantiation of the Ada.Numerics.Generic_Elementary_Functions
--- with a type derived from type Float, as well as the preinstantiated
--- version of this package for type Float.
--- Prescribed results, including instances prescribed to raise
--- exceptions, are examined in the test cases. In addition,
--- certain evaluations are performed where the actual function result
--- is compared with the expected result (within an epsilon range of
--- accuracy).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXA5A00.A (foundation code)
--- CXA5A03.A
---
---
--- CHANGE HISTORY:
--- 14 Mar 95 SAIC Initial prerelease version.
--- 06 Apr 95 SAIC Corrected errors in context clause references
--- and usage of Cycle parameter.
--- 13 Jun 95 SAIC Incorporated use of Dont_Optimize procedure, and
--- use of Result_Within_Range function overloaded for
--- FXA5A00.New_Float_Type.
--- 29 Jun 98 EDS Protected exception tests by first testing
--- for 'Machine_Overflows
---
---!
-
-with Ada.Numerics.Elementary_Functions;
-with Ada.Numerics.Generic_Elementary_Functions;
-with FXA5A00;
-with Report;
-
-procedure CXA5A03 is
-begin
-
- Report.Test ("CXA5A03", "Check that the functions Tan, Tanh, and " &
- "Arctanh provide correct results");
-
- Test_Block:
- declare
-
- use Ada.Numerics;
- use FXA5A00;
-
- package GEF is new Ada.Numerics.Generic_Elementary_Functions(New_Float);
- package EF renames Ada.Numerics.Elementary_Functions;
-
- The_Result : Float;
- New_Float_Result : New_Float;
-
- procedure Dont_Optimize_Float is new Dont_Optimize(Float);
- procedure Dont_Optimize_New_Float is new Dont_Optimize(New_Float);
-
- begin
-
- -- Testing of Tan Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that no exception occurs on computing the Tan with very
- -- large (positive and negative) input values.
-
- begin
- New_Float_Result := GEF.Tan (New_Float(FXA5A00.Large));
- Dont_Optimize_New_Float(New_Float_Result, 1);
- exception
- when others =>
- Report.Failed("Unexpected exception on GEF.Tan with large " &
- "positive value");
- end;
-
- begin
- The_Result := EF.Tan (FXA5A00.Minus_Large);
- Dont_Optimize_Float(The_Result, 2);
- exception
- when others =>
- Report.Failed("Unexpected exception on EF.Tan with large " &
- "negative value");
- end;
-
-
- -- Check that no exception occurs on computing the Tan with very
- -- small (positive and negative) input values.
-
- begin
- New_Float_Result := GEF.Tan (New_Float(FXA5A00.Small));
- Dont_Optimize_New_Float(New_Float_Result, 3);
- exception
- when others =>
- Report.Failed("Unexpected exception on GEF.Tan with small " &
- "positive value");
- end;
-
- begin
- The_Result := EF.Tan (-FXA5A00.Small);
- Dont_Optimize_Float(The_Result, 4);
- exception
- when others =>
- Report.Failed("Unexpected exception on EF.Tan with small " &
- "negative value");
- end;
-
-
- -- Check prescribed result from Tan function. When the parameter X
- -- has the value zero, the Tan function yields a result of zero.
-
- if GEF.Tan(0.0) /= 0.0 or
- EF.Tan(0.0) /= 0.0
- then
- Report.Failed("Incorrect result from Tan function with zero " &
- "value input parameter");
- end if;
-
-
- -- Check the results of the Tan function with various input parameters.
-
- if not (Result_Within_Range(GEF.Tan(0.7854), 1.0, 0.001) and
- Result_Within_Range(GEF.Tan(0.8436), 1.124, 0.001) and
- Result_Within_Range( EF.Tan(Pi), 0.0, 0.001) and
- Result_Within_Range( EF.Tan(-Pi), 0.0, 0.001) and
- Result_Within_Range(GEF.Tan(0.5381), 0.597, 0.001) and
- Result_Within_Range( EF.Tan(0.1978), 0.200, 0.001))
- then
- Report.Failed("Incorrect result from Tan function with various " &
- "input parameters");
- end if;
-
-
- -- Testing of Tan function with cycle parameter.
-
- -- Check that Constraint_Error is raised by the Tan function with
- -- specified cycle, when the value of the parameter X is an odd
- -- multiple of the quarter cycle.
-
- if New_Float'Machine_Overflows = True then
- begin
- New_Float_Result := GEF.Tan(270.0, 360.0);
- Report.Failed("Constraint_Error not raised by GEF.Tan on odd " &
- "multiple of the quarter cycle");
- Dont_Optimize_New_Float(New_Float_Result, 5);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by GEF.Tan on odd " &
- "multiple of the quarter cycle");
- end;
- end if;
-
- -- Check that the exception Numerics.Argument_Error is raised, when
- -- the value of the parameter Cycle is zero or negative.
-
- begin
- New_Float_Result := GEF.Tan(X => 1.0, Cycle => -360.0);
- Report.Failed("Argument_Error not raised by GEF.Tan when Cycle " &
- "parameter has negative value");
- Dont_Optimize_New_Float(New_Float_Result, 6);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by GEF.Tan when Cycle " &
- "parameter has negative value");
- end;
-
- begin
- The_Result := EF.Tan(1.0, Cycle => 0.0);
- Report.Failed("Argument_Error not raised by GEF.Tan when Cycle " &
- "parameter has a zero value");
- Dont_Optimize_Float(The_Result, 7);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by EF.Tan when Cycle " &
- "parameter has a zero value");
- end;
-
-
- -- Check that no exception occurs on computing the Tan with very
- -- large (positive and negative) input values.
-
- begin
- New_Float_Result := GEF.Tan (New_Float(FXA5A00.Large), 360.0);
- Dont_Optimize_New_Float(New_Float_Result, 8);
- exception
- when others =>
- Report.Failed("Unexpected exception on GEF.Tan with large " &
- "positive value");
- end;
-
- begin
- The_Result := EF.Tan (FXA5A00.Minus_Large, Cycle => 360.0);
- Dont_Optimize_Float(The_Result, 9);
- exception
- when others =>
- Report.Failed("Unexpected exception on EF.Tan with large " &
- "negative value");
- end;
-
-
- -- Check prescribed result from Tan function with Cycle parameter.
-
- if GEF.Tan(0.0, 360.0) /= 0.0 or
- EF.Tan(0.0, Cycle => 360.0) /= 0.0
- then
- Report.Failed("Incorrect result from Tan function with cycle " &
- "parameter, using a zero value input parameter");
- end if;
-
-
- -- Check the Tan function, with specified Cycle parameter, with a
- -- variety of input parameters.
-
- if not Result_Within_Range(GEF.Tan(30.0, 360.0), 0.577, 0.001) or
- not Result_Within_Range( EF.Tan(57.0, 360.0), 1.540, 0.001) or
- not Result_Within_Range(GEF.Tan(115.0, 360.0), -2.145, 0.001) or
- not Result_Within_Range( EF.Tan(299.0, 360.0), -1.804, 0.001) or
- not Result_Within_Range(GEF.Tan(390.0, 360.0), 0.577, 0.001) or
- not Result_Within_Range( EF.Tan(520.0, 360.0), -0.364, 0.001)
- then
- Report.Failed("Incorrect result from the Tan function with " &
- "cycle parameter, with various input parameter " &
- "values");
- end if;
-
-
-
- -- Testing of Tanh Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that no exception occurs on computing the Tan with very
- -- large (positive and negative) input values.
-
- begin
- New_Float_Result := GEF.Tanh (New_Float(FXA5A00.Large));
- Dont_Optimize_New_Float(New_Float_Result, 10);
- exception
- when others =>
- Report.Failed("Unexpected exception on GEF.Tanh with large " &
- "positive value");
- end;
-
- begin
- The_Result := EF.Tanh (FXA5A00.Minus_Large);
- Dont_Optimize_Float(The_Result, 11);
- exception
- when others =>
- Report.Failed("Unexpected exception on EF.Tanh with large " &
- "negative value");
- end;
-
-
- -- Check for prescribed result of Tanh with zero value input parameter.
-
- if GEF.Tanh (0.0) /= 0.0 or
- EF.Tanh (0.0) /= 0.0
- then
- Report.Failed("Incorrect result from Tanh with zero parameter");
- end if;
-
-
- -- Check the results of the Tanh function with various input
- -- parameters.
-
- if not (FXA5A00.Result_Within_Range(GEF.Tanh(2.99), 0.995, 0.001) and
- FXA5A00.Result_Within_Range(GEF.Tanh(0.130), 0.129, 0.001) and
- FXA5A00.Result_Within_Range( EF.Tanh(Pi), 0.996, 0.001) and
- FXA5A00.Result_Within_Range( EF.Tanh(-Pi), -0.996, 0.001) and
- FXA5A00.Result_Within_Range(GEF.Tanh(0.60), 0.537, 0.001) and
- FXA5A00.Result_Within_Range( EF.Tanh(1.04), 0.778, 0.001) and
- FXA5A00.Result_Within_Range(GEF.Tanh(1.55), 0.914, 0.001) and
- FXA5A00.Result_Within_Range( EF.Tanh(-2.14), -0.973, 0.001))
- then
- Report.Failed("Incorrect result from Tanh function with various " &
- "input parameters");
- end if;
-
-
-
- -- Testing of Arctanh Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that Constraint_Error is raised by the Arctanh function
- -- when the absolute value of the parameter X is one.
-
- if New_Float'Machine_Overflows = True then
- begin
- New_Float_Result := GEF.Arctanh(X => 1.0);
- Report.Failed("Constraint_Error not raised by Function Arctanh " &
- "when provided a parameter value of 1.0");
- Dont_Optimize_New_Float(New_Float_Result, 12);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Arctanh "
- & "when provided a parameter value of 1.0");
- end;
- end if;
-
- if Float'Machine_Overflows = True then
- begin
- The_Result := EF.Arctanh(-1.0);
- Report.Failed("Constraint_Error not raised by Function Arctanh " &
- "when provided a parameter value of -1.0");
- Dont_Optimize_Float(The_Result, 13);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Arctanh "
- & "when provided a parameter value of -1.0");
- end;
- end if;
-
- -- Check that Function Arctanh raises Argument_Error when the absolute
- -- value of the parameter X exceeds one.
-
- begin
- New_Float_Result := GEF.Arctanh(New_Float(FXA5A00.One_Plus_Delta));
- Report.Failed("Argument_Error not raised by Function Arctanh " &
- "when provided a parameter value greater than 1.0");
- Dont_Optimize_New_Float(New_Float_Result, 14);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Arctanh " &
- "when provided a parameter value greater than 1.0");
- end;
-
-
- begin
- The_Result := EF.Arctanh(FXA5A00.Minus_One_Minus_Delta);
- Report.Failed("Argument_Error not raised by Function Arctanh " &
- "when provided a parameter value less than -1.0");
- Dont_Optimize_Float(The_Result, 15);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Arctanh " &
- "when provided a parameter value less than -1.0");
- end;
-
-
- begin
- New_Float_Result := GEF.Arctanh(New_Float(FXA5A00.Large));
- Report.Failed("Argument_Error not raised by Function Arctanh " &
- "when provided a large positive parameter value");
- Dont_Optimize_New_Float(New_Float_Result, 16);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Arctanh " &
- "when provided a large positive parameter value");
- end;
-
-
- begin
- The_Result := EF.Arctanh(FXA5A00.Minus_Large);
- Report.Failed("Argument_Error not raised by Function Arctanh " &
- "when provided a large negative parameter value");
- Dont_Optimize_Float(The_Result, 17);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Arctanh " &
- "when provided a large negative parameter value");
- end;
-
-
- -- Prescribed results for Function Arctanh with zero input value.
-
- if GEF.Arctanh(0.0) /= 0.0 or
- EF.Arctanh(0.0) /= 0.0
- then
- Report.Failed("Incorrect result from Function Arctanh with a " &
- "parameter value of zero");
- end if;
-
-
- -- Check the results of the Arctanh function with various input
- -- parameters.
-
- if not (Result_Within_Range(GEF.Arctanh(0.15), 0.151, 0.001) and
- Result_Within_Range( EF.Arctanh(0.44), 0.472, 0.001) and
- Result_Within_Range(GEF.Arctanh(0.81), 1.127, 0.001) and
- Result_Within_Range( EF.Arctanh(0.99), 2.647, 0.001))
- then
- Report.Failed("Incorrect result from Arctanh function with " &
- "various input parameters");
- end if;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA5A03;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5a04.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5a04.a
deleted file mode 100644
index 9b590a23cb8..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5a04.a
+++ /dev/null
@@ -1,434 +0,0 @@
--- CXA5A04.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functions Cot, Coth, and Arccoth provide correct
--- results.
---
--- TEST DESCRIPTION:
--- This test examines both the version of Cot, Coth, and Arccoth
--- the instantiation of the Ada.Numerics.Generic_Elementary_Functions
--- with a type derived from type Float, as well as the preinstantiated
--- version of this package for type Float.
--- Prescribed results, including instances prescribed to raise
--- exceptions, are examined in the test cases. In addition,
--- certain evaluations are performed where the actual function result
--- is compared with the expected result (within an epsilon range of
--- accuracy).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXA5A00.A (foundation code)
--- CXA5A04.A
---
---
--- CHANGE HISTORY:
--- 15 Mar 95 SAIC Initial prerelease version.
--- 07 Apr 95 SAIC Corrected errors in context clause reference,
--- added trigonometric relationship checks.
--- 13 Jun 95 SAIC Incorporated use of Dont_Optimize procedure, and
--- use of Result_Within_Range function overloaded for
--- FXA5A00.New_Float_Type.
--- 18 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 28 Feb 97 PWB.CTA Removed checks with explicit Cycle => 2.0*Pi
--- 29 Jun 98 EDS Protected exception tests by first testing
--- for 'Machine_Overflows
---
--- CHANGE NOTE:
--- According to Ken Dritz, author of the Numerics Annex of the RM,
--- one should never specify the cycle 2.0*Pi for the trigonometric
--- functions. In particular, if the machine number for the first
--- argument is not an exact multiple of the machine number for the
--- explicit cycle, then the specified exact results cannot be
--- reasonably expected. The affected checks in this test have been
--- marked as comments, with the additional notation "pwb-math".
--- Phil Brashear
---!
-
-with Ada.Exceptions;
-with Ada.Numerics.Elementary_Functions;
-with Ada.Numerics.Generic_Elementary_Functions;
-with FXA5A00;
-with Report;
-
-procedure CXA5A04 is
-begin
-
- Report.Test ("CXA5A04", "Check that the functions Cot, Coth, and " &
- "Arccoth provide correct results");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
- use Ada.Numerics;
- use FXA5A00;
-
- package GEF is new Ada.Numerics.Generic_Elementary_Functions(New_Float);
- package EF renames Ada.Numerics.Elementary_Functions;
-
- The_Result : Float;
- New_Float_Result : New_Float;
-
- procedure Dont_Optimize_Float is new Dont_Optimize(Float);
- procedure Dont_Optimize_New_Float is new Dont_Optimize(New_Float);
-
- begin
-
- -- Testing of Cot Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that Constraint_Error is raised with the Cot function is
- -- given a parameter input value of 0.0.
-
- if New_Float'Machine_Overflows = True then
- begin
- New_Float_Result := GEF.Cot (0.0);
- Report.Failed("Constraint_Error not raised by Function Cot " &
- "when provided a zero input parameter value");
- Dont_Optimize_New_Float(New_Float_Result, 1);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Cot " &
- "when provided a zero input parameter value");
- end;
- end if;
-
- -- Check that no exception occurs on computing the Cot with very
- -- large (positive and negative) input values.
-
- begin
- New_Float_Result := GEF.Cot (New_Float(FXA5A00.Large));
- Dont_Optimize_New_Float(New_Float_Result, 2);
- exception
- when others =>
- Report.Failed("Unexpected exception on GEF.Cot with large " &
- "positive value");
- end;
-
- begin
- The_Result := EF.Cot (FXA5A00.Minus_Large);
- Dont_Optimize_Float(The_Result, 3);
- exception
- when others =>
- Report.Failed("Unexpected exception on EF.Cot with large " &
- "negative value");
- end;
-
-
- -- Check the results of the Cot function with various input parameters.
-
- if not (FXA5A00.Result_Within_Range(GEF.Cot(Pi/4.0), 1.0, 0.001) and
- FXA5A00.Result_Within_Range( EF.Cot(Pi/2.0), 0.0, 0.001) and
- FXA5A00.Result_Within_Range(GEF.Cot(3.0*Pi/4.0),-1.0, 0.001) and
- FXA5A00.Result_Within_Range( EF.Cot(3.0*Pi/2.0), 0.0, 0.001))
- then
- Report.Failed("Incorrect result from Cot function with various " &
- "input parameters");
- end if;
-
-
- -- Check the results of the Cot function against the results of
- -- various trigonometric relationships.
-
- if not FXA5A00.Result_Within_Range(GEF.Cot(New_Float(Pi/4.0)),
- 1.0/EF.Tan(Pi/4.0),
- 0.001) or
- not FXA5A00.Result_Within_Range(EF.Cot(Pi/4.0),
- EF.Cos(Pi/4.0)/EF.Sin(Pi/4.0),
- 0.001) or
- not FXA5A00.Result_Within_Range(EF.Cot(EF.Arccot(Pi/4.0)),
- Pi/4.0,
- 0.001)
- then
- Report.Failed("Incorrect result from Cot function with respect " &
- "to various trigonometric relationship expected " &
- "results");
- end if;
-
-
- -- Testing of Cot with Cycle parameter.
-
- -- Check that Argument_Error is raised by the Cot function when the
- -- value of the Cycle parameter is zero or negative.
-
- begin
- New_Float_Result := GEF.Cot (1.0, Cycle => 0.0);
- Report.Failed("Argument_Error not raised by the Cot Function " &
- "with a specified cycle value of 0.0");
- Dont_Optimize_New_Float(New_Float_Result, 4);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Unexpected exception raised by the Cot Function with " &
- "a specified cycle value of 0.0");
- end;
-
- begin
- The_Result := EF.Cot (X => 1.0, Cycle => -360.0);
- Report.Failed("Argument_Error not raised by the Cot Function " &
- "with a specified cycle value of -360.0");
- Dont_Optimize_Float(The_Result, 5);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Unexpected exception raised by the Cot Function with " &
- "a specified cycle value of -360.0");
- end;
-
-
- -- Check that Constraint_Error is raised by the Cot Function with
- -- specified cycle, when the value of the parameter X is 0.0.
-
- if New_Float'Machine_Overflows = True then
- begin
- New_Float_Result := GEF.Cot (0.0, 360.0);
- Report.Failed("Constraint_Error not raised by Function Cot " &
- "with specified cycle, when value of parameter " &
- "X is 0.0");
- Dont_Optimize_New_Float(New_Float_Result, 6);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Cot " &
- "with specified cycle, when value of parameter " &
- "X is 0.0");
- end;
- end if;
-
- -- Check that Constraint_Error is raised by the Cot Function with
- -- specified cycle, when the value of the parameter X is a multiple
- -- of the half cycle.
-
- if New_Float'Machine_Overflows = True then
- begin
- New_Float_Result := GEF.Cot (180.0, 360.0);
- Report.Failed("Constraint_Error not raised by Function Cot " &
- "with specified cycle, when value of parameter " &
- "X is a multiple of the half cycle (180.0, 360.0)");
- Dont_Optimize_New_Float(New_Float_Result, 7);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Cot " &
- "with specified cycle, when value of parameter " &
- "X is a multiple of the half cycle" &
- " (180.0, 360.0)");
- end;
- end if;
-
- if Float'Machine_Overflows = True then
- begin
- The_Result := EF.Cot (540.0, 360.0);
- Report.Failed("Constraint_Error not raised by Function Cot " &
- "with specified cycle, when value of parameter " &
- "X is a multiple of the half cycle (540.0, 360.0)");
- Dont_Optimize_Float(The_Result, 8);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Cot " &
- "with specified cycle, when value of parameter " &
- "X is a multiple of the half cycle (540.0, 360.0)");
- end;
- end if;
-
---pwb-math -- Check that no exception occurs on computing the Cot with very
---pwb-math -- large (positive and negative) input values.
---pwb-math
---pwb-math begin
---pwb-math New_Float_Result := GEF.Cot (New_Float(FXA5A00.Large), 2.0*Pi);
---pwb-math Dont_Optimize_New_Float(New_Float_Result, 9);
---pwb-math exception
---pwb-math when others =>
---pwb-math Report.Failed("Unexpected exception on GEF.Cot with large " &
---pwb-math "positive value");
---pwb-math end;
---pwb-math
---pwb-math begin
---pwb-math The_Result := EF.Cot (FXA5A00.Minus_Large, Cycle => 2.0*Pi);
---pwb-math Dont_Optimize_Float(The_Result, 10);
---pwb-math exception
---pwb-math when others =>
---pwb-math Report.Failed("Unexpected exception on EF.Cot with large " &
---pwb-math "negative value");
---pwb-math end;
---pwb-math
---pwb-math
---pwb-math -- Check prescribed result from Cot function with Cycle parameter.
---pwb-math
---pwb-math if not FXA5A00.Result_Within_Range
---pwb-math (GEF.Cot(New_Float(FXA5A00.Half_Pi), 2.0*Pi), 0.0, 0.001) or
---pwb-math not FXA5A00.Result_Within_Range
---pwb-math (EF.Cot(3.0*Pi/2.0, Cycle => 2.0*Pi), 0.0, 0.001)
---pwb-math then
---pwb-math Report.Failed("Incorrect result from Cot function with cycle " &
---pwb-math "parameter, using a multiple of Pi/2 as the " &
---pwb-math "input parameter");
---pwb-math end if;
-
-
- -- Testing of Coth Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that no exception occurs on computing the Coth with very
- -- large (positive and negative) input values.
-
- begin
- The_Result := EF.Coth (FXA5A00.Large);
- if The_Result > 1.0 then
- Report.Failed("Result of Coth function with large positive " &
- "value greater than 1.0");
- end if;
- exception
- when others =>
- Report.Failed("Unexpected exception on EF.Coth with large " &
- "positive value");
- end;
-
- begin
- The_Result := EF.Coth (FXA5A00.Minus_Large);
- if The_Result < -1.0 then
- Report.Failed("Result of Coth function with large negative " &
- "value less than -1.0");
- end if;
- exception
- when others =>
- Report.Failed("Unexpected exception on EF.Coth with large " &
- "negative value");
- end;
-
-
- -- Check that Constraint_Error is raised by the Coth function, when
- -- the value of the parameter X is 0.0.
-
- if New_Float'Machine_Overflows = True then
- begin
- New_Float_Result := GEF.Coth (X => 0.0);
- Report.Failed("Constraint_Error not raised by the Coth function " &
- "when the value of parameter X is 0.0");
- Dont_Optimize_New_Float(New_Float_Result, 11);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Coth " &
- "function when the value of parameter X is 0.0");
- end;
- end if;
-
-
- -- Testing of Arccoth Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that Constraint_Error is raised by the Arccoth function
- -- when the absolute value of the parameter X is 1.0.
-
- if New_Float'Machine_Overflows = True then
- begin
- New_Float_Result := GEF.Arccoth (X => 1.0);
- Report.Failed("Constraint_Error not raised by the Arccoth " &
- "function when the value of parameter X is 1.0");
- Dont_Optimize_New_Float(New_Float_Result, 12);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccoth " &
- "function when the value of parameter X is 1.0");
- end;
- end if;
-
- if Float'Machine_Overflows = True then
- begin
- The_Result := EF.Arccoth (-1.0);
- Report.Failed("Constraint_Error not raised by the Arccoth " &
- "function when the value of parameter X is -1.0");
- Dont_Optimize_Float(The_Result, 13);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccoth " &
- "function when the value of parameter X is -1.0");
- end;
- end if;
-
- -- Check that Argument_Error is raised by the Arccoth function when
- -- the absolute value of the parameter X is less than 1.0.
-
- begin
- New_Float_Result := GEF.Arccoth (X => New_Float(One_Minus_Delta));
- Report.Failed("Argument_Error not raised by the Arccoth " &
- "function with parameter value less than 1.0");
- Dont_Optimize_New_Float(New_Float_Result, 14);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccoth " &
- "function with parameter value less than 1.0");
- end;
-
- begin
- The_Result := EF.Arccoth (X => FXA5A00.Minus_One_Plus_Delta);
- Report.Failed("Argument_Error not raised by the Arccoth function " &
- "with parameter value between 0.0 and -1.0");
- Dont_Optimize_Float(The_Result, 15);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccoth " &
- "function with parameter value between 0.0 " &
- "and -1.0");
- end;
-
-
- -- Check the results of the Arccoth function with various input
- -- parameters.
-
- if not (Result_Within_Range(GEF.Arccoth(1.01), 2.652, 0.01) and
- Result_Within_Range( EF.Arccoth(1.25), 1.099, 0.01) and
- Result_Within_Range(GEF.Arccoth(1.56), 0.760, 0.001) and
- Result_Within_Range( EF.Arccoth(1.97), 0.560, 0.001) and
- Result_Within_Range(GEF.Arccoth(2.40), 0.444, 0.001) and
- Result_Within_Range( EF.Arccoth(4.30), 0.237, 0.001) and
- Result_Within_Range(GEF.Arccoth(5.80), 0.174, 0.001) and
- Result_Within_Range( EF.Arccoth(7.00), 0.144, 0.001))
- then
- Report.Failed("Incorrect result from Arccoth function with various " &
- "input parameters");
- end if;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXA5A04;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5a05.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5a05.a
deleted file mode 100644
index b50da3a6ab5..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5a05.a
+++ /dev/null
@@ -1,338 +0,0 @@
--- CXA5A05.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functions Arcsin and Arcsinh provide correct
--- results.
---
--- TEST DESCRIPTION:
--- This test examines both the version of Arcsin and Arcsinh
--- the instantiation of the Ada.Numerics.Generic_Elementary_Functions
--- with a type derived from type Float, as well as the preinstantiated
--- version of this package for type Float.
--- Prescribed results, including instances prescribed to raise
--- exceptions, are examined in the test cases. In addition,
--- certain evaluations are performed where the actual function result
--- is compared with the expected result (within an epsilon range of
--- accuracy).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXA5A00.A (foundation code)
--- CXA5A05.A
---
---
--- CHANGE HISTORY:
--- 20 Mar 95 SAIC Initial prerelease version.
--- 06 Apr 95 SAIC Corrected errors in context clause reference and
--- use of Cycle parameter.
--- 13 Jun 95 SAIC Incorporated use of Dont_Optimize procedure, and
--- use of Result_Within_Range function overloaded for
--- FXA5A00.New_Float_Type.
--- 28 Feb 97 PWB.CTA Removed checks with explict Cycle => 2.0*Pi
---
--- CHANGE NOTE:
--- According to Ken Dritz, author of the Numerics Annex of the RM,
--- one should never specify the cycle 2.0*Pi for the trigonometric
--- functions. In particular, if the machine number for the first
--- argument is not an exact multiple of the machine number for the
--- explicit cycle, then the specified exact results cannot be
--- reasonably expected. The affected checks in this test have been
--- marked as comments, with the additional notation "pwb-math".
--- Phil Brashear
---!
-
-with Ada.Numerics.Elementary_Functions;
-with Ada.Numerics.Generic_Elementary_Functions;
-with FXA5A00;
-with Report;
-
-procedure CXA5A05 is
-begin
-
- Report.Test ("CXA5A05", "Check that the functions Arcsin and Arcsinh " &
- "provide correct results");
-
- Test_Block:
- declare
-
- use Ada.Numerics;
- use FXA5A00;
-
- package GEF is new Ada.Numerics.Generic_Elementary_Functions(New_Float);
- package EF renames Ada.Numerics.Elementary_Functions;
-
- The_Result : Float;
- New_Float_Result : New_Float;
-
- procedure Dont_Optimize_Float is new Dont_Optimize(Float);
- procedure Dont_Optimize_New_Float is new Dont_Optimize(New_Float);
-
- begin
-
- -- Testing of Function Arcsin, both instantiated and pre-instantiated
- -- versions.
-
- -- Check that Argument_Error is raised by the Arcsin function when
- -- the absolute value of the parameter X is greater than 1.0.
-
- begin
- New_Float_Result := GEF.Arcsin(New_Float(FXA5A00.One_Plus_Delta));
- Report.Failed("Argument_Error not raised by Arcsin function " &
- "when provided a parameter value larger than 1.0");
- Dont_Optimize_New_Float(New_Float_Result, 1);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Arcsin function " &
- "when provided a parameter value larger than 1.0");
- end;
-
- begin
- The_Result := EF.Arcsin(FXA5A00.Minus_Large);
- Report.Failed("Argument_Error not raised by Arcsin function " &
- "when provided a large negative parameter value");
- Dont_Optimize_Float(The_Result, 2);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Arcsin function " &
- "when provided a large negative parameter value");
- end;
-
-
- -- Check the prescribed result of function Arcsin with parameter 0.0.
-
- if GEF.Arcsin(X => 0.0) /= 0.0 or
- EF.Arcsin(0.0) /= 0.0
- then
- Report.Failed("Incorrect result from Function Arcsin when the " &
- "value of the parameter X is 0.0");
- end if;
-
-
- -- Check the results of the Arcsin function with various input
- -- parameters.
-
- if not Result_Within_Range(GEF.Arcsin(1.0), 1.571, 0.001) or
- not Result_Within_Range( EF.Arcsin(0.62), 0.669, 0.001) or
- not Result_Within_Range(GEF.Arcsin(0.01), 0.010, 0.001) or
- not Result_Within_Range( EF.Arcsin(-0.29), -0.294, 0.001) or
- not Result_Within_Range(GEF.Arcsin(-0.50), -0.524, 0.001) or
- not Result_Within_Range( EF.Arcsin(-1.0), -1.571, 0.001)
- then
- Report.Failed("Incorrect result from Function Arcsin with " &
- "various input parameters");
- end if;
-
-
- -- Testing of Function Arcsin with specified Cycle parameter.
-
---pwb-math -- Check that Argument_Error is raised by the Arcsin function with
---pwb-math -- specified cycle, whenever the absolute value of the parameter X
---pwb-math -- is greater than 1.0.
---pwb-math
---pwb-math begin
---pwb-math New_Float_Result := GEF.Arcsin(New_Float(FXA5A00.Large), 2.0*Pi);
---pwb-math Report.Failed("Argument_Error not raised by Function Arcsin " &
---pwb-math "with specified cycle, when provided a large " &
---pwb-math "positive input parameter");
---pwb-math Dont_Optimize_New_Float(New_Float_Result, 3);
---pwb-math exception
---pwb-math when Argument_Error => null; -- OK, expected exception.
---pwb-math when others =>
---pwb-math Report.Failed("Unexpected exception raised by Function Arcsin " &
---pwb-math "with specified cycle, when provided a large " &
---pwb-math "positive input parameter");
---pwb-math end;
---pwb-math
---pwb-math begin
---pwb-math The_Result := EF.Arcsin(FXA5A00.Minus_One_Minus_Delta, 2.0*Pi);
---pwb-math Report.Failed("Argument_Error not raised by Function Arcsin " &
---pwb-math "with specified cycle, when provided an input " &
---pwb-math "parameter less than -1.0");
---pwb-math Dont_Optimize_Float(The_Result, 4);
---pwb-math exception
---pwb-math when Argument_Error => null; -- OK, expected exception.
---pwb-math when others =>
---pwb-math Report.Failed("Unexpected exception raised by Function Arcsin " &
---pwb-math "with specified cycle, when provided an input " &
---pwb-math "parameter less than -1.0");
---pwb-math end;
---pwb-math
- -- Check that Argument_Error is raised by the Arcsin function with
- -- specified cycle, whenever the Cycle parameter is zero or negative.
-
- begin
- New_Float_Result := GEF.Arcsin(2.0, 0.0);
- Report.Failed("Argument_Error not raised by Function Arcsin " &
- "with specified cycle of 0.0");
- Dont_Optimize_New_Float(New_Float_Result, 5);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Arcsin " &
- "with specified cycle of 0.0");
- end;
-
- begin
- The_Result := EF.Arcsin(2.0, -2.0*Pi);
- Report.Failed("Argument_Error not raised by Function Arcsin " &
- "with specified negative cycle parameter");
- Dont_Optimize_Float(The_Result, 6);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Arcsin " &
- "with specified negative cycle parameter");
- end;
-
-
---pwb-math -- Check the prescribed result of function Arcsin with specified Cycle
---pwb-math -- parameter, when the value of parameter X is 0.0.
---pwb-math
---pwb-math if GEF.Arcsin(X => 0.0, Cycle => 2.0*Pi) /= 0.0 or
---pwb-math EF.Arcsin(0.0, 2.0*Pi) /= 0.0
---pwb-math then
---pwb-math Report.Failed("Incorrect result from Function Arcsin with " &
---pwb-math "specified Cycle parameter, when the value " &
---pwb-math "of parameter X is 0.0");
---pwb-math end if;
---pwb-math
---pwb-math
---pwb-math -- Test of the Arcsin function with specified Cycle parameter with
---pwb-math -- various input parameters.
---pwb-math
---pwb-math if not FXA5A00.Result_Within_Range(GEF.Arcsin( 0.01, 2.0*Pi),
---pwb-math 0.010,
---pwb-math 0.001) or
---pwb-math not FXA5A00.Result_Within_Range( EF.Arcsin( 0.14, 2.0*Pi),
---pwb-math 0.141,
---pwb-math 0.001) or
---pwb-math not FXA5A00.Result_Within_Range(GEF.Arcsin( 0.37, 2.0*Pi),
---pwb-math 0.379,
---pwb-math 0.001) or
---pwb-math not FXA5A00.Result_Within_Range( EF.Arcsin( 0.55, 2.0*Pi),
---pwb-math 0.582,
---pwb-math 0.001) or
---pwb-math not FXA5A00.Result_Within_Range(GEF.Arcsin(-0.22, 2.0*Pi),
---pwb-math -0.222,
---pwb-math 0.001) or
---pwb-math not FXA5A00.Result_Within_Range( EF.Arcsin(-0.99, 2.0*Pi),
---pwb-math -1.43,
---pwb-math 0.01) or
---pwb-math not FXA5A00.Result_Within_Range( EF.Arcsin(1.0, 360.0),
---pwb-math 90.0,
---pwb-math 0.1) or
---pwb-math not FXA5A00.Result_Within_Range( EF.Arcsin(1.0, 100.0),
---pwb-math 25.0,
---pwb-math 0.1)
---pwb-math then
---pwb-math Report.Failed("Incorrect result from Arcsin with specified " &
---pwb-math "cycle parameter with various input parameters");
---pwb-math end if;
-
- -- Testing of Arcsinh Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that no exception occurs on computing the Arcsinh with very
- -- large (positive and negative) input values.
-
- begin
- New_Float_Result := GEF.Arcsinh(New_Float(FXA5A00.Large));
- Dont_Optimize_New_Float(New_Float_Result, 7);
- exception
- when others =>
- Report.Failed("Unexpected exception on Arcsinh with large " &
- "positive value");
- end;
-
- begin
- The_Result := EF.Arcsinh(FXA5A00.Minus_Large);
- Dont_Optimize_Float(The_Result, 8);
- exception
- when others =>
- Report.Failed("Unexpected exception on Arcsinh with large " &
- "negative value");
- end;
-
-
- -- Check that no exception occurs on computing the Arcsinh with very
- -- small (positive and negative) input values.
-
- begin
- New_Float_Result := GEF.Arcsinh(New_Float(FXA5A00.Small));
- Dont_Optimize_New_Float(New_Float_Result, 9);
- exception
- when others =>
- Report.Failed("Unexpected exception on Arcsinh with small " &
- "positive value");
- end;
-
- begin
- The_Result := EF.Arcsinh(-FXA5A00.Small);
- Dont_Optimize_Float(The_Result, 10);
- exception
- when others =>
- Report.Failed("Unexpected exception on Arcsinh with small " &
- "negative value");
- end;
-
-
- -- Check function Arcsinh for prescribed result with parameter 0.0.
-
- if GEF.Arcsinh(X => 0.0) /= 0.0 or
- EF.Arcsinh(X => 0.0) /= 0.0
- then
- Report.Failed("Incorrect result from Function Arcsinh when " &
- "provided a 0.0 input parameter");
- end if;
-
-
- -- Check the results of the Arcsinh function with various input
- -- parameters.
-
- if not Result_Within_Range(GEF.Arcsinh(0.15), 0.149, 0.001) or
- not Result_Within_Range( EF.Arcsinh(0.82), 0.748, 0.001) or
- not Result_Within_Range(GEF.Arcsinh(1.44), 1.161, 0.001) or
- not Result_Within_Range(GEF.Arcsinh(6.70), 2.601, 0.001) or
- not Result_Within_Range( EF.Arcsinh(Pi), 1.862, 0.001) or
- not Result_Within_Range( EF.Arcsinh(-Pi), -1.862, 0.001) or
- not Result_Within_Range(GEF.Arcsinh(-1.0), -0.881, 0.001) or
- not Result_Within_Range( EF.Arcsinh(-5.5), -2.406, 0.001)
- then
- Report.Failed("Incorrect result from Function Arcsin with " &
- "various input parameters");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA5A05;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5a06.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5a06.a
deleted file mode 100644
index 191a96d7567..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5a06.a
+++ /dev/null
@@ -1,334 +0,0 @@
--- CXA5A06.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functions Arccos and Arccosh provide correct
--- results.
---
--- TEST DESCRIPTION:
--- This test examines both the version of Arccos and Arccosh
--- the instantiation of the Ada.Numerics.Generic_Elementary_Functions
--- with a type derived from type Float, as well as the preinstantiated
--- version of this package for type Float.
--- Prescribed results, including instances prescribed to raise
--- exceptions, are examined in the test cases. In addition,
--- certain evaluations are performed where the actual function result
--- is compared with the expected result (within an epsilon range of
--- accuracy).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXA5A00.A (foundation code)
--- CXA5A06.A
---
---
--- CHANGE HISTORY:
--- 27 Mar 95 SAIC Initial prerelease version.
--- 13 Jun 95 SAIC Incorporated use of Dont_Optimize procedure, and
--- use of Result_Within_Range function overloaded for
--- FXA5A00.New_Float_Type.
--- 28 Feb 97 PWB.CTA Removed checks with explicit Cycle => 2.0*Pi
---
--- CHANGE NOTE:
--- According to Ken Dritz, author of the Numerics Annex of the RM,
--- one should never specify the cycle 2.0*Pi for the trigonometric
--- functions. In particular, if the machine number for the first
--- argument is not an exact multiple of the machine number for the
--- explicit cycle, then the specified exact results cannot be
--- reasonably expected. The affected checks in this test have been
--- marked as comments, with the additional notation "pwb-math".
--- Phil Brashear
---!
-
-with Ada.Numerics.Elementary_Functions;
-with Ada.Numerics.Generic_Elementary_Functions;
-with FXA5A00;
-with Report;
-
-procedure CXA5A06 is
-begin
-
- Report.Test ("CXA5A06", "Check that the functions Arccos and Arccosh " &
- "provide correct results");
-
- Test_Block:
- declare
-
- use Ada.Numerics;
- use FXA5A00;
-
- package GEF is new Ada.Numerics.Generic_Elementary_Functions(New_Float);
- package EF renames Ada.Numerics.Elementary_Functions;
-
- The_Result : Float;
- New_Float_Result : New_Float;
-
- procedure Dont_Optimize_Float is new Dont_Optimize(Float);
- procedure Dont_Optimize_New_Float is new Dont_Optimize(New_Float);
-
- begin
-
- -- Testing of Arccos Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that Argument_Error is raised by the Arccos function when the
- -- absolute value of the input parameter is greater than 1.0.
-
- begin
- New_Float_Result := GEF.Arccos(New_Float(FXA5A00.One_Plus_Delta));
- Report.Failed("Argument_Error not raised by the Arccos function " &
- "when the input parameter is greater than 1.0");
- Dont_Optimize_New_Float(New_Float_Result, 1);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccos " &
- "function when the input parameter is greater " &
- "than 1.0");
- end;
-
- begin
- The_Result := EF.Arccos(-FXA5A00.Large);
- Report.Failed("Argument_Error not raised by the Arccos function " &
- "when the input parameter is a large negative value");
- Dont_Optimize_Float(The_Result, 2);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccos " &
- "function when the input parameter is a " &
- "large negative value");
- end;
-
-
- -- Check the prescribed results of the Arccos function.
-
- if GEF.Arccos(X => 1.0) /= 0.0 or
- EF.Arccos(1.0) /= 0.0
- then
- Report.Failed("Incorrect result returned by the Arccos function " &
- "when provided a parameter value of 0.0");
- end if;
-
-
- -- Check the results of the Arccos function with various input
- -- parameters.
-
- if not Result_Within_Range(GEF.Arccos(0.77), 0.692, 0.001) or
- not Result_Within_Range( EF.Arccos(0.37), 1.19, 0.01) or
- not Result_Within_Range(GEF.Arccos(0.0), Pi/2.0, 0.01) or
- not Result_Within_Range( EF.Arccos(-0.11), 1.68, 0.01) or
- not Result_Within_Range(GEF.Arccos(-0.67), 2.31, 0.01) or
- not Result_Within_Range( EF.Arccos(-0.94), 2.79, 0.01) or
- not Result_Within_Range(GEF.Arccos(-1.0), Pi, 0.01)
- then
- Report.Failed("Incorrect result returned from the Arccos " &
- "function when provided a variety of input " &
- "parameters");
- end if;
-
-
- -- Testing of the Arccos function with specified Cycle parameter.
-
- -- Check that Argument_Error is raised by the Arccos function, with
- -- specified Cycle parameter, when the absolute value of the input
- -- parameter is greater than 1.0.
-
- begin
---pwb-math: Next line: Changed 2.0*Pi to 360.0
- New_Float_Result := GEF.Arccos(New_Float(Large), Cycle => 360.0);
- Report.Failed("Argument_Error not raised by the Arccos function " &
- "with specified Cycle parameter, when the input " &
- "parameter is a large positive value");
- Dont_Optimize_New_Float(New_Float_Result, 3);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccos " &
- "function with specified Cycle parameter, when " &
- "the input parameter is a large positive value");
- end;
-
- begin
---pwb-math: Next line: Changed 2.0*Pi to 360.0
- The_Result := EF.Arccos(FXA5A00.Minus_One_Minus_Delta, 360.0);
- Report.Failed("Argument_Error not raised by the Arccos function " &
- "with specified Cycle parameter, when the input " &
- "parameter is less than -1.0");
- Dont_Optimize_Float(The_Result, 4);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccos " &
- "function with specified Cycle parameter, " &
- "when the input parameter is less than -1.0");
- end;
-
-
- -- Check that Argument_Error is raised by the Arccos function with
- -- specified cycle when the value of the Cycle parameter is zero or
- -- negative.
-
- begin
- New_Float_Result := GEF.Arccos(X => 1.0, Cycle => 0.0 );
- Report.Failed("Argument_Error not raised by the Arccos function " &
- "with specified Cycle parameter, when the Cycle " &
- "parameter is 0.0");
- Dont_Optimize_New_Float(New_Float_Result, 5);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccos " &
- "function with specified Cycle parameter, when " &
- "the Cycle parameter is 0.0");
- end;
-
- begin
- The_Result := EF.Arccos(1.0, Cycle => -2.0*Pi);
- Report.Failed("Argument_Error not raised by the Arccos function " &
- "with specified Cycle parameter, when the Cycle " &
- "parameter is negative");
- Dont_Optimize_Float(The_Result, 6);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccos " &
- "function with specified Cycle parameter, when " &
- "the Cycle parameter is negative");
- end;
-
-
- -- Check the prescribed result of the Arccos function with specified
- -- Cycle parameter.
-
---pwb-math: Next two lines: Changed 2.0*Pi to 360.0
- if GEF.Arccos(X => 1.0, Cycle => 360.0) /= 0.0 or
- EF.Arccos(1.0, 360.0) /= 0.0
- then
- Report.Failed("Incorrect result from the Arccos function with " &
- "specified Cycle parameter, when the input " &
- "parameter value is 1.0");
- end if;
-
-
- -- Check the results of the Arccos function, with specified Cycle
- -- parameter, with various input parameters.
-
- if --pwb-math not Result_Within_Range(GEF.Arccos( 0.04, 2.0*Pi), 1.53, 0.01) or
---pwb-math not Result_Within_Range( EF.Arccos( 0.14, 2.0*Pi), 1.43, 0.01) or
---pwb-math not Result_Within_Range(GEF.Arccos( 0.57, 2.0*Pi), 0.96, 0.01) or
---pwb-math not Result_Within_Range( EF.Arccos( 0.99, 2.0*Pi), 0.14, 0.01) or
- not Result_Within_Range(GEF.Arccos(-1.0, 360.0), 180.0, 0.1) or
- not Result_Within_Range(GEF.Arccos(-1.0, 100.0), 50.0, 0.1) or
- not Result_Within_Range(GEF.Arccos( 0.0, 360.0), 90.0, 0.1) or
- not Result_Within_Range(GEF.Arccos( 0.0, 100.0), 25.0, 0.1)
- then
- Report.Failed("Incorrect result returned from the Arccos " &
- "function with specified Cycle parameter, " &
- "when provided a variety of input parameters");
- end if;
-
-
-
- -- Testing of Arccosh Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that Argument_Error is raised by the Arccosh function when
- -- the value of the parameter X is less than 1.0.
-
- begin
- New_Float_Result := GEF.Arccosh(New_Float(FXA5A00.One_Minus_Delta));
- Report.Failed("Argument_Error not raised by the Arccosh function " &
- "when the parameter value is less than 1.0");
- Dont_Optimize_New_Float(New_Float_Result, 7);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccosh " &
- "function when given a parameter value less " &
- "than 1.0");
- end;
-
- begin
- The_Result := EF.Arccosh(0.0);
- Report.Failed("Argument_Error not raised by the Arccosh function " &
- "when the parameter value is 0.0");
- Dont_Optimize_Float(The_Result, 8);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccosh " &
- "function when given a parameter value of 0.0");
- end;
-
- begin
- New_Float_Result := GEF.Arccosh(New_Float(-FXA5A00.Large));
- Report.Failed("Argument_Error not raised by the Arccosh function " &
- "when the large negative parameter value");
- Dont_Optimize_New_Float(New_Float_Result, 9);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Arccosh " &
- "function when given a large negative parameter " &
- "value");
- end;
-
-
- -- Check the prescribed results of the Arccosh function.
-
- if GEF.Arccosh(X => 1.0) /= 0.0 or
- EF.Arccosh(1.0) /= 0.0
- then
- Report.Failed("Incorrect result returned by the Arccosh " &
- "function when provided a parameter value of 0.0");
- end if;
-
-
- -- Check the results of the Arccosh function with various input
- -- parameters.
-
- if not Result_Within_Range(GEF.Arccosh(1.03), 0.244, 0.001) or
- not Result_Within_Range( EF.Arccosh(1.28), 0.732, 0.001) or
- not Result_Within_Range(GEF.Arccosh(1.50), 0.962, 0.001) or
- not Result_Within_Range( EF.Arccosh(1.77), 1.17, 0.01) or
- not Result_Within_Range(GEF.Arccosh(2.00), 1.32, 0.01) or
- not Result_Within_Range( EF.Arccosh(4.30), 2.14, 0.01) or
- not Result_Within_Range(GEF.Arccosh(6.90), 2.62, 0.01)
- then
- Report.Failed("Incorrect result returned from the Arccosh " &
- "function when provided a variety of input " &
- "parameters");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA5A06;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5a07.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5a07.a
deleted file mode 100644
index 179d54c44bf..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5a07.a
+++ /dev/null
@@ -1,413 +0,0 @@
--- CXA5A07.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the function Arctan provides correct results.
---
--- TEST DESCRIPTION:
--- This test examines both the version of Arctan resulting from the
--- instantiation of the Ada.Numerics.Generic_Elementary_Functions with
--- a type derived from type Float, as well as the preinstantiated
--- version of this package for type Float.
--- Prescribed results, including instances prescribed to raise
--- exceptions, are examined in the test cases. In addition,
--- certain evaluations are performed where the actual function result
--- is compared with the expected result (within an epsilon range of
--- accuracy).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXA5A00.A (foundation code)
--- CXA5A07.A
---
---
--- CHANGE HISTORY:
--- 04 Apr 95 SAIC Initial prerelease version.
--- 13 Jun 95 SAIC Incorporated use of Dont_Optimize procedure, and
--- use of Result_Within_Range function overloaded for
--- FXA5A00.New_Float_Type.
--- 28 Feb 97 PWB.CTA Removed checks with explicit Cycle => 2.0*Pi
---
--- CHANGE NOTE:
--- According to Ken Dritz, author of the Numerics Annex of the RM,
--- one should never specify the cycle 2.0*Pi for the trigonometric
--- functions. In particular, if the machine number for the first
--- argument is not an exact multiple of the machine number for the
--- explicit cycle, then the specified exact results cannot be
--- reasonably expected. The affected checks in this test have been
--- marked as comments, with the additional notation "pwb-math".
--- Phil Brashear
---!
-
-with Ada.Numerics.Elementary_Functions;
-with Ada.Numerics.Generic_Elementary_Functions;
-with FXA5A00;
-with Report;
-
-procedure CXA5A07 is
-begin
-
- Report.Test ("CXA5A07", "Check that the Arctan function provides " &
- "correct results");
-
- Test_Block:
- declare
-
- use Ada.Numerics;
- use FXA5A00;
-
- package GEF is new Ada.Numerics.Generic_Elementary_Functions(New_Float);
- package EF renames Ada.Numerics.Elementary_Functions;
-
- Float_Result : Float;
- New_Float_Result : New_Float;
-
- procedure Dont_Optimize_Float is new Dont_Optimize(Float);
- procedure Dont_Optimize_New_Float is new Dont_Optimize(New_Float);
-
- begin
-
- -- Testing of Arctan Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that Argument_Error is raised by the Arctan function when
- -- provided parameter values of 0.0, 0.0.
-
- begin
- New_Float_Result := GEF.Arctan(Y => 0.0, X => 0.0);
- Report.Failed("Argument_Error not raised when the Arctan " &
- "function is provided input of 0.0, 0.0");
- Dont_Optimize_New_Float(New_Float_Result, 1);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by the Arctan " &
- "function when provided 0.0, 0.0 input parameters");
- end;
-
-
- -- Check that no exception is raised by the Arctan function when
- -- provided a large positive or negative Y parameter value, when
- -- using the default value for parameter X.
-
- begin
- Float_Result := EF.Arctan(Y => FXA5A00.Large);
- Dont_Optimize_Float(Float_Result, 2);
- exception
- when others =>
- Report.Failed("Exception raised when the Arctan function is " &
- "provided a large positive Y parameter value");
- end;
-
- begin
- New_Float_Result := GEF.Arctan(Y => New_Float(-FXA5A00.Large));
- Dont_Optimize_New_Float(New_Float_Result, 3);
- exception
- when others =>
- Report.Failed("Exception raised when the Arctan function is " &
- "provided a large negative Y parameter value");
- end;
-
-
- -- Check that no exception is raised by the Arctan function when
- -- provided a small positive or negative Y parameter value, when
- -- using the default value for parameter X.
-
- begin
- Float_Result := EF.Arctan(Y => FXA5A00.Small);
- Dont_Optimize_Float(Float_Result, 4);
- exception
- when others =>
- Report.Failed("Exception raised when the Arctan function is " &
- "provided a small positive Y parameter value");
- end;
-
- begin
- New_Float_Result := GEF.Arctan(Y => New_Float(-FXA5A00.Small));
- Dont_Optimize_New_Float(New_Float_Result, 5);
- exception
- when others =>
- Report.Failed("Exception raised when the Arctan function is " &
- "provided a small negative Y parameter value");
- end;
-
-
- -- Check that no exception is raised by the Arctan function when
- -- provided combinations of large and small positive or negative
- -- parameter values for both Y and X input parameters.
-
- begin
- Float_Result := EF.Arctan(Y => FXA5A00.Large, X => FXA5A00.Large);
- Dont_Optimize_Float(Float_Result, 6);
- exception
- when others =>
- Report.Failed("Exception raised when the Arctan function is " &
- "provided large positive X and Y parameter values");
- end;
-
- begin
- New_Float_Result := GEF.Arctan(New_Float(-FXA5A00.Large),
- X => New_Float(FXA5A00.Small));
- Dont_Optimize_New_Float(New_Float_Result, 7);
- exception
- when others =>
- Report.Failed("Exception raised when the Arctan function is " &
- "provided a large negative Y parameter value " &
- "and a small positive X parameter value");
- end;
-
-
- begin
- Float_Result := EF.Arctan(Y => FXA5A00.Small, X => FXA5A00.Large);
- Dont_Optimize_Float(Float_Result, 8);
- exception
- when others =>
- Report.Failed("Exception raised when the Arctan function is " &
- "provided a small positive Y parameter value " &
- "and a large positive X parameter value");
- end;
-
- begin
- New_Float_Result := GEF.Arctan(New_Float(-FXA5A00.Small),
- New_Float(-FXA5A00.Large));
- Dont_Optimize_New_Float(New_Float_Result, 9);
- exception
- when others =>
- Report.Failed("Exception raised when the Arctan function is " &
- "provided a small negative Y parameter value " &
- "and a large negative parameter value");
- end;
-
-
- -- Check that when the Arctan function is provided a Y parameter value
- -- of 0.0 and a positive X parameter input value, the prescribed result
- -- of zero is returned.
-
- if GEF.Arctan(Y => 0.0) /= 0.0 or -- Default X value
- EF.Arctan(Y => 0.0, X => FXA5A00.Large) /= 0.0 or
---pwb-math: Next line: changed 2.0*Pi to 360.0
- GEF.Arctan(0.0, 360.0) /= 0.0 or
- EF.Arctan(0.0, FXA5A00.Small) /= 0.0
- then
- Report.Failed("Incorrect results from the Arctan function when " &
- "provided a Y parameter value of 0.0 and various " &
- "positive X parameter values");
- end if;
-
-
- -- Check that the Arctan function provides correct results when provided
- -- a variety of Y parameter values.
-
- if not FXA5A00.Result_Within_Range(EF.Arctan(Pi), 1.26, 0.01) or
- not FXA5A00.Result_Within_Range(EF.Arctan(-Pi), -1.26, 0.01) or
- not FXA5A00.Result_Within_Range(GEF.Arctan(1.0), 0.785, 0.001) or
- not FXA5A00.Result_Within_Range(EF.Arctan(-1.0), -0.785, 0.001) or
- not FXA5A00.Result_Within_Range(GEF.Arctan(0.25), 0.245, 0.001) or
- not FXA5A00.Result_Within_Range(EF.Arctan(0.92), 0.744, 0.001)
- then
- Report.Failed("Incorrect results from the Arctan function when " &
- "provided a variety of Y parameter values");
- end if;
-
-
-
- -- Check the results of the Arctan function with specified cycle
- -- parameter.
-
- -- Check that the Arctan function with specified Cycle parameter
- -- raises Argument_Error when the value of the Cycle parameter is zero
- -- or negative.
-
- begin
- Float_Result := EF.Arctan(Y => Pi, Cycle => 0.0); -- Default X value
- Report.Failed("Argument_Error not raised by the Arctan function " &
- "with default X parameter value, when the Cycle " &
- "parameter is 0.0");
- Dont_Optimize_Float(Float_Result, 10);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by the Arctan " &
- "function with default X parameter value, when " &
- "provided a 0.0 cycle parameter value");
- end;
-
- begin
- New_Float_Result := GEF.Arctan(Y => Pi, X => 1.0, Cycle => 0.0);
- Report.Failed("Argument_Error not raised by the Arctan function " &
- "when the Cycle parameter is 0.0");
- Dont_Optimize_New_Float(New_Float_Result, 11);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by the Arctan " &
- "function when provided a 0.0 cycle parameter " &
- "value");
- end;
-
- begin
- Float_Result := EF.Arctan(Y => Pi, Cycle => -360.0);
- Report.Failed("Argument_Error not raised by the Arctan function " &
- "with a default X parameter value, when the Cycle " &
- "parameter is -360.0");
- Dont_Optimize_Float(Float_Result, 12);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by the Arctan " &
- "function with a default X parameter value, when " &
- "provided a -360.0 cycle parameter value");
- end;
-
- begin
- New_Float_Result := GEF.Arctan(Y => Pi, X => 1.0, Cycle => -Pi);
- Report.Failed("Argument_Error not raised by the Arctan function " &
- "when the Cycle parameter is -Pi");
- Dont_Optimize_New_Float(New_Float_Result, 13);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by the Arctan " &
- "function when provided a -Pi cycle parameter " &
- "value");
- end;
-
-
- -- Check that no exception is raised by the Arctan function with
- -- specified Cycle parameter, when provided large and small positive
- -- or negative parameter values for both Y and X input parameters.
-
- begin
- Float_Result := EF.Arctan(Y => -FXA5A00.Large,
- X => -FXA5A00.Large,
---pwb-math: Next line: changed 2.0*Pi to 360.0
- Cycle => 360.0);
- Dont_Optimize_Float(Float_Result, 14);
- exception
- when others =>
- Report.Failed("Exception raised when the Arctan function with " &
- "specified Cycle parameter, when provided large " &
- "negative X and Y parameter values");
- end;
-
-
- begin
- New_Float_Result := GEF.Arctan(New_Float(FXA5A00.Large),
- X => New_Float(-FXA5A00.Small),
---pwb-math: Next line: changed 2.0*Pi to 360.0
- Cycle => 360.0);
- Dont_Optimize_New_Float(New_Float_Result, 15);
- exception
- when others =>
- Report.Failed("Exception raised when the Arctan function with " &
- "specified Cycle parameter, when provided large " &
- "positive Y parameter value and a small negative " &
- "X parameter value");
- end;
-
-
- begin
- Float_Result := EF.Arctan(Y => -FXA5A00.Small,
- X => -FXA5A00.Large,
---pwb-math: Next line: changed 2.0*Pi to 360.0
- Cycle => 360.0);
- Dont_Optimize_Float(Float_Result, 16);
- exception
- when others =>
- Report.Failed("Exception raised when the Arctan function with " &
- "specified Cycle parameter, when provided large " &
- "negative Y parameter value and a large negative " &
- "X parameter value");
- end;
-
- begin
- New_Float_Result := GEF.Arctan(New_Float(FXA5A00.Small),
- New_Float(FXA5A00.Large),
---pwb-math: Next line: changed 2.0*Pi to 360.0
- 360.0);
- Dont_Optimize_New_Float(New_Float_Result, 17);
- exception
- when others =>
- Report.Failed("Exception raised when the Arctan function with " &
- "specified Cycle parameter, when provided a " &
- "small negative Y parameter value and a large " &
- "positive X parameter value");
- end;
-
-
- -- Check that the Arctan function with specified Cycle parameter
- -- provides correct results when provided a variety of Y parameter
- -- input values.
-
---pwb-math if not FXA5A00.Result_Within_Range(EF.Arctan(Pi, Cycle => 2.0*Pi),
---pwb-math 1.26,
---pwb-math 0.01) or
---pwb-math not FXA5A00.Result_Within_Range(EF.Arctan(-Pi, Cycle => 2.0*Pi),
---pwb-math -1.26,
---pwb-math 0.01) or
---pwb-math not FXA5A00.Result_Within_Range(GEF.Arctan(1.0, Cycle => 2.0*Pi),
---pwb-math 0.785,
---pwb-math 0.001) or
---pwb-math not FXA5A00.Result_Within_Range(EF.Arctan(-1.0, Cycle => 2.0*Pi),
---pwb-math -0.785,
---pwb-math 0.001) or
---pwb-math not FXA5A00.Result_Within_Range(GEF.Arctan(0.16, Cycle => 2.0*Pi),
---pwb-math 0.159,
---pwb-math 0.001) or
---pwb-math not FXA5A00.Result_Within_Range(EF.Arctan(1.0, Cycle => 360.0),
---pwb-math 45.0,
---pwb-math 0.1) or
---pwb-math not FXA5A00.Result_Within_Range(GEF.Arctan(1.0, Cycle => 100.0),
---pwb-math 12.5,
---pwb-math 0.1)
-
---pwb-math Next 12 lines are replacements for 21 commented lines above
- if not FXA5A00.Result_Within_Range(GEF.Arctan(1.0, Cycle => 2.0*180.0),
- 45.0,
- 0.001) or
- not FXA5A00.Result_Within_Range(EF.Arctan(-1.0, Cycle => 2.0*180.0),
- -45.0,
- 0.001) or
- not FXA5A00.Result_Within_Range(EF.Arctan(1.0, Cycle => 360.0),
- 45.0,
- 0.1) or
- not FXA5A00.Result_Within_Range(GEF.Arctan(1.0, Cycle => 100.0),
- 12.5,
- 0.1)
- then
- Report.Failed("Incorrect results from the Arctan function with " &
- "specified Cycle parameter when provided a variety " &
- "of Y parameter values");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA5A07;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5a08.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5a08.a
deleted file mode 100644
index ae2b85a6d43..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5a08.a
+++ /dev/null
@@ -1,474 +0,0 @@
--- CXA5A08.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the function Arccot provides correct results.
---
--- TEST DESCRIPTION:
--- This test examines both the version of Arccot resulting from the
--- instantiation of the Ada.Numerics.Generic_Elementary_Functions
--- with a type derived from type Float, as well as the preinstantiated
--- version of this package for type Float.
--- Prescribed results, including instances prescribed to raise
--- exceptions, are examined in the test cases. In addition,
--- certain evaluations are performed where the actual function result
--- is compared with the expected result (within an epsilon range of
--- accuracy).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXA5A00.A (foundation code)
--- CXA5A08.A
---
---
--- CHANGE HISTORY:
--- 06 Apr 95 SAIC Initial prerelease version.
--- 13 Jun 95 SAIC Incorporated use of Dont_Optimize procedure, and
--- use of Result_Within_Range function overloaded for
--- FXA5A00.New_Float_Type.
--- 18 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 28 Feb 97 CTA.PWB Removed checks with explicit Cycle => 2.0*Pi
---
--- CHANGE NOTE:
--- According to Ken Dritz, author of the Numerics Annex of the RM,
--- one should never specify the cycle 2.0*Pi for the trigonometric
--- functions. In particular, if the machine number for the first
--- argument is not an exact multiple of the machine number for the
--- explicit cycle, then the specified exact results cannot be
--- reasonably expected. The affected checks in this test have been
--- marked as comments, with the additional notation "pwb-math".
--- Phil Brashear
---!
-
-with Ada.Exceptions;
-with Ada.Numerics.Elementary_Functions;
-with Ada.Numerics.Generic_Elementary_Functions;
-with FXA5A00;
-with Report;
-
-procedure CXA5A08 is
-begin
-
- Report.Test ("CXA5A08", "Check that the Arccot function provides " &
- "correct results");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
- use Ada.Numerics;
- use FXA5A00;
-
- package GEF is new Ada.Numerics.Generic_Elementary_Functions(New_Float);
- package EF renames Ada.Numerics.Elementary_Functions;
-
- Float_Result : Float;
- Angle : Float;
- New_Float_Result : New_Float;
- New_Float_Angle : New_Float;
- Incorrect_Inverse : Boolean := False;
-
- procedure Dont_Optimize_Float is new Dont_Optimize(Float);
- procedure Dont_Optimize_New_Float is new Dont_Optimize(New_Float);
-
- begin
-
- -- Testing of Arccot Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that Argument_Error is raised by the Arccot function when
- -- provided parameter values of 0.0, 0.0.
-
- begin
- New_Float_Result := GEF.Arccot(X => 0.0, Y => 0.0);
- Report.Failed("Argument_Error not raised when the Arccot " &
- "function is provided input of 0.0, 0.0");
- Dont_Optimize_New_Float(New_Float_Result, 1);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by the Arccot " &
- "function when provided 0.0, 0.0 input parameters");
- end;
-
-
- -- Check that no exception is raised by the Arccot function when
- -- provided a large positive or negative X parameter value, when
- -- using the default value for parameter Y.
-
- begin
- Float_Result := EF.Arccot(X => FXA5A00.Large);
- Dont_Optimize_Float(Float_Result, 2);
- exception
- when others =>
- Report.Failed("Exception raised when the Arccot function is " &
- "provided a large positive X parameter value");
- end;
-
- begin
- New_Float_Result := GEF.Arccot(X => New_Float(-FXA5A00.Large));
- Dont_Optimize_New_Float(New_Float_Result, 3);
- exception
- when others =>
- Report.Failed("Exception raised when the Arccot function is " &
- "provided a large negative X parameter value");
- end;
-
-
- -- Check that no exception is raised by the Arccot function when
- -- provided a small positive or negative X parameter value, when
- -- using the default value for parameter Y.
-
- begin
- Float_Result := EF.Arccot(X => FXA5A00.Small);
- Dont_Optimize_Float(Float_Result, 4);
- exception
- when others =>
- Report.Failed("Exception raised when the Arccot function is " &
- "provided a small positive X parameter value");
- end;
-
- begin
- New_Float_Result := GEF.Arccot(X => New_Float(-FXA5A00.Small));
- Dont_Optimize_New_Float(New_Float_Result, 5);
- exception
- when others =>
- Report.Failed("Exception raised when the Arccot function is " &
- "provided a small negative X parameter value");
- end;
-
-
- -- Check that no exception is raised by the Arccot function when
- -- provided combinations of large and small positive or negative
- -- parameter values for both X and Y input parameters.
-
- begin
- Float_Result := EF.Arccot(X => FXA5A00.Large, Y => FXA5A00.Large);
- Dont_Optimize_Float(Float_Result, 6);
- exception
- when others =>
- Report.Failed("Exception raised when the Arccot function is " &
- "provided large positive X and Y parameter values");
- end;
-
- begin
- New_Float_Result := GEF.Arccot(New_Float(-FXA5A00.Large),
- Y => New_Float(FXA5A00.Small));
- Dont_Optimize_New_Float(New_Float_Result, 7);
- exception
- when others =>
- Report.Failed("Exception raised when the Arccot function is " &
- "provided a large negative X parameter value " &
- "and a small positive Y parameter value");
- end;
-
-
- begin
- Float_Result := EF.Arccot(X => FXA5A00.Small, Y => FXA5A00.Large);
- Dont_Optimize_Float(Float_Result, 8);
- exception
- when others =>
- Report.Failed("Exception raised when the Arccot function is " &
- "provided a small positive X parameter value " &
- "and a large positive Y parameter value");
- end;
-
- begin
- New_Float_Result := GEF.Arccot(New_Float(-FXA5A00.Small),
- New_Float(-FXA5A00.Large));
- Dont_Optimize_New_Float(New_Float_Result, 9);
- exception
- when others =>
- Report.Failed("Exception raised when the Arccot function is " &
- "provided a small negative X parameter value " &
- "and a large negative Y parameter value");
- end;
-
-
- -- Check that when the Arccot function is provided a Y parameter value
- -- of 0.0 and a positive X parameter input value, the prescribed result
- -- of zero is returned.
-
- if EF.Arccot(X => FXA5A00.Large, Y => 0.0) /= 0.0 or
- GEF.Arccot(2.0*Pi, Y => 0.0) /= 0.0 or
- EF.Arccot(FXA5A00.Small, 0.0) /= 0.0 or
- EF.Arccot(X => FXA5A00.Large, Y => 0.0, Cycle => 360.0) /= 0.0 or
- GEF.Arccot(2.0*Pi, Y => 0.0, Cycle => 360.0) /= 0.0 or
- EF.Arccot(FXA5A00.Small, 0.0, Cycle => 360.0) /= 0.0
- then
- Report.Failed("Incorrect results from the Arccot function when " &
- "provided a Y parameter value of 0.0 and various " &
- "positive X parameter values");
- end if;
-
-
- -- Check that the Arccot function provides correct results when
- -- provided a variety of X parameter values.
-
- if not Result_Within_Range( EF.Arccot( 1.0), Pi/4.0, 0.001) or
- not Result_Within_Range(GEF.Arccot( 0.0), Pi/2.0, 0.001) or
- not Result_Within_Range( EF.Arccot(-1.0), 3.0*Pi/4.0, 0.001)
- then
- Report.Failed("Incorrect results from the Arccot function when " &
- "provided a variety of Y parameter values");
- end if;
-
-
- -- Check the results of the Arccot function with specified cycle
- -- parameter.
-
- -- Check that the Arccot function with specified Cycle parameter
- -- raises Argument_Error when the value of the Cycle parameter is zero
- -- or negative.
-
- begin
- Float_Result := EF.Arccot(X => Pi, Cycle => 0.0); -- Default Y value
- Report.Failed("Argument_Error not raised by the Arccot function " &
- "with default Y parameter value, when the Cycle " &
- "parameter is 0.0");
- Dont_Optimize_Float(Float_Result, 10);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by the Arccot " &
- "function with default Y parameter value, when " &
- "provided a 0.0 cycle parameter value");
- end;
-
- begin
- New_Float_Result := GEF.Arccot(X => Pi, Y => 1.0, Cycle => 0.0);
- Report.Failed("Argument_Error not raised by the Arccot function " &
- "when the Cycle parameter is 0.0");
- Dont_Optimize_New_Float(New_Float_Result, 11);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by the Arccot " &
- "function when provided a 0.0 cycle parameter " &
- "value");
- end;
-
- begin
- Float_Result := EF.Arccot(X => Pi, Cycle => -360.0);
- Report.Failed("Argument_Error not raised by the Arccot function " &
- "with a default Y parameter value, when the Cycle " &
- "parameter is -360.0");
- Dont_Optimize_Float(Float_Result, 12);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by the Arccot " &
- "function with a default Y parameter value, when " &
- "provided a -360.0 cycle parameter value");
- end;
-
- begin
- New_Float_Result := GEF.Arccot(X => Pi, Y => 1.0, Cycle => -Pi);
- Report.Failed("Argument_Error not raised by the Arccot function " &
- "when the Cycle parameter is -Pi");
- Dont_Optimize_New_Float(New_Float_Result, 13);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by the Arccot " &
- "function when provided a -Pi cycle parameter " &
- "value");
- end;
-
-
- -- Check that no exception is raised by the Arccot function with
- -- specified Cycle parameter, when provided large and small positive
- -- or negative parameter values for both X and Y input parameters.
-
- begin
- Float_Result := EF.Arccot(X => -FXA5A00.Large,
- Y => -FXA5A00.Large,
---pwb-math Next line: changed 2.0*Pi to 360.0
- Cycle => 360.0);
- Dont_Optimize_Float(Float_Result, 14);
- exception
- when others =>
- Report.Failed("Exception raised when the Arccot function with " &
- "specified Cycle parameter, when provided large " &
- "negative X and Y parameter values");
- end;
-
-
- begin
- New_Float_Result := GEF.Arccot(New_Float(FXA5A00.Large),
- Y => New_Float(-FXA5A00.Small),
---pwb-math Next line: changed 2.0*Pi to 360.0
- Cycle => 360.0);
- Dont_Optimize_New_Float(New_Float_Result, 15);
- exception
- when others =>
- Report.Failed("Exception raised when the Arccot function with " &
- "specified Cycle parameter, when provided large " &
- "positive X parameter value and a small negative " &
- "Y parameter value");
- end;
-
-
- begin
- Float_Result := EF.Arccot(X => -FXA5A00.Small,
- Y => -FXA5A00.Large,
---pwb-math Next line: changed 2.0*Pi to 360.0
- Cycle => 360.0);
- Dont_Optimize_Float(Float_Result, 16);
- exception
- when others =>
- Report.Failed("Exception raised when the Arccot function with " &
- "specified Cycle parameter, when provided small " &
- "negative X parameter value and a large negative " &
- "Y parameter value");
- end;
-
- begin
- New_Float_Result := GEF.Arccot(New_Float(FXA5A00.Small),
- New_Float(FXA5A00.Large),
---pwb-math Next line: changed 2.0*Pi to 360.0
- 360.0);
- Dont_Optimize_New_Float(New_Float_Result, 17);
- exception
- when others =>
- Report.Failed("Exception raised when the Arccot function with " &
- "specified Cycle parameter, when provided a " &
- "small positive X parameter value and a large " &
- "positive Y parameter value");
- end;
-
-
- -- Check that the Arccot function with specified Cycle parameter
- -- provides correct results when provided a variety of X parameter
- -- input values.
-
- if not FXA5A00.Result_Within_Range(GEF.Arccot( 0.0, Cycle => 360.0),
- 90.0,
- 0.001) or
- not FXA5A00.Result_Within_Range(EF.Arccot( 0.0, Cycle => 100.0),
- 25.0,
- 0.001) or
- not FXA5A00.Result_Within_Range(GEF.Arccot( 1.0, Cycle => 360.0),
- 45.0,
- 0.001) or
- not FXA5A00.Result_Within_Range(EF.Arccot( 1.0, Cycle => 100.0),
- 12.5,
- 0.001) or
- not FXA5A00.Result_Within_Range(GEF.Arccot(-1.0, Cycle => 360.0),
- 135.0,
- 0.001) or
- not FXA5A00.Result_Within_Range(EF.Arccot(-1.0, Cycle => 100.0),
- 37.5,
- 0.001)
- then
- Report.Failed("Incorrect results from the Arccot function with " &
- "specified Cycle parameter when provided a variety " &
- "of X parameter values");
- end if;
-
-
- if not FXA5A00.Result_Within_Range(EF.Arccot(0.2425355, 0.9701420),
- EF.Arccot(0.25),
- 0.01) or
- not FXA5A00.Result_Within_Range(EF.Arccot(0.3162277, 0.9486831),
- Ef.Arccot(0.33),
- 0.01)
- then
- Report.Failed("Incorrect results from the Arccot function with " &
- "comparison to other Arccot function results");
- end if;
-
-
- if not FXA5A00.Result_Within_Range(EF.Cot(EF.Arccot(0.4472135,
- 0.8944270)),
- 0.5,
- 0.01) or
- not FXA5A00.Result_Within_Range(EF.Cot(EF.Arccot(0.9987380,
- 0.0499369)),
- 20.0,
- 0.1)
- then
- Report.Failed("Incorrect results from the Arccot function when " &
- "used as argument to Cot function");
- end if;
-
-
- -- Check that inverse function results are correct.
- -- Default Cycle test.
-
- Angle := 0.001;
- while Angle < Pi and not Incorrect_Inverse loop
- if not Result_Within_Range(EF.Arccot(EF.Cot(Angle)), Angle, 0.001)
- then
- Incorrect_Inverse := True;
- end if;
- Angle := Angle + 0.001;
- end loop;
-
- if Incorrect_Inverse then
- Report.Failed("Incorrect results returned from the Inverse " &
- "comparison of Cot and Arccot using the default " &
- "cycle value");
- Incorrect_Inverse := False;
- end if;
-
- -- Non-Default Cycle test.
-
- New_Float_Angle := 0.01;
- while New_Float_Angle < 180.0 and not Incorrect_Inverse loop
- if not Result_Within_Range(EF.Arccot(EF.Cot(Float(New_Float_Angle),
- Cycle => 360.0),
- Cycle => 360.0),
- Float(New_Float_Angle),
- 0.01) or
- not Result_Within_Range(GEF.Arccot(
- New_Float(GEF.Cot(New_Float_Angle,
- Cycle => 360.0)),
- Cycle => 360.0),
- Float(New_Float_Angle),
- 0.01)
- then
- Incorrect_Inverse := True;
- end if;
- New_Float_Angle := New_Float_Angle + 0.01;
- end loop;
-
- if Incorrect_Inverse then
- Report.Failed("Incorrect results returned from the Inverse " &
- "comparison of Cot and Arccot using non-default " &
- "cycle value");
- end if;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXA5A08;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5a09.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5a09.a
deleted file mode 100644
index 22bd2f8909c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5a09.a
+++ /dev/null
@@ -1,400 +0,0 @@
--- CXA5A09.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the function Log provides correct results.
---
--- TEST DESCRIPTION:
--- This test examines both the version of Log resulting from the
--- instantiation of the Ada.Numerics.Generic_Elementary_Functions with
--- with a type derived from type Float,as well as the preinstantiated
--- version of this package for type Float.
--- Prescribed results, including instances prescribed to raise
--- exceptions, are examined in the test cases. In addition,
--- certain evaluations are performed where the actual function result
--- is compared with the expected result (within an epsilon range of
--- accuracy).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXA5A00.A (foundation code)
--- CXA5A09.A
---
---
--- CHANGE HISTORY:
--- 11 Apr 95 SAIC Initial prerelease version.
--- 13 Jun 95 SAIC Incorporated use of Dont_Optimize procedure, and
--- use of Result_Within_Range function overloaded for
--- FXA5A00.New_Float_Type.
--- 29 Jun 98 EDS Protected exception tests by first testing
--- for 'Machine_Overflows
---
---!
-
-with Ada.Numerics.Elementary_Functions;
-with Ada.Numerics.Generic_Elementary_Functions;
-with FXA5A00;
-with Report;
-
-procedure CXA5A09 is
-begin
-
- Report.Test ("CXA5A09", "Check that the Log function provides " &
- "correct results");
-
- Test_Block:
- declare
-
- use Ada.Numerics;
- use FXA5A00;
-
- package GEF is new Ada.Numerics.Generic_Elementary_Functions(New_Float);
- package EF renames Ada.Numerics.Elementary_Functions;
-
- Arg,
- Float_Result : Float := 0.0;
- New_Float_Result : New_Float := 0.0;
-
- Incorrect_Inverse,
- Incorrect_Inverse_Base_2,
- Incorrect_Inverse_Base_8,
- Incorrect_Inverse_Base_10,
- Incorrect_Inverse_Base_16 : Boolean := False;
-
- procedure Dont_Optimize_Float is new Dont_Optimize(Float);
- procedure Dont_Optimize_New_Float is new Dont_Optimize(New_Float);
-
- begin
-
- -- Testing of Log Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that Argument_Error is raised when the parameter X is negative.
-
- begin
- New_Float_Result := GEF.Log(X => -1.0);
- Report.Failed("Argument_Error not raised by the Log function " &
- "when the input parameter is negative");
- Dont_Optimize_New_Float(New_Float_Result, 1);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Log function " &
- "when the input parameter is negative");
- end;
-
- begin
- Float_Result := EF.Log(X => -FXA5A00.Large);
- Report.Failed("Argument_Error not raised by the Log function " &
- "when the input parameter is negative");
- Dont_Optimize_Float(Float_Result, 2);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Log function " &
- "when the input parameter is negative");
- end;
-
-
- -- Check that Constraint_Error is raised when the Log function is
- -- provided an input parameter of zero.
-
- if New_Float'Machine_Overflows = True then
- begin
- New_Float_Result := GEF.Log(X => 0.0);
- Report.Failed("Constraint_Error not raised by the Log function " &
- "when the input parameter is zero");
- Dont_Optimize_New_Float(New_Float_Result, 3);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Log function "
- & "when the input parameter is zero");
- end;
- end if;
-
-
- -- Check for the reference manual prescribed results of the Log function.
-
- if GEF.Log(X => 1.0) /= 0.0 or
- EF.Log(X => 1.0) /= 0.0
- then
- Report.Failed("Incorrect result from Function Log when provided " &
- "an input parameter value of 1.0");
- end if;
-
-
- -- Check that the Log function provides correct results when provided
- -- a variety of input parameters.
-
- if not FXA5A00.Result_Within_Range(GEF.Log(0.015), -4.20, 0.01) or
- not FXA5A00.Result_Within_Range(GEF.Log(0.592), -0.524, 0.001) or
- not FXA5A00.Result_Within_Range(GEF.Log(0.997), -0.003, 0.001) or
- not FXA5A00.Result_Within_Range(GEF.Log(1.341), 0.293, 0.001) or
- not FXA5A00.Result_Within_Range( EF.Log(2.826), 1.04, 0.01) or
- not FXA5A00.Result_Within_Range( EF.Log(10.052), 2.31, 0.01) or
- not FXA5A00.Result_Within_Range( EF.Log(2569.143), 7.85, 0.01)
- then
- Report.Failed("Incorrect results from Function Log when provided " &
- "a variety of input parameter values");
- end if;
-
- Arg := 0.001;
- while Arg < 1.0 and not Incorrect_Inverse loop
- if not Result_Within_Range(EF."**"(e,EF.Log(Arg)), Arg, 0.001) then
- Incorrect_Inverse := True;
- end if;
- Arg := Arg + 0.001;
- end loop;
-
- if Incorrect_Inverse then
- Report.Failed("Incorrect inverse result comparing ""**"" and " &
- "Log function over argument range 0.001..1.0");
- Incorrect_Inverse := False;
- end if;
-
- Arg := 1.0;
- while Arg < 10.0 and not Incorrect_Inverse loop
- if not Result_Within_Range(EF."**"(e,EF.Log(Arg)), Arg, 0.01) then
- Incorrect_Inverse := True;
- end if;
- Arg := Arg + 0.01;
- end loop;
-
- if Incorrect_Inverse then
- Report.Failed("Incorrect inverse result comparing ""**"" and " &
- "Log function over argument range 1.0..10.0");
- Incorrect_Inverse := False;
- end if;
-
- Arg := 1.0;
- while Arg < 1000.0 and not Incorrect_Inverse loop
- if not Result_Within_Range(EF."**"(e,EF.Log(Arg)), Arg, 0.1) then
- Incorrect_Inverse := True;
- end if;
- Arg := Arg + 1.0;
- end loop;
-
- if Incorrect_Inverse then
- Report.Failed("Incorrect inverse result comparing ""**"" and " &
- "Log function over argument range 1.0..1000.0");
- end if;
-
-
- -- Testing of Log Function, with specified Base parameter, both
- -- instantiated and pre-instantiated versions.
-
- -- Check that Argument_Error is raised by the Log function with
- -- specified Base parameter, when the X parameter value is negative.
-
- begin
- New_Float_Result := GEF.Log(X => -1.0, Base => 16.0);
- Report.Failed("Argument_Error not raised by the Log function " &
- "with Base parameter, when the input parameter " &
- "value is -1.0");
- Dont_Optimize_New_Float(New_Float_Result, 4);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Log function " &
- "with Base parameter, when the X parameter value " &
- "is -1.0");
- end;
-
- begin
- Float_Result := EF.Log(X => -FXA5A00.Large, Base => 8.0);
- Report.Failed("Argument_Error not raised by the Log function " &
- "with Base parameter, when the X parameter " &
- "value is a large negative value");
- Dont_Optimize_Float(Float_Result, 5);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Log function " &
- "with Base parameter, when the X parameter " &
- "value is a large negative value");
- end;
-
-
- -- Check that Argument_Error is raised by the Log function when
- -- the specified Base parameter is zero.
-
- begin
- New_Float_Result := GEF.Log(X => 10.0, Base => 0.0);
- Report.Failed("Argument_Error not raised by the Log function " &
- "with Base parameter of 0.0");
- Dont_Optimize_New_Float(New_Float_Result, 6);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Log function " &
- "with Base parameter of 0.0");
- end;
-
-
- -- Check that Argument_Error is raised by the Log function when
- -- the specified Base parameter is one.
-
- begin
- Float_Result := EF.Log(X => 12.3, Base => 1.0);
- Report.Failed("Argument_Error not raised by the Log function " &
- "with Base parameter of 1.0");
- Dont_Optimize_Float(Float_Result, 7);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Log function " &
- "with Base parameter of 1.0");
- end;
-
-
- -- Check that Argument_Error is raised by the Log function when
- -- the specified Base parameter is negative.
-
- begin
- New_Float_Result := GEF.Log(X => 12.3, Base => -10.0);
- Report.Failed("Argument_Error not raised by the Log function " &
- "with negative Base parameter");
- Dont_Optimize_New_Float(New_Float_Result, 8);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the Log function " &
- "with negative Base parameter");
- end;
-
-
- -- Check that Constraint_Error is raised by the Log function when the
- -- input X parameter value is 0.0.
-
- if New_Float'Machine_Overflows = True then
- begin
- New_Float_Result := GEF.Log(X => 0.0, Base => 16.0);
- Report.Failed("Constraint_Error not raised by the Log function " &
- "with specified Base parameter, when the value of " &
- "the parameter X is 0.0");
- Dont_Optimize_New_Float(New_Float_Result, 9);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Log" &
- "with specified Base parameter, when the value " &
- "of the parameter X is 0.0");
- end;
- end if;
-
- -- Check for the prescribed results of the Log function with specified
- -- Base parameter.
-
- if GEF.Log(X => 1.0, Base => 16.0) /= 0.0 or
- EF.Log(X => 1.0, Base => 10.0) /= 0.0 or
- GEF.Log(1.0, Base => 8.0) /= 0.0 or
- EF.Log(1.0, 2.0) /= 0.0
- then
- Report.Failed("Incorrect result from Function Log with specified " &
- "Base parameter when provided an parameter X input " &
- "value of 1.0");
- end if;
-
-
- -- Check that the Log function with specified Base parameter provides
- -- correct results when provided a variety of input parameters.
-
- if not Result_Within_Range(GEF.Log( 10.0, e), 2.30, 0.01) or
- not Result_Within_Range( EF.Log( 8.0, 2.0), 3.0, 0.01) or
- not Result_Within_Range(GEF.Log(256.0, 2.0), 8.0, 0.01) or
- not Result_Within_Range( EF.Log(512.0, 8.0), 3.0, 0.01) or
- not Result_Within_Range(GEF.Log(0.5649, e), -0.57, 0.01) or
- not Result_Within_Range( EF.Log(1.7714, e), 0.57, 0.01) or
- not Result_Within_Range(GEF.Log(0.5718, 10.0), -0.243, 0.001) or
- not Result_Within_Range( EF.Log(466.25, 10.0), 2.67, 0.01)
- then
- Report.Failed("Incorrect results from Function Log with specified " &
- "Base parameter, when provided a variety of input " &
- "parameter values");
- end if;
-
-
- Arg := 1.0;
- while Arg < 1000.0 and
- not (Incorrect_Inverse_Base_2 and Incorrect_Inverse_Base_8 and
- Incorrect_Inverse_Base_10 and Incorrect_Inverse_Base_16)
- loop
- if not FXA5A00.Result_Within_Range(EF."**"(2.0,EF.Log(Arg,2.0)),
- Arg,
- 0.001)
- then
- Incorrect_Inverse_Base_2 := True;
- end if;
- if not FXA5A00.Result_Within_Range(EF."**"(8.0,EF.Log(Arg,8.0)),
- Arg,
- 0.001)
- then
- Incorrect_Inverse_Base_8 := True;
- end if;
- if not FXA5A00.Result_Within_Range(EF."**"(10.0,EF.Log(Arg,10.0)),
- Arg,
- 0.001)
- then
- Incorrect_Inverse_Base_10 := True;
- end if;
- if not FXA5A00.Result_Within_Range(EF."**"(16.0,EF.Log(Arg,16.0)),
- Arg,
- 0.001)
- then
- Incorrect_Inverse_Base_16 := True;
- end if;
- Arg := Arg + 1.0;
- end loop;
-
- if Incorrect_Inverse_Base_2 then
- Report.Failed("Incorrect inverse result comparing ""**"" and " &
- "Log function for Base 2");
- end if;
-
- if Incorrect_Inverse_Base_8 then
- Report.Failed("Incorrect inverse result comparing ""**"" and " &
- "Log function for Base 8");
- end if;
-
- if Incorrect_Inverse_Base_10 then
- Report.Failed("Incorrect inverse result comparing ""**"" and " &
- "Log function for Base 10");
- end if;
-
- if Incorrect_Inverse_Base_16 then
- Report.Failed("Incorrect inverse result comparing ""**"" and " &
- "Log function for Base 16");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXA5A09;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa5a10.a b/gcc/testsuite/ada/acats/tests/cxa/cxa5a10.a
deleted file mode 100644
index 4804d6729fc..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa5a10.a
+++ /dev/null
@@ -1,551 +0,0 @@
--- CXA5A10.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functions Exp and Sqrt, and the exponentiation
--- operator "**" provide correct results.
---
--- TEST DESCRIPTION:
--- This test examines both the versions of Exp, Sqrt, and "**"
--- resulting from the instantiation of the
--- Ada.Numerics.Generic_Elementary_Functions with a type derived from
--- type Float, as well as the preinstantiated version of this package
--- for type Float.
--- Prescribed results (stated as such in the reference manual),
--- including instances prescribed to raise exceptions, are examined
--- in the test cases. In addition, certain evaluations are performed
--- for the preinstantiated package where the actual function result is
--- compared with the expected result (within an epsilon range of
--- accuracy).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXA5A00.A (foundation code)
--- CXA5A10.A
---
---
--- CHANGE HISTORY:
--- 17 Apr 95 SAIC Initial prerelease version.
--- 13 Jun 95 SAIC Incorporated use of Dont_Optimize procedure, and
--- use of Result_Within_Range function overloaded for
--- FXA5A00.New_Float_Type.
--- 18 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 01 Oct 01 RLB Protected Constraint_Error exception tests by
--- first testing for 'Machine_Overflows.
---
---!
-
-with Ada.Exceptions;
-with Ada.Numerics.Elementary_Functions;
-with Ada.Numerics.Generic_Elementary_Functions;
-with FXA5A00;
-with Report;
-
-procedure CXA5A10 is
-begin
-
- Report.Test ("CXA5A10", "Check that Exp, Sqrt, and the ""**"" operator " &
- "provide correct results");
-
- Test_Block:
- declare
-
- use FXA5A00, Ada.Numerics;
- use Ada.Exceptions;
-
- package GEF is new Ada.Numerics.Generic_Elementary_Functions(New_Float);
- package EF renames Ada.Numerics.Elementary_Functions;
-
- use GEF, EF;
-
- Arg,
- Float_Result : Float;
- New_Float_Result : New_Float;
-
- Flag_1, Flag_2, Flag_3, Flag_4,
- Incorrect_Inverse_Base_e,
- Incorrect_Inverse_Base_2,
- Incorrect_Inverse_Base_8,
- Incorrect_Inverse_Base_10,
- Incorrect_Inverse_Base_16 : Boolean := False;
-
- procedure Dont_Optimize_Float is new Dont_Optimize(Float);
- procedure Dont_Optimize_New_Float is new Dont_Optimize(New_Float);
-
- begin
-
- -- Testing of the "**" operator, both instantiated and pre-instantiated
- -- version.
-
- -- Check that Argument_Error is raised by the exponentiation operator
- -- when the value of the Left parameter (operand) is negative.
-
- begin
- New_Float_Result := GEF."**"(Left => -10.0,
- Right => 2.0);
- Report.Failed("Argument_Error not raised by the instantiated " &
- "version of the exponentiation operator when the " &
- "value of the Left parameter is negative");
- Dont_Optimize_New_Float(New_Float_Result, 1);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the " &
- "instantiated version of the exponentiation " &
- "operator when the value of the Left parameter " &
- "is negative");
- end;
-
- begin
- Float_Result := (-FXA5A00.Small) ** 4.0;
- Report.Failed("Argument_Error not raised by the preinstantiated " &
- "version of the exponentiation operator when the " &
- "value of the Left parameter is negative");
- Dont_Optimize_Float(Float_Result, 2);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the " &
- "preinstantiated version of the exponentiation " &
- "operator when the value of the Left parameter " &
- "is negative");
- end;
-
-
- -- Check that Argument_Error is raised by the exponentiation operator
- -- when both parameters (operands) have the value 0.0.
-
- begin
- New_Float_Result := GEF."**"(0.0, Right => 0.0);
- Report.Failed("Argument_Error not raised by the instantiated " &
- "version of the exponentiation operator when " &
- "both operands are zero");
- Dont_Optimize_New_Float(New_Float_Result, 3);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the " &
- "instantiated version of the exponentiation " &
- "operator when both operands are zero");
- end;
-
- begin
- Float_Result := 0.0**0.0;
- Report.Failed("Argument_Error not raised by the preinstantiated " &
- "version of the exponentiation operator when both " &
- "operands are zero");
- Dont_Optimize_Float(Float_Result, 4);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the " &
- "preinstantiated version of the exponentiation " &
- "operator when both operands are zero");
- end;
-
-
- -- Check that Constraint_Error is raised by the exponentiation
- -- operator when the value of the left parameter (operand) is zero,
- -- and the value of the right parameter (exponent) is negative.
- -- This check applies only if Machine_Overflows is true [A.5.1(28, 30)].
-
- if New_Float'Machine_Overflows = True then
- begin
- New_Float_Result := GEF."**"(0.0, Right => -2.0);
- Report.Failed("Constraint_Error not raised by the instantiated " &
- "version of the exponentiation operator when " &
- "the left parameter is 0.0, and the right " &
- "parameter is negative");
- Dont_Optimize_New_Float(New_Float_Result, 5);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the " &
- "instantiated version of the exponentiation " &
- "operator when the left parameter is 0.0, " &
- "and the right parameter is negative");
- end;
- end if;
-
- if Float'Machine_Overflows = True then
- begin
- Float_Result := 0.0 ** (-FXA5A00.Small);
- Report.Failed("Constraint_Error not raised by the " &
- "preinstantiated version of the exponentiation " &
- "operator when the left parameter is 0.0, and the " &
- "right parameter is negative");
- Dont_Optimize_Float(Float_Result, 6);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by the " &
- "preinstantiated version of the exponentiation " &
- "operator when the left parameter is 0.0, and " &
- "the right parameter is negative");
- end;
- end if;
-
- -- Prescribed results.
- -- Check that exponentiation by a 0.0 exponent yields the value one.
-
- if GEF."**"(Left => 10.0, Right => 0.0) /= 1.0 or
- EF."**"(FXA5A00.Large, Right => 0.0) /= 1.0 or
- GEF."**"(3.0, 0.0) /= 1.0 or
- FXA5A00.Small ** 0.0 /= 1.0
- then
- Report.Failed("Incorrect results returned from the ""**"" " &
- "operator when the value of the exponent is 0.0");
- end if;
-
-
- -- Check that exponentiation by a unit exponent yields the value
- -- of the left operand.
-
- if GEF."**"(Left => 50.0, Right => 1.0) /= 50.0 or
- EF."**"(FXA5A00.Large, Right => 1.0) /= FXA5A00.Large or
- GEF."**"(6.0, 1.0) /= 6.0 or
- FXA5A00.Small ** 1.0 /= FXA5A00.Small
- then
- Report.Failed("Incorrect results returned from the ""**"" " &
- "operator when the value of the exponent is 1.0");
- end if;
-
-
- -- Check that exponentiation of the value 1.0 yields the value 1.0.
-
- if GEF."**"(Left => 1.0, Right => 16.0) /= 1.0 or
- EF."**"(1.0, Right => FXA5A00.Large) /= 1.0 or
- GEF."**"(1.0, 3.0) /= 1.0 or
- 1.0 ** FXA5A00.Small /= 1.0
- then
- Report.Failed("Incorrect results returned from the ""**"" " &
- "operator when the value of the operand is 1.0");
- end if;
-
-
- -- Check that exponentiation of the value 0.0 yields the value 0.0.
-
- if GEF."**"(Left => 0.0, Right => 10.0) /= 0.0 or
- EF."**"(0.0, Right => FXA5A00.Large) /= 0.0 or
- GEF."**"(0.0, 4.0) /= 0.0 or
- 0.0 ** FXA5A00.Small /= 0.0
- then
- Report.Failed("Incorrect results returned from the ""**"" " &
- "operator when the value of the operand is 0.0");
- end if;
-
-
- -- Check that exponentiation of various operands with a variety of
- -- of exponent values yield correct results.
-
- if not Result_Within_Range(GEF."**"(5.0, 2.0), 25.0, 0.01) or
- not Result_Within_Range(GEF."**"(1.225, 1.5), 1.36, 0.01) or
- not Result_Within_Range(GEF."**"(0.26, 2.0), 0.068, 0.001) or
- not Result_Within_Range( EF."**"(e, 5.0), 148.4, 0.1) or
- not Result_Within_Range( EF."**"(10.0, e), 522.7, 0.1) or
- not Result_Within_Range( EF."**"(e, (-3.0)), 0.050, 0.001) or
- not Result_Within_Range(GEF."**"(10.0,(-2.0)), 0.010, 0.001)
- then
- Report.Failed("Incorrect results returned from the ""**"" " &
- "operator with a variety of operand and exponent " &
- "values");
- end if;
-
-
- -- Use the following loops to check for internal consistency between
- -- inverse functions.
-
- declare
- -- Use the relative error value to account for non-exact
- -- computations.
- TC_Relative_Error: Float := 0.005;
- begin
- for i in 1..5 loop
- for j in 0..5 loop
- if not Incorrect_Inverse_Base_e and
- not FXA5A00.Result_Within_Range
- (Float(i)**Float(j),
- e**(Float(j)*EF.Log(Float(i))),
- TC_Relative_Error)
- then
- Incorrect_Inverse_Base_e := True;
- Report.Failed("Incorrect Log-** Inverse calc for Base e " &
- "with i= " & Integer'Image(i) & " and j= " &
- Integer'Image(j));
- end if;
- if not Incorrect_Inverse_Base_2 and
- not FXA5A00.Result_Within_Range
- (Float(i)**Float(j),
- 2.0**(Float(j)*EF.Log(Float(i),2.0)),
- TC_Relative_Error)
- then
- Incorrect_Inverse_Base_2 := True;
- Report.Failed("Incorrect Log-** Inverse calc for Base 2 " &
- "with i= " & Integer'Image(i) & " and j= " &
- Integer'Image(j));
- end if;
- if not Incorrect_Inverse_Base_8 and
- not FXA5A00.Result_Within_Range
- (Float(i)**Float(j),
- 8.0**(Float(j)*EF.Log(Float(i),8.0)),
- TC_Relative_Error)
- then
- Incorrect_Inverse_Base_8 := True;
- Report.Failed("Incorrect Log-** Inverse calc for Base 8 " &
- "with i= " & Integer'Image(i) & " and j= " &
- Integer'Image(j));
- end if;
- if not Incorrect_Inverse_Base_10 and
- not FXA5A00.Result_Within_Range
- (Float(i)**Float(j),
- 10.0**(Float(j)*EF.Log(Float(i),10.0)),
- TC_Relative_Error)
- then
- Incorrect_Inverse_Base_10 := True;
- Report.Failed("Incorrect Log-** Inverse calc for Base 10 " &
- "with i= " & Integer'Image(i) & " and j= " &
- Integer'Image(j));
- end if;
- if not Incorrect_Inverse_Base_16 and
- not FXA5A00.Result_Within_Range
- (Float(i)**Float(j),
- 16.0**(Float(j)*EF.Log(Float(i),16.0)),
- TC_Relative_Error)
- then
- Incorrect_Inverse_Base_16 := True;
- Report.Failed("Incorrect Log-** Inverse calc for Base 16 " &
- "with i= " & Integer'Image(i) & " and j= " &
- Integer'Image(j));
- end if;
- end loop;
- end loop;
- end;
-
- -- Reset Flags.
- Incorrect_Inverse_Base_e := False;
- Incorrect_Inverse_Base_2 := False;
- Incorrect_Inverse_Base_8 := False;
- Incorrect_Inverse_Base_10 := False;
- Incorrect_Inverse_Base_16 := False;
-
-
- -- Testing of Exp Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that the result of the Exp Function, when provided an X
- -- parameter value of 0.0, is 1.0.
-
- if GEF.Exp(X => 0.0) /= 1.0 or
- EF.Exp(0.0) /= 1.0
- then
- Report.Failed("Incorrect result returned by Function Exp when " &
- "given a parameter value of 0.0");
- end if;
-
-
- -- Check that the Exp Function provides correct results when provided
- -- a variety of input parameter values.
-
- if not Result_Within_Range(GEF.Exp(0.001), 1.01, 0.01) or
- not Result_Within_Range( EF.Exp(0.1), 1.11, 0.01) or
- not Result_Within_Range(GEF.Exp(1.2697), 3.56, 0.01) or
- not Result_Within_Range( EF.Exp(3.2525), 25.9, 0.1) or
- not Result_Within_Range(GEF.Exp(-0.2198), 0.803, 0.001) or
- not Result_Within_Range( EF.Exp(-1.6621), 0.190, 0.001) or
- not Result_Within_Range(GEF.Exp(-2.3888), 0.092, 0.001) or
- not Result_Within_Range( EF.Exp(-5.4415), 0.004, 0.001)
- then
- Report.Failed("Incorrect result from Function Exp when provided " &
- "a variety of input parameter values");
- end if;
-
- -- Use the following loops to check for internal consistency between
- -- inverse functions.
-
- Arg := 0.01;
- while Arg < 10.0 loop
- if not Incorrect_Inverse_Base_e and
- FXA5A00.Result_Within_Range(EF.Exp(Arg),
- e**(Arg*EF.Log(Arg)),
- 0.001)
- then
- Incorrect_Inverse_Base_e := True;
- Report.Failed("Incorrect Exp-** Inverse calc for Base e");
- end if;
- if not Incorrect_Inverse_Base_2 and
- FXA5A00.Result_Within_Range(EF.Exp(Arg),
- 2.0**(Arg*EF.Log(Arg,2.0)),
- 0.001)
- then
- Incorrect_Inverse_Base_2 := True;
- Report.Failed("Incorrect Exp-** Inverse calc for Base 2");
- end if;
- if not Incorrect_Inverse_Base_8 and
- FXA5A00.Result_Within_Range(EF.Exp(Arg),
- 8.0**(Arg*EF.Log(Arg,8.0)),
- 0.001)
- then
- Incorrect_Inverse_Base_8 := True;
- Report.Failed("Incorrect Exp-** Inverse calc for Base 8");
- end if;
- if not Incorrect_Inverse_Base_10 and
- FXA5A00.Result_Within_Range(EF.Exp(Arg),
- 10.0**(Arg*EF.Log(Arg,10.0)),
- 0.001)
- then
- Incorrect_Inverse_Base_10 := True;
- Report.Failed("Incorrect Exp-** Inverse calc for Base 10");
- end if;
- if not Incorrect_Inverse_Base_16 and
- FXA5A00.Result_Within_Range(EF.Exp(Arg),
- 16.0**(Arg*EF.Log(Arg,16.0)),
- 0.001)
- then
- Incorrect_Inverse_Base_16 := True;
- Report.Failed("Incorrect Exp-** Inverse calc for Base 16");
- end if;
- Arg := Arg + 0.01;
- end loop;
-
-
- -- Testing of Sqrt Function, both instantiated and pre-instantiated
- -- version.
-
- -- Check that Argument_Error is raised by the Sqrt Function when
- -- the value of the input parameter X is negative.
-
- begin
- Float_Result := EF.Sqrt(X => -FXA5A00.Small);
- Report.Failed("Argument_Error not raised by Function Sqrt " &
- "when provided a small negative input parameter " &
- "value");
- Dont_Optimize_Float(Float_Result, 7);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Sqrt " &
- "when provided a small negative input parameter " &
- "value");
- end;
-
- begin
- New_Float_Result := GEF.Sqrt(X => -64.0);
- Report.Failed("Argument_Error not raised by Function Sqrt " &
- "when provided a large negative input parameter " &
- "value");
- Dont_Optimize_New_Float(New_Float_Result, 8);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function Sqrt " &
- "when provided a large negative input parameter " &
- "value");
- end;
-
-
- -- Check that the Sqrt Function, when given an X parameter value of 0.0,
- -- returns a result of 0.0.
-
- if GEF.Sqrt(X => 0.0) /= 0.0 or
- EF.Sqrt(0.0) /= 0.0
- then
- Report.Failed("Incorrect result from Function Sqrt when provided " &
- "an input parameter value of 0.0");
- end if;
-
-
- -- Check that the Sqrt Function, when given an X parameter input value
- -- of 1.0, returns a result of 1.0.
-
- if GEF.Sqrt(X => 1.0) /= 1.0 or
- EF.Sqrt(1.0) /= 1.0
- then
- Report.Failed("Incorrect result from Function Sqrt when provided " &
- "an input parameter value of 1.0");
- end if;
-
-
- -- Check that the Sqrt Function provides correct results when provided
- -- a variety of input parameter values.
-
- if not FXA5A00.Result_Within_Range(GEF.Sqrt(0.0327), 0.181, 0.001) or
- not FXA5A00.Result_Within_Range( EF.Sqrt(0.1808), 0.425, 0.001) or
- not FXA5A00.Result_Within_Range(GEF.Sqrt(1.0556), 1.03, 0.01) or
- not FXA5A00.Result_Within_Range( EF.Sqrt(32.8208), 5.73, 0.01) or
- not FXA5A00.Result_Within_Range( EF.Sqrt(27851.0), 166.9, 0.1) or
- not FXA5A00.Result_Within_Range( EF.Sqrt(61203.4), 247.4, 0.1) or
- not FXA5A00.Result_Within_Range( EF.Sqrt(655891.0), 809.9, 0.1)
- then
- Report.Failed("Incorrect result from Function Sqrt when provided " &
- "a variety of input parameter values");
- end if;
-
- -- Check internal consistency between functions.
-
- Arg := 0.01;
- while Arg < 10.0 loop
- if not Flag_1 and
- not FXA5A00.Result_Within_Range(Arg,
- EF.Sqrt(Arg)*EF.Sqrt(Arg),
- 0.01)
- then
- Report.Failed("Inconsistency found in Case 1");
- Flag_1 := True;
- end if;
- if not Flag_2 and
- not FXA5A00.Result_Within_Range(Arg, EF.Sqrt(Arg)**2.0, 0.01)
- then
- Report.Failed("Inconsistency found in Case 2");
- Flag_2 := True;
- end if;
- if not Flag_3 and
- not FXA5A00.Result_Within_Range(EF.Log(Arg),
- EF.Log(Sqrt(Arg)**2.0), 0.01)
- then
- Report.Failed("Inconsistency found in Case 3");
- Flag_3 := True;
- end if;
- if not Flag_4 and
- not FXA5A00.Result_Within_Range(EF.Log(Arg),
- 2.00*EF.Log(EF.Sqrt(Arg)),
- 0.01)
- then
- Report.Failed("Inconsistency found in Case 4");
- Flag_4 := True;
- end if;
- Arg := Arg + 1.0;
- end loop;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXA5A10;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa8001.a b/gcc/testsuite/ada/acats/tests/cxa/cxa8001.a
deleted file mode 100644
index 16f30752db1..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa8001.a
+++ /dev/null
@@ -1,243 +0,0 @@
--- CXA8001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that all elements to be transferred to a sequential file of
--- mode Append_File will be placed following the last element currently
--- in the file.
--- Check that it is possible to append data to a file that has been
--- previously appended to.
--- Check that the predefined procedure Write will place an element after
--- the last element in the file in mode Append_File.
---
--- TEST DESCRIPTION:
--- This test implements a sequential file system that has the capability
--- to store data records at the end of a file. Initially, the file is
--- opened with mode Out_File, and data is written to the file. The file
--- is closed, then reopened with mode Append_File. An additional record
--- is written, and again the file is closed. The file is then reopened,
--- again with mode Append_File, and another record is written to the
--- file.
--- The file is closed again, the reopened with mode In_File, and the data
--- in the file is read and checked for proper ordering within the file.
---
--- An expected common usage of Append_File mode would be in the opening
--- of a file that currently contains data. Likewise, the reopening of
--- files in Append_Mode that have been previously appended to for the
--- addition of more data would be frequently encountered. This test
--- attempts to simulate both situations. (Of course, in an actual user
--- environment, the open/write/close processing would be performed using
--- looping structures, rather than the straight-line processing displayed
--- here.)
---
--- APPLICABILITY CRITERIA:
--- Applicable to all systems capable of supporting IO operations on
--- external Sequential_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 27 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-with Sequential_IO;
-with Report;
-
-procedure CXA8001 is
-
- -- Declare data types and objects to be stored in the file.
- subtype Name_Type is String (1 .. 10);
- type Tickets is range 0 .. 1000;
-
- type Order_Type is record
- Name : Name_Type;
- No_of_Tickets : Tickets;
- end record;
-
- package Order_IO is new Sequential_IO (Order_Type); -- Declare Seq_IO
- -- package,
- Order_File : Order_IO.File_Type; -- and file object.
- Order_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXA8001" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXA8001", "Check that all elements to be transferred to a " &
- "sequential file of mode Append_File will be " &
- "placed following the last element currently " &
- "in the file");
-
- Test_for_Sequential_IO_Support:
- begin
-
- -- An implementation that does not support Sequential_IO in a particular
- -- environment will raise Use_Error or Name_Error on calls to various
- -- Sequential_IO operations. This block statement encloses a call to
- -- Create, which should produce an exception in a non-supportive
- -- environment. These exceptions will be handled to produce a
- -- Not_Applicable result.
-
- Order_IO.Create (File => Order_File, -- Create Sequential_IO file
- Mode => Order_IO.Out_File, -- with mode Out_File.
- Name => Order_Filename);
-
- exception
-
- when Order_IO.Use_Error | Order_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Sequential_IO" );
- raise Incomplete;
-
- end Test_for_Sequential_IO_Support;
-
- Operational_Test_Block:
- declare
- -- Assign values into the component fields of the data objects.
- Buyer_1 : constant Order_Type := ("John Smith", 3);
- Buyer_2 : constant Order_Type :=
- (Name => "Jane Jones", No_of_Tickets => 2);
- Buyer_3 : Order_Type := ("Mike Brown", 5);
-
- begin
- Order_IO.Write (File => Order_File, -- Write initial data item
- Item => Buyer_1); -- to file.
-
- Order_IO.Close (File => Order_File); -- Close file.
-
- --
- -- Enter additional data records into the file. (Append to a file of
- -- previous mode Out_File).
- --
- Order_IO.Open (Order_File, -- Open Sequential_IO file
- Order_IO.Append_File, -- with mode Append_File.
- Order_Filename);
-
- Order_IO.Write (Order_File, Buyer_2); -- Write second data item
- -- to file.
- Order_IO.Close (File => Order_File); -- Close file.
-
- -- Check to determine whether file is actually closed.
- begin
- Order_IO.Write (Order_File, Buyer_2);
- Report.Failed("Exception not raised on Write to Closed file");
- exception
- when Order_IO.Status_Error => null; -- Expected exception.
- when others =>
- Report.Failed("Incorrect exception on Write to Closed file");
- end;
-
- --
- -- The following code segment demonstrates appending data to a file
- -- that has been previously appended to.
- --
-
- Order_IO.Open (Order_File, -- Open Sequential_IO file
- Order_IO.Append_File, -- with mode Append_File.
- Order_Filename );
-
- Order_IO.Write (Order_File, Buyer_3); -- Write third data item
- -- to file.
- Order_IO.Close (File => Order_File); -- Close file.
-
-
- Test_Verification_Block:
- declare
- TC_Order1, TC_Order2, TC_Order3 : Order_Type;
- begin
-
- Order_IO.Open (Order_File, -- Open Sequential_IO file
- Order_IO.In_File, -- with mode In_File.
- Order_Filename );
-
- Order_IO.Read (File => Order_File, -- Read records from file.
- Item => TC_Order1);
- Order_IO.Read (Order_File, TC_Order2);
- Order_IO.Read (Order_File, TC_Order3);
-
- -- Compare the contents of each with the individual data items.
- -- If items read from file do not match the items placed into
- -- the file, in the appropriate order, then fail.
-
- if ((TC_Order1 /= Buyer_1) or
- (TC_Order2.Name /= Buyer_2.Name) or
- (TC_Order2.No_of_Tickets /= Buyer_2.No_of_Tickets) or
- not ((TC_Order3.Name = "Mike Brown") and
- (TC_Order3.No_of_Tickets = 5))) then
- Report.Failed ("Incorrect appending of record data in file");
- end if;
-
- -- Check to determine that no more than three data records were
- -- actually written to the file.
- if not Order_IO.End_Of_File (Order_File) then
- Report.Failed("File not empty after three reads");
- end if;
-
- exception
-
- when Order_IO.End_Error => -- If three items not in
- -- file (data overwritten),
- -- then fail.
- Report.Failed ("Incorrect number of record elements in file");
-
- when others =>
- Report.Failed ("Error raised during data verification");
-
- end Test_Verification_Block;
-
- exception
-
- when others =>
- Report.Failed("Exception raised during Sequential_IO processing");
-
- end Operational_Test_Block;
-
- Deletion:
- begin
- -- Check that file is open prior to deleting it.
- if Order_IO.Is_Open(Order_File) then
- Order_IO.Delete (Order_File);
- else
- Order_IO.Open(Order_File, Order_IO.In_File, Order_Filename);
- Order_IO.Delete (Order_File);
- end if;
-
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Sequential_IO" );
-
- end Deletion;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXA8001;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa8002.a b/gcc/testsuite/ada/acats/tests/cxa/cxa8002.a
deleted file mode 100644
index 8670e98bac9..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa8002.a
+++ /dev/null
@@ -1,285 +0,0 @@
--- CXA8002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that resetting a file using mode Append_File allows for the
--- writing of elements to the file starting after the last element in
--- the file.
--- Check that the result of function Name can be used on a subsequent
--- reopen of the file.
--- Check that a mode change occurs on reset of a file to/from mode
--- Append_File.
---
--- TEST DESCRIPTION:
--- This test simulates the read/write of data from/to an individual
--- sequential file. New data can be appended to the end of the existing
--- file, and the same file can be reset to allow reading of data from
--- the file. This process can occur multiple times.
--- When the mode of the file is changed with a Reset, the current mode
--- value assigned to the file is checked using the result of function
--- Mode. This, in conjunction with the read/write operations, verifies
--- that a mode change has taken place on Reset.
---
--- An expected common usage of the scenarios found in this test would
--- be a case where a single data file is kept open continuously, being
--- reset for read/append of data. For systems that do not support a
--- direct form of I/O, this would allow for efficient use of a sequential
--- I/O file.
---
--- APPLICABILITY CRITERIA:
--- Applicable to all systems capable of supporting IO operations on
--- external Sequential_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Feb 97 PWB.CTA Fixed handling for file non-support and Reset
--- non-support.
---!
-
-with Sequential_IO;
-with Report;
-
-procedure CXA8002 is
- subtype Employee_Data is String (1 .. 11);
- package Data_IO is new Sequential_IO (Employee_Data);
-
- Employee_Data_File : Data_IO.File_Type;
- Employee_Filename : constant String :=
- Report.Legal_File_Name (Nam => "CXA8002");
-
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXA8002", "Check that resetting a file using mode " &
- "Append_File allows for the writing of " &
- "elements to the file starting after the " &
- "last element in the file");
-
- Test_for_Sequential_IO_Support:
- begin
-
- -- An implementation that does not support Sequential_IO in a particular
- -- environment will raise Use_Error or Name_Error on calls to various
- -- Sequential_IO operations. This block statement encloses a call to
- -- Create, which should produce an exception in a non-supportive
- -- environment. These exceptions will be handled to produce a
- -- Not_Applicable result.
-
- Data_IO.Create (File => Employee_Data_File, -- Create file in
- Mode => Data_IO.Append_File, -- mode Append_File.
- Name => Employee_Filename);
-
- --
- -- The following portion of code demonstrates the fact that a sequential
- -- file can be created in Append_File mode, and that data can be written
- -- to the file.
- --
-
- exception
- when Data_IO.Use_Error | Data_IO.Name_Error =>
- Report.Not_Applicable
- ( "Sequential files not supported - Create as Append_File");
- raise Incomplete;
- end Test_for_Sequential_IO_Support;
- Operational_Test_Block:
- declare
- Blank_Data : constant Employee_Data := " ";
- Employee_1 : constant Employee_Data := "123-45-6789";
- Employee_2 : Employee_Data := "987-65-4321";
-
- -- Note: Artificial numerical data chosen above to prevent any
- -- unintended similarity with persons alive or dead.
-
- TC_Employee_Data : Employee_Data := Blank_Data;
-
-
- function TC_Mode_Selection (Selector : Integer)
- return Data_IO.File_Mode is
- begin
- case Report.Ident_Int(Selector) is
- when 1 => return Data_IO.In_File;
- when 2 => return Data_IO.Out_File;
- when others => return Data_IO.Append_File;
- end case;
- end TC_Mode_Selection;
-
- Employee_Filename : constant String := -- Use function Name to
- Data_IO.Name (File => Employee_Data_File); -- store filename in
- -- string variable.
- begin
-
- Data_IO.Write (File => Employee_Data_File, -- Write initial data
- Item => Employee_1); -- entry to file.
-
- --
- -- The following portion of code demonstrates that a sequential file
- -- can be reset to various file modes, including Append_File mode,
- -- allowing data to be added to the end of the file.
- --
- begin
- Data_IO.Reset (File => Employee_Data_File, -- Reset file with
- Mode => Data_IO.In_File); -- mode In_File.
- exception
- when Data_IO.Use_Error =>
- Report.Not_Applicable
- ("Reset to In_File not supported for Sequential_IO");
- raise Incomplete;
- when others =>
- Report.Failed
- ("Unexpected exception on Reset to In_File (Sequential_IO)");
- raise Incomplete;
- end;
- if Data_IO."="(Data_IO.Mode (Employee_Data_File),
- TC_Mode_Selection (1)) then -- Compare In_File mode
- -- Reset successful,
- Data_IO.Read (File => Employee_Data_File, -- now verify file data.
- Item => TC_Employee_Data);
-
- if ((TC_Employee_Data (1 .. 7) /= "123-45-") or
- (TC_Employee_Data (5 .. 11) /= "45-6789")) then
- Report.Failed ("Data read error");
- end if;
-
- else
- Report.Failed ("File mode not changed by Reset");
- end if;
-
- --
- -- Simulate appending data to a file that has previously been written
- -- to and read from.
- --
- begin
- Data_IO.Reset (File => Employee_Data_File, -- Reset file with
- Mode => Data_IO.Append_File); -- mode Append_File.
- exception
- when Data_IO.Use_Error =>
- Report.Not_Applicable
- ("Reset to Append_File not supported for Sequential_IO");
- raise Incomplete;
- when others =>
- Report.Failed
- ("Unexpected exception on Reset to Append_File (Sequential_IO)");
- raise Incomplete;
- end;
-
- if Data_IO.Is_Open (Employee_Data_File) then -- File remains open
- -- following Reset to
- -- Append_File mode?
-
- if Data_IO."=" (Data_IO.Mode (Employee_Data_File),
- TC_Mode_Selection (3)) then -- Compare to
- -- Append_File mode.
- Data_IO.Write (File => Employee_Data_File, -- Write additional
- Item => Employee_2); -- data to file.
- else
- Report.Failed ("File mode not changed by Reset");
- end if;
-
- else
- Report.Failed
- ("File status not Open following Reset to Append mode");
- end if;
-
- Data_IO.Close (Employee_Data_File);
-
-
- Test_Verification_Block:
- begin
-
- Data_IO.Open (File => Employee_Data_File, -- Reopen file, using
- Mode => Data_IO.In_File, -- previous result of
- Name => Employee_Filename); -- function Name.
-
- TC_Employee_Data := Blank_Data; -- Clear record field.
- Data_IO.Read (Employee_Data_File, -- Read first record,
- TC_Employee_Data); -- check ordering of
- -- records.
-
- if not ((TC_Employee_Data (1 .. 3) = "123") and then
- (TC_Employee_Data (4 .. 11) = "-45-6789")) then
- Report.Failed ("Data read error - first record");
- end if;
-
- TC_Employee_Data := Blank_Data; -- Clear record field.
- Data_IO.Read (Employee_Data_File, -- Read second record,
- TC_Employee_Data); -- check for ordering of
- -- records.
-
- if ((TC_Employee_Data (1 .. 6) /= "987-65") or else
- not (TC_Employee_Data (3 .. 11) = "7-65-4321")) then
- Report.Failed ("Data read error - second record");
- end if;
-
- -- Check that only two items were written to the file.
- if not Data_IO.End_Of_File(Employee_Data_File) then
- Report.Failed("Incorrect number of records in file");
- end if;
-
- exception
-
- when Data_IO.End_Error => -- If two items not in
- -- file (data overwritten),
- -- then fail.
- Report.Failed ("Incorrect number of record elements in file");
-
- when others =>
- Report.Failed ("Error raised during data verification");
-
- end Test_Verification_Block;
-
- exception
-
- when others =>
- Report.Failed("Exception raised during Sequential_IO processing");
-
- end Operational_Test_Block;
-
- Final_Block:
- begin
- -- Check that file is open prior to deleting it.
- if Data_IO.Is_Open(Employee_Data_File) then
- Data_IO.Delete (Employee_Data_File);
- else
- Data_IO.Open(Employee_Data_File,
- Data_IO.In_File,
- Employee_Filename);
- Data_IO.Delete (Employee_Data_File);
- end if;
- exception
- when others =>
- Report.Failed ("Sequential_IO Delete not properly supported");
- end Final_Block;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ("Unexpected exception");
- Report.Result;
-end CXA8002;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa8003.a b/gcc/testsuite/ada/acats/tests/cxa/cxa8003.a
deleted file mode 100644
index cf9b5e07598..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa8003.a
+++ /dev/null
@@ -1,214 +0,0 @@
--- CXA8003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Append_File mode has not been added to package Direct_IO.
---
--- TEST DESCRIPTION:
--- This test uses a procedure to change the mode of an existing Direct_IO
--- file. The file descriptor is passed as a parameter, along with a
--- numeric indicator for the new mode. Based on the numeric parameter,
--- a Direct_IO.Reset is performed using a File_Mode'Value transformation
--- of a string constant into a File_Mode value. An attempt to reset a
--- Direct_IO file to mode Append_File should cause an Constraint_Error
--- to be raised, as Append_File mode has not been added to Direct_IO in
--- Ada 9X.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations supporting Direct_IO
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 19 Feb 97 PWB.CTA Allowed for non-support of Reset for certain
--- modes.
---!
-
-with Direct_IO;
-with Report;
-
-procedure CXA8003 is
- Incomplete : exception;
- begin
-
- Report.Test ("CXA8003", "Check that Append_File mode has not " &
- "been added to package Direct_IO");
-
- Test_for_Direct_IO_Support:
- declare
-
- subtype String_Data_Type is String (1 .. 20);
- type Numeric_Data_Type is range 1 .. 512;
- type Composite_Data_Type is array (1 .. 3) of String_Data_Type;
-
- type File_Data_Type is record
- Data_Field_1 : String_Data_Type;
- Data_Field_2 : Numeric_Data_Type;
- Data_Field_3 : Composite_Data_Type;
- end record;
-
- package Dir_IO is new Direct_IO (File_Data_Type);
-
- Data_File : Dir_IO.File_Type;
- Dir_Filename : constant String := Report.Legal_File_Name;
-
- begin
-
- -- An application creates a text file with mode Out_File.
- -- Use_Error will be raised if Direct_IO operations or external
- -- files are not supported.
-
- Dir_IO.Create (Data_File,
- Dir_IO.Out_File,
- Dir_Filename);
-
- Change_File_Mode:
- declare
-
- TC_Append_Test_Executed : Boolean := False;
-
- type Mode_Selection_Type is ( A, I, IO, O );
-
-
- procedure Change_Mode (File : in out Dir_IO.File_Type;
- To : in Mode_Selection_Type) is
- begin
- case To is
- when A =>
- TC_Append_Test_Executed := True;
- Dir_IO.Reset
- (File, Dir_IO.File_Mode'Value("Append_File"));
- when I =>
- begin
- Dir_IO.Reset
- (File, Dir_IO.File_Mode'Value("In_File"));
- exception
- when Dir_IO.Use_Error =>
- Report.Not_Applicable
- ("Reset to In_File not supported: Direct_IO");
- raise Incomplete;
- end;
- when IO =>
- begin
- Dir_IO.Reset
- (File, Dir_IO.File_Mode'Value("Inout_File"));
- exception
- when Dir_IO.Use_Error =>
- Report.Not_Applicable
- ("Reset to InOut_File not supported: Direct_IO");
- raise Incomplete;
- end;
- when O =>
- begin
- Dir_IO.Reset
- (File, Dir_IO.File_Mode'Value("Out_File"));
- exception
- when Dir_IO.Use_Error =>
- Report.Not_Applicable
- ("Reset to Out_File not supported: Direct_IO");
- raise Incomplete;
- end;
- end case;
- end Change_Mode;
-
-
- begin
-
- -- At some point in the processing, the application may call a
- -- procedure to change the mode of the file (perhaps for
- -- additional data entry, data verification, etc.). It is at
- -- this point that a use of Append_File mode for a Direct_IO
- -- file would cause an exception.
-
- for I in reverse Mode_Selection_Type loop
- Change_Mode (Data_File, I);
- Report.Comment
- ("Mode changed to " &
- Dir_IO.File_Mode'Image (Dir_IO.Mode (Data_File)));
- end loop;
-
- Report.Failed("No error raised on change to Append_File mode");
-
- exception
-
- -- A handler has been provided in the application, which
- -- handles the constraint error, allowing processing to
- -- continue.
-
- when Constraint_Error =>
-
- if TC_Append_Test_Executed then
- Report.Comment ("Constraint_Error correctly raised on " &
- "attempted Append_File mode selection " &
- "for a Direct_IO file");
- else
- Report.Failed ("Append test was not executed");
- end if;
-
- when Incomplete => raise;
-
- when others => Report.Failed ("Unexpected exception raised");
-
- end Change_File_Mode;
-
- Final_Block:
- begin
- if Dir_IO.Is_Open (Data_File) then
- Dir_IO.Delete (Data_File);
- else
- Dir_IO.Open (Data_File, Dir_IO.In_File, Dir_Filename);
- Dir_IO.Delete (Data_File);
- end if;
- exception
- when others =>
- Report.Failed ("Delete not properly supported: Direct_IO");
- end Final_Block;
-
- exception
-
- -- Since Use_Error or Name_Error can be raised if, for the
- -- specified mode, the environment does not support Direct_IO
- -- operations, the following handlers are included:
-
- when Dir_IO.Name_Error =>
- Report.Not_Applicable("Name_Error raised on Direct IO Create");
-
- when Dir_IO.Use_Error =>
- Report.Not_Applicable("Use_Error raised on Direct IO Create");
-
- when others =>
- Report.Failed
- ("Unexpected exception raised on Direct IO Create");
-
- end Test_for_Direct_IO_Support;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
-
-end CXA8003;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa9001.a b/gcc/testsuite/ada/acats/tests/cxa/cxa9001.a
deleted file mode 100644
index 4fe9c357614..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa9001.a
+++ /dev/null
@@ -1,287 +0,0 @@
--- CXA9001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the operations defined in the generic package
--- Ada.Storage_IO provide the ability to store and retrieve objects
--- which may include implicit levels of indirection in their
--- implementation, from an in-memory buffer.
---
--- TEST DESCRIPTION:
--- The following scenario demonstrates how an object of a type with
--- (potential) levels of indirection (based on the implementation)
--- can be "flattened" and written/read to/from a Direct_IO file.
--- In this small example, we have attempted to simulate the situation
--- where two independent programs are using a particular Direct_IO file,
--- one writing data to the file, and the second program reading that file.
--- The Storage_IO Read and Write procedures are used to "flatten"
--- and reconstruct objects of the record type.
---
--- APPLICABILITY CRITERIA:
--- Applicable to implementations capable of supporting external
--- Direct_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 07 Jun 95 SAIC Modified to constrain type used with Storage_IO.
--- 20 Nov 95 SAIC Corrected and enhanced for ACVC 2.0.1.
--- 25 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-with Report;
-with Ada.Storage_IO;
-with Ada.Direct_IO;
-
-procedure CXA9001 is
- package Dir_IO is new Ada.Direct_IO (Integer);
- Test_File : Dir_IO.File_Type;
- Incomplete : exception;
-begin
-
- Report.Test ("CXA9001", "Check that the operations defined in the " &
- "generic package Ada.Storage_IO provide the " &
- "ability to store and retrieve objects which " &
- "may include implicit levels of indirection in " &
- "their implementation, from an in-memory buffer");
-
-
- Test_For_Direct_IO_Support:
- begin
-
- -- The following Create does not have any bearing on the test scenario,
- -- but is included to check that the implementation supports Direct_IO
- -- files. An exception on this Create statement will raise a Name_Error
- -- or Use_Error, which will be handled to produce a Not_Applicable
- -- result. If created, the file is immediately deleted, as it is not
- -- needed for the program scenario.
-
- Dir_IO.Create (Test_File, Dir_IO.Out_File, Report.Legal_File_Name(1));
-
- exception
-
- when Dir_IO.Use_Error | Dir_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Direct_IO" );
- raise Incomplete;
-
- end Test_for_Direct_IO_Support;
-
- Deletion1:
- begin
- Dir_IO.Delete (Test_File);
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Direct_IO - 1" );
- end Deletion1;
-
-
- Test_Block:
- declare
-
- The_Filename : constant String := Report.Legal_File_Name(2);
-
- -- The following type is the basic unit used in this test. It is
- -- incorporated into the definition of the Unit_Array_Type.
-
- type Unit_Type is
- record
- Position : Natural := 19;
- String_Value : String (1..9) := (others => 'X');
- end record;
-
- TC_Size : Natural := Natural'First;
-
- procedure Data_Storage (Number_Of_Units : in Natural;
- Result : out Natural) is
-
- -- Type based on input parameter. Uses type Unit_Type
- -- as the array element.
- type Unit_Array_Type is array (1..Number_Of_Units)
- of Unit_Type;
-
- -- This type definition is the ultimate storage type used
- -- in this test; uses type Unit_Array_Type as a record
- -- component field.
- -- This record type contains a component that is an array of
- -- records, with each of these records containing a Natural
- -- and a String value (i.e., a record containing an array of
- -- records).
-
- type Data_Storage_Type is
- record
- Data_Value : Natural := Number_Of_Units;
- Unit_Array : Unit_Array_Type;
- end record;
-
- -- The instantiation of the following generic package is a
- -- central point in this test. Storage_IO is instantiated for
- -- a specific data type, and will be used to "flatten" objects
- -- of that type into buffers. Direct_IO is instantiated for
- -- these Storage_IO buffers.
-
- package Flat_Storage_IO is
- new Ada.Storage_IO (Data_Storage_Type);
- package Buffer_IO is
- new Ada.Direct_IO (Flat_Storage_IO.Buffer_Type);
-
- Buffer_File : Buffer_IO.File_Type;
- Outbound_Buffer : Flat_Storage_IO.Buffer_Type;
- Storage_Item : Data_Storage_Type;
-
- begin -- procedure Data_Storage
-
- Buffer_IO.Create (Buffer_File,
- Buffer_IO.Out_File,
- The_Filename);
-
- Flat_Storage_IO.Write (Buffer => Outbound_Buffer,
- Item => Storage_Item);
-
- -- At this point, any levels of indirection have been removed
- -- by the Storage_IO procedure, and the buffered data can be
- -- written to a file.
-
- Buffer_IO.Write (Buffer_File, Outbound_Buffer);
- Buffer_IO.Close (Buffer_File);
- Result := Storage_Item.Unit_Array'Last + -- 5 +
- Storage_Item.Unit_Array -- 9
- (Storage_Item.Unit_Array'First).String_Value'Length;
-
- exception
- when others =>
- Report.Failed ("Data storage error");
- if Buffer_IO.Is_Open (Buffer_File) then
- Buffer_IO.Close (Buffer_File);
- end if;
- end Data_Storage;
-
- procedure Data_Retrieval (Number_Of_Units : in Natural;
- Result : out Natural) is
- type Unit_Array_Type is array (1..Number_Of_Units)
- of Unit_Type;
-
- type Data_Storage_Type is
- record
- Data_Value : Natural := Number_Of_Units;
- Unit_Array : Unit_Array_Type;
- end record;
-
- package Flat_Storage_IO is
- new Ada.Storage_IO (Data_Storage_Type);
- package Reader_IO is
- new Ada.Direct_IO (Flat_Storage_IO.Buffer_Type);
-
- Reader_File : Reader_IO.File_Type;
- Inbound_Buffer : Flat_Storage_IO.Buffer_Type;
- Storage_Item : Data_Storage_Type;
- TC_Item : Data_Storage_Type;
-
- begin -- procedure Data_Retrieval
-
- Reader_IO.Open (Reader_File, Reader_IO.In_File, The_Filename);
- Reader_IO.Read (Reader_File, Inbound_Buffer);
-
- Flat_Storage_IO.Read (Inbound_Buffer, Storage_Item);
-
- -- Validate the reconstructed value against an "unflattened"
- -- value.
-
- if Storage_Item.Data_Value /= TC_Item.Data_Value
- then
- Report.Failed ("Data_Retrieval Error - 1");
- end if;
-
- for i in 1..Number_Of_Units loop
- if Storage_Item.Unit_Array(i).String_Value'Length /=
- TC_Item.Unit_Array(i).String_Value'Length or
- Storage_Item.Unit_Array(i).Position /=
- TC_Item.Unit_Array(i).Position or
- Storage_Item.Unit_Array(i).String_Value /=
- TC_Item.Unit_Array(i).String_Value
- then
- Report.Failed ("Data_Retrieval Error - 2");
- end if;
- end loop;
-
- Result := Storage_Item.Unit_Array'Last + -- 5 +
- Storage_Item.Unit_Array -- 9
- (Storage_Item.Unit_Array'First).String_Value'Length;
-
- if Reader_IO.Is_Open (Reader_File) then
- Reader_IO.Delete (Reader_File);
- else
- Reader_IO.Open (Reader_File,
- Reader_IO.In_File,
- The_Filename);
- Reader_IO.Delete (Reader_File);
- end if;
-
- exception
- when others =>
- Report.Failed ("Exception raised in Data_Retrieval");
- if Reader_IO.Is_Open (Reader_File) then
- Reader_IO.Delete (Reader_File);
- else
- Reader_IO.Open (Reader_File,
- Reader_IO.In_File,
- The_Filename);
- Reader_IO.Delete (Reader_File);
- end if;
- end Data_Retrieval;
-
-
- begin -- Test_Block
-
- -- The number of Units is provided in this call to Data_Storage.
- Data_Storage (Number_Of_Units => Natural(Report.Ident_Int(5)),
- Result => TC_Size);
-
- if TC_Size /= 14 then
- Report.Failed ("Data_Storage error in Data_Storage");
- end if;
-
- Data_Retrieval (Number_Of_Units => Natural(Report.Ident_Int(5)),
- Result => TC_Size);
-
- if TC_Size /= 14 then
- Report.Failed ("Data retrieval error in Data_Retrieval");
- end if;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXA9001;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa9002.a b/gcc/testsuite/ada/acats/tests/cxa/cxa9002.a
deleted file mode 100644
index 415a56630ad..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa9002.a
+++ /dev/null
@@ -1,482 +0,0 @@
--- CXA9002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the operations defined in the generic package
--- Ada.Storage_IO provide the ability to store and retrieve objects
--- of tagged types from in-memory buffers.
---
--- TEST DESCRIPTION:
--- The following scenario demonstrates how objects of a tagged type,
--- extended types, and twice extended types can be written/read
--- to/from Direct_IO files. The Storage_IO subprograms, Read and Write,
--- demonstrated in this scenario, perform tag "fixing" prior to/following
--- transfer to the Direct_IO files.
--- This method is especially important for those implementations that
--- represent tags as pointers, or for cases where the tagged objects
--- are read in by a program other than the one that wrote them.
---
--- In this small example, we have attempted to simulate the situation
--- where two independent programs are using a series of Direct_IO files,
--- one writing data to the files, and the second program reading the
--- data from those files. Two procedures are defined, the first
--- simulating the program responsible for writing, the second simulating
--- a separate program opening and reading the data from the files.
---
--- The hierarchy of types used in this test can be displayed as follows:
---
--- Account_Type
--- / \
--- / \
--- / \
--- Cash_Account_Type Investment_Account_Type
--- / \
--- / \
--- / \
--- Checking_Account_Type Savings_Account_Type
---
--- APPLICABILITY CRITERIA:
--- Applicable to implementations capable of supporting external
--- Direct_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 08 Nov 95 SAIC Corrected incorrect prefix of 'Tag for ACVC 2.0.1,
--- and mode of files in Procedure Read_Data.
--- Added verification of objects reconstructed from
--- files.
--- 27 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-package CXA9002_0 is
-
- type Investment_Type is (Stocks, Bonds, Mutual_Funds);
- type Savings_Type is (Standard, Business, Impound);
-
- type Account_Type is tagged
- record
- Num : String (1..3);
- end record;
-
- type Cash_Account_Type is new Account_Type with
- record
- Years_As_Customer : Natural := 1;
- end record;
-
- type Investment_Account_Type is new Account_Type with
- record
- Investment_Vehicle : Investment_Type := Stocks;
- end record;
-
- type Checking_Account_Type is new Cash_Account_Type with
- record
- Checks_Per_Year : Positive := 200;
- Interest_Bearing : Boolean := False;
- end record;
-
- type Savings_Account_Type is new Cash_Account_Type with
- record
- Kind : Savings_Type := Standard;
- end record;
-
-end CXA9002_0;
-
----
-
-with Report;
-with Ada.Storage_IO;
-with Ada.Direct_IO;
-with Ada.Tags;
-with CXA9002_0;
-
-procedure CXA9002 is
- package Dir_IO is new Ada.Direct_IO (Integer);
- Test_File : Dir_IO.File_Type;
- Incomplete : exception;
-begin
-
- Report.Test ("CXA9002", "Check that the operations defined in the " &
- "generic package Ada.Storage_IO provide the " &
- "ability to store and retrieve objects of " &
- "tagged types from in-memory buffers");
-
-
- Test_For_Direct_IO_Support:
- begin
-
- -- The following Create does not have any bearing on the test scenario,
- -- but is included to check that the implementation supports Direct_IO
- -- files. An exception on this Create statement will raise a Name_Error
- -- or Use_Error, which will be handled to produce a Not_Applicable
- -- result. If created, the file is immediately deleted, as it is not
- -- needed for the program scenario.
-
- Dir_IO.Create (Test_File,
- Dir_IO.Out_File,
- Report.Legal_File_Name(1));
- exception
-
- when Dir_IO.Use_Error | Dir_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Direct_IO" );
- raise Incomplete;
-
- end Test_for_Direct_IO_Support;
-
- Deletion:
- begin
- Dir_IO.Delete (Test_File);
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Direct_IO" );
- end Deletion;
-
- Test_Block:
- declare
-
- use CXA9002_0;
-
- Acct_Filename : constant String := Report.Legal_File_Name(1);
- Cash_Filename : constant String := Report.Legal_File_Name(2);
- Inv_Filename : constant String := Report.Legal_File_Name(3);
- Chk_Filename : constant String := Report.Legal_File_Name(4);
- Sav_Filename : constant String := Report.Legal_File_Name(5);
-
- type Tag_Pointer_Type is access String;
-
- TC_Account_Type_Tag,
- TC_Cash_Account_Type_Tag,
- TC_Investment_Account_Type_Tag,
- TC_Checking_Account_Type_Tag,
- TC_Savings_Account_Type_Tag : Tag_Pointer_Type;
-
- TC_Account : Account_Type :=
- (Num => "123");
-
- TC_Cash_Account : Cash_Account_Type :=
- (Num => "234",
- Years_As_Customer => 3);
-
- TC_Investment_Account : Investment_Account_Type :=
- (Num => "456",
- Investment_Vehicle => Bonds);
-
- TC_Checking_Account : Checking_Account_Type :=
- (Num => "567",
- Years_As_Customer => 2,
- Checks_Per_Year => 300,
- Interest_Bearing => True);
-
- TC_Savings_Account : Savings_Account_Type :=
- (Num => "789",
- Years_As_Customer => 14,
- Kind => Business);
-
- procedure Buffer_Data is
-
- Account : Account_Type :=
- TC_Account;
- Cash_Account : Cash_Account_Type :=
- TC_Cash_Account;
- Investment_Account : Investment_Account_Type :=
- TC_Investment_Account;
- Checking_Account : Checking_Account_Type :=
- TC_Checking_Account;
- Savings_Account : Savings_Account_Type :=
- TC_Savings_Account;
-
- -- The instantiations below are a central point in this test.
- -- Storage_IO is instantiated for each of the specific tagged
- -- type. These instantiated packages will be used to compress
- -- tagged objects of these various types into buffers that will
- -- be written to the Direct_IO files declared below.
-
- package Acct_SIO is new Ada.Storage_IO (Account_Type);
- package Cash_SIO is new Ada.Storage_IO (Cash_Account_Type);
- package Inv_SIO is new Ada.Storage_IO (Investment_Account_Type);
- package Chk_SIO is new Ada.Storage_IO (Checking_Account_Type);
- package Sav_SIO is new Ada.Storage_IO (Savings_Account_Type);
-
- -- Direct_IO is instantiated for the buffer types defined in the
- -- instantiated Storage_IO packages.
-
- package Acct_DIO is new Ada.Direct_IO (Acct_SIO.Buffer_Type);
- package Cash_DIO is new Ada.Direct_IO (Cash_SIO.Buffer_Type);
- package Inv_DIO is new Ada.Direct_IO (Inv_SIO.Buffer_Type);
- package Chk_DIO is new Ada.Direct_IO (Chk_SIO.Buffer_Type);
- package Sav_DIO is new Ada.Direct_IO (Sav_SIO.Buffer_Type);
-
- Acct_Buffer : Acct_SIO.Buffer_Type;
- Cash_Buffer : Cash_SIO.Buffer_Type;
- Inv_Buffer : Inv_SIO.Buffer_Type;
- Chk_Buffer : Chk_SIO.Buffer_Type;
- Sav_Buffer : Sav_SIO.Buffer_Type;
-
- Acct_File : Acct_DIO.File_Type;
- Cash_File : Cash_DIO.File_Type;
- Inv_File : Inv_DIO.File_Type;
- Chk_File : Chk_DIO.File_Type;
- Sav_File : Sav_DIO.File_Type;
-
- begin
-
- Acct_DIO.Create (Acct_File, Acct_DIO.Out_File, Acct_Filename);
- Cash_DIO.Create (Cash_File, Cash_DIO.Out_File, Cash_Filename);
- Inv_DIO.Create (Inv_File, Inv_DIO.Out_File, Inv_Filename);
- Chk_DIO.Create (Chk_File, Chk_DIO.Out_File, Chk_Filename);
- Sav_DIO.Create (Sav_File, Sav_DIO.Out_File, Sav_Filename);
-
- -- Store the tag values of the objects declared above for
- -- comparison with tag values of objects following processing.
-
- TC_Account_Type_Tag :=
- new String'(Ada.Tags.External_Tag(Account_Type'Tag));
-
- TC_Cash_Account_Type_Tag :=
- new String'(Ada.Tags.External_Tag(Cash_Account_Type'Tag));
-
- TC_Investment_Account_Type_Tag :=
- new String'(Ada.Tags.External_Tag(Investment_Account_Type'Tag));
-
- TC_Checking_Account_Type_Tag :=
- new String'(Ada.Tags.External_Tag(Checking_Account_Type'Tag));
-
- TC_Savings_Account_Type_Tag :=
- new String'(Ada.Tags.External_Tag(Savings_Account_Type'Tag));
-
- -- Prepare tagged data for writing to the Direct_IO files using
- -- Storage_IO procedure to place data in buffers.
-
- Acct_SIO.Write (Buffer => Acct_Buffer, Item => Account);
- Cash_SIO.Write (Cash_Buffer, Cash_Account);
- Inv_SIO.Write (Inv_Buffer, Item => Investment_Account);
- Chk_SIO.Write (Buffer => Chk_Buffer, Item => Checking_Account);
- Sav_SIO.Write (Sav_Buffer, Savings_Account);
-
- -- At this point, the data and associated tag values have been
- -- buffered by the Storage_IO procedure, and the buffered data
- -- can be written to the appropriate Direct_IO file.
-
- Acct_DIO.Write (File => Acct_File, Item => Acct_Buffer);
- Cash_DIO.Write (Cash_File, Cash_Buffer);
- Inv_DIO.Write (Inv_File, Item => Inv_Buffer);
- Chk_DIO.Write (File => Chk_File, Item =>Chk_Buffer);
- Sav_DIO.Write (Sav_File, Sav_Buffer);
-
- -- Close all Direct_IO files.
-
- Acct_DIO.Close (Acct_File);
- Cash_DIO.Close (Cash_File);
- Inv_DIO.Close (Inv_File);
- Chk_DIO.Close (Chk_File);
- Sav_DIO.Close (Sav_File);
-
- exception
- when others => Report.Failed("Exception raised in Buffer_Data");
- end Buffer_Data;
-
- procedure Read_Data is
-
- Account : Account_Type;
- Cash_Account : Cash_Account_Type;
- Investment_Account : Investment_Account_Type;
- Checking_Account : Checking_Account_Type;
- Savings_Account : Savings_Account_Type;
-
- -- Storage_IO is instantiated for each of the specific tagged
- -- type.
-
- package Acct_SIO is new Ada.Storage_IO (Account_Type);
- package Cash_SIO is new Ada.Storage_IO (Cash_Account_Type);
- package Inv_SIO is new Ada.Storage_IO (Investment_Account_Type);
- package Chk_SIO is new Ada.Storage_IO (Checking_Account_Type);
- package Sav_SIO is new Ada.Storage_IO (Savings_Account_Type);
-
- -- Direct_IO is instantiated for the buffer types defined in the
- -- instantiated Storage_IO packages.
-
- package Acct_DIO is new Ada.Direct_IO (Acct_SIO.Buffer_Type);
- package Cash_DIO is new Ada.Direct_IO (Cash_SIO.Buffer_Type);
- package Inv_DIO is new Ada.Direct_IO (Inv_SIO.Buffer_Type);
- package Chk_DIO is new Ada.Direct_IO (Chk_SIO.Buffer_Type);
- package Sav_DIO is new Ada.Direct_IO (Sav_SIO.Buffer_Type);
-
- Acct_Buffer : Acct_SIO.Buffer_Type;
- Cash_Buffer : Cash_SIO.Buffer_Type;
- Inv_Buffer : Inv_SIO.Buffer_Type;
- Chk_Buffer : Chk_SIO.Buffer_Type;
- Sav_Buffer : Sav_SIO.Buffer_Type;
-
- Acct_File : Acct_DIO.File_Type;
- Cash_File : Cash_DIO.File_Type;
- Inv_File : Inv_DIO.File_Type;
- Chk_File : Chk_DIO.File_Type;
- Sav_File : Sav_DIO.File_Type;
-
- begin
-
- -- Open the Direct_IO files.
-
- Acct_DIO.Open (Acct_File, Acct_DIO.In_File, Acct_Filename);
- Cash_DIO.Open (Cash_File, Cash_DIO.In_File, Cash_Filename);
- Inv_DIO.Open (Inv_File, Inv_DIO.In_File, Inv_Filename);
- Chk_DIO.Open (Chk_File, Chk_DIO.In_File, Chk_Filename);
- Sav_DIO.Open (Sav_File, Sav_DIO.In_File, Sav_Filename);
-
- -- Read the buffer data from the files using Direct_IO.
-
- Acct_DIO.Read (File => Acct_File, Item => Acct_Buffer);
- Cash_DIO.Read (Cash_File, Cash_Buffer);
- Inv_DIO.Read (Inv_File, Item => Inv_Buffer);
- Chk_DIO.Read (File => Chk_File, Item =>Chk_Buffer);
- Sav_DIO.Read (Sav_File, Sav_Buffer);
-
- -- At this point, the data and associated tag values are stored
- -- in buffers. Use the Storage_IO procedure Read to recreate the
- -- tagged objects from the buffers.
-
- Acct_SIO.Read (Buffer => Acct_Buffer, Item => Account);
- Cash_SIO.Read (Cash_Buffer, Cash_Account);
- Inv_SIO.Read (Inv_Buffer, Item => Investment_Account);
- Chk_SIO.Read (Buffer => Chk_Buffer, Item => Checking_Account);
- Sav_SIO.Read (Sav_Buffer, Savings_Account);
-
- -- Delete all Direct_IO files.
-
- Acct_DIO.Delete (Acct_File);
- Cash_DIO.Delete (Cash_File);
- Inv_DIO.Delete (Inv_File);
- Chk_DIO.Delete (Chk_File);
- Sav_DIO.Delete (Sav_File);
-
- Data_Verification_Block:
- begin
-
- if Account /= TC_Account then
- Report.Failed("Incorrect Account object reconstructed");
- end if;
-
- if Cash_Account /= TC_Cash_Account then
- Report.Failed
- ("Incorrect Cash_Account object reconstructed");
- end if;
-
- if Investment_Account /= TC_Investment_Account then
- Report.Failed
- ("Incorrect Investment_Account object reconstructed");
- end if;
-
- if Checking_Account /= TC_Checking_Account then
- Report.Failed
- ("Incorrect Checking_Account object reconstructed");
- end if;
-
- if Savings_Account /= TC_Savings_Account then
- Report.Failed
- ("Incorrect Savings_Account object reconstructed");
- end if;
-
- exception
- when others =>
- Report.Failed
- ("Exception raised during Data_Verification Block");
- end Data_Verification_Block;
-
-
- -- To ensure that the tags of the values reconstructed by
- -- Storage_IO were properly preserved, object tag values following
- -- object reconstruction are compared with tag values of objects
- -- stored prior to processing.
-
- Tag_Verification_Block:
- begin
-
- if TC_Account_Type_Tag.all /=
- Ada.Tags.External_Tag(Account_Type'Class(Account)'Tag)
- then
- Report.Failed("Incorrect Account tag");
- end if;
-
- if TC_Cash_Account_Type_Tag.all /=
- Ada.Tags.External_Tag(
- Cash_Account_Type'Class(Cash_Account)'Tag)
- then
- Report.Failed("Incorrect Cash_Account tag");
- end if;
-
- if TC_Investment_Account_Type_Tag.all /=
- Ada.Tags.External_Tag(
- Investment_Account_Type'Class(Investment_Account)'Tag)
- then
- Report.Failed("Incorrect Investment_Account tag");
- end if;
-
- if TC_Checking_Account_Type_Tag.all /=
- Ada.Tags.External_Tag(
- Checking_Account_Type'Class(Checking_Account)'Tag)
- then
- Report.Failed("Incorrect Checking_Account tag");
- end if;
-
- if TC_Savings_Account_Type_Tag.all /=
- Ada.Tags.External_Tag(
- Savings_Account_Type'Class(Savings_Account)'Tag)
- then
- Report.Failed("Incorrect Savings_Account tag");
- end if;
-
- exception
- when others =>
- Report.Failed ("Exception raised during tag evaluation");
- end Tag_Verification_Block;
-
- exception
- when others => Report.Failed ("Exception in Read_Data");
- end Read_Data;
-
- begin -- Test_Block
-
- -- Enter the data into the appropriate files.
- Buffer_Data;
-
- -- Reconstruct the data from files, and verify the results.
- Read_Data;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXA9002;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa001.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa001.a
deleted file mode 100644
index 6c2af987009..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa001.a
+++ /dev/null
@@ -1,279 +0,0 @@
--- CXAA001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the Line_Length and Page_Length maximums for a Text_IO
--- file of mode Append_File are initially zero (unbounded) after a
--- Create, Open, or Reset, and that these values can be modified using
--- the procedures Set_Line_Length and Set_Page_Length.
--- Check that setting the Line_Length and Page_Length attributes to zero
--- results in an unbounded Text_IO file.
--- Check that setting the line length when in Append_Mode doesn't
--- change the length of lines previously written to the Text_IO file.
---
--- TEST DESCRIPTION:
--- This test attempts to simulate a possible text processing environment.
--- String values, from a number of different string types, are written to
--- a Text_IO file. Prior to the writing of each, the line length is set
--- to the particular length of the data being written. In addition, the
--- default line and page lengths are checked, to determine whether they
--- are unbounded (length = 0) following a create, reset, or open of a
--- Text_IO file with mode Append_File.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support text
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 27 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA001 is
- use Ada;
- Data_File : Text_IO.File_Type;
- Data_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA001" );
- Incomplete : exception;
-begin
-
- Report.Test ("CXAA001","Check that the Line_Length and Page_Length " &
- "maximums for a Text_IO file of mode Append_File " &
- "are initially zero (unbounded) after a Create, " &
- "Open, or Reset, and that these values can be " &
- "modified using the procedures Set_Line_Length " &
- "and Set_Page_Length");
-
- Test_for_Text_IO_Support:
- begin
-
- -- An implementation that does not support Text_IO in a particular
- -- environment will raise Use_Error on calls to various
- -- Text_IO operations. This block statement encloses a call to
- -- Create, which should raise an exception in a non-supportive
- -- environment. This exception will be handled to produce a
- -- Not_Applicable result.
-
- Text_IO.Create (File => Data_File,
- Mode => Text_IO.Append_File,
- Name => Data_Filename);
-
- exception
-
- when Text_IO.Use_Error | Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Append_File for Text_IO" );
- raise Incomplete;
-
- end Test_for_Text_IO_Support;
-
- Operational_Test_Block:
- declare
-
- subtype Confidential_Data_Type is string (1 .. 10);
- subtype Secret_Data_Type is string (1 .. 20);
- subtype Top_Secret_Data_Type is string (1 .. 30);
-
- Zero : constant Text_IO.Count := 0;
- Confidential_Data_Size : constant Text_IO.Count := 10;
- Secret_Data_Size : constant Text_IO.Count := 20;
- Top_Secret_Data_Size : constant Text_IO.Count := 30;
-
- -- The following generic procedure is designed to simulate a text
- -- processing environment where line and page sizes are set and
- -- verified prior to the writing of data to a file.
-
- generic
- Data_Size : Text_IO.Count;
- procedure Write_Data_To_File (Data_Item : in String);
-
- procedure Write_Data_To_File (Data_Item : in String) is
- use Text_IO; -- Used to provide visibility to the "/=" operator.
- begin
- if (Text_IO.Line_Length (Data_File) /= Zero) then -- Check default
- Report.Failed("Line not of unbounded length"); -- line length,
- elsif (Text_IO.Page_Length (Data_File) /= Zero) then -- default
- Report.Failed ("Page not of unbounded length"); -- page length.
- end if;
-
- Text_IO.Set_Line_Length (File => Data_File, -- Set the line
- To => Data_Size); -- length.
- Text_IO.Set_Page_Length (File => Data_File, -- Set the page
- To => Data_Size); -- length.
- -- Verify the lengths set.
- if (Integer(Text_IO.Line_Length (Data_File)) /=
- Report.Ident_Int(Integer(Data_Size))) then
- Report.Failed ("Line length not set to appropriate length");
- elsif (Integer(Text_IO.Page_Length (Data_File)) /=
- Report.Ident_Int(Integer(Data_Size))) then
- Report.Failed ("Page length not set to appropriate length");
- end if;
-
- Text_IO.Put_Line (File => Data_File, -- Write data to
- Item => Data_Item); -- file.
-
- end Write_Data_To_File;
-
- -- Instantiation for the three data types/sizes.
-
- procedure Write_Confidential_Data is
- new Write_Data_To_File (Data_Size => Confidential_Data_Size);
-
- procedure Write_Secret_Data is
- new Write_Data_To_File (Data_Size => Secret_Data_Size);
-
- procedure Write_Top_Secret_Data is
- new Write_Data_To_File (Data_Size => Top_Secret_Data_Size);
-
- Confidential_Item : Confidential_Data_Type := "Confidenti";
- Secret_Item : Secret_Data_Type := "Secret Data Values ";
- Top_Secret_Item : Top_Secret_Data_Type :=
- "Extremely Top Secret Data ";
-
- begin
-
- -- The following call simulates processing occurring after the create
- -- of a Text_IO file with mode Append_File.
-
- Write_Confidential_Data (Confidential_Item);
-
- -- The following call simulates processing occurring after the reset
- -- of a Text_IO file with mode Append_File.
-
- Reset1:
- begin
- Text_IO.Reset (Data_File, Text_IO.Append_File); -- Reset to
- -- Append_File mode.
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Append_File not supported for Text_IO" );
- raise Incomplete;
- end Reset1;
-
- Write_Secret_Data (Data_Item => Secret_Item);
-
- Text_IO.Close (Data_File); -- Close file.
-
- -- The following processing simulates processing occurring after the
- -- opening of an existing file with mode Append_File.
-
- Text_IO.Open (Data_File, -- Open file in
- Text_IO.Append_File, -- Append_File mode.
- Data_Filename);
-
- Write_Top_Secret_Data (Top_Secret_Item);
-
- Test_Verification_Block:
- declare
- TC_String1,
- TC_String2,
- TC_String3 : String (1..80) := (others => ' ');
- TC_Length1,
- TC_Length2,
- TC_Length3 : Natural := 0;
- begin
-
- Reset2:
- begin
- Text_IO.Reset (Data_File, Text_IO.In_File); -- Reset for reading.
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO" );
- raise Incomplete;
- end Reset2;
-
- Text_IO.Get_Line (Data_File, TC_String1, TC_Length1);
- Text_IO.Get_Line (Data_File, TC_String2, TC_Length2);
- Text_IO.Get_Line (Data_File, TC_String3, TC_Length3);
-
- -- Verify that the line lengths of each line were accurate.
- -- Note: Each data line was written to the file after the
- -- particular line length had been set (to the data length).
-
- if not ((TC_Length1 = Natural(Confidential_Data_Size)) and
- (TC_Length2 = Natural(Secret_Data_Size)) and
- (TC_Length3 = Natural(Top_Secret_Data_Size))) then
- Report.Failed ("Inaccurate line lengths read from file");
- end if;
-
- -- Verify that the data read from the file are accurate.
-
- if (TC_String1(1..TC_Length1) /= Confidential_Item) or else
- (TC_String2(1..TC_Length2) /= Secret_Item) or else
- (TC_String3(1..TC_Length3) /= Top_Secret_Item) then
- Report.Failed ("Corrupted data items read from file");
- end if;
-
- exception
-
- when Incomplete =>
- raise;
-
- when others =>
- Report.Failed ("Error raised during data verification");
-
- end Test_Verification_Block;
-
- exception
-
- when Incomplete =>
- raise;
-
- when others =>
- Report.Failed ("Exception raised during Text_IO processing");
-
- end Operational_Test_Block;
-
- Deletion:
- begin
- -- Check that the file is open prior to deleting it.
- if Text_IO.Is_Open(Data_File) then
- Text_IO.Delete(Data_File);
- else
- Text_IO.Open(Data_File, Text_IO.In_File, Data_Filename);
- Text_IO.Delete(Data_File);
- end if;
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Text_IO" );
- end Deletion;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA001;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa002.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa002.a
deleted file mode 100644
index 953d33f1d44..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa002.a
+++ /dev/null
@@ -1,257 +0,0 @@
--- CXAA002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the procedures New_Page, Set_Line, Set_Col, and New_Line
--- subprograms perform properly on a text file created with mode
--- Append_File.
--- Check that the attributes Page, Line, and Column are all set to 1
--- following the creation of a text file with mode Append_File.
--- Check that the functions Page, Line, and Col perform properly on a
--- text file created with mode Append_File.
--- Check that the procedures Put and Put_Line perform properly on text
--- files created with mode Append_File.
--- Check that the procedure Set_Line sets the current line number to
--- the value specified by the parameter "To" for text files created with
--- mode Append_File.
--- Check that the procedure Set_Col sets the current column number to
--- the value specified by the parameter "To" for text files created with
--- mode Append_File.
---
--- TEST DESCRIPTION:
--- This test is designed to simulate the text processing that could
--- occur with files that have been created in Append_File mode. Various
--- calls to Text_IO formatting subprograms are called to properly
--- position text appended to a document. The text content and position
--- are subsequently verified for accuracy.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support text
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 27 Feb 97 PWB.CTA Allowed for non-support of some IO operations
-
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA002 is
- use Ada;
- Data_File : Text_IO.File_Type;
- Data_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA002" );
- Incomplete : exception;
-begin
-
- Report.Test ("CXAA002", "Check that page, line, and column formatting " &
- "subprograms perform properly on text files " &
- "created with mode Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
- -- An implementation that does not support Text_IO in a particular
- -- environment will raise Use_Error on calls to various
- -- Text_IO operations. This block statement encloses a call to
- -- Create, which should raise the exception in a non-supportive
- -- environment. This exception will be handled to produce a
- -- Not_Applicable result.
-
- Text_IO.Create (File => Data_File,
- Mode => Text_IO.Append_File,
- Name => Data_Filename);
-
- exception
-
- when Text_IO.Use_Error | Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Append_File for Text_IO" );
- raise Incomplete;
-
- end Test_for_Text_IO_Support;
-
- Operational_Test_Block:
- declare
- Default_Position : constant Text_IO.Positive_Count := 1;
- Section_Header : constant String := "VII. ";
- Appendix_Title : constant String := "Appendix A";
- Appendix_Content : constant String := "TBD";
-
- -- The following procedure simulates the addition of an Appendix page
- -- to an existing text file.
- procedure Position_Appendix_Text is
- use Text_IO; -- To provide visibility to the "/=" operator.
- begin
-
- -- Test control code.
- -- Verify initial page, line, column number.
- if "/="(Text_IO.Page (Data_File), Default_Position) then
- Report.Failed ("Incorrect default page number");
- end if;
- if Text_IO.Line (Data_File) /= Default_Position then
- Report.Failed ("Incorrect default line number");
- end if;
- if "/="(Text_IO.Col (Data_File), Default_Position) then
- Report.Failed ("Incorrect default column number");
- end if;
-
- -- Simulated usage code.
- -- Set new page/line positions.
- Text_IO.Put_Line
- (Data_File, "Add some optional data to the file here");
- Text_IO.New_Page (Data_File);
- Text_IO.New_Line (File => Data_File, Spacing => 2);
-
- -- Test control code.
- if Integer(Text_IO.Page (Data_File)) /= Report.Ident_Int(2) or else
- Integer(Text_IO.Line (Data_File)) /= Report.Ident_Int(3) then
- Report.Failed ("Incorrect results from page/line positioning");
- end if;
-
- -- Simulated usage code.
- Text_IO.Put (Data_File, Section_Header); -- Position title
- Text_IO.Put_Line (Data_File, Appendix_Title); -- of Appendix.
-
- Text_IO.Set_Line (File => Data_File, To => 5); -- Set new
- Text_IO.Set_Col (File => Data_File, To => 8); -- position.
-
- -- Test control code.
- if (Integer(Text_IO.Line (Data_File)) /= Report.Ident_Int(5)) or
- (Integer(Text_IO.Col (Data_File)) /= Report.Ident_Int(8)) then
- Report.Failed ("Incorrect results from line/column positioning");
- end if;
-
- -- Simulated usage code. -- Position
- Text_IO.Put_Line (Data_File, Appendix_Content); -- content of
- -- Appendix.
- end Position_Appendix_Text;
-
- begin
-
- -- This code section simulates a scenario that could occur in a
- -- text processing environment:
- -- A document is created/modified/edited Then...
- -- Text is to be appended to the document.
- -- A procedure is called to perform that operation.
- -- The position on the appended page is set, verified, and text is
- -- appended to the existing file.
- --
- -- Note: The text file has been originally created in Append_File
- -- mode, and has not been closed prior to this processing.
-
- Position_Appendix_Text;
-
- Test_Verification_Block:
- declare
- TC_Page,
- TC_Line,
- TC_Column : Text_IO.Positive_Count;
- TC_Position : Natural := 0;
- Blanks : constant String := " ";
- TC_String : String (1 .. 17) := Blanks;
- begin
-
- Reset1:
- begin
- Text_IO.Reset (Data_File, Text_IO.In_File);
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO" );
- raise Incomplete;
- end Reset1;
-
- Text_IO.Skip_Page (Data_File);
- -- Loop to the third line
- for I in 1 .. 3 loop -- and read the contents.
- Text_IO.Get_Line (Data_File, TC_String, TC_Position);
- end loop;
-
- if (TC_Position /= 16) or else -- Verify the title line.
- (TC_String (1..4) /= "VII.") or else
- (TC_String (3..16) /= ("I. " & Appendix_Title)) then
- Report.Failed ("Incorrect positioning of title line");
- end if;
-
- TC_String := Blanks; -- Clear string.
- -- Loop to the fifth line
- for I in 4 .. 5 loop -- and read the contents.
- Text_IO.Get_Line (Data_File, TC_String, TC_Position);
- end loop;
-
- if (TC_Position /= 10) or -- Verify the contents.
- (TC_String (8..10) /= Appendix_Content) then
- Report.Failed ("Incorrect positioning of contents line");
- end if;
-
- exception
-
- when Incomplete =>
- raise;
-
- when others =>
- Report.Failed ("Error raised during data verification");
-
- end Test_Verification_Block;
-
- exception
-
- when Incomplete =>
- raise;
-
- when others =>
- Report.Failed ("Exception raised during Text_IO processing");
-
- end Operational_Test_Block;
-
- Deletion:
- begin
- -- Delete the external file.
- if Text_IO.Is_Open(Data_File) then
- Text_IO.Delete(Data_File);
- else
- Text_IO.Open(Data_File, Text_IO.In_File, Data_Filename);
- Text_IO.Delete(Data_File);
- end if;
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Text_IO" );
- end Deletion;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA002;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa003.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa003.a
deleted file mode 100644
index c9580dfb343..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa003.a
+++ /dev/null
@@ -1,293 +0,0 @@
--- CXAA003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the procedures New_Page, Set_Line, Set_Col, and New_Line
--- subprograms perform properly on a text file reset (from Out_File)
--- with mode Append_File.
--- Check that the attributes Page, Line, and Column are all set to 1
--- following the reset of a text file with mode Append_File.
--- Check that the functions Page, Line, and Col perform properly on a
--- text file reset with mode Append_File.
--- Check that the procedures Put and Put_Line perform properly on text
--- files reset with mode Append_File.
--- Check that the procedure Set_Line sets the current line number to
--- the value specified by the parameter "To" for text files reset with
--- mode Append_File. Check that Set_Line has no effect if the specified
--- line equals the current line.
--- Check that the procedure Set_Col sets the current column number to
--- the value specified by the parameter "To" for text files reset with
--- mode Append_File.
---
--- TEST DESCRIPTION:
--- This test is designed to simulate the text processing that could
--- occur with files that have been created in Out_File mode,
--- and then reset to Append_File mode.
--- Various calls to Text_IO formatting subprograms are called to properly
--- position text appended to a document. The text content and position
--- are subsequently verified for accuracy.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support text
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 24 Feb 97 PWB.CTA Allowed for non-support of some IO operations.
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA003 is
- use Ada;
- Data_File : Text_IO.File_Type;
- Data_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA003" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAA003", "Check that page, line, and column formatting " &
- "subprograms perform properly on text files " &
- "reset with mode Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
- -- An implementation that does not support Text_IO in a particular
- -- environment will raise Use_Error on calls to various
- -- Text_IO operations. This block statement encloses a call to
- -- Create, which should raise the exception in a non-supportive
- -- environment. This exception will be handled to produce a
- -- Not_Applicable result.
-
- Text_IO.Create (File => Data_File,
- Mode => Text_IO.Out_File,
- Name => Data_Filename);
- exception
- when Text_IO.Use_Error | Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Text files not supported - Create as Out_File" );
- raise Incomplete;
- end Test_for_Text_IO_Support;
-
- Operational_Test_Block:
- declare
-
- Default_Position : constant Text_IO.Positive_Count := 1;
-
- Section_Header : constant String := "IX. ";
- Glossary_Title : constant String := "GLOSSARY";
- Glossary_Content : constant String := "TBD";
-
- -- The following procedure simulates the addition of a Glossary page
- -- to an existing text file that has been reset with mode
- -- Append_File.
-
- procedure Position_Glossary_Text
- (The_File : in out Text_IO.File_Type) is
- use Text_IO; -- To provide visibility to the "/=" operator.
- begin
-
- -- Test control code.
- -- Verify initial page value.
- if (Text_IO.Page (The_File) /= Default_Position) then
- Report.Failed ("Incorrect default page number");
- end if;
- -- Verify initial line number.
- if (Text_IO.Line (The_File) /= Default_Position) then
- Report.Failed ("Incorrect default line number");
- end if;
- -- Verify initial column number.
- if (Text_IO.Col (The_File) /= Default_Position) then
- Report.Failed ("Incorrect default column number");
- end if;
- -- Simulated usage code. Set new page/line positions.
- Text_IO.New_Page (The_File);
- Text_IO.New_Page (The_File);
- Text_IO.New_Line (File => The_File, Spacing => 1);
-
- -- Test control code.
- if (Integer(Text_IO.Page(The_File)) /=
- Report.Ident_Int(3)) or else
- (Integer(Text_IO.Line (The_File)) /=
- Report.Ident_Int(2)) then
- Report.Failed ("Incorrect results from page/line positioning");
- end if;
-
- -- Simulated usage code. Position title of Glossary.
- Text_IO.Put (The_File, Section_Header);
- Text_IO.Put_Line (The_File, Glossary_Title);
- -- Set line to the current line.
- Text_IO.Set_Line (File => The_File, To => 3);
-
- -- Test control code.
- if (Integer(Text_IO.Page (The_File)) /= Report.Ident_Int(3)) or
- (Integer(Text_IO.Line (The_File)) /= Report.Ident_Int(3)) or
- (Integer(Text_IO.Col (The_File)) /= Report.Ident_Int(1)) then
- Report.Failed ("Set_Line failed for current line");
- end if;
-
- -- Simulated usage code.
- Text_IO.Set_Line (File => The_File, To => 4); -- Set new
- Text_IO.Set_Col (File => The_File, To => 10); -- position.
-
- -- Test control code.
- if (Integer(Text_IO.Line (The_File)) /= Report.Ident_Int(4)) or
- (Integer(Text_IO.Col (The_File)) /= Report.Ident_Int(10)) then
- Report.Failed
- ("Incorrect results from line/column positioning");
- end if;
-
- -- Simulated usage code. -- Position
- Text_IO.Put_Line (The_File, Glossary_Content); -- content of
- -- Glossary.
- end Position_Glossary_Text;
-
-
- begin
-
- -- In the scenario, data is added to the file here.
- Text_IO.Put_Line (File => Data_File, Item => "Some optional data");
-
- -- This code section simulates a scenario that could occur in a
- -- text processing environment. Text is to be appended to an
- -- existing document:
- -- The file is reset to append mode.
- -- A procedure is called to perform the positioning and placement
- -- of text.
- -- The position on the appended page is set, verified, and text is
- -- placed in the file.
- --
- -- Note: The text file has been originally created in Out_File
- -- mode, and has subsequently been reset to Append_File mode.
-
- Reset1:
- begin
- -- Reset has effect of calling New_Page.
- Text_IO.Reset (Data_File, Text_IO.Append_File);
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Append_File not supported for Text_IO" );
- raise Incomplete;
- end Reset1;
-
- Position_Glossary_Text (The_File => Data_File);
-
- Test_Verification_Block:
- declare
- TC_Page, TC_Line, TC_Column : Text_IO.Positive_Count;
- TC_Position : Natural := 0;
- Blanks : constant String :=
- " ";
- TC_String : String (1 .. 15) := Blanks;
- begin
- Reset2:
- begin
- Text_IO.Reset (Data_File, Text_IO.In_File);
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO" );
- raise Incomplete;
- end Reset2;
-
- Text_IO.Skip_Page (Data_File);
- Text_IO.Skip_Page (Data_File);
-
- -- If the Reset to Append_File mode actually put a page terminator
- -- on the file, as allowed (but not required) by RM A.10.2(4), then
- -- we are now on page 3, an empty page. We'll need to skip one more.
-
- if Text_IO.End_Of_Page (Data_File) then
- Text_IO.Skip_Page (Data_File);
- end if;
-
- -- Now we're on the Glossary page.
-
- -- Loop to the second line
- for I in 1 .. 2 loop -- and read the contents.
- Text_IO.Get_Line (Data_File, TC_String, TC_Position);
- end loop;
- if (TC_Position /= 13) or else -- Verify the title line.
- (TC_String (1..2) /= "IX") or else
- (TC_String (3..13) /= (". " & Glossary_Title)) then
- Report.Failed ("Incorrect positioning of title line");
- end if;
-
- TC_String := Blanks; -- Clear string.
- -- Loop to the fourth line
- for I in 3 .. 4 loop -- and read the contents.
- Text_IO.Get_Line (Data_File, TC_String, TC_Position);
- end loop;
-
- if (TC_Position /= 12) or -- Verify the contents.
- (TC_String (8..12) /= " " & Glossary_Content) then
- Report.Failed ("Incorrect positioning of contents line");
- end if;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Error raised during data verification");
-
- end Test_Verification_Block;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Exception raised during Text_IO processing");
-
- end Operational_Test_Block;
-
- Final_Block:
- begin
- -- Delete the external file.
- if Text_IO.Is_Open (Data_File) then
- Text_IO.Delete (Data_File);
- else
- Text_IO.Open (Data_File, Text_IO.In_File, Data_Filename);
- Text_IO.Delete (Data_File);
- end if;
- exception
- when others =>
- Report.Failed ( "Delete not properly implemented for Text_IO" );
- end Final_Block;
-
- Report.Result;
-
- exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA003;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa004.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa004.a
deleted file mode 100644
index f3ea17ebad3..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa004.a
+++ /dev/null
@@ -1,260 +0,0 @@
--- CXAA004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the procedures New_Page, Set_Line, Set_Col, and New_Line
--- perform properly on a text file opened with mode Append_File.
--- Check that the attributes Page, Line, and Column are all set to 1
--- following the opening of a text file with mode Append_File.
--- Check that the functions Page, Line, and Col perform properly on a
--- text file opened with mode Append_File.
--- Check that the procedures Put and Put_Line perform properly on text
--- files opened with mode Append_File.
--- Check that the procedure Set_Line sets the current line number to
--- the value specified by the parameter "To" for text files opened with
--- mode Append_File.
--- Check that the procedure Set_Col sets the current column number to
--- the value specified by the parameter "To" for text files reset with
--- mode Append_File.
---
--- TEST DESCRIPTION:
--- This test is designed to simulate the text processing that could
--- occur with files that have been created in Out_File mode,
--- and then reset to Append_File mode.
--- Various calls to Text_IO formatting subprograms are called to properly
--- position text appended to a document. The text content and position
--- are subsequently verified for accuracy.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support text
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 24 Feb 97 PWB.CTA Allowed for non-support of some IO operations.
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA004 is
- use Ada;
- Data_File : Text_IO.File_Type;
- Data_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA004" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAA004", "Check that page, line, and column formatting " &
- "subprograms perform properly on text files " &
- "opened with mode Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
- -- An implementation that does not support Text_IO in a particular
- -- environment will raise Use_Error on calls to various
- -- Text_IO operations. This block statement encloses a call to
- -- Create, which should raise the exception in a non-supportive
- -- environment. This exception will be handled to produce a
- -- Not_Applicable result.
-
- Text_IO.Create (File => Data_File,
- Mode => Text_IO.Out_File,
- Name => Data_Filename);
-
- exception
- when Text_IO.Use_Error | Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create for Text_IO" );
- raise Incomplete;
- end Test_for_Text_IO_Support;
-
- Operational_Test_Block:
- declare
- use Text_IO; -- To provide visibility to the "/=" operator.
-
- Default_Position : constant Text_IO.Positive_Count := 1;
-
- Section_Header : constant String := "X. ";
- Reference_Title : constant String := "REFERENCES";
- Reference_Content : constant String := "Available Upon Request";
-
- begin
-
- -- Some amount of text processing would occur here in the scenario
- -- following file creation, prior to file closure.
- Text_IO.Put_Line (File => Data_File, Item => "Some optional data");
-
- -- Close has the effect of a call to New_Page (adding a page
- -- terminator).
- Text_IO.Close (Data_File);
-
- -- This code section simulates a scenario that could occur in a
- -- text processing environment:
- -- Certain text is to be appended to a document.
- -- The file is opened in Append_File mode.
- -- The position on the appended page is set, verified, and text
- -- is placed in the file.
- --
- -- Note: The text file has been originally created in Out_File
- -- mode, has been subsequently closed and is now being reopened in
- -- Append_File mode for further processing.
-
- Text_IO.Open (Data_File, Text_IO.Append_File, Data_Filename);
-
- -- Test control code.
- if (Text_IO.Page(Data_File) /= Default_Position) then -- Verify init.
- Report.Failed ("Incorrect default page number"); -- page value.
- end if;
- if (Text_IO.Line(Data_File) /= Default_Position) then -- Verify init.
- Report.Failed ("Incorrect default line number"); -- line number.
- end if;
- if (Text_IO.Col (Data_File) /= Default_Position) then -- Verify init.
- Report.Failed ("Incorrect default column number"); -- column no.
- end if;
-
- -- Simulated usage code.
- Text_IO.New_Page (Data_File); -- Set new page/
- Text_IO.New_Line (File => Data_File, Spacing => 2); -- line pos.
- Text_IO.Put (Data_File, Section_Header); -- Position
- Text_IO.Put_Line (Data_File, Reference_Title); -- title.
-
- -- Test control code. -- Verify new
- if (Integer(Text_IO.Page (Data_File)) /= -- page and
- Report.Ident_Int(2)) or else -- line.
- (Integer(Text_IO.Line (Data_File)) /=
- Report.Ident_Int(4)) then
- Report.Failed ("Incorrect results from page/line positioning");
- end if;
-
- -- Simulated usage code.
- Text_IO.Set_Line (File => Data_File, To => 8); -- Set new
- Text_IO.Set_Col (File => Data_File, To => 30); -- position.
- Text_IO.Put_Line (Data_File, Reference_Content);
-
- -- Test control code.
- if (Integer(Text_IO.Line (Data_File)) /=
- Report.Ident_Int(9)) or -- Verify new
- (Integer(Text_IO.Col (Data_File)) /= -- position.
- Report.Ident_Int(1)) then
- Report.Failed ("Incorrect results from line/column positioning");
- end if;
-
- Test_Verification_Block:
- declare
- TC_Page, TC_Line, TC_Column : Text_IO.Positive_Count;
- TC_Position : Natural := 0;
- TC_String : String (1 .. 55) := (others => ' ');
- begin
-
- Reset1:
- begin
- Text_IO.Reset (Data_File, Text_IO.In_File);
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO" );
- raise Incomplete;
- end Reset1;
-
- Text_IO.Skip_Page (Data_File);
-
- -- If the Reset to Append_File mode actually put a page terminator
- -- in the file, as allowed (but not required) by RM A.10.2(4), then
- -- we are now on page 2, an empty page. Therefore, we need to skip
- -- one more page.
-
- if Text_IO.End_Of_Page (Data_File) then
- Text_IO.Skip_Page (Data_File);
- end if;
-
- -- Now we're on the reference page.
-
- -- Loop to the third line
- for I in 1 .. 3 loop -- and read the contents.
- Text_IO.Get_Line (Data_File, TC_String, TC_Position);
- end loop;
-
- if (TC_Position /= 14) or else -- Verify the title line.
- (TC_String (1..6) /= "X. RE") or else
- (TC_String (2..14) /= (". " & Reference_Title)) then
- Report.Failed ("Incorrect positioning of title line");
- end if;
- -- Loop to the eighth line
- for I in 4 .. 8 loop -- and read the contents.
- Text_IO.Get_Line (Data_File, TC_String, TC_Position);
- end loop;
-
- if (TC_Position /= 51) or -- Verify the contents.
- (TC_String (30..51) /= "Available Upon Request") then
- Report.Failed ("Incorrect positioning of contents line");
- end if;
-
- exception
-
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Error raised during data verification");
-
- end Test_Verification_Block;
-
- exception
-
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Exception raised during Text_IO processing");
-
- end Operational_Test_Block;
-
- Final_Block:
- begin
- -- Delete the external file.
- if Text_IO.Is_Open (Data_File) then
- Text_IO.Delete (Data_File);
- else
- Text_IO.Open (Data_File, Text_IO.In_File, Data_Filename);
- Text_IO.Delete (Data_File);
- end if;
- exception
- when others =>
- Report.Failed ( "Delete not properly implemented - Text_IO" );
- end Final_Block;
-
- Report.Result;
-
-exception
-
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ("Unexpected exception");
- Report.Result;
-
-end CXAA004;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa005.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa005.a
deleted file mode 100644
index 7b2a0bc39d3..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa005.a
+++ /dev/null
@@ -1,292 +0,0 @@
--- CXAA005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the procedure Put, when called with string parameters, does
--- not update the line number of a text file of mode Append_File, when
--- the line length is unbounded (i.e., only the column number is
--- updated).
--- Check that a call to the procedure Put with a null string argument
--- has no measurable effect on a text file of mode Append_File.
---
--- TEST DESCRIPTION:
--- This test is designed to ensure that when a string is appended to an
--- unbounded text file, it is placed following the last element currently
--- in the file. For an unbounded text file written with Put procedures
--- only (not Put_Line), the line number should not be incremented by
--- subsequent calls to Put in Append_File mode. Only the column number
--- should be incremented based on the length of the string parameter
--- placed in the file. If a call to Put with a null string argument is
--- made, no change to the line or column number should occur, and no
--- element(s) should be added to the file, so that there would be no
--- measurable change to the file.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that support Text_IO
--- processing and external files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 24 Feb 97 CTA.PWB Allowed for non-support of some IO operations.
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA005 is
- An_Unbounded_File : Ada.Text_IO.File_Type;
- Unbounded_File_Name : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA005" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAA005", "Check that the procedure Put does not " &
- "increment line numbers when used with " &
- "unbounded text files of mode Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
- -- An application creates a text file in mode Out_File, with the intention
- -- of entering string data packets into the file as appropriate. In the
- -- event that the particular environment where the application is running
- -- does not support Text_IO, Use_Error will be raised on calls to Text_IO
- -- operations.
- -- This exception will be handled to produce a Not_Applicable result.
-
- Ada.Text_IO.Create (File => An_Unbounded_File,
- Mode => Ada.Text_IO.Out_File,
- Name => Unbounded_File_Name);
- exception
- when Ada.Text_IO.Use_Error | Ada.Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create for Text_IO" );
- raise Incomplete;
- end Test_For_Text_IO_Support;
-
- Operational_Test_Block:
- declare
- subtype String_Sequence_Type is string (1 .. 20);
- type String_Pointer_Type is access String_Sequence_Type;
-
--- During the course of processing, the application creates a variety of data
--- pointers that refer to particular data items. The possibility of having
--- null data values in this environment exists.
-
- Data_Packet_1 : String_Pointer_Type :=
- new String_Sequence_Type'("One Data Sequence 01");
-
- Data_Packet_2 : String_Pointer_Type :=
- new String_Sequence_Type'("New Data Sequence 02");
-
- Blank_Data_Packet : String_Pointer_Type :=
- new String_Sequence_Type'(" ");
-
- Null_Data_Packet : constant String := "";
-
- TC_Line, TC_Col : Natural := 0;
-
- function TC_Mode_Selection (Selector : Integer)
- return Ada.Text_IO.File_Mode is
- begin
- case Selector is
- when 1 => return Ada.Text_IO.In_File;
- when 2 => return Ada.Text_IO.Out_File;
- when others => return Ada.Text_IO.Append_File;
- end case;
- end TC_Mode_Selection;
-
- begin
-
--- The application places some data into the file, using the Put subroutine.
--- This operation can occur one-to-many times.
-
- Ada.Text_IO.Put (An_Unbounded_File, Data_Packet_1.all);
-
- -- Test control code.
- if (Integer(Ada.Text_IO.Col (An_Unbounded_File)) /=
- Report.Ident_Int(21)) or
- (Integer(Ada.Text_IO.Line (An_Unbounded_File)) /=
- Report.Ident_Int(1)) then
- Report.Failed ("Incorrect Col position after 1st Put");
- end if;
-
--- The application may close the file at some point following its initial
--- entry of data.
-
- Ada.Text_IO.Close (An_Unbounded_File);
-
--- At some later point in the processing, more data needs to be added to the
--- file, so the application opens the file in Append_File mode.
-
- Ada.Text_IO.Open (File => An_Unbounded_File,
- Mode => Ada.Text_IO.Append_File,
- Name => Unbounded_File_Name);
-
- -- Test control code.
- -- Store line/column number for later comparison.
- TC_Line := Natural(Ada.Text_IO.Line(An_Unbounded_File));
- TC_Col := Natural(Ada.Text_IO.Col(An_Unbounded_File));
-
--- Additional data items can then be appended to the file.
-
- Ada.Text_IO.Put (An_Unbounded_File, Blank_Data_Packet.all);
-
- -- Test control code.
- if (Natural(Ada.Text_IO.Col (An_Unbounded_File)) /=
- (TC_Col + 20)) or
- (Natural(Ada.Text_IO.Line (An_Unbounded_File)) /=
- TC_Line) then
- Report.Failed ("Incorrect Col position after 2nd Put");
- end if;
-
--- In order to accommodate various scenarios, the application may have changed
--- the mode of the data file to In_File in order to retrieve/verify some of
--- the data contained there. However, with the need to place more data into
--- the file, the file can be reset to Append_File mode.
-
- Reset1:
- begin
- Ada.Text_IO.Reset (An_Unbounded_File,
- TC_Mode_Selection (Report.Ident_Int(3)));
- exception
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Append_File not supported for Text_IO" );
- raise Incomplete;
- end Reset1;
-
- -- Test control code.
- -- Store line/column number for later comparison.
- TC_Line := Natural(Ada.Text_IO.Line(An_Unbounded_File));
- TC_Col := Natural(Ada.Text_IO.Col(An_Unbounded_File));
-
--- Additional data can then be appended to the file. On some occasions, an
--- attempt to enter a null string value into the file may occur. This should
--- have no effect on the file, leaving it unchanged.
-
- -- No measurable effect from Put with null string.
- Ada.Text_IO.Put (An_Unbounded_File, Null_Data_Packet);
-
- -- Test control code.
- -- There should be no change following the Put above.
- if (Natural(Ada.Text_IO.Col (An_Unbounded_File)) /=
- TC_Col) or
- (Natural(Ada.Text_IO.Line (An_Unbounded_File)) /=
- TC_Line) then
- Report.Failed ("Incorrect Col position after 3rd Put");
- end if;
-
--- Additional data can be appended to the file.
-
- Ada.Text_IO.Put (An_Unbounded_File, Data_Packet_2.all);
-
- -- Test control code.
- if (Natural(Ada.Text_IO.Col (An_Unbounded_File)) /=
- (TC_Col + 20)) or
- (Integer(Ada.Text_IO.Line (An_Unbounded_File)) /=
- TC_Line) then
- Report.Failed ("Incorrect Col position after 4th Put");
- end if;
-
- Test_Verification_Block:
- declare
- File_Data : String (1 .. 80);
- TC_Width : Natural;
- begin
-
--- The application has the capability to reset the file to In_File mode to
--- verify some of the data that is contained there.
-
- Reset2:
- begin
- Ada.Text_IO.Reset (An_Unbounded_File, Ada.Text_IO.In_File);
- exception
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported - Text_IO" );
- raise Incomplete;
- end Reset2;
-
- Ada.Text_IO.Get_Line (An_Unbounded_File,
- File_Data,
- TC_Width);
-
- -- Test control code.
- -- Since it is implementation defined whether a page
- -- terminator separates preexisting text from new text
- -- following an open in append mode (as occurred above),
- -- verify only that the first data item written to the
- -- file was not overwritten by any subsequent call to Put.
-
- if (File_Data (File_Data'First) /= 'O') or
- (File_Data (20) /= '1') then
- Report.Failed ("Data placed incorrectly in file");
- end if;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Error raised during data verification");
- end Test_Verification_Block;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Exception in Text_IO processing");
- end Operational_Test_Block;
-
- Final_Block:
- begin
- -- Delete the external file.
- if Ada.Text_IO.Is_Open(An_Unbounded_File) then
- Ada.Text_IO.Delete (An_Unbounded_File);
- else
- Ada.Text_IO.Open(An_Unbounded_File,
- Ada.Text_IO.In_File,
- Unbounded_File_Name);
- Ada.Text_IO.Delete (An_Unbounded_File);
- end if;
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented -- Text_IO" );
- end Final_Block;
-
- Report.Result;
-
-exception
-
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA005;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa006.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa006.a
deleted file mode 100644
index 518d43b896e..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa006.a
+++ /dev/null
@@ -1,285 +0,0 @@
--- CXAA006.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that for a bounded line length text file of mode Append_File,
--- when the number of characters to be output exceeds the number of
--- columns remaining on the current line, a call to Put will output
--- characters of the string sufficient to fill the remaining columns of
--- the line (up to line length), then output a line terminator, reset the
--- column number, increment the line number, then output the balance of
--- the item.
---
--- Check that the procedure Put does not raise Layout_Error when the
--- number of characters to be output exceeds the line length of a bounded
--- text file of mode Append_File.
---
--- TEST DESCRIPTION:
--- This test demonstrates the situation where an application intends to
--- output variable length string elements to a text file in the most
--- efficient manner possible. This is the case in a typesetting
--- environment where text is compressed and split between lines of a
--- bounded length.
---
--- The procedure Put will break string parameters placed in the file at
--- the point of the line length. Two examples are demonstrated in this
--- test, one being the case where only one column remains on a line, and
--- the other being the case where a larger portion of the line remains
--- unfilled, but still not sufficient to contain the entire output
--- string.
---
--- During the course of the test, the file is reset to Append_File mode,
--- and the bounded line length is modified for different lines of the
--- file.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that support Text_IO
--- processing and external files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 25 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA006 is
-
- A_Bounded_File : Ada.Text_IO.File_Type;
- Bounded_File_Name : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA006" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAA006", "Check that procedure Put will correctly " &
- "output string items to a bounded line " &
- "length text file of mode Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
--- An application creates a text file in mode Append_File, with the intention
--- of using the procedure Put to compress variable length string data into the
--- file in the most efficient manner possible.
-
- Ada.Text_IO.Create (File => A_Bounded_File,
- Mode => Ada.Text_IO.Append_File,
- Name => Bounded_File_Name);
- exception
- when Ada.Text_IO.Use_Error | Ada.Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create with Append_File for Text_IO" );
- raise Incomplete;
- end Test_For_Text_IO_Support;
-
- Operational_Test_Block:
- declare
- Twelve_Characters : constant String := "12Characters";
- Nineteen_Characters : constant String := "Nineteen_Characters";
- TC_Line : Natural := 0;
-
- function TC_Mode_Selection (Selector : Integer)
- return Ada.Text_IO.File_Mode is
- begin
- case Selector is
- when 1 => return Ada.Text_IO.In_File;
- when 2 => return Ada.Text_IO.Out_File;
- when others => return Ada.Text_IO.Append_File;
- end case;
- end TC_Mode_Selection;
-
- begin
-
--- The application sets the line length of the file to be bound at 20. All
--- lines in this file will be limited to that length.
-
- Ada.Text_IO.Set_Line_Length (A_Bounded_File, 20);
-
- Ada.Text_IO.Put (A_Bounded_File, Nineteen_Characters);
-
- -- Test control code.
- if (Integer(Ada.Text_IO.Line (A_Bounded_File)) /=
- Report.Ident_Int(1)) or
- (Integer(Ada.Text_IO.Col (A_Bounded_File)) /=
- Report.Ident_Int(20)) then
- Report.Failed ("Incorrect position after 1st Put");
- end if;
-
--- The application finds that there is only one column available on the
--- current line, so the next string item to be output must be broken at
--- the appropriate place (following the first character).
-
- Ada.Text_IO.Put (File => A_Bounded_File,
- Item => Twelve_Characters);
-
- -- Test control code.
- if (Integer(Ada.Text_IO.Line (A_Bounded_File)) /=
- Report.Ident_Int(2)) or
- (Integer(Ada.Text_IO.Col (A_Bounded_File)) /=
- Report.Ident_Int(12)) then
- Report.Failed ("Incorrect position after 2nd Put");
- end if;
-
--- The application subsequently modifies the processing, resetting the file
--- at this point to In_File mode in order to verify data that has been written
--- to the file. Following this, the application resets the file to Append_File
--- mode in order to continue the placement of data into the file, but modifies
--- the original bounded line length for subsequent lines to be appended.
-
- -- Reset to Append mode; call outputs page terminator and
- -- resets line length to Unbounded.
- Reset1:
- begin
- Ada.Text_IO.Reset (A_Bounded_File,
- TC_Mode_Selection (Report.Ident_Int(3)));
- exception
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Append_File not supported for Text_IO" );
- raise Incomplete;
- end Reset1;
-
- Ada.Text_IO.Set_Line_Length (A_Bounded_File, 15);
-
- -- Store line number for later comparison.
- TC_Line := Natural(Ada.Text_IO.Line(A_Bounded_File));
-
--- The application finds that fifteen columns are available on the current
--- line but that the string item to be output exceeds this available space.
--- It must be split at the end of the line, and the balance placed on the
--- next file line.
-
- Ada.Text_IO.Put (File => A_Bounded_File,
- Item => Nineteen_Characters);
-
- -- Test control code.
- -- Positioned on new line at col 5.
- if (Natural(Ada.Text_IO.Line (A_Bounded_File)) /=
- (TC_Line + 1)) or
- (Integer(Ada.Text_IO.Col (A_Bounded_File)) /=
- Report.Ident_Int(5)) then
- Report.Failed ("Incorrect position after 3rd Put");
- end if;
-
-
- Test_Verification_Block:
- declare
- First_String : String (1 .. 80);
- Second_String : String (1 .. 80);
- Third_String : String (1 .. 80);
- Fourth_String : String (1 .. 80);
- TC_Width1 : Natural;
- TC_Width2 : Natural;
- TC_Width3 : Natural;
- TC_Width4 : Natural;
- begin
-
--- The application has the capability to reset the file to In_File mode to
--- verify some or all of the data that is contained there.
-
- Reset2:
- begin
- Ada.Text_IO.Reset (A_Bounded_File, Ada.Text_IO.In_File);
- exception
- when others =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO" );
- raise Incomplete;
- end Reset2;
-
- Ada.Text_IO.Get_Line
- (A_Bounded_File, First_String, TC_Width1);
- Ada.Text_IO.Get_Line
- (A_Bounded_File, Second_String, TC_Width2);
- Ada.Text_IO.Get_Line
- (A_Bounded_File, Third_String, TC_Width3);
- Ada.Text_IO.Get_Line
- (A_Bounded_File, Fourth_String, TC_Width4);
-
- -- Test control code.
- if (First_String (1..TC_Width1) /= Nineteen_Characters & "1") or
- (Second_String (1..TC_Width2) /= "2Characters") or
- (Third_String (1..TC_Width3) /=
- Nineteen_Characters(1..15)) or
- (Fourth_String (1..TC_Width4) /= "ters")
- then
- Report.Failed ("Data placed incorrectly in file");
- end if;
-
- exception
-
- when Incomplete =>
- raise;
-
- when Ada.Text_IO.End_Error =>
- Report.Failed ("Incorrect number of lines in file");
-
- when others =>
- Report.Failed ("Error raised during data verification");
-
- end Test_Verification_Block;
-
- exception
-
- when Ada.Text_IO.Layout_Error =>
- Report.Failed ("Layout Error raised when positioning text");
-
- when others =>
- Report.Failed ("Exception in Text_IO processing");
-
- end Operational_Test_Block;
-
- Final_Block:
- begin
- -- Delete the external file.
- if Ada.Text_IO.Is_Open(A_Bounded_File) then
- Ada.Text_IO.Delete (A_Bounded_File);
- else
- Ada.Text_IO.Open (A_Bounded_File,
- Ada.Text_IO.In_File,
- Bounded_File_Name);
- Ada.Text_IO.Delete (A_Bounded_File);
- end if;
-
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Text_IO" );
- end Final_Block;
-
- Report.Result;
-
-exception
-
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA006;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa007.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa007.a
deleted file mode 100644
index fe79c2d7a86..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa007.a
+++ /dev/null
@@ -1,263 +0,0 @@
--- CXAA007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the capabilities of Text_IO.Integer_IO perform correctly
--- on files of Append_File mode, for instantiations with integer and
--- user-defined subtypes.
--- Check that the formatting parameters available in the package can
--- be used and modified successfully in the storage and retrieval of
--- data.
---
--- TEST DESCRIPTION:
--- This test simulates a receiving department inventory system. Data on
--- items received is entered into an inventory database. This information
--- consists of integer entry number, item number, and bar code.
--- One item is placed into the inventory file immediately following file
--- creation, subsequent items are entered following file opening in
--- Append_File mode. Data items are validated by reading all data from
--- the file and comparing against known values (those used to enter the
--- data originally).
---
--- This test verifies issues of create in Append_File mode, appending to
--- a file previously appended to, opening in Append_File mode, resetting
--- from Append_File mode to In_File mode, as well as a variety of Text_IO
--- and Integer_IO predefined subprograms.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support text
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 25 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA007 is
- use Ada;
-
- Inventory_File : Text_IO.File_Type;
- Inventory_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA007" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAA007", "Check that the capabilities of " &
- "Text_IO.Integer_IO operate correctly for files " &
- "with mode Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
- -- An implementation that does not support Text_IO in a particular
- -- environment will raise Use_Error on calls to various
- -- Text_IO operations. This block statement encloses a call to
- -- Create, which should raise the exception in a non-supportive
- -- environment. This exception will be handled to produce a
- -- Not_Applicable result.
-
- Text_IO.Create (File => Inventory_File,
- Mode => Text_IO.Append_File,
- Name => Inventory_Filename);
- exception
- when Text_IO.Use_Error | Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create with Append_File for Text_IO" );
- raise Incomplete;
- end Test_for_Text_IO_Support;
-
- Operational_Test_Block:
- declare
-
- Max_Entries_Per_Order : constant Natural := 4;
-
- type Bar_Code_Type is range 0 .. 127; -- Values to be stored as base
- -- two numbers in file.
- type Item_Type is record
- Entry_Number : Natural := 0;
- Item_Number : Integer := 0;
- Bar_Code : Bar_Code_Type := 0;
- end record;
-
- type Inventory_Type is
- array (1 .. Max_Entries_Per_Order) of Item_Type;
-
- Inventory_List : Inventory_Type := ((1, 119, 87), -- Items received
- (2, 206, 44), -- this order.
- (3, -25, 126),
- (4, -18, 31));
-
- Daily_Order : constant := 1;
- Entry_Field_Width : constant Natural := 1;
- Item_Base : constant Natural := 16;
- Items_Inventoried : Natural := 1;
- Items_To_Inventory : Natural := 4;
-
- package Entry_IO is new Text_IO.Integer_IO (Natural);
- package Item_IO is new Text_IO.Integer_IO (Integer);
- package Bar_Code_IO is new Text_IO.Integer_IO (Bar_Code_Type);
-
-
- -- The following procedure simulates the addition of inventory item
- -- information into a data file.
-
- procedure Update_Inventory (The_Item : in Item_Type) is
- Spacer : constant String := " ";
- begin
- -- Enter all the incoming data into the inventory file.
- Entry_IO.Put (Inventory_File, The_Item.Entry_Number);
- Text_IO.Put (Inventory_File, Spacer);
- Item_IO.Put (Inventory_File, The_Item.Item_Number);
- Text_IO.Put (Inventory_File, Spacer);
- Bar_Code_IO.Put(File => Inventory_File,
- Item => The_Item.Bar_Code,
- Width => 13,
- Base => 2);
- Text_IO.New_Line(Inventory_File);
- end Update_Inventory;
-
-
- begin
-
- -- This code section simulates a receiving department maintaining a
- -- data file containing information on items that have been ordered
- -- and received.
- --
- -- As new orders are received, the file is opened in Append_File
- -- mode.
- -- Data is taken from the inventory list and entered into the file,
- -- in specific format.
- -- Enter the order into the inventory file. This is item 1 in
- -- the inventory list.
- -- The data entry process can be repeated numerous times as required.
-
- Entry_IO.Put (Inventory_File,
- Inventory_List(Daily_Order).Entry_Number);
- Item_IO.Put (Inventory_File,
- Inventory_List(Daily_Order).Item_Number);
- Bar_Code_IO.Put (File => Inventory_File,
- Item => Inventory_List(Daily_Order).Bar_Code);
- Text_IO.New_Line (Inventory_File);
-
- Text_IO.Close (Inventory_File);
-
-
- Entry_IO.Default_Width := Entry_Field_Width; -- Modify the default
- -- width of Entry_IO.
- Item_IO.Default_Base := Item_Base; -- Modify the default
- -- number base of
- -- Item_IO
- Text_IO.Open (Inventory_File,
- Text_IO.Append_File, -- Open in Append mode.
- Inventory_Filename);
- -- Enter items
- while (Items_Inventoried < Items_To_Inventory) loop -- 2-4 into the
- Items_Inventoried := Items_Inventoried + 1; -- inventory file.
- Update_Inventory (The_Item => Inventory_List (Items_Inventoried));
- end loop;
-
- Test_Verification_Block: -- Read and check
- declare -- all the data
- TC_Entry : Natural; -- values that
- TC_Item : Integer; -- have been
- TC_Bar_Code : Bar_Code_Type; -- entered in the
- TC_Item_Count : Natural := 0; -- data file.
- begin
-
- Reset1:
- begin
- Text_IO.Reset (Inventory_File, Text_IO.In_File); -- Reset for
- -- reading.
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to mode In_File not supported for Text_IO" );
- raise Incomplete;
- end Reset1;
-
- while not Text_IO.End_Of_File (Inventory_File) loop
- Entry_IO.Get (Inventory_File, TC_Entry);
- Item_IO.Get (Inventory_File, TC_Item);
- Bar_Code_IO.Get (Inventory_File, TC_Bar_Code);
- Text_IO.Skip_Line (Inventory_File);
- TC_Item_Count := TC_Item_Count + 1;
-
- if (TC_Item /= Inventory_List(TC_Entry).Item_Number) or
- (TC_Bar_Code /= Inventory_List(TC_Entry).Bar_Code) then
- Report.Failed ("Error in integer data read from file");
- end if;
- end loop;
-
- if (TC_Item_Count /= Max_Entries_Per_Order) then
- Report.Failed ("Incorrect number of records read from file");
- end if;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Error raised during data verification");
- end Test_Verification_Block;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Exception in Text_IO.Integer_IO processing");
- end Operational_Test_Block;
-
- Final_Block:
- begin
- -- Delete the external file.
- if Text_IO.Is_Open(Inventory_File) then
- Text_IO.Delete (Inventory_File);
- else
- Text_IO.Open (Inventory_File, Text_IO.In_File, Inventory_Filename);
- Text_IO.Delete (Inventory_File);
- end if;
-
- exception
-
- when others =>
- Report.Failed ( "Delete not properly implemented for Text_IO" );
-
- end Final_Block;
-
- Report.Result;
-
-exception
-
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA007;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa008.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa008.a
deleted file mode 100644
index c21d07ea9ac..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa008.a
+++ /dev/null
@@ -1,271 +0,0 @@
--- CXAA008.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the capabilities provided in instantiations of the
--- Ada.Text_IO.Fixed_IO package operate correctly when the mode of
--- the file is Append_File. Check that Fixed_IO procedures Put and Get
--- properly transfer fixed point data to/from data files that are in
--- Append_File mode. Check that the formatting parameters available in
--- the package can be used and modified successfully in the appending and
--- retrieval of data.
---
--- TEST DESCRIPTION:
--- This test simulates order processing, with data values being written
--- to a file, in a specific format, using Fixed_IO. Validation is done
--- on this process by reading the data values from the file, and
--- comparing them for equality with the values originally written to
--- the file.
---
--- This test verifies issues of create in Append_File mode, appending to
--- a file previously appended to, resetting to Append_File mode,
--- resetting from Append_File mode to In_File mode, as well as a
--- variety of Text_IO and Fixed_IO predefined subprograms.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support text
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 25 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA008 is
- use Ada;
-
- Inventory_File : Text_IO.File_Type;
- Inventory_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA008" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAA008", "Check that the capabilities of " &
- "Text_IO.Fixed_IO operate correctly for files " &
- "with mode Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
- -- An implementation that does not support Text_IO in a particular
- -- environment will raise Use_Error on calls to various
- -- Text_IO operations. This block statement encloses a call to
- -- Create, which should raise the exception in a non-supportive
- -- environment. This exception will be handled to produce a
- -- Not_Applicable result.
-
- Text_IO.Create (File => Inventory_File,
- Mode => Text_IO.Append_File,
- Name => Inventory_Filename);
-
- exception
- when Text_IO.Use_Error | Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create with Append_File for Text_IO" );
- raise Incomplete;
- end Test_For_Text_IO_Support;
-
- Operational_Test_Block:
- declare
-
- Daily_Orders_Received : constant Natural := 4;
-
- type Item_Type is delta 0.1 range 0.0 .. 5000.0;
- type Cost_Type is delta 0.01 range 0.0 .. 10_000.0;
- type Profit_Type is delta 0.01 range -100.0 .. 1000.0;
-
- type Product_Type is record
- Item_Number : Item_Type := 0.0;
- Unit_Cost : Cost_Type := 0.00;
- Percent_Markup : Profit_Type := 0.00;
- end record;
-
- type Inventory_Type is
- array (1 .. Daily_Orders_Received) of Product_Type;
-
- Daily_Inventory : Inventory_Type := (( 1.0, 1.75, 50.00),
- ( 155.0, 20.00, -5.50),
- (3343.5, 2.50, 126.50),
- (4986.0, 180.00, 31.75));
-
- package Item_IO is new Text_IO.Fixed_IO (Item_Type);
- package Cost_IO is new Text_IO.Fixed_IO (Cost_Type);
- package Markup_IO is new Text_IO.Fixed_IO (Profit_Type);
-
-
- function TC_Mode_Selection (Selector : Integer)
- return Text_IO.File_Mode is
- begin
- case Selector is
- when 1 => return Text_IO.In_File;
- when 2 => return Text_IO.Out_File;
- when others => return Text_IO.Append_File;
- end case;
- end TC_Mode_Selection;
-
-
- -- The following function simulates the addition of inventory item
- -- information into a data file. Boolean status of True is returned
- -- if all of the data entry was successful, False otherwise.
-
- function Update_Inventory (The_List : Inventory_Type)
- return Boolean is
- begin
- for I in 1 .. Daily_Orders_Received loop
- Item_IO.Put (Inventory_File, The_List(I).Item_Number);
- Cost_IO.Put (Inventory_File, The_List(I).Unit_Cost, 10, 4, 0);
- Markup_IO.Put(File => Inventory_File,
- Item => The_List(I).Percent_Markup,
- Fore => 6,
- Aft => 3,
- Exp => 2);
- Text_IO.New_Line (Inventory_File);
- end loop;
- return (True); -- Return a Status value.
- exception
- when others => return False;
- end Update_Inventory;
-
-
- begin
-
- -- This code section simulates a receiving department maintaining a
- -- data file containing information on items that have been ordered
- -- and received.
-
- -- Whenever items are received, the file is reset to Append_File
- -- mode. Data is taken from an inventory list and entered into the
- -- file, in specific format.
-
- Reset1:
- begin -- Reset to
- Text_IO.Reset (Inventory_File, -- Append mode.
- TC_Mode_Selection (Report.Ident_Int(3)));
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Append_File not supported for Text_IO" );
- end Reset1;
-
- -- Enter data.
- if not Update_Inventory (The_List => Daily_Inventory) then
- Report.Failed ("Exception occurred during inventory update");
- raise Incomplete;
- end if;
-
- Test_Verification_Block:
- declare
- TC_Item : Item_Type;
- TC_Cost : Cost_Type;
- TC_Markup : Profit_Type;
- TC_Item_Count : Natural := 0;
- begin
-
- Reset2:
- begin
- Text_IO.Reset (Inventory_File, Text_IO.In_File); -- Reset for
- -- reading.
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO" );
- raise Incomplete;
- end Reset2;
-
- while not Text_IO.End_Of_File (Inventory_File) loop
- Item_IO.Get (Inventory_File, TC_Item);
- Cost_IO.Get (Inventory_File, TC_Cost);
- Markup_IO.Get (File => Inventory_File,
- Item => TC_Markup,
- Width => 0);
- Text_IO.Skip_Line (Inventory_File);
- TC_Item_Count := TC_Item_Count + 1;
-
- -- Verify all of the data fields read from the file. Compare
- -- with the values that were originally entered into the file.
-
- if (TC_Item /= Daily_Inventory(TC_Item_Count).Item_Number) then
- Report.Failed ("Error in Item_Number read from file");
- end if;
- if (TC_Cost /= Daily_Inventory(TC_Item_Count).Unit_Cost) then
- Report.Failed ("Error in Unit_Cost read from file");
- end if;
- if not (TC_Markup =
- Daily_Inventory(TC_Item_Count).Percent_Markup) then
- Report.Failed ("Error in Percent_Markup read from file");
- end if;
-
- end loop;
-
- if (TC_Item_Count /= Daily_Orders_Received) then
- Report.Failed ("Incorrect number of records read from file");
- end if;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Error raised during data verification");
- end Test_Verification_Block;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Exception in Text_IO.Fixed_IO processing");
- end Operational_Test_Block;
-
- Final_Block:
- begin
- -- Delete the external file.
- if Text_IO.Is_Open (Inventory_File) then
- Text_IO.Delete (Inventory_File);
- else
- Text_IO.Open (Inventory_File, Text_IO.In_File, Inventory_Filename);
- Text_IO.Delete (Inventory_File);
- end if;
-
- exception
-
- when others =>
- Report.Failed ( "Delete not properly implemented for Text_IO" );
-
- end Final_Block;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA008;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa009.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa009.a
deleted file mode 100644
index d478060808a..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa009.a
+++ /dev/null
@@ -1,290 +0,0 @@
--- CXAA009.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the capabilities provided in instantiations of the
--- Ada.Text_IO.Float_IO package operate correctly when the mode of
--- the file is Append_File. Check that Float_IO procedures Put and Get
--- properly transfer floating point data to/from data files that are in
--- Append_File mode. Check that the formatting parameters available in
--- the package can be used and modified successfully in the appending and
--- retrieval of data.
---
--- TEST DESCRIPTION:
--- This test is designed to simulate an environment where a data file
--- that holds floating point information is created, written to, and
--- closed. In the future, the file can be reopened in Append_File mode,
--- additional data can be appended to it, and then closed. This process
--- of Open/Append/Close can be repeated as necessary. All data written
--- to the file is verified for accuracy when retrieved from the file.
---
--- This test verifies issues of create in Append_File mode, appending to
--- a file previously appended to, opening in Append_File mode, resetting
--- from Append_File mode to In_File mode, as well as a variety of Text_IO
--- and Float_IO predefined subprograms.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support text
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 25 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA009 is
-
- use Ada;
- Loan_File : Text_IO.File_Type;
- Loan_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA009" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAA009", "Check that the capabilities of " &
- "Text_IO.Float_IO operate correctly for files " &
- "with mode Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
- -- An implementation that does not support Text_IO in a particular
- -- environment will raise Use_Error on calls to various
- -- Text_IO operations. This block statement encloses a call to
- -- Create, which should raise the exception in a non-supportive
- -- environment. This exception will be handled to produce a
- -- Not_Applicable result.
-
- Text_IO.Create (File => Loan_File, -- Create in
- Mode => Text_IO.Out_File, -- Out_File mode.
- Name => Loan_Filename);
-
- exception
-
- when Text_IO.Use_Error | Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Text_IO" );
- raise Incomplete;
-
- end Test_for_Text_IO_Support;
-
- Operational_Test_Block:
- declare
- Total_Loans_Outstanding : constant Natural := 3;
- Transaction_Status : Boolean := False;
-
- type Account_Balance_Type is digits 6 range 0.0 .. 1.0E6;
- type Loan_Balance_Type is digits 6;
- type Interest_Rate_Type is digits 4 range 0.0 .. 30.00;
-
- type Loan_Info_Type is record
- Account_Balance : Account_Balance_Type := 0.00;
- Loan_Balance : Loan_Balance_Type := 0.00;
- Loan_Interest_Rate : Interest_Rate_Type := 0.00;
- end record;
-
- Home_Refinance_Loan : Loan_Info_Type :=
- (14_500.00, 135_000.00, 6.875);
- Line_Of_Credit_Loan : Loan_Info_Type :=
- ( 5490.00, -3000.00, 13.75);
- Small_Business_Loan : Loan_Info_Type :=
- (Account_Balance => 45_000.00,
- Loan_Balance => 10_500.00,
- Loan_Interest_Rate => 5.875);
-
- package Acct_IO is new Text_IO.Float_IO (Account_Balance_Type);
- package Loan_IO is new Text_IO.Float_IO (Loan_Balance_Type);
- package Rate_IO is new Text_IO.Float_IO (Interest_Rate_Type);
-
-
- -- The following procedure performs the addition of loan information
- -- into a data file. Boolean status of True is returned if all of
- -- the data entry was successful, False otherwise.
- -- This demonstrates use of Float_IO using a variety of data formats.
-
- procedure Update_Loan_Info (The_File : in out Text_IO.File_Type;
- The_Loan : in Loan_Info_Type;
- Status : out Boolean ) is
- begin
- Acct_IO.Put (The_File, The_Loan.Account_Balance);
- Loan_IO.Put (The_File, The_Loan.Loan_Balance, 15, 2, 0);
- Rate_IO.Put (File => The_File,
- Item => The_Loan.Loan_Interest_Rate,
- Fore => 6,
- Aft => 3,
- Exp => 0);
- Text_IO.New_Line (The_File);
- Status := True;
- exception
- when others => Status := False;
- end Update_Loan_Info;
-
-
- begin
-
- -- This code section simulates a bank maintaining a data file
- -- containing information on loans that have been made.
- -- The scenario:
- -- The loan file was created in Out_File mode.
- -- Some number of data records are added.
- -- The file is closed.
- -- The file is subsequently reopened in Append_File mode.
- -- Data is appended to the file.
- -- The file is closed.
- -- Repeat the Open/Append/Close process as required.
- -- Verify data in the file.
- -- etc.
-
- Update_Loan_Info(Loan_File, Home_Refinance_Loan, Transaction_Status);
-
- if not Transaction_Status then
- Report.Failed ("Failure in update of first loan data");
- end if;
-
- Text_IO.Close (Loan_File);
-
- -- When subsequent data items are to be added to the file, the file
- -- is opened in Append_File mode.
-
- Text_IO.Open (Loan_File, -- Open with
- Text_IO.Append_File, -- Append mode.
- Loan_Filename);
-
- Update_Loan_Info(Loan_File, Line_Of_Credit_Loan, Transaction_Status);
-
- if not Transaction_Status then
- Report.Failed("Failure in update of first loan data");
- end if;
-
- Text_IO.Close(Loan_File);
-
- -- To add additional data to the file, the file
- -- is again opened in Append_File mode (appending to a file
- -- previously appended to).
-
- Text_IO.Open (Loan_File, -- Open with
- Text_IO.Append_File, -- Append mode.
- Loan_Filename);
-
- Update_Loan_Info(Loan_File, Small_Business_Loan, Transaction_Status);
-
- if not Transaction_Status then
- Report.Failed("Failure in update of first loan data");
- end if;
-
- Test_Verification_Block:
- declare
- type Ledger_Type is
- array (1 .. Total_Loans_Outstanding) of Loan_Info_Type;
- TC_Bank_Ledger : Ledger_Type;
- TC_Item_Count : Natural := 0;
- begin
-
- Reset1:
- begin
- Text_IO.Reset (Loan_File, Text_IO.In_File); -- Reset for
- -- reading.
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO" );
- raise Incomplete;
- end Reset1;
-
- while not Text_IO.End_Of_File (Loan_File) loop
- TC_Item_Count := TC_Item_Count + 1;
- Acct_IO.Get (Loan_File,
- TC_Bank_Ledger(TC_Item_Count).Account_Balance);
- Loan_IO.Get (Loan_File,
- TC_Bank_Ledger(TC_Item_Count).Loan_Balance,
- 0);
- Rate_IO.Get(File => Loan_File,
- Item =>
- TC_Bank_Ledger(TC_Item_Count).Loan_Interest_Rate,
- Width => 0);
- Text_IO.Skip_Line(Loan_File);
-
- end loop;
-
- -- Verify all of the data fields read from the file. Compare
- -- with the values that were originally entered into the file.
-
- if (TC_Bank_Ledger(1) /= Home_Refinance_Loan) or
- (TC_Bank_Ledger(2) /= Line_Of_Credit_Loan) or
- (TC_Bank_Ledger(3) /= Small_Business_Loan) then
- Report.Failed("Error in data read from file");
- end if;
-
- if (TC_Item_Count /= Total_Loans_Outstanding) then
- Report.Failed ("Incorrect number of records read from file");
- end if;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Error raised during data verification");
- end Test_Verification_Block;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Exception in Text_IO.Float_IO processing");
- end Operational_Test_Block;
-
- Final_Block:
- begin
- -- Delete the external file.
- if Text_IO.Is_Open(Loan_File) then
- Text_IO.Delete(Loan_File);
- else
- Text_IO.Open(Loan_File, Text_IO.In_File, Loan_Filename);
- Text_IO.Delete(Loan_File);
- end if;
-
- exception
-
- when Text_IO.Use_Error =>
- Report.Failed
- ( "Delete not properly implemented for Text_IO" );
-
- end Final_Block;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA009;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa010.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa010.a
deleted file mode 100644
index 5678aee6bcf..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa010.a
+++ /dev/null
@@ -1,335 +0,0 @@
--- CXAA010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the operations defined in package Ada.Text_IO.Decimal_IO
--- are available, and that they function correctly when used for the
--- input/output of Decimal types.
---
--- TEST DESCRIPTION:
--- This test demonstrates the Put and Get procedures found in the
--- generic package Ada.Text_IO.Decimal_IO. Both Put and Get are
--- overloaded to allow placement or extraction of decimal values
--- to/from a text file or a string. This test demonstrates both forms
--- of each subprogram.
--- The test defines an array of records containing decimal value
--- and string component fields. All component values are placed in a
--- Text_IO file, with the decimal values being placed there using the
--- version of Put defined for files, and using user-specified formatting
--- parameters. The data is later extracted from the file, with the
--- decimal values being removed using the version of Get defined for
--- files. Decimal values are then written to strings, using the
--- appropriate Put procedure. Finally, extraction of the decimal data
--- from the strings completes the evaluation of the Decimal_IO package
--- subprograms.
--- The reconstructed data is verified at the end of the test against the
--- data originally written to the file.
---
--- APPLICABILITY CRITERIA:
--- Applicable to all implementations capable of supporting external
--- Text_IO files and Decimal Fixed Point Types
---
--- All implementations must attempt to compile this test.
---
--- For implementations validating against Information Systems Annex (F):
--- this test must execute and report PASSED.
---
--- For implementations not validating against Annex F:
--- this test may report compile time errors at one or more points
--- indicated by "-- ANX-F RQMT", in which case it may be graded as inapplicable.
--- Otherwise, the test must execute and report PASSED.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 20 Feb 95 SAIC Modified test to allow for Use_Error/Name_Error
--- generation by an implementation not supporting
--- Text_IO operations.
--- 14 Nov 95 SAIC Corrected string indexing for ACVC 2.0.1.
--- 27 Feb 97 PWB.CTA Allowed for non-support of some IO operations
--- 16 FEB 98 EDS Modified documentation.
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA010 is
- use Ada.Text_IO;
- Tax_Roll : Ada.Text_IO.File_Type;
- Tax_Roll_Name : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA010" );
- Incomplete : exception;
-begin
-
- Report.Test ("CXAA010", "Check that the operations defined in package " &
- "Ada.Text_IO.Decimal_IO are available, and " &
- "that they function correctly when used for " &
- "the input/output of Decimal types");
-
- Test_for_Decimal_IO_Support:
- begin
-
- -- An implementation that does not support Text_IO creation or naming
- -- of external files in a particular environment will raise Use_Error
- -- or Name_Error on a call to Text_IO Create. This block statement
- -- encloses a call to Create, which should produce an exception in a
- -- non-supportive environment. Either of these exceptions will be
- -- handled to produce a Not_Applicable result.
-
- Ada.Text_IO.Create (Tax_Roll, Ada.Text_IO.Out_File, Tax_Roll_Name);
-
- exception
-
- when Ada.Text_IO.Use_Error | Ada.Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Text_IO" );
- raise Incomplete;
-
- end Test_for_Decimal_IO_Support;
-
- Taxation:
- declare
-
- ID_Length : constant := 5;
- Price_String_Length : constant := 5;
- Value_String_Length : constant := 6;
- Total_String_Length : constant := 20;
- Spacer : constant String := " "; -- Two blanks.
-
- type Price_Type is delta 0.1 digits 4; -- ANX-F RQMT
- type Value_Type is delta 0.01 digits 5; -- ANX-F RQMT
-
- type Property_Type is
- record
- Parcel_ID : String (1..ID_Length);
- Purchase_Price : Price_Type;
- Assessed_Value : Value_Type;
- end record;
-
- type City_Block_Type is array (1..4) of Property_Type;
-
- subtype Tax_Bill_Type is string (1..Total_String_Length);
- type Tax_Bill_Array_Type is array (1..4) of Tax_Bill_Type;
-
- Neighborhood : City_Block_Type :=
- (("X9254", 123.0, 135.00), ("X3569", 345.0, 140.50),
- ("X3434", 234.0, 179.50), ("X8838", 456.0, 158.00));
-
- Neighborhood_Taxes : Tax_Bill_Array_Type;
-
- package Price_IO is new Ada.Text_IO.Decimal_IO (Price_Type);
- package Value_IO is new Ada.Text_IO.Decimal_IO (Value_Type);
-
- begin -- Taxation
-
- Assessors_Office:
- begin
-
- for Parcel in City_Block_Type'Range loop
- -- Note: All data in the file will be separated with a
- -- two-character blank spacer.
- Ada.Text_IO.Put(Tax_Roll, Neighborhood(Parcel).Parcel_ID);
- Ada.Text_IO.Put(Tax_Roll, Spacer);
-
- -- Use Decimal_IO.Put with non-default format parameters to
- -- place decimal data into file.
- Price_IO.Put (Tax_Roll, Neighborhood(Parcel).Purchase_Price,
- Fore => 3, Aft =>1, Exp => 0);
- Ada.Text_IO.Put(Tax_Roll, Spacer);
-
- Value_IO.Put (Tax_Roll, Neighborhood(Parcel).Assessed_Value,
- Fore => 3, Aft =>2, Exp => 0);
- Ada.Text_IO.New_Line(Tax_Roll);
- end loop;
-
- Ada.Text_IO.Close (Tax_Roll);
-
- exception
- when others =>
- Report.Failed ("Exception raised in Assessor's Office");
- end Assessors_Office;
-
-
- Twice_A_Year:
- declare
-
- procedure Collect_Tax(Index : in Integer;
- Tax_Array : in out Tax_Bill_Array_Type) is
- ID : String (1..ID_Length);
- Price : Price_Type := 0.0;
- Value : Value_Type := 0.00;
- Price_String : String (1..Price_String_Length);
- Value_String : String (1..Value_String_Length);
- begin
-
- -- Extract information from the Text_IO file; one string, two
- -- decimal values.
- -- Note that the Spacers that were put in the file above are
- -- not individually read here, due to the fact that each call
- -- to Decimal_IO.Get below uses a zero in the Width field,
- -- which allows each Get procedure to skip these leading blanks
- -- prior to extracting the numeric value.
-
- Ada.Text_IO.Get (Tax_Roll, ID);
-
- -- A zero value of Width is provided, so the following
- -- two calls to Decimal_IO.Get will skip the leading blanks,
- -- (from the Spacer variable above), then read the numeric
- -- literals.
-
- Price_IO.Get (Tax_Roll, Price, 0);
- Value_IO.Get (Tax_Roll, Value, 0);
- Ada.Text_IO.Skip_Line (Tax_Roll);
-
- -- Convert the values read from the file into string format,
- -- using user-specified format parameters.
- -- Format of the Price_String should be "nnn.n"
- -- Format of the Value_String should be "nnn.nn"
-
- Price_IO.Put (To => Price_String,
- Item => Price,
- Aft => 1);
- Value_IO.Put (Value_String, Value, 2);
-
- -- Construct a string of length 20 that contains the Parcel_ID,
- -- the Purchase_Price, and the Assessed_Value, separated by
- -- two-character blank data spacers. Store this string
- -- into the string array out parameter.
- -- Format of each Tax_Array element should be
- -- "Xnnnn nnn.n nnn.nn" (with an 'n' signifying a digit).
-
- Tax_Array(Index) := ID & Spacer &
- Price_String & Spacer &
- Value_String;
- exception
- when Data_Error =>
- Report.Failed("Data Error raised during the extraction " &
- "of decimal data from the file");
- when others =>
- Report.Failed("Exception in Collect_Tax procedure");
- end Collect_Tax;
-
-
- begin -- Twice_A_Year
-
- Ada.Text_IO.Open (Tax_Roll, Ada.Text_IO.In_File, Tax_Roll_Name);
-
- -- Determine property tax bills for the entire neighborhood from
- -- the information that is stored in the file. Store information
- -- in the Neighborhood_Taxes string array.
-
- for Parcel in City_Block_Type'Range loop
- Collect_Tax (Parcel, Neighborhood_Taxes);
- end loop;
-
- exception
- when others =>
- Report.Failed ("Exception in Twice_A_Year Block");
- end Twice_A_Year;
-
- -- Use Decimal_IO Get procedure to extract information from a string.
- -- Verify data against original values.
- Validation_Block:
- declare
- TC_ID : String (1..ID_Length); -- 1..5
- TC_Price : Price_Type;
- TC_Value : Value_Type;
- Length : Positive;
- Front,
- Rear : Integer := 0;
- begin
-
- for Parcel in City_Block_Type'Range loop
- -- Extract values from the strings of the string array.
- -- Each element of the string array is 20 characters long; the
- -- first five characters are the Parcel_ID, two blank characters
- -- separate data, the next five characters contain the Price
- -- decimal value, two blank characters separate data, the last
- -- six characters contain the Value decimal value.
- -- Extract each of these components in turn.
-
- Front := 1; -- 1
- Rear := ID_Length; -- 5
- TC_ID := Neighborhood_Taxes(Parcel)(Front..Rear);
-
- -- Extract the decimal value from the next slice of the string.
- Front := Rear + 3; -- 8
- Rear := Front + Price_String_Length - 1; -- 12
- Price_IO.Get (Neighborhood_Taxes(Parcel)(Front..Rear),
- Item => TC_Price,
- Last => Length);
-
- -- Extract next decimal value from slice of string, based on
- -- length of preceding strings read from string array element.
- Front := Rear + 3; -- 15
- Rear := Total_String_Length; -- 20
- Value_IO.Get (Neighborhood_Taxes(Parcel)(Front..Rear),
- Item => TC_Value,
- Last => Length);
-
- if TC_ID /= Neighborhood(Parcel).Parcel_ID or
- TC_Price /= Neighborhood(Parcel).Purchase_Price or
- TC_Value /= Neighborhood(Parcel).Assessed_Value
- then
- Report.Failed ("Incorrect data validation");
- end if;
-
- end loop;
-
- exception
- when others => Report.Failed ("Exception in Validation Block");
- end Validation_Block;
-
- -- Check that the Text_IO file is open, then delete.
-
- if not Ada.Text_IO.Is_Open (Tax_Roll) then
- Report.Failed ("File not left open after processing");
- Ada.Text_IO.Open (Tax_Roll, Ada.Text_IO.Out_File, Tax_Roll_Name);
- end if;
-
- Ada.Text_IO.Delete (Tax_Roll);
-
- exception
- when others =>
- Report.Failed ("Exception in Taxation block");
- -- Check that the Text_IO file is open, then delete.
- if not Ada.Text_IO.Is_Open (Tax_Roll) then
- Ada.Text_IO.Open (Tax_Roll,
- Ada.Text_IO.Out_File,
- Tax_Roll_Name);
- end if;
- Ada.Text_IO.Delete (Tax_Roll);
- end Taxation;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA010;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa011.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa011.a
deleted file mode 100644
index 8cc136d35ab..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa011.a
+++ /dev/null
@@ -1,266 +0,0 @@
--- CXAA011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the operations of Text_IO.Enumeration_IO perform correctly
--- on files of Append_File mode, for instantiations using
--- enumeration types. Check that Enumeration_IO procedures Put and Get
--- properly transfer enumeration data to/from data files.
--- Check that the formatting parameters available in the package can
--- be used and modified successfully in the storage and retrieval of data.
---
--- TEST DESCRIPTION:
--- This test is designed to simulate an environment where a data file
--- that holds enumeration type information is reset from it current mode
--- to allow the appending of data to the end of the This process
--- of Reset/Write can be repeated as necessary. All data written
--- to the file is verified for accuracy when retrieved from the file.
---
--- This test verifies issues of resetting a file created in Out_File mode
--- to Append_File mode, resetting from Append_File mode to In_File mode,
--- as well as a variety of Text_IO and Enumeration_IO predefined
--- subprograms.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support text
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 25 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA011 is
- use Ada;
-
- Status_Log : Text_IO.File_Type;
- Status_Log_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA011" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAA011", "Check that the operations of " &
- "Text_IO.Enumeration_IO operate correctly for " &
- "files with mode Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
- -- An implementation that does not support Text_IO in a particular
- -- environment will raise Use_Error on calls to various
- -- Text_IO operations. This block statement encloses a call to
- -- Create, which should raise the exception in a non-supportive
- -- environment. This exception will be handled to produce a
- -- Not_Applicable result.
-
- Text_IO.Create (File => Status_Log,
- Mode => Text_IO.Out_File,
- Name => Status_Log_Filename);
- exception
-
- when Text_IO.Use_Error | Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Text_IO" );
- raise Incomplete;
-
- end Test_for_Text_IO_Support;
-
-
- Operational_Test_Block:
- declare
-
- type Days_In_Week is (Monday, Tuesday, Wednesday, Thursday, Friday,
- Saturday, Sunday);
- type Hours_In_Day is (A0000, A0600, P1200, P0600); -- Six hour
- -- blocks.
- type Status_Type is (Operational, Off_Line);
-
- type Status_Record_Type is record
- Day : Days_In_Week;
- Hour : Hours_In_Day;
- Status : Status_Type;
- end record;
-
- Morning_Reading : Status_Record_Type :=
- (Wednesday, A0600, Operational);
- Evening_Reading : Status_Record_Type :=
- (Saturday, P0600, Off_Line);
-
- package Day_IO is new Text_IO.Enumeration_IO (Days_In_Week);
- package Hours_IO is new Text_IO.Enumeration_IO (Hours_In_Day);
- package Status_IO is new Text_IO.Enumeration_IO (Status_Type);
-
-
- -- The following function simulates the hourly recording of equipment
- -- status.
-
- function Record_Status (Reading : Status_Record_Type)
- return Boolean is
- use Text_IO; -- To provide visibility to type Type_Set and
- -- enumeration literal Upper_Case.
- begin
- Day_IO.Put (File => Status_Log,
- Item => Reading.Day,
- Set => Type_Set'(Upper_Case));
- Hours_IO.Put (Status_Log, Reading.Hour, 7);
- Status_IO.Put (Status_Log, Reading.Status,
- Width => 8, Set => Lower_Case);
- Text_IO.New_Line (Status_Log);
- return (True);
- exception
- when others => return False;
- end Record_Status;
-
- begin
-
- -- The usage scenario intended is as follows:
- -- File is created.
- -- Unrelated/unknown file processing occurs.
- -- On six hour intervals, file is reset to Append_File mode.
- -- Data is appended to file.
- -- Unrelated/unknown file processing resumes.
- -- Reset/Append process is repeated.
-
- Reset1:
- begin
- Text_IO.Reset (Status_Log, -- Reset to
- Text_IO.Append_File); -- Append mode.
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Append_File not supported for Text_IO" );
- raise Incomplete;
- end Reset1;
-
- Day_IO.Default_Width := Days_In_Week'Width + 5; -- Default values
- -- are modifiable.
-
- if not Record_Status (Morning_Reading) then -- Enter data.
- Report.Failed ("Exception occurred during data file update");
- end if;
-
- Reset2:
- begin
- Text_IO.Reset (Status_Log, -- Reset to
- Text_IO.Append_File); -- Append mode.
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Append_File not supported for Text_IO" );
- raise Incomplete;
- end Reset2;
-
- if not Record_Status (Evening_Reading) then -- Enter data.
- Report.Failed ("Exception occurred during data file update");
- end if;
-
- Test_Verification_Block:
- declare
- TC_Reading1 : Status_Record_Type;
- TC_Reading2 : Status_Record_Type;
- begin
-
- Reset3:
- begin
- Text_IO.Reset (Status_Log, Text_IO.In_File); -- Reset for
- -- reading.
- exception
- when Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO" );
- raise Incomplete;
- end Reset3;
-
- Day_IO.Get (Status_Log, TC_Reading1.Day); -- Read data from
- Hours_IO.Get (Status_Log, TC_Reading1.Hour); -- first record.
- Status_IO.Get (Status_Log, TC_Reading1.Status);
- Text_IO.Skip_Line (Status_Log);
-
- -- Verify the data read from the file. Compare with the
- -- record that was originally entered into the file.
-
- if (TC_Reading1 /= Morning_Reading) then
- Report.Failed ("Data error on reading first record");
- end if;
-
- Day_IO.Get (Status_Log, TC_Reading2.Day); -- Read data from
- Hours_IO.Get (Status_Log, TC_Reading2.Hour); -- second record.
- Status_IO.Get (Status_Log, TC_Reading2.Status);
- Text_IO.Skip_Line (Status_Log);
-
- -- Verify all of the data fields read from the file. Compare
- -- with the values that were originally entered into the file.
-
- if (TC_Reading2.Day /= Evening_Reading.Day) or
- (TC_Reading2.Hour /= Evening_Reading.Hour) or
- (TC_Reading2.Status /= Evening_Reading.Status) then
- Report.Failed ("Data error on reading second record");
- end if;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Error raised during data verification");
- end Test_Verification_Block;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Exception in Text_IO.Enumeration_IO processing");
- end Operational_Test_Block;
-
- Final_Block:
- begin
- -- Delete the external file.
- if Text_IO.Is_Open (Status_Log) then
- Text_IO.Delete (Status_Log);
- else
- Text_IO.Open (Status_Log, Text_IO.Out_File, Status_Log_Filename);
- Text_IO.Delete (Status_Log);
- end if;
- exception
- when Text_IO.Use_Error =>
- Report.Failed
- ( "Delete not properly implemented for Text_IO" );
-
- end Final_Block;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA011;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa012.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa012.a
deleted file mode 100644
index 07523b44170..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa012.a
+++ /dev/null
@@ -1,167 +0,0 @@
--- CXAA012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the exception Mode_Error is raised when an attempt is made
--- to read from (perform a Get_Line) or use the predefined End_Of_File
--- function on a text file with mode Append_File.
---
--- TEST DESCRIPTION:
--- A scenario is created that demonstrates the potential for the
--- incorrect usage of predefined text processing subprograms, resulting
--- from their use with files of the wrong Mode. This results in the
--- raising of Mode_Error exceptions, which is handled within blocks
--- embedded in the test.
--- A count is kept to ensure that each anticipated exception is in fact
--- raised and handled properly.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support text
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 27 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA012 is
- use Ada;
- Text_File : Text_IO.File_Type;
- Text_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA012" );
- Incomplete : exception;
-begin
-
- Report.Test ("CXAA012", "Check that the exception Mode_Error is " &
- "raised when an attempt is made to read " &
- "from (perform a Get_Line) or use the " &
- "predefined End_Of_File function on a " &
- "text file with mode Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
- -- Use_Error or Name_Error will be raised if Text_IO operations
- -- or external files are not supported.
-
- Text_IO.Create (Text_File, Text_IO.Out_File, Text_Filename);
-
- exception
- when Text_IO.Use_Error | Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Text_IO" );
- raise Incomplete;
- end Test_for_Text_IO_Support;
-
- -- The application writes some amount of data to the file.
-
- Text_IO.Put_Line (Text_File, "Data entered into the file");
-
- Text_IO.Close (Text_File);
-
- Operational_Test_Block:
- declare
- TC_Number_Of_Forced_Mode_Errors : constant Natural := 2;
- TC_Mode_Errors : Natural := 0;
- begin
-
- Text_IO.Open (Text_File, Text_IO.Append_File, Text_Filename);
-
- Test_for_Reading:
- declare
- TC_Data : String (1..80);
- TC_Length : Natural := 0;
- begin
-
--- During the course of its processing, the application may become confused
--- and erroneously attempt to read data from the file that is currently in
--- Append_File mode (instead of the anticipated In_File mode).
--- This would result in the raising of Mode_Error.
-
- Text_IO.Get_Line (Text_File, TC_Data, TC_Length);
- Report.Failed ("Exception not raised by Get_Line");
-
--- An exception handler present within the application handles the exception
--- and processing can continue.
-
- exception
- when Text_IO.Mode_Error =>
- TC_Mode_Errors := TC_Mode_Errors + 1;
- when others =>
- Report.Failed ("Exception in Get_Line processing");
- end Test_for_Reading;
-
-
- Test_for_End_Of_File:
- declare
- TC_End_Of_File : Boolean;
- begin
-
--- Again, during the course of its processing, the application attempts to
--- call the End_Of_File function for the file that is currently in
--- Append_File mode (instead of the anticipated In_File mode).
-
- TC_End_Of_File := Text_IO.End_Of_File (Text_File);
- Report.Failed ("Exception not raised by End_Of_File");
-
--- Once again, an exception handler present within the application handles
--- the exception and processing continues.
-
- exception
- when Text_IO.Mode_Error =>
- TC_Mode_Errors := TC_Mode_Errors + 1;
- when others =>
- Report.Failed("Exception in End_Of_File processing");
- end Test_for_End_Of_File;
-
-
- if (TC_Mode_Errors /= TC_Number_Of_Forced_Mode_Errors) then
- Report.Failed ("Incorrect number of exceptions handled");
- end if;
-
- end Operational_Test_Block;
-
- -- Delete the external file.
- if Text_IO.Is_Open (Text_File) then
- Text_IO.Delete (Text_File);
- else
- Text_IO.Open (Text_File, Text_IO.In_File, Text_Filename);
- Text_IO.Delete (Text_File);
- end if;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA012;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa013.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa013.a
deleted file mode 100644
index be658ca13e0..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa013.a
+++ /dev/null
@@ -1,167 +0,0 @@
--- CXAA013.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the exception Mode_Error is raised when an attempt is made
--- to skip a line or page using the predefined Skip_Line and Skip_Page
--- procedures on a text file with mode Append_File.
---
--- TEST DESCRIPTION:
--- A scenario is created that demonstrates the potential for the
--- incorrect usage of predefined text processing subprograms, which
--- results in the raising of a Mode_Error exception.
--- A count is kept to ensure that each anticipated exception is in fact
--- raised and handled properly.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support text
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 28 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA013 is
- use Ada;
- Text_File : Text_IO.File_Type;
- Text_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA013" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAA013", "Check that the exception Mode_Error is " &
- "raised when an attempt is made to skip " &
- "a line or page using the predefined " &
- "Skip_Line and Skip_Page procedures on " &
- "a text file with mode Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
--- An application creates a text file with mode Append_File.
--- Use_Error will be raised if Text_IO operations or external files are not
--- supported.
-
- Text_IO.Create (Text_File, Text_IO.Append_File, Text_Filename);
-
- exception
-
- when Text_IO.Use_Error | Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Append_File for Text_IO" );
- raise Incomplete;
-
- end Test_for_Text_IO_Support;
-
--- The application writes some amount of data to the file.
-
- Text_IO.Put_Line (Text_File, "Data entered into the file");
-
- Operational_Test_Block:
- declare
- TC_Number_Of_Forced_Mode_Errors : constant Natural := 2;
- TC_Mode_Errors : Natural := 0;
- begin
-
- Test_for_Skip_Line:
- declare
- TC_Spacing : constant Text_IO.Count := 3;
- begin
-
--- During the course of its processing, the application may attempt to
--- invoke the Skip_Line procedure on a file that is currently in Append_File
--- mode (instead of the anticipated In_File mode). This results in the
--- raising of Mode_Error.
-
- Text_IO.Skip_Line (Text_File, TC_Spacing);
- Report.Failed ("Exception not raised by Skip_Line");
-
--- An exception handler present within the application handles the exception
--- and processing can continue.
-
- exception
- when Text_IO.Mode_Error =>
- TC_Mode_Errors := TC_Mode_Errors + 1;
- when others =>
- Report.Failed("Exception in Skip_Line processing");
- end Test_for_Skip_Line;
-
- Test_for_Skip_Page:
- begin
-
--- Again, during the course of its processing, the application incorrectly
--- assumes that the file mode is In_File, this time attempting to call the
--- Skip_Page procedure for the file (that is currently in Append_File mode).
-
- Text_IO.Skip_Page (Text_File);
- Report.Failed ("Exception not raised by Skip_Page");
-
--- Once again, an exception handler present within the application handles
--- the exception and processing continues.
-
- exception
- when Text_IO.Mode_Error =>
- TC_Mode_Errors := TC_Mode_Errors + 1;
- when others =>
- Report.Failed("Exception in Skip_Page processing");
- end Test_for_Skip_Page;
-
- if (TC_Mode_Errors /= TC_Number_Of_Forced_Mode_Errors) then
- Report.Failed ("Incorrect number of exceptions handled");
- end if;
-
- end Operational_Test_Block;
-
- Deletion:
- begin
- -- Delete the external file.
- if Text_IO.Is_Open (Text_File) then
- Text_IO.Delete (Text_File);
- else
- Text_IO.Open (Text_File, Text_IO.In_File, Text_Filename);
- Text_IO.Delete (Text_File);
- end if;
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Text_IO" );
- end Deletion;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA013;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa014.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa014.a
deleted file mode 100644
index 0b74c616959..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa014.a
+++ /dev/null
@@ -1,178 +0,0 @@
--- CXAA014.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the exception Mode_Error is raised when an attempt is made
--- to check for the end of a line or page using the predefined functions
--- End_Of_Line or End_Of_Page on a text file with mode Append_File.
---
--- TEST DESCRIPTION:
--- A scenario is created that demonstrates the potential for the
--- incorrect usage of predefined text processing subprograms, which
--- results in the raising of a Mode_Error exception.
--- A count is kept to ensure that each anticipated exception is in fact
--- raised and handled properly.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support text
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 28 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA014 is
- use Ada;
- Text_File : Text_IO.File_Type;
- Text_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA014" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAA014", "Check that the exception Mode_Error is " &
- "raised when an attempt is made to check " &
- "for the end of a line or page using the " &
- "predefined functions End_Of_Line or " &
- "End_Of_Page on a text file with mode " &
- "Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
--- Use_Error will be raised if Text_IO operations or external files are not
--- supported.
-
- Text_IO.Create (Text_File, Text_IO.Out_File, Text_Filename);
-
- exception
-
- when Text_IO.Use_Error | Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Text_IO" );
- raise Incomplete;
-
- end Test_for_Text_IO_Support;
-
-
--- The application writes some amount of data to the file.
-
- for I in 1 .. 10 loop
- Text_IO.Put_Line (Text_File, "Data entered into the file");
- end loop;
-
- Text_IO.Close (Text_File);
-
- Operational_Test_Block:
- declare
- TC_Number_Of_Forced_Mode_Errors : constant Natural := 2;
- TC_Mode_Errors : Natural := 0;
- begin
-
- Text_IO.Open (Text_File, Text_IO.Append_File, Text_Filename);
-
- Test_for_End_Of_Line:
- declare
- TC_End_Of_Line : Boolean;
- begin
-
--- During the course of its processing, the application may attempt to
--- invoke the End_Of_Line function on a file that is currently in Append_File
--- mode (instead of the anticipated In_File mode). This results in the
--- raising of Mode_Error.
-
- TC_End_Of_Line := Text_IO.End_Of_Line (Text_File);
- Report.Failed ("Exception not raised by End_Of_Line");
-
--- An exception handler present within the application handles the exception
--- and processing can continue.
-
- exception
- when Text_IO.Mode_Error =>
- TC_Mode_Errors := TC_Mode_Errors + 1;
- when others =>
- Report.Failed("Exception in End_Of_Line processing");
- end Test_for_End_Of_Line;
-
-
- Test_for_End_Of_Page:
- declare
- TC_End_Of_Page : Boolean;
- begin
-
--- Again, during the course of its processing, the application incorrectly
--- assumes that the file mode is In_File, this time attempting to call the
--- End_Of_Page function for the file (that is currently in Append_File mode).
-
- TC_End_Of_Page := Text_IO.End_Of_Page (Text_File);
- Report.Failed ("Exception not raised by End_Of_Page");
-
--- Once again, an exception handler present within the application handles
--- the exception and processing continues.
-
- exception
- when Text_IO.Mode_Error =>
- TC_Mode_Errors := TC_Mode_Errors + 1;
- when others =>
- Report.Failed("Exception in End_Of_Page processing");
- end Test_for_End_Of_Page;
-
-
- if (TC_Mode_Errors /= TC_Number_Of_Forced_Mode_Errors) then
- Report.Failed ("Incorrect number of exceptions handled");
- end if;
-
- end Operational_Test_Block;
-
- Deletion:
- begin
- -- Delete the external file.
- if Text_IO.Is_Open (Text_File) then
- Text_IO.Delete (Text_File);
- else
- Text_IO.Open (Text_File, Text_IO.In_File, Text_Filename);
- Text_IO.Delete (Text_File);
- end if;
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Text_IO" );
- end Deletion;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA014;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa015.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa015.a
deleted file mode 100644
index 919ef05ca7e..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa015.a
+++ /dev/null
@@ -1,227 +0,0 @@
--- CXAA015.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the exception Status_Error is raised when an attempt is
--- made to create or open a file in Append_File mode when the file is
--- already open.
--- Check that the exception Name_Error is raised by procedure Open when
--- attempting to open a file in Append_File mode when the name supplied
--- as the filename does not correspond to an existing external file.
---
--- TEST DESCRIPTION:
--- A scenario is created that demonstrates the potential for the
--- inappropriate usage of text processing subprograms Create and Open,
--- resulting in the raising of Status_Error and Name_Error exceptions.
--- A count is kept to ensure that each anticipated exception is in fact
--- raised and handled properly.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support text
--- files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 28 Feb 97 PWB.CTA Allowed for non-support of some IO operations
---!
-
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA015 is
- use Ada;
- Text_File : Text_IO.File_Type;
- Text_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAA015" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAA015", "Check that the appropriate exceptions " &
- "are raised when procedures Create and " &
- "Open are used to inappropriately operate " &
- "on files of mode Append_File");
-
- Test_for_Text_IO_Support:
- begin
-
--- An application creates a text file with mode Append_File.
--- Use_Error will be raised if Text_IO operations or external files are not
--- supported.
-
- Text_IO.Create (Text_File, Text_IO.Append_File, Text_Filename);
- exception
-
- when Text_IO.Use_Error | Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Append_File for Text_IO" );
- raise Incomplete;
-
- end Test_for_Text_IO_Support;
-
-
--- The application writes some amount of data to the file.
-
- for I in 1 .. 5 loop
- Text_IO.Put_Line (Text_File, "Data entered into the file");
- end loop;
-
- Operational_Test_Block:
- declare
- TC_Number_Of_Forced_Errors : constant Natural := 3;
- TC_Errors : Natural := 0;
- begin
-
-
- Test_for_Create:
- begin
-
--- During the course of its processing, the application may (erroneously)
--- attempt to create the same file already in existence in Append_File mode.
--- This results in the raising of Status_Error.
-
- Text_IO.Create (Text_File,
- Text_IO.Append_File,
- Text_Filename);
- Report.Failed ("Exception not raised by Create");
-
--- An exception handler present within the application handles the exception
--- and processing can continue.
-
- exception
- when Text_IO.Status_Error =>
- TC_Errors := TC_Errors + 1;
- when others =>
- Report.Failed("Exception in Create processing");
- end Test_for_Create;
-
-
- First_Test_For_Open:
- begin
-
--- Again, during the course of its processing, the application incorrectly
--- attempts to Open a file (in Append_File mode) that is already open.
-
- Text_IO.Open (Text_File, Text_IO.Append_File, Text_Filename);
- Report.Failed ("Exception not raised by improper Open - 1");
-
--- Once again, an exception handler present within the application handles
--- the exception and processing continues.
-
- exception
- when Text_IO.Status_Error =>
- TC_Errors := TC_Errors + 1;
-
--- At some point in its processing, the application closes the file that is
--- currently open.
-
- Text_IO.Close (Text_File);
- when others =>
- Report.Failed("Exception in Open processing - 1");
- end First_Test_For_Open;
-
-
- Open_With_Wrong_Filename:
- declare
- TC_Wrong_Filename : constant String :=
- Report.Legal_File_Name(2);
- begin
-
--- At this point, the application attempts to Open (in Append_File mode) the
--- file used in previous processing, but it attempts this Open using a name
--- string that does not correspond to any existing external file.
--- First make sure the file doesn't exist. (If it did, then the check
--- for open in append mode wouldn't work.)
-
- Verify_No_File:
- begin
- Text_IO.Open (Text_File,
- Text_IO.In_File,
- TC_Wrong_Filename);
- exception
- when Text_IO.Name_Error =>
- null;
- when others =>
- Report.Failed ( "Unexpected exception on Open check" );
- end Verify_No_File;
-
- Delete_No_File:
- begin
- if Text_IO.Is_Open (Text_File) then
- Text_IO.Delete (Text_File);
- end if;
- exception
- when others =>
- Report.Failed ( "Unexpected exception - Delete check" );
- end Delete_No_File;
-
- Text_IO.Open (Text_File,
- Text_IO.Append_File,
- TC_Wrong_Filename);
- Report.Failed ("Exception not raised by improper Open - 2");
-
--- An exception handler for the Name_Error, present within the application,
--- catches the exception and processing continues.
-
- exception
- when Text_IO.Name_Error =>
- TC_Errors := TC_Errors + 1;
- when others =>
- Report.Failed("Exception in Open processing - 2");
- end Open_With_Wrong_Filename;
-
-
- if (TC_Errors /= TC_Number_Of_Forced_Errors) then
- Report.Failed ("Incorrect number of exceptions handled");
- end if;
-
- end Operational_Test_Block;
-
- Deletion:
- begin
- -- Delete the external file.
- if Text_IO.Is_Open (Text_File) then
- Text_IO.Delete (Text_File);
- else
- Text_IO.Open (Text_File, Text_IO.In_File, Text_Filename);
- Text_IO.Delete (Text_File);
- end if;
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Text_IO" );
- end Deletion;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAA015;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa016.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa016.a
deleted file mode 100644
index 8ae69a12664..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa016.a
+++ /dev/null
@@ -1,462 +0,0 @@
--- CXAA016.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the type File_Access is available in Ada.Text_IO, and that
--- objects of this type designate File_Type objects.
--- Check that function Set_Error will set the current default error file.
--- Check that versions of Ada.Text_IO functions Standard_Input,
--- Standard_Output, Standard_Error return File_Access values designating
--- the standard system input, output, and error files.
--- Check that versions of Ada.Text_IO functions Current_Input,
--- Current_Output, Current_Error return File_Access values designating
--- the current system input, output, and error files.
---
--- TEST DESCRIPTION:
--- This test tests the use of File_Access objects in referring
--- to File_Type objects, as well as several new functions that return
--- File_Access objects as results.
--- Four user-defined files are created. These files will be set to
--- function as current system input, output, and error files.
--- Data will be read from and written to these files during the
--- time at which they function as the current system files.
--- An array of File_Access objects will be defined. It will be
--- initialized using functions that return File_Access objects
--- referencing the Standard and Current Input, Output, and Error files.
--- This "saves" the initial system environment, which will be modified
--- to use the user-defined files as the current default Input, Output,
--- and Error files. At the end of the test, the data in this array
--- will be used to restore the initial system environment.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to implementations capable of supporting
--- external Text_IO files.
---
---
--- CHANGE HISTORY:
--- 25 May 95 SAIC Initial prerelease version.
--- 22 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 26 Feb 97 PWB.CTA Allowed for non-support of some IO operations.
--- 18 Jan 99 RLB Repaired to allow Not_Applicable systems to
--- fail delete.
---!
-
-with Ada.Text_IO;
-package CXAA016_0 is
- New_Input_File,
- New_Output_File,
- New_Error_File_1,
- New_Error_File_2 : aliased Ada.Text_IO.File_Type;
-end CXAA016_0;
-
-
-with Report;
-with Ada.Exceptions;
-with Ada.Text_IO; use Ada.Text_IO;
-with CXAA016_0; use CXAA016_0;
-
-procedure CXAA016 is
-
- Non_Applicable_System : exception;
- No_Reset : exception;
- Not_Applicable_System : Boolean := False;
-
- procedure Delete_File ( A_File : in out Ada.Text_IO.File_Type;
- ID_Num : in Integer ) is
- begin
- if not Ada.Text_IO.Is_Open ( A_File ) then
- Ada.Text_IO.Open ( A_File,
- Ada.Text_IO.In_File,
- Report.Legal_File_Name ( ID_Num ) );
- end if;
- Ada.Text_IO.Delete ( A_File );
- exception
- when Ada.Text_IO.Name_Error =>
- if Not_Applicable_System then
- null; -- File probably wasn't created.
- else
- Report.Failed ( "Can't open file for Text_IO" );
- end if;
- when Ada.Text_IO.Use_Error =>
- if Not_Applicable_System then
- null; -- File probably wasn't created.
- else
- Report.Failed ( "Delete not properly implemented for Text_IO" );
- end if;
- when others =>
- Report.Failed ( "Unexpected exception in Delete_File" );
- end Delete_File;
-
-begin
-
- Report.Test ("CXAA016", "Check that the type File_Access is available " &
- "in Ada.Text_IO, and that objects of this " &
- "type designate File_Type objects");
- Test_Block:
- declare
-
- use Ada.Exceptions;
-
- type System_File_Array_Type is
- array (Integer range <>) of File_Access;
-
- -- Fill the following array with the File_Access results of six
- -- functions.
-
- Initial_Environment : System_File_Array_Type(1..6) :=
- ( Standard_Input,
- Standard_Output,
- Standard_Error,
- Current_Input,
- Current_Output,
- Current_Error );
-
- New_Input_Ptr : File_Access := New_Input_File'Access;
- New_Output_Ptr : File_Access := New_Output_File'Access;
- New_Error_Ptr : File_Access := New_Error_File_1'Access;
-
- Line : String(1..80);
- Length : Natural := 0;
-
- Line_1 : constant String := "This is the first line in the Output file";
- Line_2 : constant String := "This is the next line in the Output file";
- Line_3 : constant String := "This is the first line in Error file 1";
- Line_4 : constant String := "This is the next line in Error file 1";
- Line_5 : constant String := "This is the first line in Error file 2";
- Line_6 : constant String := "This is the next line in Error file 2";
-
-
-
- procedure New_File (The_File : in out File_Type;
- Mode : in File_Mode;
- Next : in Integer) is
- begin
- Create (The_File, Mode, Report.Legal_File_Name(Next));
- exception
- -- The following two exceptions may be raised if a system is not
- -- capable of supporting external Text_IO files. The handler will
- -- raise a user-defined exception which will result in a
- -- Not_Applicable result for the test.
- when Use_Error | Name_Error => raise Non_Applicable_System;
- end New_File;
-
-
-
- procedure Check_Initial_Environment (Env : System_File_Array_Type) is
- begin
- -- Check that the system has defined the following sources/
- -- destinations for input/output/error, and that the six functions
- -- returning File_Access values are available.
- if not (Env(1) = Standard_Input and
- Env(2) = Standard_Output and
- Env(3) = Standard_Error and
- Env(4) = Current_Input and
- Env(5) = Current_Output and
- Env(6) = Current_Error)
- then
- Report.Failed("At the start of the test, the Standard and " &
- "Current File_Access values associated with " &
- "system Input, Output, and Error files do " &
- "not correspond");
- end if;
- end Check_Initial_Environment;
-
-
-
- procedure Load_Input_File (Input_Ptr : in File_Access) is
- begin
- -- Load data into the file that will function as the user-defined
- -- system input file.
- Put_Line(Input_Ptr.all, Line_1);
- Put_Line(Input_Ptr.all, Line_2);
- Put_Line(Input_Ptr.all, Line_3);
- Put_Line(Input_Ptr.all, Line_4);
- Put_Line(Input_Ptr.all, Line_5);
- Put_Line(Input_Ptr.all, Line_6);
- end Load_Input_File;
-
-
-
- procedure Restore_Initial_Environment
- (Initial_Env : System_File_Array_Type) is
- begin
- -- Restore the Current Input, Output, and Error files to their
- -- original states.
-
- Set_Input (Initial_Env(4).all);
- Set_Output(Initial_Env(5).all);
- Set_Error (Initial_Env(6).all);
-
- -- At this point, the user-defined files that were functioning as
- -- the Current Input, Output, and Error files have been replaced in
- -- that capacity by the state of the original environment.
-
- declare
-
- -- Capture the state of the current environment.
-
- Current_Env : System_File_Array_Type (1..6) :=
- (Standard_Input, Standard_Output, Standard_Error,
- Current_Input, Current_Output, Current_Error);
- begin
-
- -- Compare the current environment with that of the saved
- -- initial environment.
-
- if Current_Env /= Initial_Env then
- Report.Failed("Restored file environment was not the same " &
- "as the initial file environment");
- end if;
- end;
- end Restore_Initial_Environment;
-
-
-
- procedure Verify_Files (O_File, E_File_1, E_File_2 : in File_Type) is
- Str_1, Str_2, Str_3, Str_4, Str_5, Str_6 : String (1..80);
- Len_1, Len_2, Len_3, Len_4, Len_5, Len_6 : Natural;
- begin
-
- -- Get the lines that are contained in all the files, and verify
- -- them against the expected results.
-
- Get_Line(O_File, Str_1, Len_1); -- The user defined output file
- Get_Line(O_File, Str_2, Len_2); -- should contain two lines of data.
-
- if Str_1(1..Len_1) /= Line_1 or
- Str_2(1..Len_2) /= Line_2
- then
- Report.Failed("Incorrect results from Current_Output file");
- end if;
-
- Get_Line(E_File_1, Str_3, Len_3); -- The first error file received
- Get_Line(E_File_1, Str_4, Len_4); -- two lines of data originally,
- Get_Line(E_File_1, Str_5, Len_5); -- then had two additional lines
- Get_Line(E_File_1, Str_6, Len_6); -- appended from the second error
- -- file.
- if Str_3(1..Len_3) /= Line_3 or
- Str_4(1..Len_4) /= Line_4 or
- Str_5(1..Len_5) /= Line_5 or
- Str_6(1..Len_6) /= Line_6
- then
- Report.Failed("Incorrect results from first Error file");
- end if;
-
- Get_Line(E_File_2, Str_5, Len_5); -- The second error file
- Get_Line(E_File_2, Str_6, Len_6); -- received two lines of data.
-
- if Str_5(1..Len_5) /= Line_5 or
- Str_6(1..Len_6) /= Line_6
- then
- Report.Failed("Incorrect results from second Error file");
- end if;
-
- end Verify_Files;
-
-
-
- begin
-
- Check_Initial_Environment (Initial_Environment);
-
- -- Create user-defined text files that will be set to serve as current
- -- system input, output, and error files.
-
- New_File (New_Input_File, Out_File, 1); -- Will be reset prior to use.
- New_File (New_Output_File, Out_File, 2);
- New_File (New_Error_File_1, Out_File, 3);
- New_File (New_Error_File_2, Out_File, 4);
-
- -- Enter several lines of text into the new input file. This file will
- -- be reset to mode In_File to function as the current system input file.
- -- Note: File_Access value used as parameter to this procedure.
-
- Load_Input_File (New_Input_Ptr);
-
- -- Reset the New_Input_File to mode In_File, to allow it to act as the
- -- current system input file.
-
- Reset1:
- begin
- Reset (New_Input_File, In_File);
- exception
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO - 1" );
- raise No_Reset;
- end Reset1;
-
- -- Establish new files that will function as the current system Input,
- -- Output, and Error files.
-
- Set_Input (New_Input_File);
- Set_Output(New_Output_Ptr.all);
- Set_Error (New_Error_Ptr.all);
-
- -- Perform various file processing tasks, exercising specific new
- -- Text_IO functionality.
- --
- -- Read two lines from Current_Input and write them to Current_Output.
-
- for i in 1..2 loop
- Get_Line(Current_Input, Line, Length);
- Put_Line(Current_Output, Line(1..Length));
- end loop;
-
- -- Read two lines from Current_Input and write them to Current_Error.
-
- for i in 1..2 loop
- Get_Line(Current_Input, Line, Length);
- Put_Line(Current_Error, Line(1..Length));
- end loop;
-
- -- Reset the Current system error file.
-
- Set_Error (New_Error_File_2);
-
- -- Read two lines from Current_Input and write them to Current_Error.
-
- for i in 1..2 loop
- Get_Line(Current_Input, Line, Length);
- Put_Line(Current_Error, Line(1..Length));
- end loop;
-
- -- At this point in the processing, the new Output file, and each of
- -- the two Error files, contain two lines of data.
- -- Note that New_Error_File_1 has been replaced by New_Error_File_2
- -- as the current system error file, allowing New_Error_File_1 to be
- -- reset (Mode_Error raised otherwise).
- --
- -- Reset the first Error file to Append_File mode, and then set it to
- -- function as the current system error file.
-
- Reset2:
- begin
- Reset (New_Error_File_1, Append_File);
- exception
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Append_File not supported for Text_IO - 2" );
- raise No_Reset;
- end Reset2;
-
- Set_Error (New_Error_File_1);
-
- -- Reset the second Error file to In_File mode, then set it to become
- -- the current system input file.
-
- Reset3:
- begin
- Reset (New_Error_File_2, In_File);
- exception
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO - 3" );
- raise No_Reset;
- end Reset3;
-
- New_Error_Ptr := New_Error_File_2'Access;
- Set_Input (New_Error_Ptr.all);
-
- -- Append all of the text lines (2) in the new current system input
- -- file onto the current system error file.
-
- while not End_Of_File(Current_Input) loop
- Get_Line(Current_Input, Line, Length);
- Put_Line(Current_Error, Line(1..Length));
- end loop;
-
- -- Restore the original system file environment, based upon the values
- -- stored at the start of this test.
- -- Check that the original environment has been restored.
-
- Restore_Initial_Environment (Initial_Environment);
-
- -- Reset all three files to In_File_Mode prior to verification.
- -- Note: If these three files had still been the designated Current
- -- Input, Output, or Error files for the system, a Reset
- -- operation at this point would raise Mode_Error.
- -- However, at this point, the environment has been restored to
- -- its original state, and these user-defined files are no longer
- -- designated as current system files, allowing a Reset.
-
- Reset4:
- begin
- Reset(New_Error_File_1, In_File);
- exception
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO - 4" );
- raise No_Reset;
- end Reset4;
-
- Reset5:
- begin
- Reset(New_Error_File_2, In_File);
- exception
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO - 5" );
- raise No_Reset;
- end Reset5;
-
- Reset6:
- begin
- Reset(New_Output_File, In_File);
- exception
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO - 6" );
- raise No_Reset;
- end Reset6;
-
- -- Check that all the files contain the appropriate data.
-
- Verify_Files (New_Output_File, New_Error_File_1, New_Error_File_2);
-
- exception
- when No_Reset =>
- null;
- when Non_Applicable_System =>
- Report.Not_Applicable("System not capable of supporting external " &
- "text files -- Name_Error/Use_Error raised " &
- "during text file creation");
- Not_Applicable_System := True;
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Delete_Block:
- begin
- Delete_File ( New_Input_File, 1 );
- Delete_File ( New_Output_File, 2 );
- Delete_File ( New_Error_File_1, 3 );
- Delete_File ( New_Error_File_2, 4 );
- end Delete_Block;
-
- Report.Result;
-
-end CXAA016;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa017.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa017.a
deleted file mode 100644
index 17d0922cc24..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa017.a
+++ /dev/null
@@ -1,400 +0,0 @@
--- CXAA017.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Ada.Text_IO function Look_Ahead sets parameter End_Of_Line
--- to True if at the end of a line; otherwise check that it returns the
--- next character from a file (without consuming it), while setting
--- End_Of_Line to False.
---
--- Check that Ada.Text_IO function Get_Immediate will return the next
--- control or graphic character in parameter Item from the specified
--- file. Check that the version of Ada.Text_IO function Get_Immediate
--- with the Available parameter will, if a character is available in the
--- specified file, return the character in parameter Item, and set
--- parameter Available to True.
---
--- TEST DESCRIPTION:
--- This test exercises specific capabilities of two Text_IO subprograms,
--- Look_Ahead and Get_Immediate. A file is prepared that contains a
--- variety of graphic and control characters on several lines.
--- In processing this file, a call to Look_Ahead is performed to ensure
--- that characters are available, then individual characters are
--- extracted from the current line using Get_Immediate. The characters
--- returned from both subprogram calls are compared with the expected
--- character result. Processing on each file line continues until
--- Look_Ahead indicates that the end of the line is next. Separate
--- verification is performed to ensure that all characters of each line
--- are processed, and that the Available and End_Of_Line parameters
--- of the subprograms are properly set in the appropriate instances.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to implementations capable of supporting
--- external Text_IO files.
---
---
--- CHANGE HISTORY:
--- 30 May 95 SAIC Initial prerelease version.
--- 01 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 26 Feb 97 PWB.CTA Allowed for non-support of some IO operations.
---!
-
-with Ada.Text_IO;
-package CXAA017_0 is
-
- User_Defined_Input_File : aliased Ada.Text_IO.File_Type;
-
-end CXAA017_0;
-
-
-with CXAA017_0; use CXAA017_0;
-with Ada.Characters.Latin_1;
-with Ada.Exceptions;
-with Ada.Text_IO;
-with Report;
-
-procedure CXAA017 is
-
- use Ada.Characters.Latin_1;
- use Ada.Exceptions;
- use Ada.Text_IO;
-
- Non_Applicable_System : exception;
- No_Reset : exception;
-
-begin
-
- Report.Test ("CXAA017", "Check that Ada.Text_IO subprograms " &
- "Look_Ahead and Get_Immediate are available " &
- "and produce correct results");
-
- Test_Block:
- declare
-
- User_Input_Ptr : File_Access := User_Defined_Input_File'Access;
-
- UDLA_Char, -- Acronym UDLA => "User Defined Look Ahead"
- UDGI_Char, -- Acronym UDGI => "User Defined Get Immediate"
- TC_Char : Character := Ada.Characters.Latin_1.NUL;
-
- UDLA_End_Of_Line,
- UDGI_Available : Boolean := False;
-
- Char_Pos : Natural;
-
- -- This string contains five ISO 646 Control characters and six ISO 646
- -- Graphic characters:
- TC_String_1 : constant String := STX &
- SI &
- DC2 &
- CAN &
- US &
- Space &
- Ampersand &
- Solidus &
- 'A' &
- LC_X &
- DEL;
-
- -- This string contains two ISO 6429 Control and six ISO 6429 Graphic
- -- characters:
- TC_String_2 : constant String := IS4 &
- SCI &
- Yen_Sign &
- Masculine_Ordinal_Indicator &
- UC_I_Grave &
- Multiplication_Sign &
- LC_C_Cedilla &
- LC_Icelandic_Thorn;
-
- TC_Number_Of_Strings : constant := 2;
-
- type String_Access_Type is access constant String;
- type String_Ptr_Array_Type is
- array (1..TC_Number_Of_Strings) of String_Access_Type;
-
- TC_String_Ptr_Array : String_Ptr_Array_Type :=
- (new String'(TC_String_1),
- new String'(TC_String_2));
-
-
-
- procedure Create_New_File (The_File : in out File_Type;
- Mode : in File_Mode;
- Next : in Integer) is
- begin
- Create (The_File, Mode, Report.Legal_File_Name(Next));
- exception
- -- The following two exceptions can be raised if a system is not
- -- capable of supporting external Text_IO files. The handler will
- -- raise a user-defined exception which will result in a
- -- Not_Applicable result for the test.
- when Use_Error | Name_Error => raise Non_Applicable_System;
- end Create_New_File;
-
-
-
- procedure Load_File (The_File : in out File_Type) is
- -- This procedure will load several strings into the file denoted
- -- by the input parameter. A call to New_Line will add line/page
- -- termination characters, which will be available for processing
- -- along with the text in the file.
- begin
- Put_Line (The_File, TC_String_Ptr_Array(1).all);
- New_Line (The_File, Spacing => 1);
- Put_Line (The_File, TC_String_Ptr_Array(2).all);
- end Load_File;
-
-
- begin
-
- -- Create user-defined text file that will serve as the appropriate
- -- sources of input to the procedures under test.
-
- Create_New_File (User_Defined_Input_File, Out_File, 1);
-
- -- Enter several lines of text into the new input file.
- -- The characters that make up these text strings will be processed
- -- using the procedures being exercised in this test.
-
- Load_File (User_Defined_Input_File);
-
- -- Check that Mode_Error is raised by Look_Ahead and Get_Immedidate
- -- if the mode of the file object is not In_File.
- -- Currently, the file mode is Out_File.
-
- begin
- Look_Ahead(User_Defined_Input_File, UDLA_Char, UDLA_End_Of_Line);
- Report.Failed("Mode_Error not raised by Look_Ahead");
- Report.Comment("This char should never be printed: " & UDLA_Char);
- exception
- when Mode_Error => null; -- OK, expected exception.
- when The_Error : others =>
- Report.Failed ("The following exception was raised during the " &
- "check that Look_Ahead raised Mode_Error when " &
- "provided a file object that is not in In_File " &
- "mode: " & Exception_Name(The_Error));
- end;
-
- begin
- Get_Immediate(User_Defined_Input_File, UDGI_Char);
- Report.Failed("Mode_Error not raised by Get_Immediate");
- Report.Comment("This char should never be printed: " & UDGI_Char);
- exception
- when Mode_Error => null; -- OK, expected exception.
- when The_Error : others =>
- Report.Failed ("The following exception was raised during the " &
- "check that Get_Immediate raised Mode_Error " &
- "when provided a file object that is not in " &
- "In_File mode: " & Exception_Name(The_Error));
- end;
-
-
- -- The file will then be reset to In_File mode to properly function as
- -- a source of input.
-
- Reset1:
- begin
- Reset (User_Defined_Input_File, In_File);
- exception
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO" );
- raise No_Reset;
- end Reset1;
-
- -- Process the input file, exercising various Text_IO
- -- functionality, and validating the results at each step.
- -- Note: The designated File_Access object is used in processing
- -- the New_Default_Input_File in the second loop below.
-
- -- Process characters in first line of text of each file.
-
- Char_Pos := 1;
-
- -- Check that the first line is not blank.
-
- Look_Ahead(User_Defined_Input_File, UDLA_Char, UDLA_End_Of_Line);
-
- while not UDLA_End_Of_Line loop
-
- -- Use the Get_Immediate procedure on the file to get the next
- -- available character on the current line.
-
- Get_Immediate(User_Defined_Input_File, UDGI_Char);
-
- -- Check that the characters returned by both procedures are the
- -- same, and that they match the expected character from the file.
-
- if UDLA_Char /= TC_String_Ptr_Array(1).all(Char_Pos) or
- UDGI_Char /= TC_String_Ptr_Array(1).all(Char_Pos)
- then
- Report.Failed("Incorrect retrieval of character " &
- Integer'Image(Char_Pos) & " of first string");
- end if;
-
- -- Increment the character position counter.
- Char_Pos := Char_Pos + 1;
-
- -- Check the next character on the line. If at the end of line,
- -- the processing flow will exit the While loop.
-
- Look_Ahead(User_Defined_Input_File, UDLA_Char, UDLA_End_Of_Line);
-
- end loop;
-
- -- Check to ensure that the "end of line" results returned from the
- -- Look_Ahead procedure (used to exit the above While loop) corresponds
- -- with the result of Function End_Of_Line.
-
- if not End_Of_Line(User_Defined_Input_File)
- then
- Report.Failed("Result of procedure Look_Ahead that indicated " &
- "being at the end of the line does not correspond " &
- "with the result of function End_Of_Line");
- end if;
-
- -- Check that all characters in the string were processed.
-
- if Char_Pos-1 /= TC_String_1'Length then
- Report.Failed("Not all of the characters on the first line " &
- "were processed");
- end if;
-
-
- -- Call procedure Skip_Line to advance beyond the end of the first line.
-
- Skip_Line(User_Defined_Input_File);
-
-
- -- Process the second line in the file (a blank line).
-
- Look_Ahead(User_Input_Ptr.all, UDLA_Char, UDLA_End_Of_Line);
-
- if not UDLA_End_Of_Line then
- Report.Failed("Incorrect end of line determination from procedure " &
- "Look_Ahead when processing a blank line");
- end if;
-
- -- Call procedure Skip_Line to advance beyond the end of the second line.
-
- Skip_Line(User_Input_Ptr.all);
-
-
- -- Process characters in the third line of the file (second line
- -- of text)
- -- Note: The version of Get_Immediate used in processing this line has
- -- the Boolean parameter Available.
-
- Char_Pos := 1;
-
- -- Check whether the line is blank (i.e., at end of line, page, or file).
-
- Look_Ahead(User_Input_Ptr.all, UDLA_Char, UDLA_End_Of_Line);
-
- while not UDLA_End_Of_Line loop
-
- -- Use the Get_Immediate procedure on the file to get access to the
- -- next character on the current line.
-
- Get_Immediate(User_Input_Ptr.all, UDGI_Char, UDGI_Available);
-
- -- Check that the Available parameter of Get_Immediate was set
- -- to indicate that a character was available in the file.
- -- Check that the characters returned by both procedures are the
- -- same, and they all match the expected character from the file.
-
- if not UDGI_Available or
- UDLA_Char /= TC_String_Ptr_Array(2).all(Char_Pos) or
- UDGI_Char /= TC_String_Ptr_Array(2).all(Char_Pos)
- then
- Report.Failed("Incorrect retrieval of character " &
- Integer'Image(Char_Pos) & " of second string");
- end if;
-
- -- Increment the character position counter.
-
- Char_Pos := Char_Pos + 1;
-
- -- Check the next character on the line. If at the end of line,
- -- the processing flow will exit the While loop.
-
- Look_Ahead(User_Input_Ptr.all, UDLA_Char, UDLA_End_Of_Line);
-
- end loop;
-
- -- Check to ensure that the "end of line" results returned from the
- -- Look_Ahead procedure (used to exit the above While loop) corresponds
- -- with the result of Function End_Of_Line.
-
- if not End_Of_Line(User_Defined_Input_File)
- then
- Report.Failed("Result of procedure Look_Ahead that indicated " &
- "being at the end of the line does not correspond " &
- "with the result of function End_Of_Line");
- end if;
-
- -- Check that all characters in the second string were processed.
-
- if Char_Pos-1 /= TC_String_2'Length then
- Report.Failed("Not all of the characters on the second line " &
- "were processed");
- end if;
-
-
- Deletion:
- begin
- -- Delete the user defined file.
-
- if Is_Open(User_Defined_Input_File) then
- Delete(User_Defined_Input_File);
- else
- Open(User_Defined_Input_File, Out_File, Report.Legal_File_Name(1));
- Delete(User_Defined_Input_File);
- end if;
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Text_IO" );
- end Deletion;
-
-
- exception
-
- when No_Reset =>
- null;
-
- when Non_Applicable_System =>
- Report.Not_Applicable("System not capable of supporting external " &
- "text files -- Name_Error/Use_Error raised " &
- "during text file creation");
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXAA017;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa018.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa018.a
deleted file mode 100644
index 53b16fea498..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa018.a
+++ /dev/null
@@ -1,277 +0,0 @@
--- CXAA018.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in the package Text_IO.Modular_IO
--- provide correct results.
---
--- TEST DESCRIPTION:
--- This test checks that the subprograms defined in the
--- Ada.Text_IO.Modular_IO package provide correct results.
--- A modular type is defined and used to instantiate the generic
--- package Ada.Text_IO.Modular_IO. Values of the modular type are
--- written to a Text_IO file, and to a series of string variables, using
--- different versions of the procedure Put from the instantiated IO
--- package. These modular data items are retrieved from the file and
--- string variables using the appropriate instantiated version of
--- procedure Get. A variety of Base and Width parameter values are
--- used in the procedure calls.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that support Text_IO
--- processing and external files.
---
---
--- CHANGE HISTORY:
--- 03 Jul 95 SAIC Initial prerelease version.
--- 01 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
---
---!
-
-with Ada.Text_IO;
-with System;
-with Report;
-
-procedure CXAA018 is
-begin
-
- Report.Test ("CXAA018", "Check that the subprograms defined in " &
- "the package Text_IO.Modular_IO provide " &
- "correct results");
-
- Test_for_Text_IO_Support:
- declare
- Data_File : Ada.Text_IO.File_Type;
- Data_Filename : constant String := Report.Legal_File_Name;
- begin
-
- -- An application creates a text file in mode Out_File, with the
- -- intention of entering modular data into the file as appropriate.
- -- In the event that the particular environment where the application
- -- is running does not support Text_IO, Use_Error or Name_Error will be
- -- raised on calls to Text_IO operations. Either of these exceptions
- -- will be handled to produce a Not_Applicable result.
-
- Ada.Text_IO.Create (File => Data_File,
- Mode => Ada.Text_IO.Out_File,
- Name => Data_Filename);
-
- Test_Block:
- declare
-
- type Mod_Type is mod System.Max_Binary_Modulus;
- -- Max_Binary_Modulus must be at least 2**16, which would result
- -- in a base range of 0..65535 (zero to one less than the given
- -- modulus) for this modular type.
-
- package Mod_IO is new Ada.Text_IO.Modular_IO(Mod_Type);
- use Ada.Text_IO, Mod_IO;
- use type Mod_Type;
-
- Number_Of_Modular_Items : constant := 6;
- Number_Of_Error_Items : constant := 1;
-
- TC_Modular : Mod_Type;
- TC_Last_Character_Read : Positive;
-
- Modular_Array : array (1..Number_Of_Modular_Items) of Mod_Type :=
- ( 0, 97, 255, 1025, 12097, 65535 );
-
-
- procedure Load_File (The_File : in out Ada.Text_IO.File_Type) is
- begin
- -- This procedure does not create, open, or close the data file;
- -- The_File file object must be Open at this point.
- -- This procedure is designed to load Modular_Type data into a
- -- data file.
- --
- -- Use the Modular_IO procedure Put to enter modular data items
- -- into the data file.
-
- for i in 1..Number_Of_Modular_Items loop
- -- Use default Base parameter of 10.
- Mod_IO.Put(File => Data_File,
- Item => Modular_Array(i),
- Width => 6,
- Base => Mod_IO.Default_Base);
- end loop;
-
- -- Enter data into the file such that on the corresponding "Get"
- -- of this data, Data_Error must be raised. This value is outside
- -- the base range of Modular_Type.
- -- Text_IO is used to enter the value in the file.
-
- for i in 1..Number_Of_Error_Items loop
- Ada.Text_IO.Put(The_File, "-10");
- end loop;
-
- end Load_File;
-
-
-
- procedure Process_File(The_File : in out Ada.Text_IO.File_Type) is
- begin
- -- This procedure does not create, open, or close the data file;
- -- The_File file object must be Open at this point.
- -- Use procedure Get (for Files) to extract the modular data from
- -- the Text_IO file.
-
- for i in 1..Number_Of_Modular_Items loop
- Mod_IO.Get(The_File, TC_Modular, Width => 6);
-
- if TC_Modular /= Modular_Array(i) then
- Report.Failed("Incorrect modular data read from file " &
- "data item #" & Integer'Image(i));
- end if;
- end loop;
-
- -- The final item in the Data_File is a modular value that is
- -- outside the base range 0..Num'Last. This value should raise
- -- Data_Error on an attempt to "Get" it from the file.
-
- for i in 1..Number_Of_Error_Items loop
- begin
- Mod_IO.Get(The_File, TC_Modular, Mod_IO.Default_Width);
- Report.Failed
- ("Exception Data_Error not raised when Get " &
- "was used to read modular data outside base " &
- "range of type, item # " &
- Integer'Image(i));
- exception
- when Ada.Text_IO.Data_Error =>
- null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised when Get " &
- "was used to read modular data outside " &
- "base range of type from Data_File, " &
- "data item #" & Integer'Image(i));
- end;
- end loop;
-
- exception
- when others =>
- Report.Failed
- ("Unexpected exception raised in Process_File");
- end Process_File;
-
-
-
- begin -- Test_Block.
-
- -- Place modular values into data file.
-
- Load_File(Data_File);
- Ada.Text_IO.Close(Data_File);
-
- -- Read modular values from data file.
-
- Ada.Text_IO.Open(Data_File, Ada.Text_IO.In_File, Data_Filename);
- Process_File(Data_File);
-
- -- Verify versions of Modular_IO procedures Put and Get for Strings.
-
- Modular_IO_in_Strings:
- declare
- TC_String_Array : array (1..Number_Of_Modular_Items)
- of String(1..30) := (others =>(others => ' '));
- begin
-
- -- Place modular values into strings using the Procedure Put,
- -- Use a variety of different "Base" parameter values.
- -- Note: This version of Put uses the length of the given
- -- string as the value of the "Width" parameter.
-
- for i in 1..2 loop
- Mod_IO.Put(To => TC_String_Array(i),
- Item => Modular_Array(i),
- Base => Mod_IO.Default_Base);
- end loop;
- for i in 3..4 loop
- Mod_IO.Put(TC_String_Array(i),
- Modular_Array(i),
- Base => 2);
- end loop;
- for i in 5..6 loop
- Mod_IO.Put(TC_String_Array(i), Modular_Array(i), 16);
- end loop;
-
- -- Get modular values from strings using the Procedure Get.
- -- Compare with expected modular values.
-
- for i in 1..Number_Of_Modular_Items loop
-
- Mod_IO.Get(From => TC_String_Array(i),
- Item => TC_Modular,
- Last => TC_Last_Character_Read);
-
- if TC_Modular /= Modular_Array(i) then
- Report.Failed("Incorrect modular data value obtained " &
- "from String following use of Procedures " &
- "Put and Get from Strings, Modular_Array " &
- "item #" & Integer'Image(i));
- end if;
- end loop;
-
- exception
- when others =>
- Report.Failed("Unexpected exception raised during the " &
- "evaluation of Put and Get for Strings");
- end Modular_IO_in_Strings;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- -- Delete the external file.
- if Ada.Text_IO.Is_Open(Data_File) then
- Ada.Text_IO.Delete(Data_File);
- else
- Ada.Text_IO.Open(Data_File,
- Ada.Text_IO.In_File,
- Data_Filename);
- Ada.Text_IO.Delete(Data_File);
- end if;
-
- exception
-
- -- Since Use_Error can be raised if, for the specified mode,
- -- the environment does not support Text_IO operations, the
- -- following handlers are included:
-
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable ("Use_Error raised on Text_IO Create");
-
- when Ada.Text_IO.Name_Error =>
- Report.Not_Applicable ("Name_Error raised on Text_IO Create");
-
- when others =>
- Report.Failed ("Unexpected exception raised on text file Create");
-
- end Test_for_Text_IO_Support;
-
- Report.Result;
-
-end CXAA018;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaa019.a b/gcc/testsuite/ada/acats/tests/cxa/cxaa019.a
deleted file mode 100644
index 04c257e97b6..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaa019.a
+++ /dev/null
@@ -1,138 +0,0 @@
--- CXAA019.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Standard_Output can be flushed. Check that 'in' parameters of
--- types Ada.Text_IO.File_Type and Ada.Streams.Stream_IO.File_Type can be
--- flushed. (Defect Report 8652/0051).
---
--- CHANGE HISTORY:
--- 12 FEB 2001 PHL Initial version
--- 16 MAR 2001 RLB Readied for release; fixed Not_Applicable check
--- to terminate test gracefully.
---
---!
-with Ada.Streams.Stream_Io;
-use Ada.Streams;
-with Ada.Text_Io;
-with Ada.Wide_Text_Io;
-with Report;
-use Report;
-procedure CXAA019 is
-
- procedure Check (File : in Ada.Text_Io.File_Type) is
- begin
- Ada.Text_Io.Put_Line
- (File, " - CXAA019 About to flush a Text_IO file passed " &
- "as 'in' parameter");
- Ada.Text_Io.Flush (File);
- end Check;
-
- procedure Check (File : in Ada.Wide_Text_Io.File_Type) is
- begin
- Ada.Wide_Text_Io.Put_Line
- (File, " - CXAA019 About to flush a Wide_Text_IO file passed " &
- "as 'in' parameter");
- Ada.Wide_Text_Io.Flush (File);
- end Check;
-
- procedure Check (File : in Stream_Io.File_Type) is
- S : Stream_Element_Array (1 .. 10);
- begin
- for I in S'Range loop
- S (I) := Stream_Element (Character'Pos ('A') + I);
- end loop;
- Stream_Io.Write (File, S);
- Comment ("About to flush a Stream_IO file passed as 'in' parameter");
- Stream_Io.Flush (File);
- end Check;
-
-
-begin
- Test ("CXAA019",
- "Check that Standard_Output can be flushed; check that " &
- "'in' Ada.Text_IO.File_Type and Ada.Streams.Stream_IO.File_Type" &
- "parameters can be flushed");
-
- Ada.Text_Io.Put_Line (Ada.Text_Io.Standard_Output,
- " - CXAA019 About to flush Standard_Output");
- Ada.Text_Io.Flush (Ada.Text_Io.Standard_Output);
-
- Check (Ada.Text_Io.Current_Output);
-
- declare
- TC_OK : Boolean := False;
- F : Ada.Text_Io.File_Type;
- begin
- begin
- Ada.Text_Io.Create (F, Name => Legal_File_Name (X => 1));
- TC_OK := True;
- exception
- when others =>
- Not_Applicable ("Unable to create Out mode Text_IO file");
- end;
- if TC_OK then
- Check (F);
- Ada.Text_Io.Delete (F);
- end if;
- end;
-
- declare
- TC_OK : Boolean := False;
- F : Ada.Wide_Text_Io.File_Type;
- begin
- begin
- Ada.Wide_Text_Io.Create (F, Name => Legal_File_Name (X => 2));
- TC_OK := True;
- exception
- when others =>
- Not_Applicable ("Unable to create Out mode Wide_Text_IO file");
- end;
- if TC_OK then
- Check (F);
- Ada.Wide_Text_Io.Delete (F);
- end if;
- end;
-
- declare
- TC_OK : Boolean := False;
- F : Stream_Io.File_Type;
- begin
- begin
- Stream_Io.Create (F, Name => Legal_File_Name (X => 3));
- TC_OK := True;
- exception
- when others =>
- Not_Applicable ("Unable to create Out mode Stream_IO file");
- end;
- if TC_OK then
- Check (F);
- Stream_Io.Delete (F);
- end if;
- end;
-
- Result;
-end CXAA019;
-
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxab001.a b/gcc/testsuite/ada/acats/tests/cxa/cxab001.a
deleted file mode 100644
index 483acd16cb2..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxab001.a
+++ /dev/null
@@ -1,272 +0,0 @@
--- CXAB001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the operations defined in package Wide_Text_IO allow for
--- the input/output of Wide_Character and Wide_String data.
---
--- TEST DESCRIPTION:
--- This test is designed to exercise the components of the Wide_Text_IO
--- package, including the Put/Get utilities for Wide_Characters and
--- Wide_String objects.
--- The test utilizes the Put and Get procedures defined for
--- Wide_Characters, as well as the Put, Get, Put_Line, and Get_Line
--- procedures defined for Wide_Strings. In addition, many of the
--- additional subprograms found in package Wide_Text_IO are used in this
--- test.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations capable of supporting
--- external Wide_Text_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 26 Feb 97 CTA.PWB Allowed for non-support of some IO operations.
---!
-
-with Ada.Wide_Text_IO;
-with Report;
-
-procedure CXAB001 is
-
- Filter_File : Ada.Wide_Text_IO.File_Type;
- Filter_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAB001" );
- Incomplete : exception;
-
-
-begin
-
- Report.Test ("CXAB001", "Check that the operations defined in package " &
- "Wide_Text_IO allow for the input/output of " &
- "Wide_Character and Wide_String data");
-
-
- Test_for_Wide_Text_IO_Support:
- begin
-
- -- An implementation that does not support Wide_Text_IO in a particular
- -- environment will raise Use_Error on calls to various
- -- Wide_Text_IO operations. This block statement encloses a call to
- -- Create, which should raise an exception in a non-supportive
- -- environment. This exception will be handled to produce a
- -- Not_Applicable result.
-
- Ada.Wide_Text_IO.Create (File => Filter_File, -- Create.
- Mode => Ada.Wide_Text_IO.Out_File,
- Name => Filter_Filename);
-
- exception
-
- when Ada.Wide_Text_IO.Use_Error | Ada.Wide_Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Wide_Text_IO" );
- raise Incomplete;
-
- end Test_for_Wide_Text_IO_Support;
-
- Operational_Test_Block:
- declare
-
- First_String : constant Wide_String := "Somewhere ";
- Second_String : constant Wide_String := "Over The ";
- Third_String : constant Wide_String := "Rainbow";
- Current_Char : Wide_Character := ' ';
-
- begin
-
- Enter_Data_In_File:
- declare
- Pos : Natural := 1;
- Bad_Character_Found : Boolean := False;
- begin
- -- Use the Put procedure defined for Wide_Character data to
- -- write all of the wide characters of the First_String into
- -- the file individually, followed by a call to New_Line.
-
- while Pos <= First_String'Length loop
- Ada.Wide_Text_IO.Put (Filter_File, First_String (Pos)); -- Put.
- Pos := Pos + 1;
- end loop;
- Ada.Wide_Text_IO.New_Line (Filter_File); -- New_Line.
-
- -- Reset to In_File mode and read file contents, using the Get
- -- procedure defined for Wide_Character data.
- Reset1:
- begin
- Ada.Wide_Text_IO.Reset (Filter_File, -- Reset.
- Ada.Wide_Text_IO.In_File);
- exception
- when Ada.Wide_Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Wide_Text_IO" );
- raise Incomplete;
- end Reset1;
-
- Pos := 1;
- while Pos <= First_String'Length loop
- Ada.Wide_Text_IO.Get (Filter_File, Current_Char); -- Get.
- -- Verify the wide character against the original string.
- if Current_Char /= First_String(Pos) then
- Bad_Character_Found := True;
- end if;
- Pos := Pos + 1;
- end loop;
-
- if Bad_Character_Found then
- Report.Failed ("Incorrect Wide_Character read from file - 1");
- end if;
-
- -- Following user file/string processing, the Wide_String data
- -- of the Second_String and Third_String Wide_String objects are
- -- appended to the file.
- -- The Put procedure defined for Wide_String data is used to
- -- transfer the Second_String, followed by a call to New_Line.
- -- The Put_Line procedure defined for Wide_String data is used
- -- to transfer the Third_String.
- Reset2:
- begin
- Ada.Wide_Text_IO.Reset (Filter_File, -- Reset.
- Ada.Wide_Text_IO.Append_File);
-
- exception
- when Ada.Wide_Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Append_File not supported for Wide_Text_IO" );
- raise Incomplete;
- end Reset2;
-
- Ada.Wide_Text_IO.Put (Filter_File, Second_String); -- Put.
- Ada.Wide_Text_IO.New_Line (Filter_File); -- New_Line.
-
- Ada.Wide_Text_IO.Put_Line (Filter_File, Third_String); -- Put_Line.
- Ada.Wide_Text_IO.Close (Filter_File); -- Close.
-
- exception
-
- when Incomplete =>
- raise;
-
- when others =>
- Report.Failed ("Exception in Enter_Data_In_File block");
- raise;
-
- end Enter_Data_In_File;
-
- ---
-
- Filter_Block:
- declare
-
- Pos : Positive := 1;
- TC_String2 : Wide_String (1..Second_String'Length);
- TC_String3 : Wide_String (1..Third_String'Length);
- Last : Natural := Natural'First;
-
- begin
-
- Ada.Wide_Text_IO.Open (Filter_File, -- Open.
- Ada.Wide_Text_IO.In_File,
- Filter_Filename);
-
-
- -- Read the data of the First_String from the file, using the
- -- Get procedure defined for Wide_Character data.
- -- Verify that the character corresponds to the data originally
- -- written to the file.
-
- while Pos <= First_String'Length loop
- Ada.Wide_Text_IO.Get (Filter_File, Current_Char); -- Get.
- if Current_Char /= First_String(Pos) then
- Report.Failed
- ("Incorrect Wide_Character read from file - 2");
- end if;
- Pos := Pos + 1;
- end loop;
-
- -- The first line of the file has been read, move to the second.
- Ada.Wide_Text_IO.Skip_Line (Filter_File); -- Skip_Line.
-
- -- Read the Wide_String data from the second and third lines of
- -- the file.
- Ada.Wide_Text_IO.Get (Filter_File, TC_String2); -- Get.
- Ada.Wide_Text_IO.Skip_Line (Filter_File); -- Skip_Line.
- Ada.Wide_Text_IO.Get_Line (Filter_File, -- Get_Line.
- TC_String3, Last);
-
- -- Verify data of second and third strings.
- if TC_String2 /= Second_String then
- Report.Failed ("Incorrect Wide_String read from file - 1");
- end if;
- if TC_String3 /= Third_String then
- Report.Failed ("Incorrect Wide_String read from file - 2");
- end if;
-
- -- The file should now be at EOF.
- if not Ada.Wide_Text_IO.End_Of_File (Filter_File) then -- EOF.
- Report.Failed ("File not empty following filtering");
- end if;
-
- exception
- when others =>
- Report.Failed ("Exception in Filter_Block");
- raise;
- end Filter_Block;
-
- exception
-
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Exception raised in Operational Test Block");
-
- end Operational_Test_Block;
-
- Deletion:
- begin
- if Ada.Wide_Text_IO.Is_Open (Filter_File) then -- Is_Open.
- Ada.Wide_Text_IO.Delete (Filter_File); -- Delete.
- else
- Ada.Wide_Text_IO.Open (Filter_File, -- Open.
- Ada.Wide_Text_IO.Out_File,
- Filter_Filename);
- Ada.Wide_Text_IO.Delete (Filter_File); -- Delete.
- end if;
- exception
- when others =>
- Report.Failed ("Delete not properly implemented for Wide_Text_IO");
- end Deletion;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAB001;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxac001.a b/gcc/testsuite/ada/acats/tests/cxa/cxac001.a
deleted file mode 100644
index a77d561f5d6..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxac001.a
+++ /dev/null
@@ -1,292 +0,0 @@
--- CXAC001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the attribute T'Write will, for any specific non-limited
--- type T, write an item of the subtype to the stream.
---
--- Check that the attribute T'Read will, for a specific non-limited
--- type T, read a value of the subtype from the stream.
---
--- TEST DESCRIPTION:
--- The scenario depicted in this test is that of an environment where
--- product data is stored in stream form, then reconstructed into the
--- appropriate data structures. Several records of product information
--- are stored in an array; the array is passed as a parameter to a
--- procedure for storage in the stream. A header is created based on the
--- number of data records stored in the array. The header is then written
--- to the stream, followed by each record maintained in the array.
--- In order to retrieve data from the stream, the header information is
--- read from the stream, and the data stored in the header is used to
--- perform the appropriate number of read operations of record data from
--- the stream. All data read from the stream is validated against the
---- values that were written to the stream.
---
--- APPLICABILITY CRITERIA:
--- Applicable to all systems capable of supporting IO operations on
--- external Stream_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 08 Nov 95 SAIC Corrected call to Read in Procedure Retrieve_Data
--- for ACVC 2.0.1.
--- 27 Feb 08 PWB.CTA Allowed for non-support of certain IO operations.
---!
-
-with Ada.Streams.Stream_IO;
-with Report;
-
-procedure CXAC001 is
-
- package Strm_Pack renames Ada.Streams.Stream_IO;
- The_File : Strm_Pack.File_Type;
- The_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAC001" );
- Incomplete : exception;
-
-
-begin
-
- Report.Test ("CXAC001", "Check that the 'Read and 'Write attributes " &
- "will transfer an object of a specific, " &
- "non-limited type to/from a stream");
-
- Test_for_Stream_IO_Support:
- begin
-
- -- If an implementation does not support Stream_IO in a particular
- -- environment, the exception Use_Error or Name_Error will be raised on
- -- calls to various Stream_IO operations. This block statement
- -- encloses a call to Create, which should produce an exception in a
- -- non-supportive environment. These exceptions will be handled to
- -- produce a Not_Applicable result.
-
- Strm_Pack.Create (The_File, Strm_Pack.Out_File, The_Filename);
-
- exception
-
- when Ada.Streams.Stream_IO.Use_Error |
- Ada.Streams.Stream_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Stream_IO" );
- raise Incomplete;
-
- end Test_for_Stream_IO_Support;
-
- Operational_Test_Block:
- declare
-
- The_Stream : Strm_Pack.Stream_Access;
- Todays_Date : String (1 .. 6) := "271193";
-
- type ID_Type is range 1 .. 100;
- type Size_Type is (Small, Medium, Large, XLarge);
-
- type Header_Type is record
- Number_of_Elements : Natural := 0;
- Origination_Date : String (1 .. 6);
- end record;
-
- type Data_Type is record
- ID : ID_Type;
- Size : Size_Type;
- end record;
-
- type Data_Array_Type is array (Positive range <>) of Data_Type;
-
- Product_Information_1 : Data_Array_Type (1 .. 3) := ((20, Large),
- (55, Small),
- (89, XLarge));
-
- Product_Information_2 : Data_Array_Type (1 .. 4) := (( 5, XLarge),
- (27, Small),
- (79, Medium),
- (93, XLarge));
-
- procedure Store_Data ( The_Stream : in Strm_Pack.Stream_Access;
- The_Array : in Data_Array_Type ) is
- Header : Header_Type;
- begin
-
- -- Fill in header info.
- Header.Number_of_Elements := The_Array'Length;
- Header.Origination_Date := Todays_Date;
-
- -- Write header to stream.
- Header_Type'Write (The_Stream, Header);
-
- -- Write each record in the array to the stream.
- for I in 1 .. Header.Number_of_Elements loop
- Data_Type'Write (The_Stream, The_Array (I));
- end loop;
-
- end Store_Data;
-
- procedure Retrieve_Data (The_Stream : in Strm_Pack.Stream_Access;
- The_Header : out Header_Type;
- The_Array : out Data_Array_Type ) is
- begin
-
- -- Read header from the stream.
- Header_Type'Read (The_Stream, The_Header);
-
- -- Read the records from the stream into the array.
- for I in 1 .. The_Header.Number_of_Elements loop
- Data_Type'Read (The_Stream, The_Array (I));
- end loop;
-
- end Retrieve_Data;
-
- begin
-
- -- Assign access value.
- The_Stream := Strm_Pack.Stream (The_File);
-
- -- Product information is to be stored in the stream file. These
- -- data arrays are of different sizes (actually, the records
- -- are stored individually, not as a single array). Prior to the
- -- record data being written, a header record is initialized with
- -- information about the data to be written, then itself is written
- -- to the stream.
-
- Store_Data (The_Stream, Product_Information_1);
- Store_Data (The_Stream, Product_Information_2);
-
- Test_Verification_Block:
- declare
- Product_Header_1 : Header_Type;
- Product_Header_2 : Header_Type;
- Product_Array_1 : Data_Array_Type (1 .. 3);
- Product_Array_2 : Data_Array_Type (1 .. 4);
- begin
-
- Reset1:
- begin
- Strm_Pack.Reset (The_File, Strm_Pack.In_File);
- exception
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Stream_IO" );
- raise Incomplete;
- end Reset1;
-
- -- Data is read from the stream, first the appropriate header,
- -- then the associated data records, which are then reconstructed
- -- into a data array of product information.
-
- Retrieve_Data (The_Stream, Product_Header_1, Product_Array_1);
-
- -- Validate a field in the header.
- if (Product_Header_1.Origination_Date /= Todays_Date) or
- (Product_Header_1.Number_of_Elements /= 3)
- then
- Report.Failed ("Incorrect Header_1 info read from stream");
- end if;
-
- -- Validate the data records read from the file.
- for I in 1 .. Product_Header_1.Number_of_Elements loop
- if (Product_Array_1(I) /= Product_Information_1(I)) then
- Report.Failed ("Incorrect Product 1 info read from" &
- " record: " & Integer'Image (I));
- end if;
- end loop;
-
- -- Repeat this read and verify operation for the next parcel of
- -- data. Again, header and data record information are read from
- -- the same stream file.
- Retrieve_Data (The_Stream, Product_Header_2, Product_Array_2);
-
- if (Product_Header_2.Origination_Date /= Todays_Date) or
- (Product_Header_2.Number_of_Elements /= 4)
- then
- Report.Failed ("Incorrect Header_2 info read from stream");
- end if;
-
- for I in 1 .. Product_Header_2.Number_of_Elements loop
- if (Product_Array_2(I) /= Product_Information_2(I)) then
- Report.Failed ("Incorrect Product_2 info read from" &
- " record: " & Integer'Image (I));
- end if;
- end loop;
-
- exception
-
- when Incomplete =>
- raise;
-
- when Strm_Pack.End_Error => -- If correct number of
- -- items not in file (data
- -- overwritten), then fail.
- Report.Failed ("Incorrect number of record elements in file");
- if not Strm_Pack.Is_Open (The_File) then
- Strm_Pack.Open (The_File, Strm_Pack.Out_File, The_Filename);
- end if;
-
- when others =>
- Report.Failed ("Exception raised in Data Verification Block");
- if not Strm_Pack.Is_Open (The_File) then
- Strm_Pack.Open (The_File, Strm_Pack.Out_File, The_Filename);
- end if;
-
- end Test_Verification_Block;
-
- exception
-
- when Incomplete =>
- raise;
-
- when others =>
- Report.Failed ("Exception raised in Operational Test Block");
-
- end Operational_Test_Block;
-
- Deletion:
- begin
- -- Delete the file.
- if Strm_Pack.Is_Open (The_File) then
- Strm_Pack.Delete (The_File);
- else
- Strm_Pack.Open (The_File, Strm_Pack.Out_File, The_Filename);
- Strm_Pack.Delete (The_File);
- end if;
-
- exception
-
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Stream_IO" );
- end Deletion;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAC001;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxac002.a b/gcc/testsuite/ada/acats/tests/cxa/cxac002.a
deleted file mode 100644
index e4b303c4bc9..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxac002.a
+++ /dev/null
@@ -1,426 +0,0 @@
--- CXAC002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in package Ada.Streams.Stream_IO
--- are accessible, and that they provide the appropriate functionality.
---
--- TEST DESCRIPTION:
--- This test simulates a user filter designed to capitalize the
--- characters of a string. It utilizes a variety of the subprograms
--- contained in the package Ada.Streams.Stream_IO.
--- Its purpose is to demonstrate the use of a variety of the capabilities
--- found in the Ada.Streams.Stream_IO package.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations capable of supporting
--- external Stream_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 14 Nov 95 SAIC Corrected visibility problems; corrected
--- subtest validating result from function Name
--- for ACVC 2.0.1.
--- 05 Oct 96 SAIC Removed calls to Close/Open in test and replaced
--- them with a single call to Reset (per AI95-0001)
--- 26 Feb 97 PWB.CTA Allowed for non-support of some IO operations.
--- 09 Feb 01 RLB Corrected non-support check to avoid unintended
--- failures.
---!
-
-package CXAC002_0 is
-
- -- This function searches for the first instance of a specified substring
- -- within a specified string, returning boolean result. (Case insensitive
- -- analysis)
-
- function Find (Str : in String; Sub : in String) return Boolean;
-
-end CXAC002_0;
-
-package body CXAC002_0 is
-
- function Find (Str : in String; Sub : in String) return Boolean is
-
- New_Str : String(Str'First..Str'Last);
- New_Sub : String(Sub'First..Sub'Last);
- Pos : Integer := Str'First; -- Character index.
-
- function Upper_Case (Str : in String) return String is
- subtype Upper is Character range 'A'..'Z';
- subtype Lower is Character range 'a'..'z';
- Ret : String(Str'First..Str'Last);
- Pos : Integer;
- begin
- for I in Str'Range loop
- if (Str(I) in Lower) then
- Pos := Upper'Pos(Upper'First) +
- (Lower'Pos(Str(I)) - Lower'Pos(Lower'First));
- Ret(I) := Upper'Val(Pos);
- else
- Ret(I) := Str (I);
- end if;
- end loop;
- return Ret;
- end Upper_Case;
-
- begin
-
- New_Str := Upper_Case(Str); -- Convert Str and Sub to upper
- New_Sub := Upper_Case(Sub); -- case for comparison.
-
- while (Pos <= New_Str'Last-New_Sub'Length+1) -- Search until no more
- and then -- sub-string-length
- (New_Str(Pos..Pos+New_Sub'Length-1) /= New_Sub) -- slices remain.
- loop
- Pos := Pos + 1;
- end loop;
-
- if (Pos > New_Str'Last-New_Sub'Length+1) then -- Substring not found.
- return False;
- else
- return True;
- end if;
-
- end Find;
-
-end CXAC002_0;
-
-
-with Ada.Streams.Stream_IO, CXAC002_0, Report;
-procedure CXAC002 is
- Filter_File : Ada.Streams.Stream_IO.File_Type;
- Filter_Stream : Ada.Streams.Stream_IO.Stream_Access;
- Filter_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAC002" );
- Incomplete : Exception;
-
-begin
-
- Report.Test ("CXAC002", "Check that the subprograms defined in " &
- "package Ada.Streams.Stream_IO are accessible, " &
- "and that they provide the appropriate " &
- "functionality");
-
- Test_for_Stream_IO_Support:
-
- begin
-
- -- If an implementation does not support Stream_IO in a particular
- -- environment, the exception Use_Error or Name_Error will be raised on
- -- calls to various Stream_IO operations. This block statement
- -- encloses a call to Create, which should produce an exception in a
- -- non-supportive environment. These exceptions will be handled to
- -- produce a Not_Applicable result.
-
- Ada.Streams.Stream_IO.Create (Filter_File, -- Create.
- Ada.Streams.Stream_IO.Out_File,
- Filter_Filename);
- exception
-
- when Ada.Streams.Stream_IO.Use_Error | Ada.Streams.Stream_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Stream_IO" );
- raise Incomplete;
-
- end Test_for_Stream_IO_Support;
-
- Operational_Test_Block:
- declare
-
- use CXAC002_0;
- use type Ada.Streams.Stream_IO.File_Mode;
- use type Ada.Streams.Stream_IO.Count;
-
- File_Size : Ada.Streams.Stream_IO.Count := -- Count.
- Ada.Streams.Stream_IO.Count'First; -- (0)
- File_Index : Ada.Streams.Stream_IO.Positive_Count := -- Pos. Count.
- Ada.Streams.Stream_IO.Positive_Count'First; -- (1)
-
- First_String : constant String := "this is going to be ";
- Second_String : constant String := "the best year of your life";
- Total_Length : constant Natural := First_String'Length +
- Second_String'Length;
- Current_Char : Character := ' ';
-
- Cap_String : String (1..Total_Length) := (others => ' ');
-
- TC_Capital_String : constant String :=
- "THIS IS GOING TO BE THE BEST YEAR OF YOUR LIFE";
-
- begin
-
- if not Ada.Streams.Stream_IO.Is_Open (Filter_File) then -- Is_Open
- Report.Failed ("File not open following Create");
- end if;
-
- -- Call function Find to determine if the filename (Sub) is contained
- -- in the result of Function Name.
-
- if not Find(Str => Ada.Streams.Stream_IO.Name(Filter_File), -- Name.
- Sub => Filter_Filename)
- then
- Report.Failed ("Function Name provided incorrect filename");
- end if;
- -- Stream.
- Filter_Stream := Ada.Streams.Stream_IO.Stream (Filter_File);
-
- ---
-
- Enter_Data_In_Stream:
- declare
- Pos : Natural := 1;
- Bad_Character_Found : Boolean := False;
- begin
-
- -- Enter data from the first string into the stream.
- while Pos <= Natural(First_String'Length) loop
- -- Write all characters of the First_String to the stream.
- Character'Write (Filter_Stream, First_String (Pos));
- Pos := Pos + 1;
- -- Ensure data put in file on a regular basis.
- if Pos mod 5 = 0 then
- Ada.Streams.Stream_IO.Flush (Filter_File); -- Flush.
- end if;
- end loop;
-
- Ada.Streams.Stream_IO.Flush (Filter_File); -- Flush.
- -- Reset to In_File mode and read stream contents.
- Reset1:
- begin
- Ada.Streams.Stream_IO.Reset (Filter_File, -- Reset.
- Ada.Streams.Stream_IO.In_File);
- exception
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Stream_IO" );
- raise Incomplete;
- end Reset1;
-
- Pos := 1;
- while Pos <= First_String'Length loop
- -- Read one character from the stream.
- Character'Read (Filter_Stream, Current_Char); -- 'Read
- -- Verify character against the original string.
- if Current_Char /= First_String(Pos) then
- Bad_Character_Found := True;
- end if;
- Pos := Pos + 1;
- end loop;
-
- if Bad_Character_Found then
- Report.Failed ("Incorrect character read from stream");
- end if;
-
- -- Following user stream/string processing, the stream file is
- -- appended to as follows:
-
- Reset2:
- begin
- Ada.Streams.Stream_IO.Reset (Filter_File, -- Reset.
- Ada.Streams.Stream_IO.Append_File);
- exception
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Append_File not supported for Stream_IO" );
- raise Incomplete;
- end Reset2;
-
- if Ada.Streams.Stream_IO.Mode (Filter_File) /= -- Mode.
- Ada.Streams.Stream_IO.Append_File
- then
- Report.Failed ("Incorrect mode following Reset to Append");
- end if;
-
- Pos := 1;
- while Pos <= Natural(Second_String'Length) loop
- -- Write all characters of the Second_String to the stream.
- Character'Write (Filter_Stream, Second_String (Pos)); -- 'Write
- Pos := Pos + 1;
- end loop;
-
- Ada.Streams.Stream_IO.Flush (Filter_File); -- Flush.
-
- -- Record file statistics.
- File_Size := Ada.Streams.Stream_IO.Size (Filter_File); -- Size.
-
- Index_Might_Not_Be_Supported:
- begin
- File_Index := Ada.Streams.Stream_IO.Index (Filter_File); -- Index.
- exception
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable ( "Index not supported for Stream_IO" );
- raise Incomplete;
- end Index_Might_Not_Be_Supported;
-
- exception
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Exception in Enter_Data_In_Stream block");
- raise;
- end Enter_Data_In_Stream;
-
- ---
-
- Filter_Block:
- declare
- Pos : Positive := 1;
- Full_String : constant String := First_String & Second_String;
-
- function Capitalize (Char : Character) return Character is
- begin
- if Char /= ' ' then
- return Character'Val( Character'Pos(Char) -
- (Character'Pos('a') - Character'Pos('A')));
- else
- return Char;
- end if;
- end Capitalize;
-
- begin
-
- Reset3:
- begin
- Ada.Streams.Stream_IO.Reset (Filter_File, -- Reset.
- Ada.Streams.Stream_IO.In_File);
- exception
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Stream_IO" );
- raise Incomplete;
- end Reset3;
-
- if Ada.Streams.Stream_IO.Mode (Filter_File) /= -- Mode.
- Ada.Streams.Stream_IO.In_File
- then
- Report.Failed ("Incorrect mode following Reset to In_File");
- end if;
-
- if not Ada.Streams.Stream_IO.Is_Open (Filter_File) then -- Is_Open
- Report.Failed ( "Reset command did not leave file open" );
- end if;
-
- if Ada.Streams.Stream_IO.Size (Filter_File) /= -- Size.
- File_Size
- then
- Report.Failed ("Reset file is not correct size");
- end if;
-
- if Ada.Streams.Stream_IO.Index (Filter_File) /= 1 then -- Index.
- -- File position should have been reset to start of file.
- Report.Failed ("Index of file not set to 1 following Reset");
- end if;
-
- while Pos <= Full_String'Length loop
- -- Read one character from the stream.
- Character'Read (Filter_Stream, Current_Char); -- 'Read
- -- Verify character against the original string.
- if Current_Char /= Full_String(Pos) then
- Report.Failed ("Incorrect character read from stream");
- else
- -- Capitalize the characters read from the stream, and
- -- place them in a string variable.
- Cap_String(Pos) := Capitalize (Current_Char);
- end if;
- Pos := Pos + 1;
- end loop;
-
- -- File index should now be set to the position following the final
- -- character in the file (the same as the index value stored at
- -- the completion of the Enter_Data_In_Stream block).
- if Ada.Streams.Stream_IO.Index (Filter_File) /= -- Index.
- File_Index
- then
- Report.Failed ("Incorrect file index position");
- end if;
-
- -- The stream file should now be at EOF. -- EOF.
- if not Ada.Streams.Stream_IO.End_Of_File (Filter_File) then
- Report.Failed ("File not empty following filtering");
- end if;
-
- exception
-
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Exception in Filter_Block");
- raise;
- end Filter_Block;
-
- ---
-
- Verification_Block:
- begin
-
- -- Verify that the entire string was examined, and that the
- -- process of capitalizing the character data was successful.
- if Cap_String /= TC_Capital_String then
- Report.Failed ("Incorrect Capitalization");
- end if;
-
- exception
- when others =>
- Report.Failed ("Exception in Verification_Block");
- end Verification_Block;
-
-
- exception
-
- when Incomplete =>
- raise;
- when others =>
- Report.Failed ("Exception raised in Operational Test Block");
-
- end Operational_Test_Block;
-
- Deletion:
- begin
- if Ada.Streams.Stream_IO.Is_Open (Filter_File) then -- Is_Open.
- Ada.Streams.Stream_IO.Delete (Filter_File); -- Delete.
- else
- Ada.Streams.Stream_IO.Open (Filter_File, -- Open.
- Ada.Streams.Stream_IO.Out_File,
- Filter_Filename);
- Ada.Streams.Stream_IO.Delete (Filter_File); -- Delete.
- end if;
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Stream_IO" );
- end Deletion;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAC002;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxac003.a b/gcc/testsuite/ada/acats/tests/cxa/cxac003.a
deleted file mode 100644
index cc1e044d0a2..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxac003.a
+++ /dev/null
@@ -1,376 +0,0 @@
--- CXAC003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the correct exceptions are raised when improperly
--- manipulating stream file objects.
---
--- TEST DESCRIPTION:
--- This test is designed to focus on Stream_IO file manipulation
--- exceptions. Several potentially common user errors are examined in
--- the test:
---
--- A Status_Error should be raised whenever an attempt is made to perform
--- an operation on a file that is closed.
---
--- A Status_Error should be raised when an attempt is made to open a
--- stream file that is currently open.
---
--- A Mode_Error should be raised when attempting to read from (use the
--- 'Read attribute) on an Out_File or Append_Mode file.
---
--- A Mode_Error should be raised when checking for End Of File on a
--- file with mode Out_File or Append_Mode.
---
--- A Mode_Error should be raised when attempting to write to (use the
--- 'Output attribute) on a file with mode In_File.
---
--- A Name_Error should be raised when the string provided to the Name
--- parameter of an Open operation does not allow association of an
--- external file.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations capable of supporting
--- external Stream_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 25 Feb 97 PWB.CTA Allowed for non-support of some IO operations
--- 02 Mar 01 PHL Check that Ada.Streams.Stream_IO.Stream raises
--- Status_Error if the file is not open. (DR 8652/
--- 0056).
--- 15 Mar 01 RLB Readied for release.
---!
-
-with Ada.Streams.Stream_IO;
-with Report;
-
-procedure CXAC003 is
-
- Stream_File_Object : Ada.Streams.Stream_IO.File_Type;
- Stream_Access_Value : Ada.Streams.Stream_IO.Stream_Access;
- Stream_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAC003" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAC003", "Check that the correct exceptions are " &
- "raised when improperly manipulating stream " &
- "file objects");
-
- Test_for_Stream_IO_Support:
- begin
- -- If an implementation does not support Stream_IO in a particular
- -- environment, the exception Use_Error or Name_Error will be raised on
- -- calls to various Stream_IO operations. This block statement
- -- encloses a call to Create, which should produce an exception in a
- -- non-supportive environment. These exceptions will be handled to
- -- produce a Not_Applicable result.
-
- Ada.Streams.Stream_IO.Create (Stream_File_Object,
- Ada.Streams.Stream_IO.Out_File,
- Stream_Filename);
-
- exception
-
- when Ada.Streams.Stream_IO.Use_Error | Ada.Streams.Stream_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Stream_IO" );
- raise Incomplete;
-
- end Test_for_Stream_IO_Support;
-
- Operational_Test_Block:
- begin
- -- A potentially common error in a file processing environment
- -- is to attempt to perform an operation on a stream file that is
- -- not currently open. Status_Error should be raised in this case.
- Check_Status_Error:
- begin
- Ada.Streams.Stream_IO.Close (Stream_File_Object);
- -- Attempt to reset a file that is closed.
- Ada.Streams.Stream_IO.Reset (Stream_File_Object,
- Ada.Streams.Stream_IO.Out_File);
- Report.Failed ("Exception not raised on Reset of closed file");
- exception
- when Ada.Streams.Stream_IO.Status_Error =>
- null;
- when others =>
- Report.Failed ("Incorrect exception raised - 1");
- end Check_Status_Error;
-
- -- A similar error is to use Ada.Streams.Stream_IO.Stream
- -- to attempt to perform an operation on a stream file that is
- -- not currently open. Status_Error should be raised in this case.
- -- (Defect Report 8652/0046, as reflected in Technical Corrigendum 1.)
- Check_Status_Error2:
- begin
- -- Ensure that the file is not open.
- if Ada.Streams.Stream_Io.Is_Open (Stream_File_Object) then
- Ada.Streams.Stream_Io.Close (Stream_File_Object);
- end if;
- Stream_Access_Value :=
- Ada.Streams.Stream_Io.Stream (Stream_File_Object);
- Report.Failed ("Exception not raised on Stream of closed file");
- exception
- when Ada.Streams.Stream_Io.Status_Error =>
- null;
- when others =>
- Report.Failed ("Incorrect exception raised - 2");
- end Check_Status_Error2;
-
- -- Another potentially common error in a file processing environment
- -- is to attempt to Open a stream file that is currently open.
- -- Status_Error should be raised in this case.
- Check_Status_Error3:
- begin
- -- Ensure that the file is open.
- if not Ada.Streams.Stream_IO.Is_Open (Stream_File_Object) then
- Ada.Streams.Stream_IO.Open (Stream_File_Object,
- Ada.Streams.Stream_IO.In_File,
- Stream_Filename);
- end if;
- Ada.Streams.Stream_IO.Open (Stream_File_Object,
- Ada.Streams.Stream_IO.In_File,
- Stream_Filename);
- Report.Failed ("Exception not raised on Open of open file");
- exception
- when Ada.Streams.Stream_IO.Status_Error =>
- null;
- when others =>
- Report.Failed ("Incorrect exception raised - 3");
- end Check_Status_Error3;
-
- -- Another example of a potential error occurring in a file
- -- processing environment is to attempt to use the 'Read attribute
- -- on a stream file that is currently in Out_File or Append_File
- -- mode. Mode_Error should be raised in both of these cases.
- Check_Mode_Error:
- declare
- Int_Var : Integer := -10;
- begin
-
- Reset1:
- begin
- Ada.Streams.Stream_IO.Reset (Stream_File_Object,
- Ada.Streams.Stream_IO.Out_File);
- exception
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Out_File not supported for Stream_IO - 1" );
- raise Incomplete;
- end Reset1;
-
- Stream_Access_Value :=
- Ada.Streams.Stream_IO.Stream (Stream_File_Object);
- Integer'Write (Stream_Access_Value, Int_Var);
-
- -- File contains an integer value, but is of mode Out_File.
- Integer'Read (Stream_Access_Value, Int_Var);
- Report.Failed ("Exception not raised by 'Read of Out_File");
- exception
- when Incomplete =>
- raise;
- when Ada.Streams.Stream_IO.Mode_Error =>
- null;
- Try_Read:
- begin
- Reset2:
- begin
- Ada.Streams.Stream_IO.Reset
- (Stream_File_Object, Ada.Streams.Stream_IO.Append_File);
- exception
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Append_File not supported " &
- "for Stream_IO - 2" );
- raise Incomplete;
- end Reset2;
-
- Integer'Write (Stream_Access_Value, Int_Var);
- -- Attempt read from Append_File mode file.
- Integer'Read (Stream_Access_Value, Int_Var);
- Report.Failed
- ("Exception not raised by 'Read of Append file");
- exception
- when Incomplete =>
- null;
- when Ada.Streams.Stream_IO.Mode_Error =>
- null;
- when others =>
- Report.Failed ("Incorrect exception raised - 4b");
- end Try_Read;
-
- when others => Report.Failed ("Incorrect exception raised - 4a");
- end Check_Mode_Error;
-
- -- Another example of a this type of potential error is to attempt
- -- to check for End Of File on a stream file that is currently in
- -- Out_File or Append_File mode. Mode_Error should also be raised
- -- in both of these cases.
- Check_End_File:
- declare
- Test_Boolean : Boolean := False;
- begin
- Reset3:
- begin
- Ada.Streams.Stream_IO.Reset (Stream_File_Object,
- Ada.Streams.Stream_IO.Out_File);
- exception
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Out_File not supported for Stream_IO - 3" );
- raise Incomplete;
- end Reset3;
-
- Test_Boolean :=
- Ada.Streams.Stream_IO.End_Of_File (Stream_File_Object);
- Report.Failed ("Exception not raised by EOF on Out_File");
- exception
- when Incomplete =>
- null;
- when Ada.Streams.Stream_IO.Mode_Error =>
- null;
- EOF_For_Append_File:
- begin
- Reset4:
- begin
- Ada.Streams.Stream_IO.Reset
- (Stream_File_Object, Ada.Streams.Stream_IO.Append_File);
- exception
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to Append_File not supported " &
- "for Stream_IO - 4" );
- raise Incomplete;
- end Reset4;
-
- Test_Boolean :=
- Ada.Streams.Stream_IO.End_Of_File (Stream_File_Object);
- Report.Failed
- ("Exception not raised by EOF of Append file");
- exception
- when Incomplete =>
- raise;
- when Ada.Streams.Stream_IO.Mode_Error =>
- null;
- when others =>
- Report.Failed ("Incorrect exception raised - 5b");
- end EOF_For_Append_File;
-
- when others => Report.Failed ("Incorrect exception raised - 5a");
- end Check_End_File;
-
-
-
- -- In a similar situation to the above cases for attribute 'Read,
- -- an attempt to use the 'Output attribute on a stream file that
- -- is currently in In_File mode should result in Mode_Error being
- -- raised.
- Check_Output_Mode_Error:
- begin
- Reset5:
- begin
- Ada.Streams.Stream_IO.Reset (Stream_File_Object,
- Ada.Streams.Stream_IO.In_File);
- exception
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Stream_IO - 6" );
- raise Incomplete;
- end Reset5;
-
- Stream_Access_Value :=
- Ada.Streams.Stream_IO.Stream (Stream_File_Object);
- String'Output (Stream_Access_Value, "User-Oriented String");
- Report.Failed ("Exception not raised by 'Output to In_File");
- exception
- when Incomplete =>
- null;
- when Ada.Streams.Stream_IO.Mode_Error =>
- null;
- when others =>
- Report.Failed ("Incorrect exception raised - 6");
- end Check_Output_Mode_Error;
-
- -- Any case of attempting to Open a stream file with a string for
- -- the parameter Name that does not allow the identification of an
- -- external file will result in the exception Name_Error being
- -- raised.
- Check_Illegal_File_Name:
- begin
- if Ada.Streams.Stream_IO.Is_Open (Stream_File_Object) then
- Ada.Streams.Stream_IO.Close (Stream_File_Object);
- end if;
- -- No external file exists with this filename, allowing no
- -- association with an internal file object, resulting in the
- -- raising of the exception Name_Error.
- Ada.Streams.Stream_IO.Open(File => Stream_File_Object,
- Mode => Ada.Streams.Stream_IO.Out_File,
- Name => Report.Legal_File_Name(2));
- Report.Failed ("Exception not raised by bad filename on Open");
- exception
- when Ada.Streams.Stream_IO.Name_Error =>
- null;
- when others =>
- Report.Failed ("Incorrect exception raised - 7");
- end Check_Illegal_File_Name;
-
- exception
- when Incomplete =>
- null;
- when others =>
- Report.Failed ("Unexpected exception in Operational Test Block");
-
- end Operational_Test_Block;
-
- Deletion:
- begin
- if Ada.Streams.Stream_IO.Is_Open (Stream_File_Object) then
- Ada.Streams.Stream_IO.Delete (Stream_File_Object);
- else
- Ada.Streams.Stream_IO.Open (Stream_File_Object,
- Ada.Streams.Stream_IO.Out_File,
- Stream_Filename);
- Ada.Streams.Stream_IO.Delete (Stream_File_Object);
- end if;
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Stream_IO" );
- end Deletion;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAC003;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxac004.a b/gcc/testsuite/ada/acats/tests/cxa/cxac004.a
deleted file mode 100644
index 9cc88b93cfb..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxac004.a
+++ /dev/null
@@ -1,310 +0,0 @@
--- CXAC004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the Stream_Access type and Stream function found in package
--- Ada.Text_IO.Text_Streams allows a text file to be processed with the
--- functionality of streams.
---
--- TEST DESCRIPTION:
--- This test verifies that the package Ada.Text_IO.Text_Streams is
--- available and that the functionality it contains allows a text file to
--- be manipulated as a stream.
--- The test defines data objects of a variety of types that can be stored
--- in a text file. A text file and associated text stream are then
--- defined, and the 'Write attribute is used to enter the individual data
--- items into the text stream. Once all the individual data items have
--- been written to the stream, the 'Output attribute is used to write
--- arrays of these same data objects to the stream.
--- The text file is reset to serve as an input file, and the 'Read
--- attribute is used to extract the individual data items from the
--- stream. These items are then verified against the data originally
--- written to the stream. Finally, the 'Input attribute is used to
--- extract the data arrays from the stream. These arrays are then
--- verified against the original data written to the stream.
---
--- APPLICABILITY CRITERIA:
--- Applicable to implementations that support external text files.
---
--- CHANGE HISTORY:
--- 06 Jul 95 SAIC Initial prerelease version.
--- 26 Feb 97 PWB.CTA Allowed for non-support of some IO operations;
--- removed requirement for support of decimal types.
---!
-
-with Report;
-with Ada.Text_IO;
-with Ada.Text_IO.Text_Streams;
-with Ada.Characters.Latin_1;
-with Ada.Strings.Unbounded;
-
-procedure CXAC004 is
-
- Data_File : Ada.Text_IO.File_Type;
- Data_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXAC004" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXAC004", "Check that the Stream_Access type and Stream " &
- "function found in package " &
- "Ada.Text_IO.Text_Streams allows a text file to " &
- "be processed with the functionality of streams");
-
- Test_for_IO_Support:
- begin
-
- -- Check for Text_IO support in creating the data file. If the
- -- implementation does not support external files, Name_Error or
- -- Use_Error will be raised at the point of the following call to
- -- Create, resulting in a Not_Applicable test result.
-
- Ada.Text_IO.Create(Data_File, Ada.Text_IO.Out_File, Data_Filename);
-
- exception
-
- when Ada.Text_IO.Use_Error | Ada.Text_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Text_IO" );
- raise Incomplete;
-
- end Test_for_IO_Support;
-
- Test_Block:
- declare
- use Ada.Characters.Latin_1, Ada.Strings.Unbounded;
- TC_Items : constant := 3;
-
- -- Declare types and objects that will be used as data values to be
- -- written to and read from the text file/stream.
-
- type Enum_Type is (Red, Yellow, Green, Blue, Indigo);
- type Fixed_Type is delta 0.125 range 0.0..255.0;
- type Float_Type is digits 7 range 0.0..1.0E5;
- type Modular_Type is mod 256;
- subtype Str_Type is String(1..4);
-
- type Char_Array_Type is array (1..TC_Items) of Character;
- type Enum_Array_Type is array (1..TC_Items) of Enum_Type;
- type Fixed_Array_Type is array (1..TC_Items) of Fixed_Type;
- type Float_Array_Type is array (1..TC_Items) of Float_Type;
- type Int_Array_Type is array (1..TC_Items) of Integer;
- type Mod_Array_Type is array (1..TC_Items) of Modular_Type;
- type Str_Array_Type is array (1..TC_Items) of Str_Type;
- type Unb_Str_Array_Type is array (1..TC_Items) of Unbounded_String;
-
- Char_Array : Char_Array_Type := ('A', 'z', Yen_Sign);
- TC_Char_Array_1,
- TC_Char_Array_2 : Char_Array_Type := (others => Space);
-
- Enum_Array : Enum_Array_Type := (Blue, Yellow, Indigo);
- TC_Enum_Array_1,
- TC_Enum_Array_2 : Enum_Array_Type := (others => Red);
-
- Fix_Array : Fixed_Array_Type := (0.125, 123.5, 250.750);
- TC_Fix_Array_1,
- TC_Fix_Array_2 : Fixed_Array_Type := (others => 0.0);
-
- Flt_Array : Float_Array_Type := (1.0, 150.0, 1500.0);
- TC_Flt_Array_1,
- TC_Flt_Array_2 : Float_Array_Type := (others => 0.0);
-
- Int_Array : Int_Array_Type := (124, 2349, -24_001);
- TC_Int_Array_1,
- TC_Int_Array_2 : Int_Array_Type := (others => -99);
-
- Mod_Array : Mod_Array_Type := (10, 127, 255);
- TC_Mod_Array_1,
- TC_Mod_Array_2 : Mod_Array_Type := (others => 0);
-
- Str_Array : Str_Array_Type := ("abcd", "klmn", "wxyz");
- TC_Str_Array_1,
- TC_Str_Array_2 : Str_Array_Type := (others => " ");
-
- UStr_Array : Unb_Str_Array_Type :=
- (To_Unbounded_String("cat"),
- To_Unbounded_String("testing"),
- To_Unbounded_String("ACVC"));
- TC_UStr_Array_1,
- TC_UStr_Array_2 : Unb_Str_Array_Type :=
- (others => Null_Unbounded_String);
-
- -- Create a stream access object pointing to the data file.
-
- Data_Stream : Ada.Text_IO.Text_Streams.Stream_Access :=
- Ada.Text_IO.Text_Streams.Stream(File => Data_File);
-
- begin
-
- -- Use the 'Write attribute to enter the three sets of data items
- -- into the data stream.
- -- Note that the data will be mixed within the text file.
-
- for i in 1..TC_Items loop
- Character'Write (Data_Stream, Char_Array(i));
- Enum_Type'Write (Data_Stream, Enum_Array(i));
- Fixed_Type'Write (Data_Stream, Fix_Array(i));
- Float_Type'Write (Data_Stream, Flt_Array(i));
- Integer'Write (Data_Stream, Int_Array(i));
- Modular_Type'Write (Data_Stream, Mod_Array(i));
- Str_Type'Write (Data_Stream, Str_Array(i));
- Unbounded_String'Write(Data_Stream, UStr_Array(i));
- end loop;
-
- -- Use the 'Output attribute to enter the entire arrays of each
- -- type of data items into the data stream.
- -- Note that the array bounds will be written to the stream as part
- -- of the action of the 'Output attribute.
-
- Char_Array_Type'Output (Data_Stream, Char_Array);
- Enum_Array_Type'Output (Data_Stream, Enum_Array);
- Fixed_Array_Type'Output (Data_Stream, Fix_Array);
- Float_Array_Type'Output (Data_Stream, Flt_Array);
- Int_Array_Type'Output (Data_Stream, Int_Array);
- Mod_Array_Type'Output (Data_Stream, Mod_Array);
- Str_Array_Type'Output (Data_Stream, Str_Array);
- Unb_Str_Array_Type'Output (Data_Stream, UStr_Array);
-
- -- Reset the data file to mode In_File. The data file will now serve
- -- as the source of data which will be compared to the original data
- -- written to the file above.
- Reset1:
- begin
- Ada.Text_IO.Reset (File => Data_File, Mode => Ada.Text_IO.In_File);
- exception
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Text_IO" );
- raise Incomplete;
- end Reset1;
-
- -- Extract and validate all the single data items from the stream.
-
- for i in 1..TC_Items loop
- Character'Read (Data_Stream, TC_Char_Array_1(i));
- Enum_Type'Read (Data_Stream, TC_Enum_Array_1(i));
- Fixed_Type'Read (Data_Stream, TC_Fix_Array_1(i));
- Float_Type'Read (Data_Stream, TC_Flt_Array_1(i));
- Integer'Read (Data_Stream, TC_Int_Array_1(i));
- Modular_Type'Read (Data_Stream, TC_Mod_Array_1(i));
- Str_Type'Read (Data_Stream, TC_Str_Array_1(i));
- Unbounded_String'Read (Data_Stream, TC_UStr_Array_1(i));
- end loop;
-
- if TC_Char_Array_1 /= Char_Array then
- Report.Failed("Character values do not match");
- end if;
- if TC_Enum_Array_1 /= Enum_Array then
- Report.Failed("Enumeration values do not match");
- end if;
- if TC_Fix_Array_1 /= Fix_Array then
- Report.Failed("Fixed point values do not match");
- end if;
- if TC_Flt_Array_1 /= Flt_Array then
- Report.Failed("Floating point values do not match");
- end if;
- if TC_Int_Array_1 /= Int_Array then
- Report.Failed("Integer values do not match");
- end if;
- if TC_Mod_Array_1 /= Mod_Array then
- Report.Failed("Modular values do not match");
- end if;
- if TC_Str_Array_1 /= Str_Array then
- Report.Failed("String values do not match");
- end if;
- if TC_UStr_Array_1 /= UStr_Array then
- Report.Failed("Unbounded_String values do not match");
- end if;
-
- -- Extract and validate all data arrays from the data stream.
- -- Note that the 'Input attribute denotes a function, whereas the
- -- other stream oriented attributes in this test denote procedures.
-
- TC_Char_Array_2 := Char_Array_Type'Input(Data_Stream);
- TC_Enum_Array_2 := Enum_Array_Type'Input(Data_Stream);
- TC_Fix_Array_2 := Fixed_Array_Type'Input(Data_Stream);
- TC_Flt_Array_2 := Float_Array_Type'Input(Data_Stream);
- TC_Int_Array_2 := Int_Array_Type'Input(Data_Stream);
- TC_Mod_Array_2 := Mod_Array_Type'Input(Data_Stream);
- TC_Str_Array_2 := Str_Array_Type'Input(Data_Stream);
- TC_UStr_Array_2 := Unb_Str_Array_Type'Input(Data_Stream);
-
- if TC_Char_Array_2 /= Char_Array then
- Report.Failed("Character array values do not match");
- end if;
- if TC_Enum_Array_2 /= Enum_Array then
- Report.Failed("Enumeration array values do not match");
- end if;
- if TC_Fix_Array_2 /= Fix_Array then
- Report.Failed("Fixed point array values do not match");
- end if;
- if TC_Flt_Array_2 /= Flt_Array then
- Report.Failed("Floating point array values do not match");
- end if;
- if TC_Int_Array_2 /= Int_Array then
- Report.Failed("Integer array values do not match");
- end if;
- if TC_Mod_Array_2 /= Mod_Array then
- Report.Failed("Modular array values do not match");
- end if;
- if TC_Str_Array_2 /= Str_Array then
- Report.Failed("String array values do not match");
- end if;
- if TC_UStr_Array_2 /= UStr_Array then
- Report.Failed("Unbounded_String array values do not match");
- end if;
-
- exception
- when Incomplete =>
- raise;
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Deletion:
- begin
- -- Delete the data file.
- if not Ada.Text_IO.Is_Open(Data_File) then
- Ada.Text_IO.Open(Data_File, Ada.Text_IO.In_File, Data_Filename);
- end if;
- Ada.Text_IO.Delete(Data_File);
-
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Text_IO" );
-
- end Deletion;
-
- Report.Result;
-
-exception
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXAC004;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxac005.a b/gcc/testsuite/ada/acats/tests/cxa/cxac005.a
deleted file mode 100644
index 34a971f7a51..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxac005.a
+++ /dev/null
@@ -1,343 +0,0 @@
--- CXAC005.A
---
--- Grant of Unlimited Rights
---
--- The Ada Conformity Assessment Authority (ACAA) holds unlimited
--- rights in the software and documentation contained herein. Unlimited
--- rights are the same as those granted by the U.S. Government for older
--- parts of the Ada Conformity Assessment Test Suite, and are defined
--- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
--- intends to confer upon all recipients unlimited rights equal to those
--- held by the ACAA. These rights include rights to use, duplicate,
--- release or disclose the released technical data and computer software
--- in whole or in part, in any manner and for any purpose whatsoever, and
--- to have or permit others to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that stream file positioning work as specified. (Defect Report
--- 8652/0055).
---
--- CHANGE HISTORY:
--- 12 FEB 2001 PHL Initial version.
--- 14 MAR 2001 RLB Readied for release; fixed Not_Applicable check
--- to terminate test gracefully.
---
---!
-with Ada.Streams.Stream_Io;
-use Ada.Streams;
-with Ada.Exceptions;
-use Ada.Exceptions;
-with Report;
-use Report;
-procedure CXAC005 is
-
- Incomplete : exception;
-
- procedure TC_Assert (Condition : Boolean; Message : String) is
- begin
- if not Condition then
- Failed (Message);
- end if;
- end TC_Assert;
-
- package Checked_Stream_Io is
-
- type File_Type (Max_Size : Stream_Element_Count) is limited private;
- function Stream_Io_File (File : File_Type) return Stream_Io.File_Type;
-
- procedure Create (File : in out File_Type;
- Mode : in Stream_Io.File_Mode := Stream_Io.Out_File;
- Name : in String := "";
- Form : in String := "");
-
- procedure Open (File : in out File_Type;
- Mode : in Stream_Io.File_Mode;
- Name : in String;
- Form : in String := "");
-
- procedure Close (File : in out File_Type);
- procedure Delete (File : in out File_Type);
-
- procedure Reset (File : in out File_Type;
- Mode : in Stream_Io.File_Mode);
- procedure Reset (File : in out File_Type);
-
- procedure Read (File : in out File_Type;
- Item : out Stream_Element_Array;
- Last : out Stream_Element_Offset;
- From : in Stream_Io.Positive_Count);
-
- procedure Read (File : in out File_Type;
- Item : out Stream_Element_Array;
- Last : out Stream_Element_Offset);
-
- procedure Write (File : in out File_Type;
- Item : in Stream_Element_Array;
- To : in Stream_Io.Positive_Count);
-
- procedure Write (File : in out File_Type;
- Item : in Stream_Element_Array);
-
- procedure Set_Index (File : in out File_Type;
- To : in Stream_Io.Positive_Count);
-
- function Index (File : in File_Type) return Stream_Io.Positive_Count;
-
- procedure Set_Mode (File : in out File_Type;
- Mode : in Stream_Io.File_Mode);
-
- private
- type File_Type (Max_Size : Stream_Element_Count) is
- record
- File : Stream_Io.File_Type;
- Index : Stream_Io.Positive_Count;
- Contents :
- Stream_Element_Array
- (Stream_Element_Offset (Ident_Int (1)) .. Max_Size);
- end record;
- end Checked_Stream_Io;
-
- package body Checked_Stream_Io is
-
- use Stream_Io;
-
- function Stream_Io_File (File : File_Type) return Stream_Io.File_Type is
- begin
- return File.File;
- end Stream_Io_File;
-
- procedure Create (File : in out File_Type;
- Mode : in Stream_Io.File_Mode := Stream_Io.Out_File;
- Name : in String := "";
- Form : in String := "") is
- begin
- Stream_Io.Create (File.File, Mode, Name, Form);
- File.Index := Stream_Io.Index (File.File);
- if Mode = Append_File then
- TC_Assert (File.Index = Stream_Io.Size (File.File) + 1,
- "Index /= Size + 1 -- Create - Append_File");
- else
- TC_Assert (File.Index = 1, "Index /= 1 -- Create - " &
- File_Mode'Image (Mode));
- end if;
- end Create;
-
- procedure Open (File : in out File_Type;
- Mode : in Stream_Io.File_Mode;
- Name : in String;
- Form : in String := "") is
- begin
- Stream_Io.Open (File.File, Mode, Name, Form);
- File.Index := Stream_Io.Index (File.File);
- if Mode = Append_File then
- TC_Assert (File.Index = Stream_Io.Size (File.File) + 1,
- "Index /= Size + 1 -- Open - Append_File");
- else
- TC_Assert (File.Index = 1, "Index /= 1 -- Open - " &
- File_Mode'Image (Mode));
- end if;
- end Open;
-
- procedure Close (File : in out File_Type) is
- begin
- Stream_Io.Close (File.File);
- end Close;
-
- procedure Delete (File : in out File_Type) is
- begin
- Stream_Io.Delete (File.File);
- end Delete;
-
- procedure Reset (File : in out File_Type;
- Mode : in Stream_Io.File_Mode) is
- begin
- Stream_Io.Reset (File.File, Mode);
- File.Index := Stream_Io.Index (File.File);
- if Mode = Append_File then
- TC_Assert (File.Index = Stream_Io.Size (File.File) + 1,
- "Index /= Size + 1 -- Reset - Append_File");
- else
- TC_Assert (File.Index = 1, "Index /= 1 -- Reset - " &
- File_Mode'Image (Mode));
- end if;
- end Reset;
-
- procedure Reset (File : in out File_Type) is
- begin
- Reset (File, Stream_Io.Mode (File.File));
- end Reset;
-
-
- procedure Read (File : in out File_Type;
- Item : out Stream_Element_Array;
- Last : out Stream_Element_Offset;
- From : in Stream_Io.Positive_Count) is
- begin
- Set_Index (File, From);
- Read (File, Item, Last);
- end Read;
-
- procedure Read (File : in out File_Type;
- Item : out Stream_Element_Array;
- Last : out Stream_Element_Offset) is
- Index : constant Stream_Element_Offset :=
- Stream_Element_Offset (File.Index);
- begin
- Stream_Io.Read (File.File, Item, Last);
- if Last < Item'Last then
- TC_Assert (Item (Item'First .. Last) =
- File.Contents (Index .. Index + Last - Item'First),
- "Incorrect data read from file - 1");
- TC_Assert (Count (Index + Last - Item'First) =
- Stream_Io.Size (File.File),
- "Read stopped before end of file");
- File.Index := Count (Index + Last - Item'First) + 1;
- else
- TC_Assert (Item = File.Contents (Index .. Index + Item'Length - 1),
- "Incorrect data read from file - 2");
- File.Index := File.Index + Item'Length;
- end if;
- end Read;
-
- procedure Write (File : in out File_Type;
- Item : in Stream_Element_Array;
- To : in Stream_Io.Positive_Count) is
- begin
- Set_Index (File, To);
- Write (File, Item);
- end Write;
-
- procedure Write (File : in out File_Type;
- Item : in Stream_Element_Array) is
- Index : constant Stream_Element_Offset :=
- Stream_Element_Offset (File.Index);
- begin
- Stream_Io.Write (File.File, Item);
- File.Contents (Index .. Index + Item'Length - 1) := Item;
- File.Index := File.Index + Item'Length;
- TC_Assert (File.Index = Stream_Io.Index (File.File),
- "Write failed to move the index");
- end Write;
-
- procedure Set_Index (File : in out File_Type;
- To : in Stream_Io.Positive_Count) is
- begin
- Stream_Io.Set_Index (File.File, To);
- File.Index := Stream_Io.Index (File.File);
- TC_Assert (File.Index = To, "Set_Index failed");
- end Set_Index;
-
- function Index (File : in File_Type) return Stream_Io.Positive_Count is
- New_Index : constant Count := Stream_Io.Index (File.File);
- begin
- TC_Assert (New_Index = File.Index, "Index changed unexpectedly");
- return New_Index;
- end Index;
-
- procedure Set_Mode (File : in out File_Type;
- Mode : in Stream_Io.File_Mode) is
- Old_Index : constant Count := File.Index;
- begin
- Stream_Io.Set_Mode (File.File, Mode);
- File.Index := Stream_Io.Index (File.File);
- if Mode = Append_File then
- TC_Assert (File.Index = Stream_Io.Size (File.File) + 1,
- "Index /= Size + 1 -- Set_Mode - Append_File");
- else
- TC_Assert (File.Index = Old_Index, "Set_Mode changed the index");
- end if;
- end Set_Mode;
-
- end Checked_Stream_Io;
-
- package Csio renames Checked_Stream_Io;
-
- F : Csio.File_Type (100);
- S : Stream_Element_Array (1 .. 10);
- Last : Stream_Element_Offset;
-
-begin
-
- Test ("CXAC005", "Check that stream file positioning work as specified");
-
- declare
- Name : constant String := Legal_File_Name;
- begin
- begin
- Csio.Create (F, Name => Name);
- exception
- when others =>
- Not_Applicable ("Files not supported - Creation with Out_File for Stream_IO");
- raise Incomplete;
- end;
-
- for I in Stream_Element range 1 .. 10 loop
- Csio.Write (F, ((1 => I + 2)));
- end loop;
- Csio.Write (F, (1 .. 15 => 11));
- Csio.Write (F, (1 .. 15 => 12), To => 15);
-
- Csio.Reset (F);
-
- for I in Stream_Element range 1 .. 10 loop
- Csio.Write (F, (1 => I));
- end loop;
- Csio.Write (F, (1 .. 15 => 13));
- Csio.Write (F, (1 .. 15 => 14), To => 15);
- Csio.Write (F, (1 => 90));
-
- Csio.Set_Mode (F, Stream_Io.In_File);
-
- Csio.Read (F, S, Last);
- Csio.Read (F, S, Last, From => 3);
- Csio.Read (F, S, Last, From => 28);
-
- Csio.Set_Mode (F, Stream_Io.Append_File);
- Csio.Write (F, (1 .. 5 => 88));
-
- Csio.Close (F);
-
- Csio.Open (F, Name => Name, Mode => Stream_Io.Append_File);
- Csio.Write (F, (1 .. 3 => 33));
-
- Csio.Set_Mode (F, Stream_Io.In_File);
- Csio.Read (F, S, Last, From => 20);
- Csio.Read (F, S, Last);
- Csio.Reset (F, Stream_Io.Out_File);
-
- Csio.Write (F, (1 .. 9 => 99));
-
- -- Check the contents of the entire file.
- declare
- S : Stream_Element_Array
- (1 .. Stream_Element_Offset
- (Stream_Io.Size (Csio.Stream_Io_File (F))));
- begin
- Csio.Reset (F, Stream_Io.In_File);
- Csio.Read (F, S, Last);
- end;
-
- Csio.Delete (F);
- end;
-
- Result;
-exception
- when Incomplete =>
- Report.Result;
- when E:others =>
- Report.Failed ("Unexpected exception raised - " & Exception_Name (E) &
- " - " & Exception_Message (E));
- Report.Result;
-
-end CXAC005;
-
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaca01.a b/gcc/testsuite/ada/acats/tests/cxa/cxaca01.a
deleted file mode 100644
index cda8776a53d..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaca01.a
+++ /dev/null
@@ -1,291 +0,0 @@
--- CXACA01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the default attributes 'Write and 'Read work properly when
--- used with objects of a variety of types, including records with
--- default discriminants, records without default discriminants, but
--- which have the discriminant described in a representation clause for
--- the type, and arrays.
---
--- TEST DESCRIPTION:
--- This test simulates a basic sales record system, using Stream_IO to
--- allow the storage of heterogeneous data in a single stream file.
---
--- Four types of data are written to the stream file for each product.
--- First, the "header" information on the product is written.
--- This is an object of a discriminated (with default) record
--- type. This is followed by an integer object containing a count of
--- the number of sales data records to follow. The corresponding number
--- of sales records follow in the stream. These are of a record type
--- with a discriminant without a default, but where the discriminant is
--- included in the representation clause for the type. Finally, an
--- array object with statistical sales information for the product is
--- written to the stream.
---
--- Objects of both record types specified below (discriminated records
--- with defaults, and discriminated records w/o defaults that have the
--- discriminant included in a representation clause for the type) should
--- have their discriminants included in the stream when using 'Write.
--- Likewise, discriminants should be extracted from the stream when
--- using 'Read.
---
--- APPLICABILITY CRITERIA:
--- Applicable to all implementations that support external
--- Stream_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FXACA00;
-with Ada.Streams.Stream_IO;
-with Report;
-
-procedure CXACA01 is
-
-begin
-
- Report.Test ("CXACA01", "Check that 'Write and 'Read work properly " &
- "when used with complex data types");
-
- Test_for_Stream_IO_Support:
- declare
-
- Info_File : Ada.Streams.Stream_IO.File_Type;
- Info_Stream : Ada.Streams.Stream_IO.Stream_Access;
- The_Filename : constant String := Report.Legal_File_Name;
-
- begin
-
- -- If an implementation does not support Stream_IO in a particular
- -- environment, the exception Use_Error or Name_Error will be raised on
- -- calls to various Stream_IO operations. This block statement
- -- encloses a call to Create, which should produce an exception in a
- -- non-supportive environment. These exceptions will be handled to
- -- produce a Not_Applicable result.
-
- Ada.Streams.Stream_IO.Create (Info_File,
- Ada.Streams.Stream_IO.Out_File,
- The_Filename);
-
- Operational_Test_Block:
- declare
-
- begin
-
- Info_Stream := Ada.Streams.Stream_IO.Stream (Info_File);
-
- -- Write all of the product information (record, integer, and array
- -- objects) defined in package FXACA00 into the stream.
-
- Store_Data_Block:
- begin
-
- -- Write information about first product to the stream.
- FXACA00.Product_Type'Write (Info_Stream, FXACA00.Product_01);
- Integer'Write (Info_Stream, FXACA00.Sale_Count_01);
- FXACA00.Sales_Record_Type'Write(Info_Stream, FXACA00.Sale_Rec_01);
- FXACA00.Sales_Record_Type'Write(Info_Stream, FXACA00.Sale_Rec_02);
- FXACA00.Sales_Statistics_Type'Write
- (Info_Stream, FXACA00.Product_01_Stats);
-
- -- Write information about second product to the stream.
- -- Note: No Sales_Record_Type objects.
- FXACA00.Product_Type'Write (Info_Stream, FXACA00.Product_02);
- Integer'Write (Info_Stream, FXACA00.Sale_Count_02);
- FXACA00.Sales_Statistics_Type'Write
- (Info_Stream, FXACA00.Product_02_Stats);
-
- -- Write information about third product to the stream.
- FXACA00.Product_Type'Write (Info_Stream, FXACA00.Product_03);
- Integer'Write (Info_Stream, FXACA00.Sale_Count_03);
- FXACA00.Sales_Record_Type'Write(Info_Stream, FXACA00.Sale_Rec_03);
- FXACA00.Sales_Record_Type'Write(Info_Stream, FXACA00.Sale_Rec_04);
- FXACA00.Sales_Record_Type'Write(Info_Stream, FXACA00.Sale_Rec_05);
- FXACA00.Sales_Statistics_Type'Write
- (Info_Stream, FXACA00.Product_03_Stats);
-
- end Store_Data_Block;
-
-
- Verify_Data_Block:
- declare
-
- use FXACA00; -- Used within this block only.
-
- type Domestic_Rec_Array_Type is
- array (Positive range <>) of Sales_Record_Type (Domestic);
-
- type Foreign_Rec_Array_Type is
- array (Positive range <>) of Sales_Record_Type (Foreign);
-
- TC_Rec1 : Domestic_Rec_Array_Type (1..2);
- TC_Rec3 : Foreign_Rec_Array_Type (1..3);
-
- TC_Product1 : Product_Type;
- TC_Product2,
- TC_Product3 : Product_Type (Foreign);
-
- TC_Count1,
- TC_Count2,
- TC_Count3 : Integer := -10; -- Initialized to dummy value.
-
- TC_Stat1,
- TC_Stat2,
- TC_Stat3 : Sales_Statistics_Type := (others => 500);
-
- begin
-
- Ada.Streams.Stream_IO.Reset (Info_File,
- Ada.Streams.Stream_IO.In_File);
-
- -- Read all of the data that is contained in the stream.
- -- Compare all data with the original data in package FXACA00
- -- that was written to the stream.
- -- The calls to the read attribute are in anticipated order, based
- -- on the order of data written to the stream. Possible errors,
- -- such as data placement, overwriting, etc., will be manifest as
- -- exceptions raised by the attribute during an unsuccessful read
- -- attempt.
-
- -- Extract data on first product.
- Product_Type'Read (Info_Stream, TC_Product1);
- Integer'Read (Info_Stream, TC_Count1);
-
- -- Two "domestic" variant sales records will be read from the
- -- stream.
- for i in 1 .. TC_Count1 loop
- Sales_Record_Type'Read (Info_Stream, TC_Rec1(i) );
- end loop;
-
- Sales_Statistics_Type'Read (Info_Stream, TC_Stat1);
-
-
- -- Extract data on second product.
- Product_Type'Read (Info_Stream, TC_Product2);
- Integer'Read (Info_Stream, TC_Count2);
- Sales_Statistics_Type'Read (Info_Stream, TC_Stat2);
-
-
- -- Extract data on third product.
- Product_Type'Read (Info_Stream, TC_Product3);
- Integer'Read (Info_Stream, TC_Count3);
-
- -- Three "foreign" variant sales records will be read from the
- -- stream.
- for i in 1 .. TC_Count3 loop
- Sales_Record_Type'Read (Info_Stream, TC_Rec3(i) );
- end loop;
-
- Sales_Statistics_Type'Read (Info_Stream, TC_Stat3);
-
-
- -- After all the data has been correctly extracted, the file
- -- should be empty.
-
- if not Ada.Streams.Stream_IO.End_Of_File (Info_File) then
- Report.Failed ("Stream file not empty");
- end if;
-
- -- Verify that the data values read from the stream are the same
- -- as those written to the stream.
-
- -- Verify the information of the first product.
- if ((Product_01 /= TC_Product1) or else
- (Product_01.Manufacture /= TC_Product1.Manufacture) or else
- (Sale_Count_01 /= TC_Count1) or else
- (Sale_Rec_01 /= TC_Rec1(1)) or else
- (Sale_Rec_01.Buyer /= TC_Rec1(1).Buyer) or else
- (Sale_Rec_02 /= TC_Rec1(2)) or else
- (Sale_Rec_02.Buyer /= TC_Rec1(2).Buyer) or else
- (Product_01_Stats /= TC_Stat1))
- then
- Report.Failed ("Product 1 information incorrect");
- end if;
-
- -- Verify the information of the second product.
- if not ((Product_02 = TC_Product2) and then
- (Sale_Count_02 = TC_Count2) and then
- (Product_02_Stats = TC_Stat2))
- then
- Report.Failed ("Product 2 information incorrect");
- end if;
-
- -- Verify the information of the third product.
- if ((Product_03 /= TC_Product3) or else
- (Product_03.Manufacture /= TC_Product3.Manufacture) or else
- (Sale_Count_03 /= TC_Count3) or else
- (Sale_Rec_03 /= TC_Rec3(1)) or else
- (Sale_Rec_03.Buyer /= TC_Rec3(1).Buyer) or else
- (Sale_Rec_04 /= TC_Rec3(2)) or else
- (Sale_Rec_04.Buyer /= TC_Rec3(2).Buyer) or else
- (Sale_Rec_05 /= TC_Rec3(3)) or else
- (Sale_Rec_05.Buyer /= TC_Rec3(3).Buyer) or else
- (Product_03_Stats /= TC_Stat3))
- then
- Report.Failed ("Product 3 information incorrect");
- end if;
-
- end Verify_Data_Block;
-
- exception
-
- when others =>
- Report.Failed ("Exception raised in Operational Test Block");
-
- end Operational_Test_Block;
-
- if Ada.Streams.Stream_IO.Is_Open (Info_File) then
- Ada.Streams.Stream_IO.Delete (Info_File);
- else
- Ada.Streams.Stream_IO.Open (Info_File,
- Ada.Streams.Stream_IO.In_File,
- The_Filename);
- Ada.Streams.Stream_IO.Delete (Info_File);
- end if;
-
- exception
-
- -- Since Use_Error or Name_Error can be raised if, for the specified
- -- mode, the environment does not support Stream_IO operations,
- -- the following handlers are included:
-
- when Ada.Streams.Stream_IO.Name_Error =>
- Report.Not_Applicable ("Name_Error raised on Stream IO Create");
-
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable ("Use_Error raised on Stream IO Create");
-
- when others =>
- Report.Failed ("Unexpected exception raised on Stream IO Create");
-
- end Test_for_Stream_IO_Support;
-
- Report.Result;
-
-end CXACA01;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaca02.a b/gcc/testsuite/ada/acats/tests/cxa/cxaca02.a
deleted file mode 100644
index 5106dd3991d..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaca02.a
+++ /dev/null
@@ -1,360 +0,0 @@
--- CXACA02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that user defined subprograms can override the default
--- attributes 'Read and 'Write using attribute definition clauses.
--- Use objects of record types.
---
--- TEST DESCRIPTION:
--- This test demonstrates that the default implementations of the
--- 'Read and 'Write attributes can be overridden by user specified
--- subprograms in conjunction with attribute definition clauses.
--- These attributes have been overridden below, and in the user defined
--- substitutes, values are added or subtracted to global variables.
--- The global variables are evaluated to ensure that the user defined
--- subprograms were used in overriding the type-related default
--- attributes.
---
--- APPLICABILITY CRITERIA:
--- Applicable to all implementations that support external
--- Stream_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 21 Nov 95 SAIC Corrected recursive attribute definitions
--- for ACVC 2.0.1.
--- 24 Aug 96 SAIC Corrected typo in test verification criteria.
---
---!
-
-with Report;
-with Ada.Streams.Stream_IO;
-
-procedure CXACA02 is
-begin
-
- Report.Test ("CXACA02", "Check that user defined subprograms can " &
- "override the default attributes 'Read and " &
- "'Write using attribute definition clauses");
-
- Test_for_Stream_IO_Support:
- declare
-
- Data_File : Ada.Streams.Stream_IO.File_Type;
- Data_Stream : Ada.Streams.Stream_IO.Stream_Access;
- The_Filename : constant String := Report.Legal_File_Name;
-
- begin
-
- -- If an implementation does not support Stream_IO in a particular
- -- environment, the exception Use_Error or Name_Error will be raised on
- -- calls to various Stream_IO operations. This block statement
- -- encloses a call to Create, which should produce an exception in a
- -- non-supportive environment. These exceptions will be handled to
- -- produce a Not_Applicable result.
-
- Ada.Streams.Stream_IO.Create (Data_File,
- Ada.Streams.Stream_IO.Out_File,
- The_Filename);
-
- Operational_Test_Block:
- declare
-
- type Origin_Type is (Foreign, Domestic);
- subtype String_Data_Type is String(1..8);
-
- type Product_Type is
- record
- Item : String_Data_Type;
- ID : Natural range 1..100;
- Manufacture : Origin_Type := Domestic;
- Distributor : String_Data_Type;
- Importer : String_Data_Type;
- end record;
-
- type Sales_Record_Type is
- record
- Name : String_Data_Type;
- Sale_Item : Boolean := False;
- Buyer : Origin_Type;
- Quantity_Discount : Boolean;
- Cash_Discount : Boolean;
- end record;
-
-
- -- Mode conformant, user defined subprograms that will override
- -- the type-related attributes.
- -- In this test, the user defines these subprograms to add/subtract
- -- specific values from global variables.
-
- procedure Product_Read
- ( Stream : access Ada.Streams.Root_Stream_Type'Class;
- The_Item : out Product_Type );
-
- procedure Product_Write
- ( Stream : access Ada.Streams.Root_Stream_Type'Class;
- The_Item : Product_Type );
-
- procedure Sales_Read
- ( Stream : access Ada.Streams.Root_Stream_Type'Class;
- The_Item : out Sales_Record_Type );
-
- procedure Sales_Write
- ( Stream : access Ada.Streams.Root_Stream_Type'Class;
- The_Item : Sales_Record_Type );
-
- -- Attribute definition clauses.
-
- for Product_Type'Read use Product_Read;
- for Product_Type'Write use Product_Write;
-
- for Sales_Record_Type'Read use Sales_Read;
- for Sales_Record_Type'Write use Sales_Write;
-
-
- -- Object Declarations
-
- Product_01 : Product_Type :=
- ("Product1", 1, Domestic, "Distrib1", "Import 1");
- Product_02 : Product_Type :=
- ("Product2", 2, Foreign, "Distrib2", "Import 2");
-
- Sale_Rec_01 : Sales_Record_Type :=
- ("Buyer 01", False, Domestic, True, True);
- Sale_Rec_02 : Sales_Record_Type :=
- ("Buyer 02", True, Domestic, True, False);
- Sale_Rec_03 : Sales_Record_Type := (Name => "Buyer 03",
- Sale_Item => True,
- Buyer => Foreign,
- Quantity_Discount => False,
- Cash_Discount => True);
- Sale_Rec_04 : Sales_Record_Type :=
- ("Buyer 04", True, Foreign, False, False);
- Sale_Rec_05 : Sales_Record_Type :=
- ("Buyer 05", False, Foreign, False, False);
-
- TC_Read_Total : Integer := 100;
- TC_Write_Total : Integer := 0;
-
-
- -- Subprogram bodies.
- -- These subprograms are designed to override the default attributes
- -- 'Read and 'Write for the specified types. Each adds/subtracts
- -- a quantity to/from a program control variable, indicating its
- -- activity. In addition, each component of the record is
- -- individually read from or written to the stream, using the
- -- appropriate 'Read or 'Write attribute for the component type.
- -- The string components are moved to/from the stream using the
- -- 'Input and 'Output attributes for the string subtype, so that
- -- the bounds of the strings are also written/read.
-
- procedure Product_Read
- ( Stream : access Ada.Streams.Root_Stream_Type'Class;
- The_Item : out Product_Type ) is
- begin
- TC_Read_Total := TC_Read_Total - 10;
-
- The_Item.Item := String_Data_Type'Input(Data_Stream); -- Field 1.
- Natural'Read(Data_Stream, The_Item.ID); -- Field 2.
- Origin_Type'Read(Data_Stream, -- Field 3.
- The_Item.Manufacture);
- The_Item.Distributor := -- Field 4.
- String_Data_Type'Input(Data_Stream);
- The_Item.Importer := -- Field 5.
- String_Data_Type'Input(Data_Stream);
- end Product_Read;
-
-
- procedure Product_Write
- ( Stream : access Ada.Streams.Root_Stream_Type'Class;
- The_Item : Product_Type ) is
- begin
- TC_Write_Total := TC_Write_Total + 5;
-
- String_Data_Type'Output(Data_Stream, The_Item.Item); -- Field 1.
- Natural'Write(Data_Stream, The_Item.ID); -- Field 2.
- Origin_Type'Write(Data_Stream, -- Field 3.
- The_Item.Manufacture);
- String_Data_Type'Output(Data_Stream, -- Field 4.
- The_Item.Distributor);
- String_Data_Type'Output(Data_Stream, -- Field 5.
- The_Item.Importer);
- end Product_Write;
-
-
- procedure Sales_Read
- ( Stream : access Ada.Streams.Root_Stream_Type'Class;
- The_Item : out Sales_Record_Type ) is
- begin
- TC_Read_Total := TC_Read_Total - 20;
-
- The_Item.Name := String_Data_Type'Input(Data_Stream); -- Field 1.
- Boolean'Read(Data_Stream, The_Item.Sale_Item); -- Field 2.
- Origin_Type'Read(Data_Stream, The_Item.Buyer); -- Field 3.
- Boolean'Read(Data_Stream, The_Item.Quantity_Discount); -- Field 4.
- Boolean'Read(Data_Stream, The_Item.Cash_Discount); -- Field 5.
- end Sales_Read;
-
-
- procedure Sales_Write
- ( Stream : access Ada.Streams.Root_Stream_Type'Class;
- The_Item : Sales_Record_Type ) is
- begin
- TC_Write_Total := TC_Write_Total + 10;
-
- String_Data_Type'Output(Data_Stream, The_Item.Name); -- Field 1.
- Boolean'Write(Data_Stream, The_Item.Sale_Item); -- Field 2.
- Origin_Type'Write(Data_Stream, The_Item.Buyer); -- Field 3.
- Boolean'Write(Data_Stream, The_Item.Quantity_Discount); -- Field 4.
- Boolean'Write(Data_Stream, The_Item.Cash_Discount); -- Field 5.
- end Sales_Write;
-
-
-
- begin
-
- Data_Stream := Ada.Streams.Stream_IO.Stream (Data_File);
-
- -- Write product and sales data to the stream.
-
- Product_Type'Write (Data_Stream, Product_01);
- Sales_Record_Type'Write (Data_Stream, Sale_Rec_01);
- Sales_Record_Type'Write (Data_Stream, Sale_Rec_02);
-
- Product_Type'Write (Data_Stream, Product_02);
- Sales_Record_Type'Write (Data_Stream, Sale_Rec_03);
- Sales_Record_Type'Write (Data_Stream, Sale_Rec_04);
- Sales_Record_Type'Write (Data_Stream, Sale_Rec_05);
-
- -- Read data from the stream, and verify the use of the user specified
- -- attributes.
-
- Verify_Data_Block:
- declare
-
- TC_Product1,
- TC_Product2 : Product_Type;
-
- TC_Sale1,
- TC_Sale2,
- TC_Sale3,
- TC_Sale4,
- TC_Sale5 : Sales_Record_Type;
-
- begin
-
- -- Reset the mode of the stream file so that Read/Input
- -- operations may be performed.
-
- Ada.Streams.Stream_IO.Reset (Data_File,
- Ada.Streams.Stream_IO.In_File);
-
- -- Data is read/reconstructed from the stream, in the order that
- -- the data was placed into the stream.
-
- Product_Type'Read (Data_Stream, TC_Product1);
- Sales_Record_Type'Read (Data_Stream, TC_Sale1);
- Sales_Record_Type'Read (Data_Stream, TC_Sale2);
-
- Product_Type'Read (Data_Stream, TC_Product2);
- Sales_Record_Type'Read (Data_Stream, TC_Sale3);
- Sales_Record_Type'Read (Data_Stream, TC_Sale4);
- Sales_Record_Type'Read (Data_Stream, TC_Sale5);
-
- -- Verify product data was correctly written to/read from stream.
-
- if TC_Product1 /= Product_01 then
- Report.Failed ("Data verification error, Product 1");
- end if;
- if TC_Product2 /= Product_02 then
- Report.Failed ("Data verification error, Product 2");
- end if;
-
- if TC_Sale1 /= Sale_Rec_01 then
- Report.Failed ("Data verification error, Sale_Rec_01");
- end if;
- if TC_Sale2 /= Sale_Rec_02 then
- Report.Failed ("Data verification error, Sale_Rec_02");
- end if;
- if TC_Sale3 /= Sale_Rec_03 then
- Report.Failed ("Data verification error, Sale_Rec_03");
- end if;
- if TC_Sale4 /= Sale_Rec_04 then
- Report.Failed ("Data verification error, Sale_Rec_04");
- end if;
- if TC_Sale5 /= Sale_Rec_05 then
- Report.Failed ("Data verification error, Sale_Rec_05");
- end if;
-
- -- Verify that the user defined subprograms were used to
- -- override the default 'Read and 'Write attributes.
- -- There were two "product" reads and two writes; there
- -- were five "sale record" reads and five writes.
-
- if (TC_Read_Total /= -20) or (TC_Write_Total /= 60) then
- Report.Failed ("Incorrect use of user defined attributes");
- end if;
-
- end Verify_Data_Block;
-
- exception
-
- when others =>
- Report.Failed ("Exception raised in Operational Test Block");
-
- end Operational_Test_Block;
-
- if Ada.Streams.Stream_IO.Is_Open (Data_File) then
- Ada.Streams.Stream_IO.Delete (Data_File);
- else
- Ada.Streams.Stream_IO.Open (Data_File,
- Ada.Streams.Stream_IO.Out_File,
- The_Filename);
- Ada.Streams.Stream_IO.Delete (Data_File);
- end if;
-
-
- exception
-
- -- Since Use_Error or Name_Error can be raised if, for the specified
- -- mode, the environment does not support Stream_IO operations,
- -- the following handlers are included:
-
- when Ada.Streams.Stream_IO.Name_Error =>
- Report.Not_Applicable ("Name_Error raised on Stream IO Create");
-
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable ("Use_Error raised on Stream IO Create");
-
- when others =>
- Report.Failed ("Unexpected exception raised");
-
- end Test_for_Stream_IO_Support;
-
- Report.Result;
-
-end CXACA02;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxacb01.a b/gcc/testsuite/ada/acats/tests/cxa/cxacb01.a
deleted file mode 100644
index ac4a905e830..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxacb01.a
+++ /dev/null
@@ -1,264 +0,0 @@
--- CXACB01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the default attributes 'Input and 'Output work properly when
--- used with objects of a variety of types, including two-dimensional
--- arrays and records without default discriminants.
---
--- TEST DESCRIPTION:
--- This test simulates utility company service record storage, using
--- Stream_IO to allow the storage of heterogeneous data in a single
--- stream file.
---
--- Three types of data are written to the stream file for each utility
--- service customer.
--- First, the general information on the customer is written.
--- This is an object of a discriminated (without default) record
--- type. This is followed by an integer object containing a count of
--- the number of service months for the customer. Finally, a
--- two-dimensional array object with monthly consumption information for
--- the customer is written to the stream.
---
--- Objects of record types with discriminants without defaults should
--- have their discriminants included in the stream when using 'Output.
--- Likewise, discriminants should be extracted
--- from the stream when using 'Input. Similarly, array bounds are written
--- to and read from the stream when using 'Output and 'Input with array
--- objects.
---
--- APPLICABILITY CRITERIA:
--- Applicable to all implementations that support external
--- Stream_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FXACB00;
-with Ada.Streams.Stream_IO;
-with Report;
-
-procedure CXACB01 is
-begin
-
- Report.Test ("CXACB01", "Check that the default attributes 'Input and " &
- "'Output work properly when used with objects " &
- "of record, natural, and array types" );
-
- Test_for_Stream_IO_Support:
- declare
-
- Util_File : Ada.Streams.Stream_IO.File_Type;
- Util_Stream : Ada.Streams.Stream_IO.Stream_Access;
- Utility_Service_Filename : constant String := Report.Legal_File_Name;
-
- begin
-
- -- If an implementation does not support Stream_IO in a particular
- -- environment, the exception Use_Error or Name_Error will be raised on
- -- calls to various Stream_IO operations. This block statement
- -- encloses a call to Create, which should produce an exception in a
- -- non-supportive environment. These exceptions will be handled to
- -- produce a Not_Applicable result.
-
- Ada.Streams.Stream_IO.Create (Util_File,
- Ada.Streams.Stream_IO.Out_File,
- Utility_Service_Filename);
-
- Operational_Test_Block:
- declare
-
- -- The following procedure will store all of the customer specific
- -- information into the stream.
-
- procedure Store_Data_In_Stream
- (Customer : in FXACB00.Service_Type;
- Months : in FXACB00.Months_In_Service_Type;
- History : in FXACB00.Service_History_Type) is
- begin
- FXACB00.Service_Type'Output (Util_Stream, Customer);
- FXACB00.Months_In_Service_Type'Output (Util_Stream, Months);
- FXACB00.Service_History_Type'Output (Util_Stream, History);
- end Store_Data_In_Stream;
-
-
- -- The following procedure will remove from the stream all of the
- -- customer related information.
-
- procedure Retrieve_Data_From_Stream
- (Customer : out FXACB00.Service_Type;
- Months : out FXACB00.Months_In_Service_Type;
- History : out FXACB00.Service_History_Type) is
- begin
- Customer := FXACB00.Service_Type'Input (Util_Stream);
- Months := FXACB00.Months_In_Service_Type'Input (Util_Stream);
- History := FXACB00.Service_History_Type'Input (Util_Stream);
- end Retrieve_Data_From_Stream;
-
-
- begin
-
- Util_Stream := Ada.Streams.Stream_IO.Stream (Util_File);
-
- -- Write all of the customer service information (record, numeric,
- -- and array objects) defined in package FXACB00 into the stream.
-
- Data_Storage_Block:
- begin
-
- Store_Data_In_Stream (Customer => FXACB00.Customer1,
- Months => FXACB00.C1_Months,
- History => FXACB00.C1_Service_History);
-
- Store_Data_In_Stream (FXACB00.Customer2,
- FXACB00.C2_Months,
- History => FXACB00.C2_Service_History);
-
- Store_Data_In_Stream (Months => FXACB00.C3_Months,
- History => FXACB00.C3_Service_History,
- Customer => FXACB00.Customer3);
- end Data_Storage_Block;
-
-
- Data_Verification_Block:
- declare
-
- TC_Residence : FXACB00.Service_Type (FXACB00.Residence);
- TC_Apartment : FXACB00.Service_Type (FXACB00.Apartment);
- TC_Commercial : FXACB00.Service_Type (FXACB00.Commercial);
-
-
- TC_Months1,
- TC_Months2,
- TC_Months3 : FXACB00.Months_In_Service_Type :=
- FXACB00.Months_In_Service_Type'First;
-
-
- TC_History1 :
- FXACB00.Service_History_Type (FXACB00.Quarterly_Period_Type,
- FXACB00.Month_In_Quarter_Type) :=
- (others => (others => FXACB00.Electric_Usage_Type'Last));
-
- TC_History2 :
- FXACB00.Service_History_Type
- (FXACB00.Quarterly_Period_Type range
- FXACB00.Spring .. FXACB00.Summer,
- FXACB00.Month_In_Quarter_Type) :=
- (others => (others => FXACB00.Electric_Usage_Type'Last));
-
- TC_History3 :
- FXACB00.Service_History_Type (FXACB00.Quarterly_Period_Type,
- FXACB00.Month_In_Quarter_Type) :=
- (others => (others => FXACB00.Electric_Usage_Type'Last));
-
- begin
-
- Ada.Streams.Stream_IO.Reset (Util_File,
- Ada.Streams.Stream_IO.In_File);
-
- -- Input all of the data that is contained in the stream.
- -- Compare all data with the original data in package FXACB00
- -- that was written to the stream.
-
- Retrieve_Data_From_Stream (TC_Residence, TC_Months1, TC_History1);
- Retrieve_Data_From_Stream (TC_Apartment, TC_Months2, TC_History2);
- Retrieve_Data_From_Stream (Customer => TC_Commercial,
- Months => TC_Months3,
- History => TC_History3);
-
- -- After all the data has been correctly extracted, the file
- -- should be empty.
-
- if not Ada.Streams.Stream_IO.End_Of_File (Util_File) then
- Report.Failed ("Stream file not empty");
- end if;
-
- -- Verify that the data values read from the stream are the same
- -- as those written to the stream.
-
- if ((FXACB00."/="(FXACB00.Customer1, TC_Residence)) or else
- (FXACB00."/="(FXACB00.Customer2, TC_Apartment)) or else
- (FXACB00."/="(FXACB00.Customer3, TC_Commercial)))
- then
- Report.Failed ("Customer information incorrect");
- end if;
-
- if ((FXACB00."/="(FXACB00.C1_Months, TC_Months1)) or
- (FXACB00."/="(FXACB00.C2_Months, TC_Months2)) or
- (FXACB00."/="(FXACB00.C3_Months, TC_Months3)))
- then
- Report.Failed ("Number of Months information incorrect");
- end if;
-
- if not ((FXACB00."="(FXACB00.C1_Service_History, TC_History1)) and
- (FXACB00."="(FXACB00.C2_Service_History, TC_History2)) and
- (FXACB00."="(FXACB00.C3_Service_History, TC_History3)))
- then
- Report.Failed ("Service history information incorrect");
- end if;
-
- end Data_Verification_Block;
-
- exception
-
- when others =>
- Report.Failed ("Exception raised in Operational Test Block");
-
- end Operational_Test_Block;
-
- -- Delete the file.
- if Ada.Streams.Stream_IO.Is_Open (Util_File) then
- Ada.Streams.Stream_IO.Delete (Util_File);
- else
- Ada.Streams.Stream_IO.Open (Util_File,
- Ada.Streams.Stream_IO.Out_File,
- Utility_Service_Filename);
- Ada.Streams.Stream_IO.Delete (Util_File);
- end if;
-
-
- exception
-
- -- Since Use_Error or Name_Error can be raised if, for the specified
- -- mode, the environment does not support Stream_IO operations,
- -- the following handlers are included:
-
- when Ada.Streams.Stream_IO.Name_Error =>
- Report.Not_Applicable ("Name_Error raised on Stream IO Create");
-
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable ("Use_Error raised on Stream IO Create");
-
- when others =>
- Report.Failed ("Unexpected exception raised");
-
- end Test_for_Stream_IO_Support;
-
- Report.Result;
-
-end CXACB01;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxacb02.a b/gcc/testsuite/ada/acats/tests/cxa/cxacb02.a
deleted file mode 100644
index a0ade9ebe1c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxacb02.a
+++ /dev/null
@@ -1,421 +0,0 @@
--- CXACB02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that user defined subprograms can override the default
--- attributes 'Input and 'Output using attribute definition clauses,
--- when used with objects of discriminated record and multi-dimensional
--- array types.
---
--- TEST DESCRIPTION:
--- This test demonstrates that the default implementations of the
--- 'Input and 'Output attributes can be overridden by user specified
--- subprograms in conjunction with attribute definition clauses.
--- These attributes have been overridden below, and in the user defined
--- substitutes, values are added or subtracted to global variables.
--- Following the completion of the writing/reading test, the global
--- variables are evaluated to ensure that the user defined subprograms
--- were used in overriding the type-related default attributes.
---
--- APPLICABILITY CRITERIA:
--- Applicable to all implementations that support external
--- Stream_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 14 Nov 95 SAIC Corrected test errors for ACVC 2.0.1.
---
---!
-
-with Report;
-with Ada.Streams.Stream_IO;
-
-procedure CXACB02 is
-begin
-
- Report.Test ("CXACB02", "Check that user defined subprograms can " &
- "override the default attributes 'Input and " &
- "'Output using attribute definition clauses");
-
- Test_for_Stream_IO_Support:
- declare
-
- Util_File : Ada.Streams.Stream_IO.File_Type;
- Util_Stream : Ada.Streams.Stream_IO.Stream_Access;
- Utility_Filename : constant String := Report.Legal_File_Name;
-
- begin
-
- -- If an implementation does not support Stream_IO in a particular
- -- environment, the exception Use_Error or Name_Error will be raised on
- -- calls to various Stream_IO operations. This block statement
- -- encloses a call to Create, which should produce an exception in a
- -- non-supportive environment. These exceptions will be handled to
- -- produce a Not_Applicable result.
-
- Ada.Streams.Stream_IO.Create (Util_File,
- Ada.Streams.Stream_IO.Out_File,
- Utility_Filename);
-
- Operational_Test_Block:
- declare
-
- type Customer_Type is (Residence, Apartment, Commercial);
- type Electric_Usage_Type is range 0..100000;
- type Months_In_Service_Type is range 1..12;
- type Quarterly_Period_Type is (Spring, Summer, Autumn, Winter);
- subtype Month_In_Quarter_Type is Positive range 1..3;
- type Service_History_Type is
- array (Quarterly_Period_Type range <>,
- Month_In_Quarter_Type range <>) of Electric_Usage_Type;
-
- type Service_Type (Customer : Customer_Type) is
- record
- Name : String (1..21);
- Account_ID : Natural range 0..100;
- case Customer is
- when Residence | Apartment =>
- Low_Income_Credit : Boolean := False;
- when Commercial =>
- Baseline_Allowance : Natural range 0..1000;
- Quantity_Discount : Boolean := False;
- end case;
- end record;
-
-
- -- Mode conformant, user defined subprograms that will override
- -- the type-related attributes.
- -- In this test, the user defines these subprograms to add/subtract
- -- specific values from global variables.
-
- function Service_Input
- (Stream : access Ada.Streams.Root_Stream_Type'Class)
- return Service_Type;
-
- procedure Service_Output
- (Stream : access Ada.Streams.Root_Stream_Type'Class;
- Item : Service_Type);
-
- function History_Input
- (Stream : access Ada.Streams.Root_Stream_Type'Class)
- return Service_History_Type;
-
- procedure History_Output
- (Stream : access Ada.Streams.Root_Stream_Type'Class;
- Item : Service_History_Type);
-
-
- -- Attribute definition clauses.
-
- for Service_Type'Input use Service_Input;
- for Service_Type'Output use Service_Output;
-
- for Service_History_Type'Input use History_Input;
- for Service_History_Type'Output use History_Output;
-
-
- -- Object Declarations
-
- Customer1 : Service_Type (Residence) :=
- (Residence, "1221 Morningstar Lane", 44, False);
- Customer2 : Service_Type (Apartment) :=
- (Customer => Apartment,
- Account_ID => 67,
- Name => "15 South Front St. #8",
- Low_Income_Credit => True);
- Customer3 : Service_Type (Commercial) :=
- (Commercial,
- "12442 Central Avenue ",
- 100,
- Baseline_Allowance => 938,
- Quantity_Discount => True);
-
- C1_Service_History :
- Service_History_Type (Quarterly_Period_Type,
- Month_In_Quarter_Type) :=
- (Spring => (1 => 35, 2 => 39, 3 => 32),
- Summer => (1 => 34, 2 => 33, 3 => 39),
- Autumn => (1 => 45, 2 => 40, 3 => 38),
- Winter => (1 => 53, 2 => 0, 3 => 0));
-
- C2_Service_History :
- Service_History_Type (Quarterly_Period_Type range Spring..Summer,
- Month_In_Quarter_Type) :=
- (Spring => (23, 22, 0), Summer => (0, 0, 0));
-
- C3_Service_History :
- Service_History_Type (Quarterly_Period_Type,
- Month_In_Quarter_Type) :=
- (others => (others => 200));
-
-
- TC_Input_Total : Integer := 0;
- TC_Output_Total : Integer := 0;
-
-
- -- Subprogram bodies.
- -- These subprograms are designed to override the default attributes
- -- 'Input and 'Output for the specified types. Each adds/subtracts
- -- a quantity to/from a program control variable, indicating its
- -- activity. Each user defined "Input" function uses the 'Read
- -- attribute for the type to accomplish the operation. Likewise,
- -- each user defined "Output" subprogram uses the 'Write attribute
- -- for the type.
-
- function Service_Input
- ( Stream : access Ada.Streams.Root_Stream_Type'Class )
- return Service_Type is
- Customer : Customer_Type;
- begin
- TC_Input_Total := TC_Input_Total + 1;
-
- -- Extract the discriminant value from the stream.
- -- This discriminant would not otherwise be extracted from the
- -- stream when the Service_Type'Read attribute is used below.
- Customer_Type'Read (Stream, Customer);
-
- declare
- -- Declare a constant of Service_Type, using the value just
- -- read from the stream as the discriminant value of the
- -- object.
- Service : Service_Type(Customer);
- begin
- Service_Type'Read (Stream, Service);
- return Service;
- end;
- end Service_Input;
-
-
- procedure Service_Output
- ( Stream : access Ada.Streams.Root_Stream_Type'Class;
- Item : Service_Type ) is
- begin
- TC_Output_Total := TC_Output_Total + 2;
- -- Write the discriminant value to the stream.
- -- The attribute 'Write (for the record type) will not write the
- -- discriminant of the record object to the stream. Therefore, it
- -- must be explicitly written using the 'Write attribute of the
- -- discriminant type.
- Customer_Type'Write (Stream, Item.Customer);
- -- Write the record component values (but not the discriminant) to
- -- the stream.
- Service_Type'Write (Stream, Item);
- end Service_Output;
-
-
- function History_Input
- ( Stream : access Ada.Streams.Root_Stream_Type'Class )
- return Service_History_Type is
- Quarter_Bound_Low : Quarterly_Period_Type;
- Quarter_Bound_High : Quarterly_Period_Type;
- Month_Bound_Low : Month_In_Quarter_Type;
- Month_Bound_High : Month_In_Quarter_Type;
- begin
- TC_Input_Total := TC_Input_Total + 3;
-
- -- Read the value of the array bounds from the stream.
- -- Use these bounds in the creation of an array object that will
- -- be used to store data from the stream.
- -- The array bound values would not otherwise be read from the
- -- stream by use of the Service_History_Type'Read attribute.
- Quarterly_Period_Type'Read (Stream, Quarter_Bound_Low);
- Quarterly_Period_Type'Read (Stream, Quarter_Bound_High);
- Month_In_Quarter_Type'Read (Stream, Month_Bound_Low);
- Month_In_Quarter_Type'Read (Stream, Month_Bound_High);
-
- declare
- Service_History_Array :
- Service_History_Type
- (Quarterly_Period_Type range
- Quarter_Bound_Low..Quarter_Bound_High,
- Month_In_Quarter_Type range
- Month_Bound_Low .. Month_Bound_High);
- begin
- Service_History_Type'Read (Stream, Service_History_Array);
- return Service_History_Array;
- end;
- end History_Input;
-
-
- procedure History_Output
- ( Stream : access Ada.Streams.Root_Stream_Type'Class;
- Item : Service_History_Type ) is
- begin
- TC_Output_Total := TC_Output_Total + 7;
- -- Write the upper/lower bounds of the array object dimensions to
- -- the stream.
- Quarterly_Period_Type'Write (Stream, Item'First(1));
- Quarterly_Period_Type'Write (Stream, Item'Last(1));
- Month_In_Quarter_Type'Write (Stream, Item'First(2));
- Month_In_Quarter_Type'Write (Stream, Item'Last(2));
- -- Write the array values to the stream in canonical order (last
- -- dimension varying fastest).
- Service_History_Type'Write (Stream, Item);
- end History_Output;
-
-
-
- begin
-
- Util_Stream := Ada.Streams.Stream_IO.Stream (Util_File);
-
- -- Write data to the stream. A customer service record is followed
- -- by a service history array.
-
- Service_Type'Output (Util_Stream, Customer1);
- Service_History_Type'Output (Util_Stream, C1_Service_History);
-
- Service_Type'Output (Util_Stream, Customer2);
- Service_History_Type'Output (Util_Stream, C2_Service_History);
-
- Service_Type'Output (Util_Stream, Customer3);
- Service_History_Type'Output (Util_Stream, C3_Service_History);
-
-
- -- Read data from the stream, and verify the use of the user specified
- -- attributes.
-
- Verify_Data_Block:
- declare
-
- TC_Residence : Service_Type (Residence);
- TC_Apartment : Service_Type (Apartment);
- TC_Commercial : Service_Type (Commercial);
-
- TC_History1 : Service_History_Type (Quarterly_Period_Type,
- Month_In_Quarter_Type) :=
- (others => (others => Electric_Usage_Type'First));
-
- TC_History2 : Service_History_Type (Quarterly_Period_Type
- range Spring .. Summer,
- Month_In_Quarter_Type) :=
- (others => (others => Electric_Usage_Type'First));
-
- TC_History3 : Service_History_Type (Quarterly_Period_Type,
- Month_In_Quarter_Type) :=
- (others => (others => Electric_Usage_Type'First));
-
- begin
-
- -- Reset Stream file to mode In_File.
-
- Ada.Streams.Stream_IO.Reset (Util_File,
- Ada.Streams.Stream_IO.In_File);
-
- -- Read data from the stream.
-
- TC_Residence := Service_Type'Input (Util_Stream);
- TC_History1 := Service_History_Type'Input (Util_Stream);
-
- TC_Apartment := Service_Type'Input (Util_Stream);
- TC_History2 := Service_History_Type'Input (Util_Stream);
-
- TC_Commercial := Service_Type'Input (Util_Stream);
- TC_History3 := Service_History_Type'Input (Util_Stream);
-
-
- -- Verify product data was correctly written to/read from stream,
- -- including discriminants and array bounds.
-
- if (TC_Residence /= Customer1) or
- (TC_Residence.Customer /= Customer1.Customer) or
- (TC_History1'Last(1) /= C1_Service_History'Last(1)) or
- (TC_History1'First(1) /= C1_Service_History'First(1)) or
- (TC_History1'Last(2) /= C1_Service_History'Last(2)) or
- (TC_History1'First(2) /= C1_Service_History'First(2))
- then
- Report.Failed ("Incorrect data from stream - 1");
- end if;
-
- if (TC_Apartment /= Customer2) or
- (TC_Apartment.Customer /= Customer2.Customer) or
- (TC_History2 /= C2_Service_History) or
- (TC_History2'Last(1) /= C2_Service_History'Last(1)) or
- (TC_History2'First(1) /= C2_Service_History'First(1)) or
- (TC_History2'Last(2) /= C2_Service_History'Last(2)) or
- (TC_History2'First(2) /= C2_Service_History'First(2))
- then
- Report.Failed ("Incorrect data from stream - 2");
- end if;
-
- if (TC_Commercial /= Customer3) or
- (TC_Commercial.Customer /= Customer3.Customer) or
- (TC_History3 /= C3_Service_History) or
- (TC_History3'Last(1) /= C3_Service_History'Last(1)) or
- (TC_History3'First(1) /= C3_Service_History'First(1)) or
- (TC_History3'Last(2) /= C3_Service_History'Last(2)) or
- (TC_History3'First(2) /= C3_Service_History'First(2))
- then
- Report.Failed ("Incorrect data from stream - 3");
- end if;
-
- -- Verify that the user defined subprograms were used to override
- -- the default 'Input and 'Output attributes.
- -- There were three calls on each of the user defined attributes.
-
- if (TC_Input_Total /= 12 ) or (TC_Output_Total /= 27 ) then
- Report.Failed ("Incorrect use of user defined attributes");
- end if;
-
- end Verify_Data_Block;
-
- exception
-
- when others =>
- Report.Failed ("Exception raised in Operational Test Block");
-
- end Operational_Test_Block;
-
- if Ada.Streams.Stream_IO.Is_Open (Util_File) then
- Ada.Streams.Stream_IO.Delete (Util_File);
- else
- Ada.Streams.Stream_IO.Open (Util_File,
- Ada.Streams.Stream_IO.Out_File,
- Utility_Filename);
- Ada.Streams.Stream_IO.Delete (Util_File);
- end if;
-
-
- exception
-
- -- Since Use_Error or Name_Error can be raised if, for the specified
- -- mode, the environment does not support Stream_IO operations,
- -- the following handlers are included:
-
- when Ada.Streams.Stream_IO.Name_Error =>
- Report.Not_Applicable ("Name_Error raised on Stream IO Create");
-
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable ("Use_Error raised on Stream IO Create");
-
- when others =>
- Report.Failed ("Unexpected exception raised");
-
- end Test_for_Stream_IO_Support;
-
- Report.Result;
-
-end CXACB02;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxacc01.a b/gcc/testsuite/ada/acats/tests/cxa/cxacc01.a
deleted file mode 100644
index 3ab88f40e6d..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxacc01.a
+++ /dev/null
@@ -1,299 +0,0 @@
--- CXACC01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the use of 'Class'Output and 'Class'Input allow stream
--- manipulation of objects of non-limited class-wide types.
---
--- TEST DESCRIPTION:
--- This test demonstrates the uses of 'Class'Output and 'Class'Input
--- in moving objects of a particular class to and from a stream file.
--- A procedure uses a class-wide parameter to move objects of specific
--- types in the class to the stream, using the 'Class'Output attribute
--- of the root type of the class. A function returns a class-wide object,
--- using the 'Class'Input attribute of the root type of the class to
--- extract the object from the stream.
--- A field-by-field comparison of record objects is performed to validate
--- the data read from the stream. Operator precedence rules are used
--- in the comparison rather than parentheses.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations capable of supporting
--- external Stream_IO files.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 14 Nov 95 SAIC Corrected prefix of 'Tag attribute for ACVC 2.0.1.
--- 24 Aug 96 SAIC Changed a call to "Create" to "Reset".
--- 26 Feb 97 CTA.PWB Allowed for non-support of some IO operations.
---!
-
-with FXACC00, Ada.Streams.Stream_IO, Ada.Tags, Report;
-
-procedure CXACC01 is
-
- Order_File : Ada.Streams.Stream_IO.File_Type;
- Order_Stream : Ada.Streams.Stream_IO.Stream_Access;
- Order_Filename : constant String :=
- Report.Legal_File_Name ( Nam => "CXACC01" );
- Incomplete : exception;
-
-begin
-
- Report.Test ("CXACC01", "Check that the use of 'Class'Output " &
- "and 'Class'Input allow stream manipulation " &
- "of objects of non-limited class-wide types");
-
- Test_for_Stream_IO_Support:
- begin
-
- -- If an implementation does not support Stream_IO in a particular
- -- environment, the exception Use_Error or Name_Error will be raised on
- -- calls to various Stream_IO operations. This block statement
- -- encloses a call to Create, which should produce an exception in a
- -- non-supportive environment. These exceptions will be handled to
- -- produce a Not_Applicable result.
-
- Ada.Streams.Stream_IO.Create (Order_File,
- Ada.Streams.Stream_IO.Out_File,
- Order_Filename);
-
- exception
-
- when Ada.Streams.Stream_IO.Use_Error | Ada.Streams.Stream_IO.Name_Error =>
- Report.Not_Applicable
- ( "Files not supported - Create as Out_File for Stream_IO" );
- raise Incomplete;
-
- end Test_for_Stream_IO_Support;
-
- Operational_Test_Block:
- declare
-
- -- Store tag values associated with objects of tagged types.
-
- TC_Box_Office_Tag : constant String :=
- Ada.Tags.External_Tag(FXACC00.Ticket_Request'Tag);
-
- TC_Summer_Tag : constant String :=
- Ada.Tags.External_Tag(FXACC00.Subscriber_Request'Tag);
-
- TC_Mayoral_Tag : constant String :=
- Ada.Tags.External_Tag(FXACC00.VIP_Request'Tag);
-
- TC_Late_Tag : constant String :=
- Ada.Tags.External_Tag(FXACC00.Last_Minute_Request'Tag);
-
- -- The following procedure will take an object of the Ticket_Request
- -- class and output it to the stream. Objects of any extended type
- -- in the class can be output to the stream with this procedure.
-
- procedure Order_Entry (Order : FXACC00.Ticket_Request'Class) is
- begin
- FXACC00.Ticket_Request'Class'Output (Order_Stream, Order);
- end Order_Entry;
-
-
- -- The following function will retrieve from the stream an object of
- -- the Ticket_Request class.
-
- function Order_Retrieval return FXACC00.Ticket_Request'Class is
- begin
- return FXACC00.Ticket_Request'Class'Input (Order_Stream);
- end Order_Retrieval;
-
- begin
-
- Order_Stream := Ada.Streams.Stream_IO.Stream (Order_File);
-
- -- Store the data objects in the stream.
- -- Each of the objects is of a different type within the class.
-
- Order_Entry (FXACC00.Box_Office_Request); -- Object of root type
- Order_Entry (FXACC00.Summer_Subscription); -- Obj. of extended type
- Order_Entry (FXACC00.Mayoral_Ticket_Request); -- Obj. of extended type
- Order_Entry (FXACC00.Late_Request); -- Object of twice
- -- extended type.
-
- -- Reset mode of stream to In_File prior to reading data from it.
- Reset1:
- begin
- Ada.Streams.Stream_IO.Reset (Order_File,
- Ada.Streams.Stream_IO.In_File);
- exception
- when Ada.Streams.Stream_IO.Use_Error =>
- Report.Not_Applicable
- ( "Reset to In_File not supported for Stream_IO - 1" );
- raise Incomplete;
- end Reset1;
-
- Process_Order_Block:
- declare
-
- use FXACC00;
-
- -- Declare variables of the root type class,
- -- and initialize them with class-wide objects returned from
- -- the stream as function result.
-
- Order_1 : Ticket_Request'Class := Order_Retrieval;
- Order_2 : Ticket_Request'Class := Order_Retrieval;
- Order_3 : Ticket_Request'Class := Order_Retrieval;
- Order_4 : Ticket_Request'Class := Order_Retrieval;
-
- -- Declare objects of the specific types from within the class
- -- that correspond to the types of the data written to the
- -- stream. Perform a type conversion on the class-wide objects.
-
- Ticket_Order : Ticket_Request :=
- Ticket_Request(Order_1);
- Subscriber_Order : Subscriber_Request :=
- Subscriber_Request(Order_2);
- VIP_Order : VIP_Request :=
- VIP_Request(Order_3);
- Last_Minute_Order : Last_Minute_Request :=
- Last_Minute_Request(Order_4);
-
- begin
-
- -- Perform a field-by-field comparison of all the class-wide
- -- objects input from the stream with specific type objects
- -- originally written to the stream.
-
- if Ticket_Order.Location /=
- Box_Office_Request.Location or
- Ticket_Order.Number_Of_Tickets /=
- Box_Office_Request.Number_Of_Tickets
- then
- Report.Failed ("Ticket_Request object validation failure");
- end if;
-
- if Subscriber_Order.Location /=
- Summer_Subscription.Location or
- Subscriber_Order.Number_Of_Tickets /=
- Summer_Subscription.Number_Of_Tickets or
- Subscriber_Order.Subscription_Number /=
- Summer_Subscription.Subscription_Number
- then
- Report.Failed ("Subscriber_Request object validation failure");
- end if;
-
- if VIP_Order.Location /=
- Mayoral_Ticket_Request.Location or
- VIP_Order.Number_Of_Tickets /=
- Mayoral_Ticket_Request.Number_Of_Tickets or
- VIP_Order.Rank /=
- Mayoral_Ticket_Request.Rank
- then
- Report.Failed ("VIP_Request object validation failure");
- end if;
-
- if Last_Minute_Order.Location /=
- Late_Request.Location or
- Last_Minute_Order.Number_Of_Tickets /=
- Late_Request.Number_Of_Tickets or
- Last_Minute_Order.Rank /=
- Late_Request.Rank or
- Last_Minute_Order.Special_Consideration /=
- Late_Request.Special_Consideration or
- Last_Minute_Order.Donation /=
- Late_Request.Donation
- then
- Report.Failed ("Last_Minute_Request object validation failure");
- end if;
-
- -- Verify tag values from before and after processing.
- -- The 'Tag attribute is used with objects of a class-wide type.
-
- if TC_Box_Office_Tag /=
- Ada.Tags.External_Tag(Order_1'Tag)
- then
- Report.Failed("Failed tag comparison - 1");
- end if;
-
- if TC_Summer_Tag /=
- Ada.Tags.External_Tag(Order_2'Tag)
- then
- Report.Failed("Failed tag comparison - 2");
- end if;
-
- if TC_Mayoral_Tag /=
- Ada.Tags.External_Tag(Order_3'Tag)
- then
- Report.Failed("Failed tag comparison - 3");
- end if;
-
- if TC_Late_Tag /=
- Ada.Tags.External_Tag(Order_4'Tag)
- then
- Report.Failed("Failed tag comparison - 4");
- end if;
-
- end Process_Order_Block;
-
- -- After all the data has been correctly extracted, the file
- -- should be empty.
-
- if not Ada.Streams.Stream_IO.End_Of_File (Order_File) then
- Report.Failed ("Stream file not empty");
- end if;
-
- exception
- when Incomplete =>
- raise;
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Operational Block");
- when others =>
- Report.Failed ("Exception raised in Operational Test Block");
- end Operational_Test_Block;
-
- Deletion:
- begin
- if Ada.Streams.Stream_IO.Is_Open (Order_File) then
- Ada.Streams.Stream_IO.Delete (Order_File);
- else
- Ada.Streams.Stream_IO.Open (Order_File,
- Ada.Streams.Stream_IO.Out_File,
- Order_Filename);
- Ada.Streams.Stream_IO.Delete (Order_File);
- end if;
- exception
- when others =>
- Report.Failed
- ( "Delete not properly implemented for Stream_IO" );
- end Deletion;
-
- Report.Result;
-
-exception
-
- when Incomplete =>
- Report.Result;
- when others =>
- Report.Failed ( "Unexpected exception" );
- Report.Result;
-
-end CXACC01;
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxaf001.a b/gcc/testsuite/ada/acats/tests/cxa/cxaf001.a
deleted file mode 100644
index ae3497abde0..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxaf001.a
+++ /dev/null
@@ -1,199 +0,0 @@
--- CXAF001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that an implementation supports the functionality defined
--- in Package Ada.Command_Line.
---
--- TEST DESCRIPTION:
--- This test verifies that an implementation supports the subprograms
--- contained in package Ada.Command_Line. Each of the subprograms
--- is exercised in a general sense, to ensure that it is available,
--- and that it provides the prescribed results in a known test
--- environment. Function Argument_Count must return zero, or the
--- number of arguments passed to the program calling it. Function
--- Argument is called with a parameter value one greater than the
--- actual number of arguments passed to the executing program, which
--- must result in Constraint_Error being raised. Function Command_Name
--- should return the name of the executing program that called it
--- (specifically, this test name). Function Set_Exit_Status is called
--- with two different parameter values, the constants Failure and
--- Success defined in package Ada.Command_Line.
---
--- The setting of the variable TC_Verbose allows for some additional
--- output to be displayed during the running of the test as an aid in
--- tracing the processing flow of the test.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to implementations that support the
--- declaration of package Command_Line as defined in the Ada Reference
--- manual.
--- An alternative declaration is allowed for package Command_Line if
--- different functionality is appropriate for the external execution
--- environment.
---
---
--- CHANGE HISTORY:
--- 10 Jul 95 SAIC Initial prerelease version.
--- 02 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 05 AUG 98 EDS Allow Null string result to be returned from
--- Function Command
---!
-
-with Ada.Command_Line;
-with Ada.Exceptions;
-with Report;
-
-procedure CXAF001 is
-begin
-
- Report.Test ("CXAF001", "Check that an implementation supports the " &
- "functionality defined in Package " &
- "Ada.Command_Line");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
-
- type String_Access is access all String;
-
- TC_Verbose : Boolean := False;
- Number_Of_Arguments : Natural := Natural'Last;
- Name_Of_Command : String_Access;
-
- begin
-
- -- Check the result of function Argument_Count.
- -- Note: If the external environment does not support passing arguments
- -- to the program invoking the function, the function result
- -- will be zero.
-
- Number_Of_Arguments := Ada.Command_Line.Argument_Count;
- if Number_Of_Arguments = Natural'Last then
- Report.Failed("Argument_Count did not provide a return result");
- end if;
- if TC_Verbose then
- Report.Comment
- ("Argument_Count = " & Integer'Image(Number_Of_Arguments));
- end if;
-
-
- -- Check that the result of Function Argument is Constraint_Error
- -- when the Number argument is outside the range of 1..Argument_Count.
-
- Test_Function_Argument_1 :
- begin
- declare
-
- -- Define a value that will be outside the range of
- -- 1..Argument_Count.
- -- Note: If the external execution environment does not support
- -- passing arguments to a program, then Argument(N) for
- -- any N will raise Constraint_Error, since
- -- Argument_Count = 0;
-
- Arguments_Plus_One : Positive :=
- Ada.Command_Line.Argument_Count + 1;
-
- -- Using the above value in a call to Argument must result in
- -- the raising of Constraint_Error.
-
- Argument_String : constant String :=
- Ada.Command_Line.Argument(Arguments_Plus_One);
-
- begin
- Report.Failed("Constraint_Error not raised by Function " &
- "Argument when provided a Number argument " &
- "out of range");
- end;
- exception
- when Constraint_Error => null; -- OK, expected exception.
- if TC_Verbose then
- Report.Comment ("Argument_Count raised Constraint_Error");
- end if;
- when others =>
- Report.Failed ("Unexpected exception raised by Argument " &
- "in Test_Function_Argument_1 block");
- end Test_Function_Argument_1;
-
-
- -- Check that Function Argument returns a string result.
-
- Test_Function_Argument_2 :
- begin
- if Ada.Command_Line.Argument_Count > 0 then
- Report.Comment
- ("Last argument is: " &
- Ada.Command_Line.Argument(Ada.Command_Line.Argument_Count));
- elsif TC_Verbose then
- Report.Comment("Argument_Count is zero, no test of Function " &
- "Argument for string result");
- end if;
- exception
- when others =>
- Report.Failed ("Unexpected exception raised by Argument " &
- "in Test_Function_Argument_2 block");
- end Test_Function_Argument_2;
-
-
- -- Check the result of Function Command_Name.
-
- Name_Of_Command := new String'(Ada.Command_Line.Command_Name);
-
- if Name_Of_Command = null then
- Report.Failed("Null string pointer returned from Function Command");
- elsif Name_Of_Command.all = "" then
- Report.Comment("Null string result returned from Function Command");
- elsif TC_Verbose then
- Report.Comment("Invoking command is " & Name_Of_Command.all);
- end if;
-
-
- -- Check that procedure Set_Exit_Status is available.
- -- Note: If the external execution environment does not support
- -- returning an exit value from a program, then Set_Exit_Status
- -- does nothing.
-
- Ada.Command_Line.Set_Exit_Status(Ada.Command_Line.Failure);
- if TC_Verbose then
- Report.Comment("Exit status set to Failure");
- end if;
-
- Ada.Command_Line.Set_Exit_Status(Ada.Command_Line.Success);
- if TC_Verbose then
- Report.Comment("Exit status set to Success");
- end if;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXAF001;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb2001.a b/gcc/testsuite/ada/acats/tests/cxb/cxb2001.a
deleted file mode 100644
index 73f9209cd34..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb2001.a
+++ /dev/null
@@ -1,633 +0,0 @@
--- CXB2001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that subprograms Shift_Left, Shift_Right,
--- Shift_Right_Arithmetic, Rotate_Left, and Rotate_Right are available
--- and produce correct results for values of signed and modular
--- integer types of 8 bits.
---
--- TEST DESCRIPTION:
--- This test uses the shift and rotate functions of package Interfaces
--- with a modular type representative of 8 bits. The functions
--- are used as the right hand of assignment statements, as part of
--- conditional statements, and as arguments in other function calls.
---
--- A check is performed in the test to determine whether the bit
--- ordering method used by the machine/implementation is high-order
--- first ("Big Endian") or low-order first ("Little Endian"). The
--- specific subtests use this information to evaluate the results of
--- each of the functions under test.
---
--- Note: In the string associated with each Report.Failed statement, the
--- acronym BE refers to Big Endian, LE refers to Little Endian.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that support signed
--- and modular integer types of 8 bits.
---
---
--- CHANGE HISTORY:
--- 21 Aug 95 SAIC Initial prerelease version.
--- 07 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
---
---!
-
-with Report;
-with Interfaces;
-with Ada.Exceptions;
-
-procedure CXB2001 is
-begin
-
- Report.Test ("CXB2001",
- "Check that subprograms Shift_Left, Shift_Right, " &
- "Shift_Right_Arithmetic, Rotate_Left, and Rotate_Right " &
- "produce correct results for values of signed and " &
- "modular integer types of 8 bits");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
- use Interfaces;
-
- TC_Amount : Natural := Natural'First;
- Big_Endian : Boolean := False;
-
- -- Range of type Unsigned_8 is 0..255 (0..Modulus-1).
- TC_Val_Unsigned_8,
- TC_Result_Unsigned_8 : Unsigned_8 := Unsigned_8'First;
-
- begin
-
- -- Determine whether the machine uses high-order first or low-order
- -- first bit ordering.
- -- On a high-order first machine, bit zero of a storage element is
- -- the most significant bit (interpreting the sequence of bits that
- -- represent a component as an unsigned integer value).
- -- On a low-order first machine, bit zero is the least significant.
- -- In this check, a right shift of one place on a Big Endian machine
- -- will yield a result of one, while on a Little Endian machine the
- -- result would be four.
-
- TC_Val_Unsigned_8 := 2;
- Big_Endian := (Shift_Right(TC_Val_Unsigned_8, 1) = 1);
-
-
- -- Note: The shifting and rotating subprograms operate on a bit-by-bit
- -- basis, using the binary representation of the value of the
- -- operands to yield a binary representation for the result.
-
- -- Function Shift_Left.
-
- if Big_Endian then -- High-order first bit ordering.
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := Unsigned_8'Last; -- 255.
- TC_Result_Unsigned_8 := Shift_Left(Value => TC_Val_Unsigned_8,
- Amount => TC_Amount);
- if TC_Result_Unsigned_8 /= 254 then
- Report.Failed("Incorrect result from BE Shift_Left - 1");
- end if;
-
- if Shift_Left(TC_Val_Unsigned_8, 2) /= 252 or
- Shift_Left(TC_Val_Unsigned_8, 3) /= 248 or
- Shift_Left(TC_Val_Unsigned_8, 5) /= 224 or
- Shift_Left(TC_Val_Unsigned_8, 8) /= 0 or
- Shift_Left(TC_Val_Unsigned_8, 9) /= 0 or
- Shift_Left(TC_Val_Unsigned_8, 0) /= TC_Val_Unsigned_8
- then
- Report.Failed("Incorrect result from BE Shift_Left - 2");
- end if;
-
- TC_Val_Unsigned_8 := 1;
- if Shift_Left(TC_Val_Unsigned_8, 1) /= 2 or
- Shift_Left(TC_Val_Unsigned_8, Amount => 3) /= 8
- then
- Report.Failed("Incorrect result from BE Shift_Left - 3");
- end if;
-
- TC_Val_Unsigned_8 := 7;
- if Shift_Left(TC_Val_Unsigned_8, Amount => 4) /= 112 or
- Shift_Left(Shift_Left(TC_Val_Unsigned_8, 7), 1) /= 0
- then
- Report.Failed("Incorrect result from BE Shift_Left - 4");
- end if;
-
- else -- Low-order first bit ordering.
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := Unsigned_8'Last; -- 255.
- TC_Result_Unsigned_8 := Shift_Left(TC_Val_Unsigned_8, TC_Amount);
-
- if TC_Result_Unsigned_8 /= 127 then
- Report.Failed("Incorrect result from LE Shift_Left - 1");
- end if;
-
- if Shift_Left(TC_Val_Unsigned_8, 2) /= 63 or
- Shift_Left(TC_Val_Unsigned_8, 3) /= 31 or
- Shift_Left(TC_Val_Unsigned_8, 5) /= 7 or
- Shift_Left(TC_Val_Unsigned_8, 8) /= 0 or
- Shift_Left(TC_Val_Unsigned_8, 0) /= TC_Val_Unsigned_8
- then
- Report.Failed("Incorrect result from LE Shift_Left - 2");
- end if;
-
- TC_Val_Unsigned_8 := 1;
- if Shift_Left(TC_Val_Unsigned_8, 1) /= 0 or
- Shift_Left(TC_Val_Unsigned_8, 7) /= 0
- then
- Report.Failed("Incorrect result from LE Shift_Left - 3");
- end if;
-
- TC_Val_Unsigned_8 := 129;
- if Shift_Left(TC_Val_Unsigned_8, 4) /= 8 or
- Shift_Left(Shift_Left(TC_Val_Unsigned_8, 7), 1) /= 0
- then
- Report.Failed("Incorrect result from LE Shift_Left - 4");
- end if;
-
- end if;
-
-
-
- -- Function Shift_Right.
-
- if Big_Endian then -- High-order first bit ordering.
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := Unsigned_8'Last; -- 255.
- TC_Result_Unsigned_8 := Shift_Right(TC_Val_Unsigned_8, TC_Amount);
-
- if TC_Result_Unsigned_8 /= 127 then
- Report.Failed("Incorrect result from BE Shift_Right - 1");
- end if;
-
- if Shift_Right(TC_Val_Unsigned_8, 2) /= 63 or
- Shift_Right(TC_Val_Unsigned_8, 3) /= 31 or
- Shift_Right(TC_Val_Unsigned_8, 5) /= 7 or
- Shift_Right(TC_Val_Unsigned_8, 8) /= 0 or
- Shift_Right(TC_Val_Unsigned_8, 0) /= TC_Val_Unsigned_8
- then
- Report.Failed("Incorrect result from BE Shift_Right - 2");
- end if;
-
- TC_Val_Unsigned_8 := 1;
- if Shift_Right(TC_Val_Unsigned_8, 1) /= 0 or
- Shift_Right(TC_Val_Unsigned_8, 7) /= 0
- then
- Report.Failed("Incorrect result from BE Shift_Right - 3");
- end if;
-
- TC_Val_Unsigned_8 := 129;
- if Shift_Right(TC_Val_Unsigned_8, 4) /= 8 or
- Shift_Right(Shift_Right(TC_Val_Unsigned_8, 7), 1) /= 0
- then
- Report.Failed("Incorrect result from BE Shift_Right - 4");
- end if;
-
- else -- Low-order first bit ordering.
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := Unsigned_8'Last; -- 255.
- TC_Result_Unsigned_8 := Shift_Right(Value => TC_Val_Unsigned_8,
- Amount => TC_Amount);
- if TC_Result_Unsigned_8 /= 254 then
- Report.Failed("Incorrect result from LE Shift_Right - 1");
- end if;
-
- if Shift_Right(TC_Val_Unsigned_8, 2) /= 252 or
- Shift_Right(TC_Val_Unsigned_8, 3) /= 248 or
- Shift_Right(TC_Val_Unsigned_8, 5) /= 224 or
- Shift_Right(TC_Val_Unsigned_8, 8) /= 0 or
- Shift_Right(TC_Val_Unsigned_8, 9) /= 0 or
- Shift_Right(TC_Val_Unsigned_8, 0) /= TC_Val_Unsigned_8
- then
- Report.Failed("Incorrect result from LE Shift_Right - 2");
- end if;
-
- TC_Val_Unsigned_8 := 1;
- if Shift_Right(TC_Val_Unsigned_8, 1) /= 2 or
- Shift_Right(TC_Val_Unsigned_8, Amount => 3) /= 8
- then
- Report.Failed("Incorrect result from LE Shift_Right - 3");
- end if;
-
- TC_Val_Unsigned_8 := 7;
- if Shift_Right(TC_Val_Unsigned_8, Amount => 4) /= 112 or
- Shift_Right(Shift_Right(TC_Val_Unsigned_8, 7), 1) /= 0
- then
- Report.Failed("Incorrect result from LE Shift_Right - 4");
- end if;
-
- end if;
-
-
-
- -- Tests of Shift_Left and Shift_Right in combination.
-
- if Big_Endian then -- High-order first bit ordering.
-
- TC_Val_Unsigned_8 := 32;
-
- if Shift_Left(Shift_Right(TC_Val_Unsigned_8, 2), 2) /=
- TC_Val_Unsigned_8 or
- Shift_Left(Shift_Right(TC_Val_Unsigned_8, 1), 3) /= 128 or
- Shift_Right(Shift_Left(TC_Val_Unsigned_8, 2), 6) /= 2 or
- Shift_Right(Shift_Left(TC_Val_Unsigned_8, 2), 8) /= 0
- then
- Report.Failed("Incorrect result from BE Shift_Left - " &
- "Shift_Right functions used in combination");
- end if;
-
- else -- Low-order first bit ordering.
-
- TC_Val_Unsigned_8 := 32;
-
- if Shift_Left(Shift_Right(TC_Val_Unsigned_8, 2), 2) /=
- TC_Val_Unsigned_8 or
- Shift_Left(Shift_Right(TC_Val_Unsigned_8, 1), 3) /= 8 or
- Shift_Right(Shift_Left(TC_Val_Unsigned_8, 2), 3) /= 64 or
- Shift_Right(Shift_Left(TC_Val_Unsigned_8, 2), 4) /= 128
- then
- Report.Failed("Incorrect result from LE Shift_Left - " &
- "Shift_Right functions used in combination");
- end if;
-
- end if;
-
-
-
- -- Function Shift_Right_Arithmetic.
-
- if Big_Endian then -- High-order first bit ordering.
-
- -- Case where the parameter Value is less than
- -- one half of the modulus. Zero bits will be shifted in.
- -- Modulus of type Unsigned_8 is 256; half of the modulus is 128.
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := 127; -- Less than one half of modulus.
- TC_Result_Unsigned_8 := Shift_Right_Arithmetic(TC_Val_Unsigned_8,
- TC_Amount);
- if TC_Result_Unsigned_8 /= 63 then
- Report.Failed
- ("Incorrect result from BE Shift_Right_Arithmetic - 1");
- end if;
-
- if Shift_Right_Arithmetic(TC_Val_Unsigned_8, 2) /= 31 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 3) /= 15 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 5) /= 3 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 8) /= 0 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 0) /= TC_Val_Unsigned_8
- then
- Report.Failed
- ("Incorrect result from BE Shift_Right_Arithmetic - 2");
- end if;
-
- TC_Val_Unsigned_8 := 1;
- if Shift_Right_Arithmetic(TC_Val_Unsigned_8, Amount => 1) /= 0 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 3) /= 0
- then
- Report.Failed
- ("Incorrect result from BE Shift_Right_Arithmetic - 3");
- end if;
-
- -- Case where the parameter Value is greater than or equal to
- -- one half of the modulus. One bits will be shifted in.
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := 128; -- One half of modulus.
- TC_Result_Unsigned_8 := Shift_Right_Arithmetic(TC_Val_Unsigned_8,
- Amount => TC_Amount);
- if TC_Result_Unsigned_8 /= 192 then
- Report.Failed
- ("Incorrect result from BE Shift_Right_Arithmetic - 4");
- end if;
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := 129; -- Greater than one half of modulus.
- TC_Result_Unsigned_8 := Shift_Right_Arithmetic(TC_Val_Unsigned_8,
- Amount => TC_Amount);
- if TC_Result_Unsigned_8 /= 192 then
- Report.Failed
- ("Incorrect result from BE Shift_Right_Arithmetic - 5");
- end if;
-
- if Shift_Right_Arithmetic(TC_Val_Unsigned_8, 2) /= 224 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 3) /= 240 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 5) /= 252 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 7) /= Unsigned_8'Last or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 0) /= TC_Val_Unsigned_8
- then
- Report.Failed
- ("Incorrect result from BE Shift_Right_Arithmetic - 6");
- end if;
-
- TC_Val_Unsigned_8 := Unsigned_8'Last;
- if Shift_Right_Arithmetic(TC_Val_Unsigned_8, 1) /=
- Unsigned_8'Last
- then
- Report.Failed
- ("Incorrect result from BE Shift_Right_Arithmetic - 7");
- end if;
-
- else -- Low-order first bit ordering
-
- -- Case where the parameter Value is less than
- -- one half of the modulus. Zero bits will be shifted in.
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := 127; -- Less than one half of modulus.
- TC_Result_Unsigned_8 := Shift_Right_Arithmetic(TC_Val_Unsigned_8,
- TC_Amount);
- if TC_Result_Unsigned_8 /= 254 then
- Report.Failed
- ("Incorrect result from LE Shift_Right_Arithmetic - 1");
- end if;
-
- TC_Val_Unsigned_8 := 2;
- if Shift_Right_Arithmetic(TC_Val_Unsigned_8, 2) /= 8 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 3) /= 16 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 5) /= 64 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 8) /= 0 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 0) /= TC_Val_Unsigned_8
- then
- Report.Failed
- ("Incorrect result from LE Shift_Right_Arithmetic - 2");
- end if;
-
- TC_Val_Unsigned_8 := 64;
- if Shift_Right_Arithmetic(TC_Val_Unsigned_8, Amount => 1) /= 128 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 3) /= 0
- then
- Report.Failed
- ("Incorrect result from LE Shift_Right_Arithmetic - 3");
- end if;
-
- -- Case where the parameter Value is greater than or equal to
- -- one half of the modulus. One bits will be shifted in.
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := 128; -- One half of modulus.
- TC_Result_Unsigned_8 := Shift_Right_Arithmetic(TC_Val_Unsigned_8,
- Amount => TC_Amount);
-
- if TC_Result_Unsigned_8 /= 3 then
- Report.Failed
- ("Incorrect result from LE Shift_Right_Arithmetic - 4");
- end if;
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := 129; -- Greater than one half of modulus.
- TC_Result_Unsigned_8 := Shift_Right_Arithmetic(TC_Val_Unsigned_8,
- Amount => TC_Amount);
-
- if TC_Result_Unsigned_8 /= 3 then
- Report.Failed
- ("Incorrect result from LE Shift_Right_Arithmetic - 5");
- end if;
-
- TC_Val_Unsigned_8 := 135; -- Greater than one half of modulus.
- if Shift_Right_Arithmetic(TC_Val_Unsigned_8, 2) /= 31 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 3) /= 63 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 5) /= Unsigned_8'Last or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 7) /= Unsigned_8'Last or
- Shift_Right_Arithmetic(TC_Val_Unsigned_8, 0) /= TC_Val_Unsigned_8
- then
- Report.Failed
- ("Incorrect result from LE Shift_Right_Arithmetic - 6");
- end if;
-
- TC_Val_Unsigned_8 := Unsigned_8'Last;
- if Shift_Right_Arithmetic(TC_Val_Unsigned_8, 1) /=
- Unsigned_8'Last
- then
- Report.Failed
- ("Incorrect result from LE Shift_Right_Arithmetic - 7");
- end if;
-
- end if;
-
-
-
- -- Function Rotate_Left.
-
- if Big_Endian then -- High-order first bit ordering.
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := 129;
- TC_Result_Unsigned_8 := Rotate_Left(Value => TC_Val_Unsigned_8,
- Amount => TC_Amount);
- if TC_Result_Unsigned_8 /= 3 then
- Report.Failed("Incorrect result from BE Rotate_Left - 1");
- end if;
-
- if Rotate_Left(TC_Val_Unsigned_8, 2) /= 6 or
- Rotate_Left(TC_Val_Unsigned_8, 3) /= 12 or
- Rotate_Left(TC_Val_Unsigned_8, 5) /= 48 or
- Rotate_Left(TC_Val_Unsigned_8, 8) /= 129 or
- Rotate_Left(TC_Val_Unsigned_8, 0) /= TC_Val_Unsigned_8
- then
- Report.Failed("Incorrect result from BE Rotate_Left - 2");
- end if;
-
- TC_Val_Unsigned_8 := 1;
- if Rotate_Left(Value => TC_Val_Unsigned_8, Amount => 1) /= 2 or
- Rotate_Left(TC_Val_Unsigned_8, Amount => 3) /= 8
- then
- Report.Failed("Incorrect result from BE Rotate_Left - 3");
- end if;
-
- TC_Val_Unsigned_8 := 82;
- if Rotate_Left(TC_Val_Unsigned_8, Amount => 4) /= 37 or
- Rotate_Left(Rotate_Left(TC_Val_Unsigned_8, 7), 1) /= 82
- then
- Report.Failed("Incorrect result from BE Rotate_Left - 4");
- end if;
-
- else -- Low-order first bit ordering.
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := 1;
- TC_Result_Unsigned_8 := Rotate_Left(TC_Val_Unsigned_8, TC_Amount);
-
- if TC_Result_Unsigned_8 /= 128 then
- Report.Failed("Incorrect result from LE Rotate_Left - 1");
- end if;
-
- TC_Val_Unsigned_8 := 15;
- if Rotate_Left(TC_Val_Unsigned_8, 2) /= 195 or
- Rotate_Left(TC_Val_Unsigned_8, 3) /= 225 or
- Rotate_Left(TC_Val_Unsigned_8, 5) /= 120 or
- Rotate_Left(TC_Val_Unsigned_8, 8) /= TC_Val_Unsigned_8 or
- Rotate_Left(TC_Val_Unsigned_8, 0) /= TC_Val_Unsigned_8
- then
- Report.Failed("Incorrect result from LE Rotate_Left - 2");
- end if;
-
- TC_Val_Unsigned_8 := Unsigned_8'Last;
- if Rotate_Left(TC_Val_Unsigned_8, 1) /= Unsigned_8'Last then
- Report.Failed("Incorrect result from LE Rotate_Left - 3");
- end if;
-
- TC_Val_Unsigned_8 := 12;
- if Rotate_Left(TC_Val_Unsigned_8, 1) /= 6 or
- Rotate_Left(TC_Val_Unsigned_8, 3) /= 129
- then
- Report.Failed("Incorrect result from LE Rotate_Left - 4");
- end if;
-
- TC_Val_Unsigned_8 := 129;
- if Rotate_Left(TC_Val_Unsigned_8, 4) /= 24 or
- Rotate_Left(Rotate_Left(TC_Val_Unsigned_8, 7), 1) /= 129
- then
- Report.Failed("Incorrect result from LE Rotate_Left - 5");
- end if;
-
- end if;
-
-
-
- -- Function Rotate_Right.
-
- if Big_Endian then -- High-order first bit ordering.
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := 1;
- TC_Result_Unsigned_8 := Rotate_Right(TC_Val_Unsigned_8, TC_Amount);
-
- if TC_Result_Unsigned_8 /= 128 then
- Report.Failed("Incorrect result from BE Rotate_Right - 1");
- end if;
-
- TC_Val_Unsigned_8 := 15;
- if Rotate_Right(TC_Val_Unsigned_8, 2) /= 195 or
- Rotate_Right(TC_Val_Unsigned_8, 3) /= 225 or
- Rotate_Right(TC_Val_Unsigned_8, 5) /= 120 or
- Rotate_Right(TC_Val_Unsigned_8, 8) /= TC_Val_Unsigned_8 or
- Rotate_Right(TC_Val_Unsigned_8, 0) /= TC_Val_Unsigned_8
- then
- Report.Failed("Incorrect result from BE Rotate_Right - 2");
- end if;
-
- TC_Val_Unsigned_8 := Unsigned_8'Last;
- if Rotate_Right(TC_Val_Unsigned_8, 1) /= Unsigned_8'Last then
- Report.Failed("Incorrect result from BE Rotate_Right - 3");
- end if;
-
- TC_Val_Unsigned_8 := 12;
- if Rotate_Right(TC_Val_Unsigned_8, 1) /= 6 or
- Rotate_Right(TC_Val_Unsigned_8, 3) /= 129
- then
- Report.Failed("Incorrect result from BE Rotate_Right - 4");
- end if;
-
- TC_Val_Unsigned_8 := 129;
- if Rotate_Right(TC_Val_Unsigned_8, 4) /= 24 or
- Rotate_Right(Rotate_Right(TC_Val_Unsigned_8, 7), 1) /= 129
- then
- Report.Failed("Incorrect result from BE Rotate_Right - 5");
- end if;
-
- else -- Low-order first bit ordering.
-
- TC_Amount := 1;
- TC_Val_Unsigned_8 := 129;
- TC_Result_Unsigned_8 := Rotate_Right(Value => TC_Val_Unsigned_8,
- Amount => TC_Amount);
- if TC_Result_Unsigned_8 /= 3 then
- Report.Failed("Incorrect result from LE Rotate_Right - 1");
- end if;
-
- if Rotate_Right(TC_Val_Unsigned_8, 2) /= 6 or
- Rotate_Right(TC_Val_Unsigned_8, 3) /= 12 or
- Rotate_Right(TC_Val_Unsigned_8, 5) /= 48 or
- Rotate_Right(TC_Val_Unsigned_8, 8) /= 129 or
- Rotate_Right(TC_Val_Unsigned_8, 0) /= TC_Val_Unsigned_8
- then
- Report.Failed("Incorrect result from LE Rotate_Right - 2");
- end if;
-
- TC_Val_Unsigned_8 := 1;
- if Rotate_Right(Value => TC_Val_Unsigned_8, Amount => 1) /= 2 or
- Rotate_Right(TC_Val_Unsigned_8, Amount => 3) /= 8
- then
- Report.Failed("Incorrect result from LE Rotate_Right - 3");
- end if;
-
- TC_Val_Unsigned_8 := 82;
- if Rotate_Right(TC_Val_Unsigned_8, Amount => 4) /= 37 or
- Rotate_Right(Rotate_Right(TC_Val_Unsigned_8, 7), 1) /= 82
- then
- Report.Failed("Incorrect result from LE Rotate_Right - 4");
- end if;
-
- end if;
-
-
-
- -- Tests of Rotate_Left and Rotate_Right in combination.
-
- if Big_Endian then -- High-order first bit ordering.
-
- TC_Val_Unsigned_8 := 17;
-
- if Rotate_Left(Rotate_Right(TC_Val_Unsigned_8, 2), 2) /=
- TC_Val_Unsigned_8 or
- Rotate_Left(Rotate_Right(TC_Val_Unsigned_8, 1), 3) /= 68 or
- Rotate_Right(Rotate_Left(TC_Val_Unsigned_8, 3), 7) /= 17 or
- Rotate_Right(Rotate_Left(TC_Val_Unsigned_8, 2), 8) /= 68
- then
- Report.Failed("Incorrect result from BE Rotate_Left - " &
- "Rotate_Right functions used in combination");
- end if;
-
- else -- Low-order first bit ordering.
-
- TC_Val_Unsigned_8 := 4;
-
- if Rotate_Left(Rotate_Right(TC_Val_Unsigned_8, 2), 2) /=
- TC_Val_Unsigned_8 or
- Rotate_Left(Rotate_Right(TC_Val_Unsigned_8, 1), 3) /= 1 or
- Rotate_Right(Rotate_Left(TC_Val_Unsigned_8, 3), 7) /= 64 or
- Rotate_Right(Rotate_Left(TC_Val_Unsigned_8, 2), 8) /= 1
- then
- Report.Failed("Incorrect result from LE Rotate_Left - " &
- "Rotate_Right functions used in combination");
- end if;
-
- end if;
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB2001;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb2002.a b/gcc/testsuite/ada/acats/tests/cxb/cxb2002.a
deleted file mode 100644
index 945722295e7..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb2002.a
+++ /dev/null
@@ -1,259 +0,0 @@
--- CXB2002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that subprograms Shift_Left, Shift_Right,
--- Shift_Right_Arithmetic, Rotate_Left, and Rotate_Right are available
--- and produce correct results for values of signed and modular
--- integer types of 16 bits.
---
--- TEST DESCRIPTION:
--- This test uses the shift and rotate functions of package Interfaces
--- with a modular type representative of 16 bits. The functions
--- are used as the right hand of assignment statements, as part of
--- conditional statements, and as arguments in other function calls.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that support signed
--- and modular integer types of 16 bits.
---
---
--- CHANGE HISTORY:
--- 21 Aug 95 SAIC Initial prerelease version.
--- 07 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 26 Oct 96 SAIC Removed subtests based on Big/Little Endian.
--- 17 Feb 97 PWB.CTA Corrected "-" to "+" in parenthesized expressions.
---!
-
-with Report;
-with Interfaces;
-with Ada.Exceptions;
-
-procedure CXB2002 is
-begin
-
- Report.Test ("CXB2002",
- "Check that subprograms Shift_Left, Shift_Right, " &
- "Shift_Right_Arithmetic, Rotate_Left, and Rotate_Right " &
- "produce correct results for values of signed and " &
- "modular integer types of 16 bits");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
- use Interfaces;
-
- TC_Amount : Natural := Natural'First;
-
- -- Range of type Unsigned_16 is 0..65535 (0..Modulus-1).
- TC_Val_Unsigned_16,
- TC_Result_Unsigned_16 : Unsigned_16 := Unsigned_16'First;
-
- begin
-
- -- Note: The shifting and rotating subprograms operate on a bit-by-bit
- -- basis, using the binary representation of the value of the
- -- operands to yield a binary representation for the result.
-
- -- Function Shift_Left.
-
- TC_Amount := 3;
- TC_Val_Unsigned_16 := Unsigned_16'Last; -- 65535.
- TC_Result_Unsigned_16 := Shift_Left(TC_Val_Unsigned_16, TC_Amount);
-
- if TC_Result_Unsigned_16 /= Unsigned_16'Last - (2**0 + 2**1 + 2**2)
- then
- Report.Failed("Incorrect result from Shift_Left - 1");
- end if;
-
- if Shift_Left(TC_Val_Unsigned_16, 0) /= Unsigned_16'Last or
- Shift_Left(TC_Val_Unsigned_16, 5) /=
- Unsigned_16'Last - (2**0 + 2**1 + 2**2 + 2**3 +2**4) or
- Shift_Left(TC_Val_Unsigned_16, 16) /= 0
- then
- Report.Failed("Incorrect result from Shift_Left - 2");
- end if;
-
-
- -- Function Shift_Right.
-
- TC_Amount := 3;
- TC_Val_Unsigned_16 := Unsigned_16'Last; -- 65535.
- TC_Result_Unsigned_16 := Shift_Right(Value => TC_Val_Unsigned_16,
- Amount => TC_Amount);
-
- if TC_Result_Unsigned_16 /= Unsigned_16'Last-(2**15 + 2**14 + 2**13)
- then
- Report.Failed("Incorrect result from Shift_Right - 1");
- end if;
-
- if Shift_Right(TC_Val_Unsigned_16, 0) /= Unsigned_16'Last or
- Shift_Right(TC_Val_Unsigned_16, 5) /=
- Unsigned_16'Last-(2**15 + 2**14 + 2**13 + 2**12 + 2**11) or
- Shift_Right(TC_Val_Unsigned_16, 16) /= 0
- then
- Report.Failed("Incorrect result from Shift_Right - 2");
- end if;
-
-
- -- Tests of Shift_Left and Shift_Right in combination.
-
- TC_Val_Unsigned_16 := Unsigned_16'Last;
-
- if Shift_Left(Shift_Right(TC_Val_Unsigned_16, 4), 4) /=
- Unsigned_16'Last-(2**0 + 2**1 + 2**2 + 2**3) or
- Shift_Left(Shift_Right(TC_Val_Unsigned_16, 1), 3) /=
- Unsigned_16'Last-(2**0 + 2**1 + 2**2) or
- Shift_Right(Shift_Left(TC_Val_Unsigned_16, 2), 4) /=
- Unsigned_16'Last-(2**15+ 2**14 + 2**13 + 2**12) or
- Shift_Right(Shift_Left(TC_Val_Unsigned_16, 2), 16) /= 0
- then
- Report.Failed("Incorrect result from Shift_Left - " &
- "Shift_Right functions used in combination");
- end if;
-
-
- -- Function Shift_Right_Arithmetic.
-
- -- Case where the parameter Value is less than
- -- one half of the modulus. Zero bits will be shifted in.
- -- Modulus of type Unsigned_16 is 2**16; one half is 2**15.
-
- TC_Amount := 3;
- TC_Val_Unsigned_16 := 2**15 - 1; -- Less than one half of modulus.
- TC_Result_Unsigned_16 := Shift_Right_Arithmetic(TC_Val_Unsigned_16,
- TC_Amount);
- if TC_Result_Unsigned_16 /=
- TC_Val_Unsigned_16 - (2**14 + 2**13 + 2**12)
- then
- Report.Failed
- ("Incorrect result from Shift_Right_Arithmetic - 1");
- end if;
-
- if Shift_Right_Arithmetic(TC_Val_Unsigned_16, 0) /=
- TC_Val_Unsigned_16 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_16, 5) /=
- TC_Val_Unsigned_16 - (2**14 + 2**13 + 2**12 + 2**11 + 2**10) or
- Shift_Right_Arithmetic(TC_Val_Unsigned_16, 16) /= 0
- then
- Report.Failed
- ("Incorrect result from Shift_Right_Arithmetic - 2");
- end if;
-
- -- Case where the parameter Value is greater than or equal to
- -- one half of the modulus. One bits will be shifted in.
-
- TC_Amount := 1;
- TC_Val_Unsigned_16 := 2**15; -- One half of modulus.
- TC_Result_Unsigned_16 := Shift_Right_Arithmetic(TC_Val_Unsigned_16,
- TC_Amount);
- if TC_Result_Unsigned_16 /= TC_Val_Unsigned_16 + 2**14 then
- Report.Failed
- ("Incorrect result from Shift_Right_Arithmetic - 3");
- end if;
-
- TC_Amount := 1;
- TC_Val_Unsigned_16 := 2**15 + 1; -- Greater than half of modulus.
- TC_Result_Unsigned_16 := Shift_Right_Arithmetic(TC_Val_Unsigned_16,
- TC_Amount);
- if TC_Result_Unsigned_16 /= TC_Val_Unsigned_16 + 2**14 - 2**0 then
- Report.Failed
- ("Incorrect result from Shift_Right_Arithmetic - 4");
- end if;
-
- if Shift_Right_Arithmetic(TC_Val_Unsigned_16, 0) /=
- TC_Val_Unsigned_16 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_16, 4) /=
- TC_Val_Unsigned_16 - 2**0 + 2**14 + 2**13 + 2**12 + 2**11 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_16, 16) /= Unsigned_16'Last
- then
- Report.Failed
- ("Incorrect result from Shift_Right_Arithmetic - 5");
- end if;
-
-
- -- Function Rotate_Left.
-
- TC_Amount := 3;
- TC_Val_Unsigned_16 := Unsigned_16'Last; -- 65535.
- TC_Result_Unsigned_16 := Rotate_Left(Value => TC_Val_Unsigned_16,
- Amount => TC_Amount);
- if TC_Result_Unsigned_16 /= Unsigned_16'Last then
- Report.Failed("Incorrect result from Rotate_Left - 1");
- end if;
-
- TC_Val_Unsigned_16 := 2**15 + 2**14 + 2**1 + 2**0;
- if Rotate_Left(TC_Val_Unsigned_16, 0) /=
- 2**15 + 2**14 + 2**1 + 2**0 or
- Rotate_Left(TC_Val_Unsigned_16, 5) /=
- 2**6 + 2**5 + 2**4 + 2**3 or
- Rotate_Left(TC_Val_Unsigned_16, 16) /= TC_Val_Unsigned_16
- then
- Report.Failed("Incorrect result from Rotate_Left - 2");
- end if;
-
-
- -- Function Rotate_Right.
-
- TC_Amount := 1;
- TC_Val_Unsigned_16 := 2**1 + 2**0;
- TC_Result_Unsigned_16 := Rotate_Right(Value => TC_Val_Unsigned_16,
- Amount => TC_Amount);
- if TC_Result_Unsigned_16 /= 2**15 + 2**0 then
- Report.Failed("Incorrect result from Rotate_Right - 1");
- end if;
-
- if Rotate_Right(TC_Val_Unsigned_16, 0) /= 2**1 + 2**0 or
- Rotate_Right(TC_Val_Unsigned_16, 5) /= 2**12 + 2**11 or
- Rotate_Right(TC_Val_Unsigned_16, 16) /= 2**1 + 2**0
- then
- Report.Failed("Incorrect result from Rotate_Right - 2");
- end if;
-
-
- -- Tests of Rotate_Left and Rotate_Right in combination.
-
- TC_Val_Unsigned_16 := 32769;
-
- if Rotate_Left(Rotate_Right(TC_Val_Unsigned_16, 4), 3) /= 49152 or
- Rotate_Left(Rotate_Right(TC_Val_Unsigned_16, 1), 3) /= 6 or
- Rotate_Right(Rotate_Left(TC_Val_Unsigned_16, 3), 7) /= 6144 or
- Rotate_Right(Rotate_Left(TC_Val_Unsigned_16, 1), 16) /= 3
- then
- Report.Failed("Incorrect result from Rotate_Left - " &
- "Rotate_Right functions used in combination");
- end if;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB2002;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb2003.a b/gcc/testsuite/ada/acats/tests/cxb/cxb2003.a
deleted file mode 100644
index ec3998ad875..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb2003.a
+++ /dev/null
@@ -1,255 +0,0 @@
--- CXB2003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that subprograms Shift_Left, Shift_Right,
--- Shift_Right_Arithmetic, Rotate_Left, and Rotate_Right are available
--- and produce correct results for values of signed and modular
--- integer types of 32 bits.
---
--- TEST DESCRIPTION:
--- This test uses the shift and rotate functions of package Interfaces
--- with a modular type representative of 32 bits. The functions
--- are used as the right hand of assignment statements, as part of
--- conditional statements, and as arguments in other function calls.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that support signed
--- and modular integer types of 32 bits.
---
---
--- CHANGE HISTORY:
--- 23 Aug 95 SAIC Initial prerelease version.
--- 07 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 26 Oct 96 SAIC Removed all references to Big/Little endian.
---
---!
-
-with Report;
-with Interfaces;
-with Ada.Exceptions;
-
-procedure CXB2003 is
-begin
-
- Report.Test ("CXB2003",
- "Check that subprograms Shift_Left, Shift_Right, " &
- "Shift_Right_Arithmetic, Rotate_Left, and Rotate_Right " &
- "are available and produce correct results");
-
- Test_Block:
- declare
-
- use Interfaces;
- use Ada.Exceptions;
-
- TC_Amount : Natural := Natural'First;
-
- -- Range of type Unsigned_32 is 0..(2**32)-1 (0..Modulus-1).
- TC_Val_Unsigned_32,
- TC_Result_Unsigned_32 : Unsigned_32 := Unsigned_32'First;
-
- begin
-
- -- Note: The shifting and rotating subprograms operate on a bit-by-bit
- -- basis, using the binary representation of the value of the
- -- operands to yield a binary representation for the result.
-
-
- -- Function Shift_Left.
-
- TC_Amount := 2;
- TC_Val_Unsigned_32 := Unsigned_32'Last;
- TC_Result_Unsigned_32 := Shift_Left(TC_Val_Unsigned_32, TC_Amount);
-
- if TC_Result_Unsigned_32 /= Unsigned_32'Last - (2**0 + 2**1) then
- Report.Failed("Incorrect result from Shift_Left - 1");
- end if;
-
- TC_Result_Unsigned_32 := Unsigned_32'Last - (2**0 + 2**1 + 2**2 +
- 2**3 + 2**4);
- if Shift_Left(TC_Val_Unsigned_32, 5) /= TC_Result_Unsigned_32 or
- Shift_Left(TC_Val_Unsigned_32, 0) /= Unsigned_32'Last
- then
- Report.Failed("Incorrect result from Shift_Left - 2");
- end if;
-
-
- -- Function Shift_Right.
-
- TC_Amount := 3;
- TC_Val_Unsigned_32 := Unsigned_32'Last;
- TC_Result_Unsigned_32 := Shift_Right(Value => TC_Val_Unsigned_32,
- Amount => TC_Amount);
- if TC_Result_Unsigned_32 /=
- Unsigned_32'Last - (2**31 + 2**30 + 2**29)
- then
- Report.Failed("Incorrect result from Shift_Right - 1");
- end if;
-
- if Shift_Right(TC_Val_Unsigned_32, 0) /= Unsigned_32'Last or
- Shift_Right(TC_Val_Unsigned_32, 2) /= Unsigned_32'Last -
- (2**31 + 2**30)
- then
- Report.Failed("Incorrect result from Shift_Right - 2");
- end if;
-
-
- -- Tests of Shift_Left and Shift_Right in combination.
-
- TC_Val_Unsigned_32 := Unsigned_32'Last;
-
- if Shift_Left(Shift_Right(TC_Val_Unsigned_32, 4), 4) /=
- Unsigned_32'Last - (2**0 + 2**1 + 2**2 + 2**3) or
- Shift_Left(Shift_Right(TC_Val_Unsigned_32, 3), 1) /=
- Unsigned_32'Last - (2**31 + 2**30 + 2**0) or
- Shift_Left(Shift_Right(TC_Val_Unsigned_32, 5), 3) /=
- Unsigned_32'Last - (2**31 + 2**30 + 2**2 + 2**1 + 2**0) or
- Shift_Right(Shift_Left(TC_Val_Unsigned_32, 2), 1) /=
- Unsigned_32'Last - (2**31 + 2**0)
- then
- Report.Failed("Incorrect result from Shift_Left - " &
- "Shift_Right functions used in combination");
- end if;
-
-
- -- Function Shift_Right_Arithmetic.
-
- -- Case where the parameter Value is less than
- -- one half of the modulus. Zero bits will be shifted in.
-
- TC_Amount := 3;
- TC_Val_Unsigned_32 := 2**15 + 2**10 + 2**1;
- TC_Result_Unsigned_32 := Shift_Right_Arithmetic(TC_Val_Unsigned_32,
- TC_Amount);
- if TC_Result_Unsigned_32 /= (2**12 + 2**7) then
- Report.Failed
- ("Incorrect result from Shift_Right_Arithmetic - 1");
- end if;
-
- if Shift_Right_Arithmetic(TC_Val_Unsigned_32, 0) /=
- TC_Val_Unsigned_32 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_32, 5) /=
- (2**10 + 2**5)
- then
- Report.Failed
- ("Incorrect result from Shift_Right_Arithmetic - 2");
- end if;
-
- -- Case where the parameter Value is greater than or equal to
- -- one half of the modulus. One bits will be shifted in.
-
- TC_Amount := 1;
- TC_Val_Unsigned_32 := 2**31; -- One half of modulus
- TC_Result_Unsigned_32 := Shift_Right_Arithmetic(TC_Val_Unsigned_32,
- TC_Amount);
- if TC_Result_Unsigned_32 /= (2**31 + 2**30) then
- Report.Failed
- ("Incorrect result from Shift_Right_Arithmetic - 3");
- end if;
-
- TC_Amount := 1;
- TC_Val_Unsigned_32 := (2**31 + 2**1);
- TC_Result_Unsigned_32 := Shift_Right_Arithmetic(TC_Val_Unsigned_32,
- TC_Amount);
- if TC_Result_Unsigned_32 /= (2**31 + 2**30 + 2**0) then
- Report.Failed
- ("Incorrect result from Shift_Right_Arithmetic - 4");
- end if;
-
- if Shift_Right_Arithmetic(TC_Val_Unsigned_32, 0) /=
- TC_Val_Unsigned_32 or
- Shift_Right_Arithmetic(TC_Val_Unsigned_32, 3) /=
- (2**31 + 2**30 + 2**29 + 2**28)
- then
- Report.Failed
- ("Incorrect result from Shift_Right_Arithmetic - 5");
- end if;
-
-
- -- Function Rotate_Left.
-
- TC_Amount := 3;
- TC_Val_Unsigned_32 := Unsigned_32'Last;
- TC_Result_Unsigned_32 := Rotate_Left(Value => TC_Val_Unsigned_32,
- Amount => TC_Amount);
- if TC_Result_Unsigned_32 /= Unsigned_32'Last then
- Report.Failed("Incorrect result from Rotate_Left - 1");
- end if;
-
- TC_Val_Unsigned_32 := 2**31 + 2**30;
- if Rotate_Left(TC_Val_Unsigned_32, 1) /= (2**31 + 2**0) or
- Rotate_Left(TC_Val_Unsigned_32, 5) /= (2**4 + 2**3) or
- Rotate_Left(TC_Val_Unsigned_32, 32) /= TC_Val_Unsigned_32
- then
- Report.Failed("Incorrect result from Rotate_Left - 2");
- end if;
-
-
- -- Function Rotate_Right.
-
- TC_Amount := 2;
- TC_Val_Unsigned_32 := (2**1 + 2**0);
- TC_Result_Unsigned_32 := Rotate_Right(Value => TC_Val_Unsigned_32,
- Amount => TC_Amount);
- if TC_Result_Unsigned_32 /= (2**31 + 2**30) then
- Report.Failed("Incorrect result from Rotate_Right - 1");
- end if;
-
- if Rotate_Right(TC_Val_Unsigned_32, 3) /= (2**30 + 2**29) or
- Rotate_Right(TC_Val_Unsigned_32, 6) /= (2**27 + 2**26) or
- Rotate_Right(TC_Val_Unsigned_32, 32) /= (2**1 + 2**0)
- then
- Report.Failed("Incorrect result from Rotate_Right - 2");
- end if;
-
-
- -- Tests of Rotate_Left and Rotate_Right in combination.
-
- TC_Val_Unsigned_32 := (2**31 + 2**15 + 2**3);
-
- if Rotate_Left(Rotate_Right(TC_Val_Unsigned_32, 4), 3) /=
- (2**30 + 2**14 + 2**2) or
- Rotate_Left(Rotate_Right(TC_Val_Unsigned_32, 1), 3) /=
- (2**17 + 2**5 + 2**1) or
- Rotate_Right(Rotate_Left(TC_Val_Unsigned_32, 3), 7) /=
- (2**31 + 2**27 + 2**11) or
- Rotate_Right(Rotate_Left(TC_Val_Unsigned_32, 1), 32) /=
- (2**16 + 2**4 + 2**0)
- then
- Report.Failed("Incorrect result from Rotate_Left - " &
- "Rotate_Right functions used in combination");
- end if;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB2003;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3001.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3001.a
deleted file mode 100644
index 4d79b24e1f3..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3001.a
+++ /dev/null
@@ -1,179 +0,0 @@
--- CXB3001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the specifications of the package Interfaces.C are
--- available for use.
---
--- TEST DESCRIPTION:
--- This test verifies that the types and subprograms specified for the
--- interface are present. It just checks for the presence of
--- the subprograms. Other tests are designed to exercise the interface.
---
--- APPLICABILITY CRITERIA:
--- If an implementation provides package Interfaces.C, this test
--- must compile, execute, and report "PASSED".
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 Nov 95 SAIC Corrected To_C parameter list for ACVC 2.0.1.
--- 28 Feb 96 SAIC Added applicability criteria.
---
---!
-
-with Report;
-with Interfaces.C; -- N/A => ERROR
-
-procedure CXB3001 is
- package C renames Interfaces.C;
- use type C.signed_char;
- use type C.unsigned_char;
- use type C.char;
-
-begin
-
- Report.Test ("CXB3001", "Check the specification of Interfaces.C");
-
- declare -- encapsulate the test
-
-
- tst_CHAR_BIT : constant := C.CHAR_BIT;
- tst_SCHAR_MIN : constant := C.SCHAR_MIN;
- tst_SCHAR_MAX : constant := C.SCHAR_MAX;
- tst_UCHAR_MAX : constant := C.UCHAR_MAX;
-
- -- Signed and Unsigned Integers
-
- tst_int : C.int := C.int'first;
- tst_short : C.short := C.short'first;
- tst_long : C.long := C.long'first;
-
- tst_signed_char_min : C.signed_char := C.signed_char'first;
- tst_signed_char_max : C.signed_char := C.signed_char'last;
-
- tst_unsigned : C.unsigned;
- tst_unsigned_short : C.unsigned_short;
- tst_unsigned_long : C.unsigned_long;
-
- tst_unsigned_char : C.unsigned_char;
- tst_plain_char : C.plain_char;
-
- tst_ptrdiff_t : C.ptrdiff_t;
- tst_size_t : C.size_t;
-
- -- Floating-Point
-
- tst_C_float : C.C_float;
- tst_double : C.double;
- tst_long_double : C.long_double;
-
- -- Characters and Strings
-
- tst_char : C.char;
- tst_nul : C.char := C.nul;
-
- -- Collect all the subprogram calls such that they are compiled
- -- but not executed
- --
- procedure Collect_All_Calls is
-
- CAC_char : C.char;
- CAC_Character : Character;
- CAC_String : string (1..5);
- CAC_Boolean : Boolean := false;
- CAC_char_array : C.char_array(1..5);
- CAC_Integer : integer;
- CAC_Natural : natural;
- CAC_wchar_t : C.wchar_t;
- CAC_Wide_Character : Wide_Character;
- CAC_wchar_array : C.wchar_array(1..5);
- CAC_Wide_String : Wide_String(1..5);
- CAC_size_t : C.size_t;
-
- begin
-
- CAC_char := C.To_C (CAC_Character);
- CAC_Character := C.To_Ada (CAC_char);
-
- CAC_char_array := C.To_C (CAC_String, CAC_Boolean);
- CAC_String := C.To_Ada (CAC_char_array, CAC_Boolean);
-
- -- This call is out of LRM order so that we can use the
- -- array initialized above
- CAC_Boolean := C.Is_Nul_Terminated (CAC_char_array);
-
- C.To_C (CAC_String, CAC_char_array, CAC_size_t, CAC_Boolean);
- C.To_Ada (CAC_char_array, CAC_String, CAC_Natural, CAC_Boolean);
-
- CAC_wchar_t := C.To_C (CAC_Wide_Character);
- CAC_Wide_Character := C.To_Ada (CAC_wchar_t);
- CAC_wchar_t := C.wide_nul;
-
- CAC_wchar_array := C.To_C (CAC_Wide_String, CAC_Boolean);
- CAC_Wide_String := C.To_Ada (CAC_wchar_array, CAC_Boolean);
-
- -- This call is out of LRM order so that we can use the
- -- array initialized above
- CAC_Boolean := C.Is_Nul_Terminated (CAC_wchar_array);
-
- C.To_C (CAC_Wide_String, CAC_wchar_array, CAC_size_t, CAC_Boolean);
- C.To_Ada (CAC_wchar_array, CAC_Wide_String, CAC_Natural, CAC_Boolean);
-
- raise C.Terminator_Error;
-
- end Collect_All_Calls;
-
-
-
- begin -- encapsulation
-
- if tst_signed_char_min /= C.SCHAR_MIN then
- Report.Failed ("tst_signed_char_min is incorrect");
- end if;
- if tst_signed_char_max /= C.SCHAR_MAX then
- Report.Failed ("tst_signed_char_max is incorrect");
- end if;
- if C.signed_char'Size /= C.CHAR_BIT then
- Report.Failed ("C.signed_char'Size is incorrect");
- end if;
-
- if C.unsigned_char'first /= 0 or
- C.unsigned_char'last /= C.UCHAR_MAX or
- C.unsigned_char'size /= C.CHAR_BIT then
-
- Report.Failed ("unsigned_char is incorrectly defined");
-
- end if;
-
- if tst_nul /= C.char'first then
- Report.Failed ("tst_nul is incorrect");
- end if;
-
- end; -- encapsulation
-
- Report.Result;
-
-end CXB3001;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3002.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3002.a
deleted file mode 100644
index b543d467c46..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3002.a
+++ /dev/null
@@ -1,158 +0,0 @@
--- CXB3002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the specifications of the package Interfaces.C.Strings
--- are available for use.
---
--- TEST DESCRIPTION:
--- This test verifies that the types and subprograms specified for the
--- interface are present
---
--- APPLICABILITY CRITERIA:
--- If an implementation provides packages Interfaces.C and
--- Interfaces.C.Strings, this test must compile, execute, and
--- report "PASSED".
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 28 Feb 96 SAIC Added applicability criteria.
---
---!
-
-with Report;
-with Interfaces.C; -- N/A => ERROR
-with Interfaces.C.Strings; -- N/A => ERROR
-
-procedure CXB3002 is
- package Strings renames Interfaces.C.Strings;
- package C renames Interfaces.C;
-
-begin
-
- Report.Test ("CXB3002", "Check the specification of Interfaces.C.Strings");
-
-
- declare -- encapsulate the test
-
- TC_Int_1 : integer := 1;
- TC_Int_2 : integer := 1;
- TC_String : String := "ABCD";
- TC_Boolean : Boolean := true;
- TC_char_array : C.char_array (1..5);
- TC_size_t : C.size_t := C.size_t'first;
-
-
- -- Note In all of the following the Strings spec. being tested
- -- is shown in comment lines
- --
- -- type char_array_access is access all char_array;
- TST_char_array_access : Strings.char_array_access :=
- new Interfaces.C.char_array (1..5);
-
- -- type chars_ptr is private;
- -- Null_Ptr : constant chars_ptr;
- TST_chars_ptr : Strings.chars_ptr := Strings.Null_ptr;
-
- -- type chars_ptr_array is array (size_t range <>) of chars_ptr;
- TST_chars_ptr_array : Strings.chars_ptr_array(1..5);
-
- begin -- encapsulation
-
- -- Arrange that the calls to the subprograms are compiled but
- -- not executed
- --
- if not Report.Equal ( TC_Int_1, TC_Int_2 ) then
-
- -- function To_Chars_Ptr (Item : in char_array_access;
- -- Nul_Check : in Boolean := False)
- -- return chars_ptr;
- TST_chars_ptr := Strings.To_Chars_Ptr
- (TST_char_array_access, TC_Boolean);
-
- -- This one is out of LRM order so that we can "initialize"
- -- TC_char_array for the "in" parameter of the next one
- --
- -- function Value (Item : in chars_ptr) return char_array;
- TC_char_array := Strings.Value (TST_chars_ptr);
-
- -- function New_Char_Array (Chars : in char_array)
- -- return chars_ptr;
- TST_chars_ptr := Strings.New_Char_Array (TC_char_array);
-
- -- function New_String (Str : in String) return chars_ptr;
- TST_chars_ptr := Strings.New_String ("TEST STRING");
-
- -- procedure Free (Item : in out chars_ptr);
- Strings.Free (TST_chars_ptr);
-
- -- function Value (Item : in chars_ptr; Length : in size_t)
- -- return char_array;
- TC_char_array := Strings.Value (TST_chars_ptr, TC_size_t);
-
- -- Use Report.Comment as a known procedure which takes a string as
- -- a parameter (this does not actually get output)
- -- function Value (Item : in chars_ptr) return String;
- Report.Comment ( Strings.Value (TST_chars_ptr) );
-
- -- function Value (Item : in chars_ptr; Length : in size_t)
- -- return String;
- TC_String := Strings.Value (TST_chars_ptr, TC_size_t);
-
- -- function Strlen (Item : in chars_ptr) return size_t;
- TC_size_t := Strings.Strlen (TST_chars_ptr);
-
- -- procedure Update (Item : in chars_ptr;
- -- Offset : in size_t;
- -- Chars : in char_array;
- -- Check : in Boolean := True);
- Strings.Update (TST_chars_ptr, TC_size_t, TC_char_array, TC_Boolean);
-
- -- procedure Update (Item : in chars_ptr;
- -- Offset : in size_t;
- -- Str : in String;
- -- Check : in Boolean := True);
- Strings.Update (TST_chars_ptr, TC_size_t, TC_String, TC_Boolean);
-
- -- Update_Error : exception;
- raise Strings.Update_Error;
-
- end if;
-
- if not Report.Equal ( TC_Int_2, TC_Int_1 ) then
-
- -- This exception is out of LRM presentation order to avoid
- -- compiler warnings about unreachable code
- -- Dereference_Error : exception;
- raise Strings.Dereference_Error;
-
- end if;
-
- end; -- encapsulation
-
- Report.Result;
-
-end CXB3002;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3003.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3003.a
deleted file mode 100644
index c395837489d..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3003.a
+++ /dev/null
@@ -1,167 +0,0 @@
--- CXB3003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the specifications of the package Interfaces.C.Pointers
--- are available for use.
---
--- TEST DESCRIPTION:
--- This test verifies that the types and subprograms specified for the
--- interface are present
---
--- APPLICABILITY CRITERIA:
--- If an implementation provides package Interfaces.C.Pointers, this
--- test must compile, execute, and report "PASSED".
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 28 Feb 96 SAIC Added applicability criteria.
---
---!
-
-with Report;
-with Interfaces.C.Pointers; -- N/A => ERROR
-
-procedure CXB3003 is
- package C renames Interfaces.C;
-
- package Test_Ptrs is new C.Pointers
- (Index => C.size_t,
- Element => C.Char,
- Element_Array => C.Char_Array,
- Default_Terminator => C.Nul);
-
-begin
-
- Report.Test ("CXB3003", "Check the specification of Interfaces.C.Pointers");
-
-
- declare -- encapsulate the test
-
- TC_Int : integer := 1;
-
- -- Note: In all of the following the Pointers spec. being tested
- -- is shown in comments
- --
- -- type Pointer is access all Element;
- subtype TST_Pointer_Type is Test_Ptrs.Pointer;
-
- TST_Element : C.Char := C.Char'First;
- TST_Pointer : TST_Pointer_Type := null;
- TST_Pointer_2 : TST_Pointer_Type := null;
- TST_Array : C.char_array (1..5);
- TST_Index : C.ptrdiff_t := C.ptrdiff_t'First;
-
- begin -- encapsulation
-
- -- Arrange that the calls to the subprograms are compiled but
- -- not executed
- --
- if not Report.Equal ( TC_Int, TC_Int ) then
-
-
- -- function Value (Ref : in Pointer;
- -- Terminator : in Element := Default_Terminator)
- -- return Element_Array;
-
- TST_Array := Test_Ptrs.Value ( TST_Pointer ); -- default
- TST_Array := Test_Ptrs.Value ( TST_Pointer, TST_Element );
-
- -- function Value (Ref : in Pointer; Length : in ptrdiff_t)
- -- return Element_Array;
-
- TST_Array := Test_Ptrs.Value (TST_Pointer, TST_Index);
-
- --
- -- -- C-style Pointer arithmetic
- --
- -- function "+" (Left : in Pointer; Right : in ptrdiff_t)
- -- return Pointer;
- TST_Pointer := Test_Ptrs."+" (TST_Pointer, TST_Index);
-
- -- function "+" (Left : in Ptrdiff_T; Right : in Pointer)
- -- return Pointer;
- TST_Pointer := Test_Ptrs."+" (TST_Index, TST_Pointer);
-
- -- function "-" (Left : in Pointer; Right : in ptrdiff_t)
- -- return Pointer;
- TST_Pointer := Test_Ptrs."-" (TST_Pointer, TST_Index);
-
- -- function "-" (Left : in Pointer; Right : in Pointer)
- -- return ptrdiff_t;
- TST_Index := Test_Ptrs."-" (TST_Pointer, TST_Pointer);
-
- -- procedure Increment (Ref : in out Pointer);
- Test_Ptrs.Increment (TST_Pointer);
-
- -- procedure Decrement (Ref : in out Pointer);
- Test_Ptrs.Decrement (TST_Pointer);
-
- -- function Virtual_Length
- -- ( Ref : in Pointer;
- -- Terminator : in Element := Default_Terminator)
- -- return ptrdiff_t;
- TST_Index := Test_Ptrs.Virtual_Length (TST_Pointer);
- TST_Index := Test_Ptrs.Virtual_Length (TST_Pointer, TST_Element);
-
- -- procedure Copy_Terminated_Array
- -- (Source : in Pointer;
- -- Target : in Pointer;
- -- Limit : in ptrdiff_t := ptrdiff_t'Last;
- -- Terminator : in Element := Default_Terminator);
-
- Test_Ptrs.Copy_Terminated_Array (TST_Pointer, TST_Pointer_2);
-
- Test_Ptrs.Copy_Terminated_Array (TST_Pointer,
- TST_Pointer_2,
- TST_Index);
-
- Test_Ptrs.Copy_Terminated_Array (TST_Pointer,
- TST_Pointer_2,
- TST_Index,
- TST_Element);
-
-
- -- procedure Copy_Array
- -- (Source : in Pointer;
- -- Target : in Pointer;
- -- Length : in ptrdiff_t);
-
- Test_Ptrs.Copy_Array (TST_Pointer, TST_Pointer_2, TST_Index);
-
- -- This is out of LRM order to avoid complaints from compilers
- -- about inaccessible code
- -- Pointer_Error : exception;
-
- raise Test_Ptrs.Pointer_Error;
-
- end if;
-
- end; -- encapsulation
-
- Report.Result;
-
-end CXB3003;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3005.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3005.a
deleted file mode 100644
index 30b94053598..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3005.a
+++ /dev/null
@@ -1,396 +0,0 @@
--- CXB3005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the procedure To_C converts the character elements of
--- a string parameter into char elements of the char_array parameter
--- Target, with nul termination if parameter Append_Nul is true.
---
--- Check that the out parameter Count of procedure To_C is set to the
--- appropriate value for both the nul/no nul terminated cases.
---
--- Check that Constraint_Error is propagated by procedure To_C if the
--- length of the char_array parameter Target is not sufficient to
--- hold the converted string value.
---
--- Check that the Procedure To_Ada converts char elements of the
--- char_array parameter Item to the corresponding character elements
--- of string out parameter Target.
---
--- Check that Constraint_Error is propagated by Procedure To_Ada if the
--- length of string parameter Target is not long enough to hold the
--- converted char_array value.
---
--- Check that Terminator_Error is propagated by Procedure To_Ada if the
--- parameter Trim_Nul is set to True, but the actual Item parameter
--- contains no nul char.
---
--- TEST DESCRIPTION:
--- This test uses a variety of String, and char_array objects to test
--- versions of the To_C and To_Ada procedures.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.C.char:
--- ' ', 'a'..'z', 'A'..'Z', '0'..'9', and '-'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.C. If an implementation provides
--- package Interfaces.C, this test must compile, execute, and
--- report "PASSED".
---
--- CHANGE HISTORY:
--- 01 Sep 95 SAIC Initial prerelease version.
--- 09 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 26 Oct 96 SAIC Incorporated reviewer comments.
--- 14 Sep 99 RLB Removed incorrect and unnecessary
--- Unchecked_Conversion.
---
---!
-
-with Report;
-with Interfaces.C; -- N/A => ERROR
-with Ada.Characters.Latin_1;
-with Ada.Exceptions;
-with Ada.Strings.Fixed;
-
-procedure CXB3005 is
-begin
-
- Report.Test ("CXB3005", "Check that the procedures To_C and To_Ada " &
- "produce correct results");
- Test_Block:
- declare
-
- use Interfaces, Interfaces.C;
- use Ada.Characters;
- use Ada.Exceptions;
- use Ada.Strings.Fixed;
-
- TC_Short_String : String(1..4) := (others => 'x');
- TC_String : String(1..8) := (others => 'y');
- TC_char_array : char_array(0..7) := (others => char'Last);
- TC_size_t_Count : size_t := size_t'First;
- TC_Natural_Count : Natural := Natural'First;
-
-
- -- We can use the character forms of To_Ada and To_C here to check
- -- the results; they were tested in CXB3004. We give them different
- -- names to avoid confusion below.
-
- function Character_to_char (Source : in Character) return char
- renames To_C;
- function char_to_Character (Source : in char) return Character
- renames To_Ada;
-
- begin
-
- -- Check that the procedure To_C converts the character elements of
- -- a string parameter into char elements of char_array out parameter
- -- Target.
- --
- -- Case of nul termination.
-
- TC_String(1..6) := "abcdef";
-
- To_C (Item => TC_String(1..6), -- Source slice of length 6.
- Target => TC_char_array, -- Length 8 will accommodate nul.
- Count => TC_size_t_Count,
- Append_Nul => True);
-
- -- Check that the out parameter Count is set to the appropriate value
- -- for the nul terminated case.
-
- if TC_size_t_Count /= 7 then
- Report.Failed("Incorrect setting of out parameter Count by " &
- "Procedure To_C when Append_Nul => True");
- end if;
-
- for i in 1..TC_size_t_Count-1 loop
- if char_to_Character(TC_char_array(i-1)) /= TC_String(Integer(i))
- then
- Report.Failed("Incorrect result from Procedure To_C when " &
- "checking individual char values, case of " &
- "Append_Nul => True; " &
- "char position = " & Integer'Image(Integer(i)));
- end if;
- end loop;
-
- if not Is_Nul_Terminated(TC_char_array) then
- Report.Failed("No nul char appended to the char_array result " &
- "from Procedure To_C when Append_Nul => True");
- end if;
-
- if TC_char_array(0..6) /= To_C("abcdef", True) then
- Report.Failed("Incorrect result from Procedure To_C when " &
- "directly comparing char_array results, case " &
- "of Append_Nul => True");
- end if;
-
-
- -- Check Procedure To_C with no nul termination.
-
- TC_char_array := (others => Character_to_char('M')); -- Reinitialize.
- TC_String(1..4) := "WXYZ";
-
- To_C (Item => TC_String(1..4), -- Source slice of length 4.
- Target => TC_char_array,
- Count => TC_size_t_Count,
- Append_Nul => False);
-
- -- Check that the out parameter Count is set to the appropriate value
- -- for the non-nul terminated case.
-
- if TC_size_t_Count /= 4 then
- Report.Failed("Incorrect setting of out parameter Count by " &
- "Procedure To_C when Append_Nul => False");
- end if;
-
- for i in 1..TC_size_t_Count loop
- if char_to_Character(TC_char_array(i-1)) /= TC_String(Integer(i))
- then
- Report.Failed("Incorrect result from Procedure To_C when " &
- "checking individual char values, case of " &
- "Append_Nul => False; " &
- "char position = " & Integer'Image(Integer(i)));
- end if;
- end loop;
-
- if Is_Nul_Terminated(TC_char_array) then
- Report.Failed("The nul char was appended to the char_array " &
- "result of Procedure To_C when Append_Nul => False");
- end if;
-
- if TC_char_array(0..3) /= To_C("WXYZ", False) then
- Report.Failed("Incorrect result from Procedure To_C when " &
- "directly comparing char_array results, case " &
- "of Append_Nul => False");
- end if;
-
-
-
- -- Check that Constraint_Error is raised by procedure To_C if the
- -- length of the target char_array parameter is not sufficient to
- -- hold the converted string value (plus nul if Append_Nul is True).
-
- begin
- To_C("A string too long",
- TC_char_array,
- TC_size_t_Count,
- Append_Nul => True);
-
- Report.Failed("Constraint_Error not raised when the Target " &
- "parameter of Procedure To_C is not long enough " &
- "to hold the converted string");
- Report.Comment(char_to_Character(TC_char_array(0)) &
- " printed to defeat optimization");
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure " &
- "To_C when the Target parameter is not long " &
- "enough to contain the char_array result");
- end;
-
-
-
- -- Check that the procedure To_Ada converts char elements of the
- -- char_array parameter Item to the corresponding character elements
- -- of string out parameter Target, with result string length based on
- -- the Trim_Nul parameter.
- --
- -- Case of appended nul char on the char_array In parameter.
-
- TC_char_array := To_C ("ACVC-95", Append_Nul => True); -- 8 total chars.
- TC_String := (others => '*'); -- Reinitialize.
-
- To_Ada (Item => TC_char_array,
- Target => TC_String,
- Count => TC_Natural_Count,
- Trim_Nul => False);
-
- if TC_Natural_Count /= 8 then
- Report.Failed("Incorrect value returned in out parameter Count " &
- "by Procedure To_Ada, case of Trim_Nul => False");
- end if;
-
- for i in 1..TC_Natural_Count loop
- if Character_to_char(TC_String(i)) /= TC_char_array(size_t(i-1))
- then
- Report.Failed("Incorrect result from Procedure To_Ada when " &
- "checking individual char values, case of " &
- "Trim_Nul => False, when a nul is present in " &
- "the char_array input parameter; " &
- "position = " & Integer'Image(Integer(i)));
- end if;
- end loop;
-
- if TC_String(TC_Natural_Count) /= Latin_1.Nul then
- Report.Failed("Last character of String result of Procedure " &
- "To_Ada is not Nul, even though a nul was present " &
- "in the char_array argument, and the Trim_Nul " &
- "parameter was set to False");
- end if;
-
-
- TC_char_array(0..3) := To_C ("XYz", Append_Nul => True); -- 4 chars.
- TC_String := (others => '*'); -- Reinit.
-
- To_Ada (Item => TC_char_array,
- Target => TC_String,
- Count => TC_Natural_Count,
- Trim_Nul => True);
-
- if TC_Natural_Count /= 3 then
- Report.Failed("Incorrect value returned in out parameter Count " &
- "by Procedure To_Ada, case of Trim_Nul => True");
- end if;
-
- for i in 1..TC_Natural_Count loop
- if Character_to_char(TC_String(i)) /= TC_char_array(size_t(i-1))
- then
- Report.Failed("Incorrect result from Procedure To_Ada when " &
- "checking individual char values, case of " &
- "Trim_Nul => True, when a nul is present in " &
- "the char_array input parameter; " &
- "position = " & Integer'Image(Integer(i)));
- end if;
- end loop;
-
- if TC_String(TC_Natural_Count) = Latin_1.Nul then
- Report.Failed("Last character of String result of Procedure " &
- "To_Ada is Nul, even though the Trim_Nul " &
- "parameter was set to True");
- end if;
-
- -- Check that TC_String(TC_Natural_Count+1) is unchanged by procedure
- -- To_Ada.
-
- if TC_String(TC_Natural_Count+1) /= '*' then
- Report.Failed("Incorrect modification to TC_String at position " &
- Integer'Image(TC_Natural_Count+1) & " expected = " &
- "*, found = " & TC_String(TC_Natural_Count+1));
- end if;
-
-
- -- Case of no nul char being present in the char_array argument.
-
- TC_char_array := To_C ("ABCDWXYZ", Append_Nul => False);
- TC_String := (others => '*'); -- Reinitialize.
-
- To_Ada (Item => TC_char_array,
- Target => TC_String,
- Count => TC_Natural_Count,
- Trim_Nul => False);
-
- if TC_Natural_Count /= 8 then
- Report.Failed("Incorrect value returned in out parameter Count " &
- "by Procedure To_Ada, case of Trim_Nul => False, " &
- "with no nul char present in the parameter Item");
- end if;
-
- for i in 1..TC_Natural_Count loop
- if Character_to_char(TC_String(i)) /= TC_char_array(size_t(i-1))
- then
- Report.Failed("Incorrect result from Procedure To_Ada when " &
- "checking individual char values, case of " &
- "Trim_Nul => False, when a nul is not present " &
- "in the char_array input parameter; " &
- "position = " & Integer'Image(Integer(i)));
- end if;
- end loop;
-
- if TC_String(TC_Natural_Count) = Latin_1.Nul then
- Report.Failed("Last character of String result of Procedure " &
- "To_Ada is Nul, even though the nul char was " &
- "not present in the parameter Item, with the " &
- "parameter Trim_Nul => False");
- end if;
-
-
-
- -- Check that the Procedure To_Ada raises Terminator_Error if the
- -- parameter Trim_Nul is set to True, but the actual Item parameter
- -- does not contain the nul char.
-
- begin
- TC_char_array := To_C ("ABCDWXYZ", Append_Nul => False);
- TC_String := (others => '*');
-
- To_Ada(TC_char_array,
- TC_String,
- Count => TC_Natural_Count,
- Trim_Nul => True);
-
- Report.Failed("Terminator_Error not raised when Item " &
- "parameter of To_Ada does not contain the " &
- "nul char, but parameter Trim_Nul => True");
- Report.Comment(TC_String & " printed to defeat optimization");
- exception
- when Terminator_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure " &
- "To_Ada when the Item parameter does not " &
- "contain the nul char, but parameter " &
- "Trim_Nul => True");
- end;
-
-
-
- -- Check that Constraint_Error is propagated by procedure To_Ada if the
- -- length of string parameter Target is not long enough to hold the
- -- converted char_array value (plus nul if Trim_Nul is False).
-
- begin
- TC_char_array(0..4) := To_C ("ABCD", Append_Nul => True);
-
- To_Ada(TC_char_array(0..4), -- 4 chars plus nul char.
- TC_Short_String, -- Length of 4.
- Count => TC_Natural_Count,
- Trim_Nul => False);
-
- Report.Failed("Constraint_Error not raised when string " &
- "parameter Target of Procedure To_Ada is not " &
- "long enough to hold the converted chars");
- Report.Comment(TC_Short_String & " printed to defeat optimization");
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure " &
- "To_Ada when string parameter Target is " &
- "not long enough to hold the converted chars");
- end;
-
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB3005;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3007.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3007.a
deleted file mode 100644
index 3837e0bae1f..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3007.a
+++ /dev/null
@@ -1,408 +0,0 @@
--- CXB3007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the procedure To_C converts the Wide_Character elements
--- of a Wide_String parameter into wchar_t elements of the wchar_array
--- parameter Target, with wide_nul termination if parameter Append_Nul
--- is true.
---
--- Check that the out parameter Count of procedure To_C is set to the
--- appropriate value for both the wide_nul/no wide_nul terminated cases.
---
--- Check that Constraint_Error is propagated by procedure To_C if the
--- length of the wchar_array parameter Target is not sufficient to
--- hold the converted Wide_String value.
---
--- Check that the Procedure To_Ada converts wchar_t elements of the
--- wchar_array parameter Item to the corresponding Wide_Character
--- elements of Wide_String out parameter Target.
---
--- Check that Constraint_Error is propagated by Procedure To_Ada if the
--- length of Wide_String parameter Target is not long enough to hold the
--- converted wchar_array value.
---
--- Check that Terminator_Error is propagated by Procedure To_Ada if the
--- parameter Trim_Nul is set to True, but the actual Item parameter
--- contains no wide_nul wchar_t.
---
--- TEST DESCRIPTION:
--- This test uses a variety of Wide_String, and wchar_array objects to
--- test versions of the To_C and To_Ada procedures.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.C.wchar_t:
--- ' ', 'a'..'z', 'A'..'Z', and '-'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.C. If an implementation provides
--- package Interfaces.C, this test must compile, execute, and
--- report "PASSED".
---
--- CHANGE HISTORY:
--- 01 Sep 95 SAIC Initial prerelease version.
--- 09 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 26 Oct 96 SAIC Incorporated reviewer comments.
--- 14 Sep 99 RLB Removed incorrect and unnecessary
--- Unchecked_Conversion.
---
---!
-
-with Report;
-with Interfaces.C; -- N/A => ERROR
-with Ada.Characters.Latin_1;
-with Ada.Characters.Handling;
-with Ada.Exceptions;
-with Ada.Strings.Wide_Fixed;
-
-procedure CXB3007 is
-begin
-
- Report.Test ("CXB3007", "Check that the procedures To_C and To_Ada " &
- "for wide strings produce correct results");
- Test_Block:
- declare
-
- use Interfaces, Interfaces.C;
- use Ada.Characters, Ada.Characters.Handling;
- use Ada.Exceptions;
- use Ada.Strings.Wide_Fixed;
-
- TC_Short_Wide_String : Wide_String(1..4) :=
- (others => Wide_Character'First);
- TC_Wide_String : Wide_String(1..8) :=
- (others => Wide_Character'First);
- TC_wchar_array : wchar_array(0..7) := (others => wchar_t'First);
- TC_size_t_Count : size_t := size_t'First;
- TC_Natural_Count : Natural := Natural'First;
-
-
- -- We can use the wide character forms of To_Ada and To_C here to check
- -- the results; they were tested in CXB3006. We give them different
- -- names to avoid confusion below.
-
- function Wide_Character_to_wchar_t (Source : in Wide_Character)
- return wchar_t renames To_C;
- function wchar_t_to_Wide_Character (Source : in wchar_t)
- return Wide_Character renames To_Ada;
-
- begin
-
- -- Check that the procedure To_C converts the Wide_Character elements
- -- of a Wide_String parameter into wchar_t elements of wchar_array out
- -- parameter Target.
- --
- -- Case of wide_nul termination.
-
- TC_Wide_String(1..6) := "abcdef";
-
- To_C (Item => TC_Wide_String(1..6), -- Source slice of length 6.
- Target => TC_wchar_array,
- Count => TC_size_t_Count,
- Append_Nul => True);
-
- -- Check that the out parameter Count is set to the appropriate value
- -- for the wide_nul terminated case.
-
- if TC_size_t_Count /= 7 then
- Report.Failed("Incorrect setting of out parameter Count by " &
- "Procedure To_C when Append_Nul => True");
- end if;
-
- for i in 1..TC_size_t_Count-1 loop
- if wchar_t_to_Wide_Character(TC_wchar_array(i-1)) /=
- TC_Wide_String(Integer(i))
- then
- Report.Failed("Incorrect result from Procedure To_C when " &
- "checking individual wchar_t values, case of " &
- "Append_Nul => True; " &
- "wchar_t position = " & Integer'Image(Integer(i)));
- end if;
- end loop;
-
- if not Is_Nul_Terminated(TC_wchar_array) then
- Report.Failed("No wide_nul wchar_t appended to the wchar_array " &
- "result from Procedure To_C when Append_Nul => True");
- end if;
-
- if TC_wchar_array(0..6) /= To_C("abcdef", True) then
- Report.Failed("Incorrect result from Procedure To_C when " &
- "directly comparing wchar_array results, case " &
- "of Append_Nul => True");
- end if;
-
-
- -- Check Procedure To_C with no wide_nul termination.
-
- TC_wchar_array := (others => Wide_Character_to_wchar_t('M'));
- TC_Wide_String(1..4) := "WXYZ";
-
- To_C (Item => TC_Wide_String(1..4), -- Source slice of length 4.
- Target => TC_wchar_array,
- Count => TC_size_t_Count,
- Append_Nul => False);
-
- -- Check that the out parameter Count is set to the appropriate value
- -- for the non-wide_nul terminated case.
-
- if TC_size_t_Count /= 4 then
- Report.Failed("Incorrect setting of out parameter Count by " &
- "Procedure To_C when Append_Nul => False");
- end if;
-
- for i in 1..TC_size_t_Count loop
- if wchar_t_to_Wide_Character(TC_wchar_array(i-1)) /=
- TC_Wide_String(Integer(i))
- then
- Report.Failed("Incorrect result from Procedure To_C when " &
- "checking individual wchar_t values, case of " &
- "Append_Nul => False; " &
- "wchar_t position = " & Integer'Image(Integer(i)));
- end if;
- end loop;
-
- if Is_Nul_Terminated(TC_wchar_array) then
- Report.Failed
- ("The wide_nul wchar_t was appended to the wchar_array " &
- "result of Procedure To_C when Append_Nul => False");
- end if;
-
- if TC_wchar_array(0..3) /= To_C("WXYZ", False) then
- Report.Failed("Incorrect result from Procedure To_C when " &
- "directly comparing wchar_array results, case " &
- "of Append_Nul => False");
- end if;
-
-
-
- -- Check that Constraint_Error is raised by procedure To_C if the
- -- length of the target wchar_array parameter is not sufficient to
- -- hold the converted Wide_String value (plus wide_nul if Append_Nul
- -- is True).
-
- TC_wchar_array := (others => wchar_t'First);
- begin
- To_C("A string too long",
- TC_wchar_array,
- TC_size_t_Count,
- Append_Nul => True);
-
- Report.Failed("Constraint_Error not raised when the Target " &
- "parameter of Procedure To_C is not long enough " &
- "to hold the converted Wide_String");
- Report.Comment
- (To_Character(wchar_t_to_Wide_Character(TC_wchar_array(0))) &
- " printed to defeat optimization");
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure " &
- "To_C when the Target parameter is not long " &
- "enough to contain the wchar_array result");
- end;
-
-
-
- -- Check that the procedure To_Ada converts wchar_t elements of the
- -- wchar_array parameter Item to the corresponding Wide_Character
- -- elements of Wide_String out parameter Target, with result wide
- -- string length based on the Trim_Nul parameter.
- --
- -- Case of appended wide_nul wchar_t on the wchar_array In parameter.
-
- TC_wchar_array :=
- To_C ("ACVC-95", Append_Nul => True); -- 8 total chars.
-
- To_Ada (Item => TC_wchar_array,
- Target => TC_Wide_String,
- Count => TC_Natural_Count,
- Trim_Nul => False);
-
- if TC_Natural_Count /= 8 then
- Report.Failed("Incorrect value returned in out parameter Count " &
- "by Procedure To_Ada, case of Trim_Nul => False");
- end if;
-
- for i in 1..TC_Natural_Count loop
- if Wide_Character_to_wchar_t(TC_Wide_String(i)) /=
- TC_wchar_array(size_t(i-1))
- then
- Report.Failed("Incorrect result from Procedure To_Ada when " &
- "checking individual wchar_t values, case of " &
- "Trim_Nul => False, when a wide_nul is present " &
- "in the wchar_array input parameter; " &
- "position = " & Integer'Image(Integer(i)));
- end if;
- end loop;
-
- if TC_Wide_String(TC_Natural_Count) /= To_Wide_Character(Latin_1.Nul)
- then
- Report.Failed("Last Wide_Character of Wide_String result of " &
- "Procedure To_Ada is not Nul, even though a " &
- "wide_nul was present in the wchar_array argument, " &
- "and the Trim_Nul parameter was set to False");
- end if;
-
-
- TC_Wide_String := (others => Wide_Character'First);
- TC_wchar_array(0..3) := To_C ("XYz", Append_Nul => True); -- 4 chars.
-
- To_Ada (Item => TC_wchar_array,
- Target => TC_Wide_String,
- Count => TC_Natural_Count,
- Trim_Nul => True);
-
- if TC_Natural_Count /= 3 then
- Report.Failed("Incorrect value returned in out parameter Count " &
- "by Procedure To_Ada, case of Trim_Nul => True");
- end if;
-
- for i in 1..TC_Natural_Count loop
- if Wide_Character_to_wchar_t(TC_Wide_String(i)) /=
- TC_wchar_array(size_t(i-1))
- then
- Report.Failed("Incorrect result from Procedure To_Ada when " &
- "checking individual wchar_t values, case of " &
- "Trim_Nul => True, when a wide_nul is present " &
- "in the wchar_array input parameter; " &
- "position = " & Integer'Image(Integer(i)));
- end if;
- end loop;
-
- if TC_Wide_String(TC_Natural_Count) = To_Wide_Character(Latin_1.Nul)
- then
- Report.Failed("Last Wide_Character of Wide_String result of " &
- "Procedure To_Ada is Nul, even though the " &
- "Trim_Nul parameter was set to True");
- end if;
-
- if TC_Wide_String(TC_Natural_Count+1) /= Wide_Character'First then
- Report.Failed("Incorrect replacement from To_Ada");
- end if;
-
-
- -- Case of no wide_nul wchar_t present in the wchar_array argument.
-
- TC_Wide_String := (others => Wide_Character'First);
- TC_wchar_array := To_C ("ABCDWXYZ", Append_Nul => False);
-
- To_Ada (Item => TC_wchar_array,
- Target => TC_Wide_String,
- Count => TC_Natural_Count,
- Trim_Nul => False);
-
- if TC_Natural_Count /= 8 then
- Report.Failed("Incorrect value returned in out parameter Count " &
- "by Procedure To_Ada, case of Trim_Nul => False, " &
- "with no wide_nul wchar_t present in the parameter " &
- "Item");
- end if;
-
- for i in 1..TC_Natural_Count loop
- if Wide_Character_to_wchar_t(TC_Wide_String(i)) /=
- TC_wchar_array(size_t(i-1))
- then
- Report.Failed("Incorrect result from Procedure To_Ada when " &
- "checking individual wchar_t values, case of " &
- "Trim_Nul => False, when a wide_nul is not " &
- "present in the wchar_array input parameter; " &
- "position = " & Integer'Image(Integer(i)));
- end if;
- end loop;
-
- if TC_Wide_String(TC_Natural_Count) = To_Wide_Character(Latin_1.Nul)
- then
- Report.Failed("Last Wide_Character of Wide_String result of " &
- "Procedure To_Ada is Nul, even though the wide_nul " &
- "wchar_t was not present in the parameter Item, " &
- "with the parameter Trim_Nul => False");
- end if;
-
-
-
- -- Check that the Procedure To_Ada raises Terminator_Error if the
- -- parameter Trim_Nul is set to True, but the actual Item parameter
- -- does not contain the wide_nul wchar_t.
-
- begin
- TC_Wide_String := (others => Wide_Character'First);
- TC_wchar_array := To_C ("ABCDWXYZ", Append_Nul => False);
-
- To_Ada(TC_wchar_array,
- TC_Wide_String,
- Count => TC_Natural_Count,
- Trim_Nul => True);
-
- Report.Failed("Terminator_Error not raised when Item " &
- "parameter of To_Ada does not contain the " &
- "wide_nul wchar_t, but parameter Trim_Nul => True");
- Report.Comment(To_String(TC_Wide_String) &
- " printed to defeat optimization");
- exception
- when Terminator_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure " &
- "To_Ada when the Item parameter does not " &
- "contain the wide_nul wchar_t, but parameter " &
- "Trim_Nul => True");
- end;
-
-
-
- -- Check that Constraint_Error is propagated by procedure To_Ada if the
- -- length of Wide_String parameter Target is not long enough to hold the
- -- converted wchar_array value (plus wide_nul if Trim_Nul is False).
-
- begin
- TC_wchar_array(0..4) := To_C ("ABCD", Append_Nul => True);
-
- To_Ada(TC_wchar_array(0..4),
- TC_Short_Wide_String, -- Length of 4.
- Count => TC_Natural_Count,
- Trim_Nul => False);
-
- Report.Failed("Constraint_Error not raised when Wide_String " &
- "parameter Target of Procedure To_Ada is not " &
- "long enough to hold the converted wchar_ts");
- Report.Comment(To_String(TC_Short_Wide_String) &
- " printed to defeat optimization");
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure " &
- "To_Ada when Wide_String parameter Target is " &
- "not long enough to hold the converted wchar_ts");
- end;
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB3007;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3008.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3008.a
deleted file mode 100644
index 9df19d814c3..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3008.a
+++ /dev/null
@@ -1,226 +0,0 @@
--- CXB3008.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that functions imported from the C language <string.h> and
--- <stdlib.h> libraries can be called from an Ada program.
---
--- TEST DESCRIPTION:
--- This test checks that C language functions from the <string.h> and
--- <stdlib.h> libraries can be used as completions of Ada subprograms.
--- A pragma Import with convention identifier "C" is used to complete
--- the Ada subprogram specifications.
--- The three subprogram cases tested are as follows:
--- 1) A C function that returns an int value (strcpy) is used as the
--- completion of an Ada procedure specification. The return value
--- is discarded; parameter modification is the desired effect.
--- 2) A C function that returns an int value (strlen) is used as the
--- completion of an Ada function specification.
--- 3) A C function that returns a double value (strtod) is used as the
--- completion of an Ada function specification.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.C.char:
--- ' ', 'a'..'z', 'A'..'Z', '0'..'9', and '$'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- packages Interfaces.C and Interfaces.C.Strings. If an
--- implementation provides these packages, this test must compile,
--- execute, and report "PASSED".
---
--- SPECIAL REQUIREMENTS:
--- The C language library functions used by this test must be
--- available for importing into the test.
---
---
--- CHANGE HISTORY:
--- 12 Oct 95 SAIC Initial prerelease version.
--- 09 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 01 DEC 97 EDS Replaced all references of C function atof with
--- C function strtod.
--- 29 JUN 98 EDS Give Ada function corresponding to strtod a
--- second parameter.
---!
-
-with Report;
-with Ada.Exceptions;
-with Interfaces.C; -- N/A => ERROR
-with Interfaces.C.Strings; -- N/A => ERROR
-with Interfaces.C.Pointers;
-
-procedure CXB3008 is
-begin
-
- Report.Test ("CXB3008", "Check that functions imported from the " &
- "C language predefined libraries can be " &
- "called from an Ada program");
-
- Test_Block:
- declare
-
- package IC renames Interfaces.C;
- package ICS renames Interfaces.C.Strings;
- package ICP is new Interfaces.C.Pointers
- ( Index => IC.size_t,
- Element => IC.char,
- Element_Array => IC.char_array,
- Default_Terminator => IC.nul );
- use Ada.Exceptions;
-
- use type IC.char;
- use type IC.char_array;
- use type IC.size_t;
- use type IC.double;
-
- -- The String_Copy procedure copies the string pointed to by Source,
- -- including the terminating nul char, into the char_array pointed
- -- to by Target.
-
- procedure String_Copy (Target : out IC.char_array;
- Source : in IC.char_array);
-
- -- The String_Length function returns the length of the nul-terminated
- -- string pointed to by The_String. The nul is not included in
- -- the count.
-
- function String_Length (The_String : in IC.char_array)
- return IC.size_t;
-
- -- The String_To_Double function converts the char_array pointed to
- -- by The_String into a double value returned through the function
- -- name. The_String must contain a valid floating-point number; if
- -- not, the value returned is zero.
-
--- type Acc_ptr is access IC.char_array;
- function String_To_Double (The_String : in IC.char_array ;
- End_Ptr : ICP.Pointer := null)
- return IC.double;
-
-
- -- Use the <string.h> strcpy function as a completion to the procedure
- -- specification. Note that the Ada interface to this C function is
- -- in the form of a procedure (C function return value is not used).
-
- pragma Import (C, String_Copy, "strcpy");
-
- -- Use the <string.h> strlen function as a completion to the
- -- String_Length function specification.
-
- pragma Import (C, String_Length, "strlen");
-
- -- Use the <stdlib.h> strtod function as a completion to the
- -- String_To_Double function specification.
-
- pragma Import (C, String_To_Double, "strtod");
-
-
- TC_String : constant String := "Just a Test";
- Char_Source : IC.char_array(0..30);
- Char_Target : IC.char_array(0..30);
- Double_Result : IC.double;
- Source_Ptr,
- Target_Ptr : ICS.chars_ptr;
-
- begin
-
- -- Check that the imported version of C function strcpy produces
- -- the correct results.
-
- Char_Source(0..21) := "Test of Pragma Import" & IC.nul;
-
- String_Copy(Char_Target, Char_Source);
-
- if Char_Target(0..21) /= Char_Source(0..21) then
- Report.Failed("Incorrect result from the imported version of " &
- "strcpy - 1");
- end if;
-
- if String_Length(Char_Target) /= 21 then
- Report.Failed("Incorrect result from the imported version of " &
- "strlen - 1");
- end if;
-
- Char_Source(0) := IC.nul;
-
- String_Copy(Char_Target, Char_Source);
-
- if Char_Target(0) /= Char_Source(0) then
- Report.Failed("Incorrect result from the imported version of " &
- "strcpy - 2");
- end if;
-
- if String_Length(Char_Target) /= 0 then
- Report.Failed("Incorrect result from the imported version of " &
- "strlen - 2");
- end if;
-
- -- The following chars_ptr designates a char_array of 12 chars
- -- (including the terminating nul char).
- Source_Ptr := ICS.New_Char_Array(IC.To_C(TC_String));
-
- String_Copy(Char_Target, ICS.Value(Source_Ptr));
-
- Target_Ptr := ICS.New_Char_Array(Char_Target);
-
- if ICS.Value(Target_Ptr) /= TC_String then
- Report.Failed("Incorrect result from the imported version of " &
- "strcpy - 3");
- end if;
-
- if String_Length(ICS.Value(Target_Ptr)) /= TC_String'Length then
- Report.Failed("Incorrect result from the imported version of " &
- "strlen - 3");
- end if;
-
-
- Char_Source(0..9) := "100.00only";
-
- Double_Result := String_To_Double(Char_Source);
-
- Char_Source(0..13) := "5050.00$$$$$$$";
-
- if Double_Result + String_To_Double(Char_Source) /= 5150.00 then
- Report.Failed("Incorrect result returned from the imported " &
- "version of function strtod - 1");
- end if;
-
- Char_Source(0..9) := "xxx$10.00x"; -- String doesn't contain a
- -- valid floating point value.
- if String_To_Double(Char_Source) /= 0.0 then
- Report.Failed("Incorrect result returned from the imported " &
- "version of function strtod - 2");
- end if;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB3008;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3009.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3009.a
deleted file mode 100644
index 3ea5a620442..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3009.a
+++ /dev/null
@@ -1,305 +0,0 @@
--- CXB3009.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the function To_Chars_Ptr will return a Null_Ptr value
--- when the parameter Item is null. If the parameter Item is not null,
--- and references a chars_array object that does contain the char nul,
--- and parameter Nul_Check is True, check that To_Chars_Ptr performs a
--- pointer conversion from char_array_access type to chars_ptr type.
--- Check that if parameter Item is not null, and references a
--- chars_array object that does not contain nul, and parameter Nul_Check
--- is True, the To_Chars_Ptr function will propagate Terminator_Error.
--- Check that if parameter Item is not null, and parameter Nul_Check
--- is False, check that To_Chars_Ptr performs a pointer conversion from
--- char_array_access type to chars_ptr type.
---
--- Check that the New_Char_Array function will return a chars_ptr type
--- pointer to an allocated object that has been initialized with
--- the value of parameter Chars.
---
--- Check that the function New_String returns a chars_ptr initialized
--- to a nul-terminated string having the value of the Str parameter.
---
--- TEST DESCRIPTION:
--- This test uses a variety of of string, char_array,
--- char_array_access and char_ptr values in order to validate the
--- functions under test, and results are compared for both length
--- and content.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.C.char:
--- ' ', 'a'..'z', and 'A'.. 'Z'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.C.Strings. If an implementation provides
--- package Interfaces.C.Strings, this test must compile, execute, and
--- report "PASSED".
---
---
--- CHANGE HISTORY:
--- 20 Sep 95 SAIC Initial prerelease version.
--- 09 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 01 DEC 97 EDS Remove incorrect block of code (previously
--- lines 264-287)
--- 14 Sep 99 RLB Added check for behavior of To_Chars_Ptr when
--- Nul_Check => False. (From Technical
--- Corrigendum 1).
---!
-
-with Report;
-with Interfaces.C.Strings; -- N/A => ERROR
-with Ada.Characters.Latin_1;
-with Ada.Exceptions;
-with Ada.Strings.Fixed;
-
-procedure CXB3009 is
-begin
-
- Report.Test ("CXB3009", "Check that functions To_Chars_Ptr, " &
- "New_Chars_Array, and New_String produce " &
- "correct results");
-
- Test_Block:
- declare
-
- package IC renames Interfaces.C;
- package ICS renames Interfaces.C.Strings;
- use Ada.Exceptions;
-
- use type IC.char_array;
- use type IC.size_t;
- use type ICS.chars_ptr;
-
- Null_Char_Array_Access : constant ICS.char_array_access := null;
-
- Test_String : constant String := "Test String";
- String_With_nul : String(1..6) := "Addnul";
- String_Without_nul : String(1..6) := "No nul";
-
- Char_Array_With_nul : IC.char_array(0..6) :=
- IC.To_C(String_With_nul, True);
- Char_Array_Without_nul : IC.char_array(0..5) :=
- IC.To_C(String_Without_nul, False);
- Char_Array_W_nul_Ptr : ICS.char_array_access :=
- new IC.char_array'(Char_Array_With_nul);
- Char_Array_WO_nul_Ptr : ICS.char_array_access :=
- new IC.char_array'(Char_Array_Without_nul);
-
- TC_chars_ptr : ICS.chars_ptr;
-
- TC_size_t : IC.size_t := IC.size_t'First;
-
-
- begin
-
- -- Check that the function To_Chars_Ptr will return a Null_Ptr value
- -- when the parameter Item is null.
-
- if ICS.To_Chars_Ptr(Item => Null_Char_Array_Access,
- Nul_Check => False) /= ICS.Null_Ptr or
- ICS.To_Chars_Ptr(Null_Char_Array_Access,
- Nul_Check => True) /= ICS.Null_Ptr or
- ICS.To_Chars_Ptr(Null_Char_Array_Access) /= ICS.Null_Ptr
- then
- Report.Failed("Incorrect result from function To_Chars_Ptr " &
- "with parameter Item being a null value");
- end if;
-
-
- -- Check that if the parameter Item is not null, and references a
- -- chars_array object that does contain the nul char, and parameter
- -- Nul_Check is True, function To_Chars_Ptr performs a pointer
- -- conversion from char_array_access type to chars_ptr type.
-
- begin
- TC_chars_ptr := ICS.To_Chars_Ptr(Item => Char_Array_W_nul_Ptr,
- Nul_Check => True);
-
- if ICS.Value(TC_chars_ptr) /= String_With_nul or
- ICS.Value(TC_chars_ptr) /= Char_Array_With_nul
- then
- Report.Failed("Incorrect result from function To_Chars_Ptr " &
- "with parameter Item being non-null and " &
- "containing the nul char");
- end if;
- exception
- when IC.Terminator_Error =>
- Report.Failed("Terminator_Error raised during the validation " &
- "of Function To_Chars_Ptr");
- when others =>
- Report.Failed("Unexpected exception raised during the " &
- "validation of Function To_Chars_Ptr");
- end;
-
- -- Check that if parameter Item is not null, and references a
- -- chars_array object that does not contain nul, and parameter
- -- Nul_Check is True, the To_Chars_Ptr function will propagate
- -- Terminator_Error.
-
- begin
- TC_chars_ptr := ICS.To_Chars_Ptr(Char_Array_WO_nul_Ptr, True);
- Report.Failed("Terminator_Error was not raised by function " &
- "To_Chars_Ptr when given a parameter Item that " &
- "is non-null, and does not contain the nul " &
- "char, but parameter Nul_Check is True");
- TC_size_t := ICS.Strlen(TC_chars_ptr); -- Use TC_chars_ptr to
- -- defeat optimization;
- exception
- when IC.Terminator_Error => null; -- Expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when function " &
- "To_Chars_Ptr is given a parameter Item that " &
- "is non-null, and does not contain the nul " &
- "char, but parameter Nul_Check is True");
- end;
-
- -- Check that if the parameter Item is not null, and parameter
- -- Nul_Check is False, function To_Chars_Ptr performs a pointer
- -- conversion from char_array_access type to chars_ptr type.
-
- begin
- TC_chars_ptr := ICS.To_Chars_Ptr(Item => Char_Array_WO_nul_Ptr,
- Nul_Check => False);
-
- if ICS.Value(TC_chars_ptr, 6) /= String_Without_nul or
- ICS.Value(TC_chars_ptr, 6) /= Char_Array_Without_nul
- then
- Report.Failed("Incorrect result from function To_Chars_Ptr " &
- "with parameter Item being non-null and " &
- "Nul_Check False");
- end if;
- exception
- when IC.Terminator_Error =>
- Report.Failed("Terminator_Error raised during the validation " &
- "of Function To_Chars_Ptr");
- when others =>
- Report.Failed("Unexpected exception raised during the " &
- "validation of Function To_Chars_Ptr");
- end;
-
-
- -- Check that the New_Char_Array function will return a chars_ptr type
- -- pointer to an allocated object that has been initialized with
- -- the value of parameter Chars.
- TC_chars_ptr := ICS.New_String("");
- ICS.Free(TC_chars_ptr); -- Reset the chars_ptr to Null_Ptr;
-
- if TC_chars_ptr /= ICS.Null_Ptr then
- Report.Failed("Reset of TC_chars_ptr to Null not successful - 1");
- end if;
-
- TC_chars_ptr := ICS.New_Char_Array(Chars => Char_Array_With_nul);
-
- if TC_chars_ptr = ICS.Null_Ptr then -- Check allocation.
- Report.Failed
- ("No allocation took place in call to New_Char_Array " &
- "with a non-null char_array parameter containing a " &
- "terminating nul char");
- end if;
-
- -- Length of allocated array is determined using Strlen since array
- -- is nul terminated. Contents of array are validated using Value.
-
- if ICS.Value (TC_chars_ptr, Length => 7) /= Char_Array_With_nul or
- ICS.Strlen(Item => TC_chars_ptr) /= 6
- then
- Report.Failed
- ("Incorrect length of allocated char_array resulting " &
- "from call of New_Char_Array with a non-null " &
- "char_array parameter containing a terminating nul char");
- end if;
-
- ICS.Free(TC_chars_ptr); -- Reset the chars_ptr to Null_Ptr;
- if TC_chars_ptr /= ICS.Null_Ptr then
- Report.Failed("Reset of TC_chars_ptr to Null not successful - 2");
- end if;
-
- TC_chars_ptr := ICS.New_Char_Array(Chars => Char_Array_Without_nul);
-
- if TC_chars_ptr = ICS.Null_Ptr then -- Check allocation.
- Report.Failed
- ("No allocation took place in call to New_Char_Array " &
- "with a non-null char_array parameter that did not " &
- "contain a terminating nul char");
- end if;
-
- -- Function Value is used with the total length of the
- -- Char_Array_Without_nul as a parameter to verify the allocation.
-
- if ICS.Value(Item => TC_chars_ptr, Length => 6) /=
- Char_Array_Without_nul or
- ICS.Strlen(Item => TC_chars_ptr) /= 6
- then
- Report.Failed("Incorrect length of allocated char_array " &
- "resulting from call of New_Char_Array with " &
- "a non-null char_array parameter that did not " &
- "contain a terminating nul char");
- end if;
-
-
- -- Check that the function New_String returns a chars_ptr specifying
- -- an allocated object initialized to the value of parameter Str.
-
- ICS.Free(TC_chars_ptr); -- Reset the chars_ptr to Null_Ptr;
- if TC_chars_ptr /= ICS.Null_Ptr then
- Report.Failed("Reset of TC_chars_ptr to Null not successful - 3");
- end if;
-
- TC_chars_ptr := ICS.New_String(Str => Test_String);
-
- if ICS.Value(TC_chars_ptr) /= Test_String or
- ICS.Value(ICS.New_Char_Array(IC.To_C(Test_String,True))) /=
- Test_String
- then
- Report.Failed("Incorrect allocation resulting from function " &
- "New_String with a string parameter value");
- end if;
-
- ICS.Free(TC_chars_ptr); -- Reset the chars_ptr to Null_Ptr;
- if TC_chars_ptr /= ICS.Null_Ptr then
- Report.Failed("Reset of TC_chars_ptr to Null not successful - 4");
- end if;
-
- if ICS.Value(ICS.New_String(String_Without_nul)) /=
- String_Without_nul or
- ICS.Value(ICS.New_Char_Array(IC.To_C(String_Without_nul,False))) /=
- String_Without_nul
- then
- Report.Failed("Incorrect allocation resulting from function " &
- "New_String with parameter value String_Without_nul");
- end if;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB3009;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3010.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3010.a
deleted file mode 100644
index 25305b22fd0..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3010.a
+++ /dev/null
@@ -1,320 +0,0 @@
--- CXB3010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the Procedure Free resets the parameter Item to
--- Null_Ptr. Check that Free has no effect if Item is Null_Ptr.
---
--- Check that the version of Function Value with a chars_ptr parameter
--- returning a char_array result returns the prefix of an array of
--- chars.
---
--- Check that the version of Function Value with a chars_ptr parameter
--- and a size_t parameter returning a char_array result returns
--- the shorter of:
--- 1) the first size_t number of characters, or
--- 2) the characters up to and including the first nul.
---
--- Check that both of the above versions of Function Value propagate
--- Dereference_Error if the Item parameter is Null_Ptr.
---
--- TEST DESCRIPTION:
--- This test validates the Procedure Free and two versions of Function
--- Value. A variety of char_array and char_ptr values are provided as
--- input, and results are compared for both length and content.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.C.char:
--- ' ', 'a'..'z', and 'A'..'Z'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.C.Strings. If an implementation provides
--- package Interfaces.C.Strings, this test must compile, execute,
--- and report "PASSED".
---
---
--- CHANGE HISTORY:
--- 27 Sep 95 SAIC Initial prerelease version.
--- 13 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 26 Oct 96 SAIC Incorporated reviewer comments.
--- 01 DEC 97 EDS Replicate line 199 at line 256, to ensure that
--- TC_chars_ptr has a valid pointer.
--- 08 JUL 99 RLB Added a test case to check that Value raises
--- Constraint_Error when Length = 0. (From Technical
--- Corrigendum 1).
--- 25 JAN 01 RLB Repaired previous test case to avoid raising
--- Constraint_Error in test case code.
--- 26 JAN 01 RLB Added an Ident_Int to the test case to prevent
--- optimization.
-
---!
-
-with Report;
-with Interfaces.C.Strings; -- N/A => ERROR
-
-procedure CXB3010 is
-begin
-
- Report.Test ("CXB3010", "Check that Procedure Free and versions of " &
- "Function Value produce correct results");
-
- Test_Block:
- declare
-
- package IC renames Interfaces.C;
- package ICS renames Interfaces.C.Strings;
-
- use type IC.char_array;
- use type IC.size_t;
- use type ICS.chars_ptr;
- use type IC.char;
-
- Null_Char_Array_Access : constant ICS.char_array_access := null;
-
- TC_String_1 : constant String := "Nonul";
- TC_String_2 : constant String := "AbCdE";
- TC_Blank_String : constant String(1..5) := (others => ' ');
-
- -- The initialization of the following char_array objects
- -- includes the appending of a terminating nul char, in order to
- -- prevent the erroneous execution of Function Value.
-
- TC_char_array : IC.char_array :=
- IC.To_C(TC_Blank_String, True);
- TC_char_array_1 : constant IC.char_array :=
- IC.To_C(TC_String_1, True);
- TC_char_array_2 : constant IC.char_array :=
- IC.To_C(TC_String_2, True);
- TC_Blank_char_array : constant IC.char_array :=
- IC.To_C(TC_Blank_String, True);
-
- -- This chars_ptr is initialized via the use of New_Chars_Array to
- -- avoid erroneous execution of procedure Free.
- TC_chars_ptr : ICS.chars_ptr :=
- ICS.New_Char_Array(TC_Blank_char_array);
-
- begin
-
- -- Check that the Procedure Free resets the parameter Item
- -- to Null_Ptr.
-
- if TC_chars_ptr = ICS.Null_Ptr then
- Report.Failed("TC_chars_ptr is currently null; it should not be " &
- "null since it was given default initialization");
- end if;
-
- ICS.Free(TC_chars_ptr);
-
- if TC_chars_ptr /= ICS.Null_Ptr then
- Report.Failed("TC_chars_ptr was not set to Null_Ptr by " &
- "Procedure Free");
- end if;
-
- -- Check that Free has no effect if Item is Null_Ptr.
-
- begin
- TC_chars_ptr := ICS.Null_Ptr; -- Ensure pointer is null.
- ICS.Free(TC_chars_ptr);
- if TC_chars_ptr /= ICS.Null_Ptr then
- Report.Failed("TC_chars_ptr was set to a non-Null_Ptr value " &
- "by Procedure Free. It was provided as a null " &
- "parameter to Free, and there should have been " &
- "no effect from a call to Procedure Free");
- end if;
- exception
- when others =>
- Report.Failed("Unexpected exception raised by Procedure Free " &
- "when parameter Item is Null_Ptr");
- end;
-
-
- -- Check that the version of Function Value with a chars_ptr parameter
- -- that returns a char_array result returns an array of chars (up to
- -- and including the first nul).
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_1);
- TC_char_array := ICS.Value(Item => TC_chars_ptr);
-
- if TC_char_array /= TC_char_array_1 or
- IC.To_Ada(TC_char_array, True) /= IC.To_Ada(TC_char_array_1)
- then
- Report.Failed("Incorrect result from Function Value - 1");
- end if;
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_2);
- TC_char_array := ICS.Value(Item => TC_chars_ptr);
-
- if TC_char_array /= TC_char_array_2 or
- IC.To_Ada(TC_char_array, True) /= IC.To_Ada(TC_char_array_2)
- then
- Report.Failed("Incorrect result from Function Value - 2");
- end if;
-
- if ICS.Value(Item => ICS.New_String("A little longer string")) /=
- IC.To_C("A little longer string")
- then
- Report.Failed("Incorrect result from Function Value - 3");
- end if;
-
-
- -- Check that the version of Function Value with a chars_ptr parameter
- -- and a size_t parameter that returns a char_array result returns
- -- the shorter of:
- -- 1) the first size_t number of characters, or
- -- 2) the characters up to and including the first nul.
-
- -- Case 1: the first size_t number of characters (less than the
- -- total length).
-
- begin
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_1);
- TC_char_array(0..2) := ICS.Value(Item => TC_chars_ptr, Length => 3);
-
- if TC_char_array(0..2) /= TC_char_array_1(0..2)
- then
- Report.Failed
- ("Incorrect result from Function Value with Length " &
- "parameter - 1");
- end if;
- exception
- when others =>
- Report.Failed("Exception raised during Case 1 evaluation");
- end;
-
- -- Case 2: the characters up to and including the first nul.
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_2);
-
- -- The length supplied as a parameter exceeds the total length of
- -- TC_char_array_2. The result should be the entire TC_char_array_2
- -- including the terminating nul.
-
- TC_char_array := ICS.Value(Item => TC_chars_ptr, Length => 7);
-
- if TC_char_array /= TC_char_array_2 or
- IC.To_Ada(TC_char_array) /= IC.To_Ada(TC_char_array_2) or
- not (IC.Is_Nul_Terminated(TC_char_array))
- then
- Report.Failed("Incorrect result from Function Value with Length " &
- "parameter - 2");
- end if;
-
-
- -- Check that both of the above versions of Function Value propagate
- -- Dereference_Error if the Item parameter is Null_Ptr.
-
- declare
-
- -- Declare a dummy function to demonstrate one way that a chars_ptr
- -- variable could inadvertantly be set to Null_Ptr prior to a call
- -- to Value (below).
- function Freedom (Condition : Boolean := False;
- Ptr : ICS.chars_ptr) return ICS.chars_ptr is
- Pointer : ICS.chars_ptr := Ptr;
- begin
- if Condition then
- ICS.Free(Pointer);
- else
- null; -- An activity that doesn't set the chars_ptr value to
- -- Null_Ptr.
- end if;
- return Pointer;
- end Freedom;
-
- begin
-
- begin
- TC_char_array := ICS.Value(Item => Freedom(True, TC_chars_ptr));
- Report.Failed
- ("Function Value (without Length parameter) did not " &
- "raise Dereference_Error when provided a null Item " &
- "parameter input value");
- if TC_char_array(0) = '6' then -- Defeat optimization.
- Report.Comment("Should never be printed");
- end if;
- exception
- when ICS.Dereference_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function Value " &
- "with Item parameter, when the Item parameter " &
- "is Null_Ptr");
- end;
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_2);
- begin
- TC_char_array := ICS.Value(Item => Freedom(True, TC_chars_ptr),
- Length => 4);
- Report.Failed
- ("Function Value (with Length parameter) did not " &
- "raise Dereference_Error when provided a null Item " &
- "parameter input value");
- if TC_char_array(0) = '6' then -- Defeat optimization.
- Report.Comment("Should never be printed");
- end if;
- exception
- when ICS.Dereference_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function Value " &
- "with both Item and Length parameters, when " &
- "the Item parameter is Null_Ptr");
- end;
- end;
-
- -- Check that Function Value with two parameters propagates
- -- Constraint_Error if Length is 0.
-
- begin
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_1);
- declare
- TC : IC.char_array := ICS.Value(Item => TC_chars_ptr, Length =>
- IC.Size_T(Report.Ident_Int(0)));
- begin
- Report.Failed
- ("Function Value (with Length parameter) did not " &
- "raise Constraint_Error when Length = 0");
- if TC'Length <= TC_char_array'Length then
- TC_char_array(1..TC'Length) := TC; -- Block optimization of TC.
- end if;
- end;
-
- Report.Failed
- ("Function Value (with Length parameter) did not " &
- "raise Constraint_Error when Length = 0");
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function Value " &
- "with both Item and Length parameters, when " &
- "Length = 0");
- end;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXB3010;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3011.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3011.a
deleted file mode 100644
index 6930407ec55..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3011.a
+++ /dev/null
@@ -1,282 +0,0 @@
--- CXB3011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the version of Function Value with a chars_ptr parameter
--- that returns a String result returns an Ada string containing the
--- characters pointed to by the chars_ptr parameter, up to (but not
--- including) the terminating nul.
---
--- Check that the version of Function Value with a chars_ptr parameter
--- and a size_t parameter that returns a String result returns the
--- shorter of:
--- 1) a String of the first size_t number of characters, or
--- 2) a String of characters up to (but not including) the
--- terminating nul.
---
--- Check that the Function Strlen returns a size_t result that
--- corresponds to the number of chars in the array pointed to by Item,
--- up to but not including the terminating nul.
---
--- Check that both of the above versions of Function Value and
--- Function Strlen propagate Dereference_Error if the Item parameter
--- is Null_Ptr.
---
--- TEST DESCRIPTION:
--- This test validates two versions of Function Value, and the Function
--- Strlen. A series of char_ptr values are provided as input, and
--- results are compared for length or content.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.C.char:
--- ' ', 'a'..'z', 'A'..'Z', '0'..'9', '*' and '.'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.C.Strings. If an implementation provides
--- package Interfaces.C.Strings, this test must compile, execute,
--- and report "PASSED".
---
---
--- CHANGE HISTORY:
--- 28 Sep 95 SAIC Initial prerelease version.
--- 13 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 26 Oct 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Report;
-with Ada.Characters.Latin_1;
-with Interfaces.C.Strings; -- N/A => ERROR
-
-procedure CXB3011 is
-begin
-
- Report.Test ("CXB3011", "Check that the two versions of Function Value " &
- "returning a String result, and the Function " &
- "Strlen, produce correct results");
-
- Test_Block:
- declare
-
- package IC renames Interfaces.C;
- package ICS renames Interfaces.C.Strings;
- package ACL1 renames Ada.Characters.Latin_1;
-
- use type IC.char_array;
- use type IC.size_t;
- use type ICS.chars_ptr;
-
- Null_Char_Array_Access : constant ICS.char_array_access := null;
-
- TC_String : String(1..5) := (others => 'X');
- TC_String_1 : constant String := "*.3*0";
- TC_String_2 : constant String := "Two";
- TC_String_3 : constant String := "Five5";
- TC_Blank_String : constant String(1..5) := (others => ' ');
-
- TC_char_array : IC.char_array :=
- IC.To_C(TC_Blank_String, True);
- TC_char_array_1 : constant IC.char_array :=
- IC.To_C(TC_String_1, True);
- TC_char_array_2 : constant IC.char_array :=
- IC.To_C(TC_String_2, True);
- TC_char_array_3 : constant IC.char_array :=
- IC.To_C(TC_String_3, True);
- TC_Blank_char_array : constant IC.char_array :=
- IC.To_C(TC_Blank_String, True);
-
- TC_chars_ptr : ICS.chars_ptr :=
- ICS.New_Char_Array(TC_Blank_char_array);
-
- TC_size_t : IC.size_t := IC.size_t'First;
-
-
- begin
-
- -- Check that the version of Function Value with a chars_ptr parameter
- -- that returns a String result returns an Ada string containing the
- -- characters pointed to by the chars_ptr parameter, up to (but not
- -- including) the terminating nul.
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_1);
- TC_String := ICS.Value(Item => TC_chars_ptr);
-
- if TC_String /= TC_String_1 or
- TC_String(TC_String'Last) = ACL1.NUL
- then
- Report.Failed("Incorrect result from Function Value - 1");
- end if;
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_2);
-
- if ICS.Value(Item => TC_chars_ptr) /=
- IC.To_Ada(ICS.Value(TC_chars_ptr), Trim_Nul => True)
- then
- Report.Failed("Incorrect result from Function Value - 2");
- end if;
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_3);
- TC_String := ICS.Value(TC_chars_ptr);
-
- if TC_String /= TC_String_3 or
- TC_String(TC_String'Last) = ACL1.NUL
- then
- Report.Failed("Incorrect result from Function Value - 3");
- end if;
-
-
- -- Check that the version of Function Value with a chars_ptr parameter
- -- and a size_t parameter that returns a String result returns the
- -- shorter of:
- -- 1) a String of the first size_t number of characters, or
- -- 2) a String of characters up to (but not including) the
- -- terminating nul.
- --
-
- -- Case 1 : Length parameter specifies a length shorter than total
- -- length.
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_1);
- TC_String := "XXXXX"; -- Reinitialize all characters in string.
- TC_String(1..5) := ICS.Value(Item => TC_chars_ptr, Length => 6);
-
- if TC_String(1..4) /= TC_String_1(1..4) or
- TC_String(TC_String'Last) = ACL1.NUL
- then
- Report.Failed("Incorrect result from Function Value - 4");
- end if;
-
- -- Case 2 : Length parameter specifies total length.
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_2);
-
- if ICS.Value(TC_chars_ptr, Length => 5) /=
- IC.To_Ada(ICS.Value(TC_chars_ptr), Trim_Nul => True)
- then
- Report.Failed("Incorrect result from Function Value - 5");
- end if;
-
- -- Case 3 : Length parameter specifies a length longer than total
- -- length.
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_3);
- TC_String := "XXXXX"; -- Reinitialize all characters in string.
- TC_String := ICS.Value(TC_chars_ptr, 7);
-
- if TC_String /= TC_String_3 or
- TC_String(TC_String'Last) = ACL1.NUL
- then
- Report.Failed("Incorrect result from Function Value - 6");
- end if;
-
-
- -- Check that the Function Strlen returns a size_t result that
- -- corresponds to the number of chars in the array pointed to by
- -- parameter Item, up to but not including the terminating nul.
-
- TC_chars_ptr := ICS.New_Char_Array(IC.To_C("A longer string value"));
- TC_size_t := ICS.Strlen(TC_chars_ptr);
-
- if TC_size_t /= 21 then
- Report.Failed("Incorrect result from Function Strlen - 1");
- end if;
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array_2);
- TC_size_t := ICS.Strlen(TC_chars_ptr);
-
- if TC_size_t /= 3 then -- Nul not included in length.
- Report.Failed("Incorrect result from Function Strlen - 2");
- end if;
-
- TC_chars_ptr := ICS.New_Char_Array(IC.To_C(""));
- TC_size_t := ICS.Strlen(TC_chars_ptr);
-
- if TC_size_t /= 0 then
- Report.Failed("Incorrect result from Function Strlen - 3");
- end if;
-
-
- -- Check that both of the above versions of Function Value and
- -- function Strlen propagate Dereference_Error if the Item parameter
- -- is Null_Ptr.
-
- begin
- TC_chars_ptr := ICS.Null_Ptr;
- TC_String := ICS.Value(Item => TC_chars_ptr);
- Report.Failed("Function Value (without Length parameter) did not " &
- "raise Dereference_Error when provided a null Item " &
- "parameter input value");
- if TC_String(1) = '1' then -- Defeat optimization.
- Report.Comment("Should never be printed");
- end if;
- exception
- when ICS.Dereference_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function Value " &
- "with Item parameter, when the Item parameter " &
- "is Null_Ptr");
- end;
-
- begin
- TC_chars_ptr := ICS.Null_Ptr;
- TC_String := ICS.Value(Item => TC_chars_ptr, Length => 4);
- Report.Failed("Function Value (with Length parameter) did not " &
- "raise Dereference_Error when provided a null Item " &
- "parameter input value");
- if TC_String(1) = '1' then -- Defeat optimization.
- Report.Comment("Should never be printed");
- end if;
- exception
- when ICS.Dereference_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function Value " &
- "with both Item and Length parameters, when " &
- "the Item parameter is Null_Ptr");
- end;
-
- begin
- TC_chars_ptr := ICS.Null_Ptr;
- TC_size_t := ICS.Strlen(Item => TC_chars_ptr);
- Report.Failed("Function Strlen did not raise Dereference_Error" &
- "when provided a null Item parameter input value");
- if TC_size_t = 35 then -- Defeat optimization.
- Report.Comment("Should never be printed");
- end if;
- exception
- when ICS.Dereference_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function Strlen " &
- "when the Item parameter is Null_Ptr");
- end;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXB3011;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3012.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3012.a
deleted file mode 100644
index 2f97e77871c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3012.a
+++ /dev/null
@@ -1,342 +0,0 @@
--- CXB3012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Procedure Update modifies the value pointed to by
--- the chars_ptr parameter Item, starting at the position
--- corresponding to parameter Offset, using the chars in
--- char_array parameter Chars.
---
--- Check that the version of Procedure Update with a String parameter
--- behaves in the manner described above, but with the character
--- values in the String overwriting the char values in Item.
---
--- Check that both of the above versions of Procedure Update will
--- propagate Update_Error if Check is True, and if the length of
--- the new chars in Chars, when overlaid starting from position
--- Offset, will overwrite the first nul in Item.
---
--- TEST DESCRIPTION:
--- This test checks two versions of Procedure Update. In the first
--- version of the procedure, the parameter Chars indicates a char_array
--- argument. These char_array parameters are provided through the use
--- of the To_C function (with String IN parameter), both with and
--- without a terminating nul. In the case below where a terminating nul
--- char is appended, the effect of "updating" the value pointed to by the
--- Item parameter will include its shortening, due to the insertion of
--- this additional nul in the middle of the char_array.
---
--- In the second version of Procedure Update evaluated here, the string
--- parameter Str is used to modify the char_array pointed to by Item.
---
--- Finally, both versions of the procedure are evaluated to ensure that
--- they propagate Update_Error and Dereference_Error under the proper
--- conditions.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.C.char:
--- ' ', 'a'..'z', 'A'..'Z', '0'..'9', '-' and '.'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.C.Strings. If an implementation provides
--- package Interfaces.C.Strings, this test must compile, execute,
--- and report "PASSED".
---
---
--- CHANGE HISTORY:
--- 05 Oct 95 SAIC Initial prerelease version.
--- 13 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 26 Oct 96 SAIC Incorporated reviewer comments.
--- 14 Sep 99 RLB Removed incorrect and unnecessary
--- Unchecked_Conversion. Added check for raising
--- of Dereference_Error for Update (From Technical
--- Corrigendum 1).
---
---!
-
-with Report;
-with Ada.Exceptions;
-with Interfaces.C.Strings; -- N/A => ERROR
-
-procedure CXB3012 is
-begin
-
- Report.Test ("CXB3012", "Check that both versions of Procedure Update " &
- "produce correct results");
-
- Test_Block:
- declare
-
- package IC renames Interfaces.C;
- package ICS renames Interfaces.C.Strings;
- use Ada.Exceptions;
-
- use type IC.char;
- use type IC.char_array;
- use type IC.size_t;
- use type ICS.chars_ptr;
-
- TC_String_1 : String(1..1) := "J";
- TC_String_2 : String(1..2) := "Ab";
- TC_String_3 : String(1..3) := "xyz";
- TC_String_4 : String(1..4) := "ACVC";
- TC_String_5 : String(1..5) := "1a2b3";
- TC_String_6 : String(1..6) := "---...";
- TC_String_7 : String(1..7) := "AABBBAA";
- TC_String_8 : String(1..8) := "aBcDeFgH";
- TC_String_9 : String(1..9) := "JustATest";
- TC_String_10 : String(1..10) := "0123456789";
-
- TC_Result_String_1 : constant String := "JXXXXXXXXX";
- TC_Result_String_2 : constant String := "XXXXXXXXAb";
- TC_Result_String_3 : constant String := "XXXxyz";
- TC_Result_String_4 : constant String := "XACVC";
- TC_Result_String_5 : constant String := "1a2b3";
- TC_Result_String_6 : constant String := "XXX---...";
-
- TC_char_array : IC.char_array(0..10) := IC.To_C("XXXXXXXXXX");
- TC_Result_char_array : IC.char_array(0..10) := IC.To_C("XXXXXXXXXX");
- TC_chars_ptr : ICS.chars_ptr;
- TC_Length : IC.size_t;
-
- begin
-
- -- Check that Procedure Update modifies the value pointed to by
- -- the chars_ptr parameter Item, starting at the position
- -- corresponding to parameter Offset, using the chars in
- -- char_array parameter Chars.
- -- Note: If parameter Chars contains a nul char (such as a
- -- terminating nul), the result may be the overall shortening
- -- of parameter Item.
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array);
-
- ICS.Update(Item => TC_chars_ptr,
- Offset => 0,
- Chars => IC.To_C(TC_String_1, False), -- No nul char.
- Check => True);
-
- if ICS.Value(TC_chars_ptr) /= TC_Result_String_1 then
- Report.Failed("Incorrect result from Procedure Update - 1");
- end if;
- ICS.Free(TC_chars_ptr);
-
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array);
- ICS.Update(TC_chars_ptr,
- Offset => ICS.Strlen(TC_chars_ptr) - 2,
- Chars => IC.To_C(TC_String_2, False), -- No nul char.
- Check => True);
-
- if ICS.Value(TC_chars_ptr) /= TC_Result_String_2 then
- Report.Failed("Incorrect result from Procedure Update - 2");
- end if;
- ICS.Free(TC_chars_ptr);
-
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array);
- ICS.Update(TC_chars_ptr,
- 3,
- Chars => IC.To_C(TC_String_3), -- Nul appended, shortens
- Check => False); -- array.
-
- if ICS.Value(TC_chars_ptr) /= TC_Result_String_3 then
- Report.Failed("Incorrect result from Procedure Update - 3");
- end if;
- ICS.Free(TC_chars_ptr);
-
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array);
- ICS.Update(TC_chars_ptr,
- 0,
- IC.To_C(TC_String_10), -- Complete replacement of array.
- Check => False);
-
- if ICS.Value(TC_chars_ptr) /= TC_String_10 then
- Report.Failed("Incorrect result from Procedure Update - 4");
- end if;
-
- -- Perform a character-by-character comparison of the result of
- -- Procedure Update. Note that char_array lower bound is 0, and
- -- that the nul char is not compared with any character in the
- -- string (since the string is not nul terminated).
- begin
- TC_Length := ICS.Strlen(TC_chars_ptr);
- TC_Result_char_array(0..10) := ICS.Value(TC_chars_ptr);
- for i in 0..TC_Length-1 loop
- if TC_Result_char_array(i) /=
- IC.To_C(TC_String_10(Integer(i+1)))
- then
- Report.Failed("Incorrect result from the character-by-" &
- "character evaluation of the result of " &
- "Procedure Update");
- end if;
- end loop;
- exception
- when others =>
- Report.Failed("Exception raised during the character-by-" &
- "character evaluation of the result of " &
- "Procedure Update");
- end;
- ICS.Free(TC_chars_ptr);
-
-
-
- -- Check that the version of Procedure Update with a String rather
- -- than a char_array parameter behaves in the manner described above,
- -- but with the character values in the String overwriting the char
- -- values in Item.
- --
- -- Note: In each of the cases below, the String parameter Str is
- -- treated as if it were nul terminated, which means that the
- -- char_array pointed to by TC_chars_ptr will be "shortened"
- -- so that it ends after the last character of the Str
- -- parameter.
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array);
- ICS.Update(TC_chars_ptr, 1, TC_String_4, False);
-
- if ICS.Value(TC_chars_ptr) /= TC_Result_String_4 then
- Report.Failed("Incorrect result from Procedure Update - 5");
- end if;
- ICS.Free(TC_chars_ptr);
-
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array);
- ICS.Update(Item => TC_chars_ptr,
- Offset => 0,
- Str => TC_String_5);
-
- if ICS.Value(TC_chars_ptr) /= TC_Result_String_5 then
- Report.Failed("Incorrect result from Procedure Update - 6");
- end if;
- ICS.Free(TC_chars_ptr);
-
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array);
- ICS.Update(TC_chars_ptr,
- 3,
- Str => TC_String_6,
- Check => True);
-
- if ICS.Value(TC_chars_ptr) /= TC_Result_String_6 then
- Report.Failed("Incorrect result from Procedure Update - 7");
- end if;
- ICS.Free(TC_chars_ptr);
-
-
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array);
- ICS.Update(TC_chars_ptr, 0, TC_String_9, True);
-
- if ICS.Value(TC_chars_ptr) /= TC_String_9 then
- Report.Failed("Incorrect result from Procedure Update - 8");
- end if;
- ICS.Free(TC_chars_ptr);
-
-
-
- -- Check that both of the above versions of Procedure Update will
- -- propagate Update_Error if Check is True, and if the length of
- -- the new chars in Chars, when overlaid starting from position
- -- Offset, will overwrite the first nul in Item.
-
- begin
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array);
- ICS.Update(Item => TC_chars_ptr,
- Offset => 5,
- Chars => IC.To_C(TC_String_7),
- Check => True);
- Report.Failed("Update_Error not raised by Procedure Update with " &
- "Chars parameter");
- Report.Comment(ICS.Value(TC_chars_ptr) & "used here to defeat " &
- "optimization - should never be printed");
- exception
- when ICS.Update_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure Update " &
- "with Chars parameter");
- end;
-
- ICS.Free(TC_chars_ptr);
-
- begin
- TC_chars_ptr := ICS.New_Char_Array(TC_char_array);
- ICS.Update(Item => TC_chars_ptr,
- Offset => ICS.Strlen(TC_chars_ptr),
- Str => TC_String_8); -- Default Check parameter value.
- Report.Failed("Update_Error not raised by Procedure Update with " &
- "Str parameter");
- Report.Comment(ICS.Value(TC_chars_ptr) & "used here to defeat " &
- "optimization - should never be printed");
- exception
- when ICS.Update_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure Update " &
- "with Str parameter");
- end;
-
- ICS.Free(TC_chars_ptr);
-
- -- Check that both of the above versions of Procedure Update will
- -- propagate Dereference_Error if Item is Null_Ptr.
- -- Note: Free sets TC_chars_ptr to Null_Ptr.
-
- begin
- ICS.Update(Item => TC_chars_ptr,
- Offset => 5,
- Chars => IC.To_C(TC_String_7),
- Check => True);
- Report.Failed("Dereference_Error not raised by Procedure Update with " &
- "Chars parameter");
- exception
- when ICS.Dereference_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure Update " &
- "with Chars parameter");
- end;
-
- begin
- ICS.Update(Item => TC_chars_ptr,
- Offset => ICS.Strlen(TC_chars_ptr),
- Str => TC_String_8); -- Default Check parameter value.
- Report.Failed("Dereference_Error not raised by Procedure Update with " &
- "Str parameter");
- exception
- when ICS.Dereference_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Procedure Update " &
- "with Str parameter");
- end;
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB3012;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3014.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3014.a
deleted file mode 100644
index a9b386ffcfd..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3014.a
+++ /dev/null
@@ -1,254 +0,0 @@
--- CXB3014.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the Function Value with Pointer and Element
--- parameters will return an Element_Array result of correct size
--- and content (up to and including the first "terminator" Element).
---
--- Check that the Function Value with Pointer and Length parameters
--- will return an Element_Array result of appropriate size and content
--- (the first Length elements pointed to by the parameter Ref).
---
--- Check that both versions of Function Value will propagate
--- Interfaces.C.Strings.Dereference_Error when the value of
--- the Ref pointer parameter is null.
---
--- TEST DESCRIPTION:
--- This test tests that both versions of Function Value from the
--- generic package Interfaces.C.Pointers are available and produce
--- correct results. The generic package is instantiated with size_t,
--- char, char_array, and nul as actual parameters, and subtests are
--- performed on each of the Value functions resulting from this
--- instantiation.
--- For both function versions, a test is performed where a portion of
--- a char_array is to be returned as the function result. Likewise,
--- a test is performed where each version of the function returns the
--- entire char_array referenced by the in parameter Ref.
--- Finally, both versions of Function Value are called with a null
--- pointer reference, to ensure that Dereference_Error is raised in
--- this case.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.C.char:
--- ' ', 'a'..'z', and 'A'..'Z'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- packages Interfaces.C.Strings and Interfaces.C.Pointers. If an
--- implementation provides packages Interfaces.C.Strings and
--- Interfaces.C.Pointers, this test must compile, execute, and
--- report "PASSED".
---
---
--- CHANGE HISTORY:
--- 19 Oct 95 SAIC Initial prerelease version.
--- 13 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 23 Oct 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Report;
-with Interfaces.C.Strings; -- N/A => ERROR
-with Interfaces.C.Pointers; -- N/A => ERROR
-
-procedure CXB3014 is
-
-begin
-
- Report.Test ("CXB3014", "Check that versions of the Value function " &
- "from package Interfaces.C.Pointers produce " &
- "correct results");
-
- Test_Block:
- declare
-
- use type Interfaces.C.char, Interfaces.C.size_t;
-
- Char_a : constant Interfaces.C.char := 'a';
- Char_j : constant Interfaces.C.char := 'j';
- Char_z : constant Interfaces.C.char := 'z';
-
- subtype Lower_Case_chars is Interfaces.C.char range Char_a..Char_z;
- subtype Char_Range is Interfaces.C.size_t range 0..26;
-
- Local_nul : aliased Interfaces.C.char := Interfaces.C.nul;
- TC_Array_Size : Interfaces.C.size_t := 20;
-
- TC_String_1 : constant String := "abcdefghij";
- TC_String_2 : constant String := "abcdefghijklmnopqrstuvwxyz";
- TC_String_3 : constant String := "abcdefghijklmnopqrst";
- TC_String_4 : constant String := "abcdefghijklmnopqrstuvwxyz";
- TC_Blank_String : constant String := " ";
-
- TC_Char_Array : Interfaces.C.char_array(Char_Range) :=
- Interfaces.C.To_C(TC_String_2, True);
-
- TC_Char_Array_1 : Interfaces.C.char_array(0..9);
- TC_Char_Array_2 : Interfaces.C.char_array(Char_Range);
- TC_Char_Array_3 : Interfaces.C.char_array(0..TC_Array_Size-1);
- TC_Char_Array_4 : Interfaces.C.char_array(Char_Range);
-
- package Char_Pointers is new
- Interfaces.C.Pointers (Index => Interfaces.C.size_t,
- Element => Interfaces.C.char,
- Element_Array => Interfaces.C.char_array,
- Default_Terminator => Interfaces.C.nul);
-
- Char_Ptr : Char_Pointers.Pointer;
-
- use type Char_Pointers.Pointer;
-
- begin
-
- -- Check that the Function Value with Pointer and Terminator Element
- -- parameters will return an Element_Array result of appropriate size
- -- and content (up to and including the first "terminator" Element.)
-
- Char_Ptr := TC_Char_Array(0)'Access;
-
- -- Provide a new Terminator char in the call of Function Value.
- -- This call should return only a portion (the first 10 chars) of
- -- the referenced char_array, up to and including the char 'j'.
-
- TC_Char_Array_1 := Char_Pointers.Value(Ref => Char_Ptr,
- Terminator => Char_j);
-
- if Interfaces.C.To_Ada(TC_Char_Array_1, False) /= TC_String_1 or
- Interfaces.C.Is_Nul_Terminated(TC_Char_Array_1)
- then
- Report.Failed("Incorrect result from Function Value with Ref " &
- "and Terminator parameters, when supplied with " &
- "a non-default Terminator char");
- end if;
-
- -- Use the default Terminator char in the call of Function Value.
- -- This call should return the entire char_array, including the
- -- terminating nul char.
-
- TC_Char_Array_2 := Char_Pointers.Value(Char_Ptr);
-
- if Interfaces.C.To_Ada(TC_Char_Array_2, True) /= TC_String_2 or
- not Interfaces.C.Is_Nul_Terminated(TC_Char_Array_2)
- then
- Report.Failed("Incorrect result from Function Value with Ref " &
- "and Terminator parameters, when using the " &
- "default Terminator char");
- end if;
-
-
-
- -- Check that the Function Value with Pointer and Length parameters
- -- will return an Element_Array result of appropriate size and content
- -- (the first Length elements pointed to by the parameter Ref).
-
- -- This call should return only a portion (the first 20 chars) of
- -- the referenced char_array.
-
- TC_Char_Array_3 :=
- Char_Pointers.Value(Ref => Char_Ptr,
- Length => Interfaces.C.ptrdiff_t(TC_Array_Size));
-
- -- Verify the individual chars of the result.
- for i in 0..TC_Array_Size-1 loop
- if Interfaces.C.To_Ada(TC_Char_Array_3(i)) /=
- TC_String_3(Integer(i)+1)
- then
- Report.Failed("Incorrect result from Function Value with " &
- "Ref and Length parameters, when specifying " &
- "a length less than the full array size");
- exit;
- end if;
- end loop;
-
- -- This call should return the entire char_array, including the
- -- terminating nul char.
-
- TC_Char_Array_4 := Char_Pointers.Value(Char_Ptr, 27);
-
- if Interfaces.C.To_Ada(TC_Char_Array_4, True) /= TC_String_4 or
- not Interfaces.C.Is_Nul_Terminated(TC_Char_Array_4)
- then
- Report.Failed("Incorrect result from Function Value with Ref " &
- "and Length parameters, when specifying the " &
- "entire array size");
- end if;
-
-
-
- -- Check that both of the above versions of Function Value will
- -- propagate Interfaces.C.Strings.Dereference_Error when the value of
- -- the Ref Pointer parameter is null.
-
- Char_Ptr := null;
-
- begin
- TC_Char_Array_1 := Char_Pointers.Value(Ref => Char_Ptr,
- Terminator => Char_j);
- Report.Failed("Dereference_Error not raised by Function " &
- "Value with Terminator parameter, when " &
- "provided a null reference");
- -- Call Report.Comment to ensure that the assignment to
- -- TC_Char_Array_1 is not "dead", and therefore can not be
- -- optimized away.
- Report.Comment(Interfaces.C.To_Ada(TC_Char_Array_1, False));
- exception
- when Interfaces.C.Strings.Dereference_Error =>
- null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function " &
- "Value with Terminator parameter, when " &
- "provided a null reference");
- end;
-
-
- begin
- TC_Char_Array_3 :=
- Char_Pointers.Value(Char_Ptr,
- Interfaces.C.ptrdiff_t(TC_Array_Size));
- Report.Failed("Dereference_Error not raised by Function " &
- "Value with Length parameter, when provided " &
- "a null reference");
- -- Call Report.Comment to ensure that the assignment to
- -- TC_Char_Array_3 is not "dead", and therefore can not be
- -- optimized away.
- Report.Comment(Interfaces.C.To_Ada(TC_Char_Array_3, False));
- exception
- when Interfaces.C.Strings.Dereference_Error =>
- null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Function " &
- "Value with Length parameter, when " &
- "provided a null reference");
- end;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXB3014;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3015.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3015.a
deleted file mode 100644
index 24ec826fab9..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3015.a
+++ /dev/null
@@ -1,520 +0,0 @@
--- CXB3015.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the "+" and "-" functions with Pointer and ptrdiff_t
--- parameters that return Pointer values produce correct results,
--- based on the size of the array elements.
---
--- Check that the "-" function with two Pointer parameters that
--- returns a ptrdiff_t type parameter produces correct results,
--- based on the size of the array elements.
---
--- Check that each of the "+" and "-" functions above will
--- propagate Pointer_Error if a Pointer parameter is null.
---
--- Check that the Increment and Decrement procedures provide the
--- correct "pointer arithmetic" operations.
---
--- TEST DESCRIPTION:
--- This test checks that the functions "+" and "-", and the procedures
--- Increment and Decrement in the generic package Interfaces.C.Pointers
--- will allow the user to perform "pointer arithmetic" operations on
--- Pointer values.
--- Package Interfaces.C.Pointers is instantiated three times, for
--- short values, chars, and arrays of arrays. Pointers from each
--- instantiated package are then used to reference different elements
--- of array objects. Pointer arithmetic operations are performed on
--- these pointers, and the results of these operations are verified
--- against expected pointer positions along the referenced arrays.
--- The propagation of Pointer_Error is checked for when the function
--- Pointer parameter is null.
---
--- The following chart indicates the combinations of subprograms and
--- parameter types used in this test.
---
---
--- Short Char Array
--- --------------------------
--- "+" Pointer, ptrdiff_t | X | | X |
--- |--------------------------|
--- "+" ptrdiff_t, Pointer | X | | X |
--- |--------------------------|
--- "-" Pointer, ptrdiff_t | | X | X |
--- |--------------------------|
--- "-" Pointer, Pointer | | X | X |
--- |--------------------------|
--- Increment (Pointer) | X | | X |
--- |--------------------------|
--- Decrement (Pointer) | X | | X |
--- --------------------------
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.C.char:
--- ' ', and 'a'..'z'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.C.Pointers. If an implementation provides
--- package Interfaces.C.Pointers, this test must compile, execute, and
--- report "PASSED".
---
---
--- CHANGE HISTORY:
--- 26 Oct 95 SAIC Initial prerelease version.
--- 13 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 26 Oct 96 SAIC Incorporated reviewer comments.
--- 06 Mar 00 RLB Repaired so that array of arrays component
--- type is statically constrained. (C does not have
--- an analog to an array of dynamically constrained
--- arrays.)
-
-with Report;
-with Ada.Exceptions;
-with Interfaces.C.Pointers; -- N/A => ERROR
-
-procedure CXB3015 is
-begin
-
- Report.Test ("CXB3015", "Check that +, -, Increment, and Decrement " &
- "subprograms in Package Interfaces.C.Pointers " &
- "produce correct results");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
- use type Interfaces.C.short;
- use type Interfaces.C.size_t, Interfaces.C.ptrdiff_t;
- use type Interfaces.C.char, Interfaces.C.char_array;
-
- TC_Count : Interfaces.C.size_t;
- TC_Increment : Interfaces.C.ptrdiff_t;
- TC_ptrdiff_t : Interfaces.C.ptrdiff_t;
- TC_Short : Interfaces.C.short := 0;
- TC_Verbose : Boolean := False;
- Constant_Min_Array_Size : constant Interfaces.C.size_t := 0;
- Constant_Max_Array_Size : constant Interfaces.C.size_t := 20;
- Min_Array_Size : Interfaces.C.size_t := Interfaces.C.size_t(
- Report.Ident_Int(Integer(Constant_Min_Array_Size)));
- Max_Array_Size : Interfaces.C.size_t := Interfaces.C.size_t(
- Report.Ident_Int(Integer(Constant_Max_Array_Size)));
- Min_size_t,
- Max_size_t : Interfaces.C.size_t;
- Short_Terminator : Interfaces.C.short := Interfaces.C.short'Last;
- Alphabet : constant String := "abcdefghijklmnopqrstuvwxyz";
-
-
- type Short_Array_Type is
- array (Interfaces.C.size_t range <>) of aliased Interfaces.C.short;
-
- type Constrained_Array_Type is
- array (Min_Array_Size..Max_Array_Size) of aliased Interfaces.C.short;
-
- type Static_Constrained_Array_Type is
- array (Constant_Min_Array_Size .. Constant_Max_Array_Size) of
- aliased Interfaces.C.short;
-
- type Array_of_Arrays_Type is
- array (Interfaces.C.size_t range <>) of aliased
- Static_Constrained_Array_Type;
-
-
- Short_Array : Short_Array_Type(Min_Array_Size..Max_Array_Size);
-
- Constrained_Array : Constrained_Array_Type;
-
- Terminator_Array : Static_Constrained_Array_Type :=
- (others => Short_Terminator);
-
- Ch_Array : Interfaces.C.char_array
- (0..Interfaces.C.size_t(Alphabet'Length)) :=
- Interfaces.C.To_C(Alphabet, True);
-
- Array_of_Arrays : Array_of_Arrays_Type
- (Min_Array_Size..Max_Array_Size);
-
-
- package Short_Pointers is new
- Interfaces.C.Pointers (Index => Interfaces.C.size_t,
- Element => Interfaces.C.short,
- Element_Array => Short_Array_Type,
- Default_Terminator => Short_Terminator);
-
- package Char_Pointers is new
- Interfaces.C.Pointers (Interfaces.C.size_t,
- Interfaces.C.char,
- Element_Array => Interfaces.C.char_array,
- Default_Terminator => Interfaces.C.nul);
-
- package Array_Pointers is new
- Interfaces.C.Pointers (Interfaces.C.size_t,
- Static_Constrained_Array_Type,
- Array_of_Arrays_Type,
- Terminator_Array);
-
-
- use Short_Pointers, Char_Pointers, Array_Pointers;
-
- Short_Ptr : Short_Pointers.Pointer := Short_Array(0)'Access;
- Char_Ptr : Char_Pointers.Pointer := Ch_Array(0)'Access;
- Start_Char_Ptr : Char_Pointers.Pointer := Ch_Array(1)'Access;
- End_Char_Ptr : Char_Pointers.Pointer := Ch_Array(10)'Access;
- Array_Ptr : Array_Pointers.Pointer := Array_of_Arrays(0)'Access;
- Start_Array_Ptr : Array_Pointers.Pointer := Array_of_Arrays(1)'Access;
- End_Array_Ptr : Array_Pointers.Pointer := Array_of_Arrays(10)'Access;
-
- begin
-
- -- Provide initial values for the arrays that hold short int values.
-
- for i in Min_Array_Size..Max_Array_Size-1 loop
- Short_Array(i) := Interfaces.C.short(i);
- for j in Min_Array_Size..Max_Array_Size loop
- -- Initialize this "array of arrays" so that element (i)(0)
- -- is different for each value of i.
- Array_of_Arrays(i)(j) := TC_Short;
- TC_Short := TC_Short + 1;
- end loop;
- end loop;
-
- -- Set the final element of each array object to be the "terminator"
- -- element used in the instantiations above.
-
- Short_Array(Max_Array_Size) := Short_Terminator;
- Array_of_Arrays(Max_Array_Size) := Terminator_Array;
-
- -- Check starting pointer positions.
-
- if Short_Ptr.all /= 0 or
- Char_Ptr.all /= Ch_Array(0) or
- Array_Ptr.all /= Array_of_Arrays(0)
- then
- Report.Failed("Incorrect initial value for the first " &
- "Short_Array, Ch_Array, or Array_of_Array values");
- end if;
-
-
- -- Check that both versions of the "+" function with Pointer and
- -- ptrdiff_t parameters, that return a Pointer value, produce correct
- -- results, based on the size of the array elements.
-
- for i in Min_Array_Size + 1 .. Max_Array_Size loop
-
- if Integer(i)/2*2 /= Integer(i) then -- Odd numbered loops.
- -- Pointer + ptrdiff_t, increment by 1.
- Short_Ptr := Short_Ptr + 1;
- else -- Even numbered loops.
- -- ptrdiff_t + Pointer, increment by 1.
- Short_Ptr := 1 + Short_Ptr;
- end if;
-
- if Short_Ptr.all /= Short_Array(i) then
- Report.Failed("Incorrect value returned following use " &
- "of the function +, incrementing by 1, " &
- "array position : " & Integer'Image(Integer(i)));
- if not TC_Verbose then
- exit;
- end if;
- end if;
- end loop;
-
- Array_Ptr := Array_of_Arrays(Min_Array_Size)'Access;
- TC_Count := Min_Array_Size;
- TC_Increment := 3;
- while TC_Count+Interfaces.C.size_t(TC_Increment) < Max_Array_Size loop
-
- if Integer(TC_Count)/2*2 /= Integer(TC_Count) then
- -- Odd numbered loops.
- -- Pointer + ptrdiff_t, increment by 3.
- Array_Ptr := Array_Pointers."+"(Array_Ptr, TC_Increment);
- else
- -- Odd numbered loops.
- -- ptrdiff_t + Pointer, increment by 3.
- Array_Ptr := Array_Pointers."+"(Left => TC_Increment,
- Right => Array_Ptr);
- end if;
-
- if Array_Ptr.all /=
- Array_of_Arrays(TC_Count+Interfaces.C.size_t(TC_Increment))
- then
- Report.Failed("Incorrect value returned following use " &
- "of the function +, incrementing by " &
- Integer'Image(Integer(TC_Increment)) &
- ", array position : " &
- Integer'Image(Integer(TC_Count) +
- Integer(TC_Increment)));
- if not TC_Verbose then
- exit;
- end if;
- end if;
-
- TC_Count := TC_Count + Interfaces.C.size_t(TC_Increment);
- end loop;
-
-
-
- -- Check that the "-" function with Pointer and ptrdiff_t parameters,
- -- that returns a Pointer result, produces correct results, based
- -- on the size of the array elements.
-
- -- Set the pointer to the last element in the char_array, which is a
- -- nul char.
- Char_Ptr := Ch_Array(Interfaces.C.size_t(Alphabet'Length))'Access;
-
- if Char_Ptr.all /= Interfaces.C.nul then
- Report.Failed("Incorrect initial value for the last " &
- "Ch_Array value");
- end if;
-
- Min_size_t := 1;
- Max_size_t := Interfaces.C.size_t(Alphabet'Length);
-
- for i in reverse Min_size_t..Max_size_t loop
-
- -- Subtract 1 from the pointer; it should now point to the previous
- -- element in the array.
- Char_Ptr := Char_Ptr - 1;
-
- if Char_Ptr.all /= Ch_Array(i-1) then
- Report.Failed("Incorrect value returned following use " &
- "of the function '-' with char element values, " &
- "array position : " & Integer'Image(Integer(i-1)));
- if not TC_Verbose then
- exit;
- end if;
- end if;
- end loop;
-
- Array_Ptr := Array_of_Arrays(Max_Array_Size)'Access;
- TC_Count := Max_Array_Size;
- TC_Increment := 3;
- while TC_Count > Min_Array_Size+Interfaces.C.size_t(TC_Increment) loop
-
- -- Decrement the pointer by 3.
- Array_Ptr := Array_Pointers."-"(Array_Ptr, Right => 3);
-
- if Array_Ptr.all /=
- Array_of_Arrays(TC_Count - Interfaces.C.size_t(TC_Increment))
- then
- Report.Failed("Incorrect value returned following use " &
- "of the function -, decrementing by " &
- Integer'Image(Integer(TC_Increment)) &
- ", array position : " &
- Integer'Image(Integer(TC_Count-3)));
- if not TC_Verbose then
- exit;
- end if;
- end if;
-
- TC_Count := TC_Count - Interfaces.C.size_t(TC_Increment);
- end loop;
-
-
-
- -- Check that the "-" function with two Pointer parameters, that
- -- returns a ptrdiff_t type result, produces correct results,
- -- based on the size of the array elements.
-
- TC_ptrdiff_t := 9;
- if Char_Pointers."-"(Left => End_Char_Ptr,
- Right => Start_Char_Ptr) /= TC_ptrdiff_t
- then
- Report.Failed("Incorrect result from pointer-pointer " &
- "subtraction - 1");
- end if;
-
- Start_Char_Ptr := Ch_Array(1)'Access;
- End_Char_Ptr := Ch_Array(25)'Access;
-
- TC_ptrdiff_t := 24;
- if Char_Pointers."-"(End_Char_Ptr,
- Right => Start_Char_Ptr) /= TC_ptrdiff_t
- then
- Report.Failed("Incorrect result from pointer-pointer " &
- "subtraction - 2");
- end if;
-
- TC_ptrdiff_t := 9;
- if Array_Pointers."-"(End_Array_Ptr,
- Start_Array_Ptr) /= TC_ptrdiff_t
- then
- Report.Failed("Incorrect result from pointer-pointer " &
- "subtraction - 3");
- end if;
-
- Start_Array_Ptr := Array_of_Arrays(Min_Array_Size)'Access;
- End_Array_Ptr := Array_of_Arrays(Max_Array_Size)'Access;
-
- TC_ptrdiff_t := Interfaces.C.ptrdiff_t(Max_Array_Size) -
- Interfaces.C.ptrdiff_t(Min_Array_Size);
- if End_Array_Ptr - Start_Array_Ptr /= TC_ptrdiff_t then
- Report.Failed("Incorrect result from pointer-pointer " &
- "subtraction - 4");
- end if;
-
-
-
- -- Check that the Increment procedure produces correct results,
- -- based upon the size of the array elements.
-
- Short_Ptr := Short_Array(0)'Access;
-
- for i in Min_Array_Size + 1 .. Max_Array_Size loop
- -- Increment the value of the Pointer; it should now point
- -- to the next element in the array.
- Increment(Ref => Short_Ptr);
-
- if Short_Ptr.all /= Short_Array(i) then
- Report.Failed("Incorrect value returned following use " &
- "of the Procedure Increment on pointer to an " &
- "array of short values, array position : " &
- Integer'Image(Integer(i)));
- if not TC_Verbose then
- exit;
- end if;
- end if;
- end loop;
-
- Array_Ptr := Array_of_Arrays(0)'Access;
-
- for i in Min_Array_Size + 1 .. Max_Array_Size loop
- -- Increment the value of the Pointer; it should now point
- -- to the next element in the array.
- Increment(Array_Ptr);
-
- if Array_Ptr.all /= Array_of_Arrays(i) then
- Report.Failed("Incorrect value returned following use " &
- "of the Procedure Increment on an array of " &
- "arrays, array position : " &
- Integer'Image(Integer(i)));
- if not TC_Verbose then
- exit;
- end if;
- end if;
- end loop;
-
-
- -- Check that the Decrement procedure produces correct results,
- -- based upon the size of the array elements.
-
- Short_Ptr := Short_Array(Max_Array_Size)'Access;
-
- for i in reverse Min_Array_Size .. Max_Array_Size - 1 loop
- -- Decrement the value of the Pointer; it should now point
- -- to the previous element in the array.
- Decrement(Ref => Short_Ptr);
-
- if Short_Ptr.all /= Short_Array(i) then
- Report.Failed("Incorrect value returned following use " &
- "of the Procedure Decrement on pointer to an " &
- "array of short values, array position : " &
- Integer'Image(Integer(i)));
- if not TC_Verbose then
- exit;
- end if;
- end if;
- end loop;
-
- Array_Ptr := Array_of_Arrays(Max_Array_Size)'Access;
-
- for i in reverse Min_Array_Size .. Max_Array_Size - 1 loop
- -- Decrement the value of the Pointer; it should now point
- -- to the previous array element.
- Decrement(Array_Ptr);
-
- if Array_Ptr.all /= Array_of_Arrays(i) then
- Report.Failed("Incorrect value returned following use " &
- "of the Procedure Decrement on an array of " &
- "arrays, array position : " &
- Integer'Image(Integer(i)));
- if not TC_Verbose then
- exit;
- end if;
- end if;
- end loop;
-
-
-
- -- Check that each of the "+" and "-" functions above will
- -- propagate Pointer_Error if a Pointer parameter is null.
-
- begin
- Short_Ptr := null;
- Short_Ptr := Short_Ptr + 4;
- Report.Failed("Pointer_Error not raised by Function + when " &
- "the Pointer parameter is null");
- if Short_Ptr /= null then -- To avoid optimization.
- Report.Comment("This should never be printed");
- end if;
- exception
- when Short_Pointers.Pointer_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function + " &
- "when the Pointer parameter is null");
- end;
-
-
- begin
- Char_Ptr := null;
- Char_Ptr := Char_Ptr - 1;
- Report.Failed("Pointer_Error not raised by Function - when " &
- "the Pointer parameter is null");
- if Char_Ptr /= null then -- To avoid optimization.
- Report.Comment("This should never be printed");
- end if;
- exception
- when Char_Pointers.Pointer_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Function - " &
- "when the Pointer parameter is null");
- end;
-
-
- begin
- Array_Ptr := null;
- Decrement(Array_Ptr);
- Report.Failed("Pointer_Error not raised by Procedure Decrement " &
- "when the Pointer parameter is null");
- if Array_Ptr /= null then -- To avoid optimization.
- Report.Comment("This should never be printed");
- end if;
- exception
- when Array_Pointers.Pointer_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Procedure " &
- "Decrement when the Pointer parameter is null");
- end;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB3015;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb3016.a b/gcc/testsuite/ada/acats/tests/cxb/cxb3016.a
deleted file mode 100644
index 362a062ad22..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb3016.a
+++ /dev/null
@@ -1,516 +0,0 @@
--- CXB3016.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that function Virtual_Length returns the number of elements
--- in the array referenced by the Pointer parameter Ref, up to (but
--- not including) the (first) instance of the element specified in
--- the Terminator parameter.
---
--- Check that the procedure Copy_Terminated_Array copies the array of
--- elements referenced by Pointer parameter Source, into the array
--- pointed to by parameter Target, based on which of the following
--- two scenarios occurs first:
--- 1) copying the Terminator element, or
--- 2) copying the number of elements specified in parameter Limit.
---
--- Check that procedure Copy_Terminated_Array will propagate
--- Dereference_Error if either the Source or Target parameter is null.
---
--- Check that procedure Copy_Array will copy an array of elements
--- of length specified in parameter Length, referenced by the
--- Pointer parameter Source, into the array pointed to by parameter
--- Target.
---
--- Check that procedure Copy_Array will propagate Dereference_Error
--- if either the Source or Target parameter is null.
---
--- TEST DESCRIPTION:
--- This test checks that the function Virtual_Length and the procedures
--- Copy_Terminated_Array and Copy_Array in the generic package
--- Interfaces.C.Pointers will allow the user to manipulate arrays of
--- char and short values through the pointers that reference the
--- arrays.
---
--- Package Interfaces.C.Pointers is instantiated twice, once for
--- short values and once for chars. Pointers from each instantiated
--- package are then used to reference arrays of the appropriate
--- element type. The subprograms under test are used to determine the
--- length, and to copy, either portions or the entire content of the
--- arrays. The results of these operations are then compared against
--- expected results.
---
--- The propagation of Dereference_Error is checked for when either
--- of the two procedures is supplied with a null Pointer parameter.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.C.char:
--- ' ', and 'a'..'z'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- packages Interfaces.C, Interfaces.C.Strings, and
--- Interfaces.C.Pointers. If an implementation provides these packages,
--- this test must compile, execute, and report "PASSED".
---
---
--- CHANGE HISTORY:
--- 01 Feb 96 SAIC Initial release for 2.1
--- 13 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 26 Oct 96 SAIC Incorporated reviewer comments.
--- 26 Feb 97 PWB.CTA Moved code using null pointer to avoid errors
---!
-
-with Report;
-with Ada.Exceptions;
-with Interfaces.C; -- N/A => ERROR
-with Interfaces.C.Pointers; -- N/A => ERROR
-with Interfaces.C.Strings; -- N/A => ERROR
-
-procedure CXB3016 is
-begin
-
- Report.Test ("CXB3016", "Check that subprograms Virtual_Length, " &
- "Copy_Terminated_Array, and Copy_Array " &
- "produce correct results");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
- use Interfaces.C.Strings;
-
- use type Interfaces.C.char,
- Interfaces.C.char_array,
- Interfaces.C.ptrdiff_t,
- Interfaces.C.short,
- Interfaces.C.size_t;
-
- TC_char : Interfaces.C.char := 'a';
- TC_ptrdiff_t : Interfaces.C.ptrdiff_t;
- TC_Short : Interfaces.C.short := 0;
- Min_Array_Size : Interfaces.C.size_t := 0;
- Max_Array_Size : Interfaces.C.size_t := 20;
- Short_Terminator : Interfaces.C.short := Interfaces.C.short'Last;
- Alphabet : constant String := "abcdefghijklmnopqrstuvwxyz";
- Blank_String : constant String := " ";
-
- type Short_Array_Type is
- array (Interfaces.C.size_t range <>) of aliased Interfaces.C.short;
-
- Ch_Array : Interfaces.C.char_array
- (0..Interfaces.C.size_t(Alphabet'Length)) :=
- Interfaces.C.To_C(Alphabet, True);
-
- TC_Ch_Array : Interfaces.C.char_array
- (0..Interfaces.C.size_t(Blank_String'Length)) :=
- Interfaces.C.To_C(Blank_String, True);
-
- Short_Array : Short_Array_Type(Min_Array_Size..Max_Array_Size);
- TC_Short_Array : Short_Array_Type(Min_Array_Size..Max_Array_Size);
-
-
- package Char_Pointers is new
- Interfaces.C.Pointers (Index => Interfaces.C.size_t,
- Element => Interfaces.C.char,
- Element_Array => Interfaces.C.char_array,
- Default_Terminator => Interfaces.C.nul);
-
- package Short_Pointers is new
- Interfaces.C.Pointers (Index => Interfaces.C.size_t,
- Element => Interfaces.C.short,
- Element_Array => Short_Array_Type,
- Default_Terminator => Short_Terminator);
-
- use Short_Pointers, Char_Pointers;
-
- Short_Ptr : Short_Pointers.Pointer := Short_Array(0)'Access;
- TC_Short_Ptr : Short_Pointers.Pointer := TC_Short_Array(0)'Access;
- Char_Ptr : Char_Pointers.Pointer := Ch_Array(0)'Access;
- TC_Char_Ptr : Char_Pointers.Pointer := TC_Ch_Array(0)'Access;
-
- begin
-
- -- Provide initial values for the array that holds short int values.
-
- for i in Min_Array_Size..Max_Array_Size loop
- Short_Array(i) := Interfaces.C.short(i);
- TC_Short_Array(i) := 100;
- end loop;
-
- -- Set the final element of the short array object to be the "terminator"
- -- element used in the instantiation above.
-
- Short_Array(Max_Array_Size) := Short_Terminator;
-
- -- Check starting pointer positions.
-
- if Short_Ptr.all /= 0 or
- Char_Ptr.all /= Ch_Array(0)
- then
- Report.Failed("Incorrect initial value for the first " &
- "Char_Array or Short_Array values");
- end if;
-
-
-
- -- Check that function Virtual_Length returns the number of elements
- -- in the array referenced by the Pointer parameter Ref, up to (but
- -- not including) the (first) instance of the element specified in
- -- the Terminator parameter.
-
- TC_char := 'j';
-
- TC_ptrdiff_t := Char_Pointers.Virtual_Length(Ref => Char_Ptr,
- Terminator => TC_char);
- if TC_ptrdiff_t /= 9 then
- Report.Failed("Incorrect result from function Virtual_Length " &
- "with Char_ptr parameter - 1");
- end if;
-
- TC_char := Interfaces.C.nul;
-
- TC_ptrdiff_t := Char_Pointers.Virtual_Length(Char_Ptr,
- Terminator => TC_char);
- if TC_ptrdiff_t /= Interfaces.C.ptrdiff_t(Alphabet'Length) then
- Report.Failed("Incorrect result from function Virtual_Length " &
- "with Char_ptr parameter - 2");
- end if;
-
- TC_Short := 10;
-
- TC_ptrdiff_t := Short_Pointers.Virtual_Length(Short_Ptr, TC_Short);
-
- if TC_ptrdiff_t /= 10 then
- Report.Failed("Incorrect result from function Virtual_Length " &
- "with Short_ptr parameter - 1");
- end if;
-
- -- Replace an element of the Short_Array with the element used as the
- -- terminator of the entire array; now there are two occurrences of the
- -- terminator element in the array. The call to Virtual_Length should
- -- return the number of array elements prior to the first terminator.
-
- Short_Array(5) := Short_Terminator;
-
- if Short_Pointers.Virtual_Length(Short_Ptr, Short_Terminator) /= 5
- then
- Report.Failed("Incorrect result from function Virtual_Length " &
- "with Short_ptr parameter - 2");
- end if;
-
-
-
- -- Check that the procedure Copy_Terminated_Array copies the array of
- -- elements referenced by Pointer parameter Source, into the array
- -- pointed to by parameter Target, based on which of the following
- -- two scenarios occurs first:
- -- 1) copying the Terminator element, or
- -- 2) copying the number of elements specified in parameter Limit.
- -- Note: Terminator element must be copied to Target, as well as
- -- all array elements prior to the terminator element.
-
- if TC_Ch_Array = Ch_Array then
- Report.Failed("The two char arrays are equivalent prior to the " &
- "call to Copy_Terminated_Array - 1");
- end if;
-
-
- -- Case 1: Copying the Terminator Element. (Default terminator)
-
- Char_Pointers.Copy_Terminated_Array(Source => Char_Ptr,
- Target => TC_Char_Ptr);
-
- if TC_Ch_Array /= Ch_Array then
- Report.Failed("The two char arrays are not equal following the " &
- "call to Copy_Terminated_Array, case of copying " &
- "the Terminator Element, using default terminator");
- end if;
-
- -- Reset the Target Pointer array.
-
- TC_Ch_Array := Interfaces.C.To_C(Blank_String, True);
- TC_Char_Ptr := TC_Ch_Array(0)'Access;
-
- if TC_Ch_Array = Ch_Array then
- Report.Failed("The two char arrays are equivalent prior to the " &
- "call to Copy_Terminated_Array - 2");
- end if;
-
-
- -- Case 2: Copying the Terminator Element. (Non-Default terminator)
-
- TC_char := 'b'; -- Second char in char_array pointed to by Char_Ptr
- Char_Pointers.Copy_Terminated_Array(Source => Char_Ptr,
- Target => TC_Char_Ptr,
- Terminator => TC_char);
-
- if TC_Ch_Array(0) /= Ch_Array(0) or -- Initial value modified.
- TC_Ch_Array(1) /= Ch_Array(1) or -- Initial value modified.
- TC_Ch_Array(2) = Ch_Array(2) or -- Initial value not modified.
- TC_Ch_Array(5) = Ch_Array(5) or -- Initial value not modified.
- TC_Ch_Array(15) = Ch_Array(15) or -- Initial value not modified.
- TC_Ch_Array(25) = Ch_Array(25) -- Initial value not modified.
- then
- Report.Failed("The appropriate portions of the two char arrays " &
- "are not equal following the call to " &
- "Copy_Terminated_Array, case of copying the " &
- "Terminator Element, using non-default terminator");
- end if;
-
-
- if TC_Short_Array = Short_Array then
- Report.Failed("The two short int arrays are equivalent prior " &
- "to the call to Copy_Terminated_Array - 1");
- end if;
-
- Short_Pointers.Copy_Terminated_Array(Source => Short_Ptr,
- Target => TC_Short_Ptr,
- Terminator => 2);
-
- if TC_Short_Array(0) /= Short_Array(0) or
- TC_Short_Array(1) /= Short_Array(1) or
- TC_Short_Array(2) /= Short_Array(2) or
- TC_Short_Array(3) /= 100 -- Initial value not modified.
- then
- Report.Failed("The appropriate portions of the two short int " &
- "arrays are not equal following the call to " &
- "Copy_Terminated_Array, case of copying the " &
- "Terminator Element, using non-default terminator");
- end if;
-
-
- -- Case 3: Copying the number of elements specified in parameter Limit.
-
- if TC_Short_Array = Short_Array then
- Report.Failed("The two short int arrays are equivalent prior " &
- "to the call to Copy_Terminated_Array - 2");
- end if;
-
- TC_ptrdiff_t := 5;
-
- Short_Pointers.Copy_Terminated_Array(Source => Short_Ptr,
- Target => TC_Short_Ptr,
- Limit => TC_ptrdiff_t,
- Terminator => Short_Terminator);
-
- if TC_Short_Array(0) /= Short_Array(0) or
- TC_Short_Array(1) /= Short_Array(1) or
- TC_Short_Array(2) /= Short_Array(2) or
- TC_Short_Array(3) /= Short_Array(3) or
- TC_Short_Array(4) /= Short_Array(4) or
- TC_Short_Array(5) /= 100 -- Initial value not modified.
- then
- Report.Failed("The appropriate portions of the two Short arrays " &
- "are not equal following the call to " &
- "Copy_Terminated_Array, case of copying the number " &
- "of elements specified in parameter Limit");
- end if;
-
-
- -- Case 4: Copying the number of elements specified in parameter Limit,
- -- which also happens to be the number of elements up to and
- -- including the first terminator.
-
- -- Reset initial values for the array that holds short int values.
-
- for i in Min_Array_Size..Max_Array_Size loop
- Short_Array(i) := Interfaces.C.short(i);
- TC_Short_Array(i) := 100;
- end loop;
-
- if TC_Short_Array = Short_Array then
- Report.Failed("The two short int arrays are equivalent prior " &
- "to the call to Copy_Terminated_Array - 3");
- end if;
-
- TC_ptrdiff_t := 3; -- Specifies three elements to be copied.
- Short_Terminator := 2; -- Value held in Short_Array third element,
- -- will serve as the "terminator" element.
-
- Short_Pointers.Copy_Terminated_Array(Source => Short_Ptr,
- Target => TC_Short_Ptr,
- Limit => TC_ptrdiff_t,
- Terminator => Short_Terminator);
-
- if TC_Short_Array(0) /= Short_Array(0) or -- First element copied.
- TC_Short_Array(1) /= Short_Array(1) or -- Second element copied.
- TC_Short_Array(2) /= Short_Array(2) or -- Third element copied.
- TC_Short_Array(3) /= 100 -- Initial value of fourth element
- then -- not modified.
- Report.Failed("The appropriate portions of the two Short arrays " &
- "are not equal following the call to " &
- "Copy_Terminated_Array, case of copying the number " &
- "of elements specified in parameter " &
- "Limit, which also happens to be the number of " &
- "elements up to and including the first terminator");
- end if;
-
-
-
- -- Check that procedure Copy_Terminated_Array will propagate
- -- Dereference_Error if either the Source or Target parameter is null.
-
- Char_Ptr := null;
- begin
- Char_Pointers.Copy_Terminated_Array(Char_Ptr, TC_Char_Ptr);
- Report.Failed("Dereference_Error not raised by call to " &
- "Copy_Terminated_Array with null Source parameter");
- if TC_Char_Ptr = null then -- To avoid optimization.
- Report.Comment("This should never be printed");
- end if;
- exception
- when Dereference_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by call to " &
- "Copy_Terminated_Array with null Source parameter");
- end;
-
- TC_Short_Ptr := null;
- begin
- Short_Pointers.Copy_Terminated_Array(Short_Ptr, TC_Short_Ptr);
- Report.Failed("Dereference_Error not raised by call to " &
- "Copy_Terminated_Array with null Target parameter");
- if Short_Ptr = null then -- To avoid optimization.
- Report.Comment("This should never be printed");
- end if;
- exception
- when Dereference_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by call to " &
- "Copy_Terminated_Array with null Target parameter");
- end;
-
-
-
- -- Check that the procedure Copy_Array will copy the array of
- -- elements of length specified in parameter Length, referenced by
- -- the Pointer parameter Source, into the array pointed to by
- -- parameter Target.
-
- -- Reinitialize Target arrays prior to test cases below.
-
- TC_Ch_Array := Interfaces.C.To_C(Blank_String, True);
-
- for i in Min_Array_Size..Max_Array_Size loop
- TC_Short_Array(i) := 100;
- end loop;
-
- Char_Ptr := Ch_Array(0)'Access;
- TC_Char_Ptr := TC_Ch_Array(0)'Access;
- Short_Ptr := Short_Array(0)'Access;
- TC_Short_Ptr := TC_Short_Array(0)'Access;
-
- TC_ptrdiff_t := 4;
-
- Char_Pointers.Copy_Array(Source => Char_Ptr,
- Target => TC_Char_Ptr,
- Length => TC_ptrdiff_t);
-
- if TC_Ch_Array(0) /= Ch_Array(0) or
- TC_Ch_Array(1) /= Ch_Array(1) or
- TC_Ch_Array(2) /= Ch_Array(2) or
- TC_Ch_Array(3) /= Ch_Array(3) or
- TC_Ch_Array(4) = Ch_Array(4)
- then
- Report.Failed("Incorrect result from Copy_Array when using " &
- "char pointer arguments, partial array copied");
- end if;
-
-
- TC_ptrdiff_t := Interfaces.C.ptrdiff_t(Max_Array_Size) + 1;
-
- Short_Pointers.Copy_Array(Short_Ptr, TC_Short_Ptr, TC_ptrdiff_t);
-
- if TC_Short_Array /= Short_Array then
- Report.Failed("Incorrect result from Copy_Array when using Short " &
- "pointer arguments, entire array copied");
- end if;
-
-
-
- -- Check that procedure Copy_Array will propagate Dereference_Error
- -- if either the Source or Target parameter is null.
-
- Char_Ptr := null;
- begin
- Char_Pointers.Copy_Array(Char_Ptr, TC_Char_Ptr, TC_ptrdiff_t);
- Report.Failed("Dereference_Error not raised by call to " &
- "Copy_Array with null Source parameter");
- if TC_Char_Ptr = null then -- To avoid optimization.
- Report.Comment("This should never be printed");
- end if;
- exception
- when Dereference_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by call to " &
- "Copy_Array with null Source parameter");
- end;
-
- TC_Short_Ptr := null;
- begin
- Short_Pointers.Copy_Array(Short_Ptr, TC_Short_Ptr, TC_ptrdiff_t);
- Report.Failed("Dereference_Error not raised by call to " &
- "Copy_Array with null Target parameter");
- if Short_Ptr = null then -- To avoid optimization.
- Report.Comment("This should never be printed");
- end if;
- exception
- when Dereference_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by call to " &
- "Copy_Array with null Target parameter");
- end;
-
-
- -- Check that function Virtual_Length will propagate Dereference_Error
- -- if the Source parameter is null.
-
- Char_Ptr := null;
- begin
- TC_ptrdiff_t := Char_Pointers.Virtual_Length(Char_Ptr,
- Terminator => TC_char);
- Report.Failed("Dereference_Error not raised by call to " &
- "Virtual_Length with null Source parameter");
- if TC_ptrdiff_t = 100 then -- To avoid optimization.
- Report.Comment("This should never be printed");
- end if;
- exception
- when Dereference_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by call to " &
- "Virtual_Length with null Source parameter");
- end;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB3016;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb4001.a b/gcc/testsuite/ada/acats/tests/cxb/cxb4001.a
deleted file mode 100644
index 0c9ab1a6279..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb4001.a
+++ /dev/null
@@ -1,230 +0,0 @@
--- CXB4001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the specifications of the package Interfaces.COBOL
--- are available for use
---
--- TEST DESCRIPTION:
--- This test verifies that the type and the subprograms specified for
--- the interface are present.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.COBOL. If an implementation provides
--- package Interfaces.COBOL, this test must compile, execute, and
--- report "PASSED".
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 Nov 95 SAIC Corrected visibility errors for ACVC 2.0.1.
--- 28 Feb 96 SAIC Added applicability criteria.
--- 27 Oct 96 SAIC Incorporated reviewer comments.
--- 01 DEC 97 EDS Change "To_Comp" to "To_Binary".
---!
-
-with Report;
-with Interfaces.COBOL; -- N/A => ERROR
-
-procedure CXB4001 is
-
- package COBOL renames Interfaces.COBOL;
- use type COBOL.Byte;
- use type COBOL.Decimal_Element;
-
-begin
-
- Report.Test ("CXB4001", "Check the specification of Interfaces.COBOL");
-
-
- declare -- encapsulate the test
-
- -- Types and operations for internal data representations
-
- TST_Floating : COBOL.Floating;
- TST_Long_Floating : COBOL.Long_Floating;
-
- TST_Binary : COBOL.Binary;
- TST_Long_Binary : COBOL.Long_Binary;
-
- TST_Max_Digits_Binary : constant := COBOL.Max_Digits_Binary;
- TST_Max_Digits_Long_Binary : constant := COBOL.Max_Digits_Long_Binary;
-
- TST_Decimal_Element : COBOL.Decimal_Element;
-
- TST_Packed_Decimal : COBOL.Packed_Decimal (1..5) :=
- (others => COBOL.Decimal_Element'First);
-
- -- initialize it so it can reasonably be used later
- TST_COBOL_Character : COBOL.COBOL_Character :=
- COBOL.COBOL_Character'First;
-
- TST_Ada_To_COBOL : COBOL.COBOL_Character :=
- COBOL.Ada_To_COBOL (Character'First);
-
- TST_COBOL_To_Ada : Character :=
- COBOL.COBOL_To_Ada (COBOL.COBOL_Character'First);
-
- -- assignment to make sure it is an array of COBOL_Character
- TST_Alphanumeric : COBOL.Alphanumeric (1..5) :=
- (others => TST_COBOL_Character);
-
-
- -- assignment to make sure it is an array of COBOL_Character
- TST_Numeric : COBOL.Numeric (1..5) := (others => TST_COBOL_Character);
-
-
- procedure Collect_All_Calls is
-
- CAC_Alphanumeric : COBOL.Alphanumeric(1..5) :=
- COBOL.To_COBOL("abcde");
- CAC_String : String (1..5) := "vwxyz";
- CAC_Natural : natural := 0;
-
- begin
-
- CAC_Alphanumeric := COBOL.To_COBOL (CAC_String);
- CAC_String := COBOL.To_Ada (CAC_Alphanumeric);
-
- COBOL.To_COBOL (CAC_String, CAC_Alphanumeric, CAC_Natural);
- COBOL.To_Ada (CAC_Alphanumeric, CAC_String, CAC_Natural);
-
- raise COBOL.Conversion_Error;
-
- end Collect_All_Calls;
-
-
-
- -- Formats for COBOL data representations
-
- TST_Unsigned : COBOL.Display_Format := COBOL.Unsigned;
- TST_Leading_Separate : COBOL.Display_Format := COBOL.Leading_Separate;
- TST_Trailing_Separate : COBOL.Display_Format := COBOL.Trailing_Separate;
- TST_Leading_Nonseparate : COBOL.Display_Format :=
- COBOL.Leading_Nonseparate;
- TST_Trailing_Nonseparate : COBOL.Display_Format :=
- COBOL.Trailing_Nonseparate;
-
-
- TST_High_Order_First : COBOL.Binary_Format := COBOL.High_Order_First;
- TST_Low_Order_First : COBOL.Binary_Format := COBOL.Low_Order_First;
- TST_Native_Binary : COBOL.Binary_Format := COBOL.Native_Binary;
-
-
- TST_Packed_Unsigned : COBOL.Packed_Format := COBOL.Packed_Unsigned;
- TST_Packed_Signed : COBOL.Packed_Format := COBOL.Packed_Signed;
-
-
- -- Types for external representation of COBOL binary data
-
- TST_Byte_Array : COBOL.Byte_Array(1..5) := (others => COBOL.Byte'First);
-
- -- Now instantiate one version of the generic
- --
- type bx4001_Decimal is delta 0.1 digits 5;
- package bx4001_conv is new COBOL.Decimal_Conversions (bx4001_Decimal);
-
- procedure Collect_All_Generic_Calls is
- CAGC_natural : natural;
- CAGC_Display_Format : COBOL.Display_Format;
- CAGC_Boolean : Boolean;
- CAGC_Numeric : COBOL.Numeric(1..5);
- CAGC_Num : bx4001_Decimal;
- CAGC_Packed_Decimal : COBOL.Packed_Decimal (1..5);
- CAGC_Packed_Format : COBOL.Packed_Format;
- CAGC_Byte_Array : COBOL.Byte_Array (1..5);
- CAGC_Binary_Format : COBOL.Binary_Format;
- CAGC_Binary : COBOL.Binary;
- CAGC_Long_Binary : COBOL.Long_Binary;
- begin
-
- -- Display Formats: data values are represented as Numeric
-
- CAGC_Boolean := bx4001_conv.Valid (CAGC_Numeric, CAGC_Display_Format);
- CAGC_Natural := bx4001_conv.Length (CAGC_Display_Format);
-
- CAGC_Num := bx4001_conv.To_Decimal
- (CAGC_Numeric, CAGC_Display_Format);
- CAGC_Numeric := bx4001_conv.To_Display
- (CAGC_Num, CAGC_Display_Format);
-
-
- -- Packed Formats: data values are represented as Packed_Decimal
-
- CAGC_Boolean := bx4001_conv.Valid
- (CAGC_Packed_Decimal, CAGC_Packed_Format);
-
- CAGC_Natural := bx4001_conv.Length (CAGC_Packed_Format);
-
- CAGC_Num := bx4001_conv.To_Decimal
- (CAGC_Packed_Decimal, CAGC_Packed_Format);
-
- CAGC_Packed_Decimal := bx4001_conv.To_Packed
- (CAGC_Num, CAGC_Packed_Format);
-
-
- -- Binary Formats: external data values are represented as
- -- Byte_Array
-
- CAGC_Boolean := bx4001_conv.Valid
- (CAGC_Byte_Array, CAGC_Binary_Format);
-
- CAGC_Natural := bx4001_conv.Length (CAGC_Binary_Format);
- CAGC_Num := bx4001_conv.To_Decimal
- (CAGC_Byte_Array, CAGC_Binary_Format);
-
- CAGC_Byte_Array := bx4001_conv.To_Binary (CAGC_Num, CAGC_Binary_Format);
-
-
- -- Internal Binary formats: data values are of type
- -- Binary/Long_Binary
-
- CAGC_Num := bx4001_conv.To_Decimal (CAGC_Binary);
- CAGC_Num := bx4001_conv.To_Decimal (CAGC_Long_Binary);
-
- CAGC_Binary := bx4001_conv.To_Binary (CAGC_Num);
- CAGC_Long_Binary := bx4001_conv.To_Long_Binary (CAGC_Num);
-
-
- end Collect_All_Generic_Calls;
-
-
- begin -- encapsulation
-
- if COBOL.Byte'First /= 0 or
- COBOL.Byte'Last /= (2 ** COBOL.COBOL_Character'Size) - 1 then
- Report.Failed ("Byte is incorrectly defined");
- end if;
-
- if COBOL.Decimal_Element'First /= 0 then
- Report.Failed ("Decimal_Element is incorrectly defined");
- end if;
-
- end; -- encapsulation
-
- Report.Result;
-
-end CXB4001;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb4002.a b/gcc/testsuite/ada/acats/tests/cxb/cxb4002.a
deleted file mode 100644
index e3934a5ef33..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb4002.a
+++ /dev/null
@@ -1,308 +0,0 @@
--- CXB4002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the procedure To_COBOL converts the character elements
--- of the String parameter Item into COBOL_Character elements of the
--- Alphanumeric type parameter Target, using the Ada_to_COBOL mapping
--- as the basis of conversion.
--- Check that the parameter Last contains the index of the last element
--- of parameter Target that was assigned by To_COBOL.
---
--- Check that Constraint_Error is propagated by procedure To_COBOL
--- when the length of String parameter Item exceeds the length of
--- Alphanumeric parameter Target.
---
--- Check that the procedure To_Ada converts the COBOL_Character
--- elements of the Alphanumeric parameter Item into Character elements
--- of the String parameter Target, using the COBOL_to_Ada mapping array
--- as the basis of conversion.
--- Check that the parameter Last contains the index of the last element
--- of parameter Target that was assigned by To_Ada.
---
--- Check that Constraint_Error is propagated by procedure To_Ada when
--- the length of Alphanumeric parameter Item exceeds the length of
--- String parameter Target.
---
--- TEST DESCRIPTION:
--- This test checks that the procedures To_COBOL and To_Ada produce
--- the correct results, based on a variety of parameter input values.
---
--- In the first series of subtests, the Out parameter results of
--- procedure To_COBOL are compared against expected results,
--- which includes (in the parameter Last) the index in Target of the
--- last element assigned. The situation where procedure To_COBOL raises
--- Constraint_Error (when Item'Length exceeds Target'Length) is also
--- verified.
---
--- In the second series of subtests, the Out parameter results of
--- procedure To_Ada are verified, in a similar manner as is done for
--- procedure To_COBOL. The case of procedure To_Ada raising
--- Constraint_Error is also verified.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.COBOL.COBOL_Character:
--- ' ', 'a'..'z', 'A'..'Z', '0'..'9', '*', '$', '-', '_', and '#'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.COBOL. If an implementation provides
--- package Interfaces.COBOL, this test must compile, execute, and
--- report "PASSED".
---
---
--- CHANGE HISTORY:
--- 12 Jan 96 SAIC Initial prerelease version.
--- 30 May 96 SAIC Added applicability criteria for ACVC 2.1.
--- 27 Oct 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Report;
-with Ada.Strings.Bounded;
-with Ada.Strings.Unbounded;
-with Interfaces.COBOL; -- N/A => ERROR
-
-procedure CXB4002 is
-begin
-
- Report.Test ("CXB4002", "Check that the procedures To_COBOL and " &
- "To_Ada produce correct results");
-
- Test_Block:
- declare
-
- package Bnd is new Ada.Strings.Bounded.Generic_Bounded_Length(10);
- package Unb renames Ada.Strings.Unbounded;
-
- use Interfaces;
- use Bnd, Unb;
- use type Interfaces.COBOL.Alphanumeric;
-
-
- Alphanumeric_1 : COBOL.Alphanumeric(1..1) := " ";
- Alphanumeric_5 : COBOL.Alphanumeric(1..5) := " ";
- Alphanumeric_10 : COBOL.Alphanumeric(1..10) := " ";
- Alphanumeric_20 : COBOL.Alphanumeric(1..20) := " ";
- TC_Alphanumeric_1 : COBOL.Alphanumeric(1..1) := "A";
- TC_Alphanumeric_5 : COBOL.Alphanumeric(1..5) := "ab*de";
- TC_Alphanumeric_10 : COBOL.Alphanumeric(1..10) := "$1a2b3C4D5";
- TC_Alphanumeric_20 : COBOL.Alphanumeric(1..20) := "1234-ABCD_6789#fghij";
-
- Bnd_String : Bnd.Bounded_String :=
- Bnd.To_Bounded_String(" ");
- TC_Bnd_String : Bounded_String :=
- To_Bounded_String("$1a2b3C4D5");
-
- Unb_String : Unb.Unbounded_String :=
- Unb.To_Unbounded_String(" ");
- TC_Unb_String : Unbounded_String :=
- To_Unbounded_String("ab*de");
-
- String_1 : String(1..1) := " ";
- String_5 : String(1..5) := " ";
- String_10 : String(1..10) := " ";
- String_20 : String(1..20) := " ";
- TC_String_1 : String(1..1) := "A";
- TC_String_20 : String(1..20) := "1234-ABCD_6789#fghij";
-
- TC_Alphanumeric : constant COBOL.Alphanumeric := ""; -- null array.
- TC_String : constant String := ""; -- null string.
- TC_Natural : Natural := 0;
-
-
- begin
-
- -- Check that the procedure To_COBOL converts the character elements
- -- of the String parameter Item into COBOL_Character elements of the
- -- Alphanumeric type parameter Target, using the Ada_to_COBOL mapping
- -- as the basis of conversion.
- -- Check that the parameter Last contains the index of the last element
- -- of parameter Target that was assigned by To_COBOL.
-
- COBOL.To_COBOL(Item => TC_String_1,
- Target => Alphanumeric_1,
- Last => TC_Natural);
-
- if Alphanumeric_1 /= TC_Alphanumeric_1 or
- TC_Natural /= TC_Alphanumeric_1'Length or
- TC_Natural /= 1
- then
- Report.Failed("Incorrect result from procedure To_COBOL - 1");
- end if;
-
- COBOL.To_COBOL(To_String(TC_Unb_String),
- Target => Alphanumeric_5,
- Last => TC_Natural);
-
- if Alphanumeric_5 /= TC_Alphanumeric_5 or
- TC_Natural /= TC_Alphanumeric_5'Length or
- TC_Natural /= 5
- then
- Report.Failed("Incorrect result from procedure To_COBOL - 2");
- end if;
-
- COBOL.To_COBOL(To_String(TC_Bnd_String),
- Alphanumeric_10,
- Last => TC_Natural);
-
- if Alphanumeric_10 /= TC_Alphanumeric_10 or
- TC_Natural /= TC_Alphanumeric_10'Length or
- TC_Natural /= 10
- then
- Report.Failed("Incorrect result from procedure To_COBOL - 3");
- end if;
-
- COBOL.To_COBOL(TC_String_20,
- Alphanumeric_20,
- TC_Natural);
-
- if Alphanumeric_20 /= TC_Alphanumeric_20 or
- TC_Natural /= TC_Alphanumeric_20'Length or
- TC_Natural /= 20
- then
- Report.Failed("Incorrect result from procedure To_COBOL - 4");
- end if;
-
- COBOL.To_COBOL(Item => TC_String, -- null string
- Target => Alphanumeric_1,
- Last => TC_Natural);
-
- if TC_Natural /= 0 then
- Report.Failed("Incorrect result from procedure To_COBOL, value " &
- "returned in parameter Last should be zero, since " &
- "parameter Item is null array");
- end if;
-
-
-
- -- Check that Constraint_Error is propagated by procedure To_COBOL
- -- when the length of String parameter Item exceeds the length of
- -- Alphanumeric parameter Target.
-
- begin
-
- COBOL.To_COBOL(Item => TC_String_20,
- Target => Alphanumeric_10,
- Last => TC_Natural);
- Report.Failed("Constraint_Error not raised by procedure To_COBOL " &
- "when Item'Length exceeds Target'Length");
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by procedure To_COBOL " &
- "when Item'Length exceeds Target'Length");
- end;
-
-
- -- Check that the procedure To_Ada converts the COBOL_Character
- -- elements of the Alphanumeric parameter Item into Character elements
- -- of the String parameter Target, using the COBOL_to_Ada mapping array
- -- as the basis of conversion.
- -- Check that the parameter Last contains the index of the last element
- -- of parameter Target that was assigned by To_Ada.
-
- COBOL.To_Ada(Item => TC_Alphanumeric_1,
- Target => String_1,
- Last => TC_Natural);
-
- if String_1 /= TC_String_1 or
- TC_Natural /= TC_String_1'Length or
- TC_Natural /= 1
- then
- Report.Failed("Incorrect result from procedure To_Ada - 1");
- end if;
-
- COBOL.To_Ada(TC_Alphanumeric_5,
- Target => String_5,
- Last => TC_Natural);
-
- if String_5 /= To_String(TC_Unb_String) or
- TC_Natural /= Length(TC_Unb_String) or
- TC_Natural /= 5
- then
- Report.Failed("Incorrect result from procedure To_Ada - 2");
- end if;
-
- COBOL.To_Ada(TC_Alphanumeric_10,
- String_10,
- Last => TC_Natural);
-
- if String_10 /= To_String(TC_Bnd_String) or
- TC_Natural /= Length(TC_Bnd_String) or
- TC_Natural /= 10
- then
- Report.Failed("Incorrect result from procedure To_Ada - 3");
- end if;
-
- COBOL.To_Ada(TC_Alphanumeric_20,
- String_20,
- TC_Natural);
-
- if String_20 /= TC_String_20 or
- TC_Natural /= TC_String_20'Length or
- TC_Natural /= 20
- then
- Report.Failed("Incorrect result from procedure To_Ada - 4");
- end if;
-
- COBOL.To_Ada(Item => TC_Alphanumeric, -- null array.
- Target => String_20,
- Last => TC_Natural);
-
- if TC_Natural /= 0 then
- Report.Failed("Incorrect result from procedure To_Ada, value " &
- "returned in parameter Last should be zero, since " &
- "parameter Item is null array");
- end if;
-
-
-
- -- Check that Constraint_Error is propagated by procedure To_Ada when
- -- the length of Alphanumeric parameter Item exceeds the length of
- -- String parameter Target.
-
- begin
-
- COBOL.To_Ada(Item => TC_Alphanumeric_10,
- Target => String_5,
- Last => TC_Natural);
- Report.Failed("Constraint_Error not raised by procedure To_Ada " &
- "when Item'Length exceeds Target'Length");
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by procedure To_Ada " &
- "when Item'Length exceeds Target'Length");
- end;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXB4002;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb4003.a b/gcc/testsuite/ada/acats/tests/cxb/cxb4003.a
deleted file mode 100644
index 609dabc5089..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb4003.a
+++ /dev/null
@@ -1,310 +0,0 @@
--- CXB4003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that function Valid, with the Display_Format parameter
--- set to Unsigned, will return True if Numeric parameter Item
--- comprises one or more decimal digit characters; check that it
--- returns False if the parameter Item is otherwise comprised.
---
--- Check that function Valid, with Display_Format parameter set to
--- Leading_Separate, will return True if Numeric parameter Item
--- comprises a single occurrence of a Plus_Sign or Minus_Sign
--- character, and then by one or more decimal digit characters;
--- check that it returns False if the parameter Item is otherwise
--- comprised.
---
--- Check that function Valid, with Display_Format parameter set to
--- Trailing_Separate, will return True if Numeric parameter Item
--- comprises one or more decimal digit characters, and then by a
--- single occurrence of the Plus_Sign or Minus_Sign character;
--- check that it returns False if the parameter Item is otherwise
--- comprised.
---
--- TEST DESCRIPTION:
--- This test checks that a version of function Valid, from an instance
--- of the generic package Decimal_Conversions, will produce correct
--- results based on the particular Numeric and Display_Format
--- parameters provided. Arrays of both valid and invalid Numeric
--- data items have been created to correspond to a particular
--- value of Display_Format. The result of the function is compared
--- against the expected result for each appropriate combination of
--- Numeric and Display_Format parameter.
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.COBOL.COBOL_Character:
--- ' ', 'A'..'Z', '+', '-', '.', '$'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.COBOL. If an implementation provides
--- package Interfaces.COBOL, this test must compile, execute, and
--- report "PASSED".
---
---
---
--- CHANGE HISTORY:
--- 18 Jan 96 SAIC Initial version for 2.1.
--- 30 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 27 Oct 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Report;
-with Ada.Exceptions;
-with Interfaces.COBOL; -- N/A => ERROR
-
-procedure CXB4003 is
-begin
-
- Report.Test ("CXB4003", "Check that function Valid, with various " &
- "Display_Format parameters, produces correct " &
- "results");
-
- Test_Block:
- declare
-
- use Interfaces;
- use Ada.Exceptions;
-
- type A_Numeric_Type is delta 0.01 digits 16;
- type Numeric_Access is access COBOL.Numeric;
- type Numeric_Items_Type is array(Integer range <>) of Numeric_Access;
-
- package Display_Format is
- new COBOL.Decimal_Conversions(Num => A_Numeric_Type);
-
-
- Number_Of_Valid_Unsigned_Items : constant := 5;
- Number_Of_Invalid_Unsigned_Items : constant := 21;
- Number_Of_Valid_Leading_Separate_Items : constant := 5;
- Number_Of_Invalid_Leading_Separate_Items : constant := 23;
- Number_Of_Valid_Trailing_Separate_Items : constant := 5;
- Number_Of_Invalid_Trailing_Separate_Items : constant := 22;
-
- Valid_Unsigned_Items :
- Numeric_Items_Type(1..Number_Of_Valid_Unsigned_Items) :=
- (new COBOL.Numeric'("0"),
- new COBOL.Numeric'("1"),
- new COBOL.Numeric'("0000000001"),
- new COBOL.Numeric'("1234567890123456"),
- new COBOL.Numeric'("0000"));
-
- Invalid_Unsigned_Items :
- Numeric_Items_Type(1..Number_Of_Invalid_Unsigned_Items) :=
- (new COBOL.Numeric'(" 12345"),
- new COBOL.Numeric'(" 12345"),
- new COBOL.Numeric'("1234567890 "),
- new COBOL.Numeric'("1234567890 "),
- new COBOL.Numeric'("1.01"),
- new COBOL.Numeric'(".0000000001"),
- new COBOL.Numeric'("12345 6"),
- new COBOL.Numeric'("MCXVIII"),
- new COBOL.Numeric'("15F"),
- new COBOL.Numeric'("+12345"),
- new COBOL.Numeric'("$12.30"),
- new COBOL.Numeric'("1234-"),
- new COBOL.Numeric'("12--"),
- new COBOL.Numeric'("+12-"),
- new COBOL.Numeric'("++99--"),
- new COBOL.Numeric'("-1.01"),
- new COBOL.Numeric'("(1.01)"),
- new COBOL.Numeric'("123,456"),
- new COBOL.Numeric'("101."),
- new COBOL.Numeric'(""),
- new COBOL.Numeric'("1.0000"));
-
- Valid_Leading_Separate_Items :
- Numeric_Items_Type(1..Number_Of_Valid_Leading_Separate_Items) :=
- (new COBOL.Numeric'("+1000"),
- new COBOL.Numeric'("-1"),
- new COBOL.Numeric'("-0000000001"),
- new COBOL.Numeric'("+1234567890123456"),
- new COBOL.Numeric'("-0000"));
-
- Invalid_Leading_Separate_Items :
- Numeric_Items_Type(1..Number_Of_Invalid_Leading_Separate_Items) :=
- (new COBOL.Numeric'("123456"),
- new COBOL.Numeric'(" +12345"),
- new COBOL.Numeric'(" +12345"),
- new COBOL.Numeric'("- 0000000001"),
- new COBOL.Numeric'("1234567890- "),
- new COBOL.Numeric'("1234567890+ "),
- new COBOL.Numeric'("123-456"),
- new COBOL.Numeric'("+15F"),
- new COBOL.Numeric'("++123"),
- new COBOL.Numeric'("12--"),
- new COBOL.Numeric'("+12-"),
- new COBOL.Numeric'("+/-12"),
- new COBOL.Numeric'("++99--"),
- new COBOL.Numeric'("1.01"),
- new COBOL.Numeric'("(1.01)"),
- new COBOL.Numeric'("+123,456"),
- new COBOL.Numeric'("+15FF"),
- new COBOL.Numeric'("- 123"),
- new COBOL.Numeric'("+$123"),
- new COBOL.Numeric'(""),
- new COBOL.Numeric'("-"),
- new COBOL.Numeric'("-1.01"),
- new COBOL.Numeric'("1.0000+"));
-
- Valid_Trailing_Separate_Items :
- Numeric_Items_Type(1..Number_Of_Valid_Trailing_Separate_Items) :=
- (new COBOL.Numeric'("1001-"),
- new COBOL.Numeric'("1+"),
- new COBOL.Numeric'("0000000001+"),
- new COBOL.Numeric'("1234567890123456-"),
- new COBOL.Numeric'("0000-"));
-
- Invalid_Trailing_Separate_Items :
- Numeric_Items_Type(1..Number_Of_Invalid_Trailing_Separate_Items) :=
- (new COBOL.Numeric'("123456"),
- new COBOL.Numeric'("+12345"),
- new COBOL.Numeric'("12345 "),
- new COBOL.Numeric'("123- "),
- new COBOL.Numeric'("123- "),
- new COBOL.Numeric'("12345 +"),
- new COBOL.Numeric'("12345+ "),
- new COBOL.Numeric'("-0000000001"),
- new COBOL.Numeric'("123-456"),
- new COBOL.Numeric'("12--"),
- new COBOL.Numeric'("+12-"),
- new COBOL.Numeric'("99+-"),
- new COBOL.Numeric'("12+/-"),
- new COBOL.Numeric'("12.01-"),
- new COBOL.Numeric'("$12.01+"),
- new COBOL.Numeric'("(1.01)"),
- new COBOL.Numeric'("DM12-"),
- new COBOL.Numeric'("123,456+"),
- new COBOL.Numeric'(""),
- new COBOL.Numeric'("-"),
- new COBOL.Numeric'("1.01-"),
- new COBOL.Numeric'("+1.0000"));
-
- begin
-
- -- Check that function Valid, with the Display_Format parameter
- -- set to Unsigned, will return True if Numeric parameter Item
- -- comprises one or more decimal digit characters; check that it
- -- returns False if the parameter Item is otherwise comprised.
-
- for i in 1..Number_of_Valid_Unsigned_Items loop
- -- Fail if the Item parameter is _NOT_ considered Valid.
- if not Display_Format.Valid(Item => Valid_Unsigned_Items(i).all,
- Format => COBOL.Unsigned)
- then
- Report.Failed("Incorrect result from function Valid, with " &
- "Format parameter set to Unsigned, for valid " &
- "format item number " & Integer'Image(i));
- end if;
- end loop;
-
-
- for i in 1..Number_of_Invalid_Unsigned_Items loop
- -- Fail if the Item parameter _IS_ considered Valid.
- if Display_Format.Valid(Item => Invalid_Unsigned_Items(i).all,
- Format => COBOL.Unsigned)
- then
- Report.Failed("Incorrect result from function Valid, with " &
- "Format parameter set to Unsigned, for invalid " &
- "format item number " & Integer'Image(i));
- end if;
- end loop;
-
-
-
- -- Check that function Valid, with Display_Format parameter set to
- -- Leading_Separate, will return True if Numeric parameter Item
- -- comprises a single occurrence of a Plus_Sign or Minus_Sign
- -- character, and then by one or more decimal digit characters;
- -- check that it returns False if the parameter Item is otherwise
- -- comprised.
-
- for i in 1..Number_of_Valid_Leading_Separate_Items loop
- -- Fail if the Item parameter is _NOT_ considered Valid.
- if not Display_Format.Valid(Valid_Leading_Separate_Items(i).all,
- Format => COBOL.Leading_Separate)
- then
- Report.Failed("Incorrect result from function Valid, with " &
- "Format parameter set to Leading_Separate, " &
- "for valid format item number " & Integer'Image(i));
- end if;
- end loop;
-
-
- for i in 1..Number_of_Invalid_Leading_Separate_Items loop
- -- Fail if the Item parameter _IS_ considered Valid.
- if Display_Format.Valid(Invalid_Leading_Separate_Items(i).all,
- Format => COBOL.Leading_Separate)
- then
- Report.Failed("Incorrect result from function Valid, with " &
- "Format parameter set to Leading_Separate, " &
- "for invalid format item number " &
- Integer'Image(i));
- end if;
- end loop;
-
-
-
- -- Check that function Valid, with Display_Format parameter set to
- -- Trailing_Separate, will return True if Numeric parameter Item
- -- comprises one or more decimal digit characters, and then by a
- -- single occurrence of the Plus_Sign or Minus_Sign character;
- -- check that it returns False if the parameter Item is otherwise
- -- comprised.
-
- for i in 1..Number_of_Valid_Trailing_Separate_Items loop
- -- Fail if the Item parameter is _NOT_ considered Valid.
- if not Display_Format.Valid(Valid_Trailing_Separate_Items(i).all,
- COBOL.Trailing_Separate)
- then
- Report.Failed("Incorrect result from function Valid, with " &
- "Format parameter set to Trailing_Separate, " &
- "for valid format item number " & Integer'Image(i));
- end if;
- end loop;
-
-
- for i in 1..Number_of_Invalid_Trailing_Separate_Items loop
- -- Fail if the Item parameter _IS_ considered Valid.
- if Display_Format.Valid(Invalid_Trailing_Separate_Items(i).all,
- COBOL.Trailing_Separate)
- then
- Report.Failed("Incorrect result from function Valid, with " &
- "Format parameter set to Trailing_Separate, " &
- "for invalid format item number " &
- Integer'Image(i));
- end if;
- end loop;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB4003;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb4004.a b/gcc/testsuite/ada/acats/tests/cxb/cxb4004.a
deleted file mode 100644
index 0046c5e7c56..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb4004.a
+++ /dev/null
@@ -1,443 +0,0 @@
--- CXB4004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that function Length, with Display_Format parameter, will
--- return the minimal length of a Numeric value that will be required
--- to hold the largest value of type Num represented as Format.
---
--- Check that function To_Decimal will produce a decimal type Num
--- result that corresponds to parameter Item as represented by
--- parameter Format.
---
--- Check that function To_Decimal propagates Conversion_Error when
--- the value represented by parameter Item is outside the range of
--- the Decimal_Type Num used to instantiate the package
--- Decimal_Conversions
---
--- Check that function To_Display returns a Numeric type result that
--- represents Item under the specific Display_Format.
---
--- Check that function To_Display propagates Conversion_Error when
--- parameter Item is negative and the specified Display_Format
--- parameter is Unsigned.
---
--- TEST DESCRIPTION:
--- This test checks the results from instantiated versions of three
--- functions within generic package Interfaces.COBOL.Decimal_Conversions.
--- This generic package is instantiated twice, with decimal types having
--- four and ten digits representation.
--- The function Length is validated with the Unsigned, Leading_Separate,
--- and Trailing_Separate Display_Format specifiers.
--- The results of function To_Decimal are verified in cases where it
--- is given a variety of Numeric and Display_Format type parameters.
--- Function To_Decimal is also checked to propagate Conversion_Error
--- when the value represented by parameter Item is outside the range
--- of the type used to instantiate the package.
--- The results of function To_Display are verified in cases where it
--- is given a variety of Num and Display_Format parameters. It is also
--- checked to ensure that it propagates Conversion_Error if parameter
--- Num is negative and the Format parameter is Unsigned.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.COBOL.COBOL_Character:
--- ' ', '0'..'9', '+', '-', and '.'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.COBOL. If an implementation provides
--- package Interfaces.COBOL, this test must compile, execute, and
--- report "PASSED".
---
---
--- CHANGE HISTORY:
--- 06 Feb 96 SAIC Initial release for 2.1.
--- 30 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 27 Oct 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Report;
-with Interfaces.COBOL; -- N/A => ERROR
-with Ada.Exceptions;
-
-procedure CXB4004 is
-begin
-
- Report.Test ("CXB4004", "Check that the functions Length, To_Decimal, " &
- "and To_Display produce correct results");
-
- Test_Block:
- declare
-
- use Interfaces;
- use Ada.Exceptions;
- use type Interfaces.COBOL.Numeric;
-
- Number_Of_Unsigned_Items : constant := 6;
- Number_Of_Leading_Separate_Items : constant := 6;
- Number_Of_Trailing_Separate_Items : constant := 6;
- Number_Of_Decimal_Items : constant := 9;
-
- type Decimal_Type_1 is delta 0.01 digits 4;
- type Decimal_Type_2 is delta 1.0 digits 10;
- type Numeric_Access is access COBOL.Numeric;
- type Numeric_Items_Type is array(Integer range <>) of Numeric_Access;
-
- Correct_Result : Boolean := False;
- TC_Num_1 : Decimal_Type_1 := 0.0;
- TC_Num_2 : Decimal_Type_2 := 0.0;
-
- package Package_1 is new COBOL.Decimal_Conversions(Decimal_Type_1);
- package Package_2 is new COBOL.Decimal_Conversions(Decimal_Type_2);
-
-
- Package_1_Numeric_Items :
- Numeric_Items_Type(1..Number_Of_Decimal_Items) :=
- (new COBOL.Numeric'("0"),
- new COBOL.Numeric'("591"),
- new COBOL.Numeric'("6342"),
- new COBOL.Numeric'("+0"),
- new COBOL.Numeric'("-1539"),
- new COBOL.Numeric'("+9199"),
- new COBOL.Numeric'("0-"),
- new COBOL.Numeric'("8934+"),
- new COBOL.Numeric'("9949-"));
-
- Package_2_Numeric_Items :
- Numeric_Items_Type(1..Number_Of_Decimal_Items) :=
- (new COBOL.Numeric'("3"),
- new COBOL.Numeric'("105"),
- new COBOL.Numeric'("1234567899"),
- new COBOL.Numeric'("+8"),
- new COBOL.Numeric'("-12345601"),
- new COBOL.Numeric'("+9123459999"),
- new COBOL.Numeric'("1-"),
- new COBOL.Numeric'("123456781+"),
- new COBOL.Numeric'("9499999999-"));
-
-
- Decimal_Type_1_Items : array (1..Number_Of_Decimal_Items)
- of Decimal_Type_1 :=
- (0.0, 5.91, 63.42, 0.0, -15.39, 91.99, 0.0, 89.34, -99.49);
-
- Decimal_Type_2_Items : array (1..Number_Of_Decimal_Items)
- of Decimal_Type_2 :=
- ( 3.0, 105.0, 1234567899.0,
- 8.0, -12345601.0, 9123459999.0,
- -1.0, 123456781.0, -9499999999.0);
-
- begin
-
- -- Check that function Length with Display_Format parameter will
- -- return the minimal length of a Numeric value (number of
- -- COBOL_Characters) that will be required to hold the largest
- -- value of type Num.
-
- if Package_1.Length(COBOL.Unsigned) /= 4 or
- Package_2.Length(COBOL.Unsigned) /= 10
- then
- Report.Failed("Incorrect results from function Length when " &
- "used with Display_Format parameter Unsigned");
- end if;
-
- if Package_1.Length(Format => COBOL.Leading_Separate) /= 5 or
- Package_2.Length(Format => COBOL.Leading_Separate) /= 11
- then
- Report.Failed("Incorrect results from function Length when " &
- "used with Display_Format parameter " &
- "Leading_Separate");
- end if;
-
- if Package_1.Length(COBOL.Trailing_Separate) /= 5 or
- Package_2.Length(COBOL.Trailing_Separate) /= 11
- then
- Report.Failed("Incorrect results from function Length when " &
- "used with Display_Format parameter " &
- "Trailing_Separate");
- end if;
-
-
- -- Check that function To_Decimal with Numeric and Display_Format
- -- parameters will produce a decimal type Num result that corresponds
- -- to parameter Item as represented by parameter Format.
-
- for i in 1..Number_Of_Decimal_Items loop
- case i is
- when 1..3 => -- Unsigned Display_Format parameter.
-
- if Package_1.To_Decimal(Package_1_Numeric_Items(i).all,
- Format => COBOL.Unsigned) /=
- Decimal_Type_1_Items(i)
- then
- Report.Failed
- ("Incorrect result from function To_Decimal " &
- "from an instantiation of Decimal_Conversions " &
- "using a four-digit Decimal type, with Format " &
- "parameter Unsigned, subtest index: " &
- Integer'Image(i));
- end if;
-
- if Package_2.To_Decimal(Package_2_Numeric_Items(i).all,
- Format => COBOL.Unsigned) /=
- Decimal_Type_2_Items(i)
- then
- Report.Failed
- ("Incorrect result from function To_Decimal " &
- "from an instantiation of Decimal_Conversions " &
- "using a ten-digit Decimal type, with Format " &
- "parameter Unsigned, subtest index: " &
- Integer'Image(i));
- end if;
-
- when 4..6 => -- Leading_Separate Display_Format parameter.
-
- if Package_1.To_Decimal(Package_1_Numeric_Items(i).all,
- Format => COBOL.Leading_Separate) /=
- Decimal_Type_1_Items(i)
- then
- Report.Failed
- ("Incorrect result from function To_Decimal " &
- "from an instantiation of Decimal_Conversions " &
- "using a four-digit Decimal type, with Format " &
- "parameter Leading_Separate, subtest index: " &
- Integer'Image(i));
- end if;
-
- if Package_2.To_Decimal(Package_2_Numeric_Items(i).all,
- Format => COBOL.Leading_Separate) /=
- Decimal_Type_2_Items(i)
- then
- Report.Failed
- ("Incorrect result from function To_Decimal " &
- "from an instantiation of Decimal_Conversions " &
- "using a ten-digit Decimal type, with Format " &
- "parameter Leading_Separate, subtest index: " &
- Integer'Image(i));
- end if;
-
- when 7..9 => -- Trailing_Separate Display_Format parameter.
-
- if Package_1.To_Decimal(Package_1_Numeric_Items(i).all,
- COBOL.Trailing_Separate) /=
- Decimal_Type_1_Items(i)
- then
- Report.Failed
- ("Incorrect result from function To_Decimal " &
- "from an instantiation of Decimal_Conversions " &
- "using a four-digit Decimal type, with Format " &
- "parameter Trailing_Separate, subtest index: " &
- Integer'Image(i));
- end if;
-
- if Package_2.To_Decimal(Package_2_Numeric_Items(i).all,
- COBOL.Trailing_Separate) /=
- Decimal_Type_2_Items(i)
- then
- Report.Failed
- ("Incorrect result from function To_Decimal " &
- "from an instantiation of Decimal_Conversions " &
- "using a ten-digit Decimal type, with Format " &
- "parameter Trailing_Separate, subtest index: " &
- Integer'Image(i));
- end if;
-
- end case;
- end loop;
-
-
- -- Check that function To_Decimal propagates Conversion_Error when
- -- the value represented by Numeric type parameter Item is outside
- -- the range of the Decimal_Type Num used to instantiate the package
- -- Decimal_Conversions.
-
- declare
- TC_Numeric_1 : Decimal_Type_1 := Decimal_Type_1_Items(1);
- begin
- -- The COBOL.Numeric type used as parameter Item represents a
- -- Decimal value that is outside the range of the Decimal type
- -- used to instantiate Package_1.
- TC_Numeric_1 :=
- Package_1.To_Decimal(Item => Package_2_Numeric_Items(8).all,
- Format => COBOL.Trailing_Separate);
- Report.Failed("Conversion_Error not raised by To_Decimal " &
- "when the value represented by parameter " &
- "Item is outside the range of the Decimal_Type " &
- "used to instantiate the package " &
- "Decimal_Conversions");
- if TC_Numeric_1 = Decimal_Type_1_Items(1) then
- Report.Comment("To Guard Against Dead Assignment Elimination " &
- "-- Should never be printed");
- end if;
- exception
- when COBOL.Conversion_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by To_Decimal " &
- "when the value represented by parameter " &
- "Item is outside the range of the Decimal_Type " &
- "used to instantiate the package " &
- "Decimal_Conversions");
- end;
-
-
- -- Check that function To_Display with decimal type Num and
- -- Display_Format parameters returns a Numeric type result that
- -- represents Item under the specific Display_Format.
-
- -- Unsigned Display_Format parameter.
- TC_Num_1 := 13.04;
- Correct_Result := (Package_1.To_Display(TC_Num_1, COBOL.Unsigned) =
- "1304") AND
- (Package_1.To_Display(TC_Num_1, COBOL.Unsigned) /=
- "13.04");
- if not Correct_Result then
- Report.Failed("Incorrect result from function To_Display with " &
- "Unsigned Display_Format parameter - 1");
- end if;
-
- TC_Num_2 := 1234567890.0;
- Correct_Result := Package_2.To_Display(TC_Num_2,
- COBOL.Unsigned) = "1234567890";
- if not Correct_Result then
- Report.Failed("Incorrect result from function To_Display with " &
- "Unsigned Display_Format parameter - 2");
- end if;
-
- -- Leading_Separate Display_Format parameter.
- TC_Num_1 := -34.29;
- Correct_Result := (Package_1.To_Display(TC_Num_1,
- COBOL.Leading_Separate) =
- "-3429") AND
- (Package_1.To_Display(TC_Num_1,
- COBOL.Leading_Separate) /=
- "-34.29");
- if not Correct_Result then
- Report.Failed("Incorrect result from function To_Display with " &
- "Leading_Separate Display_Format parameter - 1");
- end if;
-
- TC_Num_1 := 19.01;
- Correct_Result := Package_1.To_Display(TC_Num_1,
- COBOL.Leading_Separate) =
- "+1901";
- if not Correct_Result then
- Report.Failed("Incorrect result from function To_Display with " &
- "Leading_Separate Display_Format parameter - 2");
- end if;
-
- TC_Num_2 := 1234567890.0;
- Correct_Result := Package_2.To_Display(TC_Num_2,
- COBOL.Leading_Separate) =
- "+1234567890";
- if not Correct_Result then
- Report.Failed("Incorrect result from function To_Display with " &
- "Leading_Separate Display_Format parameter - 3");
- end if;
-
- TC_Num_2 := -1234567890.0;
- Correct_Result := Package_2.To_Display(TC_Num_2,
- COBOL.Leading_Separate) =
- "-1234567890";
- if not Correct_Result then
- Report.Failed("Incorrect result from function To_Display with " &
- "Leading_Separate Display_Format parameter - 4");
- end if;
-
- -- Trailing_Separate Display_Format parameter.
- TC_Num_1 := -99.91;
- Correct_Result := (Package_1.To_Display(TC_Num_1,
- COBOL.Trailing_Separate) =
- "9991-") AND
- (Package_1.To_Display(TC_Num_1,
- COBOL.Trailing_Separate) /=
- "99.91-");
- if not Correct_Result then
- Report.Failed("Incorrect result from function To_Display with " &
- "Trailing_Separate Display_Format parameter - 1");
- end if;
-
- TC_Num_1 := 51.99;
- Correct_Result := Package_1.To_Display(TC_Num_1,
- COBOL.Trailing_Separate) =
- "5199+";
- if not Correct_Result then
- Report.Failed("Incorrect result from function To_Display with " &
- "Trailing_Separate Display_Format parameter - 2");
- end if;
-
- TC_Num_2 := 1234567890.0;
- Correct_Result := Package_2.To_Display(TC_Num_2,
- COBOL.Trailing_Separate) =
- "1234567890+";
- if not Correct_Result then
- Report.Failed("Incorrect result from function To_Display with " &
- "Trailing_Separate Display_Format parameter - 3");
- end if;
-
- TC_Num_2 := -1234567890.0;
- Correct_Result := Package_2.To_Display(TC_Num_2,
- COBOL.Trailing_Separate) =
- "1234567890-";
- if not Correct_Result then
- Report.Failed("Incorrect result from function To_Display with " &
- "Trailing_Separate Display_Format parameter - 4");
- end if;
-
-
- -- Check that function To_Display propagates Conversion_Error when
- -- parameter Item is negative and the specified Display_Format
- -- parameter is Unsigned.
-
- begin
- if Package_2.To_Display(Item => Decimal_Type_2_Items(9),
- Format => COBOL.Unsigned) =
- Package_2_Numeric_Items(2).all
- then
- Report.Comment("To Guard Against Dead Assignment Elimination " &
- "-- Should never be printed");
- end if;
- Report.Failed("Conversion_Error not raised by To_Display " &
- "when the value represented by parameter " &
- "Item is negative and the Display_Format " &
- "parameter is Unsigned");
- exception
- when COBOL.Conversion_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by To_Display " &
- "when the value represented by parameter " &
- "Item is negative and the Display_Format " &
- "parameter is Unsigned");
- end;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB4004;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb4005.a b/gcc/testsuite/ada/acats/tests/cxb/cxb4005.a
deleted file mode 100644
index 01f1ded1d1d..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb4005.a
+++ /dev/null
@@ -1,332 +0,0 @@
--- CXB4005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the function To_COBOL will convert a String
--- parameter value into a type Alphanumeric array of
--- COBOL_Characters, with lower bound of one, and length
--- equal to length of the String parameter, based on the
--- mapping Ada_to_COBOL.
---
--- Check that the function To_Ada will convert a type
--- Alphanumeric parameter value into a String type result,
--- with lower bound of one, and length equal to the length
--- of the Alphanumeric parameter, based on the mapping
--- COBOL_to_Ada.
---
--- Check that the Ada_to_COBOL and COBOL_to_Ada mapping
--- arrays provide a mapping capability between Ada's type
--- Character and COBOL run-time character sets.
---
--- TEST DESCRIPTION:
--- This test checks that the functions To_COBOL and To_Ada produce
--- the correct results, based on a variety of parameter input values.
---
--- In the first series of subtests, the results of the function
--- To_COBOL are compared against expected Alphanumeric type results,
--- and the length and lower bound of the alphanumeric result are
--- also verified. In the second series of subtests, the results of
--- the function To_Ada are compared against expected String type
--- results, and the length of the String result is also verified
--- against the Alphanumeric type parameter.
---
--- This test also verifies that two mapping array variables defined
--- in package Interfaces.COBOL, Ada_To_COBOL and COBOL_To_Ada, are
--- available, and that they can be modified by a user at runtime.
--- Finally, the effects of user modifications on these mapping
--- variables is checked in the test.
---
--- This test uses Fixed, Bounded, and Unbounded_Strings in combination
--- with the functions under validation.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.COBOL.COBOL_Character:
--- ' ', 'a'..'z', 'A'..'Z', '0'..'9', '*', ',', '.', and '$'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.COBOL. If an implementation provides
--- package Interfaces.COBOL, this test must compile, execute, and
--- report "PASSED".
---
---
--- CHANGE HISTORY:
--- 11 Jan 96 SAIC Initial prerelease version for ACVC 2.1
--- 30 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 27 Oct 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Report;
-with Ada.Exceptions;
-with Ada.Strings.Bounded;
-with Ada.Strings.Unbounded;
-with Interfaces.COBOL; -- N/A => ERROR
-
-procedure CXB4005 is
-begin
-
- Report.Test ("CXB4005", "Check that the functions To_COBOL and " &
- "To_Ada produce correct results");
-
- Test_Block:
- declare
-
- package Bnd is new Ada.Strings.Bounded.Generic_Bounded_Length(5);
- package Unb renames Ada.Strings.Unbounded;
-
- use Ada.Exceptions;
- use Interfaces;
- use Bnd;
- use type Unb.Unbounded_String;
- use type Interfaces.COBOL.Alphanumeric;
-
- TC_Alphanumeric_1 : Interfaces.COBOL.Alphanumeric(1..1);
- TC_Alphanumeric_5 : Interfaces.COBOL.Alphanumeric(1..5);
- TC_Alphanumeric_10 : Interfaces.COBOL.Alphanumeric(1..10);
- TC_Alphanumeric_20 : Interfaces.COBOL.Alphanumeric(1..20);
-
- Bnd_String,
- TC_Bnd_String : Bnd.Bounded_String :=
- Bnd.To_Bounded_String(" ");
- Unb_String,
- TC_Unb_String : Unb.Unbounded_String :=
- Unb.To_Unbounded_String(" ");
-
- The_String,
- TC_String : String(1..20) := (" ");
-
- begin
-
- -- Check that the function To_COBOL will convert a String
- -- parameter value into a type Alphanumeric array of
- -- COBOL_Characters, with lower bound of one, and length
- -- equal to length of the String parameter, based on the
- -- mapping Ada_to_COBOL.
-
- Unb_String := Unb.To_Unbounded_String("A");
- TC_Alphanumeric_1 := COBOL.To_COBOL(Unb.To_String(Unb_String));
-
- if TC_Alphanumeric_1 /= "A" or
- TC_Alphanumeric_1'Length /= Unb.Length(Unb_String) or
- TC_Alphanumeric_1'Length /= 1 or
- COBOL.To_COBOL(Unb.To_String(Unb_String))'First /= 1
- then
- Report.Failed("Incorrect result from function To_COBOL - 1");
- end if;
-
- Bnd_String := Bnd.To_Bounded_String("abcde");
- TC_Alphanumeric_5 := COBOL.To_COBOL(Bnd.To_String(Bnd_String));
-
- if TC_Alphanumeric_5 /= "abcde" or
- TC_Alphanumeric_5'Length /= Bnd.Length(Bnd_String) or
- TC_Alphanumeric_5'Length /= 5 or
- COBOL.To_COBOL(Bnd.To_String(Bnd_String))'First /= 1
- then
- Report.Failed("Incorrect result from function To_COBOL - 2");
- end if;
-
- Unb_String := Unb.To_Unbounded_String("1A2B3c4d5F");
- TC_Alphanumeric_10 := COBOL.To_COBOL(Unb.To_String(Unb_String));
-
- if TC_Alphanumeric_10 /= "1A2B3c4d5F" or
- TC_Alphanumeric_10'Length /= Unb.Length(Unb_String) or
- TC_Alphanumeric_10'Length /= 10 or
- COBOL.To_COBOL(Unb.To_String(Unb_String))'First /= 1
- then
- Report.Failed("Incorrect result from function To_COBOL - 3");
- end if;
-
- The_String := "abcd ghij" & "1234 7890";
- TC_Alphanumeric_20 := COBOL.To_COBOL(The_String);
-
- if TC_Alphanumeric_20 /= "abcd ghij1234 7890" or
- TC_Alphanumeric_20'Length /= The_String'Length or
- TC_Alphanumeric_20'Length /= 20 or
- COBOL.To_COBOL(The_String)'First /= 1
- then
- Report.Failed("Incorrect result from function To_COBOL - 4");
- end if;
-
-
-
- -- Check that the function To_Ada will convert a type
- -- Alphanumeric parameter value into a String type result,
- -- with lower bound of one, and length equal to the length
- -- of the Alphanumeric parameter, based on the mapping
- -- COBOL_to_Ada.
-
- TC_Unb_String := Unb.To_Unbounded_String
- (COBOL.To_Ada(TC_Alphanumeric_1));
-
- if TC_Unb_String /= "A" or
- TC_Alphanumeric_1'Length /= Unb.Length(TC_Unb_String) or
- Unb.Length(TC_Unb_String) /= 1 or
- COBOL.To_Ada(TC_Alphanumeric_1)'First /= 1
- then
- Report.Failed("Incorrect value returned from function To_Ada - 1");
- end if;
-
- TC_Bnd_String := Bnd.To_Bounded_String
- (COBOL.To_Ada(TC_Alphanumeric_5));
-
- if TC_Bnd_String /= "abcde" or
- TC_Alphanumeric_5'Length /= Bnd.Length(TC_Bnd_String) or
- Bnd.Length(TC_Bnd_String) /= 5 or
- COBOL.To_Ada(TC_Alphanumeric_5)'First /= 1
- then
- Report.Failed("Incorrect value returned from function To_Ada - 2");
- end if;
-
- TC_Unb_String := Unb.To_Unbounded_String
- (COBOL.To_Ada(TC_Alphanumeric_10));
-
- if TC_Unb_String /= "1A2B3c4d5F" or
- TC_Alphanumeric_10'Length /= Unb.Length(TC_Unb_String) or
- Unb.Length(TC_Unb_String) /= 10 or
- COBOL.To_Ada(TC_Alphanumeric_10)'First /= 1
- then
- Report.Failed("Incorrect value returned from function To_Ada - 3");
- end if;
-
- TC_String := COBOL.To_Ada(TC_Alphanumeric_20);
-
- if TC_String /= "abcd ghij1234 7890" or
- TC_Alphanumeric_20'Length /= TC_String'Length or
- TC_String'Length /= 20 or
- COBOL.To_Ada(TC_Alphanumeric_20)'First /= 1
- then
- Report.Failed("Incorrect value returned from function To_Ada - 4");
- end if;
-
-
- -- Check the two functions when used in combination.
-
- if COBOL.To_COBOL(Item => COBOL.To_Ada("This is a test")) /=
- "This is a test" or
- COBOL.To_COBOL(COBOL.To_Ada("1234567890abcdeFGHIJ")) /=
- "1234567890abcdeFGHIJ"
- then
- Report.Failed("Incorrect result returned when using the " &
- "functions To_Ada and To_COBOL in combination");
- end if;
-
-
-
- -- Check that the Ada_to_COBOL and COBOL_to_Ada mapping
- -- arrays provide a mapping capability between Ada's type
- -- Character and COBOL run-time character sets.
-
- Interfaces.COBOL.Ada_To_COBOL('a') := 'A';
- Interfaces.COBOL.Ada_To_COBOL('b') := 'B';
- Interfaces.COBOL.Ada_To_COBOL('c') := 'C';
- Interfaces.COBOL.Ada_To_COBOL('d') := '1';
- Interfaces.COBOL.Ada_To_COBOL('e') := '2';
- Interfaces.COBOL.Ada_To_COBOL('f') := '3';
- Interfaces.COBOL.Ada_To_COBOL(' ') := '*';
-
- Unb_String := Unb.To_Unbounded_String("b");
- TC_Alphanumeric_1 := COBOL.To_COBOL(Unb.To_String(Unb_String));
-
- if TC_Alphanumeric_1 /= "B" then
- Report.Failed("Incorrect result from function To_COBOL after " &
- "modification to Ada_To_COBOL mapping array - 1");
- end if;
-
- Bnd_String := Bnd.To_Bounded_String("abcde");
- TC_Alphanumeric_5 := COBOL.To_COBOL(Bnd.To_String(Bnd_String));
-
- if TC_Alphanumeric_5 /= "ABC12" then
- Report.Failed("Incorrect result from function To_COBOL after " &
- "modification to Ada_To_COBOL mapping array - 2");
- end if;
-
- Unb_String := Unb.To_Unbounded_String("1a2B3c4d5e");
- TC_Alphanumeric_10 := COBOL.To_COBOL(Unb.To_String(Unb_String));
-
- if TC_Alphanumeric_10 /= "1A2B3C4152" then
- Report.Failed("Incorrect result from function To_COBOL after " &
- "modification to Ada_To_COBOL mapping array - 3");
- end if;
-
- The_String := "abcd ghij" & "1234 7890";
- TC_Alphanumeric_20 := COBOL.To_COBOL(The_String);
-
- if TC_Alphanumeric_20 /= "ABC1**ghij1234**7890" then
- Report.Failed("Incorrect result from function To_COBOL after " &
- "modification to Ada_To_COBOL mapping array - 4");
- end if;
-
-
- -- Reset the Ada_To_COBOL mapping array to its original state.
-
- Interfaces.COBOL.Ada_To_COBOL('a') := 'a';
- Interfaces.COBOL.Ada_To_COBOL('b') := 'b';
- Interfaces.COBOL.Ada_To_COBOL('c') := 'c';
- Interfaces.COBOL.Ada_To_COBOL('d') := 'd';
- Interfaces.COBOL.Ada_To_COBOL('e') := 'e';
- Interfaces.COBOL.Ada_To_COBOL('f') := 'f';
- Interfaces.COBOL.Ada_To_COBOL(' ') := ' ';
-
- -- Modify the COBOL_To_Ada mapping array to check its effect on
- -- the function To_Ada.
-
- Interfaces.COBOL.COBOL_To_Ada(' ') := '*';
- Interfaces.COBOL.COBOL_To_Ada('$') := 'F';
- Interfaces.COBOL.COBOL_To_Ada('1') := '7';
- Interfaces.COBOL.COBOL_To_Ada('.') := ',';
-
- Unb_String := Unb.To_Unbounded_String(" $$100.00");
- TC_Alphanumeric_10 := COBOL.To_COBOL(Unb.To_String(Unb_String));
- TC_Unb_String := Unb.To_Unbounded_String(
- COBOL.To_Ada(TC_Alphanumeric_10));
-
- if Unb.To_String(TC_Unb_String) /= "**FF700,00" then
- Report.Failed("Incorrect result from function To_Ada after " &
- "modification of COBOL_To_Ada mapping array - 1");
- end if;
-
- Interfaces.COBOL.COBOL_To_Ada('*') := ' ';
- Interfaces.COBOL.COBOL_To_Ada('F') := '$';
- Interfaces.COBOL.COBOL_To_Ada('7') := '1';
- Interfaces.COBOL.COBOL_To_Ada(',') := '.';
-
- if COBOL.To_Ada(COBOL.To_COBOL(Unb.To_String(TC_Unb_String))) /=
- Unb_String
- then
- Report.Failed("Incorrect result from function To_Ada after " &
- "modification of COBOL_To_Ada mapping array - 2");
- end if;
-
-
- exception
- when The_Error : others =>
- Report.Failed ("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB4005;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb4006.a b/gcc/testsuite/ada/acats/tests/cxb/cxb4006.a
deleted file mode 100644
index 6e491eebff7..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb4006.a
+++ /dev/null
@@ -1,322 +0,0 @@
--- CXB4006.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the function Valid with Packed_Decimal and Packed_Format
--- parameters returns True if Item (the Packed_Decimal parameter) has
--- a value consistent with the Packed_Format parameter.
---
--- Check that the function Length with Packed_Format parameter returns
--- the minimal length of a Packed_Decimal value sufficient to hold any
--- value of type Num when represented according to parameter Format.
---
--- Check that the function To_Decimal with Packed_Decimal and
--- Packed_Format parameters produces a decimal type value corresponding
--- to the Packed_Decimal parameter value Item, under the conditions of
--- the Packed_Format parameter Format.
---
--- Check that the function To_Packed with Decimal (Num) and
--- Packed_Format parameters produces a Packed_Decimal result that
--- corresponds to the decimal parameter under conditions of the
--- Packed_Format parameter.
---
--- Check that Conversion_Error is propagated by function To_Packed if
--- the value of the decimal parameter Item is negative and the specified
--- Packed_Format parameter is Packed_Unsigned.
---
---
--- TEST DESCRIPTION:
--- This test checks the results from instantiated versions of
--- several functions that deal with parameters or results of type
--- Packed_Decimal. Since the rules for the formation of Packed_Decimal
--- values are implementation defined, several of the subtests cannot
--- directly check the accuracy of the results produced. Instead, they
--- verify that the result is within a range of possible values, or
--- that the result of one function can be converted back to the original
--- actual parameter using a "mirror image" conversion function.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.COBOL. If an implementation provides
--- package Interfaces.COBOL, this test must compile, execute, and
--- report "PASSED".
---
---
--- CHANGE HISTORY:
--- 12 Feb 96 SAIC Initial release for 2.1.
--- 30 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 27 Oct 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Report;
-with Ada.Exceptions;
-with Interfaces.COBOL; -- N/A => ERROR
-
-procedure CXB4006 is
-begin
-
- Report.Test ("CXB4006", "Check that the functions Valid, Length, " &
- "To_Decimal, and To_Packed specific to " &
- "Packed_Decimal parameters produce correct " &
- "results");
-
- Test_Block:
- declare
-
- use Interfaces.COBOL;
- use Ada.Exceptions;
- use type Interfaces.COBOL.Numeric;
-
- type Decimal_Type_1 is delta 0.1 digits 6;
- type Decimal_Type_2 is delta 0.01 digits 8;
- type Decimal_Type_3 is delta 0.001 digits 10;
- type Decimal_Type_4 is delta 0.0001 digits 12;
-
- package Pack_1 is new Decimal_Conversions(Decimal_Type_1);
- package Pack_2 is new Decimal_Conversions(Decimal_Type_2);
- package Pack_3 is new Decimal_Conversions(Decimal_Type_3);
- package Pack_4 is new Decimal_Conversions(Decimal_Type_4);
-
- TC_Dec_1 : Decimal_Type_1 := 12345.6;
- TC_Dec_2 : Decimal_Type_2 := 123456.78;
- TC_Dec_3 : Decimal_Type_3 := 1234567.890;
- TC_Dec_4 : Decimal_Type_4 := 12345678.9012;
- TC_Min_Length : Natural := 1;
- TC_Max_Length : Natural := 16;
-
- begin
-
- -- Check that the function Valid with Packed_Decimal and Packed_Format
- -- parameters returns True if Item (the Packed_Decimal parameter) has
- -- a value consistent with the Packed_Format parameter.
- -- Note: Since the formation rules for Packed_Decimal values are
- -- implementation defined, the parameter values here are
- -- created by function To_Packed.
-
- TC_Dec_1 := 1434.3;
- if not Pack_1.Valid(Item => Pack_1.To_Packed(TC_Dec_1,
- Packed_Unsigned),
- Format => Packed_Unsigned)
- then
- Report.Failed("Incorrect result from function Valid - 1");
- end if;
-
- TC_Dec_2 := -4321.03;
- if not Pack_2.Valid(Pack_2.To_Packed(TC_Dec_2, Packed_Signed),
- Format => Packed_Signed) or
- Pack_2.Valid(Pack_2.To_Packed(TC_Dec_2, Packed_Signed),
- Format => Packed_Unsigned)
- then
- Report.Failed("Incorrect result from function Valid - 2");
- end if;
-
- TC_Dec_3 := 1234567.890;
- if not Pack_3.Valid(Pack_3.To_Packed(TC_Dec_3, Packed_Unsigned),
- Packed_Unsigned)
- then
- Report.Failed("Incorrect result from function Valid - 3");
- end if;
-
- TC_Dec_4 := -234.6789;
- if not Pack_4.Valid(Item => Pack_4.To_Packed(TC_Dec_4,
- Packed_Signed),
- Format => Packed_Signed) or
- Pack_4.Valid(Item => Pack_4.To_Packed(TC_Dec_4, Packed_Signed),
- Format => Packed_Unsigned)
- then
- Report.Failed("Incorrect result from function Valid - 4");
- end if;
-
-
-
- -- Check that the function Length with Packed_Format parameter returns
- -- the minimal length of a Packed_Decimal value sufficient to hold any
- -- value of type Num when represented according to parameter Format.
-
- if NOT (Pack_1.Length(Packed_Signed) >= TC_Min_Length AND
- Pack_1.Length(Packed_Signed) <= TC_Max_Length AND
- Pack_1.Length(Packed_Unsigned) >= TC_Min_Length AND
- Pack_1.Length(Packed_Unsigned) <= TC_Max_Length)
- then
- Report.Failed("Incorrect result from function Length - 1");
- end if;
-
- if NOT (Pack_2.Length(Packed_Signed) >= TC_Min_Length AND
- Pack_2.Length(Packed_Signed) <= TC_Max_Length AND
- Pack_2.Length(Packed_Unsigned) >= TC_Min_Length AND
- Pack_2.Length(Packed_Unsigned) <= TC_Max_Length)
- then
- Report.Failed("Incorrect result from function Length - 2");
- end if;
-
- if NOT (Pack_3.Length(Packed_Signed) >= TC_Min_Length AND
- Pack_3.Length(Packed_Signed) <= TC_Max_Length AND
- Pack_3.Length(Packed_Unsigned) >= TC_Min_Length AND
- Pack_3.Length(Packed_Unsigned) <= TC_Max_Length)
- then
- Report.Failed("Incorrect result from function Length - 3");
- end if;
-
- if NOT (Pack_4.Length(Packed_Signed) >= TC_Min_Length AND
- Pack_4.Length(Packed_Signed) <= TC_Max_Length AND
- Pack_4.Length(Packed_Unsigned) >= TC_Min_Length AND
- Pack_4.Length(Packed_Unsigned) <= TC_Max_Length)
- then
- Report.Failed("Incorrect result from function Length - 4");
- end if;
-
-
-
- -- Check that the function To_Decimal with Packed_Decimal and
- -- Packed_Format parameters produces a decimal type value corresponding
- -- to the Packed_Decimal parameter value Item, under the conditions of
- -- the Packed_Format parameter Format.
-
- begin
- TC_Dec_1 := 1234.5;
- if Pack_1.To_Decimal(Item => Pack_1.To_Packed(TC_Dec_1,
- Packed_Unsigned),
- Format => Packed_Unsigned) /= TC_Dec_1
- then
- Report.Failed("Incorrect result from function To_Decimal - 1");
- end if;
- exception
- when The_Error : others =>
- Report.Failed("The following exception was raised in " &
- "subtest 1 of function To_Decimal: " &
- Exception_Name(The_Error));
- end;
-
- begin
- TC_Dec_2 := -123456.50;
- if Pack_2.To_Decimal(Pack_2.To_Packed(TC_Dec_2, Packed_Signed),
- Format => Packed_Signed) /= TC_Dec_2
- then
- Report.Failed("Incorrect result from function To_Decimal - 2");
- end if;
- exception
- when The_Error : others =>
- Report.Failed("The following exception was raised in " &
- "subtest 2 of function To_Decimal: " &
- Exception_Name(The_Error));
- end;
-
- begin
- TC_Dec_3 := 1234567.809;
- if Pack_3.To_Decimal(Pack_3.To_Packed(TC_Dec_3, Packed_Unsigned),
- Packed_Unsigned) /= TC_Dec_3
- then
- Report.Failed("Incorrect result from function To_Decimal - 3");
- end if;
- exception
- when The_Error : others =>
- Report.Failed("The following exception was raised in " &
- "subtest 3 of function To_Decimal: " &
- Exception_Name(The_Error));
- end;
-
- begin
- TC_Dec_4 := -789.1234;
- if Pack_4.To_Decimal(Item => Pack_4.To_Packed(TC_Dec_4,
- Packed_Signed),
- Format => Packed_Signed) /= TC_Dec_4
- then
- Report.Failed("Incorrect result from function To_Decimal - 4");
- end if;
- exception
- when The_Error : others =>
- Report.Failed("The following exception was raised in " &
- "subtest 4 of function To_Decimal: " &
- Exception_Name(The_Error));
- end;
-
-
-
- -- Check that the function To_Packed with Decimal (Num) and
- -- Packed_Format parameters produces a Packed_Decimal result that
- -- corresponds to the decimal parameter under conditions of the
- -- Packed_Format parameter.
-
- if Pack_1.To_Packed(Item => 123.4, Format => Packed_Unsigned) =
- Pack_1.To_Packed(Item => -123.4, Format => Packed_Signed)
- then
- Report.Failed("Incorrect result from function To_Packed - 1");
- end if;
-
- if Pack_2.To_Packed( 123.45, Format => Packed_Unsigned) =
- Pack_2.To_Packed(-123.45, Format => Packed_Signed)
- then
- Report.Failed("Incorrect result from function To_Packed - 2");
- end if;
-
- if Pack_3.To_Packed(Item => 123.456, Format => Packed_Unsigned) =
- Pack_3.To_Packed(Item => -123.456, Format => Packed_Signed)
- then
- Report.Failed("Incorrect result from function To_Packed - 3");
- end if;
-
- if (Pack_4.To_Packed( 123.4567, Packed_Unsigned) =
- Pack_4.To_Packed(-123.4567, Packed_Signed)) or
- (Pack_4.To_Packed(12345678.9012, Packed_Unsigned) =
- Pack_4.To_Packed(12345678.9013, Packed_Unsigned)) or
- (Pack_4.To_Packed(12345678.9012, Packed_Unsigned) =
- Pack_4.To_Packed(22345678.9012, Packed_Unsigned))
- then
- Report.Failed("Incorrect result from function To_Packed - 4");
- end if;
-
-
- -- Check that Conversion_Error is propagated by function To_Packed if
- -- the value of the decimal parameter Item is negative and the
- -- specified Packed_Format parameter is Packed_Unsigned.
-
- begin
- if Pack_1.To_Packed(Item => -12.3, Format => Packed_Unsigned) =
- Pack_1.To_Packed(Item => 12.3, Format => Packed_Signed)
- then
- Report.Comment("Should never be printed");
- end if;
- Report.Failed("Conversion_Error not raised following call to " &
- "function To_Packed with a negative parameter " &
- "Item and Packed_Format parameter Packed_Unsigned");
- exception
- when Conversion_Error => null; -- OK, expected exception.
- when The_Error : others =>
- Report.Failed(Exception_Name(The_Error) & " was incorrectly " &
- "raised following call to function To_Packed " &
- "with a negative parameter Item and " &
- "Packed_Format parameter Packed_Unsigned");
- end;
-
- exception
- when The_Error : others =>
- Report.Failed("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB4006;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb4007.a b/gcc/testsuite/ada/acats/tests/cxb/cxb4007.a
deleted file mode 100644
index c4e0641766a..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb4007.a
+++ /dev/null
@@ -1,271 +0,0 @@
--- CXB4007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the function Valid with Byte_Array and Binary_Format
--- parameters returns True if the Byte_Array parameter corresponds
--- to any value inside the range of type Num.
--- Check that function Valid returns False if the Byte_Array parameter
--- corresponds to a value outside the range of Num.
---
--- Check that function Length with Binary_Format parameter will return
--- the minimum length of a Byte_Array value required to hold any value
--- of decimal type Num.
---
--- Check that function To_Decimal with Byte_Array and Binary_Format
--- parameters will return a decimal type value that corresponds to
--- parameter Item (of type Byte_Array) under the specified Format.
---
--- Check that Conversion_Error is propagated by function To_Decimal if
--- the Byte_Array parameter Item represents a decimal value outside the
--- range of decimal type Num.
---
--- Check that function To_Binary will produce a Byte_Array result that
--- corresponds to the decimal type parameter Item, under the specified
--- Binary_Format.
---
--- TEST DESCRIPTION:
--- This test uses several instantiations of generic package
--- Decimal_Conversions to provide appropriate test material.
--- This test uses the function To_Binary to create all Byte_Array
--- parameter values used in calls to functions Valid and To_Decimal.
--- The function Valid is tested with parameters to provide both
--- valid and invalid expected results. This test also checks that
--- Function To_Decimal produces expected results in cases where each
--- of the three predefined Binary_Format constants are used in the
--- function calls. In addition, the prescribed propagation of
--- Conversion_Error by function To_Decimal is verified.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.COBOL. If an implementation provides
--- package Interfaces.COBOL, this test must compile, execute, and
--- report "PASSED".
---
---
--- CHANGE HISTORY:
--- 14 Feb 96 SAIC Initial release for 2.1.
--- 30 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 27 Oct 96 SAIC Incorporated reviewer comments.
--- 05 JAN 98 EDS Remove incorrect subtest.
---!
-
-with Report;
-with Ada.Exceptions;
-with Interfaces.COBOL; -- N/A => ERROR
-
-procedure CXB4007 is
-begin
-
- Report.Test ("CXB4007", "Check that functions Valid, Length, To_Decimal " &
- "and To_Binary specific to Byte_Array and " &
- "Binary_Format parameters produce correct results");
-
- Test_Block:
- declare
-
- use Interfaces.COBOL;
- use Ada.Exceptions;
- use type Interfaces.COBOL.Numeric;
-
- type Decimal_Type_1 is delta 0.1 digits 6;
- type Decimal_Type_2 is delta 0.01 digits 8;
- type Decimal_Type_3 is delta 0.001 digits 10;
- type Decimal_Type_4 is delta 0.0001 digits 12;
-
- package Pack_1 is new Decimal_Conversions(Decimal_Type_1);
- package Pack_2 is new Decimal_Conversions(Decimal_Type_2);
- package Pack_3 is new Decimal_Conversions(Decimal_Type_3);
- package Pack_4 is new Decimal_Conversions(Decimal_Type_4);
-
- TC_Dec_1 : Decimal_Type_1 := 12345.6;
- TC_Dec_2 : Decimal_Type_2 := 123456.78;
- TC_Dec_3 : Decimal_Type_3 := 1234567.890;
- TC_Dec_4 : Decimal_Type_4 := 12345678.9012;
- TC_Min_Length : Natural := 1;
- TC_Max_Length : Natural := 16;
- TC_Valid : Boolean := False;
-
- begin
-
- -- Check that the function Valid with Byte_Array and Binary_Format
- -- parameters returns True if the Byte_Array parameter corresponds to
- -- any value inside the range of type Num.
-
- if not Pack_1.Valid(Item => Pack_1.To_Binary(TC_Dec_1,
- High_Order_First),
- Format => High_Order_First) or
- not Pack_1.Valid(Pack_1.To_Binary(0.0, Low_Order_First),
- Format => Low_Order_First)
- then
- Report.Failed("Incorrect result from function Valid, using " &
- "parameters that should return a positive result - 1");
- end if;
-
- TC_Valid := (Pack_2.Valid(Pack_2.To_Binary(TC_Dec_2, High_Order_First),
- Format => High_Order_First) and
- Pack_2.Valid(Pack_2.To_Binary(0.01, Low_Order_First),
- Format => Low_Order_First));
- if not TC_Valid then
- Report.Failed("Incorrect result from function Valid, using " &
- "parameters that should return a positive result - 2");
- end if;
-
- if not Pack_3.Valid(Item => Pack_3.To_Binary(TC_Dec_3,
- Low_Order_First),
- Format => Low_Order_First) or
- not Pack_3.Valid(Pack_3.To_Binary(0.001, High_Order_First),
- Format => High_Order_First) or
- not Pack_3.Valid(Pack_3.To_Binary(123.456, Native_Binary),
- Native_Binary)
- then
- Report.Failed("Incorrect result from function Valid, using " &
- "parameters that should return a positive result - 3");
- end if;
-
-
- -- Check that function Valid returns False if the Byte_Array parameter
- -- corresponds to a value outside the range of Num.
- -- Note: use a Byte_Array value Item created by an instantiation of
- -- To_Binary with a larger Num type as the generic formal.
-
- if Pack_1.Valid(Item => Pack_2.To_Binary(TC_Dec_2, Low_Order_First),
- Format => Low_Order_First) or
- Pack_2.Valid(Pack_3.To_Binary(TC_Dec_3, High_Order_First),
- Format => High_Order_First) or
- Pack_3.Valid(Pack_4.To_Binary(TC_Dec_4, Native_Binary),
- Native_Binary)
- then
- Report.Failed("Incorrect result from function Valid, using " &
- "parameters that should return a negative result");
- end if;
-
-
- -- Check that function Length with Binary_Format parameter will return
- -- the minimum length of a Byte_Array value required to hold any value
- -- of decimal type Num.
-
- if not (Pack_1.Length(Native_Binary) >= TC_Min_Length and
- Pack_1.Length(Low_Order_First) <= TC_Max_Length and
- Pack_2.Length(High_Order_First) >= TC_Min_Length and
- Pack_2.Length(Native_Binary) <= TC_Max_Length and
- Pack_3.Length(Low_Order_First) >= TC_Min_Length and
- Pack_3.Length(High_Order_First) <= TC_Max_Length and
- Pack_4.Length(Native_Binary) >= TC_Min_Length and
- Pack_4.Length(Low_Order_First) <= TC_Max_Length)
- then
- Report.Failed("Incorrect result from function Length");
- end if;
-
-
-
- -- Check that function To_Decimal with Byte_Array and Binary_Format
- -- parameters will return a decimal type value that corresponds to
- -- parameter Item (of type Byte_Array) under the specified Format.
-
- if Pack_1.To_Decimal(Item => Pack_1.To_Binary(Item => TC_Dec_1,
- Format => Native_Binary),
- Format => Native_Binary) /=
- TC_Dec_1
- then
- Report.Failed("Incorrect result from function To_Decimal - 1");
- end if;
-
- if Pack_3.To_Decimal(Pack_3.To_Binary(TC_Dec_3, High_Order_First),
- Format => High_Order_First) /=
- TC_Dec_3
- then
- Report.Failed("Incorrect result from function To_Decimal - 2");
- end if;
-
- if Pack_4.To_Decimal(Pack_4.To_Binary(TC_Dec_4, Low_Order_First),
- Low_Order_First) /=
- TC_Dec_4
- then
- Report.Failed("Incorrect result from function To_Decimal - 3");
- end if;
-
-
-
- -- Check that Conversion_Error is propagated by function To_Decimal
- -- if the Byte_Array parameter Item represents a decimal value outside
- -- the range of decimal type Num.
- -- Note: use a Byte_Array value Item created by an instantiation of
- -- To_Binary with a larger Num type as the generic formal.
-
- begin
- TC_Dec_4 := 99999.9001;
- TC_Dec_1 := Pack_1.To_Decimal(Pack_4.To_Binary(TC_Dec_4,
- Native_Binary),
- Format => Native_Binary);
- if TC_Dec_1 = 99999.9 then
- Report.Comment("Minimize dead assignment optimization -- " &
- "Should never be printed");
- end if;
- Report.Failed("Conversion_Error not raised following call to " &
- "function To_Decimal if the Byte_Array parameter " &
- "Item represents a decimal value outside the " &
- "range of decimal type Num");
- exception
- when Conversion_Error => null; -- OK, expected exception.
- when The_Error : others =>
- Report.Failed(Exception_Name(The_Error) & " was incorrectly " &
- "raised following call to function To_Decimal " &
- "if the Byte_Array parameter Item represents " &
- "a decimal value outside the range of decimal " &
- "type Num");
- end;
-
-
-
- -- Check that function To_Binary will produce a Byte_Array result that
- -- corresponds to the decimal type parameter Item, under the specified
- -- Binary_Format.
-
- -- Different ordering.
- TC_Dec_1 := 12345.6;
- if Pack_1.To_Binary(TC_Dec_1, Low_Order_First) =
- Pack_1.To_Binary(TC_Dec_1, High_Order_First)
- then
- Report.Failed("Incorrect result from function To_Binary - 1");
- end if;
-
- -- Variable vs. literal.
- TC_Dec_2 := 12345.00;
- if Pack_2.To_Binary(TC_Dec_2, Native_Binary) /=
- Pack_2.To_Binary(12345.00, Native_Binary)
- then
- Report.Failed("Incorrect result from function To_Binary - 2");
- end if;
-
- exception
- when The_Error : others =>
- Report.Failed("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB4007;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb4008.a b/gcc/testsuite/ada/acats/tests/cxb/cxb4008.a
deleted file mode 100644
index 5ab8e6b0339..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb4008.a
+++ /dev/null
@@ -1,248 +0,0 @@
--- CXB4008.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the function To_Decimal with Binary parameter will return
--- the corresponding value of the decimal type Num.
---
--- Check that the function To_Decimal with Long_Binary parameter will
--- return the corresponding value of the decimal type Num.
---
--- Check that both of the To_Decimal functions described above will
--- propagate Conversion_Error if the converted value Item is outside
--- the range of type Num.
---
--- Check that the function To_Binary converts a value of the Ada
--- decimal type Num into a Binary type value.
---
--- Check that the function To_Long_Binary converts a value of the Ada
--- decimal type Num into a Long_Binary type value.
---
--- TEST DESCRIPTION:
--- This test uses several instantiations of generic package
--- Decimal_Conversions to provide appropriate test material.
--- Two of the instantiations use decimal types as generic actuals
--- that include the implementation defined constants Max_Digits_Binary
--- and Max_Digits_Long_Binary in their definition.
---
--- Subtests are included for both versions of function To_Decimal,
--- (Binary and Long_Binary parameters), and include checks that
--- Conversion_Error is propagated under the appropriate circumstances.
--- Functions To_Binary and To_Long_Binary are "sanity" checked, to
--- ensure that the functions are available, and that the results are
--- appropriate based on their parameter input.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.COBOL. If an implementation provides
--- package Interfaces.COBOL, this test must compile, execute, and
--- report "PASSED".
---
---
--- CHANGE HISTORY:
--- 21 Feb 96 SAIC Initial release for 2.1.
--- 10 Jun 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 27 Oct 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Report;
-with Ada.Exceptions;
-with Interfaces.COBOL; -- N/A => ERROR
-
-procedure CXB4008 is
-begin
-
- Report.Test ("CXB4008", "Check that functions To_Decimal, To_Binary, and " &
- "To_Long_Binary produce the correct results");
-
- Test_Block:
- declare
-
- use Interfaces.COBOL;
- use Ada.Exceptions;
- use type Interfaces.COBOL.Numeric;
-
- type Decimal_Type_1 is delta 0.1 digits 6;
- type Decimal_Type_2 is delta 0.01 digits Max_Digits_Binary;
- type Decimal_Type_3 is delta 0.001 digits 10;
- type Decimal_Type_4 is delta 0.0001 digits Max_Digits_Long_Binary;
-
- package Pack_1 is new Decimal_Conversions(Decimal_Type_1);
- package Pack_2 is new Decimal_Conversions(Decimal_Type_2);
- package Pack_3 is new Decimal_Conversions(Decimal_Type_3);
- package Pack_4 is new Decimal_Conversions(Decimal_Type_4);
-
- TC_Dec_1 : Decimal_Type_1 := 12345.0;
- TC_Dec_2 : Decimal_Type_2 := 123456.00;
- TC_Dec_3 : Decimal_Type_3 := 1234567.000;
- TC_Dec_4 : Decimal_Type_4 := 12345678.0000;
- TC_Binary : Interfaces.COBOL.Binary;
- TC_Long_Binary : Interfaces.COBOL.Long_Binary;
-
- begin
-
- -- Check that the function To_Decimal with Binary parameter will
- -- return the corresponding value of the decimal type Num.
-
- if Pack_1.To_Decimal(Item => Pack_1.To_Binary(TC_Dec_1)) /= TC_Dec_1 or
- Pack_2.To_Decimal(Pack_2.To_Binary(TC_Dec_2)) /= TC_Dec_2
- then
- Report.Failed("Incorrect result from function To_Decimal with " &
- "Binary parameter - 1");
- end if;
-
- if Pack_1.To_Decimal(Item => Pack_1.To_Binary(1234.0)) /= 1234.0 then
- Report.Failed("Incorrect result from function To_Decimal with " &
- "Binary parameter - 2");
- end if;
-
- TC_Binary := Pack_2.To_Binary(TC_Dec_2);
- if Pack_2.To_Decimal(TC_Binary) /= TC_Dec_2 then
- Report.Failed("Incorrect result from function To_Decimal with " &
- "Binary parameter - 3");
- end if;
-
-
-
- -- Check that the function To_Decimal with Long_Binary parameter
- -- will return the corresponding value of the decimal type Num.
-
- if Pack_3.To_Decimal(Item => Pack_3.To_Long_Binary(TC_Dec_3)) /=
- TC_Dec_3 or
- Pack_4.To_Decimal(Pack_4.To_Long_Binary(TC_Dec_4)) /=
- TC_Dec_4
- then
- Report.Failed("Incorrect result from function To_Decimal with " &
- "Long_Binary parameter - 1");
- end if;
-
- if Pack_3.To_Decimal(Pack_3.To_Long_Binary(1234567.0)) /= 1234567.0 then
- Report.Failed("Incorrect result from function To_Decimal with " &
- "Long_Binary parameter - 2");
- end if;
-
- TC_Long_Binary := Pack_4.To_Long_Binary(TC_Dec_4);
- if Pack_4.To_Decimal(TC_Long_Binary) /= TC_Dec_4 then
- Report.Failed("Incorrect result from function To_Decimal with " &
- "Long_Binary parameter - 3");
- end if;
-
-
-
- -- Check that both of the To_Decimal functions described above
- -- will propagate Conversion_Error if the converted value Item is
- -- outside the range of type Num.
- -- Note: Binary/Long_Binary parameter values are created by an
- -- instantiation of To_Binary/To_Long_Binary with a larger
- -- Num type as the generic formal.
-
- Binary_Parameter:
- begin
- TC_Dec_1 := Pack_1.To_Decimal(Pack_2.To_Binary(123456.78));
- Report.Failed("Conversion_Error was not raised by function " &
- "To_Decimal with Binary parameter, when the " &
- "converted value Item was outside the range " &
- "of type Num");
- if TC_Dec_1 = 12345.6 then -- Avoid dead assignment optimization.
- Report.Comment("Should never be printed");
- end if;
- exception
- when Conversion_Error => null; -- OK, expected exception.
- when The_Error : others =>
- Report.Failed(Ada.Exceptions.Exception_Name(The_Error) & " " &
- "was incorrectly raised by function To_Decimal " &
- "with Binary parameter, when the converted " &
- "value Item was outside the range of type Num");
- end Binary_Parameter;
-
- Long_Binary_Parameter:
- begin
- TC_Dec_3 := Pack_3.To_Decimal(Pack_4.To_Long_Binary(TC_Dec_4));
- Report.Failed("Conversion_Error was not raised by function " &
- "To_Decimal with Long_Binary parameter, when " &
- "the converted value Item was outside the range " &
- "of type Num");
- if TC_Dec_3 = 123456.78 then -- Avoid dead assignment optimization.
- Report.Comment("Should never be printed");
- end if;
- exception
- when Conversion_Error => null; -- OK, expected exception.
- when The_Error : others =>
- Report.Failed(Ada.Exceptions.Exception_Name(The_Error) & " " &
- "was incorrectly raised by function To_Decimal " &
- "with Long_Binary parameter, when the converted " &
- "value Item was outside the range of type Num");
- end Long_Binary_Parameter;
-
-
-
- -- Check that the function To_Binary converts a value of the Ada
- -- decimal type Num into a Binary type value.
-
- TC_Dec_1 := 123.4;
- TC_Dec_2 := 9.99;
- if Pack_1.To_Binary(TC_Dec_1) = Pack_1.To_Binary(-TC_Dec_1) or
- Pack_2.To_Binary(TC_Dec_2) = Pack_2.To_Binary(-TC_Dec_2)
- then
- Report.Failed("Incorrect result from function To_Binary - 1");
- end if;
-
- if Pack_1.To_Binary(1.1) = Pack_1.To_Binary(-1.1) or
- Pack_2.To_Binary(9999.99) = Pack_2.To_Binary(-9999.99)
- then
- Report.Failed("Incorrect result from function To_Binary - 2");
- end if;
-
-
- -- Check that the function To_Long_Binary converts a value of the
- -- Ada decimal type Num into a Long_Binary type value.
-
- TC_Dec_3 := 9.001;
- TC_Dec_4 := 123.4567;
- if Pack_3.To_Long_Binary(TC_Dec_3) = Pack_3.To_Long_Binary(-TC_Dec_3) or
- Pack_4.To_Long_Binary(TC_Dec_4) = Pack_4.To_Long_Binary(-TC_Dec_4)
- then
- Report.Failed("Incorrect result from function To_Long_Binary - 1");
- end if;
-
- if Pack_3.To_Long_Binary(1.011) =
- Pack_3.To_Long_Binary(-1.011) or
- Pack_4.To_Long_Binary(2345678.9012) =
- Pack_4.To_Long_Binary(-2345678.9012)
- then
- Report.Failed("Incorrect result from function To_Long_Binary - 2");
- end if;
-
-
- exception
- when The_Error : others =>
- Report.Failed("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB4008;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb5001.a b/gcc/testsuite/ada/acats/tests/cxb/cxb5001.a
deleted file mode 100644
index a681c5f13e2..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb5001.a
+++ /dev/null
@@ -1,110 +0,0 @@
--- CXB5001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the specification of the package Interfaces.Fortran
--- are available for use.
---
--- TEST DESCRIPTION:
--- This test verifies that the types and subprograms specified for the
--- interface are present
---
--- APPLICABILITY CRITERIA:
--- If an implementation provides package Interfaces.Fortran, this test
--- must compile, execute, and report "PASSED".
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 28 Feb 96 SAIC Added applicability criteria.
--- 27 Oct 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Report;
-with Interfaces.Fortran; -- N/A => ERROR
-
-procedure CXB5001 is
- package Fortran renames Interfaces.FORTRAN;
-
-begin
-
- Report.Test ("CXB5001", "Check the specification of Interfaces.Fortran");
-
-
- declare -- encapsulate the test
-
-
- TC_Int : integer := 1;
- TC_Natural : natural;
- TC_String : String := "ABCD";
- TC_Character : Character := 'a';
-
- TST_Fortran_Integer : FORTRAN.Fortran_Integer;
-
- TST_Real : Fortran.Real;
- TST_Double_Precision : Fortran.Double_Precision;
-
- TST_Logical : Fortran.Logical := FORTRAN.true;
- -- verify it is a Boolean
- TST_Complex : Fortran.Complex;
-
- TST_Imaginary_i : Fortran.Imaginary := FORTRAN.i;
- TST_Imaginary_j : Fortran.Imaginary := FORTRAN.j;
-
-
- -- Initialize it so we can use it below
- TST_Character_Set : Fortran.Character_Set :=
- Fortran.Character_Set'First;
-
- TST_Fortran_Character : FORTRAN.Fortran_Character (1..5) :=
- (others => TST_Character_Set);
-
-
-
- begin -- encapsulation
-
- -- Arrange that the calls to the subprograms are compiled but
- -- not executed
- --
- if not Report.Equal ( TC_Int, TC_Int ) then
-
- TST_Character_Set := Fortran.To_Fortran (TC_Character);
- TC_Character := Fortran.To_Ada (TST_Character_Set);
-
-
- TST_Fortran_Character := FORTRAN.To_Fortran ("TEST STRING");
- Report.Comment ( Fortran.To_Ada (TST_Fortran_Character) );
-
- Fortran.To_Fortran ( TC_String, TST_Fortran_Character, TC_Natural );
- Fortran.To_Ada ( TST_Fortran_Character, TC_String, TC_Natural );
-
- end if;
-
- end; -- encapsulation
-
- Report.Result;
-
-end CXB5001;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb5002.a b/gcc/testsuite/ada/acats/tests/cxb/cxb5002.a
deleted file mode 100644
index 3da7cc9b195..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb5002.a
+++ /dev/null
@@ -1,334 +0,0 @@
--- CXB5002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the Function To_Fortran with a Character parameter will
--- return the corresponding Fortran Character_Set value.
---
--- Check that the Function To_Ada with a Character_Set parameter will
--- return the corresponding Ada Character value.
---
--- Check that the Function To_Fortran with a String parameter will
--- return the corresponding Fortran_Character value.
---
--- Check that the Function To_Ada with a Fortran_Character parameter
--- will return the corresponding Ada String value.
---
--- TEST DESCRIPTION:
--- This test checks that the functions To_Fortran and To_Ada produce
--- the correct results, based on a variety of parameter input values.
---
--- In the first series of subtests, the results of the function
--- To_Fortran are compared against expected Character_Set type results.
--- In the second series of subtests, the results of the function To_Ada
--- are compared against expected String type results, and the length of
--- the String result is also verified against the Fortran_Character type
--- parameter.
---
--- This test uses Fixed, Bounded, and Unbounded_Strings in combination
--- with the functions under validation.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.Fortran.Character_Set:
--- ' ', 'a'..'z', 'A'..'Z', '1'..'9', '-', '_', '$', '#', and '*'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.Fortran. If an implementation provides
--- package Interfaces.Fortran, this test must compile, execute, and
--- report "PASSED".
---
--- This test does not apply to an implementation in which the Fortran
--- character set ranges are not contiguous (e.g., EBCDIC).
---
---
---
--- CHANGE HISTORY:
--- 11 Mar 96 SAIC Initial release for 2.1.
--- 10 Jun 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 27 Oct 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Ada.Characters.Latin_1;
-with Ada.Exceptions;
-with Ada.Strings.Bounded;
-with Ada.Strings.Unbounded;
-with Ada.Unchecked_Conversion;
-with Interfaces.Fortran; -- N/A => ERROR
-with Report;
-
-procedure CXB5002 is
-begin
-
- Report.Test ("CXB5002", "Check that functions To_Fortran and To_Ada " &
- "produce correct results");
-
- Test_Block:
- declare
-
- package ACL renames Ada.Characters.Latin_1;
- package Bnd is new Ada.Strings.Bounded.Generic_Bounded_Length(10);
- package Unb renames Ada.Strings.Unbounded;
-
- use Bnd, Unb;
- use Interfaces.Fortran;
- use Ada.Exceptions;
-
- Null_Fortran_Character : constant Fortran_Character := "";
- Fortran_Character_1 : Fortran_Character(1..1) := " ";
- Fortran_Character_5 : Fortran_Character(1..5) := " ";
- Fortran_Character_10 : Fortran_Character(1..10) := " ";
- Fortran_Character_20 : Fortran_Character(1..20) :=
- " ";
- TC_Fortran_Character_1 : Fortran_Character(1..1) := "A";
- TC_Fortran_Character_5 : Fortran_Character(1..5) := "ab*de";
- TC_Fortran_Character_10 : Fortran_Character(1..10) := "$1a2b3C4D5";
- TC_Fortran_Character_20 : Fortran_Character(1..20) :=
- "1234-ABCD_6789#fghij";
-
- Bnd_String : Bnd.Bounded_String :=
- Bnd.To_Bounded_String(" ");
- TC_Bnd_String : Bounded_String :=
- To_Bounded_String("$1a2b3C4D5");
-
- Unb_String : Unb.Unbounded_String :=
- Unb.To_Unbounded_String(" ");
- TC_Unb_String : Unbounded_String :=
- To_Unbounded_String("ab*de");
-
- String_1 : String(1..1) := " ";
- String_5 : String(1..5) := " ";
- String_10 : String(1..10) := " ";
- String_20 : String(1..20) := " ";
- TC_String_1 : String(1..1) := "A";
- TC_String_20 : String(1..20) := "1234-ABCD_6789#fghij";
- Null_String : constant String := "";
-
- Null_Character : constant Character := ACL.Nul;
- Character_A : constant Character := Character'Val(65);
- Character_Z : constant Character := Character'Val(90);
- TC_Character : Character := Character'First;
-
- Null_Character_Set : Character_Set := To_Fortran(ACL.Nul);
- TC_Character_Set,
- TC_Low_Character_Set,
- TC_High_Character_Set : Character_Set := Character_Set'First;
-
-
- -- The following procedure checks the results of function To_Ada.
-
- procedure Check_Length (Str : in String;
- Ftn : in Fortran_Character;
- Num : in Natural) is
- begin
- if Str'Length /= Ftn'Length or
- Str'Length /= Num
- then
- Report.Failed("Incorrect result from Function To_Ada " &
- "with string length " & Integer'Image(Num));
- end if;
- end Check_Length;
-
- -- To facilitate the conversion of Character-Character_Set data, the
- -- following functions have been instantiated.
-
- function Character_to_Character_Set is
- new Ada.Unchecked_Conversion(Character, Character_Set);
-
- function Character_Set_to_Character is
- new Ada.Unchecked_Conversion(Character_Set, Character);
-
- begin
-
- -- Check that the Function To_Fortran with a Character parameter
- -- will return the corresponding Fortran Character_Set value.
-
- for TC_Character in ACL.LC_A..ACL.LC_Z loop
- if To_Fortran(Item => TC_Character) /=
- Character_to_Character_Set(TC_Character)
- then
- Report.Failed("Incorrect result from To_Fortran with lower " &
- "case alphabetic character input");
- end if;
- end loop;
-
- for TC_Character in Character_A..Character_Z loop
- if To_Fortran(TC_Character) /=
- Character_to_Character_Set(TC_Character)
- then
- Report.Failed("Incorrect result from To_Fortran with upper " &
- "case alphabetic character input");
- end if;
- end loop;
-
- if To_Fortran(Null_Character) /=
- Character_to_Character_Set(Null_Character)
- then
- Report.Failed
- ("Incorrect result from To_Fortran with null character input");
- end if;
-
-
- -- Check that the Function To_Ada with a Character_Set parameter
- -- will return the corresponding Ada Character value.
-
- TC_Low_Character_Set := Character_to_Character_Set('a');
- TC_High_Character_Set := Character_to_Character_Set('z');
- for TC_Character_Set in TC_Low_Character_Set..TC_High_Character_Set loop
- if To_Ada(Item => TC_Character_Set) /=
- Character_Set_to_Character(TC_Character_Set)
- then
- Report.Failed("Incorrect result from To_Ada with lower case " &
- "alphabetic Character_Set input");
- end if;
- end loop;
-
- TC_Low_Character_Set := Character_to_Character_Set('A');
- TC_High_Character_Set := Character_to_Character_Set('Z');
- for TC_Character_Set in TC_Low_Character_Set..TC_High_Character_Set loop
- if To_Ada(TC_Character_Set) /=
- Character_Set_to_Character(TC_Character_Set)
- then
- Report.Failed("Incorrect result from To_Ada with upper case " &
- "alphabetic Character_Set input");
- end if;
- end loop;
-
- if To_Ada(Character_to_Character_Set(Null_Character)) /=
- Null_Character
- then
- Report.Failed("Incorrect result from To_Ada with a null " &
- "Character_Set input");
- end if;
-
-
- -- Check that the Function To_Fortran with a String parameter
- -- will return the corresponding Fortran_Character value.
- -- Note: The type Fortran_Character is a character array type that
- -- corresponds to Ada type String.
-
- Fortran_Character_1 := To_Fortran(Item => TC_String_1);
-
- if Fortran_Character_1 /= TC_Fortran_Character_1 then
- Report.Failed("Incorrect result from procedure To_Fortran - 1");
- end if;
-
- Fortran_Character_5 := To_Fortran(To_String(TC_Unb_String));
-
- if Fortran_Character_5 /= TC_Fortran_Character_5 then
- Report.Failed("Incorrect result from procedure To_Fortran - 2");
- end if;
-
- Fortran_Character_10 := To_Fortran(To_String(TC_Bnd_String));
-
- if Fortran_Character_10 /= TC_Fortran_Character_10 then
- Report.Failed("Incorrect result from procedure To_Fortran - 3");
- end if;
-
- Fortran_Character_20 := To_Fortran(Item => TC_String_20);
-
- if Fortran_Character_20 /= TC_Fortran_Character_20 then
- Report.Failed("Incorrect result from procedure To_Fortran - 4");
- end if;
-
- if To_Fortran(Null_String) /= Null_Fortran_Character then
- Report.Failed("Incorrect result from procedure To_Fortran - 5");
- end if;
-
-
- -- Check that the Function To_Ada with a Fortran_Character parameter
- -- will return the corresponding Ada String value.
-
- String_1 := To_Ada(TC_Fortran_Character_1);
-
- if String_1 /= TC_String_1 then
- Report.Failed("Incorrect value returned from function To_Ada - 1");
- end if;
-
- Check_Length(To_Ada(TC_Fortran_Character_1),
- TC_Fortran_Character_1,
- Num => 1);
-
-
- Unb_String := Unb.To_Unbounded_String(To_Ada(TC_Fortran_Character_5));
-
- if Unb_String /= TC_Unb_String then
- Report.Failed("Incorrect value returned from function To_Ada - 2");
- end if;
-
- Check_Length(To_Ada(TC_Fortran_Character_5),
- TC_Fortran_Character_5,
- Num => 5);
-
-
- Bnd_String := Bnd.To_Bounded_String
- (To_Ada(TC_Fortran_Character_10));
-
- if Bnd_String /= TC_Bnd_String then
- Report.Failed("Incorrect value returned from function To_Ada - 3");
- end if;
-
- Check_Length(To_Ada(TC_Fortran_Character_10),
- TC_Fortran_Character_10,
- Num => 10);
-
-
- String_20 := To_Ada(TC_Fortran_Character_20);
-
- if String_20 /= TC_String_20 then
- Report.Failed("Incorrect value returned from function To_Ada - 4");
- end if;
-
- Check_Length(To_Ada(TC_Fortran_Character_20),
- TC_Fortran_Character_20,
- Num => 20);
-
- if To_Ada(Null_Character_Set) /= Null_Character then
- Report.Failed("Incorrect value returned from function To_Ada - 5");
- end if;
-
-
- -- Check the two functions when used in combination.
-
- if To_Ada(Item => To_Fortran("This is a test")) /=
- "This is a test" or
- To_Ada(To_Fortran("1234567890abcdeFGHIJ")) /=
- Report.Ident_Str("1234567890abcdeFGHIJ")
- then
- Report.Failed("Incorrect result returned when using the " &
- "functions To_Ada and To_Fortran in combination");
- end if;
-
-
- exception
- when The_Error : others =>
- Report.Failed("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB5002;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb5003.a b/gcc/testsuite/ada/acats/tests/cxb/cxb5003.a
deleted file mode 100644
index 1c2b1c537ae..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb5003.a
+++ /dev/null
@@ -1,295 +0,0 @@
--- CXB5003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the procedure To_Fortran converts the character elements
--- of the String parameter Item into Character_Set elements of the
--- Fortran_Character type parameter Target. Check that the parameter
--- Last contains the index of the last element of parameter Target
--- that was assigned by To_Fortran.
---
--- Check that Constraint_Error is propagated by procedure To_Fortran
--- when the length of String parameter Item exceeds the length of
--- Fortran_Character parameter Target.
---
--- Check that the procedure To_Ada converts the Character_Set
--- elements of the Fortran_Character parameter Item into Character
--- elements of the String parameter Target. Check that the parameter
--- Last contains the index of the last element of parameter Target
--- that was assigned by To_Ada.
---
--- Check that Constraint_Error is propagated by procedure To_Ada when
--- the length of Fortran_Character parameter Item exceeds the length of
--- String parameter Target.
---
--- TEST DESCRIPTION:
--- This test checks that the procedures To_Fortran and To_Ada produce
--- the correct results, based on a variety of parameter input values.
---
--- In the first series of subtests, the Out parameter results of
--- procedure To_Fortran are compared against expected results,
--- which includes (in the parameter Last) the index in Target of the
--- last element assigned. The situation where procedure To_Fortran
--- raises Constraint_Error (when Item'Length exceeds Target'Length)
--- is also verified.
---
--- In the second series of subtests, the Out parameter results of
--- procedure To_Ada are verified, in a similar manner as is done for
--- procedure To_Fortran. The case of procedure To_Ada raising
--- Constraint_Error is also verified.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.Fortran.Character_Set:
--- ' ', 'a'..'j', 'A'..'D', '1'..'9', '-', '_', '$', '#', and '*'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.Fortran. If an implementation provides
--- package Interfaces.Fortran, this test must compile, execute, and
--- report "PASSED".
---
---
--- CHANGE HISTORY:
--- 14 Mar 96 SAIC Initial release for 2.1.
--- 10 Jun 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 27 Oct 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Ada.Exceptions;
-with Ada.Strings.Bounded;
-with Ada.Strings.Unbounded;
-with Interfaces.Fortran; -- N/A => ERROR
-with Report;
-
-procedure CXB5003 is
-begin
-
- Report.Test ("CXB5003", "Check that procedures To_Fortran and To_Ada " &
- "produce correct results");
-
- Test_Block:
- declare
-
- package Bnd is new Ada.Strings.Bounded.Generic_Bounded_Length(10);
- package Unb renames Ada.Strings.Unbounded;
-
- use Bnd, Unb;
- use Interfaces.Fortran;
- use Ada.Exceptions;
-
- Fortran_Character_1 : Fortran_Character(1..1) := " ";
- Fortran_Character_5 : Fortran_Character(1..5) := " ";
- Fortran_Character_10 : Fortran_Character(1..10) := " ";
- Fortran_Character_20 : Fortran_Character(1..20) :=
- " ";
- TC_Fortran_Character_1 : Fortran_Character(1..1) := "A";
- TC_Fortran_Character_5 : Fortran_Character(1..5) := "ab*de";
- TC_Fortran_Character_10 : Fortran_Character(1..10) := "$1a2b3C4D5";
- TC_Fortran_Character_20 : Fortran_Character(1..20) :=
- "1234-ABCD_6789#fghij";
-
- Bnd_String : Bnd.Bounded_String :=
- Bnd.To_Bounded_String(" ");
- TC_Bnd_String : Bounded_String :=
- To_Bounded_String("$1a2b3C4D5");
-
- Unb_String : Unb.Unbounded_String :=
- Unb.To_Unbounded_String(" ");
- TC_Unb_String : Unbounded_String :=
- To_Unbounded_String("ab*de");
-
- String_1 : String(1..1) := " ";
- String_5 : String(1..5) := " ";
- String_10 : String(1..10) := " ";
- String_20 : String(1..20) := " ";
- TC_String_1 : String(1..1) := "A";
- TC_String_20 : String(1..20) := "1234-ABCD_6789#fghij";
-
- TC_Fortran_Character : constant Fortran_Character := "";
- TC_String : constant String := "";
- TC_Natural : Natural := 0;
-
-
- begin
-
- -- Check that the procedure To_Fortran converts the character elements
- -- of the String parameter Item into Character_Set elements of the
- -- Fortran_Character type parameter Target.
- -- Check that the parameter Last contains the index of the last element
- -- of parameter Target that was assigned by To_Fortran.
-
- To_Fortran(Item => TC_String_1,
- Target => Fortran_Character_1,
- Last => TC_Natural);
-
- if Fortran_Character_1 /= TC_Fortran_Character_1 or
- TC_Natural /= TC_Fortran_Character_1'Length
- then
- Report.Failed("Incorrect result from procedure To_Fortran - 1");
- end if;
-
- To_Fortran(To_String(TC_Unb_String),
- Target => Fortran_Character_5,
- Last => TC_Natural);
-
- if Fortran_Character_5 /= TC_Fortran_Character_5 or
- TC_Natural /= TC_Fortran_Character_5'Length
- then
- Report.Failed("Incorrect result from procedure To_Fortran - 2");
- end if;
-
- To_Fortran(To_String(TC_Bnd_String),
- Fortran_Character_10,
- Last => TC_Natural);
-
- if Fortran_Character_10 /= TC_Fortran_Character_10 or
- TC_Natural /= TC_Fortran_Character_10'Length
- then
- Report.Failed("Incorrect result from procedure To_Fortran - 3");
- end if;
-
- To_Fortran(TC_String_20, Fortran_Character_20, TC_Natural);
-
- if Fortran_Character_20 /= TC_Fortran_Character_20 or
- TC_Natural /= TC_Fortran_Character_20'Length
- then
- Report.Failed("Incorrect result from procedure To_Fortran - 4");
- end if;
-
- To_Fortran(Item => TC_String, -- null string
- Target => Fortran_Character_1,
- Last => TC_Natural);
-
- if TC_Natural /= 0 then
- Report.Failed("Incorrect result from procedure To_Fortran, value " &
- "returned in parameter Last should be zero, since " &
- "parameter Item is null array");
- end if;
-
-
- -- Check that Constraint_Error is propagated by procedure To_Fortran
- -- when the length of String parameter Item exceeds the length of
- -- Fortran_Character parameter Target.
-
- begin
-
- To_Fortran(Item => TC_String_20,
- Target => Fortran_Character_10,
- Last => TC_Natural);
- Report.Failed("Constraint_Error not raised by procedure " &
- "To_Fortran when Item'Length exceeds Target'Length");
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when The_Error : others =>
- Report.Failed("The following exception was raised by procedure " &
- "To_Fortran when Item'Length exceeds " &
- "Target'Length: " & Exception_Name(The_Error));
- end;
-
-
- -- Check that the procedure To_Ada converts the Character_Set
- -- elements of the Fortran_Character parameter Item into Character
- -- elements of the String parameter Target.
- -- Check that the parameter Last contains the index of the last
- -- element of parameter Target that was assigned by To_Ada.
-
- To_Ada(Item => TC_Fortran_Character_1,
- Target => String_1,
- Last => TC_Natural);
-
- if String_1 /= TC_String_1 or
- TC_Natural /= TC_String_1'Length
- then
- Report.Failed("Incorrect result from procedure To_Ada - 1");
- end if;
-
- To_Ada(TC_Fortran_Character_5,
- Target => String_5,
- Last => TC_Natural);
-
- if String_5 /= To_String(TC_Unb_String) or
- TC_Natural /= Length(TC_Unb_String)
- then
- Report.Failed("Incorrect result from procedure To_Ada - 2");
- end if;
-
- To_Ada(TC_Fortran_Character_10,
- String_10,
- Last => TC_Natural);
-
- if String_10 /= To_String(TC_Bnd_String) or
- TC_Natural /= Length(TC_Bnd_String)
- then
- Report.Failed("Incorrect result from procedure To_Ada - 3");
- end if;
-
- To_Ada(TC_Fortran_Character_20, String_20, TC_Natural);
-
- if String_20 /= TC_String_20 or
- TC_Natural /= TC_String_20'Length
- then
- Report.Failed("Incorrect result from procedure To_Ada - 4");
- end if;
-
- To_Ada(Item => TC_Fortran_Character, -- null array.
- Target => String_20,
- Last => TC_Natural);
-
- if TC_Natural /= 0 then
- Report.Failed("Incorrect result from procedure To_Ada, value " &
- "returned in parameter Last should be zero, since " &
- "parameter Item is null array");
- end if;
-
-
- -- Check that Constraint_Error is propagated by procedure To_Ada
- -- when the length of Fortran_Character parameter Item exceeds the
- -- length of String parameter Target.
-
- begin
-
- To_Ada(Item => TC_Fortran_Character_10,
- Target => String_5,
- Last => TC_Natural);
- Report.Failed("Constraint_Error not raised by procedure To_Ada " &
- "when Item'Length exceeds Target'Length");
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when The_Error : others =>
- Report.Failed("Incorrect exception raised by procedure To_Ada " &
- "when Item'Length exceeds Target'Length");
- end;
-
-
- exception
- when The_Error : others =>
- Report.Failed("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB5003;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf1001.a b/gcc/testsuite/ada/acats/tests/cxf/cxf1001.a
deleted file mode 100644
index be7e5069252..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf1001.a
+++ /dev/null
@@ -1,261 +0,0 @@
--- CXF1001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that values of 2 and 10 are allowable values for Machine_Radix
--- of a decimal first subtype.
--- Check that the value of Decimal.Max_Decimal_Digits is at least 18;
--- the value of Decimal.Max_Scale is at least 18; the value of
--- Decimal.Min_Scale is at most 0.
---
--- TEST DESCRIPTION:
--- This test examines the Machine_Radix attribute definition clause
--- and its effect on Decimal fixed point types, as well as several
--- constants from the package Ada.Decimal.
--- The first subtest checks that the Machine_Radix attribute will
--- return the value set for Machine_Radix by an attribute definition
--- clause. The second and third subtests examine differences between
--- the binary and decimal scaling of a type, based on the radix
--- representation. The final subtest examines the values
--- assigned to constants Min_Scale, Max_Scale, and Max_Decimal_Digits,
--- found in the package Ada.Decimal.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 29 Dec 94 SAIC Restructured Radix 10 and Radix 2 test blocks.
---
---!
-
-with Report;
-with Ada.Decimal;
-
-procedure CXF1001 is
-begin
-
- Report.Test ("CXF1001", "Check that values of 2 and 10 are allowable " &
- "values for Machine_Radix of a decimal first " &
- "subtype. Check that the value of " &
- "Decimal.Max_Decimal_Digits is at least 18; " &
- "the value of Decimal.Max_Scale is at least " &
- "18; the value of Decimal.Min_Scale is at " &
- "most 0");
-
- Attribute_Check_Block:
- declare
-
- Del : constant := 1.0/10**2;
- Const_Digits : constant := 3;
- Two : constant := 2;
- Ten : constant := 10;
-
- type Radix_2_Type_1 is delta 0.01 digits 7;
- type Radix_2_Type_2 is delta Ada.Decimal.Min_Delta digits 10;
- type Radix_2_Type_3 is
- delta 0.000_1 digits Ada.Decimal.Max_Decimal_Digits;
-
- type Radix_10_Type_1 is delta 10.0**(-Ada.Decimal.Max_Scale) digits 8;
- type Radix_10_Type_2 is delta 10.0**(-Ada.Decimal.Min_Scale) digits 6;
- type Radix_10_Type_3 is delta Ada.Decimal.Max_Delta digits 15;
-
-
- -- Use an attribute definition clause to set the Machine_Radix for a
- -- decimal first subtype to either 2 or 10.
- for Radix_2_Type_1'Machine_Radix use 2;
- for Radix_2_Type_2'Machine_Radix use Two;
- for Radix_2_Type_3'Machine_Radix use 10-8;
-
- for Radix_10_Type_1'Machine_Radix use 2*15/Const_Digits;
- for Radix_10_Type_2'Machine_Radix use Ten;
- for Radix_10_Type_3'Machine_Radix use Radix_10_Type_2'Machine_Radix;
-
-
- begin
-
- -- Check that the attribute 'Machine_Radix returns the value assigned
- -- by the attribute definition clause.
-
- if Radix_2_Type_1'Machine_Radix /= 2 or else
- Radix_2_Type_2'Machine_Radix /= 2 or else
- Radix_2_Type_3'Machine_Radix /= 2
- then
- Report.Failed("Incorrect radix value returned, 2 expected");
- end if;
-
- if Radix_10_Type_1'Machine_Radix /= 10 or else
- Radix_10_Type_2'Machine_Radix /= 10 or else
- Radix_10_Type_3'Machine_Radix /= 10
- then
- Report.Failed("Incorrect radix value returned, 10 expected");
- end if;
-
- exception
- when others => Report.Failed ("Exception raised in Attr_Check_Block");
- end Attribute_Check_Block;
-
-
-
- Radix_Block:
- -- Premises:
- -- 1) Choose several numbers, from types using either decimal scaling or
- -- binary scaling.
- -- 1) Repetitively add these numbers to themselves.
- -- 3) Validate that the result is the expected result, regardless of the
- -- scaling used in the definition of the type.
- declare
-
- Number_Of_Values : constant := 3;
- Loop_Count : constant := 1000;
-
- type Radix_2_Type is delta 0.0001 digits 10;
- type Radix_10_Type is delta 0.0001 digits 10;
-
- for Radix_2_Type'Machine_Radix use 2;
- for Radix_10_Type'Machine_Radix use 10;
-
- type Result_Record_Type is record
- Rad_2 : Radix_2_Type;
- Rad_10 : Radix_10_Type;
- end record;
-
- type Result_Array_Type is array (1..Number_Of_Values)
- of Result_Record_Type;
-
- Result_Array : Result_Array_Type := ((50.00, 50.00),
- (613.00, 613.00),
- (72.70, 72.70));
-
- function Repetitive_Radix_2_Add (Value : in Radix_2_Type)
- return Radix_2_Type is
- Result : Radix_2_Type := 0.0;
- begin
- for i in 1..Loop_Count loop
- Result := Result + Value;
- end loop;
- return Result;
- end Repetitive_Radix_2_Add;
-
- function Repetitive_Radix_10_Add (Value : in Radix_10_Type)
- return Radix_10_Type is
- Result : Radix_10_Type := 0.0;
- begin
- for i in 1..Loop_Count loop
- Result := Result + Value;
- end loop;
- return Result;
- end Repetitive_Radix_10_Add;
-
- begin
-
- -- Radix 2 Cases, three different values.
- -- Compare the result of the repetitive addition with the expected
- -- Radix 2 result, as well as with the Radix 10 value after type
- -- conversion.
-
- if Repetitive_Radix_2_Add(0.05) /= Result_Array(1).Rad_2 or
- Repetitive_Radix_2_Add(0.05) /= Radix_2_Type(Result_Array(1).Rad_10)
- then
- Report.Failed("Incorrect Radix 2 Result, Case 1");
- end if;
-
- if Repetitive_Radix_2_Add(0.613) /=
- Result_Array(2).Rad_2 or
- Repetitive_Radix_2_Add(0.613) /=
- Radix_2_Type(Result_Array(2).Rad_10)
- then
- Report.Failed("Incorrect Radix 2 Result, Case 2");
- end if;
-
- if Repetitive_Radix_2_Add(0.0727) /=
- Result_Array(3).Rad_2 or
- Repetitive_Radix_2_Add(0.0727) /=
- Radix_2_Type(Result_Array(3).Rad_10)
- then
- Report.Failed("Incorrect Radix 2 Result, Case 3");
- end if;
-
- -- Radix 10 Cases, three different values.
- -- Compare the result of the repetitive addition with the expected
- -- Radix 10 result, as well as with the Radix 2 value after type
- -- conversion.
-
- if Repetitive_Radix_10_Add(0.05) /= Result_Array(1).Rad_10 or
- Repetitive_Radix_10_Add(0.05) /= Radix_10_Type(Result_Array(1).Rad_2)
- then
- Report.Failed("Incorrect Radix 10 Result, Case 1");
- end if;
-
- if Repetitive_Radix_10_Add(0.613) /=
- Result_Array(2).Rad_10 or
- Repetitive_Radix_10_Add(0.613) /=
- Radix_10_Type(Result_Array(2).Rad_2)
- then
- Report.Failed("Incorrect Radix 10 Result, Case 2");
- end if;
-
- if Repetitive_Radix_10_Add(0.0727) /=
- Result_Array(3).Rad_10 or
- Repetitive_Radix_10_Add(0.0727) /=
- Radix_10_Type(Result_Array(3).Rad_2)
- then
- Report.Failed("Incorrect Radix 10 Result, Case 3");
- end if;
-
- exception
- when others => Report.Failed ("Exception raised in Radix_Block");
- end Radix_Block;
-
-
-
- Size_Block:
- -- Check the implementation max/min values of constants declared in
- -- package Ada.Decimal.
- declare
- Minimum_Required_Size : constant := 18;
- Maximum_Allowed_Size : constant := 0;
- begin
-
- -- Check that the Max_Decimal_Digits value is at least 18.
- if not (Ada.Decimal.Max_Decimal_Digits >= Minimum_Required_Size) then
- Report.Failed("Insufficient size provided for Max_Decimal_Digits");
- end if;
-
- -- Check that the Max_Scale value is at least 18.
- if not (Ada.Decimal.Max_Scale >= Minimum_Required_Size) then
- Report.Failed("Insufficient size provided for Max_Scale");
- end if;
-
- -- Check that the Min_Scale value is at most 0.
- if not (Ada.Decimal.Min_Scale <= Maximum_Allowed_Size) then
- Report.Failed("Too large a value provided for Min_Scale");
- end if;
-
- exception
- when others => Report.Failed ("Exception raised in Size_Block");
- end Size_Block;
-
- Report.Result;
-
-end CXF1001;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf2001.a b/gcc/testsuite/ada/acats/tests/cxf/cxf2001.a
deleted file mode 100644
index 96d0a0a17d3..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf2001.a
+++ /dev/null
@@ -1,755 +0,0 @@
--- CXF2001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the Divide procedure provides the following results:
--- Quotient = Dividend divided by Divisor and
--- Remainder = Dividend - (Divisor * Quotient)
--- Check that the Remainder is calculated exactly.
---
--- TEST DESCRIPTION:
--- This test is designed to test the generic procedure Divide found in
--- package Ada.Decimal.
---
--- The table below attempts to portray the design approach used in this
--- test. There are three "dimensions" of concern:
--- 1) the delta value of the Quotient and Remainder types, shown as
--- column headers,
--- 2) specific choices for the Dividend and Divisor numerical values
--- (i.e., whether they yielded a repeating/non-terminating result,
--- or a terminating result ["exact"]), displayed on the left side
--- of the tables, and
--- 3) the delta for the Dividend and Divisor.
---
--- Each row in the tables indicates a specific test case, showing the
--- specific quotient and remainder (under the appropriate Delta column)
--- for each combination of dividend and divisor values. Test cases
--- follow the top-to-bottom sequence shown in the tables.
---
--- Most of the test case sets (same dividend/divisor combinations -
--- indicated by dashed horizontal lines in the tables) vary the
--- delta of the quotient and remainder types between test cases. This
--- allows for an examination of how different deltas for a quotient
--- and/or remainder type can influence the results of a division with
--- identical dividend and divisor.
---
--- Note: Test cases are performed for both Radix 10 and Radix 2 types.
---
---
--- Divid Divis Delta Delta Delta Delta Delta
--- (Delta)(Delta)| .1 | .01 | .001 | .0001 | .00001 |Test
--- |---|---|-----|-----|-----|-----|-----|-----|-----|-----|Case
--- quotient | Q | R | Q | R | Q | R | Q | R | Q | R | No.
--- ---------------------------------------------------------------------------
--- .05 .3 |.1 .02 1,21
--- (.01) (.1) |.1 0 2,22
--- | .16 .002 3,23
--- 0.166666.. | .16 .00 4,24
--- | .166 .0002 5,25
--- ---------------------------------------------------------------------------
--- .15 20 | .00 .1500 6,26
--- (.01) (1) | .00 .150 7,27
--- | .00 .15 8,28
--- 0.0075 | .01 .007 9,29
--- | .007 .010 10,30
--- | .0075 .0000 11,31
--- ---------------------------------------------------------------------------
--- .03125 .5 | .0625 .0000 12,32
--- (.00001) (.1) | .062 .00025 13,33
--- | .062 .0002 14,34
--- 0.0625 | .062 .000 15,35
--- | .00 .062 16,36
--- | .06 .00125 17,37
--- | .06 .0012 18,38
--- | .06 .001 19,39
--- | .06 .00 20,40
--- ---------------------------------------------------------------------------
--- Divide by Zero| Raise Constraint_Error 41
--- ---------------------------------------------------------------------------
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 29 Dec 94 SAIC Modified Radix 2 cases to match Radix 10 cases.
--- 03 Oct 95 RBKD Modified to fix incorrect remainder results
--- 15 Nov 95 SAIC Incorporated reviewer fixes for ACVC 2.0.1.
---
---!
-
-with Report;
-with Ada.Decimal;
-
-procedure CXF2001 is
-
- TC_Verbose : Boolean := False;
-
-begin
-
- Report.Test ("CXF2001", "Check that the Divide procedure provides " &
- "correct results. Check that the Remainder " &
- "is calculated exactly");
- Radix_10_Block:
- declare
-
-
- -- Declare all types and variables used in the various blocks below
- -- for all Radix 10 evaluations.
-
- type DT_1 is delta 1.0 digits 5;
- type DT_0_1 is delta 0.1 digits 10;
- type DT_0_01 is delta 0.01 digits 10;
- type DT_0_001 is delta 0.001 digits 10;
- type DT_0_0001 is delta 0.0001 digits 10;
- type DT_0_00001 is delta 0.00001 digits 10;
-
- for DT_1'Machine_Radix use 10;
- for DT_0_1'Machine_Radix use 10;
- for DT_0_01'Machine_Radix use 10;
- for DT_0_001'Machine_Radix use 10;
- for DT_0_0001'Machine_Radix use 10;
- for DT_0_00001'Machine_Radix use 10;
-
- Dd_1, Dv_1, Quot_1, Rem_1 : DT_1 := 0.0;
- Dd_0_1, Dv_0_1, Quot_0_1, Rem_0_1 : DT_0_1 := 0.0;
- Dd_0_01, Dv_0_01, Quot_0_01, Rem_0_01 : DT_0_01 := 0.0;
- Dd_0_001, Dv_0_001, Quot_0_001, Rem_0_001 : DT_0_001 := 0.0;
- Dd_0_0001, Dv_0_0001, Quot_0_0001, Rem_0_0001 : DT_0_0001 := 0.0;
- Dd_0_00001, Dv_0_00001, Quot_0_00001, Rem_0_00001 : DT_0_00001 := 0.0;
-
- begin
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(Dividend_Type => DT_0_01,
- Divisor_Type => DT_0_1,
- Quotient_Type => DT_0_1,
- Remainder_Type => DT_0_01);
- begin
- if TC_Verbose then Report.Comment("Case 1"); end if;
- Dd_0_01 := DT_0_01(0.05); Dv_0_1 := DT_0_1(0.3);
- Div(Dd_0_01, Dv_0_1, Quot_0_1, Rem_0_01);
- if Quot_0_1 /= DT_0_1(0.1) or Rem_0_01 /= DT_0_01(0.02) then
- Report.Failed("Incorrect values returned, Case 1");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_0_1, DT_0_1, DT_0_1);
- begin
- if TC_Verbose then Report.Comment("Case 2"); end if;
- Dd_0_01 := DT_0_01(0.05); Dv_0_1 := DT_0_1(0.3);
- Div(Dd_0_01, Dv_0_1, Quot_0_1, Rem_0_1);
- if Quot_0_1 /= DT_0_1(0.1) or Rem_0_1 /= DT_0_1(0.0) then
- Report.Failed("Incorrect values returned, Case 2");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_0_1, DT_0_01, DT_0_001);
- begin
- if TC_Verbose then Report.Comment("Case 3"); end if;
- Dd_0_01 := DT_0_01(0.05); Dv_0_1 := DT_0_1(0.3);
- Div(Dd_0_01, Dv_0_1, Quot_0_01, Rem_0_001);
- if Quot_0_01 /= DT_0_01(0.16) or Rem_0_001 /= DT_0_001(0.002) then
- Report.Failed("Incorrect values returned, Case 3");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_0_1, DT_0_01, DT_0_01);
- begin
- if TC_Verbose then Report.Comment("Case 4"); end if;
- Dd_0_01 := DT_0_01(0.05); Dv_0_1 := DT_0_1(0.3);
- Div(Dd_0_01, Dv_0_1, Quot_0_01, Rem_0_01);
- if Quot_0_01 /= DT_0_01(0.16) or Rem_0_01 /= DT_0_01(0.0) then
- Report.Failed("Incorrect values returned, Case 4");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_0_1, DT_0_001, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 5"); end if;
- Dd_0_01 := DT_0_01(0.05); Dv_0_1 := DT_0_1(0.3);
- Div(Dd_0_01, Dv_0_1, Quot_0_001, Rem_0_0001);
- if Quot_0_001 /= DT_0_001(0.166) or
- Rem_0_0001 /= DT_0_0001(0.0002)
- then
- Report.Failed("Incorrect values returned, Case 5");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_1, DT_0_01, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 6"); end if;
- Dd_0_01 := DT_0_01(0.15); Dv_1 := DT_1(20);
- Div(Dd_0_01, Dv_1, Quot_0_01, Rem_0_0001);
- if Quot_0_01 /= DT_0_01(0.0) or Rem_0_0001 /= DT_0_0001(0.1500) then
- Report.Failed("Incorrect values returned, Case 6");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_1, DT_0_01, DT_0_001);
- begin
- if TC_Verbose then Report.Comment("Case 7"); end if;
- Dd_0_01 := DT_0_01(0.15); Dv_1 := DT_1(20);
- Div(Dd_0_01, Dv_1, Quot_0_01, Rem_0_001);
- if Quot_0_01 /= DT_0_01(0.0) or Rem_0_001 /= DT_0_001(0.150) then
- Report.Failed("Incorrect values returned, Case 7");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_1, DT_0_01, DT_0_01);
- begin
- if TC_Verbose then Report.Comment("Case 8"); end if;
- Dd_0_01 := DT_0_01(0.15); Dv_1 := DT_1(20);
- Div(Dd_0_01, Dv_1, Quot_0_01, Rem_0_01);
- if Quot_0_01 /= DT_0_01(0.0) or Rem_0_01 /= DT_0_01(0.15) then
- Report.Failed("Incorrect values returned, Case 8");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_1, DT_0_001, DT_0_001);
- begin
- if TC_Verbose then Report.Comment("Case 9"); end if;
- Dd_0_01 := DT_0_01(0.15); Dv_1 := DT_1(20);
- Div(Dd_0_01, Dv_1, Quot_0_001, Rem_0_001);
- if Quot_0_001 /= DT_0_001(0.007) or Rem_0_001 /= DT_0_001(0.01) then
- Report.Failed("Incorrect values returned, Case 9");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_1, DT_0_001, DT_0_01);
- begin
- if TC_Verbose then Report.Comment("Case 10"); end if;
- Dd_0_01 := DT_0_01(0.15); Dv_1 := DT_1(20);
- Div(Dd_0_01, Dv_1, Quot_0_001, Rem_0_01);
- if Quot_0_001 /= DT_0_001(0.007) or Rem_0_01 /= DT_0_01(0.01) then
- Report.Failed("Incorrect values returned, Case 10");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_1, DT_0_0001, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 11"); end if;
- Dd_0_01 := DT_0_01(0.15); Dv_1 := DT_1(20);
- Div(Dd_0_01, Dv_1, Quot_0_0001, Rem_0_0001);
- if Quot_0_0001 /= DT_0_0001(0.0075) or
- Rem_0_0001 /= DT_0_0001(0.0)
- then
- Report.Failed("Incorrect values returned, Case 11");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_0001, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 12"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_0001, Rem_0_0001);
- if Quot_0_0001 /= DT_0_0001(0.0625) or
- Rem_0_0001 /= DT_0_0001(0.0)
- then
- Report.Failed("Incorrect values returned, Case 12");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_001, DT_0_00001);
- begin
- if TC_Verbose then Report.Comment("Case 13"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_001, Rem_0_00001);
- if Quot_0_001 /= DT_0_001(0.062) or
- Rem_0_00001 /= DT_0_00001(0.00025)
- then
- Report.Failed("Incorrect values returned, Case 13");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_001, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 14"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_001, Rem_0_0001);
- if Quot_0_001 /= DT_0_001(0.062) or
- Rem_0_0001 /= DT_0_0001(0.0002)
- then
- Report.Failed("Incorrect values returned, Case 14");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_001, DT_0_001);
- begin
- if TC_Verbose then Report.Comment("Case 15"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_001, Rem_0_001);
- if Quot_0_001 /= DT_0_001(0.062) or Rem_0_001 /= DT_0_001(0.000)
- then
- Report.Failed("Incorrect values returned, Case 15");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_001, DT_0_01);
- begin
- if TC_Verbose then Report.Comment("Case 16"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_001, Rem_0_01);
- if Quot_0_001 /= DT_0_001(0.062) or Rem_0_01 /= DT_0_01(0.00) then
- Report.Failed("Incorrect values returned, Case 16");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_01, DT_0_00001);
- begin
- if TC_Verbose then Report.Comment("Case 17"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_01, Rem_0_00001);
- if Quot_0_01 /= DT_0_01(0.06) or Rem_0_00001 /= DT_0_00001(0.00125)
- then
- Report.Failed("Incorrect values returned, Case 17");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_01, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 18"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_01, Rem_0_0001);
- if Quot_0_01 /= DT_0_01(0.06) or Rem_0_0001 /= DT_0_0001(0.0012)
- then
- Report.Failed("Incorrect values returned, Case 18");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_01, DT_0_001);
- begin
- if TC_Verbose then Report.Comment("Case 19"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_01, Rem_0_001);
- if Quot_0_01 /= DT_0_01(0.06) or Rem_0_001 /= DT_0_001(0.001) then
- Report.Failed("Incorrect values returned, Case 19");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_01, DT_0_01);
- begin
- if TC_Verbose then Report.Comment("Case 20"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_01, Rem_0_01);
- if Quot_0_01 /= DT_0_01(0.06) or Rem_0_01 /= DT_0_01(0.0) then
- Report.Failed("Incorrect values returned, Case 20");
- end if;
- end;
-
-
- exception
- when others => Report.Failed("Exception raised in Radix_10_Block");
- end Radix_10_Block;
-
-
-
- Radix_2_Block:
- declare
-
- -- Declare all types and variables used in the various blocks below
- -- for all Radix 2 evaluations.
-
- type DT_1 is delta 1.0 digits 5;
- type DT_0_1 is delta 0.1 digits 10;
- type DT_0_01 is delta 0.01 digits 10;
- type DT_0_001 is delta 0.001 digits 10;
- type DT_0_0001 is delta 0.0001 digits 10;
- type DT_0_00001 is delta 0.00001 digits 10;
-
- for DT_1'Machine_Radix use 2;
- for DT_0_1'Machine_Radix use 2;
- for DT_0_01'Machine_Radix use 2;
- for DT_0_001'Machine_Radix use 2;
- for DT_0_0001'Machine_Radix use 2;
- for DT_0_00001'Machine_Radix use 2;
-
- Dd_1, Dv_1, Quot_1, Rem_1 : DT_1 := 0.0;
- Dd_0_1, Dv_0_1, Quot_0_1, Rem_0_1 : DT_0_1 := 0.0;
- Dd_0_01, Dv_0_01, Quot_0_01, Rem_0_01 : DT_0_01 := 0.0;
- Dd_0_001, Dv_0_001, Quot_0_001, Rem_0_001 : DT_0_001 := 0.0;
- Dd_0_0001, Dv_0_0001, Quot_0_0001, Rem_0_0001 : DT_0_0001 := 0.0;
- Dd_0_00001, Dv_0_00001, Quot_0_00001, Rem_0_00001 : DT_0_00001 := 0.0;
-
- begin
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(Dividend_Type => DT_0_01,
- Divisor_Type => DT_0_1,
- Quotient_Type => DT_0_1,
- Remainder_Type => DT_0_01);
- begin
- if TC_Verbose then Report.Comment("Case 21"); end if;
- Dd_0_01 := DT_0_01(0.05); Dv_0_1 := DT_0_1(0.3);
- Div(Dd_0_01, Dv_0_1, Quot_0_1, Rem_0_01);
- if Quot_0_1 /= DT_0_1(0.1) or Rem_0_01 /= DT_0_01(0.02) then
- Report.Failed("Incorrect values returned, Case 21");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_0_1, DT_0_1, DT_0_1);
- begin
- if TC_Verbose then Report.Comment("Case 22"); end if;
- Dd_0_01 := DT_0_01(0.05); Dv_0_1 := DT_0_1(0.3);
- Div(Dd_0_01, Dv_0_1, Quot_0_1, Rem_0_1);
- if Quot_0_1 /= DT_0_1(0.1) or Rem_0_1 /= DT_0_1(0.0) then
- Report.Failed("Incorrect values returned, Case 22");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_0_1, DT_0_01, DT_0_001);
- begin
- if TC_Verbose then Report.Comment("Case 23"); end if;
- Dd_0_01 := DT_0_01(0.05); Dv_0_1 := DT_0_1(0.3);
- Div(Dd_0_01, Dv_0_1, Quot_0_01, Rem_0_001);
- if Quot_0_01 /= DT_0_01(0.16) or Rem_0_001 /= DT_0_001(0.002) then
- Report.Failed("Incorrect values returned, Case 23");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_0_1, DT_0_01, DT_0_01);
- begin
- if TC_Verbose then Report.Comment("Case 24"); end if;
- Dd_0_01 := DT_0_01(0.05); Dv_0_1 := DT_0_1(0.3);
- Div(Dd_0_01, Dv_0_1, Quot_0_01, Rem_0_01);
- if Quot_0_01 /= DT_0_01(0.16) or Rem_0_01 /= DT_0_01(0.0) then
- Report.Failed("Incorrect values returned, Case 24");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_0_1, DT_0_001, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 25"); end if;
- Dd_0_01 := DT_0_01(0.05); Dv_0_1 := DT_0_1(0.3);
- Div(Dd_0_01, Dv_0_1, Quot_0_001, Rem_0_0001);
- if Quot_0_001 /= DT_0_001(0.166) or
- Rem_0_0001 /= DT_0_0001(0.0002)
- then
- Report.Failed("Incorrect values returned, Case 25");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_1, DT_0_01, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 26"); end if;
- Dd_0_01 := DT_0_01(0.15); Dv_1 := DT_1(20);
- Div(Dd_0_01, Dv_1, Quot_0_01, Rem_0_0001);
- if Quot_0_01 /= DT_0_01(0.0) or Rem_0_0001 /= DT_0_0001(0.1500) then
- Report.Failed("Incorrect values returned, Case 26");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_1, DT_0_01, DT_0_001);
- begin
- if TC_Verbose then Report.Comment("Case 27"); end if;
- Dd_0_01 := DT_0_01(0.15); Dv_1 := DT_1(20);
- Div(Dd_0_01, Dv_1, Quot_0_01, Rem_0_001);
- if Quot_0_01 /= DT_0_01(0.0) or Rem_0_001 /= DT_0_001(0.150) then
- Report.Failed("Incorrect values returned, Case 27");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_1, DT_0_01, DT_0_01);
- begin
- if TC_Verbose then Report.Comment("Case 28"); end if;
- Dd_0_01 := DT_0_01(0.15); Dv_1 := DT_1(20);
- Div(Dd_0_01, Dv_1, Quot_0_01, Rem_0_01);
- if Quot_0_01 /= DT_0_01(0.0) or Rem_0_01 /= DT_0_01(0.15) then
- Report.Failed("Incorrect values returned, Case 28");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_1, DT_0_001, DT_0_001);
- begin
- if TC_Verbose then Report.Comment("Case 29"); end if;
- Dd_0_01 := DT_0_01(0.15); Dv_1 := DT_1(20);
- Div(Dd_0_01, Dv_1, Quot_0_001, Rem_0_001);
- if Quot_0_001 /= DT_0_001(0.007) or Rem_0_001 /= DT_0_001(0.01) then
- Report.Failed("Incorrect values returned, Case 29");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_1, DT_0_001, DT_0_01);
- begin
- if TC_Verbose then Report.Comment("Case 30"); end if;
- Dd_0_01 := DT_0_01(0.15); Dv_1 := DT_1(20);
- Div(Dd_0_01, Dv_1, Quot_0_001, Rem_0_01);
- if Quot_0_001 /= DT_0_001(0.007) or Rem_0_01 /= DT_0_01(0.01) then
- Report.Failed("Incorrect values returned, Case 30");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_01, DT_1, DT_0_0001, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 31"); end if;
- Dd_0_01 := DT_0_01(0.15); Dv_1 := DT_1(20);
- Div(Dd_0_01, Dv_1, Quot_0_0001, Rem_0_0001);
- if Quot_0_0001 /= DT_0_0001(0.0075) or
- Rem_0_0001 /= DT_0_0001(0.0)
- then
- Report.Failed("Incorrect values returned, Case 31");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_0001, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 32"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_0001, Rem_0_0001);
- if Quot_0_0001 /= DT_0_0001(0.0625) or
- Rem_0_0001 /= DT_0_0001(0.0)
- then
- Report.Failed("Incorrect values returned, Case 32");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_001, DT_0_00001);
- begin
- if TC_Verbose then Report.Comment("Case 33"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_001, Rem_0_00001);
- if Quot_0_001 /= DT_0_001(0.062) or
- Rem_0_00001 /= DT_0_00001(0.00025)
- then
- Report.Failed("Incorrect values returned, Case 33");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_001, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 34"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_001, Rem_0_0001);
- if Quot_0_001 /= DT_0_001(0.062) or
- Rem_0_0001 /= DT_0_0001(0.0002)
- then
- Report.Failed("Incorrect values returned, Case 34");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_001, DT_0_001);
- begin
- if TC_Verbose then Report.Comment("Case 35"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_001, Rem_0_001);
- if Quot_0_001 /= DT_0_001(0.062) or Rem_0_001 /= DT_0_001(0.000)
- then
- Report.Failed("Incorrect values returned, Case 35");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_001, DT_0_01);
- begin
- if TC_Verbose then Report.Comment("Case 36"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_001, Rem_0_01);
- if Quot_0_001 /= DT_0_001(0.062) or Rem_0_01 /= DT_0_01(0.00) then
- Report.Failed("Incorrect values returned, Case 36");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_01, DT_0_00001);
- begin
- if TC_Verbose then Report.Comment("Case 37"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_01, Rem_0_00001);
- if Quot_0_01 /= DT_0_01(0.06) or Rem_0_00001 /= DT_0_00001(0.00125)
- then
- Report.Failed("Incorrect values returned, Case 37");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_01, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 38"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_01, Rem_0_0001);
- if Quot_0_01 /= DT_0_01(0.06) or Rem_0_0001 /= DT_0_0001(0.0012)
- then
- Report.Failed("Incorrect values returned, Case 38");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_01, DT_0_001);
- begin
- if TC_Verbose then Report.Comment("Case 39"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_01, Rem_0_001);
- if Quot_0_01 /= DT_0_01(0.06) or Rem_0_001 /= DT_0_001(0.001) then
- Report.Failed("Incorrect values returned, Case 39");
- end if;
- end;
-
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_00001, DT_0_1, DT_0_01, DT_0_01);
- begin
- if TC_Verbose then Report.Comment("Case 40"); end if;
- Dd_0_00001 := DT_0_00001(0.03125); Dv_0_1 := DT_0_1(0.5);
- Div(Dd_0_00001, Dv_0_1, Quot_0_01, Rem_0_01);
- if Quot_0_01 /= DT_0_01(0.06) or Rem_0_01 /= DT_0_01(0.0) then
- Report.Failed("Incorrect values returned, Case 40");
- end if;
- end;
-
- declare
- procedure Div is
- new Ada.Decimal.Divide(DT_0_0001, DT_1, DT_0_0001, DT_0_0001);
- begin
- if TC_Verbose then Report.Comment("Case 41"); end if;
- Dd_0_0001 := (DT_0_0001(6062.0) / DT_0_0001(16384.0));
- Dv_1 := DT_1(0.0);
- Div(Dd_0_0001, Dv_1, Quot_0_0001, Rem_0_0001);
- Report.Failed("Divide by Zero didn't raise Constraint_Error, " &
- "Case 41");
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised by Divide by Zero," &
- "Case 41");
- end;
-
- exception
- when others => Report.Failed("Exception raised in Radix_10_Block");
- end Radix_2_Block;
-
-
- Report.Result;
-
-end CXF2001;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf2002.a b/gcc/testsuite/ada/acats/tests/cxf/cxf2002.a
deleted file mode 100644
index 984daa97bca..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf2002.a
+++ /dev/null
@@ -1,352 +0,0 @@
--- CXF2002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the multiplying operators for a decimal fixed point type
--- return values that are integral multiples of the small of the type.
--- Check the case where the operand and result types are the same.
---
--- Check that if the mathematical result is between multiples of the
--- small of the result type, the result is truncated toward zero.
--- Check that if the attribute 'Round is applied to the mathematical
--- result, however, the result is rounded to the nearest multiple of
--- the small (away from zero if the result is midway between two
--- multiples of the small).
---
--- TEST DESCRIPTION:
--- Two decimal fixed point types are declared, one with a Machine_Radix
--- value of 2, and one with a value of 10. For each type, checks are
--- performed on the following operations, where the operand and result
--- types are the same:
---
--- - Multiplication.
--- - Multiplication, where the attribute 'Round is applied to the
--- result.
--- - Division.
--- - Division, where the attribute 'Round is applied to the result.
---
--- Each operation is performed within a loop, where one operand is
--- always the same variable. After the loop completes, the cumulative
--- total contained in this variable is compared with the expected
--- result.
---
--- APPLICABILITY CRITERIA:
--- This test is only applicable for a compiler attempting validation
--- for the Information Systems Annex.
---
---
--- CHANGE HISTORY:
--- 27 Mar 96 SAIC Prerelease version for ACVC 2.1.
---
---!
-
-generic
- type Decimal_Fixed is delta <> digits <>;
-package CXF2002_0 is
-
- procedure Multiply_And_Truncate (Balance : in out Decimal_Fixed;
- Factor : in Decimal_Fixed);
-
- procedure Divide_And_Truncate (Balance : in out Decimal_Fixed;
- Divisor : in Decimal_Fixed);
-
- procedure Multiply_And_Round (Balance : in out Decimal_Fixed;
- Factor : in Decimal_Fixed);
-
- procedure Divide_And_Round (Balance : in out Decimal_Fixed;
- Divisor : in Decimal_Fixed);
-
-end CXF2002_0;
-
-
- --==================================================================--
-
-
-package body CXF2002_0 is
-
- procedure Multiply_And_Truncate (Balance : in out Decimal_Fixed;
- Factor : in Decimal_Fixed) is
- Interest : Decimal_Fixed;
- begin
- Interest := Factor * Balance; -- Fixed-fixed multiplication.
- Balance := Balance + Interest;
- end Multiply_And_Truncate;
-
-
- procedure Divide_And_Truncate (Balance : in out Decimal_Fixed;
- Divisor : in Decimal_Fixed) is
- Interest : Decimal_Fixed;
- begin
- Interest := Balance / Divisor; -- Fixed-fixed division.
- Balance := Balance + Interest;
- end Divide_And_Truncate;
-
-
- procedure Multiply_And_Round (Balance : in out Decimal_Fixed;
- Factor : in Decimal_Fixed) is
- Interest : Decimal_Fixed;
- begin
- -- Fixed-fixed multiplication.
- Interest := Decimal_Fixed'Round ( Factor * Balance );
- Balance := Balance + Interest;
- end Multiply_And_Round;
-
-
- procedure Divide_And_Round (Balance : in out Decimal_Fixed;
- Divisor : in Decimal_Fixed) is
- Interest : Decimal_Fixed;
- begin
- -- Fixed-fixed division.
- Interest := Decimal_Fixed'Round ( Balance / Divisor );
- Balance := Balance + Interest;
- end Divide_And_Round;
-
-end CXF2002_0;
-
-
- --==================================================================--
-
-
-package CXF2002_1 is
-
- type Money_Radix2 is delta 0.01 digits 11; -- range -999,999,999.99 ..
- for Money_Radix2'Machine_Radix use 2; -- +999,999,999.99
-
-
- type Money_Radix10 is delta 0.01 digits 11; -- range -999,999,999.99 ..
- for Money_Radix10'Machine_Radix use 10; -- +999,999,999.99
-
-end CXF2002_1;
-
-
- --==================================================================--
-
-
-with CXF2002_0;
-with CXF2002_1;
-
-with Report;
-procedure CXF2002 is
-
- Loop_Count : constant := 300;
- type Loop_Range is range 1 .. Loop_Count;
-
-begin
-
- Report.Test ("CXF2002", "Check decimal multiplication and division, and " &
- "'Round, where the operand and result types are " &
- "the same");
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- RADIX_2_SUBTESTS:
- declare
- package Radix_2 is new CXF2002_0 (CXF2002_1.Money_Radix2);
- use type CXF2002_1.Money_Radix2;
- begin
-
- RADIX_2_MULTIPLICATION:
- declare
- Rate : constant CXF2002_1.Money_Radix2 := 0.12;
- Period : constant Integer := 12;
- Factor : CXF2002_1.Money_Radix2 := Rate / Period;
-
- Initial : constant CXF2002_1.Money_Radix2 := 100_000.00;
- Trunc_Expected : constant CXF2002_1.Money_Radix2 := 1_978_837.50;
- Round_Expected : constant CXF2002_1.Money_Radix2 := 1_978_846.75;
-
- Balance : CXF2002_1.Money_Radix2;
- begin
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_2.Multiply_And_Truncate (Balance, Factor);
- end loop;
-
- if Balance /= Trunc_Expected then
- Report.Failed ("Wrong result: Radix 2 multiply and truncate");
- end if;
-
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_2.Multiply_And_Round (Balance, Factor);
- end loop;
-
- if Balance /= Round_Expected then
- Report.Failed ("Wrong result: Radix 2 multiply and round");
- end if;
-
- ---=---=---=---=---=---=---
- end RADIX_2_MULTIPLICATION;
-
-
- RADIX_2_DIVISION:
- declare
- Rate : constant CXF2002_1.Money_Radix2 := 0.25;
- Period : constant Integer := 12;
- Factor : CXF2002_1.Money_Radix2 := Rate / Period;
- Divisor : constant CXF2002_1.Money_Radix2 := 1.0 / Factor;
-
- Initial : constant CXF2002_1.Money_Radix2 := 5_500.36;
- Trunc_Expected : constant CXF2002_1.Money_Radix2 := 2_091_332.87;
- Round_Expected : constant CXF2002_1.Money_Radix2 := 2_091_436.88;
-
- Balance : CXF2002_1.Money_Radix2;
- begin
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_2.Divide_And_Truncate (Balance, Divisor);
- end loop;
-
- if Balance /= Trunc_Expected then
- Report.Failed ("Wrong result: Radix 2 divide and truncate");
- end if;
-
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_2.Divide_And_Round (Balance, Divisor);
- end loop;
-
- if Balance /= Round_Expected then
- Report.Failed ("Wrong result: Radix 2 divide and round");
- end if;
-
- ---=---=---=---=---=---=---
- end RADIX_2_DIVISION;
-
- end RADIX_2_SUBTESTS;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- RADIX_10_SUBTESTS:
- declare
- package Radix_10 is new CXF2002_0 (CXF2002_1.Money_Radix10);
- use type CXF2002_1.Money_Radix10;
- begin
-
- RADIX_10_MULTIPLICATION:
- declare
- Rate : constant CXF2002_1.Money_Radix10 := 0.37;
- Period : constant Integer := 12;
- Factor : CXF2002_1.Money_Radix10 := Rate / Period;
-
- Initial : constant CXF2002_1.Money_Radix10 := 459.33;
- Trunc_Expected : constant CXF2002_1.Money_Radix10 := 3_259_305.54;
- Round_Expected : constant CXF2002_1.Money_Radix10 := 3_260_544.11;
-
- Balance : CXF2002_1.Money_Radix10;
- begin
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_10.Multiply_And_Truncate (Balance, Factor);
- end loop;
-
- if Balance /= Trunc_Expected then
- Report.Failed ("Wrong result: Radix 10 multiply and truncate");
- end if;
-
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_10.Multiply_And_Round (Balance, Factor);
- end loop;
-
- if Balance /= Round_Expected then
- Report.Failed ("Wrong result: Radix 10 multiply and round");
- end if;
-
- ---=---=---=---=---=---=---
- end RADIX_10_MULTIPLICATION;
-
-
- RADIX_10_DIVISION:
- declare
- Rate : constant CXF2002_1.Money_Radix10 := 0.15;
- Period : constant Integer := 12;
- Factor : CXF2002_1.Money_Radix10 := Rate / Period;
- Divisor : constant CXF2002_1.Money_Radix10 := 1.0 / Factor;
-
- Initial : constant CXF2002_1.Money_Radix10 := 29_842.08;
- Trunc_Expected : constant CXF2002_1.Money_Radix10 := 590_519.47;
- Round_Expected : constant CXF2002_1.Money_Radix10 := 590_528.98;
-
- Balance : CXF2002_1.Money_Radix10;
- begin
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_10.Divide_And_Truncate (Balance, Divisor);
- end loop;
-
- if Balance /= Trunc_Expected then
- Report.Failed ("Wrong result: Radix 10 divide and truncate");
- end if;
-
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_10.Divide_And_Round (Balance, Divisor);
- end loop;
-
- if Balance /= Round_Expected then
- Report.Failed ("Wrong result: Radix 10 divide and round");
- end if;
-
- ---=---=---=---=---=---=---
- end RADIX_10_DIVISION;
-
- end RADIX_10_SUBTESTS;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- Report.Result;
-
-end CXF2002;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf2003.a b/gcc/testsuite/ada/acats/tests/cxf/cxf2003.a
deleted file mode 100644
index 133dc48e6c2..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf2003.a
+++ /dev/null
@@ -1,363 +0,0 @@
--- CXF2003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the multiplying operators for a decimal fixed point type
--- return values that are integral multiples of the small of the type.
--- Check the case where the two operands are of different decimal
--- fixed point types.
---
--- Check that if the mathematical result is between multiples of the
--- small of the result type, the result is truncated toward zero.
--- Check that if the attribute 'Round is applied to the mathematical
--- result, however, the result is rounded to the nearest multiple of
--- the small (away from zero if the result is midway between two
--- multiples of the small).
---
--- TEST DESCRIPTION:
--- Two decimal fixed point types A and B are declared, one with a
--- Machine_Radix value of 2, and one with a value of 10. A third decimal
--- fixed point type C is declared with digits and delta values different
--- from those of A and B. For type A (and B), checks are performed
--- on the following operations, where one operand type is C, and the
--- other operand type and the result type is A (or B):
---
--- - Multiplication.
--- - Multiplication, where the attribute 'Round is applied to the
--- result.
--- - Division.
--- - Division, where the attribute 'Round is applied to the result.
---
--- Each operation is performed within a loop, where one operand is
--- always the same variable. After the loop completes, the cumulative
--- total contained in this variable is compared with the expected
--- result.
---
--- APPLICABILITY CRITERIA:
--- This test is only applicable for a compiler attempting validation
--- for the Information Systems Annex.
---
---
--- CHANGE HISTORY:
--- 22 Mar 96 SAIC Prerelease version for ACVC 2.1.
---
---!
-
-generic
- type Decimal_Fixed_1 is delta <> digits <>;
- type Decimal_Fixed_2 is delta <> digits <>;
-package CXF2003_0 is
-
- procedure Multiply_And_Truncate (Balance : in out Decimal_Fixed_1;
- Factor : in Decimal_Fixed_2);
-
- procedure Divide_And_Truncate (Balance : in out Decimal_Fixed_1;
- Divisor : in Decimal_Fixed_2);
-
- procedure Multiply_And_Round (Balance : in out Decimal_Fixed_1;
- Factor : in Decimal_Fixed_2);
-
- procedure Divide_And_Round (Balance : in out Decimal_Fixed_1;
- Divisor : in Decimal_Fixed_2);
-
-end CXF2003_0;
-
-
- --==================================================================--
-
-
-package body CXF2003_0 is
-
- procedure Multiply_And_Truncate (Balance : in out Decimal_Fixed_1;
- Factor : in Decimal_Fixed_2) is
- Interest : Decimal_Fixed_1;
- begin
- Interest := Factor * Balance; -- Fixed-fixed multiplication.
- Balance := Balance + Interest;
- end Multiply_And_Truncate;
-
-
- procedure Divide_And_Truncate (Balance : in out Decimal_Fixed_1;
- Divisor : in Decimal_Fixed_2) is
- Interest : Decimal_Fixed_1;
- begin
- Interest := Balance / Divisor; -- Fixed-fixed division.
- Balance := Balance + Interest;
- end Divide_And_Truncate;
-
-
- procedure Multiply_And_Round (Balance : in out Decimal_Fixed_1;
- Factor : in Decimal_Fixed_2) is
- Interest : Decimal_Fixed_1;
- begin
- -- Fixed-fixed multiplication.
- Interest := Decimal_Fixed_1'Round ( Factor * Balance );
- Balance := Balance + Interest;
- end Multiply_And_Round;
-
-
- procedure Divide_And_Round (Balance : in out Decimal_Fixed_1;
- Divisor : in Decimal_Fixed_2) is
- Interest : Decimal_Fixed_1;
- begin
- -- Fixed-fixed division.
- Interest := Decimal_Fixed_1'Round ( Balance / Divisor );
- Balance := Balance + Interest;
- end Divide_And_Round;
-
-end CXF2003_0;
-
-
- --==================================================================--
-
-
-package CXF2003_1 is
-
- type Money_Radix2 is delta 0.01 digits 11; -- range -999,999,999.99 ..
- for Money_Radix2'Machine_Radix use 2; -- +999,999,999.99
-
-
- type Money_Radix10 is delta 0.01 digits 11; -- range -999,999,999.99 ..
- for Money_Radix10'Machine_Radix use 10; -- +999,999,999.99
-
-
- type Interest_Rate is delta 0.00001 digits 9; -- range -9999.99999 ..
- -- +9999.99999
-
-end CXF2003_1;
-
-
- --==================================================================--
-
-
-with CXF2003_0;
-with CXF2003_1;
-
-with Report;
-procedure CXF2003 is
-
- Loop_Count : constant := 1825;
- type Loop_Range is range 1 .. Loop_Count;
-
-begin
-
- Report.Test ("CXF2003", "Check decimal multiplication and division, and " &
- "'Round, where the operand types are different");
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- RADIX_2_SUBTESTS:
- declare
- package Radix_2 is new CXF2003_0 (CXF2003_1.Money_Radix2,
- CXF2003_1.Interest_Rate);
- use type CXF2003_1.Money_Radix2;
- use type CXF2003_1.Interest_Rate;
- begin
-
- RADIX_2_MULTIPLICATION:
- declare
- Rate : CXF2003_1.Interest_Rate := 0.198;
- Period : Integer := 365;
- Factor : CXF2003_1.Interest_Rate := Rate / Period;
-
- Initial : constant CXF2003_1.Money_Radix2 := 1_000.00;
- Trunc_Expected : constant CXF2003_1.Money_Radix2 := 2_662.94;
- Round_Expected : constant CXF2003_1.Money_Radix2 := 2_678.34;
-
- Balance : CXF2003_1.Money_Radix2;
- begin
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_2.Multiply_And_Truncate (Balance, Factor);
- end loop;
-
- if Balance /= Trunc_Expected then
- Report.Failed ("Wrong result: Radix 2 multiply and truncate");
- end if;
-
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_2.Multiply_And_Round (Balance, Factor);
- end loop;
-
- if Balance /= Round_Expected then
- Report.Failed ("Wrong result: Radix 2 multiply and round");
- end if;
-
- ---=---=---=---=---=---=---
- end RADIX_2_MULTIPLICATION;
-
-
- RADIX_2_DIVISION:
- declare
- Rate : CXF2003_1.Interest_Rate := 0.129;
- Period : Integer := 365;
- Factor : CXF2003_1.Interest_Rate := Rate / Period;
- Divisor : CXF2003_1.Interest_Rate := 1.0 / Factor;
-
- Initial : constant CXF2003_1.Money_Radix2 := 14_626.52;
- Trunc_Expected : constant CXF2003_1.Money_Radix2 := 27_688.26;
- Round_Expected : constant CXF2003_1.Money_Radix2 := 27_701.12;
-
- Balance : CXF2003_1.Money_Radix2;
- begin
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_2.Divide_And_Truncate (Balance, Divisor);
- end loop;
-
- if Balance /= Trunc_Expected then
- Report.Failed ("Wrong result: Radix 2 divide and truncate");
- end if;
-
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_2.Divide_And_Round (Balance, Divisor);
- end loop;
-
- if Balance /= Round_Expected then
- Report.Failed ("Wrong result: Radix 2 divide and round");
- end if;
-
- ---=---=---=---=---=---=---
- end RADIX_2_DIVISION;
-
- end RADIX_2_SUBTESTS;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- RADIX_10_SUBTESTS:
- declare
- package Radix_10 is new CXF2003_0 (CXF2003_1.Money_Radix10,
- CXF2003_1.Interest_Rate);
- use type CXF2003_1.Money_Radix10;
- use type CXF2003_1.Interest_Rate;
- begin
-
- RADIX_10_MULTIPLICATION:
- declare
- Rate : CXF2003_1.Interest_Rate := 0.063;
- Period : Integer := 365;
- Factor : CXF2003_1.Interest_Rate := Rate / Period;
-
- Initial : constant CXF2003_1.Money_Radix10 := 314_036.10;
- Trunc_Expected : constant CXF2003_1.Money_Radix10 := 428_249.48;
- Round_Expected : constant CXF2003_1.Money_Radix10 := 428_260.52;
-
- Balance : CXF2003_1.Money_Radix10;
- begin
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_10.Multiply_And_Truncate (Balance, Factor);
- end loop;
-
- if Balance /= Trunc_Expected then
- Report.Failed ("Wrong result: Radix 10 multiply and truncate");
- end if;
-
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_10.Multiply_And_Round (Balance, Factor);
- end loop;
-
- if Balance /= Round_Expected then
- Report.Failed ("Wrong result: Radix 10 multiply and round");
- end if;
-
- ---=---=---=---=---=---=---
- end RADIX_10_MULTIPLICATION;
-
-
- RADIX_10_DIVISION:
- declare
- Rate : CXF2003_1.Interest_Rate := 0.273;
- Period : Integer := 365;
- Factor : CXF2003_1.Interest_Rate := Rate / Period;
- Divisor : CXF2003_1.Interest_Rate := 1.0 / Factor;
-
- Initial : constant CXF2003_1.Money_Radix10 := 25.72;
- Trunc_Expected : constant CXF2003_1.Money_Radix10 := 79.05;
- Round_Expected : constant CXF2003_1.Money_Radix10 := 97.46;
-
- Balance : CXF2003_1.Money_Radix10;
- begin
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_10.Divide_And_Truncate (Balance, Divisor);
- end loop;
-
- if Balance /= Trunc_Expected then
- Report.Failed ("Wrong result: Radix 10 divide and truncate");
- end if;
-
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_10.Divide_And_Round (Balance, Divisor);
- end loop;
-
- if Balance /= Round_Expected then
- Report.Failed ("Wrong result: Radix 10 divide and round");
- end if;
-
- ---=---=---=---=---=---=---
- end RADIX_10_DIVISION;
-
- end RADIX_10_SUBTESTS;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- Report.Result;
-
-end CXF2003;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf2004.a b/gcc/testsuite/ada/acats/tests/cxf/cxf2004.a
deleted file mode 100644
index 9651384ce7e..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf2004.a
+++ /dev/null
@@ -1,513 +0,0 @@
--- CXF2004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the multiplying operators for a decimal fixed point type
--- return values that are integral multiples of the small of the type.
--- Check the case where one operand is of an ordinary fixed point type.
---
--- Check that if the mathematical result is between multiples of the
--- small of the result type, the result is truncated toward zero.
--- Check that if the attribute 'Round is applied to the mathematical
--- result, however, the result is rounded to the nearest multiple of
--- the small (away from zero if the result is midway between two
--- multiples of the small).
---
--- TEST DESCRIPTION:
--- Two decimal fixed point types A and B are declared, one with a
--- Machine_Radix value of 2, and one with a value of 10. An ordinary
--- fixed point type C is declared with a delta value different from
--- those of A and B (although still a power of 10). For type A (and B),
--- checks are performed on the following operations, where one operand
--- type is C, and the other operand type and the result type is A (or B):
---
--- - Multiplication.
--- - Multiplication, where the attribute 'Round is applied to the
--- result.
--- - Division.
--- - Division, where the attribute 'Round is applied to the result.
---
--- Each operation is performed within a loop, where one operand is
--- always the same variable. After the loop completes, the cumulative
--- total contained in this variable is compared with the expected
--- result.
---
--- APPLICABILITY CRITERIA:
--- This test is only applicable for a compiler attempting validation
--- for the Information Systems Annex.
---
---
--- CHANGE HISTORY:
--- 22 Mar 96 SAIC Prerelease version for ACVC 2.1.
--- 11 Aug 96 SAIC ACVC 2.1: In RADIX_2_MULTIPLICATION, corrected
--- value of Rate. Corrected associated commentary.
---
---!
-
-generic
- type Decimal_Fixed is delta <> digits <>;
- type Ordinary_Fixed is delta <>;
-package CXF2004_0 is
-
- procedure Multiply_And_Truncate (Balance : in out Decimal_Fixed;
- Factor : in Ordinary_Fixed);
-
- procedure Divide_And_Truncate (Balance : in out Decimal_Fixed;
- Divisor : in Ordinary_Fixed);
-
- procedure Multiply_And_Round (Balance : in out Decimal_Fixed;
- Factor : in Ordinary_Fixed);
-
- procedure Divide_And_Round (Balance : in out Decimal_Fixed;
- Divisor : in Ordinary_Fixed);
-
-end CXF2004_0;
-
-
- --==================================================================--
-
-
-package body CXF2004_0 is
-
- procedure Multiply_And_Truncate (Balance : in out Decimal_Fixed;
- Factor : in Ordinary_Fixed) is
- Interest : Decimal_Fixed;
- begin
- Interest := Factor * Balance; -- Fixed-fixed multiplication.
- Balance := Balance + Interest;
- end Multiply_And_Truncate;
-
-
- procedure Divide_And_Truncate (Balance : in out Decimal_Fixed;
- Divisor : in Ordinary_Fixed) is
- Interest : Decimal_Fixed;
- begin
- Interest := Balance / Divisor; -- Fixed-fixed division.
- Balance := Balance + Interest;
- end Divide_And_Truncate;
-
-
- procedure Multiply_And_Round (Balance : in out Decimal_Fixed;
- Factor : in Ordinary_Fixed) is
- Interest : Decimal_Fixed;
- begin
- -- Fixed-fixed multiplication.
- Interest := Decimal_Fixed'Round ( Factor * Balance );
- Balance := Balance + Interest;
- end Multiply_And_Round;
-
-
- procedure Divide_And_Round (Balance : in out Decimal_Fixed;
- Divisor : in Ordinary_Fixed) is
- Interest : Decimal_Fixed;
- begin
- -- Fixed-fixed division.
- Interest := Decimal_Fixed'Round ( Balance / Divisor );
- Balance := Balance + Interest;
- end Divide_And_Round;
-
-end CXF2004_0;
-
-
- --==================================================================--
-
-
-package CXF2004_1 is
-
- type Money_Radix2 is delta 0.01 digits 11; -- range -999,999,999.99 ..
- for Money_Radix2'Machine_Radix use 2; -- +999,999,999.99
-
-
- type Money_Radix10 is delta 0.01 digits 11; -- range -999,999,999.99 ..
- for Money_Radix10'Machine_Radix use 10; -- +999,999,999.99
-
-
- type Interest_Rate is delta 0.001 range 0.0 .. 1_000.0;
- for Interest_Rate'Small use 0.001; -- Power of 10.
-
-end CXF2004_1;
-
-
- --==================================================================--
-
-
-with CXF2004_0;
-with CXF2004_1;
-
-with Report;
-procedure CXF2004 is
-
- Loop_Count : constant := 180;
- type Loop_Range is range 1 .. Loop_Count;
-
- type Rounding_Scheme is ( Rounds, Truncates );
- Machine : Rounding_Scheme;
-
-begin
-
- Report.Test ("CXF2004", "Check decimal multiplication and division, and " &
- "'Round, where one operand type is ordinary fixed");
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- if CXF2004_1.Interest_Rate'Machine_Rounds then -- Determine machine's
- Machine := Rounds; -- rounding scheme.
- else
- Machine := Truncates;
- end if;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- RADIX_2_SUBTESTS:
- declare
- package Radix_2 is new CXF2004_0 (CXF2004_1.Money_Radix2,
- CXF2004_1.Interest_Rate);
- use type CXF2004_1.Money_Radix2;
- use type CXF2004_1.Interest_Rate;
- begin
-
- RADIX_2_MULTIPLICATION:
- declare
- Rate : constant CXF2004_1.Interest_Rate := 0.154;
- Period : constant Integer := 12;
- Factor : CXF2004_1.Interest_Rate := Rate / Period;
-
- -- The exact value of Factor is:
- --
- -- 0.154/12 = 0.01283333...
- --
- -- The adjacent multiples of small are 0.012 and 0.013. Since
- -- Factor is of an ordinary fixed point type, it may contain either
- -- of these values. However, since "Rate / Period" is a static
- -- expression, the value Factor contains is determined by the
- -- value of CXF2004_1.Interest_Rate'Machine_Rounds:
- --
- -- If Machine_Rounds = FALSE : Factor = 0.012
- -- If Machine_Rounds = TRUE : Factor = 0.013
-
- Initial : constant CXF2004_1.Money_Radix2 := 1_000.00;
-
- Trunc_Expected_MachTrnc: constant CXF2004_1.Money_Radix2 := 8_557.07;
- Round_Expected_MachTrnc: constant CXF2004_1.Money_Radix2 := 8_560.47;
-
- Trunc_Expected_MachRnds: constant CXF2004_1.Money_Radix2 := 10_222.65;
- Round_Expected_MachRnds: constant CXF2004_1.Money_Radix2 := 10_225.81;
-
- Balance : CXF2004_1.Money_Radix2;
- begin
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_2.Multiply_And_Truncate (Balance, Factor);
- end loop;
-
- case (Machine) is
- when Rounds =>
- if Balance /= Trunc_Expected_MachRnds then
- Report.Failed ("Error (R): Radix 2 multiply and truncate");
- end if;
- when Truncates =>
- if Balance /= Trunc_Expected_MachTrnc then
- Report.Failed ("Error (T): Radix 2 multiply and truncate");
- end if;
- end case;
-
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_2.Multiply_And_Round (Balance, Factor);
- end loop;
-
- case (Machine) is
- when Rounds =>
- if Balance /= Round_Expected_MachRnds then
- Report.Failed ("Error (R): Radix 2 multiply and round");
- end if;
- when Truncates =>
- if Balance /= Round_Expected_MachTrnc then
- Report.Failed ("Error (T): Radix 2 multiply and round");
- end if;
- end case;
-
- ---=---=---=---=---=---=---
- end RADIX_2_MULTIPLICATION;
-
-
- RADIX_2_DIVISION:
- declare
- Rate : constant CXF2004_1.Interest_Rate := 0.210;
- Period : constant Integer := 12;
- Factor : constant CXF2004_1.Interest_Rate := Rate / Period;
- Divisor : CXF2004_1.Interest_Rate := 1.0 / Factor;
-
- -- The exact value of Factor is:
- --
- -- 0.210/12 = 0.0175
- --
- -- The adjacent multiples of small are 0.017 and 0.018. Since
- -- Factor is of an ordinary fixed point type, it may contain either
- -- of these values. However, since "Rate / Period" is a static
- -- expression, the value Factor contains is determined by the
- -- value of CXF2004_1.Interest_Rate'Machine_Rounds:
- --
- -- If Machine_Rounds = FALSE : Factor = 0.017
- -- If Machine_Rounds = TRUE : Factor = 0.018
- --
- -- The exact value of Divisor is one of the following values:
- --
- -- 1.0/0.017 = 58.82352... (Adjacent smalls 58.823 and 58.824)
- -- 1.0/0.018 = 55.55555... (Adjacent smalls 55.555 and 55.556)
- --
- -- Again, since "1.0 / Factor" is static, the value Divisor contains
- -- is determined by the value of CXF2004_1.Interest_Rate'Rounds:
- --
- -- If Machine_Rounds = FALSE : Divisor = 58.823
- -- If Machine_Rounds = TRUE : Divisor = 55.556
-
- Initial : constant CXF2004_1.Money_Radix2 := 260.13;
-
- Trunc_Expected_MachTrnc: constant CXF2004_1.Money_Radix2 := 5_401.46;
- Round_Expected_MachTrnc: constant CXF2004_1.Money_Radix2 := 5_406.95;
-
- Trunc_Expected_MachRnds: constant CXF2004_1.Money_Radix2 := 6_446.56;
- Round_Expected_MachRnds: constant CXF2004_1.Money_Radix2 := 6_453.78;
-
- Balance : CXF2004_1.Money_Radix2;
- begin
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_2.Divide_And_Truncate (Balance, Divisor);
- end loop;
-
- case (Machine) is
- when Rounds =>
- if Balance /= Trunc_Expected_MachRnds then
- Report.Failed ("Error (R): Radix 2 divide and truncate");
- end if;
- when Truncates =>
- if Balance /= Trunc_Expected_MachTrnc then
- Report.Failed ("Error (T): Radix 2 divide and truncate");
- end if;
- end case;
-
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_2.Divide_And_Round (Balance, Divisor);
- end loop;
-
- case (Machine) is
- when Rounds =>
- if Balance /= Round_Expected_MachRnds then
- Report.Failed ("Error (R): Radix 2 divide and round");
- end if;
- when Truncates =>
- if Balance /= Round_Expected_MachTrnc then
- Report.Failed ("Error (T): Radix 2 divide and round");
- end if;
- end case;
-
- ---=---=---=---=---=---=---
- end RADIX_2_DIVISION;
-
- end RADIX_2_SUBTESTS;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- RADIX_10_SUBTESTS:
- declare
- package Radix_10 is new CXF2004_0 (CXF2004_1.Money_Radix10,
- CXF2004_1.Interest_Rate);
- use type CXF2004_1.Money_Radix10;
- use type CXF2004_1.Interest_Rate;
- begin
-
- RADIX_10_MULTIPLICATION:
- declare
- Rate : constant CXF2004_1.Interest_Rate := 0.095;
- Period : constant Integer := 12;
- Factor : CXF2004_1.Interest_Rate := Rate / Period;
-
- -- The exact value of Factor is:
- --
- -- 0.095/12 = 0.00791666...
- --
- -- The adjacent multiples of small are 0.007 and 0.008. Since
- -- Factor is of an ordinary fixed point type, it may contain either
- -- of these values. However, since "Rate / Period" is a static
- -- expression, the value Factor contains can be determined based
- -- on the value of CXF2004_1.Interest_Rate'Machine_Rounds:
- --
- -- If Machine_Rounds = FALSE : Factor = 0.007
- -- If Machine_Rounds = TRUE : Factor = 0.008
-
- Initial : constant CXF2004_1.Money_Radix10 := 2_125.00;
-
- Trunc_Expected_MachTrnc: constant CXF2004_1.Money_Radix10 := 7_456.90;
- Round_Expected_MachTrnc: constant CXF2004_1.Money_Radix10 := 7_458.77;
-
- Trunc_Expected_MachRnds: constant CXF2004_1.Money_Radix10 := 8_915.74;
- Round_Expected_MachRnds: constant CXF2004_1.Money_Radix10 := 8_917.84;
-
- Balance : CXF2004_1.Money_Radix10;
- begin
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_10.Multiply_And_Truncate (Balance, Factor);
- end loop;
-
- case (Machine) is
- when Rounds =>
- if Balance /= Trunc_Expected_MachRnds then
- Report.Failed ("Error (R): Radix 10 multiply and truncate");
- end if;
- when Truncates =>
- if Balance /= Trunc_Expected_MachTrnc then
- Report.Failed ("Error (T): Radix 10 multiply and truncate");
- end if;
- end case;
-
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_10.Multiply_And_Round (Balance, Factor);
- end loop;
-
- case (Machine) is
- when Rounds =>
- if Balance /= Round_Expected_MachRnds then
- Report.Failed ("Error (R): Radix 10 multiply and round");
- end if;
- when Truncates =>
- if Balance /= Round_Expected_MachTrnc then
- Report.Failed ("Error (T): Radix 10 multiply and round");
- end if;
- end case;
-
- ---=---=---=---=---=---=---
- end RADIX_10_MULTIPLICATION;
-
-
- RADIX_10_DIVISION:
- declare
- Rate : constant CXF2004_1.Interest_Rate := 0.295;
- Period : constant Integer := 12;
- Factor : constant CXF2004_1.Interest_Rate := Rate / Period;
- Divisor : CXF2004_1.Interest_Rate := 1.0 / Factor;
-
- -- The exact value of Factor is:
- --
- -- 0.295/12 = 0.02458333...
- --
- -- The adjacent multiples of small are 0.024 and 0.025. Thus, the
- -- exact value of Divisor is one of the following:
- --
- -- 1.0/0.024 = 41.66666... (Adjacent smalls 41.666 and 41.667)
- -- 1.0/0.025 = 40.0
- --
- -- The value of CXF2004_1.Interest_Rate'Machine_Rounds determines
- -- what Divisor contains:
- --
- -- If Machine_Rounds = FALSE : Divisor = 41.666
- -- If Machine_Rounds = TRUE : Divisor = 40.000
-
- Initial : constant CXF2004_1.Money_Radix10 := 72.19;
-
- Trunc_Expected_MachTrnc: constant CXF2004_1.Money_Radix10 := 5_144.60;
- Round_Expected_MachTrnc: constant CXF2004_1.Money_Radix10 := 5_157.80;
-
- Trunc_Expected_MachRnds: constant CXF2004_1.Money_Radix10 := 6_133.28;
- Round_Expected_MachRnds: constant CXF2004_1.Money_Radix10 := 6_149.06;
-
- Balance : CXF2004_1.Money_Radix10;
- begin
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_10.Divide_And_Truncate (Balance, Divisor);
- end loop;
-
- case (Machine) is
- when Rounds =>
- if Balance /= Trunc_Expected_MachRnds then
- Report.Failed ("Error (R): Radix 10 divide and truncate");
- end if;
- when Truncates =>
- if Balance /= Trunc_Expected_MachTrnc then
- Report.Failed ("Error (T): Radix 10 divide and truncate");
- end if;
- end case;
-
- ---=---=---=---=---=---=---
-
- Balance := Initial;
-
- for I in Loop_Range loop
- Radix_10.Divide_And_Round (Balance, Divisor);
- end loop;
-
- case (Machine) is
- when Rounds =>
- if Balance /= Round_Expected_MachRnds then
- Report.Failed ("Error (R): Radix 10 divide and round");
- end if;
- when Truncates =>
- if Balance /= Round_Expected_MachTrnc then
- Report.Failed ("Error (T): Radix 10 divide and round");
- end if;
- end case;
-
- ---=---=---=---=---=---=---
- end RADIX_10_DIVISION;
-
- end RADIX_10_SUBTESTS;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- Report.Result;
-
-end CXF2004;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf2005.a b/gcc/testsuite/ada/acats/tests/cxf/cxf2005.a
deleted file mode 100644
index 71cd5bb31b5..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf2005.a
+++ /dev/null
@@ -1,293 +0,0 @@
--- CXF2005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the multiplying operators for a decimal fixed point type
--- return values that are integral multiples of the small of the type.
--- Check the case where one operand is of the predefined type Integer.
---
--- TEST DESCRIPTION:
--- Two decimal fixed point types A and B are declared, one with a
--- Machine_Radix value of 2, and one with a value of 10. A variable of
--- each type is multiplied repeatedly by a series of different Integer
--- values. A cumulative result is kept and compared to an expected
--- final result. Similar checks are performed for division.
---
--- APPLICABILITY CRITERIA:
--- This test is only applicable for a compiler attempting validation
--- for the Information Systems Annex.
---
---
--- CHANGE HISTORY:
--- 28 Mar 96 SAIC Prerelease version for ACVC 2.1.
---
---!
-
-generic
- type Decimal_Fixed is delta <> digits <>;
-package CXF2005_0 is
-
- function Multiply (Operand : Decimal_Fixed;
- Interval : Integer) return Decimal_Fixed;
-
- function Divide (Operand : Decimal_Fixed;
- Interval : Integer) return Decimal_Fixed;
-
-end CXF2005_0;
-
-
- --==================================================================--
-
-
-package body CXF2005_0 is
-
- function Multiply (Operand : Decimal_Fixed;
- Interval : Integer) return Decimal_Fixed is
- begin
- return Operand * Interval; -- Fixed-Integer multiplication.
- end Multiply;
-
-
- function Divide (Operand : Decimal_Fixed;
- Interval : Integer) return Decimal_Fixed is
- begin
- return Operand / Interval; -- Fixed-Integer division.
- end Divide;
-
-end CXF2005_0;
-
-
- --==================================================================--
-
-
-package CXF2005_1 is
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Interest_Rate is delta 0.001 range 0.0 .. 1_000.0;
- for Interest_Rate'Small use 0.001; -- Power of 10.
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Money_Radix2 is delta 0.01 digits 11; -- range -999,999,999.99 ..
- for Money_Radix2'Machine_Radix use 2; -- +999,999,999.99
-
- function Factor (Rate : Interest_Rate;
- Interval : Integer) return Money_Radix2;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Money_Radix10 is delta 0.01 digits 11; -- range -999,999,999.99 ..
- for Money_Radix10'Machine_Radix use 10; -- +999,999,999.99
-
- function Factor (Rate : Interest_Rate;
- Interval : Integer) return Money_Radix10;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-end CXF2005_1;
-
-
- --==================================================================--
-
-
-package body CXF2005_1 is
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- function Factor (Rate : Interest_Rate;
- Interval : Integer) return Money_Radix2 is
- begin
- return Money_Radix2( Rate / Interval );
- end Factor;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- function Factor (Rate : Interest_Rate;
- Interval : Integer) return Money_Radix10 is
- begin
- return Money_Radix10( Rate / Interval );
- end Factor;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-end CXF2005_1;
-
-
- --==================================================================--
-
-
-with CXF2005_0;
-with CXF2005_1;
-
-with Report;
-procedure CXF2005 is
-
- Loop_Count : constant := 25_000;
- type Loop_Range is range 1 .. Loop_Count;
-
-begin
-
- Report.Test ("CXF2005", "Check decimal multiplication and division, " &
- "where one operand type is Integer");
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- RADIX_2_SUBTESTS:
- declare
- package Radix_2 is new CXF2005_0 (CXF2005_1.Money_Radix2);
- use type CXF2005_1.Money_Radix2;
- begin
-
- RADIX_2_MULTIPLICATION:
- declare
- Rate : constant CXF2005_1.Interest_Rate := 0.127;
- Period : constant Integer := 12;
-
- Expected : constant CXF2005_1.Money_Radix2 := 2_624.88;
- Balance : CXF2005_1.Money_Radix2 := 1_000.00;
-
- Operand : CXF2005_1.Money_Radix2;
- Increment : CXF2005_1.Money_Radix2;
- Interval : Integer;
- begin
-
- for I in Loop_Range loop
- Interval := (Integer(I) mod Period) + 1; -- Range from 1 to 12.
- Operand := CXF2005_1.Factor (Rate, Period);
- Increment := Radix_2.Multiply (Operand, Interval);
- Balance := Balance + Increment;
- end loop;
-
- if Balance /= Expected then
- Report.Failed ("Error: Radix 2 multiply");
- end if;
-
- end RADIX_2_MULTIPLICATION;
-
-
-
- RADIX_2_DIVISION:
- declare
- Rate : constant CXF2005_1.Interest_Rate := 0.377;
- Period : constant Integer := 12;
-
- Expected : constant CXF2005_1.Money_Radix2 := 36_215.58;
- Balance : CXF2005_1.Money_Radix2 := 456_985.01;
-
- Operand : CXF2005_1.Money_Radix2;
- Increment : CXF2005_1.Money_Radix2;
- Interval : Integer;
- begin
-
- for I in Loop_Range loop
- Interval := (Integer(I+1000) mod (200*Period)) + 1; -- 1 .. 2400.
- Operand := CXF2005_1.Factor (Rate, Period);
- Increment := Radix_2.Divide (Balance, Interval);
- Balance := Balance - (Operand * Increment);
- end loop;
-
- if Balance /= Expected then
- Report.Failed ("Error: Radix 2 divide");
- end if;
-
- end RADIX_2_DIVISION;
-
- end RADIX_2_SUBTESTS;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- RADIX_10_SUBTESTS:
- declare
- package Radix_10 is new CXF2005_0 (CXF2005_1.Money_Radix10);
- use type CXF2005_1.Money_Radix10;
- begin
-
- RADIX_10_MULTIPLICATION:
- declare
- Rate : constant CXF2005_1.Interest_Rate := 0.721;
- Period : constant Integer := 12;
-
- Expected : constant CXF2005_1.Money_Radix10 := 9_875.62;
- Balance : CXF2005_1.Money_Radix10 := 126.34;
-
- Operand : CXF2005_1.Money_Radix10;
- Increment : CXF2005_1.Money_Radix10;
- Interval : Integer;
- begin
-
- for I in Loop_Range loop
- Interval := (Integer(I) mod Period) + 1; -- Range from 1 to 12.
- Operand := CXF2005_1.Factor (Rate, Period);
- Increment := Radix_10.Multiply (Operand, Interval);
- Balance := Balance + Increment;
- end loop;
-
- if Balance /= Expected then
- Report.Failed ("Error: Radix 10 multiply");
- end if;
-
- end RADIX_10_MULTIPLICATION;
-
-
- RADIX_10_DIVISION:
- declare
- Rate : constant CXF2005_1.Interest_Rate := 0.547;
- Period : constant Integer := 12;
-
- Expected : constant CXF2005_1.Money_Radix10 := 26_116.37;
- Balance : CXF2005_1.Money_Radix10 := 770_082.46;
-
- Operand : CXF2005_1.Money_Radix10;
- Increment : CXF2005_1.Money_Radix10;
- Interval : Integer;
- begin
-
- for I in Loop_Range loop
- Interval := (Integer(I+1000) mod (200*Period)) + 1; -- 1 .. 2400.
- Operand := CXF2005_1.Factor (Rate, Period);
- Increment := Radix_10.Divide (Balance, Interval);
- Balance := Balance - (Operand * Increment);
- end loop;
-
- if Balance /= Expected then
- Report.Failed ("Error: Radix 10 divide");
- end if;
-
- end RADIX_10_DIVISION;
-
- end RADIX_10_SUBTESTS;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- Report.Result;
-
-end CXF2005;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf2a01.a b/gcc/testsuite/ada/acats/tests/cxf/cxf2a01.a
deleted file mode 100644
index 002c59d6c8e..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf2a01.a
+++ /dev/null
@@ -1,448 +0,0 @@
--- CXF2A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the binary adding operators for a decimal fixed point type
--- return values that are integral multiples of the small of the type.
---
--- TEST DESCRIPTION:
--- The test verifies that decimal addition and subtraction behave as
--- expected for types with various digits, delta, and Machine_Radix
--- values. Types with the minimum values for Decimal.Max_Digits and
--- Decimal.Max_Scale (18) are included.
---
--- Two kinds of checks are performed for each type. In the first check,
--- the iteration, operation, and operand counts in the foundation and
--- the operation tables in this test are given values such that, when the
--- operations loop is complete, each operand will have been added to and
--- subtracted from the loop's cumulator variable the same number of times,
--- albeit in varying order. Thus, the result returned by the operations
--- loop should have the same value as that used to initialize the
--- cumulator (in this test, zero).
---
--- In the second check, the same operation (addition for some types and
--- subtraction for others) is performed during each loop iteration,
--- resulting in a cumulative total which is checked against an expected
--- value.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXF2A00.A
--- -> CXF2A01.A
---
--- APPLICABILITY CRITERIA:
--- This test is only applicable for a compiler attempting validation
--- for the Information Systems Annex.
---
---
--- CHANGE HISTORY:
--- 08 Apr 96 SAIC Prerelease version for ACVC 2.1.
---
---!
-
-package CXF2A01_0 is
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Micro is delta 10.0**(-18) digits 18; -- range -0.999999999999999999 ..
- for Micro'Machine_Radix use 10; -- +0.999999999999999999
-
- function Add (Left, Right : Micro) return Micro;
- function Subtract (Left, Right : Micro) return Micro;
-
-
- type Micro_Optr_Ptr is access function (Left, Right : Micro) return Micro;
-
- Micro_Add : Micro_Optr_Ptr := Add'Access;
- Micro_Sub : Micro_Optr_Ptr := Subtract'Access;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Money is delta 0.01 digits 11; -- range -999,999,999.99 ..
- for Money'Machine_Radix use 2; -- +999,999,999.99
-
- function Add (Left, Right : Money) return Money;
- function Subtract (Left, Right : Money) return Money;
-
-
- type Money_Optr_Ptr is access function (Left, Right : Money) return Money;
-
- Money_Add : Money_Optr_Ptr := Add'Access;
- Money_Sub : Money_Optr_Ptr := Subtract'Access;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- -- Same as Money, but with Radix 10:
-
- type Cash is delta 0.01 digits 11; -- range -999,999,999.99 ..
- for Cash'Machine_Radix use 10; -- +999,999,999.99
-
- function Add (Left, Right : Cash) return Cash;
- function Subtract (Left, Right : Cash) return Cash;
-
-
- type Cash_Optr_Ptr is access function (Left, Right : Cash) return Cash;
-
- Cash_Add : Cash_Optr_Ptr := Add'Access;
- Cash_Sub : Cash_Optr_Ptr := Subtract'Access;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Broad is delta 10.0**(-9) digits 18; -- range -999,999,999.999999999 ..
- for Broad'Machine_Radix use 10; -- +999,999,999.999999999
-
- function Add (Left, Right : Broad) return Broad;
- function Subtract (Left, Right : Broad) return Broad;
-
-
- type Broad_Optr_Ptr is access function (Left, Right : Broad) return Broad;
-
- Broad_Add : Broad_Optr_Ptr := Add'Access;
- Broad_Sub : Broad_Optr_Ptr := Subtract'Access;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-end CXF2A01_0;
-
-
- --==================================================================--
-
-
-package body CXF2A01_0 is
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- function Add (Left, Right : Micro) return Micro is
- begin
- return (Left + Right); -- Decimal fixed addition.
- end Add;
-
- function Subtract (Left, Right : Micro) return Micro is
- begin
- return (Left - Right); -- Decimal fixed subtraction.
- end Subtract;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- function Add (Left, Right : Money) return Money is
- begin
- return (Left + Right); -- Decimal fixed addition.
- end Add;
-
- function Subtract (Left, Right : Money) return Money is
- begin
- return (Left - Right); -- Decimal fixed subtraction.
- end Subtract;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- function Add (Left, Right : Cash) return Cash is
- begin
- return (Left + Right); -- Decimal fixed addition.
- end Add;
-
- function Subtract (Left, Right : Cash) return Cash is
- begin
- return (Left - Right); -- Decimal fixed subtraction.
- end Subtract;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- function Add (Left, Right : Broad) return Broad is
- begin
- return (Left + Right); -- Decimal fixed addition.
- end Add;
-
- function Subtract (Left, Right : Broad) return Broad is
- begin
- return (Left - Right); -- Decimal fixed subtraction.
- end Subtract;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-end CXF2A01_0;
-
-
- --==================================================================--
-
-
-with FXF2A00;
-package CXF2A01_0.CXF2A01_1 is
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Micro_Ops is array (FXF2A00.Optr_Range) of Micro_Optr_Ptr;
- type Micro_Opnds is array (FXF2A00.Opnd_Range) of Micro;
-
- Micro_Optr_Table_Cancel : Micro_Ops := ( Micro_Add, Micro_Sub,
- Micro_Add, Micro_Sub,
- Micro_Add, Micro_Sub );
-
- Micro_Optr_Table_Cumul : Micro_Ops := ( others => Micro_Add );
-
- Micro_Opnd_Table_Cancel : Micro_Opnds := ( 0.001025000235111997,
- 0.000000000000000003,
- 0.724902903219925400,
- 0.000459228020000011,
- 0.049832104921096533 );
-
- Micro_Opnd_Table_Cumul : Micro_Opnds := ( 0.000002309540000000,
- 0.000000278060000000,
- 0.000000000000070000,
- 0.000010003000000000,
- 0.000000023090000000 );
-
- function Test_Micro_Ops is new FXF2A00.Operations_Loop
- (Decimal_Fixed => Micro,
- Operator_Ptr => Micro_Optr_Ptr,
- Operator_Table => Micro_Ops,
- Operand_Table => Micro_Opnds);
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Money_Ops is array (FXF2A00.Optr_Range) of Money_Optr_Ptr;
- type Money_Opnds is array (FXF2A00.Opnd_Range) of Money;
-
- Money_Optr_Table_Cancel : Money_Ops := ( Money_Add, Money_Add,
- Money_Sub, Money_Add,
- Money_Sub, Money_Sub );
-
- Money_Optr_Table_Cumul : Money_Ops := ( others => Money_Sub );
-
- Money_Opnd_Table_Cancel : Money_Opnds := ( 127.10,
- 5600.44,
- 0.05,
- 189662.78,
- 226900402.99 );
-
- Money_Opnd_Table_Cumul : Money_Opnds := ( 17.99,
- 500.41,
- 92.78,
- 0.38,
- 2942.99 );
-
- function Test_Money_Ops is new FXF2A00.Operations_Loop
- (Decimal_Fixed => Money,
- Operator_Ptr => Money_Optr_Ptr,
- Operator_Table => Money_Ops,
- Operand_Table => Money_Opnds);
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Cash_Ops is array (FXF2A00.Optr_Range) of Cash_Optr_Ptr;
- type Cash_Opnds is array (FXF2A00.Opnd_Range) of Cash;
-
- Cash_Optr_Table_Cancel : Cash_Ops := ( Cash_Add, Cash_Add,
- Cash_Sub, Cash_Add,
- Cash_Sub, Cash_Sub );
-
- Cash_Optr_Table_Cumul : Cash_Ops := ( others => Cash_Add );
-
- Cash_Opnd_Table_Cancel : Cash_Opnds := ( 127.10,
- 5600.44,
- 0.05,
- 189662.78,
- 226900402.99 );
-
- Cash_Opnd_Table_Cumul : Cash_Opnds := ( 3.33,
- 100056.14,
- 22.87,
- 3901.55,
- 111.21 );
-
- function Test_Cash_Ops is new FXF2A00.Operations_Loop
- (Decimal_Fixed => Cash,
- Operator_Ptr => Cash_Optr_Ptr,
- Operator_Table => Cash_Ops,
- Operand_Table => Cash_Opnds);
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Broad_Ops is array (FXF2A00.Optr_Range) of Broad_Optr_Ptr;
- type Broad_Opnds is array (FXF2A00.Opnd_Range) of Broad;
-
- Broad_Optr_Table_Cancel : Broad_Ops := ( Broad_Sub, Broad_Add,
- Broad_Add, Broad_Sub,
- Broad_Sub, Broad_Add );
-
- Broad_Optr_Table_Cumul : Broad_Ops := ( others => Broad_Sub );
-
- Broad_Opnd_Table_Cancel : Broad_Opnds := ( 1.000009092,
- 732919479.445022293,
- 89662.787000006,
- 660.101010133,
- 1121127.999905594 );
-
- Broad_Opnd_Table_Cumul : Broad_Opnds := ( 12.000450223,
- 479.430320780,
- 0.003492096,
- 8.112888400,
- 1002.994937800 );
-
- function Test_Broad_Ops is new FXF2A00.Operations_Loop
- (Decimal_Fixed => Broad,
- Operator_Ptr => Broad_Optr_Ptr,
- Operator_Table => Broad_Ops,
- Operand_Table => Broad_Opnds);
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-end CXF2A01_0.CXF2A01_1;
-
-
- --==================================================================--
-
-
-with CXF2A01_0.CXF2A01_1;
-
-with Report;
-procedure CXF2A01 is
- package Data renames CXF2A01_0.CXF2A01_1;
-
- use type CXF2A01_0.Micro;
- use type CXF2A01_0.Money;
- use type CXF2A01_0.Cash;
- use type CXF2A01_0.Broad;
-
- Micro_Cancel_Expected : constant CXF2A01_0.Micro := 0.0;
- Money_Cancel_Expected : constant CXF2A01_0.Money := 0.0;
- Cash_Cancel_Expected : constant CXF2A01_0.Cash := 0.0;
- Broad_Cancel_Expected : constant CXF2A01_0.Broad := 0.0;
-
- Micro_Cumul_Expected : constant CXF2A01_0.Micro := 0.075682140420000000;
- Money_Cumul_Expected : constant CXF2A01_0.Money := -21327300.00;
- Cash_Cumul_Expected : constant CXF2A01_0.Cash := 624570600.00;
- Broad_Cumul_Expected : constant CXF2A01_0.Broad := -9015252.535794000;
-
- Micro_Actual : CXF2A01_0.Micro;
- Money_Actual : CXF2A01_0.Money;
- Cash_Actual : CXF2A01_0.Cash;
- Broad_Actual : CXF2A01_0.Broad;
-begin
-
- Report.Test ("CXF2A01", "Check decimal addition and subtraction");
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- Micro_Actual := Data.Test_Micro_Ops (0.0,
- Data.Micro_Optr_Table_Cancel,
- Data.Micro_Opnd_Table_Cancel);
-
- if Micro_Actual /= Micro_Cancel_Expected then
- Report.Failed ("Wrong cancellation result for type Micro");
- end if;
-
- ---=---=---=---=---=---=---
-
-
- Micro_Actual := Data.Test_Micro_Ops (0.0,
- Data.Micro_Optr_Table_Cumul,
- Data.Micro_Opnd_Table_Cumul);
-
- if Micro_Actual /= Micro_Cumul_Expected then
- Report.Failed ("Wrong cumulation result for type Micro");
- end if;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- Money_Actual := Data.Test_Money_Ops (0.0,
- Data.Money_Optr_Table_Cancel,
- Data.Money_Opnd_Table_Cancel);
-
- if Money_Actual /= Money_Cancel_Expected then
- Report.Failed ("Wrong cancellation result for type Money");
- end if;
-
- ---=---=---=---=---=---=---
-
-
- Money_Actual := Data.Test_Money_Ops (0.0,
- Data.Money_Optr_Table_Cumul,
- Data.Money_Opnd_Table_Cumul);
-
- if Money_Actual /= Money_Cumul_Expected then
- Report.Failed ("Wrong cumulation result for type Money");
- end if;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- Cash_Actual := Data.Test_Cash_Ops (0.0,
- Data.Cash_Optr_Table_Cancel,
- Data.Cash_Opnd_Table_Cancel);
-
- if Cash_Actual /= Cash_Cancel_Expected then
- Report.Failed ("Wrong cancellation result for type Cash");
- end if;
-
-
- ---=---=---=---=---=---=---
-
-
- Cash_Actual := Data.Test_Cash_Ops (0.0,
- Data.Cash_Optr_Table_Cumul,
- Data.Cash_Opnd_Table_Cumul);
-
- if Cash_Actual /= Cash_Cumul_Expected then
- Report.Failed ("Wrong cumulation result for type Cash");
- end if;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- Broad_Actual := Data.Test_Broad_Ops (0.0,
- Data.Broad_Optr_Table_Cancel,
- Data.Broad_Opnd_Table_Cancel);
-
- if Broad_Actual /= Broad_Cancel_Expected then
- Report.Failed ("Wrong cancellation result for type Broad");
- end if;
-
-
- ---=---=---=---=---=---=---
-
-
- Broad_Actual := Data.Test_Broad_Ops (0.0,
- Data.Broad_Optr_Table_Cumul,
- Data.Broad_Opnd_Table_Cumul);
-
- if Broad_Actual /= Broad_Cumul_Expected then
- Report.Failed ("Wrong cumulation result for type Broad");
- end if;
-
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-
- Report.Result;
-
-end CXF2A01;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf2a02.a b/gcc/testsuite/ada/acats/tests/cxf/cxf2a02.a
deleted file mode 100644
index e9977b0f502..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf2a02.a
+++ /dev/null
@@ -1,354 +0,0 @@
--- CXF2A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the multiplying operators for a decimal fixed point type
--- return values that are integral multiples of the small of the type.
--- Check the case where the operand and result types are the same.
---
--- Check that if the mathematical result is between multiples of the
--- small of the result type, the result is truncated toward zero.
---
--- TEST DESCRIPTION:
--- The test verifies that decimal multiplication and division behave as
--- expected for types with various digits, delta, and Machine_Radix
--- values.
---
--- The iteration, operation, and operand counts in the foundation, and
--- the operations and operand tables in the test, are given values such
--- that, when the operations loop is complete, truncation of inexact
--- results should cause the result returned by the operations loop to be
--- the same as that used to initialize the loop's cumulator variable (in
--- this test, one).
---
--- TEST FILES:
--- This test consists of the following files:
---
--- FXF2A00.A
--- -> CXF2A02.A
---
--- APPLICABILITY CRITERIA:
--- This test is only applicable for a compiler attempting validation
--- for the Information Systems Annex.
---
---
--- CHANGE HISTORY:
--- 13 Mar 96 SAIC Prerelease version for ACVC 2.1.
--- 04 Aug 96 SAIC Updated prologue.
---
---!
-
-package CXF2A02_0 is
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Micro is delta 10.0**(-5) digits 6; -- range -9.99999 ..
- for Micro'Machine_Radix use 2; -- +9.99999
-
- function Multiply (Left, Right : Micro) return Micro;
- function Divide (Left, Right : Micro) return Micro;
-
-
- type Micro_Optr_Ptr is access function (Left, Right : Micro) return Micro;
-
- Micro_Mult : Micro_Optr_Ptr := Multiply'Access;
- Micro_Div : Micro_Optr_Ptr := Divide'Access;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Basic is delta 0.01 digits 11; -- range -999,999,999.99 ..
- for Basic'Machine_Radix use 10; -- +999,999,999.99
-
- function Multiply (Left, Right : Basic) return Basic;
- function Divide (Left, Right : Basic) return Basic;
-
-
- type Basic_Optr_Ptr is access function (Left, Right : Basic) return Basic;
-
- Basic_Mult : Basic_Optr_Ptr := Multiply'Access;
- Basic_Div : Basic_Optr_Ptr := Divide'Access;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Broad is delta 10.0**(-3) digits 10; -- range -9,999,999.999 ..
- for Broad'Machine_Radix use 2; -- +9,999,999.999
-
- function Multiply (Left, Right : Broad) return Broad;
- function Divide (Left, Right : Broad) return Broad;
-
-
- type Broad_Optr_Ptr is access function (Left, Right : Broad) return Broad;
-
- Broad_Mult : Broad_Optr_Ptr := Multiply'Access;
- Broad_Div : Broad_Optr_Ptr := Divide'Access;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-end CXF2A02_0;
-
-
- --==================================================================--
-
-
-package body CXF2A02_0 is
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- function Multiply (Left, Right : Micro) return Micro is
- begin
- return (Left * Right); -- Decimal fixed multiplication.
- end Multiply;
-
- function Divide (Left, Right : Micro) return Micro is
- begin
- return (Left / Right); -- Decimal fixed division.
- end Divide;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- function Multiply (Left, Right : Basic) return Basic is
- begin
- return (Left * Right); -- Decimal fixed multiplication.
- end Multiply;
-
- function Divide (Left, Right : Basic) return Basic is
- begin
- return (Left / Right); -- Decimal fixed division.
- end Divide;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- function Multiply (Left, Right : Broad) return Broad is
- begin
- return (Left * Right); -- Decimal fixed multiplication.
- end Multiply;
-
- function Divide (Left, Right : Broad) return Broad is
- begin
- return (Left / Right); -- Decimal fixed division.
- end Divide;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-end CXF2A02_0;
-
-
- --==================================================================--
-
-
-with FXF2A00;
-package CXF2A02_0.CXF2A02_1 is
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Micro_Ops is array (FXF2A00.Optr_Range) of Micro_Optr_Ptr;
- type Micro_Opnds is array (FXF2A00.Opnd_Range) of Micro;
-
- Micro_Mult_Operator_Table : Micro_Ops := ( Micro_Mult, Micro_Mult,
- Micro_Mult, Micro_Mult,
- Micro_Mult, Micro_Mult );
-
- Micro_Div_Operator_Table : Micro_Ops := ( Micro_Div, Micro_Div,
- Micro_Div, Micro_Div,
- Micro_Div, Micro_Div );
-
- Micro_Mult_Operand_Table : Micro_Opnds := ( 2.35119,
- 0.05892,
- 9.58122,
- 0.80613,
- 0.93462 );
-
- Micro_Div_Operand_Table : Micro_Opnds := ( 0.58739,
- 4.90012,
- 0.08765,
- 0.71577,
- 5.53768 );
-
- function Test_Micro_Ops is new FXF2A00.Operations_Loop
- (Decimal_Fixed => Micro,
- Operator_Ptr => Micro_Optr_Ptr,
- Operator_Table => Micro_Ops,
- Operand_Table => Micro_Opnds);
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Basic_Ops is array (FXF2A00.Optr_Range) of Basic_Optr_Ptr;
- type Basic_Opnds is array (FXF2A00.Opnd_Range) of Basic;
-
- Basic_Mult_Operator_Table : Basic_Ops := ( Basic_Mult, Basic_Mult,
- Basic_Mult, Basic_Mult,
- Basic_Mult, Basic_Mult );
-
- Basic_Div_Operator_Table : Basic_Ops := ( Basic_Div, Basic_Div,
- Basic_Div, Basic_Div,
- Basic_Div, Basic_Div );
-
- Basic_Mult_Operand_Table : Basic_Opnds := ( 127.10,
- 0.02,
- 0.87,
- 45.67,
- 0.01 );
-
- Basic_Div_Operand_Table : Basic_Opnds := ( 0.03,
- 0.08,
- 23.57,
- 0.11,
- 159.11 );
-
- function Test_Basic_Ops is new FXF2A00.Operations_Loop
- (Decimal_Fixed => Basic,
- Operator_Ptr => Basic_Optr_Ptr,
- Operator_Table => Basic_Ops,
- Operand_Table => Basic_Opnds);
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- type Broad_Ops is array (FXF2A00.Optr_Range) of Broad_Optr_Ptr;
- type Broad_Opnds is array (FXF2A00.Opnd_Range) of Broad;
-
- Broad_Mult_Operator_Table : Broad_Ops := ( Broad_Mult, Broad_Mult,
- Broad_Mult, Broad_Mult,
- Broad_Mult, Broad_Mult );
-
- Broad_Div_Operator_Table : Broad_Ops := ( Broad_Div, Broad_Div,
- Broad_Div, Broad_Div,
- Broad_Div, Broad_Div );
-
- Broad_Mult_Operand_Table : Broad_Opnds := ( 589.720,
- 0.106,
- 21.018,
- 0.002,
- 0.381 );
-
- Broad_Div_Operand_Table : Broad_Opnds := ( 0.008,
- 0.793,
- 9.092,
- 214.300,
- 0.080 );
-
- function Test_Broad_Ops is new FXF2A00.Operations_Loop
- (Decimal_Fixed => Broad,
- Operator_Ptr => Broad_Optr_Ptr,
- Operator_Table => Broad_Ops,
- Operand_Table => Broad_Opnds);
-
- ---=---=---=---=---=---=---=---=---=---=---
-
-end CXF2A02_0.CXF2A02_1;
-
-
- --==================================================================--
-
-
-with CXF2A02_0.CXF2A02_1;
-
-with Report;
-procedure CXF2A02 is
- package Data renames CXF2A02_0.CXF2A02_1;
-
- use type CXF2A02_0.Micro;
- use type CXF2A02_0.Basic;
- use type CXF2A02_0.Broad;
-
- Micro_Expected : constant CXF2A02_0.Micro := 1.0;
- Basic_Expected : constant CXF2A02_0.Basic := 1.0;
- Broad_Expected : constant CXF2A02_0.Broad := 1.0;
-
- Micro_Actual : CXF2A02_0.Micro;
- Basic_Actual : CXF2A02_0.Basic;
- Broad_Actual : CXF2A02_0.Broad;
-begin
-
- Report.Test ("CXF2A02", "Check decimal multiplication and division, " &
- "where the operand and result types are the same");
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- Micro_Actual := 0.0;
- Micro_Actual := Data.Test_Micro_Ops (1.0,
- Data.Micro_Mult_Operator_Table,
- Data.Micro_Mult_Operand_Table);
-
- if Micro_Actual /= Micro_Expected then
- Report.Failed ("Wrong result for type Micro multiplication");
- end if;
-
-
- Micro_Actual := 0.0;
- Micro_Actual := Data.Test_Micro_Ops (1.0,
- Data.Micro_Div_Operator_Table,
- Data.Micro_Div_Operand_Table);
-
- if Micro_Actual /= Micro_Expected then
- Report.Failed ("Wrong result for type Micro division");
- end if;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- Basic_Actual := 0.0;
- Basic_Actual := Data.Test_Basic_Ops (1.0,
- Data.Basic_Mult_Operator_Table,
- Data.Basic_Mult_Operand_Table);
-
- if Basic_Actual /= Basic_Expected then
- Report.Failed ("Wrong result for type Basic multiplication");
- end if;
-
-
- Basic_Actual := 0.0;
- Basic_Actual := Data.Test_Basic_Ops (1.0,
- Data.Basic_Div_Operator_Table,
- Data.Basic_Div_Operand_Table);
-
- if Basic_Actual /= Basic_Expected then
- Report.Failed ("Wrong result for type Basic division");
- end if;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- Broad_Actual := 0.0;
- Broad_Actual := Data.Test_Broad_Ops (1.0,
- Data.Broad_Mult_Operator_Table,
- Data.Broad_Mult_Operand_Table);
-
- if Broad_Actual /= Broad_Expected then
- Report.Failed ("Wrong result for type Broad multiplication");
- end if;
-
-
- Broad_Actual := 0.0;
- Broad_Actual := Data.Test_Broad_Ops (1.0,
- Data.Broad_Div_Operator_Table,
- Data.Broad_Div_Operand_Table);
-
- if Broad_Actual /= Broad_Expected then
- Report.Failed ("Wrong result for type Broad division");
- end if;
-
- ---=---=---=---=---=---=---=---=---=---=---
-
- Report.Result;
-
-end CXF2A02;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf3001.a b/gcc/testsuite/ada/acats/tests/cxf/cxf3001.a
deleted file mode 100644
index 1b9abca153f..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf3001.a
+++ /dev/null
@@ -1,192 +0,0 @@
--- CXF3001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the edited output string value returned by Function Image
--- is correct.
---
--- TEST DESCRIPTION:
--- This test is structured using tables of data, consisting of
--- numerical values, picture strings, and expected image
--- result strings.
---
--- Each picture string is checked for validity, and an invalid picture
--- string will cause immediate test failure on its first pass through
--- the evaluation loop. Inside the evaluation loop, each decimal data
--- item is combined with each of the picture strings as parameters to a
--- call to Image, and the result of each call is compared to an
--- expected edited output result string.
---
---
--- CHANGE HISTORY:
--- 24 Feb 95 SAIC Initial prerelease version.
--- 23 Jun 95 SAIC Corrected call to functions Valid and To_Picture.
--- 22 Aug 95 SAIC Test name changed to CXF3001 (from CXF3301) to
--- conform to naming conventions.
--- 24 Feb 97 CTA.PWB Corrected picture strings and expected results.
---!
-
-with Ada.Text_IO.Editing;
-with Report;
-
-procedure CXF3001 is
-begin
-
- Report.Test ("CXF3001", "Check that the string value returned by " &
- "Function Image is correct");
-
- Test_Block:
- declare
-
- use Ada.Text_IO;
-
- Number_Of_Decimal_Items : constant := 5;
- Number_Of_Picture_Strings : constant := 4;
- Number_Of_Expected_Results : constant := Number_Of_Decimal_Items *
- Number_Of_Picture_Strings;
-
- type String_Pointer_Type is access String;
-
- -- Define a decimal data type, and instantiate the Decimal_Output
- -- generic package for the data type.
-
- type Decimal_Data_Type is delta 0.01 digits 16;
- package Ed_Out is new Editing.Decimal_Output (Decimal_Data_Type);
-
- -- Define types for the arrays of data that will hold the decimal data
- -- values, picture strings, and expected edited output results.
-
- type Decimal_Data_Array_Type is
- array (Integer range <>) of Decimal_Data_Type;
-
- type Picture_String_Array_Type is
- array (Integer range <>) of String_Pointer_Type;
-
- type Edited_Output_Results_Array_Type is
- array (Integer range <>) of String_Pointer_Type;
-
- -- Define the data arrays for this test.
-
- Decimal_Data :
- Decimal_Data_Array_Type(1..Number_Of_Decimal_Items) :=
- ( 1 => 5678.90,
- 2 => -6789.01,
- 3 => 0.00,
- 4 => 0.20,
- 5 => 3.45
- );
-
- Picture_Strings :
- Picture_String_Array_Type(1..Number_Of_Picture_Strings) :=
- ( 1 => new String'("-$$_$$9.99"),
- 2 => new String'("-$$_$$$.$$"),
- 3 => new String'("-ZZZZ.ZZ"),
- 4 => new String'("-$$$_999.99")
- );
-
- Edited_Output :
- Edited_Output_Results_Array_Type(1..Number_Of_Expected_Results) :=
- ( 1 => new String'(" $5,678.90"),
- 2 => new String'(" $5,678.90"),
- 3 => new String'(" 5678.90"),
- 4 => new String'(" $5,678.90"),
-
- 5 => new String'("-$6,789.01"),
- 6 => new String'("-$6,789.01"),
- 7 => new String'("-6789.01"),
- 8 => new String'("- $6,789.01"),
-
- 9 => new String'(" $0.00"),
- 10 => new String'(" "),
- 11 => new String'(" "),
- 12 => new String'(" $ 000.00"),
-
- 13 => new String'(" $0.20"),
- 14 => new String'(" $.20"),
- 15 => new String'(" .20"),
- 16 => new String'(" $ 000.20"),
-
- 17 => new String'(" $3.45"),
- 18 => new String'(" $3.45"),
- 19 => new String'(" 3.45"),
- 20 => new String'(" $ 003.45")
- );
-
- TC_Picture : Editing.Picture;
- TC_Loop_Count : Natural := 0;
-
- begin
-
- -- Compare string result of Image with expected edited output string.
-
- Evaluate_Edited_Output:
- for i in 1..Number_Of_Decimal_Items loop
- for j in 1..Number_Of_Picture_Strings loop
-
- TC_Loop_Count := TC_Loop_Count + 1;
-
- -- Check on the validity of the picture strings prior to
- -- processing.
-
- if Editing.Valid(Picture_Strings(j).all) then
-
- -- Create the picture object from the picture string.
- TC_Picture := Editing.To_Picture(Picture_Strings(j).all);
-
- -- Compare actual edited output result of Function Image with
- -- the expected result.
-
- if Ed_Out.Image(Decimal_Data(i), TC_Picture) /=
- Edited_Output(TC_Loop_Count).all
- then
- Report.Failed("Incorrect result from Function Image, " &
- "when used with decimal data item # " &
- Integer'Image(i) &
- " and picture string # " &
- Integer'Image(j));
- end if;
-
- else
- Report.Failed("Picture String # " & Integer'Image(j) &
- "reported as being invalid");
- -- Immediate test failure if a string is invalid.
- exit Evaluate_Edited_Output;
- end if;
-
- end loop;
- end loop Evaluate_Edited_Output;
-
- exception
- when Editing.Picture_Error =>
- Report.Failed ("Picture_Error raised in Test_Block");
- when Layout_Error =>
- Report.Failed ("Layout_Error raised in Test_Block");
- when others =>
- Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXF3001;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf3002.a b/gcc/testsuite/ada/acats/tests/cxf/cxf3002.a
deleted file mode 100644
index 8444244ef5c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf3002.a
+++ /dev/null
@@ -1,231 +0,0 @@
--- CXF3002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functionality contained in package
--- Ada.Wide_Text_IO.Editing is available and produces correct results.
---
--- TEST DESCRIPTION:
--- This test is designed to validate the procedures and functions that
--- are found in package Ada.Wide_Text_IO.Editing, the "wide"
--- complementary package to Ada.Text_IO.Editing. The test is similar
--- to CXF3301, which tested a large portion of the Ada.Text_IO.Editing
--- package. Additional testing has been added here to cover the balance
--- of the Wide_Text_IO.Editing child package.
-
--- This test is structured using tables of data, consisting of
--- numerical values, picture strings, and expected image
--- result strings.
---
--- Each picture string is checked for validity, and an invalid picture
--- string will cause immediate test failure on its first pass through
--- the evaluation loop. Inside the evaluation loop, each decimal data
--- item is combined with each of the picture strings as parameters to a
--- call to Image, and the result of each call is compared to an
--- expected edited output result string.
---
--- Note: Each of the functions Valid, To_Picture, and Pic_String has
--- String (rather than Wide_String) as its parameter or result
--- subtype, since a picture String is not localizable.
---
---
--- CHANGE HISTORY:
--- 22 Jun 95 SAIC Initial prerelease version.
--- 22 Aug 95 SAIC Test name changed to CXF3002 (from CXF3401) to
--- conform with naming conventions.
--- 24 Feb 97 PWB.CTA Corrected picture strings and expected values.
---!
-
-with Ada.Wide_Text_IO.Editing;
-with Report;
-
-procedure CXF3002 is
-begin
-
- Report.Test ("CXF3002", "Check that the functionality contained " &
- "in package Ada.Wide_Text_IO.Editing is " &
- "available and produces correct results");
-
- Test_Block:
- declare
-
- use Ada.Wide_Text_IO;
-
- Number_Of_Decimal_Items : constant := 5;
- Number_Of_Picture_Strings : constant := 4;
- Number_Of_Expected_Results : constant := Number_Of_Decimal_Items *
- Number_Of_Picture_Strings;
-
- Def_Cur : constant Wide_String := "$";
- Def_Fill : constant Wide_Character := '*';
- Def_Sep : constant Wide_Character := Editing.Default_Separator;
- Def_Radix : constant Wide_Character := Editing.Default_Radix_Mark;
-
- type String_Pointer_Type is access String;
- type Wide_String_Pointer_Type is access Wide_String;
-
- -- Define a decimal data type, and instantiate the Decimal_Output
- -- generic package for the data type.
-
- type Decimal_Data_Type is delta 0.01 digits 16;
-
- package Wide_Ed_Out is
- new Editing.Decimal_Output(Num => Decimal_Data_Type,
- Default_Currency => Def_Cur,
- Default_Fill => Def_Fill,
- Default_Separator => Def_Sep,
- Default_Radix_Mark => Def_Radix);
-
- -- Define types for the arrays of data that will hold the decimal data
- -- values, picture strings, and expected edited output results.
-
- type Decimal_Data_Array_Type is
- array (Integer range <>) of Decimal_Data_Type;
-
- type Picture_String_Array_Type is
- array (Integer range <>) of String_Pointer_Type;
-
- type Edited_Output_Results_Array_Type is
- array (Integer range <>) of Wide_String_Pointer_Type;
-
- -- Define the data arrays for this test.
-
- Decimal_Data :
- Decimal_Data_Array_Type(1..Number_Of_Decimal_Items) :=
- ( 1 => 5678.90,
- 2 => -6789.01,
- 3 => 0.00,
- 4 => 0.20,
- 5 => 3.45
- );
-
- Picture_Strings :
- Picture_String_Array_Type(1..Number_Of_Picture_Strings) :=
- ( 1 => new String'("-$$_$$9.99"),
- 2 => new String'("-$$_$$$.$$"),
- 3 => new String'("-ZZZZ.ZZ"),
- 4 => new String'("-$$$_999.99")
- );
-
-
- Edited_Output :
- Edited_Output_Results_Array_Type(1..Number_Of_Expected_Results) :=
- ( 1 => new Wide_String'(" $5,678.90"),
- 2 => new Wide_String'(" $5,678.90"),
- 3 => new Wide_String'(" 5678.90"),
- 4 => new Wide_String'(" $5,678.90"),
-
- 5 => new Wide_String'("-$6,789.01"),
- 6 => new Wide_String'("-$6,789.01"),
- 7 => new Wide_String'("-6789.01"),
- 8 => new Wide_String'("- $6,789.01"),
-
- 9 => new Wide_String'(" $0.00"),
- 10 => new Wide_String'(" "),
- 11 => new Wide_String'(" "),
- 12 => new Wide_String'(" $ 000.00"),
-
- 13 => new Wide_String'(" $0.20"),
- 14 => new Wide_String'(" $.20"),
- 15 => new Wide_String'(" .20"),
- 16 => new Wide_String'(" $ 000.20"),
-
- 17 => new Wide_String'(" $3.45"),
- 18 => new Wide_String'(" $3.45"),
- 19 => new Wide_String'(" 3.45"),
- 20 => new Wide_String'(" $ 003.45")
- );
-
- TC_Picture : Editing.Picture;
- TC_Loop_Count : Natural := 0;
-
- begin
-
- -- Compare string result of Image with expected edited output wide
- -- string.
-
- Evaluate_Edited_Output:
- for i in 1..Number_Of_Decimal_Items loop
- for j in 1..Number_Of_Picture_Strings loop
-
- TC_Loop_Count := TC_Loop_Count + 1;
-
- -- Check on the validity of the picture strings prior to
- -- processing.
-
- if Editing.Valid(Picture_Strings(j).all) then
-
- -- Create the picture object from the picture string.
- TC_Picture := Editing.To_Picture(Picture_Strings(j).all);
-
- -- Check results of function Decimal_Output.Valid.
- if not Wide_Ed_Out.Valid(Decimal_Data(i), TC_Picture) then
- Report.Failed("Incorrect result from function Valid " &
- "when examining the picture string that " &
- "was produced from string " &
- Integer'Image(j) & " in conjunction with " &
- "decimal data item # " & Integer'Image(i));
- end if;
-
- -- Check results of function Editing.Pic_String.
- if Editing.Pic_String(TC_Picture) /= Picture_Strings(j).all then
- Report.Failed("Incorrect result from To_Picture/" &
- "Pic_String conversion for picture " &
- "string # " & Integer'Image(j));
- end if;
-
- -- Compare actual edited output result of Function Image with
- -- the expected result.
-
- if Wide_Ed_Out.Image(Decimal_Data(i), TC_Picture) /=
- Edited_Output(TC_Loop_Count).all
- then
- Report.Failed("Incorrect result from Function Image, " &
- "when used with decimal data item # " &
- Integer'Image(i) &
- " and picture string # " &
- Integer'Image(j));
- end if;
-
- else
- Report.Failed("Picture String # " & Integer'Image(j) &
- "reported as being invalid");
- end if;
-
- end loop;
- end loop Evaluate_Edited_Output;
-
- exception
- when Editing.Picture_Error =>
- Report.Failed ("Picture_Error raised in Test_Block");
- when Layout_Error =>
- Report.Failed ("Layout_Error raised in Test_Block");
- when others =>
- Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXF3002;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf3003.a b/gcc/testsuite/ada/acats/tests/cxf/cxf3003.a
deleted file mode 100644
index 7cfce618e7c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf3003.a
+++ /dev/null
@@ -1,292 +0,0 @@
--- CXF3003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that statically identifiable picture strings can be used to
--- produce correctly formatted edited output.
---
--- TEST DESCRIPTION:
--- This test defines several picture strings that are statically
--- identifiable, (i.e., Pic : Picture := To_Picture("..."); ).
--- These picture strings are used in conjunction with decimal data
--- as parameters in calls to functions Valid and Image. These
--- functions are created by an instantiation of the generic package
--- Ada.Text_IO.Editing.Decimal_Output.
---
---
--- CHANGE HISTORY:
--- 04 Apr 96 SAIC Initial release for 2.1.
--- 13 Feb 97 PWB.CTA corrected incorrect picture strings.
---!
-
-with Report;
-with Ada.Text_IO.Editing;
-with Ada.Exceptions;
-
-procedure CXF3003 is
-begin
-
- Report.Test ("CXF3003", "Check that statically identifiable " &
- "picture strings can be used to produce " &
- "correctly formatted edited output");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
- use Ada.Text_IO.Editing;
-
- Def_Cur : constant String := "$";
- Def_Fill : constant Character := '*';
- Def_Sep : constant Character := Default_Separator;
- Def_Radix : constant Character :=
- Ada.Text_IO.Editing.Default_Radix_Mark;
-
- type Str_Ptr is access String;
- type Edited_Output_Array_Type is array (Integer range <>) of Str_Ptr;
-
- -- Define a decimal data type, and instantiate the Decimal_Output
- -- generic package for the data type.
-
- type Decimal_Data_Type is delta 0.01 digits 16;
-
- package Image_IO is
- new Decimal_Output(Num => Decimal_Data_Type,
- Default_Currency => Def_Cur,
- Default_Fill => '*',
- Default_Separator => Default_Separator,
- Default_Radix_Mark => Def_Radix);
-
-
- type Decimal_Data_Array_Type is
- array (Integer range <>) of Decimal_Data_Type;
-
- Decimal_Data : Decimal_Data_Array_Type(1..5) :=
- (1 => 1357.99,
- 2 => -9029.01,
- 3 => 0.00,
- 4 => 0.20,
- 5 => 3.45);
-
- -- Statically identifiable picture strings.
-
- Picture_1 : Picture := To_Picture("-$$_$$9.99");
- Picture_2 : Picture := To_Picture("-$$_$$$.$$");
- Picture_3 : Picture := To_Picture("-ZZZZ.ZZ");
- Picture_5 : Picture := To_Picture("-$$$_999.99");
- Picture_6 : Picture := To_Picture("-###**_***_**9.99");
- Picture_7 : Picture := To_Picture("-$**_***_**9.99");
- Picture_8 : Picture := To_Picture("-$$$$$$.$$");
- Picture_9 : Picture := To_Picture("-$$$$$$.$$");
- Picture_10 : Picture := To_Picture("+BBBZZ_ZZZ_ZZZ.ZZ");
- Picture_11 : Picture := To_Picture("--_---_---_--9");
- Picture_12 : Picture := To_Picture("-$_$$$_$$$_$$9.99");
- Picture_14 : Picture := To_Picture("$_$$9.99");
- Picture_15 : Picture := To_Picture("$$9.99");
-
-
- Picture_1_Output : Edited_Output_Array_Type(1..5) :=
- ( 1 => new String'(" $1,357.99"),
- 2 => new String'("-$9,029.01"),
- 3 => new String'(" $0.00"),
- 4 => new String'(" $0.20"),
- 5 => new String'(" $3.45"));
-
- Picture_2_Output : Edited_Output_Array_Type(1..5) :=
- (1 => new String'(" $1,357.99"),
- 2 => new String'("-$9,029.01"),
- 3 => new String'(" "),
- 4 => new String'(" $.20"),
- 5 => new String'(" $3.45"));
-
- Picture_3_Output : Edited_Output_Array_Type(1..5) :=
- (1 => new String'(" 1357.99"),
- 2 => new String'("-9029.01"),
- 3 => new String'(" "),
- 4 => new String'(" .20"),
- 5 => new String'(" 3.45"));
-
- Picture_5_Output : Edited_Output_Array_Type(1..5) :=
- (1 => new String'(" $1,357.99"),
- 2 => new String'("- $9,029.01"),
- 3 => new String'(" $ 000.00"),
- 4 => new String'(" $ 000.20"),
- 5 => new String'(" $ 003.45"));
-
- begin
-
- -- Check the results of function Valid, using the first five decimal
- -- data items and picture strings.
-
- if not Image_IO.Valid(Decimal_Data(1), Picture_1) then
- Report.Failed("Picture string 1 not valid");
- elsif not Image_IO.Valid(Decimal_Data(2), Picture_2) then
- Report.Failed("Picture string 2 not valid");
- elsif not Image_IO.Valid(Decimal_Data(3), Picture_3) then
- Report.Failed("Picture string 3 not valid");
- elsif not Image_IO.Valid(Decimal_Data(5), Picture_5) then
- Report.Failed("Picture string 5 not valid");
- end if;
-
-
- -- Check the results of function Image, using the picture strings
- -- constructed above, with a variety of named vs. positional
- -- parameter notation and defaulted parameters.
-
- for i in 1..5 loop
- if Image_IO.Image(Item => Decimal_Data(i), Pic => Picture_1) /=
- Picture_1_Output(i).all
- then
- Report.Failed("Incorrect result from function Image with " &
- "decimal data item #" & Integer'Image(i) & ", " &
- "combined with Picture_1 picture string." &
- "Expected: " & Picture_1_Output(i).all & ", " &
- "Found: " &
- Image_IO.Image(Decimal_Data(i),Picture_1));
- end if;
-
- if Image_IO.Image(Decimal_Data(i), Pic => Picture_2) /=
- Picture_2_Output(i).all
- then
- Report.Failed("Incorrect result from function Image with " &
- "decimal data item #" & Integer'Image(i) & ", " &
- "combined with Picture_2 picture string." &
- "Expected: " & Picture_2_Output(i).all & ", " &
- "Found: " &
- Image_IO.Image(Decimal_Data(i),Picture_2));
- end if;
-
- if Image_IO.Image(Decimal_Data(i), Picture_3) /=
- Picture_3_Output(i).all
- then
- Report.Failed("Incorrect result from function Image with " &
- "decimal data item #" & Integer'Image(i) & ", " &
- "combined with Picture_3 picture string." &
- "Expected: " & Picture_3_Output(i).all & ", " &
- "Found: " &
- Image_IO.Image(Decimal_Data(i),Picture_3));
- end if;
-
- if Image_IO.Image(Decimal_Data(i), Picture_5) /=
- Picture_5_Output(i).all
- then
- Report.Failed("Incorrect result from function Image with " &
- "decimal data item #" & Integer'Image(i) & ", " &
- "combined with Picture_5 picture string." &
- "Expected: " & Picture_5_Output(i).all & ", " &
- "Found: " &
- Image_IO.Image(Decimal_Data(i),Picture_5));
- end if;
- end loop;
-
-
- if Image_IO.Image(Item => 123456.78,
- Pic => Picture_6,
- Currency => "$",
- Fill => Def_Fill,
- Separator => Def_Sep,
- Radix_Mark => Def_Radix) /= " $***123,456.78"
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_6");
- end if;
-
- if Image_IO.Image(123456.78,
- Pic => Picture_7,
- Currency => Def_Cur,
- Fill => '*',
- Separator => Def_Sep,
- Radix_Mark => Def_Radix) /= " $***123,456.78"
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_7");
- end if;
-
- if Image_IO.Image(0.0,
- Picture_8,
- Currency => "$",
- Fill => '*',
- Separator => Def_Sep,
- Radix_Mark => Def_Radix) /= " "
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_8");
- end if;
-
- if Image_IO.Image(0.20,
- Picture_9,
- Def_Cur,
- Fill => Def_Fill,
- Separator => Default_Separator,
- Radix_Mark => Default_Radix_Mark) /= " $.20"
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_9");
- end if;
-
- if Image_IO.Image(123456.00,
- Picture_10,
- "$",
- '*',
- Separator => Def_Sep,
- Radix_Mark => Def_Radix) /= "+ 123,456.00"
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_10");
- end if;
-
- if Image_IO.Image(-123456.78,
- Picture_11,
- Default_Currency,
- Default_Fill,
- Default_Separator,
- Radix_Mark => Def_Radix) /= " -123,457"
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_11");
- end if;
-
- if Image_IO.Image(123456.78, Picture_12, "$", '*', ',', '.') /=
- " $123,456.78"
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_12");
- end if;
-
- if Image_IO.Image(1.23,
- Picture_14,
- Currency => Def_Cur,
- Fill => Def_Fill) /= " $1.23"
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_14");
- end if;
-
- if Image_IO.Image(12.34, Pic => Picture_15) /= "$12.34"
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_15");
- end if;
-
- exception
- when The_Error : others =>
- Report.Failed("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXF3003;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf3004.a b/gcc/testsuite/ada/acats/tests/cxf/cxf3004.a
deleted file mode 100644
index 146047bc824..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf3004.a
+++ /dev/null
@@ -1,257 +0,0 @@
--- CXF3004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that statically identifiable picture strings can be used
--- in conjunction with function Image to produce output strings
--- appropriate to foreign currency representations.
---
--- Check that statically identifiable picture strings will cause
--- function Image to raise Layout_Error under the appropriate
--- conditions.
---
--- TEST DESCRIPTION:
--- This test defines several picture strings that are statically
--- identifiable, (i.e., Pic : Picture := To_Picture("..."); ).
--- These picture strings are used in conjunction with decimal data
--- as parameters in calls to function Image.
---
---
--- CHANGE HISTORY:
--- 11 Apr 96 SAIC Initial release for 2.1.
---
---!
-
-with Report;
-with Ada.Text_IO.Editing;
-with Ada.Exceptions;
-
-procedure CXF3004 is
-begin
-
- Report.Test ("CXF3004", "Check that statically identifiable " &
- "picture strings will cause function Image " &
- "to raise Layout_Error under appropriate " &
- "conditions");
-
- Test_Block:
- declare
-
- use Ada.Exceptions;
- use Ada.Text_IO.Editing;
-
- FF_Currency : constant String := "FF";
- DM_Currency : constant String := "DM";
- FF_Separator : constant Character := '.';
- DM_Separator : constant Character := ',';
- FF_Radix : constant Character := ',';
- DM_Radix : constant Character := '.';
- Blank_Fill : constant Character := ' ';
- Star_Fill : constant Character := '*';
-
-
- -- Define a decimal data type, and instantiate the Decimal_Output
- -- generic package for the data type.
-
- type Decimal_Data_Type is delta 0.01 digits 16;
-
- package Image_IO is
- new Decimal_Output(Num => Decimal_Data_Type,
- Default_Currency => "$",
- Default_Fill => Star_Fill,
- Default_Separator => Default_Separator,
- Default_Radix_Mark => DM_Radix);
-
-
-
- -- The following decimal data items are used with picture strings
- -- in evaluating use of foreign currency symbols.
-
- Dec_Data_1 : Decimal_Data_Type := 123456.78;
- Dec_Data_2 : Decimal_Data_Type := 32.10;
- Dec_Data_3 : Decimal_Data_Type := -1234.57;
- Dec_Data_4 : Decimal_Data_Type := 123456.78;
- Dec_Data_5 : Decimal_Data_Type := 12.34;
- Dec_Data_6 : Decimal_Data_Type := 12.34;
- Dec_Data_7 : Decimal_Data_Type := 12345.67;
-
-
- -- Statically identifiable picture strings.
- -- These strings are used in conjunction with non-default values
- -- for Currency string, Radix mark, and Separator in calls to
- -- function Image.
-
- Picture_1 : Picture := To_Picture("-###**_***_**9.99"); -- FF
- Picture_2 : Picture := To_Picture("###z_ZZ9.99"); -- FF
- Picture_3 : Picture := To_Picture("<<<<_<<<.<<###>"); -- DM
- Picture_4 : Picture := To_Picture("-$_$$$_$$$_$$9.99"); -- DM
- Picture_5 : Picture := To_Picture("$Zz9.99"); -- DM
- Picture_6 : Picture := To_Picture("$$$9.99"); -- DM
- Picture_7 : Picture := To_Picture("###_###_##9.99"); -- CHF
-
-
- -- The following ten edited output strings correspond to the ten
- -- foreign currency picture strings.
-
- Output_1 : constant String := " FF***123.456,78";
- Output_2 : constant String := " FF 32,10";
- Output_3 : constant String := " (1,234.57DM )";
- Output_4 : constant String := " DM123,456.78";
- Output_5 : constant String := "DM 12.34";
- Output_6 : constant String := " DM12.34";
- Output_7 : constant String := " CHF12,345.67";
-
-
- begin
-
- -- Check the results of function Image, using the picture strings
- -- constructed above, in creating foreign currency edited output
- -- strings.
-
- if Image_IO.Image(Item => Dec_Data_1,
- Pic => Picture_1,
- Currency => FF_Currency,
- Fill => Star_Fill,
- Separator => FF_Separator,
- Radix_Mark => FF_Radix) /= Output_1
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_1");
- end if;
-
- if Image_IO.Image(Item => Dec_Data_2,
- Pic => Picture_2,
- Currency => FF_Currency,
- Fill => Blank_Fill,
- Separator => FF_Separator,
- Radix_Mark => FF_Radix) /= Output_2
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_2");
- end if;
-
- if Image_IO.Image(Item => Dec_Data_3,
- Pic => Picture_3,
- Currency => DM_Currency,
- Fill => Blank_Fill,
- Separator => DM_Separator,
- Radix_Mark => DM_Radix) /= Output_3
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_3");
- end if;
-
- if Image_IO.Image(Item => Dec_Data_4,
- Pic => Picture_4,
- Currency => DM_Currency,
- Fill => Blank_Fill,
- Separator => DM_Separator,
- Radix_Mark => DM_Radix) /= Output_4
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_4");
- end if;
-
- if Image_IO.Image(Item => Dec_Data_5,
- Pic => Picture_5,
- Currency => DM_Currency,
- Fill => Blank_Fill,
- Separator => DM_Separator,
- Radix_Mark => DM_Radix) /= Output_5
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_5");
- end if;
-
- if Image_IO.Image(Item => Dec_Data_6,
- Pic => Picture_6,
- Currency => DM_Currency,
- Fill => Blank_Fill,
- Separator => DM_Separator,
- Radix_Mark => DM_Radix) /= Output_6
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_6");
- end if;
-
- if Image_IO.Image(Item => Dec_Data_7,
- Pic => Picture_7,
- Currency => "CHF",
- Fill => Blank_Fill,
- Separator => ',',
- Radix_Mark => '.') /= Output_7
- then
- Report.Failed("Incorrect result from Fn. Image using Picture_7");
- end if;
-
-
- -- The following calls of Function Image, using the specific
- -- decimal values and picture strings provided, will cause
- -- a Layout_Error to be raised.
- -- Note: The data and the picture strings used in the following
- -- evaluations are not themselves erroneous, but when used in
- -- combination will cause Layout_Error to be raised.
-
- Exception_Block_1 :
- declare
- Erroneous_Data_1 : Decimal_Data_Type := 12.34;
- Erroneous_Picture_1 : Picture := To_Picture("9.99");
- N : constant Natural := Image_IO.Length(Erroneous_Picture_1);
- TC_String : String(1..N);
- begin
- TC_String := Image_IO.Image(Erroneous_Data_1, Erroneous_Picture_1);
- Report.Failed("Layout_Error not raised by combination of " &
- "Erroneous_Picture_1 and Erroneous_Data_1");
- Report.Comment("Should never be printed: " & TC_String);
- exception
- when Ada.Text_IO.Layout_Error => null; -- OK, expected exception.
- when The_Error : others =>
- Report.Failed
- ("The following exception was incorrectly raised in " &
- "Exception_Block_1: " & Exception_Name(The_Error));
- end Exception_Block_1;
-
- Exception_Block_2 :
- declare
- Erroneous_Data_2 : Decimal_Data_Type := -12.34;
- Erroneous_Picture_2 : Picture := To_Picture("99.99");
- N : constant Natural := Image_IO.Length(Erroneous_Picture_2);
- TC_String : String(1..N);
- begin
- TC_String := Image_IO.Image(Erroneous_Data_2, Erroneous_Picture_2);
- Report.Failed("Layout_Error not raised by combination of " &
- "Erroneous_Picture_2 and Erroneous_Data_2");
- Report.Comment("Should never be printed: " & TC_String);
- exception
- when Ada.Text_IO.Layout_Error => null; -- OK, expected exception.
- when The_Error : others =>
- Report.Failed
- ("The following exception was incorrectly raised in " &
- "Exception_Block_2: " & Exception_Name(The_Error));
- end Exception_Block_2;
-
- exception
- when The_Error : others =>
- Report.Failed("The following exception was raised in the " &
- "Test_Block: " & Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXF3004;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf3a01.a b/gcc/testsuite/ada/acats/tests/cxf/cxf3a01.a
deleted file mode 100644
index 202a6996e32..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf3a01.a
+++ /dev/null
@@ -1,167 +0,0 @@
--- CXF3A01.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the function Ada.Text_IO.Editing.Valid returns False if
--- a) Pic_String is not a well-formed Picture string, or
--- b) the length of Pic_String exceeds Max_Picture_Length, or
--- c) Blank_When_Zero is True and Pic_String contains '*';
--- Check that Valid otherwise returns True.
---
--- TEST DESCRIPTION:
--- This test validates the results of function Editing.Valid under a
--- variety of conditions. Both valid and invalid picture strings are
--- provided as input parameters to the function. The use of the
--- Blank_When_Zero parameter is evaluated with strings that contain the
--- zero suppression character '*'.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXF3A00.A (foundation code)
--- => CXF3A01.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FXF3A00;
-with Ada.Text_IO.Editing;
-with Report;
-
-procedure CXF3A01 is
-begin
-
- Report.Test ("CXF3A01", "Check that the Valid function from package " &
- "Ada.Text_IO.Editing returns False for strings " &
- "that fail to comply with the composition " &
- "constraints defined for picture strings. " &
- "Check that the Valid function returns True " &
- "for strings that conform to the composition " &
- "constraints defined for picture strings");
-
- Test_Block:
- declare
- use FXF3A00;
- use Ada.Text_IO;
- begin
-
- -- Use a series of picture strings that conform to the composition
- -- constraints to validate the Ada.Text_IO.Editing.Valid function.
- -- The result for each of these calls should be True.
- -- In all the following cases, the default value of the Blank_When_Zero
- -- parameter is used.
-
- for i in 1..FXF3A00.Number_Of_Valid_Strings loop
-
- if not Editing.Valid(Pic_String => FXF3A00.Valid_Strings(i).all)
- then
- Report.Failed("Incorrect result from Function Valid using " &
- "Valid_String = " & FXF3A00.Valid_Strings(i).all);
- end if;
-
- end loop;
-
-
- for i in 1..FXF3A00.Number_Of_Foreign_Strings loop
-
- if not Editing.Valid(Pic_String => FXF3A00.Foreign_Strings(i).all)
- then
- Report.Failed("Incorrect result from Function Valid using " &
- "Foreign_String = " &
- FXF3A00.Foreign_Strings(i).all);
- end if;
-
- end loop;
-
-
- -- Use a series of picture strings that violate one or more of the
- -- composition constraints to validate the Ada.Text_IO.Editing.Valid
- -- function. The result for each of these calls should be False.
- -- In all the following cases, the default value of the Blank_When_Zero
- -- parameter is used.
-
- for i in 1..FXF3A00.Number_Of_Invalid_Strings loop
-
- if Editing.Valid(Pic_String => FXF3A00.Invalid_Strings(i).all)
- then
- Report.Failed("Incorrect result from Function Valid using " &
- "Invalid_String = " &
- FXF3A00.Invalid_Strings(i).all);
- end if;
-
- end loop;
-
-
- -- In all the following cases, the default value of the Blank_When_Zero
- -- parameter is overridden with a True actual parameter value. Using
- -- valid picture strings that contain the '*' zero suppression character
- -- when this parameter value is True must result in a False result
- -- from function Valid. Valid picture strings that do not contain the
- -- '*' character should return a function result of True with True
- -- provided as the actual parameter to Blank_When_Zero.
-
- -- Check entries 1, 2, 25, 36 from the Valid_Strings array, all of
- -- which contain the '*' zero suppression character.
-
- if Editing.Valid(Valid_Strings(1).all, Blank_When_Zero => True) or
- Editing.Valid(Valid_Strings(2).all, Blank_When_Zero => True) or
- Editing.Valid(Valid_Strings(25).all, Blank_When_Zero => True) or
- Editing.Valid(Valid_Strings(36).all, Blank_When_Zero => True)
- then
- Report.Failed
- ("Incorrect result from Function Valid when setting " &
- "the value of the Blank_When_Zero parameter to True, " &
- "and using picture strings with the '*' character");
- end if;
-
-
- -- Check entries from the Valid_Strings array, none of
- -- which contain the '*' zero suppression character.
-
- for i in 3..24 loop
-
- if not Editing.Valid(Pic_String => Valid_Strings(i).all,
- Blank_When_Zero => True)
- then
- Report.Failed("Incorrect result from Function Valid when " &
- "setting the value of the Blank_When_Zero " &
- "parameter to True, and using picture strings " &
- "without the '*' character, Valid_String = " &
- FXF3A00.Valid_Strings(i).all);
- end if;
-
- end loop;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXF3A01;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf3a02.a b/gcc/testsuite/ada/acats/tests/cxf/cxf3a02.a
deleted file mode 100644
index 4231b56aa46..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf3a02.a
+++ /dev/null
@@ -1,267 +0,0 @@
--- CXF3A02.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the function Ada.Text_IO.Editing.To_Picture raises
--- Picture_Error if the picture string provided as input parameter does
--- not conform to the composition constraints defined for picture
--- strings.
--- Check that when Pic_String is applied to To_Picture, the result
--- is equivalent to the actual string parameter of To_Picture;
--- Check that when Blank_When_Zero is applied to To_Picture, the result
--- is the same value as the Blank_When_Zero parameter of To_Picture.
---
--- TEST DESCRIPTION:
--- This test validates that function Editing.To_Picture returns a
--- Picture result when provided a valid picture string, and raises a
--- Picture_Error exception when provided an invalid picture string
--- input parameter. In addition, the Picture result of To_Picture is
--- converted back to a picture string value using function Pic_String,
--- and the result of function Blank_When_Zero is validated based on the
--- value of parameter Blank_When_Zero used in the formation of the Picture
--- by function To_Picture.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXF3A00.A (foundation code)
--- => CXF3A02.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 11 Mar 97 PWB.CTA Corrected invalid picture string and uppercase
--- problem.
---!
-
-with FXF3A00;
-with Ada.Text_IO.Editing;
-with Ada.Strings.Maps;
-with Ada.Strings.Fixed;
-with Report;
-
-procedure CXF3A02 is
-
- Lower_Alpha : constant String := "abcdefghijklmnopqrstuvwxyz";
- Upper_Alpha : constant String := "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- function UpperCase ( Source : String ) return String is
- begin
- return
- Ada.Strings.Fixed.Translate
- ( Source => Source,
- Mapping => Ada.Strings.Maps.To_Mapping
- ( From => Lower_Alpha,
- To => Upper_Alpha ) );
- end UpperCase;
-
-begin
-
- Report.Test ("CXF3A02", "Check that the function " &
- "Ada.Text_IO.Editing.To_Picture raises " &
- "Picture_Error if the picture string provided " &
- "as input parameter does not conform to the " &
- "composition constraints defined for picture " &
- "strings");
-
- Test_Block:
- declare
-
- use Ada.Text_IO;
- use FXF3A00;
-
- TC_Picture : Editing.Picture;
- TC_Blank_When_Zero : Boolean;
-
- begin
-
-
- -- Validate that function To_Picture does not raise Picture_Error when
- -- provided a valid picture string as an input parameter.
-
- for i in 1..FXF3A00.Number_Of_Valid_Strings loop
- begin
- TC_Picture :=
- Editing.To_Picture(Pic_String => Valid_Strings(i).all,
- Blank_When_Zero => False );
- exception
- when Editing.Picture_Error =>
- Report.Failed
- ("Picture_Error raised by function To_Picture " &
- "with a valid picture string as input parameter, " &
- "Valid_String = " & FXF3A00.Valid_Strings(i).all);
- when others =>
- Report.Failed("Unexpected exception raised - 1, " &
- "Valid_String = " & FXF3A00.Valid_Strings(i).all);
- end;
- end loop;
-
-
-
- -- Validate that function To_Picture raises Picture_Error when an
- -- invalid picture string is provided as an input parameter.
- -- Default value used for parameter Blank_When_Zero.
-
- for i in 1..FXF3A00.Number_Of_Invalid_Strings loop
- begin
- TC_Picture :=
- Editing.To_Picture(Pic_String => FXF3A00.Invalid_Strings(i).all);
- Report.Failed
- ("Picture_Error not raised by function To_Picture " &
- "with an invalid picture string as input parameter, " &
- "Invalid_String = " & FXF3A00.Invalid_Strings(i).all);
- exception
- when Editing.Picture_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Unexpected exception raised, " &
- "Invalid_String = " &
- FXF3A00.Invalid_Strings(i).all);
- end;
- end loop;
-
-
-
- -- Validate that To_Picture and Pic_String/Blank_When_Zero provide
- -- "inverse" results.
-
- -- Use the default value of the Blank_When_Zero parameter (False) for
- -- these evaluations (some valid strings have the '*' zero suppression
- -- character, which would result in an invalid string if used with a
- -- True value for the Blank_When_Zero parameter).
-
- for i in 1..FXF3A00.Number_Of_Valid_Strings loop
- begin
-
- -- Format a picture string using function To_Picture.
-
- TC_Picture := Editing.To_Picture(FXF3A00.Valid_Strings(i).all);
-
- -- Reconvert the Picture result from To_Picture to a string value
- -- using function Pic_String, and compare to the original string.
-
- if Editing.Pic_String(Pic => TC_Picture) /=
- Uppercase (FXF3A00.Valid_Strings(i).all)
- then
- Report.Failed
- ("Inverse result incorrect from Editing.Pic_String, " &
- "Valid_String = " & FXF3A00.Valid_Strings(i).all);
- end if;
-
- -- Ensure that function Blank_When_Zero returns the correct value
- -- of the Blank_When_Zero parameter used in forming the Picture
- -- (default parameter value False used in call to To_Picture
- -- above).
-
- if Editing.Blank_When_Zero(Pic => TC_Picture) then
- Report.Failed
- ("Inverse result incorrect from Editing.Blank_When_Zero, " &
- "Valid_String = " & FXF3A00.Valid_Strings(i).all);
- end if;
-
- exception
- when others =>
- Report.Failed("Unexpected exception raised - 2, " &
- "Valid_String = " & FXF3A00.Valid_Strings(i).all);
- end;
- end loop;
-
-
- -- Specifically check that any lower case letters in the original
- -- picture string have been converted to upper case form following
- -- the To_Picture/Pic_String conversion (as shown in previous loop).
-
- declare
- The_Picture : Editing.Picture;
- The_Picture_String : constant String := "+bBbZz_zZz_Zz9.99";
- The_Expected_Result : constant String := "+BBBZZ_ZZZ_ZZ9.99";
- begin
- -- Convert Picture String to Picture.
- The_Picture := Editing.To_Picture(Pic_String => The_Picture_String);
-
- declare
- -- Reconvert the Picture to a Picture String.
- The_Result : constant String := Editing.Pic_String(The_Picture);
- begin
- if The_Result /= The_Expected_Result then
- Report.Failed("Conversion to Picture/Reconversion to String " &
- "did not produce expected result when Picture " &
- "String had lower case letters");
- end if;
- end;
- end;
-
-
- -- Use a value of True for the Blank_When_Zero parameter for the
- -- following evaluations (picture strings that do not have the '*' zero
- -- suppression character, which would result in an invalid string when
- -- used here with a True value for the Blank_When_Zero parameter).
-
- for i in 3..24 loop
- begin
-
- -- Format a picture string using function To_Picture.
-
- TC_Picture :=
- Editing.To_Picture(Pic_String => Valid_Strings(i).all,
- Blank_When_Zero => True);
-
- -- Reconvert the Picture result from To_Picture to a string value
- -- using function Pic_String, and compare to the original string.
-
- if Editing.Pic_String(Pic => TC_Picture) /=
- UpperCase (FXF3A00.Valid_Strings(i).all)
- then
- Report.Failed
- ("Inverse result incorrect from Editing.Pic_String, used " &
- "on Picture formed with parameter Blank_When_Zero = True, " &
- "Valid_String = " & FXF3A00.Valid_Strings(i).all);
- end if;
-
- -- Ensure that function Blank_When_Zero returns the correct value
- -- of the Blank_When_Zero parameter used in forming the Picture
- -- (default parameter value False overridden in call to
- -- To_Picture above).
-
- if not Editing.Blank_When_Zero(Pic => TC_Picture) then
- Report.Failed
- ("Inverse result incorrect from Editing.Blank_When_Zero, " &
- "used on a Picture formed with parameter Blank_When_Zero " &
- "= True, Valid_String = " & FXF3A00.Valid_Strings(i).all);
- end if;
-
- exception
- when others =>
- Report.Failed("Unexpected exception raised - 3, " &
- "Valid_String = " & FXF3A00.Valid_Strings(i).all);
- end;
- end loop;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXF3A02;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf3a03.a b/gcc/testsuite/ada/acats/tests/cxf/cxf3a03.a
deleted file mode 100644
index 86709601464..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf3a03.a
+++ /dev/null
@@ -1,429 +0,0 @@
--- CXF3A03.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that function Length in the generic package Decimal_Output
--- returns the number of characters in the edited output string
--- produced by function Image, for a particular decimal type,
--- currency string, and radix mark.
--- Check that function Valid in the generic package Decimal_Output
--- returns correct results based on the particular decimal value,
--- and the Picture and Currency string parameters.
---
--- TEST DESCRIPTION:
--- This test uses two instantiations of package Decimal_Output, one
--- for decimal data with delta 0.01, the other for decimal data with
--- delta 1.0. The functions Length and Valid found in this generic
--- package are evaluated for each instantiation.
--- Function Length is examined with picture and currency string input
--- parameters of different sizes.
--- Function Valid is examined with a decimal type data item, picture
--- object, and currency string, for cases that are both valid and
--- invalid (Layout_Error would result from the particular items as
--- input parameters to function Image).
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXF3A00.A (foundation code)
--- => CXF3A03.A
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with FXF3A00;
-with Ada.Text_IO.Editing;
-with Report;
-
-procedure CXF3A03 is
-begin
-
- Report.Test ("CXF3A03", "Check that function Length returns the " &
- "number of characters in the edited output " &
- "string produced by function Image, for a " &
- "particular decimal type, currency string, " &
- "and radix mark. Check that function Valid " &
- "returns correct results based on the " &
- "particular decimal value, and the Picture " &
- "and Currency string parameters");
-
- Test_Block:
- declare
-
- use Ada.Text_IO;
- use FXF3A00;
-
- type Instantiation_Type is (NDP, TwoDP);
-
- -- Defaults used for all other generic parameters in these
- -- instantiations.
- package Pack_NDP is new Editing.Decimal_Output (Decimal_Type_NDP);
- package Pack_2DP is new Editing.Decimal_Output (Decimal_Type_2DP);
-
- TC_Lower_Bound,
- TC_Higher_Bound : Integer := 0;
-
- TC_Picture : Editing.Picture;
- TC_US_String : constant String := "$";
- TC_FF_String : constant String := "FF";
- TC_DM_String : constant String := "DM";
- TC_CHF_String : constant String := "CHF";
-
-
- function Dollar_Sign_Present (Str : String) return Boolean is
- begin
- for i in 1..Str'Length loop
- if Str(i) = '$' then
- return True;
- end if;
- end loop;
- return False;
- end Dollar_Sign_Present;
-
- function V_Present (Str : String) return Boolean is
- begin
- for i in 1..Str'Length loop
- if Str(i) = 'V' or Str(i) = 'v' then
- return True;
- end if;
- end loop;
- return False;
- end V_Present;
-
-
- function Accurate_Length (Pict_Str : String;
- Inst : Instantiation_Type;
- Currency_String : String)
- return Boolean is
-
- TC_Length : Natural := 0;
- TC_Currency_Length_Adjustment : Natural := 0;
- TC_Radix_Adjustment : Natural := 0;
- begin
-
- -- Create the picture object from the picture string.
- TC_Picture := Editing.To_Picture(Pict_Str);
-
- -- Calculate the currency length adjustment.
- if Dollar_Sign_Present (Editing.Pic_String(TC_Picture)) then
- TC_Currency_Length_Adjustment := Currency_String'Length - 1;
- end if;
-
- -- Calculate the Radix adjustment.
- if V_Present (Editing.Pic_String(TC_Picture)) then
- TC_Radix_Adjustment := 1;
- end if;
-
- -- Calculate the length, using the version of Length that comes
- -- from the appropriate instantiation of Decimal_Output, based
- -- on the decimal type used in the instantiation.
- if Inst = NDP then
- TC_Length := Pack_NDP.Length(TC_Picture,
- Currency_String);
- else
- TC_Length := Pack_2DP.Length(TC_Picture,
- Currency_String);
- end if;
-
- return TC_Length = Editing.Pic_String(TC_Picture)'Length +
- TC_Currency_Length_Adjustment -
- TC_Radix_Adjustment;
- end Accurate_Length;
-
-
- begin
-
- Length_Block:
- begin
-
- -- The first 10 picture strings in the Valid_Strings array correspond
- -- to data values of a decimal type with delta 0.01.
- -- Note: The appropriate instantiation of the Decimal_Output package
- -- (and therefore function Length) is used by function
- -- Accurate_Length to calculate length.
-
- for i in 1..10 loop
- if not Accurate_Length (FXF3A00.Valid_Strings(i).all,
- TwoDP,
- TC_US_String)
- then
- Report.Failed("Incorrect result from function Length, " &
- "when used with a decimal type with delta .01 " &
- "and with the currency string " & TC_US_String &
- " in evaluating picture string " &
- FXF3A00.Valid_Strings(i).all );
- end if;
- end loop;
-
-
- -- Picture strings 17-20 in the Valid_Strings array correspond
- -- to data values of a decimal type with delta 1.0. Again, the
- -- instantiation of Decimal_Output used is based on this particular
- -- decimal type.
-
- for i in 17..20 loop
- if not Accurate_Length (FXF3A00.Valid_Strings(i).all,
- NDP,
- TC_US_String)
- then
- Report.Failed("Incorrect result from function Length, " &
- "when used with a decimal type with delta 1.0 " &
- "and with the currency string " & TC_US_String &
- " in evaluating picture string " &
- FXF3A00.Valid_Strings(i).all );
- end if;
- end loop;
-
-
- -- The first 4 picture strings in the Foreign_Strings array
- -- correspond to data values of a decimal type with delta 0.01,
- -- and to the currency string "FF" (two characters).
-
- for i in 1..FXF3A00.Number_of_FF_Strings loop
- if not Accurate_Length (FXF3A00.Foreign_Strings(i).all,
- TwoDP,
- TC_FF_String)
- then
- Report.Failed("Incorrect result from function Length, " &
- "when used with a decimal type with delta .01 " &
- "and with the currency string " & TC_FF_String &
- " in evaluating picture string " &
- FXF3A00.Foreign_Strings(i).all );
- end if;
- end loop;
-
-
- -- Picture strings 5-9 in the Foreign_Strings array correspond
- -- to data values of a decimal type with delta 0.01, and to the
- -- currency string "DM" (two characters).
-
- TC_Lower_Bound := FXF3A00.Number_of_FF_Strings + 1;
- TC_Higher_Bound := FXF3A00.Number_of_FF_Strings +
- FXF3A00.Number_of_DM_Strings;
-
- for i in TC_Lower_Bound..TC_Higher_Bound loop
- if not Accurate_Length (FXF3A00.Foreign_Strings(i).all,
- TwoDP,
- TC_DM_String)
- then
- Report.Failed("Incorrect result from function Length, " &
- "when used with a decimal type with delta .01 " &
- "and with the currency string " & TC_DM_String &
- " in evaluating picture string " &
- FXF3A00.Foreign_Strings(i).all );
- end if;
- end loop;
-
-
- -- Picture string #10 in the Foreign_Strings array corresponds
- -- to a data value of a decimal type with delta 0.01, and to the
- -- currency string "CHF" (three characters).
-
- if not Accurate_Length (FXF3A00.Foreign_Strings(10).all,
- TwoDP,
- TC_CHF_String)
- then
- Report.Failed("Incorrect result from function Length, " &
- "when used with a decimal type with delta .01 " &
- "and with the currency string " &
- TC_CHF_String);
- end if;
-
- exception
- when others =>
- Report.Failed("Unexpected exception raised in Length_Block");
- end Length_Block;
-
-
- Valid_Block:
- declare
-
- -- This offset value is used to align picture string and decimal
- -- data values from package FXF3A00 for proper correspondence for
- -- the evaluations below.
-
- TC_Offset : constant Natural := 10;
-
- begin
-
- -- The following four For Loops examine cases where the
- -- decimal data/picture string/currency combinations used will
- -- generate valid Edited Output strings. These combinations, when
- -- provided to the Function Valid (from instantiations of
- -- Decimal_Output), should result in a return result of True.
- -- The particular instantiated version of Valid used in these loops
- -- is that for decimal data with delta 0.01.
-
- -- The first 4 picture strings in the Foreign_Strings array
- -- correspond to data values of a decimal type with delta 0.01,
- -- and to the currency string "FF" (two characters).
-
- for i in 1..FXF3A00.Number_of_FF_Strings loop
- -- Create the picture object from the picture string.
- TC_Picture := Editing.To_Picture(FXF3A00.Foreign_Strings(i).all);
-
- if not Pack_2DP.Valid (FXF3A00.Data_With_2DP(TC_Offset + i),
- TC_Picture,
- TC_FF_String)
- then
- Report.Failed("Incorrect result from function Valid, " &
- "when used with a decimal type with delta .01 " &
- "and with the currency string " & TC_FF_String &
- " in evaluating picture string " &
- FXF3A00.Foreign_Strings(i).all );
- end if;
- end loop;
-
-
- -- Picture strings 5-9 in the Foreign_Strings array correspond
- -- to data values of a decimal type with delta 0.01, and to the
- -- currency string "DM" (two characters).
-
- TC_Lower_Bound := FXF3A00.Number_of_FF_Strings + 1;
- TC_Higher_Bound := FXF3A00.Number_of_FF_Strings +
- FXF3A00.Number_of_DM_Strings;
-
- for i in TC_Lower_Bound..TC_Higher_Bound loop
- -- Create the picture object from the picture string.
- TC_Picture := Editing.To_Picture(FXF3A00.Foreign_Strings(i).all);
-
- if not Pack_2DP.Valid (FXF3A00.Data_With_2DP(TC_Offset + i),
- TC_Picture,
- TC_DM_String)
- then
- Report.Failed("Incorrect result from function Valid, " &
- "when used with a decimal type with delta .01 " &
- "and with the currency string " & TC_DM_String &
- " in evaluating picture string " &
- FXF3A00.Foreign_Strings(i).all );
- end if;
- end loop;
-
-
- -- Picture string #10 in the Foreign_Strings array corresponds
- -- to a data value of a decimal type with delta 0.01, and to the
- -- currency string "CHF" (three characters).
-
- -- Create the picture object from the picture string.
- TC_Picture := Editing.To_Picture(FXF3A00.Foreign_Strings(10).all);
-
- if not Pack_2DP.Valid (FXF3A00.Data_With_2DP(TC_Offset + 10),
- TC_Picture,
- TC_CHF_String)
- then
- Report.Failed("Incorrect result from function Valid, " &
- "when used with a decimal type with delta .01 " &
- "and with the currency string " &
- TC_CHF_String);
- end if;
-
-
- -- The following For Loop examines cases where the
- -- decimal data/picture string/currency combinations used will
- -- generate valid Edited Output strings.
- -- The particular instantiated version of Valid used in this loop
- -- is that for decimal data with delta 1.0; the others above have
- -- been for decimal data with delta 0.01.
- -- Note: TC_Offset is used here to align picture strings from the
- -- FXF3A00.Valid_Strings table with the appropriate decimal
- -- data in the FXF3A00.Data_With_NDP table.
-
- for i in 1..FXF3A00.Number_Of_NDP_Items loop
- -- Create the picture object from the picture string.
- TC_Picture :=
- Editing.To_Picture(FXF3A00.Valid_Strings(TC_Offset + i).all);
-
- if not Pack_NDP.Valid (FXF3A00.Data_With_NDP(i),
- TC_Picture,
- TC_US_String)
- then
- Report.Failed("Incorrect result from function Valid, " &
- "when used with a decimal type with delta .01 " &
- "and with the currency string " & TC_US_String &
- " in evaluating picture string " &
- FXF3A00.Valid_Strings(i).all );
- end if;
- end loop;
-
-
- -- The following three evaluations of picture strings, used in
- -- conjunction with the specific decimal values provided, will cause
- -- Editing.Image to raise Layout_Error (to be examined in other
- -- tests). Function Valid should return a False result for these
- -- combinations.
- -- The first two evaluations use the instantiation of Decimal_Output
- -- with a decimal type with delta 0.01, while the last evaluation
- -- uses the instantiation with decimal type with delta 1.0.
-
- for i in 1..FXF3A00.Number_of_Erroneous_Conditions loop
-
- -- Create the picture object from the picture string.
- TC_Picture :=
- Editing.To_Picture(FXF3A00.Erroneous_Strings(i).all);
-
- if i < 3 then -- Choose the appropriate instantiation.
- if Pack_2DP.Valid(Item => FXF3A00.Erroneous_Data(i),
- Pic => TC_Picture,
- Currency => TC_US_String)
- then
- Report.Failed("Incorrect result from function Valid, " &
- "when used with a decimal type with delta " &
- "0.01 and with the currency string " &
- TC_US_String &
- " in evaluating picture string " &
- FXF3A00.Valid_Strings(i).all );
- end if;
- else
- if Pack_NDP.Valid(Item => FXF3A00.Decimal_Type_NDP(
- FXF3A00.Erroneous_Data(i)),
- Pic => TC_Picture,
- Currency => TC_US_String)
- then
- Report.Failed("Incorrect result from function Valid, " &
- "when used with a decimal type with delta " &
- "1.0 and with the currency string " &
- TC_US_String &
- " in evaluating picture string " &
- FXF3A00.Valid_Strings(i).all );
- end if;
- end if;
- end loop;
-
- exception
- when others =>
- Report.Failed("Unexpected exception raised in Valid_Block");
- end Valid_Block;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXF3A03;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf3a04.a b/gcc/testsuite/ada/acats/tests/cxf/cxf3a04.a
deleted file mode 100644
index 9eee39bb694..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf3a04.a
+++ /dev/null
@@ -1,293 +0,0 @@
--- CXF3A04.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the edited output string value returned by Function Image
--- is correct.
---
--- TEST DESCRIPTION:
--- This test is structured using tables of data, consisting of
--- numerical values, picture strings, and expected image
--- result strings. These data tables are found in package FXF3A00.
---
--- The results of the Image function are examined under a number of
--- circumstances. The generic package Decimal_Output is instantiated
--- twice, for decimal data with delta 0.01 and delta 1.0. Each version
--- of Image is called with both default parameters and user-provided
--- parameters. The results of each call to Image are compared to an
--- expected edited output result string.
---
--- In addition, three calls to Image are designed to raise Layout_Error,
--- due to the combination of decimal value and picture string provided
--- as input parameters. If Layout_Error is not raised, or an alternate
--- exception is raised instead, test failure results.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXF3A00.A (foundation code)
--- => CXF3A04.A
---
---
--- CHANGE HISTORY:
--- 22 JAN 95 SAIC Initial prerelease version.
--- 11 MAR 97 PWB.CTA Corrected incorrect index expression
---!
-
-with FXF3A00;
-with Ada.Text_IO.Editing;
-with Report;
-
-procedure CXF3A04 is
-begin
-
- Report.Test ("CXF3A04", "Check that the string value returned by " &
- "Function Image is correct, based on the " &
- "numerical data and picture formatting " &
- "parameters provided to the function");
-
- Test_Block:
- declare
-
- use Ada.Text_IO;
-
- -- Instantiate the Decimal_Output generic package for the two data
- -- types, using the default values for the Default_Currency,
- -- Default_Fill, Default_Separator, and Default_Radix_Mark
- -- parameters.
-
- package Pack_NDP is
- new Editing.Decimal_Output (FXF3A00.Decimal_Type_NDP);
-
- package Pack_2DP is
- new Editing.Decimal_Output (FXF3A00.Decimal_Type_2DP);
-
- TC_Currency : constant String := "$";
- TC_Fill : constant Character := '*';
- TC_Separator : constant Character := ',';
- TC_Radix_Mark : constant Character := '.';
-
- TC_Picture : Editing.Picture;
-
-
- begin
-
- Two_Decimal_Place_Data:
- -- Use a decimal fixed point type with delta 0.01 (two decimal places)
- -- and valid picture strings. Evaluate the result of function Image
- -- with the expected edited output result string.
- declare
-
- TC_Loop_End : constant := -- 10
- FXF3A00.Number_Of_2DP_Items - FXF3A00.Number_Of_Foreign_Strings;
-
- begin
- -- The first 10 picture strings in the Valid_Strings array
- -- correspond to data values of a decimal type with delta 0.01.
-
- -- Compare string result of Image with expected edited output
- -- string. Evaluate data using both default parameters of Image
- -- and user-provided parameter values.
- for i in 1..TC_Loop_End loop
-
- -- Create the picture object from the picture string.
- TC_Picture := Editing.To_Picture(FXF3A00.Valid_Strings(i).all);
-
- -- Use the default parameters for this loop evaluation of Image.
- if Pack_2DP.Image(FXF3A00.Data_With_2DP(i), TC_Picture) /=
- FXF3A00.Edited_Output(i).all
- then
- Report.Failed("Incorrect result from Function Image, " &
- "when used with a decimal type with delta " &
- "0.01, picture string " &
- FXF3A00.Valid_Strings(i).all &
- ", and the default parameters of Image");
- end if;
-
- -- Use user-provided parameters for this loop evaluation of Image.
-
- if Pack_2DP.Image(Item => FXF3A00.Data_With_2DP(i),
- Pic => TC_Picture,
- Currency => TC_Currency,
- Fill => TC_Fill,
- Separator => TC_Separator,
- Radix_Mark => TC_Radix_Mark) /=
- FXF3A00.Edited_Output(i).all
- then
- Report.Failed("Incorrect result from Function Image, " &
- "when used with a decimal type with delta " &
- "0.01, picture string " &
- FXF3A00.Valid_Strings(i).all &
- ", and user-provided parameters");
- end if;
-
- end loop;
-
- exception
- when others =>
- Report.Failed("Exception raised in Two_Decimal_Place_Data block");
- end Two_Decimal_Place_Data;
-
-
-
- No_Decimal_Place_Data:
- -- Use a decimal fixed point type with delta 1.00 (no decimal places)
- -- and valid picture strings. Evaluate the result of function Image
- -- with the expected result string.
- declare
-
- use Editing, FXF3A00;
-
- TC_Offset : constant := 10;
- TC_Loop_Start : constant := TC_Offset + 1; -- 11
- TC_Loop_End : constant := TC_Loop_Start +
- Number_Of_NDP_Items - 1; -- 22
-
- begin
- -- The following evaluations correspond to data values of a
- -- decimal type with delta 1.0.
-
- -- Compare string result of Image with expected edited output
- -- string. Evaluate data using both default parameters of Image
- -- and user-provided parameter values.
- -- Note: TC_Offset is used to align corresponding data the various
- -- data tables in foundation package FXF3A00.
-
- for i in TC_Loop_Start..TC_Loop_End loop
-
- -- Create the picture object from the picture string.
- TC_Picture := To_Picture(Valid_Strings(i).all);
-
- -- Use the default parameters for this loop evaluation of Image.
- if not (Pack_NDP.Image(Data_With_NDP(i-TC_Offset), TC_Picture) =
- Edited_Output(TC_Offset+i).all)
- then
- Report.Failed("Incorrect result from Function Image, " &
- "when used with a decimal type with delta " &
- "1.0, picture string " &
- Valid_Strings(i).all &
- ", and the default parameters of Image");
- end if;
-
- -- Use user-provided parameters for this loop evaluation of Image.
- if Pack_NDP.Image(Item => Data_With_NDP(i - TC_Offset),
- Pic => TC_Picture,
- Currency => TC_Currency,
- Fill => TC_Fill,
- Separator => TC_Separator,
- Radix_Mark => TC_Radix_Mark) /=
- Edited_Output(TC_Offset+i).all
- then
- Report.Failed("Incorrect result from Function Image, " &
- "when used with a decimal type with delta " &
- "1.0, picture string " &
- Valid_Strings(i).all &
- ", and user-provided parameters");
- end if;
-
- end loop;
-
- exception
- when others =>
- Report.Failed("Exception raised in No_Decimal_Place_Data block");
- end No_Decimal_Place_Data;
-
-
-
- Exception_Block:
- -- The following three calls of Function Image, using the specific
- -- decimal values and picture strings provided, will cause
- -- a Layout_Error to be raised.
- -- The first two evaluations use the instantiation of Decimal_Output
- -- with a decimal type with delta 0.01, while the last evaluation
- -- uses the instantiation with decimal type with delta 1.0.
-
- -- Note: The data and the picture strings used in the following
- -- evaluations are not themselves erroneous, but when used in
- -- combination will cause Layout_Error to be raised.
-
- begin
-
- for i in 1..FXF3A00.Number_Of_Erroneous_Conditions loop -- 1..3
- begin
- -- Create the picture object from the picture string.
- TC_Picture :=
- Editing.To_Picture(FXF3A00.Erroneous_Strings(i).all);
-
- -- Layout_Error must be raised by the following calls to
- -- Function Image.
-
- if i < 3 then -- Choose the appropriate instantiation.
- declare
- N : constant Natural := Pack_2DP.Length(TC_Picture);
- TC_String : String(1..N);
- begin
- TC_String := Pack_2DP.Image(FXF3A00.Erroneous_Data(i),
- TC_Picture);
- end;
- else
- declare
- use FXF3A00;
- N : constant Natural := Pack_NDP.Length(TC_Picture,
- TC_Currency);
- TC_String : String(1..N);
- begin
- TC_String :=
- Pack_NDP.Image(Item => Decimal_Type_NDP(
- Erroneous_Data(i)),
- Pic => TC_Picture,
- Currency => TC_Currency,
- Fill => TC_Fill,
- Separator => TC_Separator,
- Radix_Mark => TC_Radix_Mark);
- end;
- end if;
-
- Report.Failed("Layout_Error not raised by combination " &
- "# " & Integer'Image(i) & " " &
- "of decimal data and picture string");
-
- exception
- when Layout_Error => null; -- Expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by combination " &
- "# " & Integer'Image(i) & " " &
- "of decimal data and picture string");
- end;
- end loop;
-
- exception
- when others =>
- Report.Failed("Unexpected exception raised in Exception_Block");
- end Exception_Block;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXF3A04;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf3a05.a b/gcc/testsuite/ada/acats/tests/cxf/cxf3a05.a
deleted file mode 100644
index 3fb39332a50..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf3a05.a
+++ /dev/null
@@ -1,266 +0,0 @@
--- CXF3A05.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Function Image produces correct results when provided
--- non-default parameters for Currency, Fill, Separator, and
--- Radix_Mark at either the time of package Decimal_Output instantiation,
--- or in a call to Image. Check non-default parameters that are
--- appropriate for foreign currency representations.
---
--- TEST DESCRIPTION:
--- This test is structured using tables of data, consisting of
--- numerical values, picture strings, and expected image
--- result strings. These data tables are found in package FXF3A00.
---
--- The results of the Image function, resulting from several different
--- instantiations of Decimal_Output, are compared with expected
--- edited output string results. The primary focus of this test is to
--- examine the effect of non-default parameters, provided during the
--- instantiation of package Decimal_Output, or provided as part of a
--- call to Function Image (that resulted from an instantiation of
--- Decimal_Output that used default parameters). The non-default
--- parameters provided correspond to foreign currency representations.
---
--- For each picture string/decimal data combination examined, two
--- evaluations of Image are performed. These correspond to the two
--- methods of providing the appropriate non-default parameters described
--- above. Both forms of Function Image should produce the same expected
--- edited output string.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXF3A00.A (foundation code)
--- => CXF3A05.A
---
---
--- CHANGE HISTORY:
--- 26 JAN 95 SAIC Initial prerelease version.
--- 17 FEB 97 PWB.CTA Correct array indices for Foreign_Strings array
--- references.
---!
-
-with FXF3A00;
-with Ada.Text_IO.Editing;
-with Report;
-
-procedure CXF3A05 is
-begin
-
- Report.Test ("CXF3A05", "Check that Function Image produces " &
- "correct results when provided non-default " &
- "parameters for Currency, Fill, Separator, " &
- "and Radix_Mark, appropriate to foreign " &
- "currency representations");
-
- Test_Block:
- declare
-
- use Ada.Text_IO;
-
- -- Instantiate the Decimal_Output generic package for the several
- -- combinations of Default_Currency, Default_Fill, Default_Separator,
- -- and Default_Radix_Mark.
-
- package Pack_Def is -- Uses default parameter values.
- new Editing.Decimal_Output(FXF3A00.Decimal_Type_2DP);
-
- package Pack_FF is
- new Editing.Decimal_Output(FXF3A00.Decimal_Type_2DP,
- Default_Currency => "FF",
- Default_Fill => '*',
- Default_Separator => '.',
- Default_Radix_Mark => ',');
-
- package Pack_DM is
- new Editing.Decimal_Output(FXF3A00.Decimal_Type_2DP,
- Default_Currency => "DM",
- Default_Fill => '*',
- Default_Separator => ',',
- Default_Radix_Mark => '.');
-
- package Pack_CHF is
- new Editing.Decimal_Output(FXF3A00.Decimal_Type_2DP,
- Default_Currency => "CHF",
- Default_Fill => '*',
- Default_Separator => ',',
- Default_Radix_Mark => '.');
-
-
- TC_Picture : Editing.Picture;
- TC_Start_Loop : constant := 11;
- TC_End_Loop : constant := TC_Start_Loop + -- 20
- FXF3A00.Number_Of_Foreign_Strings - 1;
-
- begin
-
- -- In the case of each particular type of foreign string examined,
- -- two versions of Function Image are examined. First, a version of
- -- the function that originated from an instantiation of Decimal_Output
- -- with non-default parameters is checked. This version of Image is
- -- called making use of default parameters in the actual function call.
- -- In addition, a version of Function Image is checked that resulted
- -- from an instantiation of Decimal_Output using default parameters,
- -- but which uses non-default parameters in the function call.
-
- for i in TC_Start_Loop..TC_End_Loop loop
-
- -- Create the picture object from the picture string.
-
- TC_Picture := Editing.To_Picture
- (FXF3A00.Foreign_Strings(i - TC_Start_Loop + 1).all);
-
- -- Based on the ordering of the specific foreign picture strings
- -- in the FXF3A00.Foreign_Strings table, the following conditional
- -- is used to determine which type of currency is being examined
- -- as the loop executes.
-
- if i < TC_Start_Loop + FXF3A00.Number_Of_FF_Strings then -- (11-14)
- -- Process the FF picture strings.
-
- -- Check the result of Function Image from an instantiation
- -- of Decimal_Output that provided non-default actual
- -- parameters at the time of package instantiation, and uses
- -- default parameters in the call of Image.
-
- if Pack_FF.Image(Item => FXF3A00.Data_With_2DP(i),
- Pic => TC_Picture) /=
- FXF3A00.Edited_Output(i).all
- then
- Report.Failed("Incorrect output from Function Image " &
- "from package instantiated with FF " &
- "related parameters, using picture string " &
- FXF3A00.Foreign_Strings
- (i - TC_Start_Loop + 1).all);
- end if;
-
- -- Check the result of Function Image that originated from
- -- an instantiation of Decimal_Output where default parameters
- -- were used at the time of package Instantiation, but where
- -- non-default parameters are provided in the call of Image.
-
- if Pack_Def.Image(Item => FXF3A00.Data_With_2DP(i),
- Pic => TC_Picture,
- Currency => "FF",
- Fill => '*',
- Separator => '.',
- Radix_Mark => ',') /=
- FXF3A00.Edited_Output(i).all
- then
- Report.Failed("Incorrect output from Function Image " &
- "from package instantiated with default " &
- "parameters, using picture string " &
- FXF3A00.Foreign_Strings
- (i - TC_Start_Loop + 1).all &
- ", and FF related parameters in call to Image");
- end if;
-
-
- elsif i < TC_Start_Loop + -- (15-19)
- FXF3A00.Number_Of_FF_Strings +
- FXF3A00.Number_Of_DM_Strings then
- -- Process the DM picture strings.
-
- -- Non-default instantiation parameters, default function call
- -- parameters.
-
- if Pack_DM.Image(Item => FXF3A00.Data_With_2DP(i),
- Pic => TC_Picture) /=
- FXF3A00.Edited_Output(i).all
- then
- Report.Failed("Incorrect output from Function Image " &
- "from package instantiated with DM " &
- "related parameters, using picture string " &
- FXF3A00.Foreign_Strings
- (i - TC_Start_Loop + 1).all);
- end if;
-
- -- Default instantiation parameters, non-default function call
- -- parameters.
-
- if Pack_Def.Image(Item => FXF3A00.Data_With_2DP(i),
- Pic => TC_Picture,
- Currency => "DM",
- Fill => '*',
- Separator => ',',
- Radix_Mark => '.') /=
- FXF3A00.Edited_Output(i).all
- then
- Report.Failed("Incorrect output from Function Image " &
- "from package instantiated with default " &
- "parameters, using picture string " &
- FXF3A00.Foreign_Strings
- (i - TC_Start_Loop + 1).all &
- ", and DM related parameters in call to Image");
- end if;
-
-
- else -- (i=20)
- -- Process the CHF string.
-
- -- Non-default instantiation parameters, default function call
- -- parameters.
-
- if Pack_CHF.Image(FXF3A00.Data_With_2DP(i), TC_Picture) /=
- FXF3A00.Edited_Output(i).all
- then
- Report.Failed("Incorrect output from Function Image " &
- "from package instantiated with CHF " &
- "related parameters, using picture string " &
- FXF3A00.Foreign_Strings
- (i - TC_Start_Loop + 1).all);
- end if;
-
- -- Default instantiation parameters, non-default function call
- -- parameters.
-
- if Pack_Def.Image(FXF3A00.Data_With_2DP(i),
- TC_Picture,
- "CHF",
- '*',
- ',',
- '.') /=
- FXF3A00.Edited_Output(i).all
- then
- Report.Failed("Incorrect output from Function Image " &
- "from package instantiated with default " &
- "parameters, using picture string " &
- FXF3A00.Foreign_Strings
- (i - TC_Start_Loop + 1).all &
- ", and CHF related parameters in call to Image");
- end if;
-
- end if;
-
- end loop;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXF3A05;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf3a06.a b/gcc/testsuite/ada/acats/tests/cxf/cxf3a06.a
deleted file mode 100644
index 7b769ba96bf..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf3a06.a
+++ /dev/null
@@ -1,302 +0,0 @@
--- CXF3A06.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Ada.Text_IO.Editing.Put and Ada.Text_IO.Put have the same
--- effect.
---
--- TEST DESCRIPTION:
--- This test is structured using tables of data, consisting of
--- numerical values, picture strings, and expected image
--- result strings. These data tables are found in package FXF3A00.
---
--- The testing approach used in this test is that of writing edited
--- output data to a text file, using two different approaches. First,
--- Ada.Text_IO.Put is used, with a call to an instantiated version of
--- Function Image supplied as the actual for parameter Item. The
--- second approach is to use a version of Function Put from an
--- instantiation of Ada.Text_IO.Editing.Decimal_Output, with the
--- appropriate parameters for decimal data, picture, and format
--- specific parameters. A call to New_Line follows each Put, so that
--- each entry is placed on a separate line in the text file.
---
--- Edited output for decimal data with two decimal places is in the
--- first loop, and once the data has been written to the file, the
--- text file is closed, then opened in In_File mode. The edited
--- output data is read from the file, and data on successive lines
--- is compared with the expected edited output result. The edited
--- output data produced by both of the Put procedures should be
--- identical.
---
--- This process is repeated for decimal data with no decimal places.
--- The file is reopened in Append_File mode, and the edited output
--- data is added to the file in the same manner as described above.
--- The file is closed, and reopened to verify the data written.
--- The data written above (with two decimal places) is skipped, then
--- the data to be verified is extracted as above and verified against
--- the expected edited output string values.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable only to implementations that support
--- external text files.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXF3A00.A (foundation code)
--- => CXF3A06.A
---
---
--- CHANGE HISTORY:
--- 26 JAN 95 SAIC Initial prerelease version.
--- 26 FEB 97 PWB.CTA Made input buffers sufficiently long
--- and removed code depending on shorter buffers
---!
-
-with FXF3A00;
-with Ada.Text_IO.Editing;
-with Report;
-
-procedure CXF3A06 is
- use Ada;
-begin
-
- Report.Test ("CXF3A06", "Check that Ada.Text_IO.Editing.Put and " &
- "Ada.Text_IO.Put have the same effect");
-
- Test_for_Text_IO_Support:
- declare
- Text_File : Ada.Text_IO.File_Type;
- Text_Filename : constant String := Report.Legal_File_Name(1);
- begin
-
- -- Use_Error will be raised if Text_IO operations or external files
- -- are not supported.
-
- Text_IO.Create (Text_File, Text_IO.Out_File, Text_Filename);
-
- Test_Block:
- declare
- use Ada.Text_IO;
-
- -- Instantiate the Decimal_Output generic package for two
- -- different decimal data types.
-
- package Pack_2DP is -- Uses decimal type with delta 0.01.
- new Editing.Decimal_Output(FXF3A00.Decimal_Type_2DP);
-
- package Pack_NDP is -- Uses decimal type with delta 1.0.
- new Editing.Decimal_Output(Num => FXF3A00.Decimal_Type_NDP,
- Default_Currency => "$",
- Default_Fill => '*',
- Default_Separator => ',',
- Default_Radix_Mark => '.');
-
- TC_Picture : Editing.Picture;
- TC_Start_Loop : constant := 1;
- TC_End_Loop_1 : constant := FXF3A00.Number_Of_2DP_Items - -- 20-10
- FXF3A00.Number_Of_Foreign_Strings;
- TC_End_Loop_2 : constant := FXF3A00.Number_Of_NDP_Items; -- 12
- TC_Offset : constant := FXF3A00.Number_Of_2DP_Items; -- 20
-
- TC_String_1, TC_String_2 : String(1..255) := (others => ' ');
- TC_Last_1, TC_Last_2 : Natural := 0;
-
- begin
-
- -- Use the two versions of Put, for data with two decimal points,
- -- to write edited output strings to the text file. Use a separate
- -- line for each string entry.
-
- for i in TC_Start_Loop..TC_End_Loop_1 loop -- 1..10
-
- -- Create the picture object from the picture string.
-
- TC_Picture := Editing.To_Picture(FXF3A00.Valid_Strings(i).all);
-
- -- Use the Text_IO version of Put to place an edited output
- -- string into a text file. Use default parameters in the call
- -- to Image for Currency, Fill, Separator, and Radix_Mark.
-
- Text_IO.Put(Text_File,
- Pack_2DP.Image(Item => FXF3A00.Data_With_2DP(i),
- Pic => TC_Picture));
- Text_IO.New_Line(Text_File);
-
- -- Use the version of Put from the instantiation of
- -- Decimal_Output to place an edited output string on a separate
- -- line of the Text_File. Use default parameters for Currency,
- -- Fill, Separator, and Radix_Mark.
-
- Pack_2DP.Put(File => Text_File,
- Item => FXF3A00.Data_With_2DP(i),
- Pic => TC_Picture);
- Text_IO.New_Line(Text_File);
-
- end loop;
-
- Text_IO.Close(Text_File);
-
- -- Reopen the text file in In_File mode, and verify the edited
- -- output found on consecutive lines of the file.
-
- Text_IO.Open(Text_File, Text_IO.In_File, Text_Filename);
-
- for i in TC_Start_Loop..TC_End_Loop_1 loop
- -- Read successive lines in the text file.
- Text_IO.Get_Line(Text_File, TC_String_1, TC_Last_1);
- Text_IO.Get_Line(Text_File, TC_String_2, TC_Last_2);
-
- -- Compare the two strings for equality with the expected edited
- -- output result. Failure results if strings don't match, or if
- -- a reading error occurred from the attempted Get_Line resulting
- -- from an improperly formed edited output string.
-
- if TC_String_1(1..TC_Last_1) /= FXF3A00.Edited_Output(i).all or
- TC_String_2(1..TC_Last_2) /= FXF3A00.Edited_Output(i).all
- then
- Report.Failed("Failed comparison of two edited output " &
- "strings from data with two decimal points " &
- ", loop number = " & Integer'Image(i));
- end if;
- end loop;
-
- Text_IO.Close(Text_File);
-
- -- Reopen the text file in Append_File mode.
- -- Use the two versions of Put, for data with no decimal points,
- -- to write edited output strings to the text file. Use a separate
- -- line for each string entry.
-
- Text_IO.Open(Text_File, Text_IO.Append_File, Text_Filename);
-
- for i in TC_Start_Loop..TC_End_Loop_2 loop -- 1..12
-
- -- Create the picture object from the picture string specific to
- -- data with no decimal points. Use appropriate offset into the
- -- Valid_Strings array to account for the string data used above.
-
- TC_Picture :=
- Editing.To_Picture(FXF3A00.Valid_Strings(i+TC_End_Loop_1).all);
-
- -- Use the Text_IO version of Put to place an edited output
- -- string into a text file. Use non-default parameters in the
- -- call to Image for Currency, Fill, Separator, and Radix_Mark.
-
- Text_IO.Put(Text_File,
- Pack_NDP.Image(Item => FXF3A00.Data_With_NDP(i),
- Pic => TC_Picture,
- Currency => "$",
- Fill => '*',
- Separator => ',',
- Radix_Mark => '.'));
- Text_IO.New_Line(Text_File);
-
- -- Use the version of Put from the instantiation of
- -- Decimal_Output to place an edited output string on a separate
- -- line of the Text_File. Use non-default parameters for
- -- Currency, Fill, Separator, and Radix_Mark.
-
- Pack_NDP.Put(File => Text_File,
- Item => FXF3A00.Data_With_NDP(i),
- Pic => TC_Picture,
- Currency => "$",
- Fill => '*',
- Separator => ',',
- Radix_Mark => '.');
- Text_IO.New_Line(Text_File);
-
- end loop;
-
- Text_IO.Close(Text_File);
-
- -- Reopen the text file in In_File mode, and verify the edited
- -- output found on consecutive lines of the file.
-
- Text_IO.Open(Text_File, Text_IO.In_File, Text_Filename);
-
- -- Read past data that has been verified above, skipping two lines
- -- of the data file for each loop.
-
- for i in TC_Start_Loop..TC_End_Loop_1 loop -- 1..10
- Text_IO.Skip_Line(Text_File, 2);
- end loop;
-
- -- Verify the last data set that was written to the file.
-
- for i in TC_Start_Loop..TC_End_Loop_2 loop -- 1..12
- Text_IO.Get_Line(Text_File, TC_String_1, TC_Last_1);
- Text_IO.Get_Line(Text_File, TC_String_2, TC_Last_2);
-
- -- Compare the two strings for equality with the expected edited
- -- output result. Failure results if strings don't match, or if
- -- a reading error occurred from the attempted Get_Line resulting
- -- from an improperly formed edited output string.
-
- if TC_String_1(1..TC_Last_1) /=
- FXF3A00.Edited_Output(i+TC_Offset).all or
- TC_String_2(1..TC_Last_2) /=
- FXF3A00.Edited_Output(i+TC_Offset).all
- then
- Report.Failed("Failed comparison of two edited output " &
- "strings from data with no decimal points " &
- ", loop number = " &
- Integer'Image(i));
- end if;
-
- end loop;
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- -- Delete the external file.
- if Text_IO.Is_Open (Text_File) then
- Text_IO.Delete (Text_File);
- else
- Text_IO.Open (Text_File, Text_IO.In_File, Text_Filename);
- Text_IO.Delete (Text_File);
- end if;
-
- exception
-
- -- Since Use_Error can be raised if, for the specified mode,
- -- the environment does not support Text_IO operations, the
- -- following handlers are included:
-
- when Text_IO.Use_Error =>
- Report.Not_Applicable ("Use_Error raised on Text_IO Create");
-
- when Text_IO.Name_Error =>
- Report.Not_Applicable ("Name_Error raised on Text_IO Create");
-
- when others =>
- Report.Failed ("Unexpected exception raised in Create block");
-
- end Test_for_Text_IO_Support;
-
- Report.Result;
-
-end CXF3A06;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf3a07.a b/gcc/testsuite/ada/acats/tests/cxf/cxf3a07.a
deleted file mode 100644
index 7cb2c360c97..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf3a07.a
+++ /dev/null
@@ -1,337 +0,0 @@
--- CXF3A07.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that Ada.Text_IO.Editing.Put and Ada.Strings.Fixed.Move
--- have the same effect in putting edited output results into string
--- variables.
---
--- TEST DESCRIPTION:
--- This test is structured using tables of data, consisting of
--- numerical values, picture strings, and expected image
--- result strings. These data tables are found in package FXF3A00.
---
--- The operation of the two above subprograms are examined twice, first
--- with the output of an edited output string to a receiving string
--- object of equal size, the other to a receiving string object of
--- larger size, where justification and padding are considered.
--- The procedure Editing.Put will place an edited output string into
--- a larger receiving string with right justification and blank fill.
--- Procedure Move has parameter control of justification and fill, and
--- in this test will mirror Put by specifying right justification and
--- blank fill.
---
--- In the cases where the edited output string is of shorter length
--- than the receiving string object, a blank-filled constant string
--- will be catenated to the front of the expected edited output string
--- for comparison with the receiving string object, enabling direct
--- string comparison for result verification.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXF3A00.A (foundation code)
--- => CXF3A07.A
---
---
--- CHANGE HISTORY:
--- 30 JAN 95 SAIC Initial prerelease version.
--- 11 MAR 97 PWB.CTA Fixed string lengths
---!
-
-with FXF3A00;
-with Ada.Text_IO.Editing;
-with Ada.Strings.Fixed;
-with Report;
-
-procedure CXF3A07 is
-begin
-
- Report.Test ("CXF3A07", "Check that Ada.Text_IO.Editing.Put and " &
- "Ada.Strings.Fixed.Move have the same " &
- "effect in putting edited output results " &
- "into string variables");
- Test_Block:
- declare
-
- use Ada.Text_IO;
-
- -- Instantiate the Decimal_Output generic package for two
- -- different decimal data types.
-
- package Pack_2DP is -- Uses decimal type with delta 0.01.
- new Editing.Decimal_Output(FXF3A00.Decimal_Type_2DP);
-
- package Pack_NDP is -- Uses decimal type with delta 1.0.
- new Editing.Decimal_Output(Num => FXF3A00.Decimal_Type_NDP,
- Default_Currency => "$",
- Default_Fill => '*',
- Default_Separator => ',',
- Default_Radix_Mark => '.');
-
- TC_Picture : Editing.Picture;
- TC_Start_Loop : Integer := 0;
- TC_End_Loop : Integer := 0;
- TC_Offset : Integer := 0;
- TC_Length : Natural := 0;
-
- TC_Put_String_20, -- Longer than the longest edited
- TC_Move_String_20 : String(1..20); -- output string.
-
- TC_Put_String_17, -- Exact length of longest edited
- TC_Move_String_17 : String(1..17); -- output string in 2DP-US data set.
-
- TC_Put_String_8, -- Exact length of longest edited
- TC_Move_String_8 : String(1..8); -- output string in NDP-US data set.
-
-
- begin
-
- -- Examine cases where the output string is longer than the length
- -- of the edited output result. Use the instantiation of
- -- Decimal_Output specific to data with two decimal places.
-
- TC_Start_Loop := 1;
- TC_End_Loop := FXF3A00.Number_of_2DP_Items - -- 10
- FXF3A00.Number_Of_Foreign_Strings;
-
- for i in TC_Start_Loop..TC_End_Loop loop -- 1..10
-
- -- Create the picture object from the picture string.
-
- TC_Picture := Editing.To_Picture(FXF3A00.Valid_Strings(i).all,
- Blank_When_Zero => False);
-
- -- Determine the actual length of the edited output string
- -- that is expected from Put and Image.
-
- TC_Length := Pack_2DP.Length(Pic => TC_Picture,
- Currency => "$");
-
- -- Determine the difference in length between the receiving string
- -- object and the expected length of the edited output string.
- -- Define a blank filled string constant with length equal to this
- -- length difference.
-
- declare
- TC_Length_Diff : Integer := TC_Put_String_20'Length -
- TC_Length;
- TC_Buffer_String : constant String(1..TC_Length_Diff) :=
- (others => ' ');
- begin
-
- -- Fill the two receiving string objects with edited output,
- -- using the two different methods (Put and Move).
-
- Pack_2DP.Put(To => TC_Put_String_20,
- Item => FXF3A00.Data_With_2DP(i),
- Pic => TC_Picture,
- Currency => "$",
- Fill => '*',
- Separator => ',',
- Radix_Mark => '.');
-
-
- Ada.Strings.Fixed.Move
- (Source => Pack_2DP.Image(Item => FXF3A00.Data_With_2DP(i),
- Pic => TC_Picture,
- Currency => "$",
- Fill => '*',
- Separator => ',',
- Radix_Mark => '.'),
- Target => TC_Move_String_20,
- Drop => Ada.Strings.Error,
- Justify => Ada.Strings.Right,
- Pad => Ada.Strings.Space);
-
- -- Each receiving string object is now filled with the edited
- -- output result, right justified.
- -- Compare these two string objects with the expected edited
- -- output value, which is appended to the blank filled string
- -- whose length is the difference between the expected edited
- -- output length and the length of the receiving strings.
-
- if TC_Buffer_String & FXF3A00.Edited_Output(i).all /=
- TC_Put_String_20 or
- TC_Buffer_String & FXF3A00.Edited_Output(i).all /=
- TC_Move_String_20
- then
- Report.Failed("Failed case where the output string is " &
- "longer than the length of the edited " &
- "output result, loop #" & Integer'Image(i));
- end if;
-
- exception
- when Layout_Error =>
- Report.Failed("Layout_Error raised when the output string " &
- "is longer than the length of the edited " &
- "output result, loop #" & Integer'Image(i));
- when others =>
- Report.Failed("Exception raised when the output string is " &
- "longer than the length of the edited " &
- "output result, loop #" & Integer'Image(i));
- end;
- end loop;
-
-
- -- Repeat the above loop, but only evaluate three cases - those where
- -- the length of the expected edited output string is the exact length
- -- of the receiving strings (no justification will be required within
- -- the string. This series of evaluations again uses decimal data
- -- with two decimal places.
-
- for i in TC_Start_Loop..TC_End_Loop loop -- 1..10
-
- case i is
- when 1 | 5 | 7 =>
-
- -- Create the picture object from the picture string.
- TC_Picture :=
- Editing.To_Picture(FXF3A00.Valid_Strings(i).all);
-
- -- Fill the two receiving string objects with edited output,
- -- using the two different methods (Put and Move).
- -- Use default parameters in the various calls where possible.
-
- Pack_2DP.Put(To => TC_Put_String_17,
- Item => FXF3A00.Data_With_2DP(i),
- Pic => TC_Picture);
-
-
- Ada.Strings.Fixed.Move
- (Source => Pack_2DP.Image(Item => FXF3A00.Data_With_2DP(i),
- Pic => TC_Picture),
- Target => TC_Move_String_17);
-
- -- Each receiving string object is now filled with the edited
- -- output result. Compare these two string objects with the
- -- expected edited output value.
-
- if FXF3A00.Edited_Output(i).all /= TC_Put_String_17 or
- FXF3A00.Edited_Output(i).all /= TC_Move_String_17
- then
- Report.Failed("Failed case where the output string is " &
- "the exact length of the edited output " &
- "result, loop #" & Integer'Image(i));
- end if;
-
- when others => null;
- end case;
- end loop;
-
-
- -- Evaluate a mix of cases, where the expected edited output string
- -- length is either exactly as long or shorter than the receiving
- -- output string parameter. This series of evaluations uses decimal
- -- data with no decimal places.
-
- TC_Start_Loop := TC_End_Loop + 1; -- 11
- TC_End_Loop := TC_Start_Loop + -- 22
- FXF3A00.Number_of_NDP_Items - 1;
- TC_Offset := FXF3A00.Number_of_Foreign_Strings; -- 10
- -- This offset is required due to the arrangement of data within the
- -- tables found in FXF3A00.
-
- for i in TC_Start_Loop..TC_End_Loop loop -- 11..22
-
- -- Create the picture object from the picture string.
-
- TC_Picture := Editing.To_Picture(FXF3A00.Valid_Strings(i).all);
-
- -- Determine the actual length of the edited output string
- -- that is expected from Put and Image.
-
- TC_Length := Pack_NDP.Length(TC_Picture);
-
- -- Fill the two receiving string objects with edited output,
- -- using the two different methods (Put and Move).
-
- Pack_NDP.Put(TC_Put_String_8,
- FXF3A00.Data_With_NDP(i-TC_Offset),
- TC_Picture);
-
- Ada.Strings.Fixed.Move
- (Pack_NDP.Image(FXF3A00.Data_With_NDP(i-TC_Offset), TC_Picture),
- TC_Move_String_8,
- Ada.Strings.Error,
- Ada.Strings.Right,
- Ada.Strings.Space);
-
- -- Determine if there is a difference in length between the
- -- receiving string object and the expected length of the edited
- -- output string. If so, then define a blank filled string constant
- -- with length equal to this length difference.
-
- if TC_Length < TC_Put_String_8'Length then
- declare
- TC_Length_Diff : Integer := TC_Put_String_8'Length -
- TC_Length;
- TC_Buffer_String : constant String(1..TC_Length_Diff) :=
- (others => ' ');
- begin
-
- -- Each receiving string object is now filled with the edited
- -- output result, right justified.
- -- Compare these two string objects with the expected edited
- -- output value, which is appended to the blank filled string
- -- whose length is the difference between the expected edited
- -- output length and the length of the receiving strings.
-
- if TC_Buffer_String & FXF3A00.Edited_Output(i+TC_Offset).all /=
- TC_Put_String_8 or
- TC_Buffer_String & FXF3A00.Edited_Output(i+TC_Offset).all /=
- TC_Move_String_8
- then
- Report.Failed("Failed case where the output string is " &
- "longer than the length of the edited " &
- "output result, loop #" & Integer'Image(i) &
- ", using data with no decimal places");
- end if;
- end;
- else
-
- -- Compare these two string objects with the expected edited
- -- output value, which is appended to the blank filled string
- -- whose length is the difference between the expected edited
- -- output length and the length of the receiving strings.
-
- if FXF3A00.Edited_Output(i+TC_Offset).all /= TC_Put_String_8 or
- FXF3A00.Edited_Output(i+TC_Offset).all /= TC_Move_String_8
- then
- Report.Failed("Failed case where the output string is " &
- "the same length as the edited output " &
- "result, loop #" & Integer'Image(i) &
- ", using data with no decimal places");
- end if;
- end if;
- end loop;
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXF3A07;
diff --git a/gcc/testsuite/ada/acats/tests/cxf/cxf3a08.a b/gcc/testsuite/ada/acats/tests/cxf/cxf3a08.a
deleted file mode 100644
index 871ab5600a9..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxf/cxf3a08.a
+++ /dev/null
@@ -1,289 +0,0 @@
--- CXF3A08.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the version of Ada.Text_IO.Editing.Put with an out
--- String parameter propagates Layout_Error if the edited output string
--- result of Put exceeds the length of the out String parameter.
---
--- TEST DESCRIPTION:
--- This test is structured using tables of data, consisting of
--- numerical values, picture strings, and expected image
--- result strings. These data tables are found in package FXF3A00.
---
--- This test examines the case of the out string parameter to Procedure
--- Put being insufficiently long to hold the entire edited output
--- string result of the procedure. In this case, Layout_Error is to be
--- raised. Test failure results if Layout_Error is not raised, or if an
--- exception other than Layout_Error is raised.
---
--- A number of data combinations are examined, using instantiations
--- of Package Decimal_Output with different decimal data types and
--- both default and non-default parameters as generic actual parameters.
--- In addition, calls to Procedure Put are performed using default
--- parameters, non-default parameters, and non-default parameters that
--- override the generic actual parameters provided at the time of
--- instantiation of Decimal_Output.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- FXF3A00.A (foundation code)
--- => CXF3A08.A
---
---
--- CHANGE HISTORY:
--- 31 JAN 95 SAIC Initial prerelease version.
---
---!
-
-with FXF3A00;
-with Ada.Text_IO.Editing;
-with Report;
-
-procedure CXF3A08 is
-begin
-
- Report.Test ("CXF3A08", "Check that the version of " &
- "Ada.Text_IO.Editing.Put with an out " &
- "String parameter propagates Layout_Error " &
- "if the output string exceeds the length " &
- "of the out String parameter");
-
- Test_Block:
- declare
-
- use Ada.Text_IO;
-
- -- Instantiate the Decimal_Output generic package for two
- -- different decimal data types.
- -- Uses decimal type with delta 0.01 and
- package Pack_2DP is -- non-default generic actual parameters.
- new Editing.Decimal_Output(Num => FXF3A00.Decimal_Type_2DP,
- Default_Currency => "$",
- Default_Fill => '*',
- Default_Separator => ',',
- Default_Radix_Mark => '.');
-
- package Pack_NDP is -- Uses decimal type with delta 1.0.
- new Editing.Decimal_Output(FXF3A00.Decimal_Type_NDP);
-
- TC_Picture : Editing.Picture;
- TC_Start_Loop : Integer := 0;
- TC_End_Loop : Integer := 0;
- TC_Offset : Integer := 0;
-
- TC_Short_String : String(1..4); -- Shorter than the shortest edited
- -- output string result.
-
- begin
-
- -- Examine cases where the out string parameter is shorter than
- -- the length of the edited output result. Use the instantiation of
- -- Decimal_Output specific to data with two decimal places.
-
- TC_Start_Loop := 1;
- TC_End_Loop := FXF3A00.Number_of_2DP_Items - -- 10
- FXF3A00.Number_Of_Foreign_Strings;
-
- for i in TC_Start_Loop..TC_End_Loop loop -- 1..10
-
- -- Create the picture object from the picture string.
-
- TC_Picture :=
- Editing.To_Picture(Pic_String => FXF3A00.Valid_Strings(i).all,
- Blank_When_Zero => False);
-
- -- The out parameter string provided in the call to Put is
- -- shorter than the edited output result of the procedure.
- -- This will result in a Layout_Error being raised and handled.
- -- Test failure results from no exception being raised, or from
- -- the wrong exception being raised.
-
- begin
-
- -- Use the instantiation of Decimal_Output specific to decimal
- -- data with two decimal places, as well as non-default
- -- parameters and named parameter association.
-
- Pack_2DP.Put(To => TC_Short_String,
- Item => FXF3A00.Data_With_2DP(i),
- Pic => TC_Picture,
- Currency => "$",
- Fill => '*',
- Separator => ',',
- Radix_Mark => '.');
-
- -- Test failure if exception not raised.
-
- Report.Failed
- ("Layout_Error not raised, decimal data with two decimal " &
- "places, loop #" & Integer'Image(i));
-
- exception
- when Layout_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Incorrect exception raised, Layout_Error expected, " &
- "decimal data with two decimal places, loop #" &
- Integer'Image(i));
- end;
- end loop;
-
-
- -- Perform similar evaluations as above, but use the instantiation
- -- of Decimal_Output specific to decimal data with no decimal places.
-
- TC_Start_Loop := TC_End_Loop + 1; -- 11
- TC_End_Loop := TC_Start_Loop + -- 22
- FXF3A00.Number_of_NDP_Items - 1;
- TC_Offset := FXF3A00.Number_of_Foreign_Strings; -- 10
- -- This offset is required due to the arrangement of data within the
- -- tables found in FXF3A00.
-
- for i in TC_Start_Loop..TC_End_Loop loop -- 11..22
-
- -- Create the picture object from the picture string.
-
- TC_Picture := Editing.To_Picture(FXF3A00.Valid_Strings(i).all);
-
- begin
-
- -- Use the instantiation of Decimal_Output specific to decimal
- -- data with no decimal places, as well as default parameters
- -- and positional parameter association.
-
- Pack_NDP.Put(TC_Short_String,
- FXF3A00.Data_With_NDP(i-TC_Offset),
- TC_Picture);
-
- -- Test failure if exception not raised.
-
- Report.Failed
- ("Layout_Error not raised, decimal data with no decimal " &
- "places, loop #" & Integer'Image(i));
-
- exception
- when Layout_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Incorrect exception raised, Layout_Error expected, " &
- "decimal data with no decimal places, loop #" &
- Integer'Image(i));
- end;
-
- end loop;
-
-
- -- Check that Layout_Error is raised by Put resulting from an
- -- instantiation of Decimal_Output specific to foreign currency
- -- representations.
- -- Note: Both of the following evaluation sets use decimal data with
- -- two decimal places.
-
- declare
-
- package Pack_FF is
- new Editing.Decimal_Output(Num => FXF3A00.Decimal_Type_2DP,
- Default_Currency => "FF",
- Default_Fill => '*',
- Default_Separator => '.',
- Default_Radix_Mark => ',');
-
- begin
-
- TC_Offset := FXF3A00.Number_Of_2DP_Items - -- 10
- FXF3A00.Number_Of_Foreign_Strings;
-
- for i in 1..FXF3A00.Number_Of_FF_Strings loop -- 1..4
- begin
-
- -- Create the picture object from the picture string.
- TC_Picture :=
- Editing.To_Picture(FXF3A00.Foreign_Strings(i).all);
-
- Pack_FF.Put(To => TC_Short_String,
- Item => FXF3A00.Data_With_2DP(i+TC_Offset),
- Pic => TC_Picture);
-
- Report.Failed("Layout_Error was not raised by Put from " &
- "an instantiation of Decimal_Output using " &
- "non-default parameters specific to FF " &
- "currency, loop #" & Integer'Image(i));
-
- exception
- when Layout_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Put from " &
- "an instantiation of Decimal_Output using " &
- "non-default parameters specific to FF " &
- "currency, loop #" & Integer'Image(i));
- end;
- end loop;
-
-
- -- These evaluations use a version of Put resulting from a
- -- non-default instantiation of Decimal_Output, but which has
- -- specific foreign currency parameters provided in the call that
- -- override the generic actual parameters provided at instantiation.
-
- TC_Offset := TC_Offset + FXF3A00.Number_Of_FF_Strings; -- 14
-
- for i in 1..FXF3A00.Number_Of_DM_Strings loop -- 1..5
- begin
- TC_Picture :=
- Editing.To_Picture(FXF3A00.Foreign_Strings
- (i+FXF3A00.Number_Of_FF_Strings).all);
-
- Pack_2DP.Put(To => TC_Short_String,
- Item => FXF3A00.Data_With_2DP(i+TC_Offset),
- Pic => TC_Picture,
- Currency => "DM",
- Fill => '*',
- Separator => ',',
- Radix_Mark => '.');
-
- Report.Failed("Layout_Error was not raised by Put using " &
- "non-default parameters specific to DM " &
- "currency, loop #" & Integer'Image(i));
-
- exception
- when Layout_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by Put using " &
- "non-default parameters specific to DM " &
- "currency, loop #" & Integer'Image(i));
- end;
- end loop;
-
- end;
-
- exception
- when others => Report.Failed("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXF3A08;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg1001.a b/gcc/testsuite/ada/acats/tests/cxg/cxg1001.a
deleted file mode 100644
index 01a0f061e51..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg1001.a
+++ /dev/null
@@ -1,276 +0,0 @@
--- CXG1001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in the package
--- Ada.Numerics.Generic_Complex_Types provide correct results.
--- Specifically, check the functions Re, Im (both versions), procedures
--- Set_Re, Set_Im (both versions), functions Compose_From_Cartesian (all
--- versions), Compose_From_Polar, Modulus, Argument, and "abs".
---
--- TEST DESCRIPTION:
--- The generic package Generic_Complex_Types
--- is instantiated with a real type (new Float), and the results
--- produced by the specified subprograms are verified.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 15 Nov 95 SAIC Corrected visibility problems for ACVC 2.0.1.
--- Modified subtest for Compose_From_Polar.
--- 29 Sep 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Ada.Numerics.Generic_Complex_Types;
-with Report;
-
-procedure CXG1001 is
-
-begin
-
- Report.Test ("CXG1001", "Check that the subprograms defined in " &
- "the package Ada.Numerics.Generic_Complex_Types " &
- "provide correct results");
-
- Test_Block:
- declare
-
- type Real_Type is new Float;
-
- package Complex_Pack is new
- Ada.Numerics.Generic_Complex_Types(Real_Type);
-
- use type Complex_Pack.Complex;
-
- -- Declare a zero valued complex number.
- Complex_Zero : constant Complex_Pack.Complex := (0.0, 0.0);
-
- TC_Complex : Complex_Pack.Complex := Complex_Zero;
- TC_Imaginary : Complex_Pack.Imaginary;
-
- begin
-
- -- Check that the procedures Set_Re and Set_Im (both versions) provide
- -- correct results.
-
- declare
- TC_Complex_Real_Field : Complex_Pack.Complex := (5.0, 0.0);
- TC_Complex_Both_Fields : Complex_Pack.Complex := (5.0, 7.0);
- begin
-
- Complex_Pack.Set_Re(X => TC_Complex, Re => 5.0);
-
- if TC_Complex /= TC_Complex_Real_Field then
- Report.Failed("Incorrect results from Procedure Set_Re");
- end if;
-
- Complex_Pack.Set_Im(X => TC_Complex, Im => 7.0);
-
- if TC_Complex.Re /= 5.0 or
- TC_Complex.Im /= 7.0 or
- TC_Complex /= TC_Complex_Both_Fields
- then
- Report.Failed("Incorrect results from Procedure Set_Im " &
- "with Complex argument");
- end if;
-
- Complex_Pack.Set_Im(X => TC_Imaginary, Im => 3.0);
-
-
- if Complex_Pack.Im(TC_Imaginary) /= 3.0 then
- Report.Failed("Incorrect results returned following the use " &
- "of Procedure Set_Im with Imaginary argument");
- end if;
-
- end;
-
-
- -- Check that the functions Re and Im (both versions) provide
- -- correct results.
-
- declare
- TC_Complex_1 : Complex_Pack.Complex := (1.0, 0.0);
- TC_Complex_2 : Complex_Pack.Complex := (0.0, 2.0);
- TC_Complex_3 : Complex_Pack.Complex := (4.0, 3.0);
- begin
-
- -- Function Re.
-
- if Complex_Pack.Re(X => TC_Complex_1) /= 1.0 or
- Complex_Pack.Re(X => TC_Complex_2) /= 0.0 or
- Complex_Pack.Re(X => TC_Complex_3) /= 4.0
- then
- Report.Failed("Incorrect results from Function Re");
- end if;
-
- -- Function Im; version with Complex argument.
-
- if Complex_Pack.Im(X => TC_Complex_1) /= 0.0 or
- Complex_Pack.Im(X => TC_Complex_2) /= 2.0 or
- Complex_Pack.Im(X => TC_Complex_3) /= 3.0
- then
- Report.Failed("Incorrect results from Function Im " &
- "with Complex argument");
- end if;
-
-
- -- Function Im; version with Imaginary argument.
-
- if Complex_Pack.Im(Complex_Pack.i) /= 1.0 or
- Complex_Pack.Im(Complex_Pack.j) /= 1.0
- then
- Report.Failed("Incorrect results from use of Function Im " &
- "when used with an Imaginary argument");
- end if;
-
- end;
-
-
- -- Verify the results of the three versions of Function
- -- Compose_From_Cartesian
-
- declare
-
- Zero : constant Real_Type := 0.0;
- Six : constant Real_Type := 6.0;
-
- TC_Complex_1 : Complex_Pack.Complex := (3.0, 8.0);
- TC_Complex_2 : Complex_Pack.Complex := (Six, Zero);
- TC_Complex_3 : Complex_Pack.Complex := (Zero, 1.0);
-
- begin
-
- TC_Complex := Complex_Pack.Compose_From_Cartesian(3.0, 8.0);
-
- if TC_Complex /= TC_Complex_1 then
- Report.Failed("Incorrect results from Function " &
- "Compose_From_Cartesian - 1");
- end if;
-
- -- If only one component is given, the other component is
- -- implicitly zero (Both components are set by the following two
- -- function calls).
-
- TC_Complex := Complex_Pack.Compose_From_Cartesian(Re => 6.0);
-
- if TC_Complex /= TC_Complex_2 then
- Report.Failed("Incorrect results from Function " &
- "Compose_From_Cartesian - 2");
- end if;
-
- TC_Complex :=
- Complex_Pack.Compose_From_Cartesian(Im => Complex_Pack.i);
-
- if TC_Complex /= TC_Complex_3 then
- Report.Failed("Incorrect results from Function " &
- "Compose_From_Cartesian - 3");
- end if;
-
- end;
-
-
- -- Verify the results of Function Compose_From_Polar, Modulus, "abs",
- -- and Argument.
-
- declare
-
- use Complex_Pack;
-
- TC_Modulus,
- TC_Argument : Real_Type := 0.0;
-
-
- Angle_0 : constant Real_Type := 0.0;
- Angle_90 : constant Real_Type := 90.0;
- Angle_180 : constant Real_Type := 180.0;
- Angle_270 : constant Real_Type := 270.0;
- Angle_360 : constant Real_Type := 360.0;
-
- begin
-
- -- Verify the result of Function Compose_From_Polar.
- -- When the value of the parameter Modulus is zero, the
- -- Compose_From_Polar function yields a result of zero.
-
- if Compose_From_Polar(0.0, 30.0, 360.0) /= Complex_Zero
- then
- Report.Failed("Incorrect result from Function " &
- "Compose_From_Polar - 1");
- end if;
-
- -- When the value of the parameter Argument is equal to a multiple
- -- of the quarter cycle, the result of the Compose_From_Polar
- -- function with specified cycle lies on one of the axes.
-
- if Compose_From_Polar( 5.0, Angle_0, Angle_360) /= (5.0, 0.0) or
- Compose_From_Polar( 5.0, Angle_90, Angle_360) /= (0.0, 5.0) or
- Compose_From_Polar(-5.0, Angle_180, Angle_360) /= (5.0, 0.0) or
- Compose_From_Polar(-5.0, Angle_270, Angle_360) /= (0.0, 5.0) or
- Compose_From_Polar(-5.0, Angle_90, Angle_360) /= (0.0, -5.0) or
- Compose_From_Polar( 5.0, Angle_270, Angle_360) /= (0.0, -5.0)
- then
- Report.Failed("Incorrect result from Function " &
- "Compose_From_Polar - 2");
- end if;
-
- -- When the parameter to Function Argument represents a point on
- -- the non-negative real axis, the function yields a zero result.
-
- if Argument(Complex_Zero, Angle_360) /= 0.0 then
- Report.Failed("Incorrect result from Function Argument");
- end if;
-
- -- Function Modulus
-
- if Modulus(Complex_Zero) /= 0.0 or
- Modulus(Compose_From_Polar( 5.0, Angle_90, Angle_360)) /= 5.0 or
- Modulus(Compose_From_Polar(-5.0, Angle_180, Angle_360)) /= 5.0
- then
- Report.Failed("Incorrect results from Function Modulus");
- end if;
-
- -- Function "abs", a rename of Function Modulus.
-
- if "abs"(Complex_Zero) /= 0.0 or
- "abs"(Compose_From_Polar( 5.0, Angle_90, Angle_360)) /= 5.0 or
- "abs"(Compose_From_Polar(-5.0, Angle_180, Angle_360)) /= 5.0
- then
- Report.Failed("Incorrect results from Function abs");
- end if;
-
- end;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXG1001;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg1002.a b/gcc/testsuite/ada/acats/tests/cxg/cxg1002.a
deleted file mode 100644
index 39f5f00dbc3..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg1002.a
+++ /dev/null
@@ -1,198 +0,0 @@
--- CXG1002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in the package
--- Ada.Numerics.Generic_Complex_Types provide the prescribed results.
--- Specifically, check the various versions of functions "+" and "-".
---
--- TEST DESCRIPTION:
--- This test checks that the subprograms "+" and "-" defined in the
--- Generic_Complex_Types package provide the results prescribed for the
--- evaluation of these complex arithmetic operations. The functions
--- Re and Im are used to extract the appropriate component of the
--- complex result, in order that the prescribed result component can be
--- verified.
--- The generic package is instantiated with a real type (new Float),
--- and the results produced by the specified subprograms are verified.
---
--- SPECIAL REQUIREMENTS:
--- This test can be run in either "relaxed" or "strict" mode.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
---
---!
-
-with Ada.Numerics.Generic_Complex_Types;
-with Report;
-
-procedure CXG1002 is
-
-begin
-
- Report.Test ("CXG1002", "Check that the subprograms defined in " &
- "the package Ada.Numerics.Generic_Complex_Types " &
- "provide the prescribed results");
-
- Test_Block:
- declare
-
- type Real_Type is new Float;
-
- package Complex_Pack is new
- Ada.Numerics.Generic_Complex_Types(Real_Type);
- use Complex_Pack;
-
- -- Declare a zero valued complex number using the record
- -- aggregate approach.
-
- Complex_Zero : constant Complex_Pack.Complex := (0.0, 0.0);
-
- TC_Complex,
- TC_Complex_Right,
- TC_Complex_Left : Complex_Pack.Complex := Complex_Zero;
-
- TC_Real : Real_Type := 0.0;
-
- TC_Imaginary : Complex_Pack.Imaginary;
-
- begin
-
-
- -- Check that the imaginary component of the result of a binary addition
- -- operator that yields a result of complex type is exact when either
- -- of its operands is of pure-real type.
-
- TC_Complex := Compose_From_Cartesian(2.0, 3.0);
- TC_Real := 3.0;
-
- if Im("+"(Left => TC_Complex, Right => TC_Real)) /= 3.0 or
- Im("+"(TC_Complex, 6.0)) /= 3.0 or
- Im(TC_Complex + TC_Real) /= 3.0 or
- Im(TC_Complex + 5.0) /= 3.0 or
- Im((7.0, 2.0) + 1.0) /= 2.0 or
- Im((7.0, 5.0) + (-2.0)) /= 5.0 or
- Im((-7.0, -2.0) + 1.0) /= -2.0 or
- Im((-7.0, -3.0) + (-3.0)) /= -3.0
- then
- Report.Failed("Incorrect results from Function ""+"" with " &
- "one Complex and one Real argument - 1");
- end if;
-
- if Im("+"(Left => TC_Real, Right => TC_Complex)) /= 3.0 or
- Im("+"(4.0, TC_Complex)) /= 3.0 or
- Im(TC_Real + TC_Complex) /= 3.0 or
- Im(9.0 + TC_Complex) /= 3.0 or
- Im(1.0 + (7.0, -9.0)) /= -9.0 or
- Im((-2.0) + (7.0, 2.0)) /= 2.0 or
- Im(1.0 + (-7.0, -5.0)) /= -5.0 or
- Im((-3.0) + (-7.0, 16.0)) /= 16.0
- then
- Report.Failed("Incorrect results from Function ""+"" with " &
- "one Complex and one Real argument - 2");
- end if;
-
-
- -- Check that the imaginary component of the result of a binary
- -- subtraction operator that yields a result of complex type is exact
- -- when its right operand is of pure-real type.
-
- TC_Complex := (8.0, -4.0);
- TC_Real := 2.0;
-
- if Im("-"(Left => TC_Complex, Right => TC_Real)) /= -4.0 or
- Im("-"(TC_Complex, 5.0)) /= -4.0 or
- Im(TC_Complex - TC_Real) /= -4.0 or
- Im(TC_Complex - 4.0) /= -4.0 or
- Im((6.0, 5.0) - 1.0) /= 5.0 or
- Im((6.0, 13.0) - 7.0) /= 13.0 or
- Im((-5.0, 3.0) - (2.0)) /= 3.0 or
- Im((-5.0, -6.0) - (-3.0)) /= -6.0
- then
- Report.Failed("Incorrect results from Function ""-"" with " &
- "one Complex and one Real argument");
- end if;
-
-
- -- Check that the real component of the result of a binary addition
- -- operator that yields a result of complex type is exact when either
- -- of its operands is of pure-imaginary type.
-
- TC_Complex := (5.0, 0.0);
-
- if Re("+"(Left => TC_Complex, Right => i)) /= 5.0 or
- Re("+"(Complex_Pack.j, TC_Complex)) /= 5.0 or
- Re((-8.0, 5.0) + ( 2.0*i)) /= -8.0 or
- Re((2.0, 5.0) + (-2.0*i)) /= 2.0 or
- Re((-20.0, -5.0) + ( 3.0*i)) /= -20.0 or
- Re((6.0, -5.0) + (-3.0*i)) /= 6.0
- then
- Report.Failed("Incorrect results from Function ""+"" with " &
- "one Complex and one Imaginary argument");
- end if;
-
-
- -- Check that the real component of the result of a binary
- -- subtraction operator that yields a result of complex type is exact
- -- when its right operand is of pure-imaginary type.
-
- TC_Complex := TC_Complex + i; -- Should produce (5.0, 1.0)
-
- if Re("-"(TC_Complex, i)) /= 5.0 or
- Re((-4.0, 4.0) - ( 2.0*i)) /= -4.0 or
- Re((9.0, 4.0) - ( 5.0*i)) /= 9.0 or
- Re((16.0, -5.0) - ( 3.0*i)) /= 16.0 or
- Re((-3.0, -5.0) - (-4.0*i)) /= -3.0
- then
- Report.Failed("Incorrect results from Function ""-"" with " &
- "one Complex and one Imaginary argument");
- end if;
-
-
- -- Check that the result of a binary addition operation is exact when
- -- one of its operands is of real type and the other is of
- -- pure-imaginary type; the operator is analogous to the
- -- Compose_From_Cartesian function; it performs no arithmetic.
-
- TC_Complex := Complex_Pack."+"(5.0, Complex_Pack.i);
-
- if TC_Complex /= (5.0, 1.0) or
- (4.0 + i) /= (4.0, 1.0) or
- "+"(Left => j, Right => 3.0) /= (3.0, 1.0)
- then
- Report.Failed("Incorrect results from Function ""+"" with " &
- "one Real and one Imaginary argument");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXG1002;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg1003.a b/gcc/testsuite/ada/acats/tests/cxg/cxg1003.a
deleted file mode 100644
index c3885136b86..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg1003.a
+++ /dev/null
@@ -1,478 +0,0 @@
--- CXG1003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in the package Text_IO.Complex_IO
--- provide correct results.
---
--- TEST DESCRIPTION:
--- The generic package Ada.Numerics.Generic_Complex_Types is instantiated
--- with a real type (new Float). The resulting new package is used as
--- the generic actual to package Complex_IO.
--- Two different versions of Put and Get are examined in this test,
--- those that input/output complex data values from/to Text_IO files,
--- and those that input/output complex data values from/to strings.
--- Two procedures are defined to perform the file data manipulations;
--- one to place complex data into the file, and one to retrieve the data
--- from the file and verify its correctness.
--- Complex data is also put into string variables using the Procedure
--- Put for strings, and this data is then retrieved and reconverted into
--- complex values using the Get procedure.
---
---
--- APPLICABILITY CRITERIA:
--- This test is only applicable to implementations that:
--- support Annex G,
--- support Text_IO and external files
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 29 Dec 94 SAIC Modified Width parameter in Get function calls.
--- 16 Nov 95 SAIC Corrected visibility problems for ACVC 2.0.1.
--- 29 Sep 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Ada.Text_IO.Complex_IO;
-with Ada.Numerics.Generic_Complex_Types;
-with Report;
-
-procedure CXG1003 is
-begin
-
- Report.Test ("CXG1003", "Check that the subprograms defined in " &
- "the package Text_IO.Complex_IO " &
- "provide correct results");
-
- Test_for_Text_IO_Support:
- declare
- use Ada;
-
- Data_File : Ada.Text_IO.File_Type;
- Data_Filename : constant String := Report.Legal_File_Name;
-
- begin
-
- -- An application creates a text file in mode Out_File, with the
- -- intention of entering complex data into the file as appropriate.
- -- In the event that the particular environment where the application
- -- is running does not support Text_IO, Use_Error or Name_Error will be
- -- raised on calls to Text_IO operations. Either of these exceptions
- -- will be handled to produce a Not_Applicable result.
-
- Text_IO.Create (File => Data_File,
- Mode => Ada.Text_IO.Out_File,
- Name => Data_Filename);
-
- Test_Block:
- declare
-
- TC_Verbose : Boolean := False;
-
- type Real_Type is new Float;
-
- package Complex_Pack is new
- Ada.Numerics.Generic_Complex_Types(Real_Type);
-
- package C_IO is new Ada.Text_IO.Complex_IO(Complex_Pack);
-
- use Ada.Text_IO, C_IO;
- use type Complex_Pack.Complex;
-
- Number_Of_Complex_Items : constant := 6;
- Number_Of_Error_Items : constant := 2;
-
- TC_Complex : Complex_Pack.Complex;
- TC_Last_Character_Read : Positive;
-
- Complex_Array : array (1..Number_Of_Complex_Items)
- of Complex_Pack.Complex := ( (3.0, 9.0),
- (4.0, 7.0),
- (5.0, 6.0),
- (6.0, 3.0),
- (2.0, 5.0),
- (3.0, 7.0) );
-
-
- procedure Load_Data_File (The_File : in out Text_IO.File_Type) is
- use Ada.Text_IO;
- begin
- -- This procedure does not create, open, or close the data file;
- -- The_File file object must be Open at this point.
- -- This procedure is designed to load complex data into a data
- -- file twice, first using Text_IO, then Complex_IO. In this
- -- first case, the complex data values are entered as strings,
- -- assuming a variety of legal formats, as provided in the
- -- reference manual.
-
- Put_Line(The_File, "(3.0, 9.0)");
- Put_Line(The_File, "+4. +7."); -- Relaxed real literal format.
- Put_Line(The_File, "(5.0 6.)");
- Put_Line(The_File, "6., 3.0");
- Put_Line(The_File, " ( 2.0 , 5.0 ) ");
- Put_Line(The_File, "("); -- Complex data separated over
- Put_Line(The_File, "3.0"); -- several (5) lines.
- Put_Line(The_File, " , ");
- Put_Line(The_File, "7.0 ");
- Put_Line(The_File, ")");
-
- if TC_Verbose then
- Report.Comment("Complex values entered into data file using " &
- "Text_IO, Procedure Load_Data_File");
- end if;
-
- -- Use the Complex_IO procedure Put to enter Complex data items
- -- into the data file.
- -- Note: Data is being entered into the file for the *second* time
- -- at this point. (Using Complex_IO here, Text_IO above)
-
- for i in 1..Number_Of_Complex_Items loop
- C_IO.Put(File => The_File,
- Item => Complex_Array(i),
- Fore => 1,
- Aft => 1,
- Exp => 0);
- end loop;
-
- if TC_Verbose then
- Report.Comment("Complex values entered into data file using " &
- "Complex_IO, Procedure Load_Data_File");
- end if;
-
- Put_Line(The_File, "(5A,3)"); -- data to raise Data_Error.
- Put_Line(The_File, "(3.0,,8.0)"); -- data to raise Data_Error.
-
- end Load_Data_File;
-
-
-
- procedure Process_Data_File (The_File : in out Text_IO.File_Type) is
- TC_Complex : Complex_Pack.Complex := (0.0, 0.0);
- TC_Width : Integer := 0;
- begin
- -- This procedure does not create, open, or close the data file;
- -- The_File file object must be Open at this point.
- -- Use procedure Get (for Files) to extract the complex data from
- -- the Text_IO file. This data was placed into the file using
- -- Text_IO.
-
-
- for i in 1..Number_Of_Complex_Items loop
-
- C_IO.Get(The_File, TC_Complex, TC_Width);
-
- if TC_Complex /= Complex_Array(i) then
- Report.Failed("Incorrect complex data read from file " &
- "when using Text_IO procedure Get, " &
- "data item #" & Integer'Image(i));
- end if;
- end loop;
-
- if TC_Verbose then
- Report.Comment("First set of complex values extracted " &
- "from data file using Complex_IO, " &
- "Procedure Process_Data_File");
- end if;
-
- -- Use procedure Get (for Files) to extract the complex data from
- -- the Text_IO file. This data was placed into the file using
- -- procedure Complex_IO.Put.
- -- Note: Data is being extracted from the file for the *second*
- -- time at this point (Using Complex_IO here, Text_IO above)
-
- for i in 1..Number_Of_Complex_Items loop
-
- C_IO.Get(The_File, TC_Complex, TC_Width);
-
- if TC_Complex /= Complex_Array(i) then
- Report.Failed("Incorrect complex data read from file " &
- "when using Complex_IO procedure Get, " &
- "data item #" & Integer'Image(i));
- end if;
- end loop;
-
- if TC_Verbose then
- Report.Comment("Second set of complex values extracted " &
- "from data file using Complex_IO, " &
- "Procedure Process_Data_File");
- end if;
-
- -- The final items in the Data_File are complex values with
- -- incorrect syntax, which should raise Data_Error on an attempt
- -- to read them from the file.
- TC_Width := 10;
- for i in 1..Number_Of_Error_Items loop
- begin
- C_IO.Get(The_File, TC_Complex, TC_Width);
- Report.Failed
- ("Exception Data_Error not raised when Complex_IO.Get " &
- "was used to read complex data with incorrect " &
- "syntax from the Data_File, data item #" &
- Integer'Image(i));
- exception
- when Ada.Text_IO.Data_Error => -- OK, expected exception.
- Text_IO.Skip_Line(The_File);
- when others =>
- Report.Failed
- ("Unexpected exception raised when Complex_IO.Get " &
- "was used to read complex data with incorrect " &
- "syntax from the Data_File, data item #" &
- Integer'Image(i));
- end;
- end loop;
-
- if TC_Verbose then
- Report.Comment("Erroneous set of complex values extracted " &
- "from data file using Complex_IO, " &
- "Procedure Process_Data_File");
- end if;
-
-
- exception
- when others =>
- Report.Failed
- ("Unexpected exception raised in Process_Data_File");
- end Process_Data_File;
-
-
-
- begin -- Test_Block.
-
- -- Place complex values into data file.
-
- Load_Data_File(Data_File);
- Text_IO.Close(Data_File);
-
- if TC_Verbose then
- Report.Comment("Data file loaded with Complex values");
- end if;
-
- -- Read complex values from data file.
-
- Text_IO.Open(Data_File, Text_IO.In_File, Data_Filename);
- Process_Data_File(Data_File);
-
- if TC_Verbose then
- Report.Comment("Complex values extracted from data file");
- end if;
-
-
-
- -- Verify versions of Procedures Put and Get for Strings.
-
- declare
- TC_String_Array : array (1..Number_Of_Complex_Items)
- of String(1..15) := (others =>(others => ' '));
- begin
-
- -- Place complex values into strings using the Procedure Put.
-
- for i in 1..Number_Of_Complex_Items loop
- C_IO.Put(To => TC_String_Array(i),
- Item => Complex_Array(i),
- Aft => 1,
- Exp => 0);
- end loop;
-
- if TC_Verbose then
- Report.Comment("Complex values placed into string array");
- end if;
-
- -- Check the format of the strings containing a complex number.
- -- The resulting strings are of 15 character length, with the
- -- real component left justified within the string, followed by
- -- a comma, and with the imaginary component and closing
- -- parenthesis right justified in the string, with blank fill
- -- for the balance of the string.
-
- if TC_String_Array(1) /= "(3.0, 9.0)" or
- TC_String_Array(2) /= "(4.0, 7.0)" or
- TC_String_Array(3) /= "(5.0, 6.0)" or
- TC_String_Array(4) /= "(6.0, 3.0)" or
- TC_String_Array(5) /= "(2.0, 5.0)" or
- TC_String_Array(6) /= "(3.0, 7.0)"
- then
- Report.Failed("Incorrect format for complex values that " &
- "have been placed into string variables " &
- "using the Complex_IO.Put procedure for " &
- "strings");
- end if;
-
- if TC_Verbose then
- Report.Comment("String format of Complex values verified");
- end if;
-
- -- Get complex values from strings using the Procedure Get.
- -- Compare with expected complex values.
-
- for i in 1..Number_Of_Complex_Items loop
-
- C_IO.Get(From => TC_String_Array(i),
- Item => TC_Complex,
- Last => TC_Last_Character_Read);
-
- if TC_Complex /= Complex_Array(i) then
- Report.Failed("Incorrect complex data value obtained " &
- "from String following use of Procedures " &
- "Put and Get from Strings, Complex_Array " &
- "item #" & Integer'Image(i));
- end if;
- end loop;
-
- if TC_Verbose then
- Report.Comment("Complex values removed from String array");
- end if;
-
- -- Verify that Layout_Error is raised if the given string is
- -- too short to hold the formatted output.
- Layout_Error_On_Put:
- declare
- Much_Too_Short : String(1..2);
- Complex_Value : Complex_Pack.Complex := (5.0, 0.0);
- begin
- C_IO.Put(Much_Too_Short, Complex_Value);
- Report.Failed("Layout_Error not raised by Procedure Put " &
- "when the given string was too short to " &
- "hold the formatted output");
- exception
- when Layout_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed
- ("Unexpected exception raised by Procedure Put when " &
- "the given string was too short to hold the " &
- "formatted output");
- end Layout_Error_On_Put;
-
- if TC_Verbose then
- Report.Comment("Layout Errors verified");
- end if;
-
- exception
- when others =>
- Report.Failed("Unexpected exception raised during the " &
- "evaluation of Put and Get for Strings");
- end;
-
-
- -- Place complex values into strings using a variety of legal
- -- complex data formats.
- declare
-
- type String_Ptr is access String;
-
- TC_Complex_String_Array :
- array (1..Number_Of_Complex_Items) of String_Ptr :=
- (new String'( "(3.0, 9.0 )" ),
- new String'( "+4.0 +7.0" ),
- new String'( "(5.0 6.0)" ),
- new String'( "6.0, 3.0" ),
- new String'( " ( 2.0 , 5.0 ) " ),
- new String'( "(3.0 7.0)" ));
-
- -- The following array contains Positive values that correspond
- -- to the last character that will be read by Procedure Get when
- -- given each of the above strings as input.
-
- TC_Last_Char_Array : array (1..Number_Of_Complex_Items)
- of Positive := (12,10,9,8,20,22);
-
- begin
-
- -- Get complex values from strings using the Procedure Get.
- -- Compare with expected complex values.
-
- for i in 1..Number_Of_Complex_Items loop
-
- C_IO.Get(TC_Complex_String_Array(i).all,
- TC_Complex,
- TC_Last_Character_Read);
-
- if TC_Complex /= Complex_Array(i) then
- Report.Failed
- ("Incorrect complex data value obtained from " &
- "Procedure Get with complex data input of: " &
- TC_Complex_String_Array(i).all);
- end if;
-
- if TC_Last_Character_Read /= TC_Last_Char_Array(i) then
- Report.Failed
- ("Incorrect value returned as the last character of " &
- "the input string processed by Procedure Get, " &
- "string value : " & TC_Complex_String_Array(i).all &
- " expected last character value read : " &
- Positive'Image(TC_Last_Char_Array(i)) &
- " last character value read : " &
- Positive'Image(TC_Last_Character_Read));
- end if;
-
- end loop;
-
- if TC_Verbose then
- Report.Comment("Complex values removed from strings and " &
- "verified against expected values");
- end if;
-
- exception
- when others =>
- Report.Failed("Unexpected exception raised during the " &
- "evaluation of Get for Strings");
- end;
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- -- Delete the external file.
- if Ada.Text_IO.Is_Open(Data_File) then
- Ada.Text_IO.Delete(Data_File);
- else
- Ada.Text_IO.Open(Data_File,
- Ada.Text_IO.In_File,
- Data_Filename);
- Ada.Text_IO.Delete(Data_File);
- end if;
-
- exception
-
- -- Since Use_Error can be raised if, for the specified mode,
- -- the environment does not support Text_IO operations, the
- -- following handlers are included:
-
- when Ada.Text_IO.Use_Error =>
- Report.Not_Applicable ("Use_Error raised on Text_IO Create");
-
- when Ada.Text_IO.Name_Error =>
- Report.Not_Applicable ("Name_Error raised on Text_IO Create");
-
- when others =>
- Report.Failed ("Unexpected exception raised on text file Create");
-
- end Test_for_Text_IO_Support;
-
- Report.Result;
-
-end CXG1003;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg1004.a b/gcc/testsuite/ada/acats/tests/cxg/cxg1004.a
deleted file mode 100644
index f026eae70db..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg1004.a
+++ /dev/null
@@ -1,360 +0,0 @@
--- CXG1004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the specified exceptions are raised by the subprograms
--- defined in package Ada.Numerics.Generic_Complex_Elementary_Functions
--- given the prescribed input parameter values.
---
--- TEST DESCRIPTION:
--- This test checks that specific subprograms defined in the
--- package Ada.Numerics.Generic_Complex_Elementary_Functions raise the
--- exceptions Argument_Error and Constraint_Error when their input
--- parameter value are those specified as causing each exception.
--- In the case of Constraint_Error, the exception will be raised in
--- each test case, provided that the value of the attribute
--- 'Machine_Overflows (for the actual type of package
--- Generic_Complex_Type) is True.
---
--- APPLICABILITY CRITERIA:
--- This test only applies to implementations supporting the
--- numerics annex.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 16 Nov 95 SAIC Corrected visibility problems for ACVC 2.0.1.
--- 29 Sep 96 SAIC Incorporated reviewer comments.
--- 02 Jun 98 EDS Replace "_i" with "_One".
---!
-
-with Ada.Numerics.Generic_Complex_Types;
-with Ada.Numerics.Generic_Complex_Elementary_Functions;
-with Report;
-
-procedure CXG1004 is
-begin
-
- Report.Test ("CXG1004", "Check that the specified exceptions are " &
- "raised by the subprograms defined in package " &
- "Ada.Numerics.Generic_Complex_Elementary_" &
- "Functions given the prescribed input " &
- "parameter values");
-
- Test_Block:
- declare
-
- type Real_Type is new Float;
-
- TC_Overflows : Boolean := Real_Type'Machine_Overflows;
-
- package Complex_Pack is
- new Ada.Numerics.Generic_Complex_Types(Real_Type);
-
- package CEF is
- new Ada.Numerics.Generic_Complex_Elementary_Functions(Complex_Pack);
-
- use Ada.Numerics, Complex_Pack, CEF;
-
- Complex_Zero : constant Complex := Compose_From_Cartesian(0.0, 0.0);
- Plus_One : constant Complex := Compose_From_Cartesian(1.0, 0.0);
- Minus_One : constant Complex := Compose_From_Cartesian(-1.0, 0.0);
- Plus_i : constant Complex := Compose_From_Cartesian(i);
- Minus_i : constant Complex := Compose_From_Cartesian(-i);
-
- Complex_Negative_Real : constant Complex :=
- Compose_From_Cartesian(-4.0, 2.0);
- Complex_Negative_Imaginary : constant Complex :=
- Compose_From_Cartesian(3.0, -5.0);
-
- TC_Complex : Complex;
-
-
- -- This procedure is used in "Exception Raising" calls below in an
- -- attempt to avoid elimination of the subtest through optimization.
-
- procedure No_Optimize (The_Complex_Number : Complex) is
- begin
- Report.Comment("No Optimize: Should never be printed " &
- Integer'Image(Integer(The_Complex_Number.Im)));
- end No_Optimize;
-
-
- begin
-
- -- Check that the exception Numerics.Argument_Error is raised by the
- -- exponentiation operator when the value of the left operand is zero,
- -- and the real component of the exponent (or the exponent itself) is
- -- zero.
-
- begin
- TC_Complex := "**"(Left => Complex_Zero, Right => Complex_Zero);
- Report.Failed("Argument_Error not raised by exponentiation " &
- "operator, left operand = complex zero, right " &
- "operand = complex zero");
- No_Optimize(TC_Complex);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by exponentiation " &
- "operator, left operand = complex zero, right " &
- "operand = complex zero");
- end;
-
- begin
- TC_Complex := Complex_Zero**0.0;
- Report.Failed("Argument_Error not raised by exponentiation " &
- "operator, left operand = complex zero, right " &
- "operand = real zero");
- No_Optimize(TC_Complex);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by exponentiation " &
- "operator, left operand = complex zero, right " &
- "operand = real zero");
- end;
-
-
- begin
- TC_Complex := "**"(Left => 0.0, Right => Complex_Zero);
- Report.Failed("Argument_Error not raised by exponentiation " &
- "operator, left operand = real zero, right " &
- "operand = complex zero");
- No_Optimize(TC_Complex);
- exception
- when Argument_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by exponentiation " &
- "operator, left operand = real zero, right " &
- "operand = complex zero");
- end;
-
-
- -- Check that the exception Constraint_Error is raised under the
- -- specified circumstances, provided that
- -- Complex_Types.Real'Machine_Overflows is True.
-
- if TC_Overflows then
-
- -- Raised by Log, when the value of the parameter X is zero.
- begin
- TC_Complex := Log (X => Complex_Zero);
- Report.Failed("Constraint_Error not raised when Function " &
- "Log given parameter value of complex zero");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when Function " &
- "Log given parameter value of complex zero");
- end;
-
- -- Raised by Cot, when the value of the parameter X is zero.
- begin
- TC_Complex := Cot (X => Complex_Zero);
- Report.Failed("Constraint_Error not raised when Function " &
- "Cot given parameter value of complex zero");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when Function " &
- "Cot given parameter value of complex zero");
- end;
-
- -- Raised by Coth, when the value of the parameter X is zero.
- begin
- TC_Complex := Coth (Complex_Zero);
- Report.Failed("Constraint_Error not raised when Function " &
- "Coth given parameter value of complex zero");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when Function " &
- "Coth given parameter value of complex zero");
- end;
-
- -- Raised by the exponentiation operator, when the value of the
- -- left operand is zero and the real component of the exponent
- -- is negative.
- begin
- TC_Complex := Complex_Zero**Complex_Negative_Real;
- Report.Failed("Constraint_Error not raised when the " &
- "exponentiation operator left operand is " &
- "complex zero, and the real component of " &
- "the exponent is negative");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when the " &
- "exponentiation operator left operand is " &
- "complex zero, and the real component of " &
- "the exponent is negative");
- end;
-
- -- Raised by the exponentiation operator, when the value of the
- -- left operand is zero and the exponent itself (when it is of
- -- type real) is negative.
- declare
- Negative_Exponent : constant Real_Type := -4.0;
- begin
- TC_Complex := Complex_Zero**Negative_Exponent;
- Report.Failed("Constraint_Error not raised when the " &
- "exponentiation operator left operand is " &
- "complex zero, and the real exponent is " &
- "negative");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when the " &
- "exponentiation operator left operand is " &
- "complex zero, and the real exponent is " &
- "negative");
- end;
-
- -- Raised by Arctan, when the value of the parameter is +i.
- begin
- TC_Complex := Arctan (Plus_i);
- Report.Failed("Constraint_Error not raised when Function " &
- "Arctan is given parameter value +i");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when Function " &
- "Arctan is given parameter value +i");
- end;
-
- -- Raised by Arctan, when the value of the parameter is -i.
- begin
- TC_Complex := Arctan (Minus_i);
- Report.Failed("Constraint_Error not raised when Function " &
- "Arctan is given parameter value -i");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when Function " &
- "Arctan is given parameter value -i");
- end;
-
- -- Raised by Arccot, when the value of the parameter is +i.
- begin
- TC_Complex := Arccot (Plus_i);
- Report.Failed("Constraint_Error not raised when Function " &
- "Arccot is given parameter value +i");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when Function " &
- "Arccot is given parameter value +i");
- end;
-
- -- Raised by Arccot, when the value of the parameter is -i.
- begin
- TC_Complex := Arccot (Minus_i);
- Report.Failed("Constraint_Error not raised when Function " &
- "Arccot is given parameter value -i");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when Function " &
- "Arccot is given parameter value -i");
- end;
-
- -- Raised by Arctanh, when the value of the parameter is +1.
- begin
- TC_Complex := Arctanh (Plus_One);
- Report.Failed("Constraint_Error not raised when Function " &
- "Arctanh is given parameter value +1");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when Function " &
- "Arctanh is given parameter value +1");
- end;
-
- -- Raised by Arctanh, when the value of the parameter is -1.
- begin
- TC_Complex := Arctanh (Minus_One);
- Report.Failed("Constraint_Error not raised when Function " &
- "Arctanh is given parameter value -1");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when Function " &
- "Arctanh is given parameter value -1");
- end;
-
- -- Raised by Arccoth, when the value of the parameter is +1.
- begin
- TC_Complex := Arccoth (Plus_One);
- Report.Failed("Constraint_Error not raised when Function " &
- "Arccoth is given parameter value +1");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when Function " &
- "Arccoth is given parameter value +1");
- end;
-
- -- Raised by Arccoth, when the value of the parameter is -1.
- begin
- TC_Complex := Arccoth (Minus_One);
- Report.Failed("Constraint_Error not raised when Function " &
- "Arccoth is given parameter value -1");
- No_Optimize(TC_Complex);
- exception
- when Constraint_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised when Function " &
- "Arccoth is given parameter value -1");
- end;
-
- else
- Report.Comment
- ("Attribute Complex_Pack.Real'Machine_Overflows is False; " &
- "evaluation of the complex elementary functions under " &
- "specified circumstances was not performed");
- end if;
-
-
- exception
- when others =>
- Report.Failed ("Unexpected exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXG1004;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg1005.a b/gcc/testsuite/ada/acats/tests/cxg/cxg1005.a
deleted file mode 100644
index 6faad4e1357..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg1005.a
+++ /dev/null
@@ -1,393 +0,0 @@
--- CXG1005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the subprograms defined in the package
--- Ada.Numerics.Generic_Complex_Elementary_Functions provide correct
--- results.
---
--- TEST DESCRIPTION:
--- This test checks that specific subprograms defined in the generic
--- package Generic_Complex_Elementary_Functions are available, and that
--- they provide prescribed results given specific input values.
--- The generic package Ada.Numerics.Generic_Complex_Types is instantiated
--- with a real type (new Float). The resulting new package is used as
--- the generic actual to package Complex_IO.
---
--- SPECIAL REQUIREMENTS:
--- Implementations for which Float'Signed_Zeros is True must provide
--- a body for ImpDef.Annex_G.Negative_Zero which returns a negative
--- zero.
---
--- APPLICABILITY CRITERIA
--- This test only applies to implementations that support the
--- numerics annex.
---
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 16 Nov 95 SAIC Corrected visibility problems for ACVC 2.0.1.
--- 21 Feb 96 SAIC Incorporated new structure for package Impdef.
--- 29 Sep 96 SAIC Incorporated reviewer comments.
---
---!
-
-with Ada.Numerics.Generic_Complex_Types;
-with Ada.Numerics.Generic_Complex_Elementary_Functions;
-with ImpDef.Annex_G;
-with Report;
-
-procedure CXG1005 is
-begin
-
- Report.Test ("CXG1005", "Check that the subprograms defined in " &
- "the package Generic_Complex_Elementary_" &
- "Functions provide correct results");
-
- Test_Block:
- declare
-
- type Real_Type is new Float;
-
- TC_Signed_Zeros : Boolean := Real_Type'Signed_Zeros;
-
- package Complex_Pack is new
- Ada.Numerics.Generic_Complex_Types(Real_Type);
-
- package CEF is
- new Ada.Numerics.Generic_Complex_Elementary_Functions(Complex_Pack);
-
- use Ada.Numerics, Complex_Pack, CEF;
-
- Complex_Zero : constant Complex := Compose_From_Cartesian( 0.0, 0.0);
- Plus_One : constant Complex := Compose_From_Cartesian( 1.0, 0.0);
- Minus_One : constant Complex := Compose_From_Cartesian(-1.0, 0.0);
- Plus_i : constant Complex := Compose_From_Cartesian(i);
- Minus_i : constant Complex := Compose_From_Cartesian(-i);
-
- Complex_Positive_Real : constant Complex :=
- Compose_From_Cartesian(4.0, 2.0);
- Complex_Positive_Imaginary : constant Complex :=
- Compose_From_Cartesian(3.0, 5.0);
- Complex_Negative_Real : constant Complex :=
- Compose_From_Cartesian(-4.0, 2.0);
- Complex_Negative_Imaginary : constant Complex :=
- Compose_From_Cartesian(3.0, -5.0);
-
-
- function A_Zero_Result (Z : Complex) return Boolean is
- begin
- return (Re(Z) = 0.0 and Im(Z) = 0.0);
- end A_Zero_Result;
-
-
- -- In order to evaluate complex elementary functions that are
- -- prescribed to return a "real" result (meaning that the imaginary
- -- component is zero), the Function A_Real_Result is defined.
-
- function A_Real_Result (Z : Complex) return Boolean is
- begin
- return Im(Z) = 0.0;
- end A_Real_Result;
-
-
- -- In order to evaluate complex elementary functions that are
- -- prescribed to return an "imaginary" result (meaning that the real
- -- component of the complex number is zero, and the imaginary
- -- component is non-zero), the Function An_Imaginary_Result is defined.
-
- function An_Imaginary_Result (Z : Complex) return Boolean is
- begin
- return (Re(Z) = 0.0 and Im(Z) /= 0.0);
- end An_Imaginary_Result;
-
-
- begin
-
- -- Check that when the input parameter value is zero, the following
- -- functions yield a zero result.
-
- if not A_Zero_Result( Sqrt(Complex_Zero) ) then
- Report.Failed("Non-zero result from Function Sqrt with zero input");
- end if;
-
- if not A_Zero_Result( Sin(Complex_Zero) ) then
- Report.Failed("Non-zero result from Function Sin with zero input");
- end if;
-
- if not A_Zero_Result( Arcsin(Complex_Zero) ) then
- Report.Failed("Non-zero result from Function Arcsin with zero " &
- "input");
- end if;
-
- if not A_Zero_Result( Tan(Complex_Zero) ) then
- Report.Failed("Non-zero result from Function Tan with zero input");
- end if;
-
- if not A_Zero_Result( Arctan(Complex_Zero) ) then
- Report.Failed("Non-zero result from Function Arctan with zero " &
- "input");
- end if;
-
- if not A_Zero_Result( Sinh(Complex_Zero) ) then
- Report.Failed("Non-zero result from Function Sinh with zero input");
- end if;
-
- if not A_Zero_Result( Arcsinh(Complex_Zero) ) then
- Report.Failed("Non-zero result from Function Arcsinh with zero " &
- "input");
- end if;
-
- if not A_Zero_Result( Tanh(Complex_Zero) ) then
- Report.Failed("Non-zero result from Function Tanh with zero input");
- end if;
-
- if not A_Zero_Result( Arctanh(Complex_Zero) ) then
- Report.Failed("Non-zero result from Function Arctanh with zero " &
- "input");
- end if;
-
-
- -- Check that when the input parameter value is zero, the following
- -- functions yield a result of one.
-
- if Exp(Complex_Zero) /= Plus_One
- then
- Report.Failed("Non-zero result from Function Exp with zero input");
- end if;
-
- if Cos(Complex_Zero) /= Plus_One
- then
- Report.Failed("Non-zero result from Function Cos with zero input");
- end if;
-
- if Cosh(Complex_Zero) /= Plus_One
- then
- Report.Failed("Non-zero result from Function Cosh with zero input");
- end if;
-
-
- -- Check that when the input parameter value is zero, the following
- -- functions yield a real result.
-
- if not A_Real_Result( Arccos(Complex_Zero) ) then
- Report.Failed("Non-real result from Function Arccos with zero input");
- end if;
-
- if not A_Real_Result( Arccot(Complex_Zero) ) then
- Report.Failed("Non-real result from Function Arccot with zero input");
- end if;
-
-
- -- Check that when the input parameter value is zero, the following
- -- functions yield an imaginary result.
-
- if not An_Imaginary_Result( Arccoth(Complex_Zero) ) then
- Report.Failed("Non-imaginary result from Function Arccoth with " &
- "zero input");
- end if;
-
-
- -- Check that when the input parameter value is one, the Sqrt function
- -- yields a result of one.
-
- if Sqrt(Plus_One) /= Plus_One then
- Report.Failed("Incorrect result from Function Sqrt with input " &
- "value of one");
- end if;
-
-
- -- Check that when the input parameter value is one, the following
- -- functions yield a result of zero.
-
- if not A_Zero_Result( Log(Plus_One) ) then
- Report.Failed("Non-zero result from Function Log with input " &
- "value of one");
- end if;
-
- if not A_Zero_Result( Arccos(Plus_One) ) then
- Report.Failed("Non-zero result from Function Arccos with input " &
- "value of one");
- end if;
-
- if not A_Zero_Result( Arccosh(Plus_One) ) then
- Report.Failed("Non-zero result from Function Arccosh with input " &
- "value of one");
- end if;
-
-
- -- Check that when the input parameter value is one, the Arcsin
- -- function yields a real result.
-
- if not A_Real_Result( Arcsin(Plus_One) ) then
- Report.Failed("Non-real result from Function Arcsin with input " &
- "value of one");
- end if;
-
-
- -- Check that when the input parameter value is minus one, the Sqrt
- -- function yields a result of "i", when the sign of the imaginary
- -- component of the input parameter is positive (and yields "-i", if
- -- the sign on the imaginary component is negative), and the
- -- Complex_Types.Real'Signed_Zeros attribute is True.
-
- if TC_Signed_Zeros then
-
- declare
- Minus_One_With_Pos_Zero_Im_Component : Complex :=
- Compose_From_Cartesian(-1.0, +0.0);
- Minus_One_With_Neg_Zero_Im_Component : Complex :=
- Compose_From_Cartesian
- (-1.0, Real_Type(ImpDef.Annex_G.Negative_Zero));
- begin
-
- if Sqrt(Minus_One_With_Pos_Zero_Im_Component) /= Plus_i then
- Report.Failed("Incorrect result from Function Sqrt, when " &
- "input value is minus one with a positive " &
- "imaginary component, Signed_Zeros being True");
- end if;
-
- if Sqrt(Minus_One_With_Neg_Zero_Im_Component) /= Minus_i then
- Report.Failed("Incorrect result from Function Sqrt, when " &
- "input value is minus one with a negative " &
- "imaginary component, Signed_Zeros being True");
- end if;
- end;
-
- else -- Signed_Zeros is False.
-
- -- Check that when the input parameter value is minus one, the Sqrt
- -- function yields a result of "i", when the
- -- Complex_Types.Real'Signed_Zeros attribute is False.
-
- if Sqrt(Minus_One) /= Plus_i then
- Report.Failed("Incorrect result from Function Sqrt, when " &
- "input value is minus one, Signed_Zeros being " &
- "False");
- end if;
-
- end if;
-
-
- -- Check that when the input parameter value is minus one, the Log
- -- function yields an imaginary result.
-
- if not An_Imaginary_Result( Log(Minus_One) ) then
- Report.Failed("Non-imaginary result from Function Log with a " &
- "minus one input value");
- end if;
-
- -- Check that when the input parameter is minus one, the following
- -- functions yield a real result.
-
- if not A_Real_Result( Arcsin(Minus_One) ) then
- Report.Failed("Non-real result from Function Arcsin with a " &
- "minus one input value");
- end if;
-
- if not A_Real_Result( Arccos(Minus_One) ) then
- Report.Failed("Non-real result from Function Arccos with a " &
- "minus one input value");
- end if;
-
-
- -- Check that when the input parameter has a value of +i or -i, the
- -- Log function yields an imaginary result.
-
- if not An_Imaginary_Result( Log(Plus_i) ) then
- Report.Failed("Non-imaginary result from Function Log with an " &
- "input value of ""+i""");
- end if;
-
- if not An_Imaginary_Result( Log(Minus_i) ) then
- Report.Failed("Non-imaginary result from Function Log with an " &
- "input value of ""-i""");
- end if;
-
-
- -- Check that exponentiation by a zero exponent yields the value one.
-
- if "**"(Left => Compose_From_Cartesian(5.0, 3.0),
- Right => Complex_Zero) /= Plus_One or
- Complex_Negative_Real**0.0 /= Plus_One or
- 15.0**Complex_Zero /= Plus_One
- then
- Report.Failed("Incorrect result from exponentiation with a zero " &
- "exponent");
- end if;
-
-
- -- Check that exponentiation by a unit exponent yields the value of
- -- the left operand (as a complex value).
- -- Note: a "unit exponent" is considered the complex number (1.0, 0.0)
-
- if "**"(Complex_Negative_Real, Plus_One) /=
- Complex_Negative_Real or
- Complex_Negative_Imaginary**Plus_One /=
- Complex_Negative_Imaginary or
- 4.0**Plus_One /=
- Compose_From_Cartesian(4.0, 0.0)
- then
- Report.Failed("Incorrect result from exponentiation with a unit " &
- "exponent");
- end if;
-
-
- -- Check that exponentiation of the value one yields the value one.
-
- if "**"(Plus_One, Complex_Negative_Imaginary) /= Plus_One or
- Plus_One**9.0 /= Plus_One or
- 1.0**Complex_Negative_Real /= Plus_One
- then
- Report.Failed("Incorrect result from exponentiation of the value " &
- "One");
- end if;
-
-
- -- Check that exponentiation of the value zero yields the value zero.
- begin
- if not A_Zero_Result("**"(Complex_Zero,
- Complex_Positive_Imaginary)) or
- not A_Zero_Result(Complex_Zero**4.0) or
- not A_Zero_Result(0.0**Complex_Positive_Real)
- then
- Report.Failed("Incorrect result from exponentiation of the " &
- "value zero");
- end if;
- exception
- when others =>
- Report.Failed("Exception raised during the exponentiation of " &
- "the complex value zero");
- end;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
- Report.Result;
-
-end CXG1005;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2001.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2001.a
deleted file mode 100644
index 0d7afa46091..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2001.a
+++ /dev/null
@@ -1,322 +0,0 @@
--- CXG2001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the floating point attributes Model_Mantissa,
--- Machine_Mantissa, Machine_Radix, and Machine_Rounds
--- are properly reported.
---
--- TEST DESCRIPTION:
--- This test uses a generic package to compute and check the
--- values of the Machine_ attributes listed above. The
--- generic package is instantiated with the standard FLOAT
--- type and a floating point type for the maximum number
--- of digits of precision.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
---
---
--- CHANGE HISTORY:
--- 26 JAN 96 SAIC Initial Release for 2.1
---
---!
-
--- References:
---
--- "Algorithms To Reveal Properties of Floating-Point Arithmetic"
--- Michael A. Malcolm; CACM November 1972; pgs 949-951.
---
--- Software Manual for Elementary Functions; W. J. Cody and W. Waite;
--- Prentice-Hall; 1980
------------------------------------------------------------------------
---
--- This test relies upon the fact that
--- (A+2.0)-A is not necessarily 2.0. If A is large enough then adding
--- a small value to A does not change the value of A. Consider the case
--- where we have a decimal based floating point representation with 4
--- digits of precision. A floating point number would logically be
--- represented as "DDDD * 10 ** exp" where D is a value in the range 0..9.
--- The first loop of the test starts A at 2.0 and doubles it until
--- ((A+1.0)-A)-1.0 is no longer zero. For our decimal floating point
--- number this will be 1638 * 10**1 (the value 16384 rounded or truncated
--- to fit in 4 digits).
--- The second loop starts B at 2.0 and keeps doubling B until (A+B)-A is
--- no longer 0. This will keep looping until B is 8.0 because that is
--- the first value where rounding (assuming our machine rounds and addition
--- employs a guard digit) will change the upper 4 digits of the result:
--- 1638_
--- + 8
--- -------
--- 1639_
--- Without rounding the second loop will continue until
--- B is 16:
--- 1638_
--- + 16
--- -------
--- 1639_
---
--- The radix is then determined by (A+B)-A which will give 10.
---
--- The use of Tmp and ITmp in the test is to force values to be
--- stored into memory in the event that register precision is greater
--- than the stored precision of the floating point values.
---
---
--- The test for rounding is (ignoring the temporary variables used to
--- get the stored precision) is
--- Rounds := A + Radix/2.0 - A /= 0.0 ;
--- where A is the value determined in the first step that is the smallest
--- power of 2 such that A + 1.0 = A. This means that the true value of
--- A has one more digit in its value than 'Machine_Mantissa.
--- This check will detect the case where a value is always rounded.
--- There is an additional case where values are rounded to the nearest
--- even value. That is referred to as IEEE style rounding in the test.
---
------------------------------------------------------------------------
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Elementary_Functions;
-procedure CXG2001 is
- Verbose : constant Boolean := False;
-
- -- if one of the attribute computation loops exceeds Max_Iterations
- -- it is most likely due to the compiler reordering an expression
- -- that should not be reordered.
- Illegal_Optimization : exception;
- Max_Iterations : constant := 10_000;
-
- generic
- type Real is digits <>;
- package Chk_Attrs is
- procedure Do_Test;
- end Chk_Attrs;
-
- package body Chk_Attrs is
- package EF is new Ada.Numerics.Generic_Elementary_Functions (Real);
- function Log (X : Real) return Real renames EF.Log;
-
-
- -- names used in paper
- Radix : Integer; -- Beta
- Mantissa_Digits : Integer; -- t
- Rounds : Boolean; -- RND
-
- -- made global to Determine_Attributes to help thwart optimization
- A, B : Real := 2.0;
- Tmp, Tmpa, Tmp1 : Real;
- ITmp : Integer;
- Half_Radix : Real;
-
- -- special constants - not declared as constants so that
- -- the "stored" precision will be used instead of a "register"
- -- precision.
- Zero : Real := 0.0;
- One : Real := 1.0;
- Two : Real := 2.0;
-
-
- procedure Thwart_Optimization is
- -- the purpose of this procedure is to reference the
- -- global variables used by Determine_Attributes so
- -- that the compiler is not likely to keep them in
- -- a higher precision register for their entire lifetime.
- begin
- if Report.Ident_Bool (False) then
- -- never executed
- A := A + 5.0;
- B := B + 6.0;
- Tmp := Tmp + 1.0;
- Tmp1 := Tmp1 + 2.0;
- Tmpa := Tmpa + 2.0;
- One := 12.34; Two := 56.78; Zero := 90.12;
- end if;
- end Thwart_Optimization;
-
-
- -- determines values for Radix, Mantissa_Digits, and Rounds
- -- This is mostly a straight translation of the C code.
- -- The only significant addition is the iteration count
- -- to prevent endless looping if things are really screwed up.
- procedure Determine_Attributes is
- Iterations : Integer;
- begin
- Rounds := True;
-
- Iterations := 0;
- Tmp := Real'Machine (((A + One) - A) - One);
- while Tmp = Zero loop
- A := Real'Machine(A + A);
- Tmp := Real'Machine(A + One);
- Tmp1 := Real'Machine(Tmp - A);
- Tmp := Real'Machine(Tmp1 - One);
-
- Iterations := Iterations + 1;
- if Iterations > Max_Iterations then
- raise Illegal_Optimization;
- end if;
- end loop;
-
- Iterations := 0;
- Tmp := Real'Machine(A + B);
- ITmp := Integer (Tmp - A);
- while ITmp = 0 loop
- B := Real'Machine(B + B);
- Tmp := Real'Machine(A + B);
- ITmp := Integer (Tmp - A);
-
- Iterations := Iterations + 1;
- if Iterations > Max_Iterations then
- raise Illegal_Optimization;
- end if;
- end loop;
-
- Radix := ITmp;
-
- Mantissa_Digits := 0;
- B := 1.0;
- Tmp := Real'Machine(((B + One) - B) - One);
- Iterations := 0;
- while (Tmp = Zero) loop
- Mantissa_Digits := Mantissa_Digits + 1;
- B := B * Real (Radix);
- Tmp := Real'Machine(B + One);
- Tmp1 := Real'Machine(Tmp - B);
- Tmp := Real'Machine(Tmp1 - One);
-
- Iterations := Iterations + 1;
- if Iterations > Max_Iterations then
- raise Illegal_Optimization;
- end if;
- end loop;
-
- Rounds := False;
- Half_Radix := Real (Radix) / Two;
- Tmp := Real'Machine(A + Half_Radix);
- Tmp1 := Real'Machine(Tmp - A);
- if (Tmp1 /= Zero) then
- Rounds := True;
- end if;
- Tmpa := Real'Machine(A + Real (Radix));
- Tmp := Real'Machine(Tmpa + Half_Radix);
- if not Rounds and (Tmp - TmpA /= Zero) then
- Rounds := True;
- if Verbose then
- Report.Comment ("IEEE style rounding");
- end if;
- end if;
-
- exception
- when others =>
- Thwart_Optimization;
- raise;
- end Determine_Attributes;
-
-
- procedure Do_Test is
- Show_Results : Boolean := Verbose;
- Min_Mantissa_Digits : Integer;
- begin
- -- compute the actual Machine_* attribute values
- Determine_Attributes;
-
- if Real'Machine_Radix /= Radix then
- Report.Failed ("'Machine_Radix incorrectly reports" &
- Integer'Image (Real'Machine_Radix));
- Show_Results := True;
- end if;
-
- if Real'Machine_Mantissa /= Mantissa_Digits then
- Report.Failed ("'Machine_Mantissa incorrectly reports" &
- Integer'Image (Real'Machine_Mantissa));
- Show_Results := True;
- end if;
-
- if Real'Machine_Rounds /= Rounds then
- Report.Failed ("'Machine_Rounds incorrectly reports " &
- Boolean'Image (Real'Machine_Rounds));
- Show_Results := True;
- end if;
-
- if Show_Results then
- Report.Comment ("computed Machine_Mantissa is" &
- Integer'Image (Mantissa_Digits));
- Report.Comment ("computed Radix is" &
- Integer'Image (Radix));
- Report.Comment ("computed Rounds is " &
- Boolean'Image (Rounds));
- end if;
-
- -- check the model attributes against the machine attributes
- -- G.2.2(3)/3;6.0
- if Real'Model_Mantissa > Real'Machine_Mantissa then
- Report.Failed ("model mantissa > machine mantissa");
- end if;
-
- -- G.2.2(3)/2;6.0
- -- 'Model_Mantissa >= ceiling(d*log(10)/log(radix))+1
- Min_Mantissa_Digits :=
- Integer (
- Real'Ceiling (
- Real(Real'Digits) * Log(10.0) / Log(Real(Real'Machine_Radix))
- ) ) + 1;
- if Real'Model_Mantissa < Min_Mantissa_Digits then
- Report.Failed ("Model_Mantissa [" &
- Integer'Image (Real'Model_Mantissa) &
- "] < minimum mantissa digits [" &
- Integer'Image (Min_Mantissa_Digits) &
- "]");
- end if;
-
- exception
- when Illegal_Optimization =>
- Report.Failed ("illegal optimization of" &
- " floating point expression");
- end Do_Test;
- end Chk_Attrs;
-
- package Chk_Float is new Chk_Attrs (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package Chk_A_Long_Float is new Chk_Attrs (A_Long_Float);
-begin
- Report.Test ("CXG2001",
- "Check the attributes Model_Mantissa," &
- " Machine_Mantissa, Machine_Radix," &
- " and Machine_Rounds");
-
- Report.Comment ("checking Standard.Float");
- Chk_Float.Do_Test;
-
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- Chk_A_Long_Float.Do_Test;
-
- Report.Result;
-end CXG2001;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2002.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2002.a
deleted file mode 100644
index 6a1f322e8bf..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2002.a
+++ /dev/null
@@ -1,468 +0,0 @@
--- CXG2002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the complex "abs" or modulus function returns
--- results that are within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test uses a generic package to compute and check the
--- values of the modulus function. In addition, a non-generic
--- copy of this package is used to check the non-generic package
--- Ada.Numerics.Complex_Types.
--- Of special interest is the case where either the real or
--- the imaginary part of the argument is very large while the
--- other part is very small or 0.
--- We want to check that the value is computed such that
--- an overflow does not occur. If computed directly from the
--- definition
--- abs (x+yi) = sqrt(x**2 + y**2)
--- then overflow or underflow is much more likely than if the
--- argument is normalized first.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 31 JAN 96 SAIC Initial release for 2.1
--- 02 JUN 98 EDS Add parens to intermediate calculations.
---!
-
---
--- Reference:
--- Problems and Methodologies in Mathematical Software Production;
--- editors: P. C. Messina and A Murli;
--- Lecture Notes in Computer Science
--- Volume 142
--- Springer Verlag 1982
---
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Complex_Types;
-with Ada.Numerics.Complex_Types;
-procedure CXG2002 is
- Verbose : constant Boolean := False;
- Maximum_Relative_Error : constant := 3.0;
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Complex_Types is new
- Ada.Numerics.Generic_Complex_Types (Real);
- use Complex_Types;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real := Maximum_Relative_Error) is
- Rel_Error,
- Abs_Error,
- Max_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * (abs Expected * Real'Model_Epsilon);
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " &
- Real'Image (Expected - Actual) &
- " max_err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Do_Test is
- Z : Complex;
- X : Real;
- T : Real;
- begin
-
- --- test 1 ---
- begin
- T := Real'Safe_Last;
- Z := T + 0.0*i;
- X := abs Z;
- Check (X, T, "test 1 -- abs(bigreal + 0i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 1");
- when others =>
- Report.Failed ("exception in test 1");
- end;
-
- --- test 2 ---
- begin
- T := Real'Safe_Last;
- Z := 0.0 + T*i;
- X := Modulus (Z);
- Check (X, T, "test 2 -- abs(0 + bigreal*i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 2");
- when others =>
- Report.Failed ("exception in test 2");
- end;
-
- --- test 3 ---
- begin
- Z := 3.0 + 4.0*i;
- X := abs Z;
- Check (X, 5.0 , "test 3 -- abs(3 + 4*i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 3");
- when others =>
- Report.Failed ("exception in test 3");
- end;
-
- --- test 4 ---
- declare
- S : Real;
- begin
- S := Real(Real'Machine_Radix) ** (Real'Machine_EMax - 3);
- Z := 3.0 * S + 4.0*S*i;
- X := abs Z;
- Check (X, 5.0*S, "test 4 -- abs(3S + 4S*i) for large S",
- 5.0*Real'Model_Epsilon);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 4");
- when others =>
- Report.Failed ("exception in test 4");
- end;
-
- --- test 5 ---
- begin
- T := Real'Model_Small;
- Z := T + 0.0*i;
- X := abs Z;
- Check (X, T , "test 5 -- abs(small + 0*i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 5");
- when others =>
- Report.Failed ("exception in test 5");
- end;
-
- --- test 6 ---
- begin
- T := Real'Model_Small;
- Z := 0.0 + T*i;
- X := abs Z;
- Check (X, T , "test 6 -- abs(0 + small*i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 6");
- when others =>
- Report.Failed ("exception in test 6");
- end;
-
- --- test 7 ---
- declare
- S : Real;
- begin
- S := Real(Real'Machine_Radix) ** (Real'Model_EMin + 3);
- Z := 3.0 * S + 4.0*S*i;
- X := abs Z;
- Check (X, 5.0*S, "test 7 -- abs(3S + 4S*i) for small S",
- 5.0*Real'Model_Epsilon);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 7");
- when others =>
- Report.Failed ("exception in test 7");
- end;
-
- --- test 8 ---
- declare
- -- CRC Standard Mathematical Tables; 23rd Edition; pg 738
- Sqrt2 : constant :=
- 1.41421_35623_73095_04880_16887_24209_69807_85696_71875_37695;
- begin
- Z := 1.0 + 1.0*i;
- X := abs Z;
- Check (X, Sqrt2 , "test 8 -- abs(1 + 1*i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 8");
- when others =>
- Report.Failed ("exception in test 8");
- end;
-
- --- test 9 ---
- begin
- T := 0.0;
- Z := T + 0.0*i;
- X := abs Z;
- Check (X, T , "test 5 -- abs(0 + 0*i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 9");
- when others =>
- Report.Failed ("exception in test 9");
- end;
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- --- non generic copy of the above generic package
- -----------------------------------------------------------------------
-
- package Non_Generic_Check is
- subtype Real is Float;
- procedure Do_Test;
- end Non_Generic_Check;
-
- package body Non_Generic_Check is
- use Ada.Numerics.Complex_Types;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real := Maximum_Relative_Error) is
- Rel_Error,
- Abs_Error,
- Max_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * (abs Expected * Real'Model_Epsilon);
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " &
- Real'Image (Expected - Actual) &
- " max_err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Do_Test is
- Z : Complex;
- X : Real;
- T : Real;
- begin
-
- --- test 1 ---
- begin
- T := Real'Safe_Last;
- Z := T + 0.0*i;
- X := abs Z;
- Check (X, T, "test 1 -- abs(bigreal + 0i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 1");
- when others =>
- Report.Failed ("exception in test 1");
- end;
-
- --- test 2 ---
- begin
- T := Real'Safe_Last;
- Z := 0.0 + T*i;
- X := Modulus (Z);
- Check (X, T, "test 2 -- abs(0 + bigreal*i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 2");
- when others =>
- Report.Failed ("exception in test 2");
- end;
-
- --- test 3 ---
- begin
- Z := 3.0 + 4.0*i;
- X := abs Z;
- Check (X, 5.0 , "test 3 -- abs(3 + 4*i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 3");
- when others =>
- Report.Failed ("exception in test 3");
- end;
-
- --- test 4 ---
- declare
- S : Real;
- begin
- S := Real(Real'Machine_Radix) ** (Real'Machine_EMax - 3);
- Z := 3.0 * S + 4.0*S*i;
- X := abs Z;
- Check (X, 5.0*S, "test 4 -- abs(3S + 4S*i) for large S",
- 5.0*Real'Model_Epsilon);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 4");
- when others =>
- Report.Failed ("exception in test 4");
- end;
-
- --- test 5 ---
- begin
- T := Real'Model_Small;
- Z := T + 0.0*i;
- X := abs Z;
- Check (X, T , "test 5 -- abs(small + 0*i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 5");
- when others =>
- Report.Failed ("exception in test 5");
- end;
-
- --- test 6 ---
- begin
- T := Real'Model_Small;
- Z := 0.0 + T*i;
- X := abs Z;
- Check (X, T , "test 6 -- abs(0 + small*i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 6");
- when others =>
- Report.Failed ("exception in test 6");
- end;
-
- --- test 7 ---
- declare
- S : Real;
- begin
- S := Real(Real'Machine_Radix) ** (Real'Model_EMin + 3);
- Z := 3.0 * S + 4.0*S*i;
- X := abs Z;
- Check (X, 5.0*S, "test 7 -- abs(3S + 4S*i) for small S",
- 5.0*Real'Model_Epsilon);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 7");
- when others =>
- Report.Failed ("exception in test 7");
- end;
-
- --- test 8 ---
- declare
- -- CRC Standard Mathematical Tables; 23rd Edition; pg 738
- Sqrt2 : constant :=
- 1.41421_35623_73095_04880_16887_24209_69807_85696_71875_37695;
- begin
- Z := 1.0 + 1.0*i;
- X := abs Z;
- Check (X, Sqrt2 , "test 8 -- abs(1 + 1*i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 8");
- when others =>
- Report.Failed ("exception in test 8");
- end;
-
- --- test 9 ---
- begin
- T := 0.0;
- Z := T + 0.0*i;
- X := abs Z;
- Check (X, T , "test 5 -- abs(0 + 0*i)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 9");
- when others =>
- Report.Failed ("exception in test 9");
- end;
- end Do_Test;
- end Non_Generic_Check;
-
- -----------------------------------------------------------------------
- --- end of "manual instantiation"
- -----------------------------------------------------------------------
- package Chk_Float is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package Chk_A_Long_Float is new Generic_Check (A_Long_Float);
-begin
- Report.Test ("CXG2002",
- "Check the accuracy of the complex modulus" &
- " function");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
- Chk_Float.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
- Chk_A_Long_Float.Do_Test;
-
- if Verbose then
- Report.Comment ("checking non-generic package");
- end if;
- Non_Generic_Check.Do_Test;
- Report.Result;
-end CXG2002;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2003.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2003.a
deleted file mode 100644
index d1a225a50a1..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2003.a
+++ /dev/null
@@ -1,701 +0,0 @@
--- CXG2003.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the sqrt function returns
--- results that are within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test contains three test packages that are almost
--- identical. The first two packages differ only in the
--- floating point type that is being tested. The first
--- and third package differ only in whether the generic
--- elementary functions package or the pre-instantiated
--- package is used.
--- The test package is not generic so that the arguments
--- and expected results for some of the test values
--- can be expressed as universal real instead of being
--- computed at runtime.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 2 FEB 96 SAIC Initial release for 2.1
--- 18 AUG 96 SAIC Made Check consistent with other tests.
---
---!
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Elementary_Functions;
-with Ada.Numerics.Elementary_Functions;
-procedure CXG2003 is
- Verbose : constant Boolean := False;
-
- package Float_Check is
- subtype Real is Float;
- procedure Do_Test;
- end Float_Check;
-
- package body Float_Check is
- package Elementary_Functions is new
- Ada.Numerics.Generic_Elementary_Functions (Real);
- function Sqrt (X : Real) return Real renames
- Elementary_Functions.Sqrt;
- function Log (X : Real) return Real renames
- Elementary_Functions.Log;
- function Exp (X : Real) return Real renames
- Elementary_Functions.Exp;
-
- -- The default Maximum Relative Error is the value specified
- -- in the LRM.
- Default_MRE : constant Real := 2.0;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real := Default_MRE) is
- Rel_Error : Real;
- Abs_Error : Real;
- Max_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " &
- Real'Image (Actual - Expected) &
- " mre:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Argument_Range_Check (A, B : Real;
- Test : String) is
- -- test a logarithmically distributed selection of
- -- arguments selected from the range A to B.
- X : Real;
- Expected : Real;
- Y : Real;
- C : Real := Log(B/A);
- Max_Samples : constant := 1000;
-
- begin
- for I in 1..Max_Samples loop
- Expected := A * Exp(C * Real (I) / Real (Max_Samples));
- X := Expected * Expected;
- Y := Sqrt (X);
-
- -- note that since the expected value is computed, we
- -- must take the error in that computation into account.
- Check (Y, Expected,
- "test " & Test & " -" &
- Integer'Image (I) &
- " of argument range",
- 3.0);
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in argument range check");
- when others =>
- Report.Failed ("exception in argument range check");
- end Argument_Range_Check;
-
- procedure Do_Test is
- begin
-
- --- test 1 ---
- declare
- T : constant := (Real'Machine_EMax - 1) / 2;
- X : constant := (1.0 * Real'Machine_Radix) ** (2 * T);
- Expected : constant := (1.0 * Real'Machine_Radix) ** T;
- Y : Real;
- begin
- Y := Sqrt (X);
- Check (Y, Expected, "test 1 -- sqrt(radix**((emax-1)/2))");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 1");
- when others =>
- Report.Failed ("exception in test 1");
- end;
-
- --- test 2 ---
- declare
- T : constant := (Real'Model_EMin + 1) / 2;
- X : constant := (1.0 * Real'Machine_Radix) ** (2 * T);
- Expected : constant := (1.0 * Real'Machine_Radix) ** T;
- Y : Real;
- begin
- Y := Sqrt (X);
- Check (Y, Expected, "test 2 -- sqrt(radix**((emin+1)/2))");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 2");
- when others =>
- Report.Failed ("exception in test 2");
- end;
-
- --- test 3 ---
- declare
- X : constant := 1.0;
- Expected : constant := 1.0;
- Y : Real;
- begin
- Y := Sqrt(X);
- Check (Y, Expected, "test 3 -- sqrt(1.0)",
- 0.0); -- no error allowed
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 3");
- when others =>
- Report.Failed ("exception in test 3");
- end;
-
- --- test 4 ---
- declare
- X : constant := 0.0;
- Expected : constant := 0.0;
- Y : Real;
- begin
- Y := Sqrt(X);
- Check (Y, Expected, "test 4 -- sqrt(0.0)",
- 0.0); -- no error allowed
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 4");
- when others =>
- Report.Failed ("exception in test 4");
- end;
-
- --- test 5 ---
- declare
- X : constant := -1.0;
- Y : Real;
- begin
- Y := Sqrt(X);
- -- the following code should not be executed.
- -- The call to Check is to keep the call to Sqrt from
- -- appearing to be dead code.
- Check (Y, -1.0, "test 5 -- sqrt(-1)" );
- Report.Failed ("test 5 - argument_error expected");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 5");
- when Ada.Numerics.Argument_Error =>
- if Verbose then
- Report.Comment ("test 5 correctly got argument_error");
- end if;
- when others =>
- Report.Failed ("exception in test 5");
- end;
-
- --- test 6 ---
- declare
- X : constant := Ada.Numerics.Pi ** 2;
- Expected : constant := Ada.Numerics.Pi;
- Y : Real;
- begin
- Y := Sqrt (X);
- Check (Y, Expected, "test 6 -- sqrt(pi**2)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 6");
- when others =>
- Report.Failed ("exception in test 6");
- end;
-
- --- test 7 & 8 ---
- Argument_Range_Check (1.0/Sqrt(Real(Real'Machine_Radix)),
- 1.0,
- "7");
- Argument_Range_Check (1.0,
- Sqrt(Real(Real'Machine_Radix)),
- "8");
- end Do_Test;
- end Float_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
-
-
- package A_Long_Float_Check is
- subtype Real is A_Long_Float;
- procedure Do_Test;
- end A_Long_Float_Check;
-
- package body A_Long_Float_Check is
- package Elementary_Functions is new
- Ada.Numerics.Generic_Elementary_Functions (Real);
- function Sqrt (X : Real) return Real renames
- Elementary_Functions.Sqrt;
- function Log (X : Real) return Real renames
- Elementary_Functions.Log;
- function Exp (X : Real) return Real renames
- Elementary_Functions.Exp;
-
- -- The default Maximum Relative Error is the value specified
- -- in the LRM.
- Default_MRE : constant Real := 2.0;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real := Default_MRE) is
- Rel_Error : Real;
- Abs_Error : Real;
- Max_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " &
- Real'Image (Actual - Expected) &
- " mre:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Argument_Range_Check (A, B : Real;
- Test : String) is
- -- test a logarithmically distributed selection of
- -- arguments selected from the range A to B.
- X : Real;
- Expected : Real;
- Y : Real;
- C : Real := Log(B/A);
- Max_Samples : constant := 1000;
-
- begin
- for I in 1..Max_Samples loop
- Expected := A * Exp(C * Real (I) / Real (Max_Samples));
- X := Expected * Expected;
- Y := Sqrt (X);
-
- -- note that since the expected value is computed, we
- -- must take the error in that computation into account.
- Check (Y, Expected,
- "test " & Test & " -" &
- Integer'Image (I) &
- " of argument range",
- 3.0);
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in argument range check");
- when others =>
- Report.Failed ("exception in argument range check");
- end Argument_Range_Check;
-
-
- procedure Do_Test is
- begin
-
- --- test 1 ---
- declare
- T : constant := (Real'Machine_EMax - 1) / 2;
- X : constant := (1.0 * Real'Machine_Radix) ** (2 * T);
- Expected : constant := (1.0 * Real'Machine_Radix) ** T;
- Y : Real;
- begin
- Y := Sqrt (X);
- Check (Y, Expected, "test 1 -- sqrt(radix**((emax-1)/2))");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 1");
- when others =>
- Report.Failed ("exception in test 1");
- end;
-
- --- test 2 ---
- declare
- T : constant := (Real'Model_EMin + 1) / 2;
- X : constant := (1.0 * Real'Machine_Radix) ** (2 * T);
- Expected : constant := (1.0 * Real'Machine_Radix) ** T;
- Y : Real;
- begin
- Y := Sqrt (X);
- Check (Y, Expected, "test 2 -- sqrt(radix**((emin+1)/2))");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 2");
- when others =>
- Report.Failed ("exception in test 2");
- end;
-
- --- test 3 ---
- declare
- X : constant := 1.0;
- Expected : constant := 1.0;
- Y : Real;
- begin
- Y := Sqrt(X);
- Check (Y, Expected, "test 3 -- sqrt(1.0)",
- 0.0); -- no error allowed
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 3");
- when others =>
- Report.Failed ("exception in test 3");
- end;
-
- --- test 4 ---
- declare
- X : constant := 0.0;
- Expected : constant := 0.0;
- Y : Real;
- begin
- Y := Sqrt(X);
- Check (Y, Expected, "test 4 -- sqrt(0.0)",
- 0.0); -- no error allowed
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 4");
- when others =>
- Report.Failed ("exception in test 4");
- end;
-
- --- test 5 ---
- declare
- X : constant := -1.0;
- Y : Real;
- begin
- Y := Sqrt(X);
- -- the following code should not be executed.
- -- The call to Check is to keep the call to Sqrt from
- -- appearing to be dead code.
- Check (Y, -1.0, "test 5 -- sqrt(-1)" );
- Report.Failed ("test 5 - argument_error expected");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 5");
- when Ada.Numerics.Argument_Error =>
- if Verbose then
- Report.Comment ("test 5 correctly got argument_error");
- end if;
- when others =>
- Report.Failed ("exception in test 5");
- end;
-
- --- test 6 ---
- declare
- X : constant := Ada.Numerics.Pi ** 2;
- Expected : constant := Ada.Numerics.Pi;
- Y : Real;
- begin
- Y := Sqrt (X);
- Check (Y, Expected, "test 6 -- sqrt(pi**2)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 6");
- when others =>
- Report.Failed ("exception in test 6");
- end;
-
- --- test 7 & 8 ---
- Argument_Range_Check (1.0/Sqrt(Real(Real'Machine_Radix)),
- 1.0,
- "7");
- Argument_Range_Check (1.0,
- Sqrt(Real(Real'Machine_Radix)),
- "8");
- end Do_Test;
- end A_Long_Float_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
- package Non_Generic_Check is
- procedure Do_Test;
- end Non_Generic_Check;
-
- package body Non_Generic_Check is
- package EF renames
- Ada.Numerics.Elementary_Functions;
- subtype Real is Float;
-
- -- The default Maximum Relative Error is the value specified
- -- in the LRM.
- Default_MRE : constant Real := 2.0;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real := Default_MRE) is
- Rel_Error : Real;
- Abs_Error : Real;
- Max_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " &
- Real'Image (Actual - Expected) &
- " mre:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
-
- procedure Argument_Range_Check (A, B : Float;
- Test : String) is
- -- test a logarithmically distributed selection of
- -- arguments selected from the range A to B.
- X : Float;
- Expected : Float;
- Y : Float;
- C : Float := EF.Log(B/A);
- Max_Samples : constant := 1000;
-
- begin
- for I in 1..Max_Samples loop
- Expected := A * EF.Exp(C * Float (I) / Float (Max_Samples));
- X := Expected * Expected;
- Y := EF.Sqrt (X);
-
- -- note that since the expected value is computed, we
- -- must take the error in that computation into account.
- Check (Y, Expected,
- "test " & Test & " -" &
- Integer'Image (I) &
- " of argument range",
- 3.0);
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in argument range check");
- when others =>
- Report.Failed ("exception in argument range check");
- end Argument_Range_Check;
-
-
- procedure Do_Test is
- begin
-
- --- test 1 ---
- declare
- T : constant := (Float'Machine_EMax - 1) / 2;
- X : constant := (1.0 * Float'Machine_Radix) ** (2 * T);
- Expected : constant := (1.0 * Float'Machine_Radix) ** T;
- Y : Float;
- begin
- Y := EF.Sqrt (X);
- Check (Y, Expected, "test 1 -- sqrt(radix**((emax-1)/2))");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 1");
- when others =>
- Report.Failed ("exception in test 1");
- end;
-
- --- test 2 ---
- declare
- T : constant := (Float'Model_EMin + 1) / 2;
- X : constant := (1.0 * Float'Machine_Radix) ** (2 * T);
- Expected : constant := (1.0 * Float'Machine_Radix) ** T;
- Y : Float;
- begin
- Y := EF.Sqrt (X);
- Check (Y, Expected, "test 2 -- sqrt(radix**((emin+1)/2))");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 2");
- when others =>
- Report.Failed ("exception in test 2");
- end;
-
- --- test 3 ---
- declare
- X : constant := 1.0;
- Expected : constant := 1.0;
- Y : Float;
- begin
- Y := EF.Sqrt(X);
- Check (Y, Expected, "test 3 -- sqrt(1.0)",
- 0.0); -- no error allowed
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 3");
- when others =>
- Report.Failed ("exception in test 3");
- end;
-
- --- test 4 ---
- declare
- X : constant := 0.0;
- Expected : constant := 0.0;
- Y : Float;
- begin
- Y := EF.Sqrt(X);
- Check (Y, Expected, "test 4 -- sqrt(0.0)",
- 0.0); -- no error allowed
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 4");
- when others =>
- Report.Failed ("exception in test 4");
- end;
-
- --- test 5 ---
- declare
- X : constant := -1.0;
- Y : Float;
- begin
- Y := EF.Sqrt(X);
- -- the following code should not be executed.
- -- The call to Check is to keep the call to Sqrt from
- -- appearing to be dead code.
- Check (Y, -1.0, "test 5 -- sqrt(-1)" );
- Report.Failed ("test 5 - argument_error expected");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 5");
- when Ada.Numerics.Argument_Error =>
- if Verbose then
- Report.Comment ("test 5 correctly got argument_error");
- end if;
- when others =>
- Report.Failed ("exception in test 5");
- end;
-
- --- test 6 ---
- declare
- X : constant := Ada.Numerics.Pi ** 2;
- Expected : constant := Ada.Numerics.Pi;
- Y : Float;
- begin
- Y := EF.Sqrt (X);
- Check (Y, Expected, "test 6 -- sqrt(pi**2)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 6");
- when others =>
- Report.Failed ("exception in test 6");
- end;
-
- --- test 7 & 8 ---
- Argument_Range_Check (1.0/EF.Sqrt(Float(Float'Machine_Radix)),
- 1.0,
- "7");
- Argument_Range_Check (1.0,
- EF.Sqrt(Float(Float'Machine_Radix)),
- "8");
- end Do_Test;
- end Non_Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-begin
- Report.Test ("CXG2003",
- "Check the accuracy of the sqrt function");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking non-generic package");
- end if;
-
- Non_Generic_Check.Do_Test;
-
- Report.Result;
-end CXG2003;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2004.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2004.a
deleted file mode 100644
index 2df296d3d42..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2004.a
+++ /dev/null
@@ -1,499 +0,0 @@
--- CXG2004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the sin and cos functions return
--- results that are within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test consists of a generic package that is
--- instantiated to check both float and a long float type.
--- The test for each floating point type is divided into
--- the following parts:
--- Special value checks where the result is a known constant.
--- Checks using an identity relationship.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 13 FEB 96 SAIC Initial release for 2.1
--- 22 APR 96 SAIC Changed to generic implementation.
--- 18 AUG 96 SAIC Improvements to commentary.
--- 23 OCT 96 SAIC Exact results are not required unless the
--- cycle is specified.
--- 28 FEB 97 PWB.CTA Removed checks where cycle 2.0*Pi is specified
--- 02 JUN 98 EDS Revised calculations to ensure that X is exactly
--- three times Y per advice of numerics experts.
---
--- CHANGE NOTE:
--- According to Ken Dritz, author of the Numerics Annex of the RM,
--- one should never specify the cycle 2.0*Pi for the trigonometric
--- functions. In particular, if the machine number for the first
--- argument is not an exact multiple of the machine number for the
--- explicit cycle, then the specified exact results cannot be
--- reasonably expected. The affected checks in this test have been
--- marked as comments, with the additional notation "pwb-math".
--- Phil Brashear
---!
-
---
--- References:
---
--- Software Manual for the Elementary Functions
--- William J. Cody, Jr. and William Waite
--- Prentice-Hall, 1980
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
--- Implementation and Testing of Function Software
--- W. J. Cody
--- Problems and Methodologies in Mathematical Software Production
--- editors P. C. Messina and A. Murli
--- Lecture Notes in Computer Science Volume 142
--- Springer Verlag, 1982
---
--- The sin and cos checks are translated directly from
--- the netlib FORTRAN code that was written by W. Cody.
---
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Elementary_Functions;
-with Ada.Numerics.Elementary_Functions;
-procedure CXG2004 is
- Verbose : constant Boolean := False;
- Number_Samples : constant := 1000;
-
- -- CRC Standard Mathematical Tables; 23rd Edition; pg 738
- Sqrt2 : constant :=
- 1.41421_35623_73095_04880_16887_24209_69807_85696_71875_37695;
- Sqrt3 : constant :=
- 1.73205_08075_68877_29352_74463_41505_87236_69428_05253_81039;
-
- Pi : constant := Ada.Numerics.Pi;
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Elementary_Functions is new
- Ada.Numerics.Generic_Elementary_Functions (Real);
-
- function Sin (X : Real) return Real renames
- Elementary_Functions.Sin;
- function Cos (X : Real) return Real renames
- Elementary_Functions.Cos;
- function Sin (X, Cycle : Real) return Real renames
- Elementary_Functions.Sin;
- function Cos (X, Cycle : Real) return Real renames
- Elementary_Functions.Cos;
-
- Accuracy_Error_Reported : Boolean := False;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Rel_Error,
- Abs_Error,
- Max_Error : Real;
- begin
-
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
-
- -- in addition to the relative error checks we apply the
- -- criteria of G.2.4(16)
- if abs (Actual) > 1.0 then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name & " result > 1.0");
- elsif abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " &
- Real'Image (Actual - Expected) &
- " mre:" &
- Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Sin_Check (A, B : Real;
- Arg_Range : String) is
- -- test a selection of
- -- arguments selected from the range A to B.
- --
- -- This test uses the identity
- -- sin(x) = sin(x/3)*(3 - 4 * sin(x/3)**2)
- --
- -- Note that in this test we must take into account the
- -- error in the calculation of the expected result so
- -- the maximum relative error is larger than the
- -- accuracy required by the ARM.
-
- X, Y, ZZ : Real;
- Actual, Expected : Real;
- MRE : Real;
- Ran : Real;
- begin
- Accuracy_Error_Reported := False; -- reset
- for I in 1 .. Number_Samples loop
- -- Evenly distributed selection of arguments
- Ran := Real (I) / Real (Number_Samples);
-
- -- make sure x and x/3 are both exactly representable
- -- on the machine. See "Implementation and Testing of
- -- Function Software" page 44.
- X := (B - A) * Ran + A;
- Y := Real'Leading_Part
- ( X/3.0,
- Real'Machine_Mantissa - Real'Exponent (3.0) );
- X := Y * 3.0;
-
- Actual := Sin (X);
-
- ZZ := Sin(Y);
- Expected := ZZ * (3.0 - 4.0 * ZZ * ZZ);
-
- -- note that since the expected value is computed, we
- -- must take the error in that computation into account.
- -- See Cody pp 139-141.
- MRE := 4.0;
-
- Check (Actual, Expected,
- "sin test of range" & Arg_Range &
- Integer'Image (I),
- MRE);
- exit when Accuracy_Error_Reported;
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in sin check");
- when others =>
- Report.Failed ("exception in sin check");
- end Sin_Check;
-
-
-
- procedure Cos_Check (A, B : Real;
- Arg_Range : String) is
- -- test a selection of
- -- arguments selected from the range A to B.
- --
- -- This test uses the identity
- -- cos(x) = cos(x/3)*(4 * cos(x/3)**2 - 3)
- --
- -- Note that in this test we must take into account the
- -- error in the calculation of the expected result so
- -- the maximum relative error is larger than the
- -- accuracy required by the ARM.
-
- X, Y, ZZ : Real;
- Actual, Expected : Real;
- MRE : Real;
- Ran : Real;
- begin
- Accuracy_Error_Reported := False; -- reset
- for I in 1 .. Number_Samples loop
- -- Evenly distributed selection of arguments
- Ran := Real (I) / Real (Number_Samples);
-
- -- make sure x and x/3 are both exactly representable
- -- on the machine. See "Implementation and Testing of
- -- Function Software" page 44.
- X := (B - A) * Ran + A;
- Y := Real'Leading_Part
- ( X/3.0,
- Real'Machine_Mantissa - Real'Exponent (3.0) );
- X := Y * 3.0;
-
- Actual := Cos (X);
-
- ZZ := Cos(Y);
- Expected := ZZ * (4.0 * ZZ * ZZ - 3.0);
-
- -- note that since the expected value is computed, we
- -- must take the error in that computation into account.
- -- See Cody pp 141-143.
- MRE := 6.0;
-
- Check (Actual, Expected,
- "cos test of range" & Arg_Range &
- Integer'Image (I),
- MRE);
- exit when Accuracy_Error_Reported;
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in cos check");
- when others =>
- Report.Failed ("exception in cos check");
- end Cos_Check;
-
-
- procedure Special_Angle_Checks is
- type Data_Point is
- record
- Degrees,
- Radians,
- Sine,
- Cosine : Real;
- Sin_Result_Error,
- Cos_Result_Error : Boolean;
- end record;
-
- type Test_Data_Type is array (Positive range <>) of Data_Point;
-
- -- the values in the following table only involve static
- -- expressions to minimize any loss of precision. However,
- -- there are two sources of error that must be accounted for
- -- in the following tests.
- -- First, when a cycle is not specified there can be a roundoff
- -- error in the value of Pi used. This error does not apply
- -- when a cycle of 2.0 * Pi is explicitly provided.
- -- Second, the expected results that involve sqrt values also
- -- have a potential roundoff error.
- -- The amount of error due to error in the argument is computed
- -- as follows:
- -- sin(x+err) = sin(x)*cos(err) + cos(x)*sin(err)
- -- ~= sin(x) + err * cos(x)
- -- similarly for cos the error due to error in the argument is
- -- computed as follows:
- -- cos(x+err) = cos(x)*cos(err) - sin(x)*sin(err)
- -- ~= cos(x) - err * sin(x)
- -- In both cases the term "err" is bounded by 0.5 * argument.
-
- Test_Data : constant Test_Data_Type := (
--- degrees radians sine cosine sin_er cos_er test #
- ( 0.0, 0.0, 0.0, 1.0, False, False ), -- 1
- ( 30.0, Pi/6.0, 0.5, Sqrt3/2.0, False, True ), -- 2
- ( 60.0, Pi/3.0, Sqrt3/2.0, 0.5, True, False ), -- 3
- ( 90.0, Pi/2.0, 1.0, 0.0, False, False ), -- 4
- (120.0, 2.0*Pi/3.0, Sqrt3/2.0, -0.5, True, False ), -- 5
- (150.0, 5.0*Pi/6.0, 0.5, -Sqrt3/2.0, False, True ), -- 6
- (180.0, Pi, 0.0, -1.0, False, False ), -- 7
- (210.0, 7.0*Pi/6.0, -0.5, -Sqrt3/2.0, False, True ), -- 8
- (240.0, 8.0*Pi/6.0, -Sqrt3/2.0, -0.5, True, False ), -- 9
- (270.0, 9.0*Pi/6.0, -1.0, 0.0, False, False ), -- 10
- (300.0, 10.0*Pi/6.0, -Sqrt3/2.0, 0.5, True, False ), -- 11
- (330.0, 11.0*Pi/6.0, -0.5, Sqrt3/2.0, False, True ), -- 12
- (360.0, 2.0*Pi, 0.0, 1.0, False, False ), -- 13
- ( 45.0, Pi/4.0, Sqrt2/2.0, Sqrt2/2.0, True, True ), -- 14
- (135.0, 3.0*Pi/4.0, Sqrt2/2.0, -Sqrt2/2.0, True, True ), -- 15
- (225.0, 5.0*Pi/4.0, -Sqrt2/2.0, -Sqrt2/2.0, True, True ), -- 16
- (315.0, 7.0*Pi/4.0, -Sqrt2/2.0, Sqrt2/2.0, True, True ), -- 17
- (405.0, 9.0*Pi/4.0, Sqrt2/2.0, Sqrt2/2.0, True, True ) ); -- 18
-
-
- Y : Real;
- Sin_Arg_Err,
- Cos_Arg_Err,
- Sin_Result_Err,
- Cos_Result_Err : Real;
- begin
- for I in Test_Data'Range loop
- -- compute error components
- Sin_Arg_Err := abs Test_Data (I).Cosine *
- abs Test_Data (I).Radians / 2.0;
- Cos_Arg_Err := abs Test_Data (I).Sine *
- abs Test_Data (I).Radians / 2.0;
-
- if Test_Data (I).Sin_Result_Error then
- Sin_Result_Err := 0.5;
- else
- Sin_Result_Err := 0.0;
- end if;
-
- if Test_Data (I).Cos_Result_Error then
- Cos_Result_Err := 1.0;
- else
- Cos_Result_Err := 0.0;
- end if;
-
-
-
- Y := Sin (Test_Data (I).Radians);
- Check (Y, Test_Data (I).Sine,
- "test" & Integer'Image (I) & " sin(r)",
- 2.0 + Sin_Arg_Err + Sin_Result_Err);
- Y := Cos (Test_Data (I).Radians);
- Check (Y, Test_Data (I).Cosine,
- "test" & Integer'Image (I) & " cos(r)",
- 2.0 + Cos_Arg_Err + Cos_Result_Err);
- Y := Sin (Test_Data (I).Degrees, 360.0);
- Check (Y, Test_Data (I).Sine,
- "test" & Integer'Image (I) & " sin(d,360)",
- 2.0 + Sin_Result_Err);
- Y := Cos (Test_Data (I).Degrees, 360.0);
- Check (Y, Test_Data (I).Cosine,
- "test" & Integer'Image (I) & " cos(d,360)",
- 2.0 + Cos_Result_Err);
---pwb-math Y := Sin (Test_Data (I).Radians, 2.0*Pi);
---pwb-math Check (Y, Test_Data (I).Sine,
---pwb-math "test" & Integer'Image (I) & " sin(r,2pi)",
---pwb-math 2.0 + Sin_Result_Err);
---pwb-math Y := Cos (Test_Data (I).Radians, 2.0*Pi);
---pwb-math Check (Y, Test_Data (I).Cosine,
---pwb-math "test" & Integer'Image (I) & " cos(r,2pi)",
---pwb-math 2.0 + Cos_Result_Err);
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in special angle test");
- when others =>
- Report.Failed ("exception in special angle test");
- end Special_Angle_Checks;
-
-
- -- check the rule of A.5.1(41);6.0 which requires that the
- -- result be exact if the mathematical result is 0.0, 1.0,
- -- or -1.0
- procedure Exact_Result_Checks is
- type Data_Point is
- record
- Degrees,
- Sine,
- Cosine : Real;
- end record;
-
- type Test_Data_Type is array (Positive range <>) of Data_Point;
- Test_Data : constant Test_Data_Type := (
- -- degrees sine cosine test #
- ( 0.0, 0.0, 1.0 ), -- 1
- ( 90.0, 1.0, 0.0 ), -- 2
- (180.0, 0.0, -1.0 ), -- 3
- (270.0, -1.0, 0.0 ), -- 4
- (360.0, 0.0, 1.0 ), -- 5
- ( 90.0 + 360.0, 1.0, 0.0 ), -- 6
- (180.0 + 360.0, 0.0, -1.0 ), -- 7
- (270.0 + 360.0,-1.0, 0.0 ), -- 8
- (360.0 + 360.0, 0.0, 1.0 ) ); -- 9
-
- Y : Real;
- begin
- for I in Test_Data'Range loop
- Y := Sin (Test_Data(I).Degrees, 360.0);
- if Y /= Test_Data(I).Sine then
- Report.Failed ("exact result for sin(" &
- Real'Image (Test_Data(I).Degrees) &
- ", 360.0) is not" &
- Real'Image (Test_Data(I).Sine) &
- " Difference is " &
- Real'Image (Y - Test_Data(I).Sine) );
- end if;
-
- Y := Cos (Test_Data(I).Degrees, 360.0);
- if Y /= Test_Data(I).Cosine then
- Report.Failed ("exact result for cos(" &
- Real'Image (Test_Data(I).Degrees) &
- ", 360.0) is not" &
- Real'Image (Test_Data(I).Cosine) &
- " Difference is " &
- Real'Image (Y - Test_Data(I).Cosine) );
- end if;
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in exact result check");
- when others =>
- Report.Failed ("exception in exact result check");
- end Exact_Result_Checks;
-
-
- procedure Do_Test is
- begin
- Special_Angle_Checks;
- Sin_Check (0.0, Pi/2.0, "0..pi/2");
- Sin_Check (6.0*Pi, 6.5*Pi, "6pi..6.5pi");
- Cos_Check (7.0*Pi, 7.5*Pi, "7pi..7.5pi");
- Exact_Result_Checks;
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
- package Float_Check is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package A_Long_Float_Check is new Generic_Check (A_Long_Float);
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-
-begin
- Report.Test ("CXG2004",
- "Check the accuracy of the sin and cos functions");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
- Report.Result;
-end CXG2004;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2005.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2005.a
deleted file mode 100644
index 4054b83d88a..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2005.a
+++ /dev/null
@@ -1,204 +0,0 @@
--- CXG2005.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that floating point addition and multiplication
--- have the required accuracy.
---
--- TEST DESCRIPTION:
--- The check for the required precision is essentially a
--- check that a guard digit is used for the operations.
--- This test uses a generic package to check the addition
--- and multiplication results. The
--- generic package is instantiated with the standard FLOAT
--- type and a floating point type for the maximum number
--- of digits of precision.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
---
---
--- CHANGE HISTORY:
--- 14 FEB 96 SAIC Initial Release for 2.1
--- 16 SEP 99 RLB Repaired to avoid printing thousands of (almost)
--- identical failure messages.
---!
-
--- References:
---
--- Basic Concepts for Computational Software
--- W. J. Cody
--- Problems and Methodologies in Mathematical Software Production
--- editors P. C. Messina and A. Murli
--- Lecture Notes in Computer Science Vol 142
--- Springer Verlag, 1982
---
--- Software Manual for the Elementary Functions
--- William J. Cody and William Waite
--- Prentice-Hall, 1980
---
-
-with System;
-with Report;
-procedure CXG2005 is
- Verbose : constant Boolean := False;
-
- generic
- type Real is digits <>;
- package Guard_Digit_Check is
- procedure Do_Test;
- end Guard_Digit_Check;
-
- package body Guard_Digit_Check is
- -- made global so that the compiler will be more likely
- -- to keep the values in memory instead of in higher
- -- precision registers.
- X, Y, Z : Real;
- OneX : Real;
- Eps, BN : Real;
-
- -- special constants - not declared as constants so that
- -- the "stored" precision will be used instead of a "register"
- -- precision.
- Zero : Real := 0.0;
- One : Real := 1.0;
- Two : Real := 2.0;
-
- Failure_Count : Natural := 0;
-
- procedure Thwart_Optimization is
- -- the purpose of this procedure is to reference the
- -- global variables used by the test so
- -- that the compiler is not likely to keep them in
- -- a higher precision register for their entire lifetime.
- begin
- if Report.Ident_Bool (False) then
- -- never executed
- X := X + 5.0;
- Y := Y + 6.0;
- Z := Z + 1.0;
- Eps := Eps + 2.0;
- BN := BN + 2.0;
- OneX := X + Y;
- One := 12.34; Two := 56.78; Zero := 90.12;
- end if;
- end Thwart_Optimization;
-
-
- procedure Addition_Test is
- begin
- for K in 1..10 loop
- Eps := Real (K) * Real'Model_Epsilon;
- for N in 1.. Real'Machine_EMax - 1 loop
- BN := Real(Real'Machine_Radix) ** N;
- X := (One + Eps) * BN;
- Y := (One - Eps) * BN;
- Z := X - Y; -- true value for Z is 2*Eps*BN
-
- if Z /= Eps*BN + Eps*BN then
- Report.Failed ("addition check failed. K=" &
- Integer'Image (K) &
- " N=" & Integer'Image (N) &
- " difference=" & Real'Image (Z - 2.0*Eps*BN) &
- " Eps*BN=" & Real'Image (Eps*BN) );
- Failure_Count := Failure_Count + 1;
- exit when Failure_Count > K*4; -- Avoid displaying dozens of messages.
- end if;
- end loop;
- end loop;
- exception
- when others =>
- Thwart_Optimization;
- Report.Failed ("unexpected exception in addition test");
- end Addition_Test;
-
-
- procedure Multiplication_Test is
- begin
- X := Real (Real'Machine_Radix) ** (Real'Machine_EMax - 1);
- OneX := One * X;
- Thwart_Optimization;
- if OneX /= X then
- Report.Failed ("multiplication for large values");
- end if;
-
- X := Real (Real'Machine_Radix) ** (Real'Model_EMin + 1);
- OneX := One * X;
- Thwart_Optimization;
- if OneX /= X then
- Report.Failed ("multiplication for small values");
- end if;
-
- -- selection of "random" values between 1/radix and radix
- Y := One / Real (Real'Machine_Radix);
- Z := Real(Real'Machine_Radix) - One/Real(Real'Machine_Radix);
- for I in 0..100 loop
- X := Y + Real (I) / 100.0 * Z;
- OneX := One * X;
- Thwart_Optimization;
- if OneX /= X then
- Report.Failed ("multiplication for case" & Integer'Image (I));
- exit when Failure_Count > 40+8; -- Avoid displaying dozens of messages.
- end if;
- end loop;
- exception
- when others =>
- Thwart_Optimization;
- Report.Failed ("unexpected exception in multiplication test");
- end Multiplication_Test;
-
-
- procedure Do_Test is
- begin
- Addition_Test;
- Multiplication_Test;
- end Do_Test;
- end Guard_Digit_Check;
-
- package Chk_Float is new Guard_Digit_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package Chk_A_Long_Float is new Guard_Digit_Check (A_Long_Float);
-begin
- Report.Test ("CXG2005",
- "Check the accuracy of floating point" &
- " addition and multiplication");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
- Chk_Float.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
- Chk_A_Long_Float.Do_Test;
-
- Report.Result;
-end CXG2005;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2006.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2006.a
deleted file mode 100644
index da15dc3be67..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2006.a
+++ /dev/null
@@ -1,281 +0,0 @@
--- CXG2006.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the complex Argument function returns
--- results that are within the error bound allowed.
--- Check that Argument_Error is raised if the Cycle parameter
--- is less than or equal to zero.
---
--- TEST DESCRIPTION:
--- This test uses a generic package to compute and check the
--- values of the Argument function.
--- Of special interest is the case where either the real or
--- the imaginary part of the parameter is very large while the
--- other part is very small or 0.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 15 FEB 96 SAIC Initial release for 2.1
--- 03 MAR 97 PWB.CTA Removed checks involving explicit cycle => 2.0*Pi
---
--- CHANGE NOTE:
--- According to Ken Dritz, author of the Numerics Annex of the RM,
--- one should never specify the cycle 2.0*Pi for the trigonometric
--- functions. In particular, if the machine number for the first
--- argument is not an exact multiple of the machine number for the
--- explicit cycle, then the specified exact results cannot be
--- reasonably expected. The affected checks in this test have been
--- marked as comments, with the additional notation "pwb-math".
--- Phil Brashear
---!
-
---
--- Reference:
--- Problems and Methodologies in Mathematical Software Production;
--- editors: P. C. Messina and A Murli;
--- Lecture Notes in Computer Science
--- Volume 142
--- Springer Verlag 1982
---
-
-with System;
-with Report;
-with ImpDef.Annex_G;
-with Ada.Numerics;
-with Ada.Numerics.Generic_Complex_Types;
-with Ada.Numerics.Complex_Types;
-procedure CXG2006 is
- Verbose : constant Boolean := False;
-
-
- -- CRC Standard Mathematical Tables; 23rd Edition; pg 738
- Sqrt2 : constant :=
- 1.41421_35623_73095_04880_16887_24209_69807_85696_71875_37695;
- Sqrt3 : constant :=
- 1.73205_08075_68877_29352_74463_41505_87236_69428_05253_81039;
-
- Pi : constant := Ada.Numerics.Pi;
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Complex_Types is new
- Ada.Numerics.Generic_Complex_Types (Real);
- use Complex_Types;
-
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Rel_Error : Real;
- Abs_Error : Real;
- Max_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " &
- Real'Image (Actual - Expected) &
- " mre:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Special_Cases is
- type Data_Point is
- record
- Re,
- Im,
- Radians,
- Degrees,
- Error_Bound : Real;
- end record;
-
- type Test_Data_Type is array (Positive range <>) of Data_Point;
-
- -- the values in the following table only involve static
- -- expressions to minimize errors in precision introduced by the
- -- test. For cases where Pi is used in the argument we must
- -- allow an extra 1.0*MRE to account for roundoff error in the
- -- argument. Where the result involves a square root we allow
- -- an extra 0.5*MRE to allow for roundoff error.
- Test_Data : constant Test_Data_Type := (
--- Re Im Radians Degrees Err Test #
- (0.0, 0.0, 0.0, 0.0, 4.0 ), -- 1
- (1.0, 0.0, 0.0, 0.0, 4.0 ), -- 2
- (Real'Safe_Last, 0.0, 0.0, 0.0, 4.0 ), -- 3
- (Real'Model_Small, 0.0, 0.0, 0.0, 4.0 ), -- 4
- (1.0, 1.0, Pi/4.0, 45.0, 5.0 ), -- 5
- (1.0, -1.0, -Pi/4.0, -45.0, 5.0 ), -- 6
- (-1.0, -1.0, -3.0*Pi/4.0,-135.0, 5.0 ), -- 7
- (-1.0, 1.0, 3.0*Pi/4.0, 135.0, 5.0 ), -- 8
- (Sqrt3, 1.0, Pi/6.0, 30.0, 5.5 ), -- 9
- (-Sqrt3, 1.0, 5.0*Pi/6.0, 150.0, 5.5 ), -- 10
- (Sqrt3, -1.0, -Pi/6.0, -30.0, 5.5 ), -- 11
- (-Sqrt3, -1.0, -5.0*Pi/6.0,-150.0, 5.5 ), -- 12
- (Real'Model_Small, Real'Model_Small, Pi/4.0, 45.0, 5.0 ), -- 13
- (-Real'Safe_Last, 0.0, Pi, 180.0, 5.0 ), -- 14
- (-Real'Safe_Last, -Real'Model_Small, -Pi,-180.0, 5.0 ), -- 15
- (100000.0, 100000.0, Pi/4.0, 45.0, 5.0 )); -- 16
-
- X : Real;
- Z : Complex;
- begin
- for I in Test_Data'Range loop
- begin
- Z := (Test_Data(I).Re, Test_Data(I).Im);
- X := Argument (Z);
- Check (X, Test_Data(I).Radians,
- "test" & Integer'Image (I) & " argument(z)",
- Test_Data (I).Error_Bound);
---pwb-math X := Argument (Z, 2.0*Pi);
---pwb-math Check (X, Test_Data(I).Radians,
---pwb-math "test" & Integer'Image (I) & " argument(z, 2pi)",
---pwb-math Test_Data (I).Error_Bound);
- X := Argument (Z, 360.0);
- Check (X, Test_Data(I).Degrees,
- "test" & Integer'Image (I) & " argument(z, 360)",
- Test_Data (I).Error_Bound);
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test" &
- Integer'Image (I));
- when others =>
- Report.Failed ("exception in test" &
- Integer'Image (I));
- end;
- end loop;
-
- if Real'Signed_Zeros then
- begin
- X := Argument ((-1.0, Real(ImpDef.Annex_G.Negative_Zero)));
- Check (X, -Pi, "test of arg((-1,-0)", 4.0);
- exception
- when others =>
- Report.Failed ("exception in signed zero test");
- end;
- end if;
- end Special_Cases;
-
-
- procedure Exception_Cases is
- -- check that Argument_Error is raised if Cycle is <= 0
- Z : Complex := (1.0, 1.0);
- X : Real;
- Y : Real;
- begin
- begin
- X := Argument (Z, Cycle => 0.0);
- Report.Failed ("no exception for cycle = 0.0");
- exception
- when Ada.Numerics.Argument_Error => null;
- when others =>
- Report.Failed ("wrong exception for cycle = 0.0");
- end;
-
- begin
- Y := Argument (Z, Cycle => -3.0);
- Report.Failed ("no exception for cycle < 0.0");
- exception
- when Ada.Numerics.Argument_Error => null;
- when others =>
- Report.Failed ("wrong exception for cycle < 0.0");
- end;
-
- if Report.Ident_Int (2) = 1 then
- -- optimization thwarting code - never executed
- Report.Failed("2=1" & Real'Image (X+Y));
- end if;
- end Exception_Cases;
-
-
- procedure Do_Test is
- begin
- Special_Cases;
- Exception_Cases;
- end Do_Test;
- end Generic_Check;
-
- package Chk_Float is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package Chk_A_Long_Float is new Generic_Check (A_Long_Float);
-begin
- Report.Test ("CXG2006",
- "Check the accuracy of the complex argument" &
- " function");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Chk_Float.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- Chk_A_Long_Float.Do_Test;
-
- Report.Result;
-end CXG2006;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2007.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2007.a
deleted file mode 100644
index ba07df29d52..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2007.a
+++ /dev/null
@@ -1,291 +0,0 @@
--- CXG2007.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the complex Compose_From_Polar function returns
--- results that are within the error bound allowed.
--- Check that Argument_Error is raised if the Cycle parameter
--- is less than or equal to zero.
---
--- TEST DESCRIPTION:
--- This test uses a generic package to compute and check the
--- values of the Compose_From_Polar function.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 23 FEB 96 SAIC Initial release for 2.1
--- 23 APR 96 SAIC Fixed error checking
--- 03 MAR 97 PWB.CTA Deleted checks with explicit Cycle => 2.0*Pi
---
--- CHANGE NOTE:
--- According to Ken Dritz, author of the Numerics Annex of the RM,
--- one should never specify the cycle 2.0*Pi for the trigonometric
--- functions. In particular, if the machine number for the first
--- argument is not an exact multiple of the machine number for the
--- explicit cycle, then the specified exact results cannot be
--- reasonably expected. The affected checks in this test have been
--- marked as comments, with the additional notation "pwb-math".
--- Phil Brashear
---!
-
-with System;
-with Report;
-with Ada.Numerics;
-with Ada.Numerics.Generic_Complex_Types;
-procedure CXG2007 is
- Verbose : constant Boolean := False;
-
-
- -- CRC Standard Mathematical Tables; 23rd Edition; pg 738
- Sqrt2 : constant :=
- 1.41421_35623_73095_04880_16887_24209_69807_85696_71875_37695;
- Sqrt3 : constant :=
- 1.73205_08075_68877_29352_74463_41505_87236_69428_05253_81039;
-
- Pi : constant := Ada.Numerics.Pi;
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Complex_Types is new
- Ada.Numerics.Generic_Complex_Types (Real);
- use Complex_Types;
-
- Maximum_Relative_Error : constant Real := 3.0;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real;
- Arg_Error : Real) is
- -- Arg_Error is additional absolute error that is allowed beyond
- -- the MRE to account for error in the result that can be
- -- attributed to error in the arguments.
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Small instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
- Max_Error := Max_Error + Arg_Error;
-
- if abs (Actual - Expected) > Max_Error then
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Check (Actual, Expected : Complex;
- Test_Name : String;
- MRE : Real;
- Arg_Error : Real) is
- -- Arg_Error is additional absolute error that is allowed beyond
- -- the MRE to account for error in the result that can be
- -- attributed to error in the arguments.
- begin
- Check (Actual.Re, Expected.Re,
- Test_Name & " real part",
- MRE, Arg_Error);
- Check (Actual.Im, Expected.Im,
- Test_Name & " imaginary part",
- MRE, Arg_Error);
- end Check;
-
-
- procedure Special_Cases is
- type Data_Point is
- record
- Re,
- Im,
- Modulus,
- Radians,
- Degrees,
- Arg_Error : Real;
- end record;
-
- -- shorthand names for various constants
- P4 : constant := Pi/4.0;
- P6 : constant := Pi/6.0;
-
- MER2 : constant Real := Real'Model_Epsilon * Sqrt2;
-
- type Test_Data_Type is array (Positive range <>) of Data_Point;
-
- -- the values in the following table only involve static
- -- expressions so no loss of precision occurs.
- Test_Data : constant Test_Data_Type := (
- --Re Im Modulus Radians Degrees Arg_Err
- ( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ), -- 1
- ( 0.0, 0.0, 0.0, Pi, 180.0, 0.0 ), -- 2
-
- ( 1.0, 0.0, 1.0, 0.0, 0.0, 0.0 ), -- 3
- (-1.0, 0.0, -1.0, 0.0, 0.0, 0.0 ), -- 4
-
- ( 1.0, 1.0, Sqrt2, P4, 45.0, MER2), -- 5
- (-1.0, 1.0, -Sqrt2, -P4, -45.0, MER2), -- 6
- ( 1.0, -1.0, Sqrt2, -P4, -45.0, MER2), -- 7
- (-1.0, -1.0, -Sqrt2, P4, 45.0, MER2), -- 8
- (-1.0, -1.0, Sqrt2, -3.0*P4,-135.0, MER2), -- 9
- (-1.0, 1.0, Sqrt2, 3.0*P4, 135.0, MER2), -- 10
- ( 1.0, -1.0, -Sqrt2, 3.0*P4, 135.0, MER2), -- 11
-
- (-1.0, 0.0, 1.0, Pi, 180.0, 0.0 ), -- 12
- ( 1.0, 0.0, -1.0, Pi, 180.0, 0.0 ) ); -- 13
-
-
- Z : Complex;
- Exp : Complex;
- begin
- for I in Test_Data'Range loop
- begin
- Exp := (Test_Data (I).Re, Test_Data (I).Im);
-
- Z := Compose_From_Polar (Test_Data (I).Modulus,
- Test_Data (I).Radians);
- Check (Z, Exp,
- "test" & Integer'Image (I) & " compose_from_polar(m,r)",
- Maximum_Relative_Error, Test_Data (I).Arg_Error);
-
---pwb-math Z := Compose_From_Polar (Test_Data (I).Modulus,
---pwb-math Test_Data (I).Radians,
---pwb-math 2.0*Pi);
---pwb-math Check (Z, Exp,
---pwb-math "test" & Integer'Image (I) & " compose_from_polar(m,r,2pi)",
---pwb-math Maximum_Relative_Error, Test_Data (I).Arg_Error);
-
- Z := Compose_From_Polar (Test_Data (I).Modulus,
- Test_Data (I).Degrees,
- 360.0);
- Check (Z, Exp,
- "test" & Integer'Image (I) & " compose_from_polar(m,d,360)",
- Maximum_Relative_Error, Test_Data (I).Arg_Error);
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test" &
- Integer'Image (I));
- when others =>
- Report.Failed ("exception in test" &
- Integer'Image (I));
- end;
- end loop;
- end Special_Cases;
-
-
- procedure Exception_Cases is
- -- check that Argument_Error is raised if Cycle is <= 0
- Z : Complex;
- W : Complex;
- begin
- begin
- Z := Compose_From_Polar (3.0, 0.0, Cycle => 0.0);
- Report.Failed ("no exception for cycle = 0.0");
- exception
- when Ada.Numerics.Argument_Error => null;
- when others =>
- Report.Failed ("wrong exception for cycle = 0.0");
- end;
-
- begin
- W := Compose_From_Polar (6.0, 1.0, Cycle => -10.0);
- Report.Failed ("no exception for cycle < 0.0");
- exception
- when Ada.Numerics.Argument_Error => null;
- when others =>
- Report.Failed ("wrong exception for cycle < 0.0");
- end;
-
- if Report.Ident_Int (1) = 2 then
- -- not executed - used to make it appear that we use the
- -- results of the above computation
- Z := Z * W;
- Report.Failed(Real'Image (Z.Re + Z.Im));
- end if;
- end Exception_Cases;
-
-
- procedure Do_Test is
- begin
- Special_Cases;
- Exception_Cases;
- end Do_Test;
- end Generic_Check;
-
- package Chk_Float is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package Chk_A_Long_Float is new Generic_Check (A_Long_Float);
-begin
- Report.Test ("CXG2007",
- "Check the accuracy of the Compose_From_Polar" &
- " function");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
- Chk_Float.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
- Chk_A_Long_Float.Do_Test;
-
- Report.Result;
-end CXG2007;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2008.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2008.a
deleted file mode 100644
index 58cf367f61c..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2008.a
+++ /dev/null
@@ -1,948 +0,0 @@
--- CXG2008.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the complex multiplication and division
--- operations return results that are within the allowed
--- error bound.
--- Check that all the required pure Numerics packages are pure.
---
--- TEST DESCRIPTION:
--- This test contains three test packages that are almost
--- identical. The first two packages differ only in the
--- floating point type that is being tested. The first
--- and third package differ only in whether the generic
--- complex types package or the pre-instantiated
--- package is used.
--- The test package is not generic so that the arguments
--- and expected results for some of the test values
--- can be expressed as universal real instead of being
--- computed at runtime.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 24 FEB 96 SAIC Initial release for 2.1
--- 03 JUN 98 EDS Correct the test program's incorrect assumption
--- that Constraint_Error must be raised by complex
--- division by zero, which is contrary to the
--- allowance given by the Ada 95 standard G.1.1(40).
--- 13 MAR 01 RLB Replaced commented out Pure check on non-generic
--- packages, as required by Defect Report
--- 8652/0020 and as reflected in Technical
--- Corrigendum 1.
---!
-
-------------------------------------------------------------------------------
--- Check that the required pure packages are pure by withing them from a
--- pure package. The non-generic versions of those packages are required to
--- be pure by Defect Report 8652/0020, Technical Corrigendum 1 [A.5.1(9/1) and
--- G.1.1(25/1)].
-with Ada.Numerics.Generic_Elementary_Functions;
-with Ada.Numerics.Elementary_Functions;
-with Ada.Numerics.Generic_Complex_Types;
-with Ada.Numerics.Complex_Types;
-with Ada.Numerics.Generic_Complex_Elementary_Functions;
-with Ada.Numerics.Complex_Elementary_Functions;
-package CXG2008_0 is
- pragma Pure;
- -- CRC Standard Mathematical Tables; 23rd Edition; pg 738
- Sqrt2 : constant :=
- 1.41421_35623_73095_04880_16887_24209_69807_85696_71875_37695;
- Sqrt3 : constant :=
- 1.73205_08075_68877_29352_74463_41505_87236_69428_05253_81039;
-end CXG2008_0;
-
-------------------------------------------------------------------------------
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Complex_Types;
-with Ada.Numerics.Complex_Types;
-with CXG2008_0; use CXG2008_0;
-procedure CXG2008 is
- Verbose : constant Boolean := False;
-
- package Float_Check is
- subtype Real is Float;
- procedure Do_Test;
- end Float_Check;
-
- package body Float_Check is
- package Complex_Types is new
- Ada.Numerics.Generic_Complex_Types (Real);
- use Complex_Types;
-
- -- keep track if an accuracy failure has occurred so the test
- -- can be short-circuited to avoid thousands of error messages.
- Failure_Detected : Boolean := False;
-
- Mult_MBE : constant Real := 5.0;
- Divide_MBE : constant Real := 13.0;
-
-
- procedure Check (Actual, Expected : Complex;
- Test_Name : String;
- MBE : Real) is
- Rel_Error : Real;
- Abs_Error : Real;
- Max_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MBE * abs Expected.Re * Real'Model_Epsilon;
- Abs_Error := MBE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual.Re - Expected.Re) > Max_Error then
- Failure_Detected := True;
- Report.Failed (Test_Name &
- " actual.re: " & Real'Image (Actual.Re) &
- " expected.re: " & Real'Image (Expected.Re) &
- " difference.re " &
- Real'Image (Actual.Re - Expected.Re) &
- " mre:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result for real part");
- else
- Report.Comment (Test_Name & " passed for real part");
- end if;
- end if;
-
- Rel_Error := MBE * abs Expected.Im * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
- if abs (Actual.Im - Expected.Im) > Max_Error then
- Failure_Detected := True;
- Report.Failed (Test_Name &
- " actual.im: " & Real'Image (Actual.Im) &
- " expected.im: " & Real'Image (Expected.Im) &
- " difference.im " &
- Real'Image (Actual.Im - Expected.Im) &
- " mre:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result for imaginary part");
- else
- Report.Comment (Test_Name & " passed for imaginary part");
- end if;
- end if;
- end Check;
-
-
- procedure Special_Values is
- begin
-
- --- test 1 ---
- declare
- T : constant := (Real'Machine_EMax - 1) / 2;
- Big : constant := (1.0 * Real'Machine_Radix) ** (2 * T);
- Expected : Complex := (0.0, 0.0);
- X : Complex := (0.0, 0.0);
- Y : Complex := (Big, Big);
- Z : Complex;
- begin
- Z := X * Y;
- Check (Z, Expected, "test 1a -- (0+0i) * (big+big*i)",
- Mult_MBE);
- Z := Y * X;
- Check (Z, Expected, "test 1b -- (big+big*i) * (0+0i)",
- Mult_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 1");
- when others =>
- Report.Failed ("exception in test 1");
- end;
-
- --- test 2 ---
- declare
- T : constant := Real'Model_EMin + 1;
- Tiny : constant := (1.0 * Real'Machine_Radix) ** T;
- U : Complex := (Tiny, Tiny);
- X : Complex := (0.0, 0.0);
- Expected : Complex := (0.0, 0.0);
- Z : Complex;
- begin
- Z := U * X;
- Check (Z, Expected, "test 2 -- (tiny,tiny) * (0,0)",
- Mult_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 2");
- when others =>
- Report.Failed ("exception in test 2");
- end;
-
- --- test 3 ---
- declare
- T : constant := (Real'Machine_EMax - 1) / 2;
- Big : constant := (1.0 * Real'Machine_Radix) ** (2 * T);
- B : Complex := (Big, Big);
- X : Complex := (0.0, 0.0);
- Z : Complex;
- begin
- if Real'Machine_Overflows then
- Z := B / X;
- Report.Failed ("test 3 - Constraint_Error not raised");
- Check (Z, Z, "not executed - optimizer thwarting", 0.0);
- end if;
- exception
- when Constraint_Error => null; -- expected
- when others =>
- Report.Failed ("exception in test 3");
- end;
-
- --- test 4 ---
- declare
- T : constant := Real'Model_EMin + 1;
- Tiny : constant := (1.0 * Real'Machine_Radix) ** T;
- U : Complex := (Tiny, Tiny);
- X : Complex := (0.0, 0.0);
- Z : Complex;
- begin
- if Real'Machine_Overflows then
- Z := U / X;
- Report.Failed ("test 4 - Constraint_Error not raised");
- Check (Z, Z, "not executed - optimizer thwarting", 0.0);
- end if;
- exception
- when Constraint_Error => null; -- expected
- when others =>
- Report.Failed ("exception in test 4");
- end;
-
-
- --- test 5 ---
- declare
- X : Complex := (Sqrt2, Sqrt2);
- Z : Complex;
- Expected : constant Complex := (0.0, 4.0);
- begin
- Z := X * X;
- Check (Z, Expected, "test 5 -- (sqrt2,sqrt2) * (sqrt2,sqrt2)",
- Mult_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 5");
- when others =>
- Report.Failed ("exception in test 5");
- end;
-
- --- test 6 ---
- declare
- X : Complex := Sqrt3 - Sqrt3 * i;
- Z : Complex;
- Expected : constant Complex := (0.0, -6.0);
- begin
- Z := X * X;
- Check (Z, Expected, "test 6 -- (sqrt3,-sqrt3) * (sqrt3,-sqrt3)",
- Mult_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 6");
- when others =>
- Report.Failed ("exception in test 6");
- end;
-
- --- test 7 ---
- declare
- X : Complex := Sqrt2 + Sqrt2 * i;
- Y : Complex := Sqrt2 - Sqrt2 * i;
- Z : Complex;
- Expected : constant Complex := 0.0 + i;
- begin
- Z := X / Y;
- Check (Z, Expected, "test 7 -- (sqrt2,sqrt2) / (sqrt2,-sqrt2)",
- Divide_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 7");
- when others =>
- Report.Failed ("exception in test 7");
- end;
- end Special_Values;
-
-
- procedure Do_Mult_Div (X, Y : Complex) is
- Z : Complex;
- Args : constant String :=
- "X=(" & Real'Image (X.Re) & "," & Real'Image (X.Im) & ") " &
- "Y=(" & Real'Image (Y.Re) & "," & Real'Image (Y.Im) & ") " ;
- begin
- Z := (X * X) / X;
- Check (Z, X, "X*X/X " & Args, Mult_MBE + Divide_MBE);
- Z := (X * Y) / X;
- Check (Z, Y, "X*Y/X " & Args, Mult_MBE + Divide_MBE);
- Z := (X * Y) / Y;
- Check (Z, X, "X*Y/Y " & Args, Mult_MBE + Divide_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error in Do_Mult_Div for " & Args);
- when others =>
- Report.Failed ("exception in Do_Mult_Div for " & Args);
- end Do_Mult_Div;
-
- -- select complex values X and Y where the real and imaginary
- -- parts are selected from the ranges (1/radix..1) and
- -- (1..radix). This translates into quite a few combinations.
- procedure Mult_Div_Check is
- Samples : constant := 17;
- Radix : constant Real := Real(Real'Machine_Radix);
- Inv_Radix : constant Real := 1.0 / Real(Real'Machine_Radix);
- Low_Sample : Real; -- (1/radix .. 1)
- High_Sample : Real; -- (1 .. radix)
- Sample : array (1..2) of Real;
- X, Y : Complex;
- begin
- for I in 1 .. Samples loop
- Low_Sample := (1.0 - Inv_Radix) / Real (Samples) * Real (I) +
- Inv_Radix;
- Sample (1) := Low_Sample;
- for J in 1 .. Samples loop
- High_Sample := (Radix - 1.0) / Real (Samples) * Real (I) +
- Radix;
- Sample (2) := High_Sample;
- for K in 1 .. 2 loop
- for L in 1 .. 2 loop
- X := Complex'(Sample (K), Sample (L));
- Y := Complex'(Sample (L), Sample (K));
- Do_Mult_Div (X, Y);
- if Failure_Detected then
- return; -- minimize flood of error messages
- end if;
- end loop;
- end loop;
- end loop; -- J
- end loop; -- I
- end Mult_Div_Check;
-
-
- procedure Do_Test is
- begin
- Special_Values;
- Mult_Div_Check;
- end Do_Test;
- end Float_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- -- check the floating point type with the most digits
-
- package A_Long_Float_Check is
- type A_Long_Float is digits System.Max_Digits;
- subtype Real is A_Long_Float;
- procedure Do_Test;
- end A_Long_Float_Check;
-
- package body A_Long_Float_Check is
-
- package Complex_Types is new
- Ada.Numerics.Generic_Complex_Types (Real);
- use Complex_Types;
-
- -- keep track if an accuracy failure has occurred so the test
- -- can be short-circuited to avoid thousands of error messages.
- Failure_Detected : Boolean := False;
-
- Mult_MBE : constant Real := 5.0;
- Divide_MBE : constant Real := 13.0;
-
-
- procedure Check (Actual, Expected : Complex;
- Test_Name : String;
- MBE : Real) is
- Rel_Error : Real;
- Abs_Error : Real;
- Max_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MBE * abs Expected.Re * Real'Model_Epsilon;
- Abs_Error := MBE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual.Re - Expected.Re) > Max_Error then
- Failure_Detected := True;
- Report.Failed (Test_Name &
- " actual.re: " & Real'Image (Actual.Re) &
- " expected.re: " & Real'Image (Expected.Re) &
- " difference.re " &
- Real'Image (Actual.Re - Expected.Re) &
- " mre:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result for real part");
- else
- Report.Comment (Test_Name & " passed for real part");
- end if;
- end if;
-
- Rel_Error := MBE * abs Expected.Im * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
- if abs (Actual.Im - Expected.Im) > Max_Error then
- Failure_Detected := True;
- Report.Failed (Test_Name &
- " actual.im: " & Real'Image (Actual.Im) &
- " expected.im: " & Real'Image (Expected.Im) &
- " difference.im " &
- Real'Image (Actual.Im - Expected.Im) &
- " mre:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result for imaginary part");
- else
- Report.Comment (Test_Name & " passed for imaginary part");
- end if;
- end if;
- end Check;
-
-
- procedure Special_Values is
- begin
-
- --- test 1 ---
- declare
- T : constant := (Real'Machine_EMax - 1) / 2;
- Big : constant := (1.0 * Real'Machine_Radix) ** (2 * T);
- Expected : Complex := (0.0, 0.0);
- X : Complex := (0.0, 0.0);
- Y : Complex := (Big, Big);
- Z : Complex;
- begin
- Z := X * Y;
- Check (Z, Expected, "test 1a -- (0+0i) * (big+big*i)",
- Mult_MBE);
- Z := Y * X;
- Check (Z, Expected, "test 1b -- (big+big*i) * (0+0i)",
- Mult_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 1");
- when others =>
- Report.Failed ("exception in test 1");
- end;
-
- --- test 2 ---
- declare
- T : constant := Real'Model_EMin + 1;
- Tiny : constant := (1.0 * Real'Machine_Radix) ** T;
- U : Complex := (Tiny, Tiny);
- X : Complex := (0.0, 0.0);
- Expected : Complex := (0.0, 0.0);
- Z : Complex;
- begin
- Z := U * X;
- Check (Z, Expected, "test 2 -- (tiny,tiny) * (0,0)",
- Mult_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 2");
- when others =>
- Report.Failed ("exception in test 2");
- end;
-
- --- test 3 ---
- declare
- T : constant := (Real'Machine_EMax - 1) / 2;
- Big : constant := (1.0 * Real'Machine_Radix) ** (2 * T);
- B : Complex := (Big, Big);
- X : Complex := (0.0, 0.0);
- Z : Complex;
- begin
- if Real'Machine_Overflows then
- Z := B / X;
- Report.Failed ("test 3 - Constraint_Error not raised");
- Check (Z, Z, "not executed - optimizer thwarting", 0.0);
- end if;
- exception
- when Constraint_Error => null; -- expected
- when others =>
- Report.Failed ("exception in test 3");
- end;
-
- --- test 4 ---
- declare
- T : constant := Real'Model_EMin + 1;
- Tiny : constant := (1.0 * Real'Machine_Radix) ** T;
- U : Complex := (Tiny, Tiny);
- X : Complex := (0.0, 0.0);
- Z : Complex;
- begin
- if Real'Machine_Overflows then
- Z := U / X;
- Report.Failed ("test 4 - Constraint_Error not raised");
- Check (Z, Z, "not executed - optimizer thwarting", 0.0);
- end if;
- exception
- when Constraint_Error => null; -- expected
- when others =>
- Report.Failed ("exception in test 4");
- end;
-
-
- --- test 5 ---
- declare
- X : Complex := (Sqrt2, Sqrt2);
- Z : Complex;
- Expected : constant Complex := (0.0, 4.0);
- begin
- Z := X * X;
- Check (Z, Expected, "test 5 -- (sqrt2,sqrt2) * (sqrt2,sqrt2)",
- Mult_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 5");
- when others =>
- Report.Failed ("exception in test 5");
- end;
-
- --- test 6 ---
- declare
- X : Complex := Sqrt3 - Sqrt3 * i;
- Z : Complex;
- Expected : constant Complex := (0.0, -6.0);
- begin
- Z := X * X;
- Check (Z, Expected, "test 6 -- (sqrt3,-sqrt3) * (sqrt3,-sqrt3)",
- Mult_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 6");
- when others =>
- Report.Failed ("exception in test 6");
- end;
-
- --- test 7 ---
- declare
- X : Complex := Sqrt2 + Sqrt2 * i;
- Y : Complex := Sqrt2 - Sqrt2 * i;
- Z : Complex;
- Expected : constant Complex := 0.0 + i;
- begin
- Z := X / Y;
- Check (Z, Expected, "test 7 -- (sqrt2,sqrt2) / (sqrt2,-sqrt2)",
- Divide_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 7");
- when others =>
- Report.Failed ("exception in test 7");
- end;
- end Special_Values;
-
-
- procedure Do_Mult_Div (X, Y : Complex) is
- Z : Complex;
- Args : constant String :=
- "X=(" & Real'Image (X.Re) & "," & Real'Image (X.Im) & ") " &
- "Y=(" & Real'Image (Y.Re) & "," & Real'Image (Y.Im) & ") " ;
- begin
- Z := (X * X) / X;
- Check (Z, X, "X*X/X " & Args, Mult_MBE + Divide_MBE);
- Z := (X * Y) / X;
- Check (Z, Y, "X*Y/X " & Args, Mult_MBE + Divide_MBE);
- Z := (X * Y) / Y;
- Check (Z, X, "X*Y/Y " & Args, Mult_MBE + Divide_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error in Do_Mult_Div for " & Args);
- when others =>
- Report.Failed ("exception in Do_Mult_Div for " & Args);
- end Do_Mult_Div;
-
- -- select complex values X and Y where the real and imaginary
- -- parts are selected from the ranges (1/radix..1) and
- -- (1..radix). This translates into quite a few combinations.
- procedure Mult_Div_Check is
- Samples : constant := 17;
- Radix : constant Real := Real(Real'Machine_Radix);
- Inv_Radix : constant Real := 1.0 / Real(Real'Machine_Radix);
- Low_Sample : Real; -- (1/radix .. 1)
- High_Sample : Real; -- (1 .. radix)
- Sample : array (1..2) of Real;
- X, Y : Complex;
- begin
- for I in 1 .. Samples loop
- Low_Sample := (1.0 - Inv_Radix) / Real (Samples) * Real (I) +
- Inv_Radix;
- Sample (1) := Low_Sample;
- for J in 1 .. Samples loop
- High_Sample := (Radix - 1.0) / Real (Samples) * Real (I) +
- Radix;
- Sample (2) := High_Sample;
- for K in 1 .. 2 loop
- for L in 1 .. 2 loop
- X := Complex'(Sample (K), Sample (L));
- Y := Complex'(Sample (L), Sample (K));
- Do_Mult_Div (X, Y);
- if Failure_Detected then
- return; -- minimize flood of error messages
- end if;
- end loop;
- end loop;
- end loop; -- J
- end loop; -- I
- end Mult_Div_Check;
-
-
- procedure Do_Test is
- begin
- Special_Values;
- Mult_Div_Check;
- end Do_Test;
- end A_Long_Float_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
- package Non_Generic_Check is
- subtype Real is Float;
- procedure Do_Test;
- end Non_Generic_Check;
-
- package body Non_Generic_Check is
-
- use Ada.Numerics.Complex_Types;
-
- -- keep track if an accuracy failure has occurred so the test
- -- can be short-circuited to avoid thousands of error messages.
- Failure_Detected : Boolean := False;
-
- Mult_MBE : constant Real := 5.0;
- Divide_MBE : constant Real := 13.0;
-
-
- procedure Check (Actual, Expected : Complex;
- Test_Name : String;
- MBE : Real) is
- Rel_Error : Real;
- Abs_Error : Real;
- Max_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MBE * abs Expected.Re * Real'Model_Epsilon;
- Abs_Error := MBE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual.Re - Expected.Re) > Max_Error then
- Failure_Detected := True;
- Report.Failed (Test_Name &
- " actual.re: " & Real'Image (Actual.Re) &
- " expected.re: " & Real'Image (Expected.Re) &
- " difference.re " &
- Real'Image (Actual.Re - Expected.Re) &
- " mre:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result for real part");
- else
- Report.Comment (Test_Name & " passed for real part");
- end if;
- end if;
-
- Rel_Error := MBE * abs Expected.Im * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
- if abs (Actual.Im - Expected.Im) > Max_Error then
- Failure_Detected := True;
- Report.Failed (Test_Name &
- " actual.im: " & Real'Image (Actual.Im) &
- " expected.im: " & Real'Image (Expected.Im) &
- " difference.im " &
- Real'Image (Actual.Im - Expected.Im) &
- " mre:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result for imaginary part");
- else
- Report.Comment (Test_Name & " passed for imaginary part");
- end if;
- end if;
- end Check;
-
-
- procedure Special_Values is
- begin
-
- --- test 1 ---
- declare
- T : constant := (Real'Machine_EMax - 1) / 2;
- Big : constant := (1.0 * Real'Machine_Radix) ** (2 * T);
- Expected : Complex := (0.0, 0.0);
- X : Complex := (0.0, 0.0);
- Y : Complex := (Big, Big);
- Z : Complex;
- begin
- Z := X * Y;
- Check (Z, Expected, "test 1a -- (0+0i) * (big+big*i)",
- Mult_MBE);
- Z := Y * X;
- Check (Z, Expected, "test 1b -- (big+big*i) * (0+0i)",
- Mult_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 1");
- when others =>
- Report.Failed ("exception in test 1");
- end;
-
- --- test 2 ---
- declare
- T : constant := Real'Model_EMin + 1;
- Tiny : constant := (1.0 * Real'Machine_Radix) ** T;
- U : Complex := (Tiny, Tiny);
- X : Complex := (0.0, 0.0);
- Expected : Complex := (0.0, 0.0);
- Z : Complex;
- begin
- Z := U * X;
- Check (Z, Expected, "test 2 -- (tiny,tiny) * (0,0)",
- Mult_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 2");
- when others =>
- Report.Failed ("exception in test 2");
- end;
-
- --- test 3 ---
- declare
- T : constant := (Real'Machine_EMax - 1) / 2;
- Big : constant := (1.0 * Real'Machine_Radix) ** (2 * T);
- B : Complex := (Big, Big);
- X : Complex := (0.0, 0.0);
- Z : Complex;
- begin
- if Real'Machine_Overflows then
- Z := B / X;
- Report.Failed ("test 3 - Constraint_Error not raised");
- Check (Z, Z, "not executed - optimizer thwarting", 0.0);
- end if;
- exception
- when Constraint_Error => null; -- expected
- when others =>
- Report.Failed ("exception in test 3");
- end;
-
- --- test 4 ---
- declare
- T : constant := Real'Model_EMin + 1;
- Tiny : constant := (1.0 * Real'Machine_Radix) ** T;
- U : Complex := (Tiny, Tiny);
- X : Complex := (0.0, 0.0);
- Z : Complex;
- begin
- if Real'Machine_Overflows then
- Z := U / X;
- Report.Failed ("test 4 - Constraint_Error not raised");
- Check (Z, Z, "not executed - optimizer thwarting", 0.0);
- end if;
- exception
- when Constraint_Error => null; -- expected
- when others =>
- Report.Failed ("exception in test 4");
- end;
-
-
- --- test 5 ---
- declare
- X : Complex := (Sqrt2, Sqrt2);
- Z : Complex;
- Expected : constant Complex := (0.0, 4.0);
- begin
- Z := X * X;
- Check (Z, Expected, "test 5 -- (sqrt2,sqrt2) * (sqrt2,sqrt2)",
- Mult_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 5");
- when others =>
- Report.Failed ("exception in test 5");
- end;
-
- --- test 6 ---
- declare
- X : Complex := Sqrt3 - Sqrt3 * i;
- Z : Complex;
- Expected : constant Complex := (0.0, -6.0);
- begin
- Z := X * X;
- Check (Z, Expected, "test 6 -- (sqrt3,-sqrt3) * (sqrt3,-sqrt3)",
- Mult_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 6");
- when others =>
- Report.Failed ("exception in test 6");
- end;
-
- --- test 7 ---
- declare
- X : Complex := Sqrt2 + Sqrt2 * i;
- Y : Complex := Sqrt2 - Sqrt2 * i;
- Z : Complex;
- Expected : constant Complex := 0.0 + i;
- begin
- Z := X / Y;
- Check (Z, Expected, "test 7 -- (sqrt2,sqrt2) / (sqrt2,-sqrt2)",
- Divide_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 7");
- when others =>
- Report.Failed ("exception in test 7");
- end;
- end Special_Values;
-
-
- procedure Do_Mult_Div (X, Y : Complex) is
- Z : Complex;
- Args : constant String :=
- "X=(" & Real'Image (X.Re) & "," & Real'Image (X.Im) & ") " &
- "Y=(" & Real'Image (Y.Re) & "," & Real'Image (Y.Im) & ") " ;
- begin
- Z := (X * X) / X;
- Check (Z, X, "X*X/X " & Args, Mult_MBE + Divide_MBE);
- Z := (X * Y) / X;
- Check (Z, Y, "X*Y/X " & Args, Mult_MBE + Divide_MBE);
- Z := (X * Y) / Y;
- Check (Z, X, "X*Y/Y " & Args, Mult_MBE + Divide_MBE);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error in Do_Mult_Div for " & Args);
- when others =>
- Report.Failed ("exception in Do_Mult_Div for " & Args);
- end Do_Mult_Div;
-
- -- select complex values X and Y where the real and imaginary
- -- parts are selected from the ranges (1/radix..1) and
- -- (1..radix). This translates into quite a few combinations.
- procedure Mult_Div_Check is
- Samples : constant := 17;
- Radix : constant Real := Real(Real'Machine_Radix);
- Inv_Radix : constant Real := 1.0 / Real(Real'Machine_Radix);
- Low_Sample : Real; -- (1/radix .. 1)
- High_Sample : Real; -- (1 .. radix)
- Sample : array (1..2) of Real;
- X, Y : Complex;
- begin
- for I in 1 .. Samples loop
- Low_Sample := (1.0 - Inv_Radix) / Real (Samples) * Real (I) +
- Inv_Radix;
- Sample (1) := Low_Sample;
- for J in 1 .. Samples loop
- High_Sample := (Radix - 1.0) / Real (Samples) * Real (I) +
- Radix;
- Sample (2) := High_Sample;
- for K in 1 .. 2 loop
- for L in 1 .. 2 loop
- X := Complex'(Sample (K), Sample (L));
- Y := Complex'(Sample (L), Sample (K));
- Do_Mult_Div (X, Y);
- if Failure_Detected then
- return; -- minimize flood of error messages
- end if;
- end loop;
- end loop;
- end loop; -- J
- end loop; -- I
- end Mult_Div_Check;
-
-
- procedure Do_Test is
- begin
- Special_Values;
- Mult_Div_Check;
- end Do_Test;
- end Non_Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-begin
- Report.Test ("CXG2008",
- "Check the accuracy of the complex multiplication and" &
- " division operators");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking non-generic package");
- end if;
-
- Non_Generic_Check.Do_Test;
-
- Report.Result;
-end CXG2008;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2009.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2009.a
deleted file mode 100644
index 0b11ca53887..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2009.a
+++ /dev/null
@@ -1,421 +0,0 @@
--- CXG2009.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the real sqrt and complex modulus functions
--- return results that are within the allowed
--- error bound.
---
--- TEST DESCRIPTION:
--- This test checks the accuracy of the sqrt and modulus functions
--- by computing the norm of various vectors where the result
--- is known in advance.
--- This test uses real and complex math together as would an
--- actual application. Considerable use of generics is also
--- employed.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 26 FEB 96 SAIC Initial release for 2.1
--- 22 AUG 96 SAIC Revised Check procedure
---
---!
-
-------------------------------------------------------------------------------
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Complex_Types;
-with Ada.Numerics.Generic_Elementary_Functions;
-procedure CXG2009 is
- Verbose : constant Boolean := False;
-
- --=====================================================================
-
- generic
- type Real is digits <>;
- package Generic_Real_Norm_Check is
- procedure Do_Test;
- end Generic_Real_Norm_Check;
-
- -----------------------------------------------------------------------
-
- package body Generic_Real_Norm_Check is
- type Vector is array (Integer range <>) of Real;
-
- package GEF is new Ada.Numerics.Generic_Elementary_Functions (Real);
- function Sqrt (X : Real) return Real renames GEF.Sqrt;
-
- function One_Norm (V : Vector) return Real is
- -- sum of absolute values of the elements of the vector
- Result : Real := 0.0;
- begin
- for I in V'Range loop
- Result := Result + abs V(I);
- end loop;
- return Result;
- end One_Norm;
-
- function Inf_Norm (V : Vector) return Real is
- -- greatest absolute vector element
- Result : Real := 0.0;
- begin
- for I in V'Range loop
- if abs V(I) > Result then
- Result := abs V(I);
- end if;
- end loop;
- return Result;
- end Inf_Norm;
-
- function Two_Norm (V : Vector) return Real is
- -- if greatest absolute vector element is 0 then return 0
- -- else return greatest * sqrt (sum((element / greatest) ** 2)))
- -- where greatest is Inf_Norm of the vector
- Inf_N : Real;
- Sum_Squares : Real;
- Term : Real;
- begin
- Inf_N := Inf_Norm (V);
- if Inf_N = 0.0 then
- return 0.0;
- end if;
- Sum_Squares := 0.0;
- for I in V'Range loop
- Term := V (I) / Inf_N;
- Sum_Squares := Sum_Squares + Term * Term;
- end loop;
- return Inf_N * Sqrt (Sum_Squares);
- end Two_Norm;
-
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real;
- Vector_Length : Integer) is
- Rel_Error : Real;
- Abs_Error : Real;
- Max_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Report.Failed (Test_Name &
- " VectLength:" &
- Integer'Image (Vector_Length) &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " &
- Real'Image (Actual - Expected) &
- " mre:" & Real'Image (Max_Error) );
- elsif Verbose then
- Report.Comment (Test_Name & " vector length" &
- Integer'Image (Vector_Length));
- end if;
- end Check;
-
-
- procedure Do_Test is
- begin
- for Vector_Length in 1 .. 10 loop
- declare
- V : Vector (1..Vector_Length) := (1..Vector_Length => 0.0);
- V1 : Vector (1..Vector_Length) := (1..Vector_Length => 1.0);
- begin
- Check (One_Norm (V), 0.0, "one_norm (z)", 0.0, Vector_Length);
- Check (Inf_Norm (V), 0.0, "inf_norm (z)", 0.0, Vector_Length);
-
- for J in 1..Vector_Length loop
- V := (1..Vector_Length => 0.0);
- V (J) := 1.0;
- Check (One_Norm (V), 1.0, "one_norm (010)",
- 0.0, Vector_Length);
- Check (Inf_Norm (V), 1.0, "inf_norm (010)",
- 0.0, Vector_Length);
- Check (Two_Norm (V), 1.0, "two_norm (010)",
- 0.0, Vector_Length);
- end loop;
-
- Check (One_Norm (V1), Real (Vector_Length), "one_norm (1)",
- 0.0, Vector_Length);
- Check (Inf_Norm (V1), 1.0, "inf_norm (1)",
- 0.0, Vector_Length);
-
- -- error in computing Two_Norm and expected result
- -- are as follows (ME is Model_Epsilon * Expected_Value):
- -- 2ME from expected Sqrt
- -- 2ME from Sqrt in Two_Norm times the error in the
- -- vector calculation.
- -- The vector calculation contains the following error
- -- based upon the length N of the vector:
- -- N*1ME from squaring terms in Two_Norm
- -- N*1ME from the division of each term in Two_Norm
- -- (N-1)*1ME from the sum of the terms
- -- This gives (2 + 2 * (N + N + (N-1)) ) * ME
- -- which simplifies to (2 + 2N + 2N + 2N - 2) * ME
- -- or 6*N*ME
- Check (Two_Norm (V1), Sqrt (Real(Vector_Length)),
- "two_norm (1)",
- (Real (6 * Vector_Length)),
- Vector_Length);
- exception
- when others => Report.Failed ("exception for vector length" &
- Integer'Image (Vector_Length) );
- end;
- end loop;
- end Do_Test;
- end Generic_Real_Norm_Check;
-
- --=====================================================================
-
- generic
- type Real is digits <>;
- package Generic_Complex_Norm_Check is
- procedure Do_Test;
- end Generic_Complex_Norm_Check;
-
- -----------------------------------------------------------------------
-
- package body Generic_Complex_Norm_Check is
- package Complex_Types is new Ada.Numerics.Generic_Complex_Types (Real);
- use Complex_Types;
- type Vector is array (Integer range <>) of Complex;
-
- package GEF is new Ada.Numerics.Generic_Elementary_Functions (Real);
- function Sqrt (X : Real) return Real renames GEF.Sqrt;
-
- function One_Norm (V : Vector) return Real is
- Result : Real := 0.0;
- begin
- for I in V'Range loop
- Result := Result + abs V(I);
- end loop;
- return Result;
- end One_Norm;
-
- function Inf_Norm (V : Vector) return Real is
- Result : Real := 0.0;
- begin
- for I in V'Range loop
- if abs V(I) > Result then
- Result := abs V(I);
- end if;
- end loop;
- return Result;
- end Inf_Norm;
-
- function Two_Norm (V : Vector) return Real is
- Inf_N : Real;
- Sum_Squares : Real;
- Term : Real;
- begin
- Inf_N := Inf_Norm (V);
- if Inf_N = 0.0 then
- return 0.0;
- end if;
- Sum_Squares := 0.0;
- for I in V'Range loop
- Term := abs (V (I) / Inf_N );
- Sum_Squares := Sum_Squares + Term * Term;
- end loop;
- return Inf_N * Sqrt (Sum_Squares);
- end Two_Norm;
-
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real;
- Vector_Length : Integer) is
- Rel_Error : Real;
- Abs_Error : Real;
- Max_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Report.Failed (Test_Name &
- " VectLength:" &
- Integer'Image (Vector_Length) &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " &
- Real'Image (Actual - Expected) &
- " mre:" & Real'Image (Max_Error) );
- elsif Verbose then
- Report.Comment (Test_Name & " vector length" &
- Integer'Image (Vector_Length));
- end if;
- end Check;
-
-
- procedure Do_Test is
- begin
- for Vector_Length in 1 .. 10 loop
- declare
- V : Vector (1..Vector_Length) :=
- (1..Vector_Length => (0.0, 0.0));
- X, Y : Vector (1..Vector_Length);
- begin
- Check (One_Norm (V), 0.0, "one_norm (z)", 0.0, Vector_Length);
- Check (Inf_Norm (V), 0.0, "inf_norm (z)", 0.0, Vector_Length);
-
- for J in 1..Vector_Length loop
- X := (1..Vector_Length => (0.0, 0.0) );
- Y := X; -- X and Y are now both zeroed
- X (J).Re := 1.0;
- Y (J).Im := 1.0;
- Check (One_Norm (X), 1.0, "one_norm (0x0)",
- 0.0, Vector_Length);
- Check (Inf_Norm (X), 1.0, "inf_norm (0x0)",
- 0.0, Vector_Length);
- Check (Two_Norm (X), 1.0, "two_norm (0x0)",
- 0.0, Vector_Length);
- Check (One_Norm (Y), 1.0, "one_norm (0y0)",
- 0.0, Vector_Length);
- Check (Inf_Norm (Y), 1.0, "inf_norm (0y0)",
- 0.0, Vector_Length);
- Check (Two_Norm (Y), 1.0, "two_norm (0y0)",
- 0.0, Vector_Length);
- end loop;
-
- V := (1..Vector_Length => (3.0, 4.0));
-
- -- error in One_Norm is 3*N*ME for abs computation +
- -- (N-1)*ME for the additions
- -- which gives (4N-1) * ME
- Check (One_Norm (V), 5.0 * Real (Vector_Length),
- "one_norm ((3,4))",
- Real (4*Vector_Length - 1),
- Vector_Length);
-
- -- error in Inf_Norm is from abs of single element (3ME)
- Check (Inf_Norm (V), 5.0,
- "inf_norm ((3,4))",
- 3.0,
- Vector_Length);
-
- -- error in following comes from:
- -- 2ME in sqrt of expected result
- -- 3ME in Inf_Norm calculation
- -- 2ME in sqrt of vector calculation
- -- vector calculation has following error
- -- 3N*ME for abs
- -- N*ME for squaring
- -- N*ME for division
- -- (N-1)ME for sum
- -- this results in [2 + 3 + 2(6N-1) ] * ME
- -- or (12N + 3)ME
- Check (Two_Norm (V), 5.0 * Sqrt (Real(Vector_Length)),
- "two_norm ((3,4))",
- (12.0 * Real (Vector_Length) + 3.0),
- Vector_Length);
- exception
- when others => Report.Failed ("exception for complex " &
- "vector length" &
- Integer'Image (Vector_Length) );
- end;
- end loop;
- end Do_Test;
- end Generic_Complex_Norm_Check;
-
- --=====================================================================
-
- generic
- type Real is digits <>;
- package Generic_Norm_Check is
- procedure Do_Test;
- end Generic_Norm_Check;
-
- -----------------------------------------------------------------------
-
- package body Generic_Norm_Check is
- package RNC is new Generic_Real_Norm_Check (Real);
- package CNC is new Generic_Complex_Norm_Check (Real);
- procedure Do_Test is
- begin
- RNC.Do_Test;
- CNC.Do_Test;
- end Do_Test;
- end Generic_Norm_Check;
-
- --=====================================================================
-
- package Float_Check is new Generic_Norm_Check (Float);
-
- type A_Long_Float is digits System.Max_Digits;
- package A_Long_Float_Check is new Generic_Norm_Check (A_Long_Float);
-
- -----------------------------------------------------------------------
-
-begin
- Report.Test ("CXG2009",
- "Check the accuracy of the real sqrt and complex " &
- " modulus functions");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
- Report.Result;
-end CXG2009;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2010.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2010.a
deleted file mode 100644
index 4140a487526..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2010.a
+++ /dev/null
@@ -1,892 +0,0 @@
--- CXG2010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the exp function returns
--- results that are within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test contains three test packages that are almost
--- identical. The first two packages differ only in the
--- floating point type that is being tested. The first
--- and third package differ only in whether the generic
--- elementary functions package or the pre-instantiated
--- package is used.
--- The test package is not generic so that the arguments
--- and expected results for some of the test values
--- can be expressed as universal real instead of being
--- computed at runtime.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex and where the Machine_Radix is 2, 4, 8, or 16.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 1 Mar 96 SAIC Initial release for 2.1
--- 2 Sep 96 SAIC Improved check routine
---
---!
-
---
--- References:
---
--- Software Manual for the Elementary Functions
--- William J. Cody, Jr. and William Waite
--- Prentice-Hall, 1980
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
--- Implementation and Testing of Function Software
--- W. J. Cody
--- Problems and Methodologies in Mathematical Software Production
--- editors P. C. Messina and A. Murli
--- Lecture Notes in Computer Science Volume 142
--- Springer Verlag, 1982
---
-
---
--- Notes on derivation of error bound for exp(p)*exp(-p)
---
--- Let a = true value of exp(p) and ac be the computed value.
--- Then a = ac(1+e1), where |e1| <= 4*Model_Epsilon.
--- Similarly, let b = true value of exp(-p) and bc be the computed value.
--- Then b = bc(1+e2), where |e2| <= 4*ME.
---
--- The product of x and y is (x*y)(1+e3), where |e3| <= 1.0ME
---
--- Hence, the computed ab is [ac(1+e1)*bc(1+e2)](1+e3) =
--- (ac*bc)[1 + e1 + e2 + e3 + e1e2 + e1e3 + e2e3 + e1e2e3).
---
--- Throwing away the last four tiny terms, we have (ac*bc)(1 + eta),
---
--- where |eta| <= (4+4+1)ME = 9.0Model_Epsilon.
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Elementary_Functions;
-with Ada.Numerics.Elementary_Functions;
-procedure CXG2010 is
- Verbose : constant Boolean := False;
- Max_Samples : constant := 1000;
- Accuracy_Error_Reported : Boolean := False;
-
- package Float_Check is
- subtype Real is Float;
- procedure Do_Test;
- end Float_Check;
-
- package body Float_Check is
- package Elementary_Functions is new
- Ada.Numerics.Generic_Elementary_Functions (Real);
- function Sqrt (X : Real) return Real renames
- Elementary_Functions.Sqrt;
- function Exp (X : Real) return Real renames
- Elementary_Functions.Exp;
-
-
- -- The following value is a lower bound on the accuracy
- -- required. It is normally 0.0 so that the lower bound
- -- is computed from Model_Epsilon. However, for tests
- -- where the expected result is only known to a certain
- -- amount of precision this bound takes on a non-zero
- -- value to account for that level of precision.
- Error_Low_Bound : Real := 0.0;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon
- -- instead of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- -- take into account the low bound on the error
- if Max_Error < Error_Low_Bound then
- Max_Error := Error_Low_Bound;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Argument_Range_Check_1 (A, B : Real;
- Test : String) is
- -- test a evenly distributed selection of
- -- arguments selected from the range A to B.
- -- Test using identity: EXP(X-V) = EXP(X) * EXP (-V)
- -- The parameter One_Minus_Exp_Minus_V is the value
- -- 1.0 - Exp (-V)
- -- accurate to machine precision.
- -- This procedure is a translation of part of Cody's test
- X : Real;
- Y : Real;
- ZX, ZY : Real;
- V : constant := 1.0 / 16.0;
- One_Minus_Exp_Minus_V : constant := 6.058693718652421388E-2;
-
- begin
- Accuracy_Error_Reported := False;
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
- Y := X - V;
- if Y < 0.0 then
- X := Y + V;
- end if;
-
- ZX := Exp (X);
- ZY := Exp (Y);
-
- -- ZX := Exp(X) - Exp(X) * (1 - Exp(-V);
- -- which simplifies to ZX := Exp (X-V);
- ZX := ZX - ZX * One_Minus_Exp_Minus_V;
-
- -- note that since the expected value is computed, we
- -- must take the error in that computation into account.
- Check (ZY, ZX,
- "test " & Test & " -" &
- Integer'Image (I) &
- " exp (" & Real'Image (X) & ")",
- 9.0);
- exit when Accuracy_Error_Reported;
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in argument range check 1");
- when others =>
- Report.Failed ("exception in argument range check 1");
- end Argument_Range_Check_1;
-
-
-
- procedure Argument_Range_Check_2 (A, B : Real;
- Test : String) is
- -- test a evenly distributed selection of
- -- arguments selected from the range A to B.
- -- Test using identity: EXP(X-V) = EXP(X) * EXP (-V)
- -- The parameter One_Minus_Exp_Minus_V is the value
- -- 1.0 - Exp (-V)
- -- accurate to machine precision.
- -- This procedure is a translation of part of Cody's test
- X : Real;
- Y : Real;
- ZX, ZY : Real;
- V : constant := 45.0 / 16.0;
- -- 1/16 - Exp(45/16)
- Coeff : constant := 2.4453321046920570389E-3;
-
- begin
- Accuracy_Error_Reported := False;
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
- Y := X - V;
- if Y < 0.0 then
- X := Y + V;
- end if;
-
- ZX := Exp (X);
- ZY := Exp (Y);
-
- -- ZX := Exp(X) * 1/16 - Exp(X) * Coeff;
- -- where Coeff is 1/16 - Exp(45/16)
- -- which simplifies to ZX := Exp (X-V);
- ZX := ZX * 0.0625 - ZX * Coeff;
-
- -- note that since the expected value is computed, we
- -- must take the error in that computation into account.
- Check (ZY, ZX,
- "test " & Test & " -" &
- Integer'Image (I) &
- " exp (" & Real'Image (X) & ")",
- 9.0);
- exit when Accuracy_Error_Reported;
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in argument range check 2");
- when others =>
- Report.Failed ("exception in argument range check 2");
- end Argument_Range_Check_2;
-
-
- procedure Do_Test is
- begin
-
- --- test 1 ---
- declare
- Y : Real;
- begin
- Y := Exp(1.0);
- -- normal accuracy requirements
- Check (Y, Ada.Numerics.e, "test 1 -- exp(1)", 4.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 1");
- when others =>
- Report.Failed ("exception in test 1");
- end;
-
- --- test 2 ---
- declare
- Y : Real;
- begin
- Y := Exp(16.0) * Exp(-16.0);
- Check (Y, 1.0, "test 2 -- exp(16)*exp(-16)", 9.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 2");
- when others =>
- Report.Failed ("exception in test 2");
- end;
-
- --- test 3 ---
- declare
- Y : Real;
- begin
- Y := Exp (Ada.Numerics.Pi) * Exp (-Ada.Numerics.Pi);
- Check (Y, 1.0, "test 3 -- exp(pi)*exp(-pi)", 9.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 3");
- when others =>
- Report.Failed ("exception in test 3");
- end;
-
- --- test 4 ---
- declare
- Y : Real;
- begin
- Y := Exp(0.0);
- Check (Y, 1.0, "test 4 -- exp(0.0)",
- 0.0); -- no error allowed
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 4");
- when others =>
- Report.Failed ("exception in test 4");
- end;
-
- --- test 5 ---
- -- constants used here only have 19 digits of precision
- if Real'Digits > 19 then
- Error_Low_Bound := 0.00000_00000_00000_0001;
- Report.Comment ("exp accuracy checked to 19 digits");
- end if;
-
- Argument_Range_Check_1 ( 1.0/Sqrt(Real(Real'Machine_Radix)),
- 1.0,
- "5");
- Error_Low_Bound := 0.0; -- reset
-
- --- test 6 ---
- -- constants used here only have 19 digits of precision
- if Real'Digits > 19 then
- Error_Low_Bound := 0.00000_00000_00000_0001;
- Report.Comment ("exp accuracy checked to 19 digits");
- end if;
-
- Argument_Range_Check_2 (1.0,
- Sqrt(Real(Real'Machine_Radix)),
- "6");
- Error_Low_Bound := 0.0; -- reset
-
- end Do_Test;
- end Float_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
-
-
- package A_Long_Float_Check is
- subtype Real is A_Long_Float;
- procedure Do_Test;
- end A_Long_Float_Check;
-
- package body A_Long_Float_Check is
- package Elementary_Functions is new
- Ada.Numerics.Generic_Elementary_Functions (Real);
- function Sqrt (X : Real) return Real renames
- Elementary_Functions.Sqrt;
- function Exp (X : Real) return Real renames
- Elementary_Functions.Exp;
-
-
- -- The following value is a lower bound on the accuracy
- -- required. It is normally 0.0 so that the lower bound
- -- is computed from Model_Epsilon. However, for tests
- -- where the expected result is only known to a certain
- -- amount of precision this bound takes on a non-zero
- -- value to account for that level of precision.
- Error_Low_Bound : Real := 0.0;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon
- -- instead of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- -- take into account the low bound on the error
- if Max_Error < Error_Low_Bound then
- Max_Error := Error_Low_Bound;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Argument_Range_Check_1 (A, B : Real;
- Test : String) is
- -- test a evenly distributed selection of
- -- arguments selected from the range A to B.
- -- Test using identity: EXP(X-V) = EXP(X) * EXP (-V)
- -- The parameter One_Minus_Exp_Minus_V is the value
- -- 1.0 - Exp (-V)
- -- accurate to machine precision.
- -- This procedure is a translation of part of Cody's test
- X : Real;
- Y : Real;
- ZX, ZY : Real;
- V : constant := 1.0 / 16.0;
- One_Minus_Exp_Minus_V : constant := 6.058693718652421388E-2;
-
- begin
- Accuracy_Error_Reported := False;
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
- Y := X - V;
- if Y < 0.0 then
- X := Y + V;
- end if;
-
- ZX := Exp (X);
- ZY := Exp (Y);
-
- -- ZX := Exp(X) - Exp(X) * (1 - Exp(-V);
- -- which simplifies to ZX := Exp (X-V);
- ZX := ZX - ZX * One_Minus_Exp_Minus_V;
-
- -- note that since the expected value is computed, we
- -- must take the error in that computation into account.
- Check (ZY, ZX,
- "test " & Test & " -" &
- Integer'Image (I) &
- " exp (" & Real'Image (X) & ")",
- 9.0);
- exit when Accuracy_Error_Reported;
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in argument range check 1");
- when others =>
- Report.Failed ("exception in argument range check 1");
- end Argument_Range_Check_1;
-
-
-
- procedure Argument_Range_Check_2 (A, B : Real;
- Test : String) is
- -- test a evenly distributed selection of
- -- arguments selected from the range A to B.
- -- Test using identity: EXP(X-V) = EXP(X) * EXP (-V)
- -- The parameter One_Minus_Exp_Minus_V is the value
- -- 1.0 - Exp (-V)
- -- accurate to machine precision.
- -- This procedure is a translation of part of Cody's test
- X : Real;
- Y : Real;
- ZX, ZY : Real;
- V : constant := 45.0 / 16.0;
- -- 1/16 - Exp(45/16)
- Coeff : constant := 2.4453321046920570389E-3;
-
- begin
- Accuracy_Error_Reported := False;
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
- Y := X - V;
- if Y < 0.0 then
- X := Y + V;
- end if;
-
- ZX := Exp (X);
- ZY := Exp (Y);
-
- -- ZX := Exp(X) * 1/16 - Exp(X) * Coeff;
- -- where Coeff is 1/16 - Exp(45/16)
- -- which simplifies to ZX := Exp (X-V);
- ZX := ZX * 0.0625 - ZX * Coeff;
-
- -- note that since the expected value is computed, we
- -- must take the error in that computation into account.
- Check (ZY, ZX,
- "test " & Test & " -" &
- Integer'Image (I) &
- " exp (" & Real'Image (X) & ")",
- 9.0);
- exit when Accuracy_Error_Reported;
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in argument range check 2");
- when others =>
- Report.Failed ("exception in argument range check 2");
- end Argument_Range_Check_2;
-
-
- procedure Do_Test is
- begin
-
- --- test 1 ---
- declare
- Y : Real;
- begin
- Y := Exp(1.0);
- -- normal accuracy requirements
- Check (Y, Ada.Numerics.e, "test 1 -- exp(1)", 4.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 1");
- when others =>
- Report.Failed ("exception in test 1");
- end;
-
- --- test 2 ---
- declare
- Y : Real;
- begin
- Y := Exp(16.0) * Exp(-16.0);
- Check (Y, 1.0, "test 2 -- exp(16)*exp(-16)", 9.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 2");
- when others =>
- Report.Failed ("exception in test 2");
- end;
-
- --- test 3 ---
- declare
- Y : Real;
- begin
- Y := Exp (Ada.Numerics.Pi) * Exp (-Ada.Numerics.Pi);
- Check (Y, 1.0, "test 3 -- exp(pi)*exp(-pi)", 9.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 3");
- when others =>
- Report.Failed ("exception in test 3");
- end;
-
- --- test 4 ---
- declare
- Y : Real;
- begin
- Y := Exp(0.0);
- Check (Y, 1.0, "test 4 -- exp(0.0)",
- 0.0); -- no error allowed
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 4");
- when others =>
- Report.Failed ("exception in test 4");
- end;
-
- --- test 5 ---
- -- constants used here only have 19 digits of precision
- if Real'Digits > 19 then
- Error_Low_Bound := 0.00000_00000_00000_0001;
- Report.Comment ("exp accuracy checked to 19 digits");
- end if;
-
- Argument_Range_Check_1 ( 1.0/Sqrt(Real(Real'Machine_Radix)),
- 1.0,
- "5");
- Error_Low_Bound := 0.0; -- reset
-
- --- test 6 ---
- -- constants used here only have 19 digits of precision
- if Real'Digits > 19 then
- Error_Low_Bound := 0.00000_00000_00000_0001;
- Report.Comment ("exp accuracy checked to 19 digits");
- end if;
-
- Argument_Range_Check_2 (1.0,
- Sqrt(Real(Real'Machine_Radix)),
- "6");
- Error_Low_Bound := 0.0; -- reset
-
- end Do_Test;
- end A_Long_Float_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
- package Non_Generic_Check is
- procedure Do_Test;
- subtype Real is Float;
- end Non_Generic_Check;
-
- package body Non_Generic_Check is
-
- package Elementary_Functions renames
- Ada.Numerics.Elementary_Functions;
- function Sqrt (X : Real) return Real renames
- Elementary_Functions.Sqrt;
- function Exp (X : Real) return Real renames
- Elementary_Functions.Exp;
-
-
- -- The following value is a lower bound on the accuracy
- -- required. It is normally 0.0 so that the lower bound
- -- is computed from Model_Epsilon. However, for tests
- -- where the expected result is only known to a certain
- -- amount of precision this bound takes on a non-zero
- -- value to account for that level of precision.
- Error_Low_Bound : Real := 0.0;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon
- -- instead of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- -- take into account the low bound on the error
- if Max_Error < Error_Low_Bound then
- Max_Error := Error_Low_Bound;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Argument_Range_Check_1 (A, B : Real;
- Test : String) is
- -- test a evenly distributed selection of
- -- arguments selected from the range A to B.
- -- Test using identity: EXP(X-V) = EXP(X) * EXP (-V)
- -- The parameter One_Minus_Exp_Minus_V is the value
- -- 1.0 - Exp (-V)
- -- accurate to machine precision.
- -- This procedure is a translation of part of Cody's test
- X : Real;
- Y : Real;
- ZX, ZY : Real;
- V : constant := 1.0 / 16.0;
- One_Minus_Exp_Minus_V : constant := 6.058693718652421388E-2;
-
- begin
- Accuracy_Error_Reported := False;
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
- Y := X - V;
- if Y < 0.0 then
- X := Y + V;
- end if;
-
- ZX := Exp (X);
- ZY := Exp (Y);
-
- -- ZX := Exp(X) - Exp(X) * (1 - Exp(-V);
- -- which simplifies to ZX := Exp (X-V);
- ZX := ZX - ZX * One_Minus_Exp_Minus_V;
-
- -- note that since the expected value is computed, we
- -- must take the error in that computation into account.
- Check (ZY, ZX,
- "test " & Test & " -" &
- Integer'Image (I) &
- " exp (" & Real'Image (X) & ")",
- 9.0);
- exit when Accuracy_Error_Reported;
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in argument range check 1");
- when others =>
- Report.Failed ("exception in argument range check 1");
- end Argument_Range_Check_1;
-
-
-
- procedure Argument_Range_Check_2 (A, B : Real;
- Test : String) is
- -- test a evenly distributed selection of
- -- arguments selected from the range A to B.
- -- Test using identity: EXP(X-V) = EXP(X) * EXP (-V)
- -- The parameter One_Minus_Exp_Minus_V is the value
- -- 1.0 - Exp (-V)
- -- accurate to machine precision.
- -- This procedure is a translation of part of Cody's test
- X : Real;
- Y : Real;
- ZX, ZY : Real;
- V : constant := 45.0 / 16.0;
- -- 1/16 - Exp(45/16)
- Coeff : constant := 2.4453321046920570389E-3;
-
- begin
- Accuracy_Error_Reported := False;
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
- Y := X - V;
- if Y < 0.0 then
- X := Y + V;
- end if;
-
- ZX := Exp (X);
- ZY := Exp (Y);
-
- -- ZX := Exp(X) * 1/16 - Exp(X) * Coeff;
- -- where Coeff is 1/16 - Exp(45/16)
- -- which simplifies to ZX := Exp (X-V);
- ZX := ZX * 0.0625 - ZX * Coeff;
-
- -- note that since the expected value is computed, we
- -- must take the error in that computation into account.
- Check (ZY, ZX,
- "test " & Test & " -" &
- Integer'Image (I) &
- " exp (" & Real'Image (X) & ")",
- 9.0);
- exit when Accuracy_Error_Reported;
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in argument range check 2");
- when others =>
- Report.Failed ("exception in argument range check 2");
- end Argument_Range_Check_2;
-
-
- procedure Do_Test is
- begin
-
- --- test 1 ---
- declare
- Y : Real;
- begin
- Y := Exp(1.0);
- -- normal accuracy requirements
- Check (Y, Ada.Numerics.e, "test 1 -- exp(1)", 4.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 1");
- when others =>
- Report.Failed ("exception in test 1");
- end;
-
- --- test 2 ---
- declare
- Y : Real;
- begin
- Y := Exp(16.0) * Exp(-16.0);
- Check (Y, 1.0, "test 2 -- exp(16)*exp(-16)", 9.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 2");
- when others =>
- Report.Failed ("exception in test 2");
- end;
-
- --- test 3 ---
- declare
- Y : Real;
- begin
- Y := Exp (Ada.Numerics.Pi) * Exp (-Ada.Numerics.Pi);
- Check (Y, 1.0, "test 3 -- exp(pi)*exp(-pi)", 9.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 3");
- when others =>
- Report.Failed ("exception in test 3");
- end;
-
- --- test 4 ---
- declare
- Y : Real;
- begin
- Y := Exp(0.0);
- Check (Y, 1.0, "test 4 -- exp(0.0)",
- 0.0); -- no error allowed
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 4");
- when others =>
- Report.Failed ("exception in test 4");
- end;
-
- --- test 5 ---
- -- constants used here only have 19 digits of precision
- if Real'Digits > 19 then
- Error_Low_Bound := 0.00000_00000_00000_0001;
- Report.Comment ("exp accuracy checked to 19 digits");
- end if;
-
- Argument_Range_Check_1 ( 1.0/Sqrt(Real(Real'Machine_Radix)),
- 1.0,
- "5");
- Error_Low_Bound := 0.0; -- reset
-
- --- test 6 ---
- -- constants used here only have 19 digits of precision
- if Real'Digits > 19 then
- Error_Low_Bound := 0.00000_00000_00000_0001;
- Report.Comment ("exp accuracy checked to 19 digits");
- end if;
-
- Argument_Range_Check_2 (1.0,
- Sqrt(Real(Real'Machine_Radix)),
- "6");
- Error_Low_Bound := 0.0; -- reset
-
- end Do_Test;
- end Non_Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-begin
- Report.Test ("CXG2010",
- "Check the accuracy of the exp function");
-
- -- the test only applies to machines with a radix of 2,4,8, or 16
- case Float'Machine_Radix is
- when 2 | 4 | 8 | 16 => null;
- when others =>
- Report.Not_Applicable ("only applicable to binary radix");
- Report.Result;
- return;
- end case;
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking non-generic package");
- end if;
-
- Non_Generic_Check.Do_Test;
-
- Report.Result;
-end CXG2010;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2011.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2011.a
deleted file mode 100644
index 2c018b1321e..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2011.a
+++ /dev/null
@@ -1,490 +0,0 @@
--- CXG2011.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the log function returns
--- results that are within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test consists of a generic package that is
--- instantiated to check both Float and a long float type.
--- The test for each floating point type is divided into
--- several parts:
--- Special value checks where the result is a known constant.
--- Checks in a range where a Taylor series can be used to compute
--- the expected result.
--- Checks that use an identity for determining the result.
--- Exception checks.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 1 Mar 96 SAIC Initial release for 2.1
--- 22 Aug 96 SAIC Improved Check routine
--- 02 DEC 97 EDS Log (0.0) must raise Constraint_Error,
--- not Argument_Error
---!
-
---
--- References:
---
--- Software Manual for the Elementary Functions
--- William J. Cody, Jr. and William Waite
--- Prentice-Hall, 1980
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
--- Implementation and Testing of Function Software
--- W. J. Cody
--- Problems and Methodologies in Mathematical Software Production
--- editors P. C. Messina and A. Murli
--- Lecture Notes in Computer Science Volume 142
--- Springer Verlag, 1982
---
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Elementary_Functions;
-procedure CXG2011 is
- Verbose : constant Boolean := False;
- Max_Samples : constant := 1000;
-
- -- CRC Handbook Page 738
- Ln10 : constant := 2.30258_50929_94045_68401_79914_54684_36420_76011_01489;
- Ln2 : constant := 0.69314_71805_59945_30941_72321_21458_17656_80755_00134;
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Elementary_Functions is new
- Ada.Numerics.Generic_Elementary_Functions (Real);
- function Sqrt (X : Real'Base) return Real'Base renames
- Elementary_Functions.Sqrt;
- function Exp (X : Real'Base) return Real'Base renames
- Elementary_Functions.Exp;
- function Log (X : Real'Base) return Real'Base renames
- Elementary_Functions.Log;
- function Log (X, Base : Real'Base) return Real'Base renames
- Elementary_Functions.Log;
-
- -- flag used to terminate some tests early
- Accuracy_Error_Reported : Boolean := False;
-
-
- -- The following value is a lower bound on the accuracy
- -- required. It is normally 0.0 so that the lower bound
- -- is computed from Model_Epsilon. However, for tests
- -- where the expected result is only known to a certain
- -- amount of precision this bound takes on a non-zero
- -- value to account for that level of precision.
- Error_Low_Bound : Real := 0.0;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon
- -- instead of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- -- take into account the low bound on the error
- if Max_Error < Error_Low_Bound then
- Max_Error := Error_Low_Bound;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Special_Value_Test is
- begin
-
- --- test 1 ---
- declare
- Y : Real;
- begin
- Y := Log(1.0);
- Check (Y, 0.0, "special value test 1 -- log(1)",
- 0.0); -- no error allowed
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 1");
- when others =>
- Report.Failed ("exception in test 1");
- end;
-
- --- test 2 ---
- declare
- Y : Real;
- begin
- Y := Log(10.0);
- Check (Y, Ln10, "special value test 2 -- log(10)", 4.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 2");
- when others =>
- Report.Failed ("exception in test 2");
- end;
-
- --- test 3 ---
- declare
- Y : Real;
- begin
- Y := Log (2.0);
- Check (Y, Ln2, "special value test 3 -- log(2)", 4.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 3");
- when others =>
- Report.Failed ("exception in test 3");
- end;
-
- --- test 4 ---
- declare
- Y : Real;
- begin
- Y := Log (2.0 ** 18, 2.0);
- Check (Y, 18.0, "special value test 4 -- log(2**18,2)", 4.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in test 4");
- when others =>
- Report.Failed ("exception in test 4");
- end;
- end Special_Value_Test;
-
-
- procedure Taylor_Series_Test is
- -- Use a 4 term taylor series expansion to check a selection of
- -- arguments very near 1.0.
- -- The range is chosen so that the 4 term taylor series will
- -- provide accuracy to machine precision. Cody pg 49-50.
- Half_Range : constant Real := Real'Model_Epsilon * 50.0;
- A : constant Real := 1.0 - Half_Range;
- B : constant Real := 1.0 + Half_Range;
- X : Real;
- Xm1 : Real;
- Expected : Real;
- Actual : Real;
-
- begin
- Accuracy_Error_Reported := False; -- reset
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
-
- Xm1 := X - 1.0;
- -- The following is the first 4 terms of the taylor series
- -- that has been rearranged to minimize error in the calculation
- Expected := (Xm1 * (1.0/3.0 - Xm1/4.0) - 0.5) * Xm1 * Xm1 + Xm1;
-
- Actual := Log (X);
- Check (Actual, Expected,
- "Taylor Series Test -" &
- Integer'Image (I) &
- " log (" & Real'Image (X) & ")",
- 4.0);
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Taylor Series Test");
- when others =>
- Report.Failed ("exception in Taylor Series Test");
- end Taylor_Series_Test;
-
-
-
- procedure Log_Difference_Identity is
- -- Check using the identity ln(x) = ln(17x/16) - ln(17/16)
- -- over the range A to B.
- -- The selected range assures that both X and 17x/16 will
- -- have the same exponents and neither argument gets too close
- -- to 1. Cody pg 50.
- A : constant Real := 1.0 / Sqrt (2.0);
- B : constant Real := 15.0 / 16.0;
- X : Real;
- Expected : Real;
- Actual : Real;
- begin
- Accuracy_Error_Reported := False; -- reset
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
- -- magic argument purification
- X := Real'Machine (Real'Machine (X+8.0) - 8.0);
-
- Expected := Log (X + X / 16.0) - Log (17.0/16.0);
-
- Actual := Log (X);
- Check (Actual, Expected,
- "Log Difference Identity -" &
- Integer'Image (I) &
- " log (" & Real'Image (X) & ")",
- 4.0);
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Log Difference Identity Test");
- when others =>
- Report.Failed ("exception in Log Difference Identity Test");
- end Log_Difference_Identity;
-
-
- procedure Log_Product_Identity is
- -- Check using the identity ln(x**2) = 2ln(x)
- -- over the range A to B.
- -- This large range is chosen to minimize the possibility of
- -- undetected systematic errors. Cody pg 53.
- A : constant Real := 16.0;
- B : constant Real := 240.0;
- X : Real;
- Expected : Real;
- Actual : Real;
- begin
- Accuracy_Error_Reported := False; -- reset
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
- -- magic argument purification
- X := Real'Machine (Real'Machine (X+8.0) - 8.0);
-
- Expected := 2.0 * Log (X);
-
- Actual := Log (X*X);
- Check (Actual, Expected,
- "Log Product Identity -" &
- Integer'Image (I) &
- " log (" & Real'Image (X) & ")",
- 4.0);
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Log Product Identity Test");
- when others =>
- Report.Failed ("exception in Log Product Identity Test");
- end Log_Product_Identity;
-
-
- procedure Log10_Test is
- -- Check using the identity log(x) = log(11x/10) - log(1.1)
- -- over the range A to B. See Cody pg 52.
- A : constant Real := 1.0 / Sqrt (10.0);
- B : constant Real := 0.9;
- X : Real;
- Expected : Real;
- Actual : Real;
- begin
- if Real'Digits > 17 then
- -- constant used below is accuract to 17 digits
- Error_Low_Bound := 0.00000_00000_00000_01;
- Report.Comment ("log accuracy checked to 19 digits");
- end if;
- Accuracy_Error_Reported := False; -- reset
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
-
- Expected := Log (X + X/10.0, 10.0)
- - 3.77060_15822_50407_5E-4 - 21.0 / 512.0;
-
- Actual := Log (X, 10.0);
- Check (Actual, Expected,
- "Log 10 Test -" &
- Integer'Image (I) &
- " log (" & Real'Image (X) & ")",
- 4.0);
-
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- exit when Accuracy_Error_Reported;
- end loop;
- Error_Low_Bound := 0.0; -- reset
-
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Log 10 Test");
- when others =>
- Report.Failed ("exception in Log 10 Test");
- end Log10_Test;
-
-
- procedure Exception_Test is
- X1, X2, X3, X4 : Real;
- begin
- begin
- X1 := Log (0.0);
- Report.Failed ("exception not raised for LOG(0)");
- exception
- -- Log (0.0) must raise Constraint_Error, not Argument_Error,
- -- as per A.5.1(28,29). Was incorrect in ACVC 2.1 release.
- when Ada.Numerics.Argument_Error =>
- Report.Failed ("Argument_Error raised instead of" &
- " Constraint_Error for LOG(0)--A.5.1(28,29)");
- when Constraint_Error => null; -- ok
- when others =>
- Report.Failed ("wrong exception raised for LOG(0)");
- end;
-
- begin
- X2 := Log ( 1.0, 0.0);
- Report.Failed ("exception not raised for LOG(1,0)");
- exception
- when Ada.Numerics.Argument_Error => null; -- ok
- when Constraint_Error =>
- Report.Failed ("constraint_error raised instead of" &
- " argument_error for LOG(1,0)");
- when others =>
- Report.Failed ("wrong exception raised for LOG(1,0)");
- end;
-
- begin
- X3 := Log (1.0, 1.0);
- Report.Failed ("exception not raised for LOG(1,1)");
- exception
- when Ada.Numerics.Argument_Error => null; -- ok
- when Constraint_Error =>
- Report.Failed ("constraint_error raised instead of" &
- " argument_error for LOG(1,1)");
- when others =>
- Report.Failed ("wrong exception raised for LOG(1,1)");
- end;
-
- begin
- X4 := Log (1.0, -10.0);
- Report.Failed ("exception not raised for LOG(1,-10)");
- exception
- when Ada.Numerics.Argument_Error => null; -- ok
- when Constraint_Error =>
- Report.Failed ("constraint_error raised instead of" &
- " argument_error for LOG(1,-10)");
- when others =>
- Report.Failed ("wrong exception raised for LOG(1,-10)");
- end;
-
- -- optimizer thwarting
- if Report.Ident_Bool (False) then
- Report.Comment (Real'Image (X1+X2+X3+X4));
- end if;
- end Exception_Test;
-
-
- procedure Do_Test is
- begin
- Special_Value_Test;
- Taylor_Series_Test;
- Log_Difference_Identity;
- Log_Product_Identity;
- Log10_Test;
- Exception_Test;
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- package Float_Check is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package A_Long_Float_Check is new Generic_Check (A_Long_Float);
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-
-begin
- Report.Test ("CXG2011",
- "Check the accuracy of the log function");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
-
- Report.Result;
-end CXG2011;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2012.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2012.a
deleted file mode 100644
index 6a665d0e077..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2012.a
+++ /dev/null
@@ -1,438 +0,0 @@
--- CXG2012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the exponentiation operator returns
--- results that are within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test consists of a generic package that is
--- instantiated to check both Float and a long float type.
--- The test for each floating point type is divided into
--- several parts:
--- Special value checks where the result is a known constant.
--- Checks that use an identity for determining the result.
--- Exception checks.
--- While this test concentrates on the "**" operator
--- defined in Generic_Elementary_Functions, a check is also
--- performed on the standard "**" operator.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 7 Mar 96 SAIC Initial release for 2.1
--- 2 Sep 96 SAIC Improvements as suggested by reviewers
--- 3 Jun 98 EDS Add parens to ensure that the expression is not
--- evaluated by multiplying its two large terms
--- together and overflowing.
--- 3 Dec 01 RLB Added 'Machine to insure that equality tests
--- are certain to work.
---
---!
-
---
--- References:
---
--- Software Manual for the Elementary Functions
--- William J. Cody, Jr. and William Waite
--- Prentice-Hall, 1980
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
--- Implementation and Testing of Function Software
--- W. J. Cody
--- Problems and Methodologies in Mathematical Software Production
--- editors P. C. Messina and A. Murli
--- Lecture Notes in Computer Science Volume 142
--- Springer Verlag, 1982
---
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Elementary_Functions;
-procedure CXG2012 is
- Verbose : constant Boolean := False;
- Max_Samples : constant := 1000;
-
- -- CRC Standard Mathematical Tables; 23rd Edition; pg 738
- Sqrt2 : constant :=
- 1.41421_35623_73095_04880_16887_24209_69807_85696_71875_37695;
- Sqrt3 : constant :=
- 1.73205_08075_68877_29352_74463_41505_87236_69428_05253_81039;
-
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Elementary_Functions is new
- Ada.Numerics.Generic_Elementary_Functions (Real);
- function Sqrt (X : Real) return Real renames
- Elementary_Functions.Sqrt;
- function Exp (X : Real) return Real renames
- Elementary_Functions.Exp;
- function Log (X : Real) return Real renames
- Elementary_Functions.Log;
- function "**" (L, R : Real) return Real renames
- Elementary_Functions."**";
-
- -- flag used to terminate some tests early
- Accuracy_Error_Reported : Boolean := False;
-
-
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon
- -- instead of Model_Epsilon and Expected.
- Rel_Error := MRE * (abs Expected * Real'Model_Epsilon);
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- -- the following version of Check computes the allowed error bound
- -- using the operands
- procedure Check (Actual, Expected : Real;
- Left, Right : Real;
- Test_Name : String;
- MRE_Factor : Real := 1.0) is
- MRE : Real;
- begin
- MRE := MRE_Factor * (4.0 + abs (Right * Log(Left)) / 32.0);
- Check (Actual, Expected, Test_Name, MRE);
- end Check;
-
-
- procedure Real_To_Integer_Test is
- type Int_Check is
- record
- Left : Real;
- Right : Integer;
- Expected : Real;
- end record;
- type Int_Checks is array (Positive range <>) of Int_Check;
-
- -- the following tests use only model numbers so the result
- -- is expected to be exact.
- IC : constant Int_Checks :=
- ( ( 2.0, 5, 32.0),
- ( -2.0, 5, -32.0),
- ( 0.5, -5, 32.0),
- ( 2.0, 0, 1.0),
- ( 0.0, 0, 1.0) );
- begin
- for I in IC'Range loop
- declare
- Y : Real;
- begin
- Y := IC (I).Left ** IC (I).Right;
- Check (Y, IC (I).Expected,
- "real to integer test" &
- Real'Image (IC (I).Left) & " ** " &
- Integer'Image (IC (I).Right),
- 0.0); -- no error allowed
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in rtoi test " &
- Integer'Image (I));
- when others =>
- Report.Failed ("exception in rtoi test " &
- Integer'Image (I));
- end;
- end loop;
- end Real_To_Integer_Test;
-
-
- procedure Special_Value_Test is
- No_Error : constant := 0.0;
- begin
- Check (0.0 ** 1.0, 0.0, "0**1", No_Error);
- Check (1.0 ** 0.0, 1.0, "1**0", No_Error);
-
- Check ( 2.0 ** 5.0, 32.0, 2.0, 5.0, "2**5");
- Check ( 0.5**(-5.0), 32.0, 0.5, -5.0, "0.5**-5");
-
- Check (Sqrt2 ** 4.0, 4.0, Sqrt2, 4.0, "Sqrt2**4");
- Check (Sqrt3 ** 6.0, 27.0, Sqrt3, 6.0, "Sqrt3**6");
-
- Check (2.0 ** 0.5, Sqrt2, 2.0, 0.5, "2.0**0.5");
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Special Value Test");
- when others =>
- Report.Failed ("exception in Special Value Test");
- end Special_Value_Test;
-
-
- procedure Small_Range_Test is
- -- Several checks over the range 1/radix .. 1
- A : constant Real := 1.0 / Real (Real'Machine_Radix);
- B : constant Real := 1.0;
- X : Real;
- -- In the cases below where the expected result is
- -- inexact we allow an additional error amount of
- -- 1.0 * Model_Epsilon to account for that error.
- -- This is accomplished by the factor of 1.25 times
- -- the computed error bound (which is > 4.0) thus
- -- increasing the error bound by at least
- -- 1.0 * Model_Epsilon
- begin
- Accuracy_Error_Reported := False; -- reset
- for I in 0..Max_Samples loop
- X := Real'Machine((B - A) * Real (I) / Real (Max_Samples) + A);
-
- Check (X ** 1.0, X, -- exact result required
- "Small range" & Integer'Image (I) & ": " &
- Real'Image (X) & " ** 1.0",
- 0.0);
-
- Check ((X*X) ** 1.5, X**3, X*X, 1.5,
- "Small range" & Integer'Image (I) & ": " &
- Real'Image (X*X) & " ** 1.5",
- 1.25);
-
- Check (X ** 13.5, 1.0 / (X ** (-13.5)), X, 13.5,
- "Small range" & Integer'Image (I) & ": " &
- Real'Image (X) & " ** 13.5",
- 2.0); -- 2 ** computations
-
- Check ((X*X) ** 1.25, X**(2.5), X*X, 1.25,
- "Small range" & Integer'Image (I) & ": " &
- Real'Image (X*X) & " ** 1.25",
- 2.0); -- 2 ** computations
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
-
- end loop;
-
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Small Range Test");
- when others =>
- Report.Failed ("exception in Small Range Test");
- end Small_Range_Test;
-
-
- procedure Large_Range_Test is
- -- Check over the range A to B where A is 1.0 and
- -- B is a large value.
- A : constant Real := 1.0;
- B : Real;
- X : Real;
- Iteration : Integer := 0;
- Subtest : Character := 'X';
- begin
- -- upper bound of range should be as large as possible where
- -- B**3 is still valid.
- B := Real'Safe_Last ** 0.333;
- Accuracy_Error_Reported := False; -- reset
- for I in 0..Max_Samples loop
- Iteration := I;
- Subtest := 'X';
- X := Real'Machine((B - A) * (Real (I) / Real (Max_Samples)) + A);
-
- Subtest := 'A';
- Check (X ** 1.0, X, -- exact result required
- "Large range" & Integer'Image (I) & ": " &
- Real'Image (X) & " ** 1.0",
- 0.0);
-
- Subtest := 'B';
- Check ((X*X) ** 1.5, X**3, X*X, 1.5,
- "Large range" & Integer'Image (I) & ": " &
- Real'Image (X*X) & " ** 1.5",
- 1.25); -- inexact expected result
-
- Subtest := 'C';
- Check ((X*X) ** 1.25, X**(2.5), X*X, 1.25,
- "Large range" & Integer'Image (I) & ": " &
- Real'Image (X*X) & " ** 1.25",
- 2.0); -- two ** operators
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
-
- end loop;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Large Range Test" &
- Integer'Image (Iteration) & Subtest);
- when others =>
- Report.Failed ("exception in Large Range Test" &
- Integer'Image (Iteration) & Subtest);
- end Large_Range_Test;
-
-
- procedure Exception_Test is
- X1, X2, X3, X4 : Real;
- begin
- begin
- X1 := 0.0 ** (-1.0);
- Report.Failed ("exception not raised for 0**-1");
- exception
- when Ada.Numerics.Argument_Error =>
- Report.Failed ("argument_error raised instead of" &
- " constraint_error for 0**-1");
- when Constraint_Error => null; -- ok
- when others =>
- Report.Failed ("wrong exception raised for 0**-1");
- end;
-
- begin
- X2 := 0.0 ** 0.0;
- Report.Failed ("exception not raised for 0**0");
- exception
- when Ada.Numerics.Argument_Error => null; -- ok
- when Constraint_Error =>
- Report.Failed ("constraint_error raised instead of" &
- " argument_error for 0**0");
- when others =>
- Report.Failed ("wrong exception raised for 0**0");
- end;
-
- begin
- X3 := (-1.0) ** 1.0;
- Report.Failed ("exception not raised for -1**1");
- exception
- when Ada.Numerics.Argument_Error => null; -- ok
- when Constraint_Error =>
- Report.Failed ("constraint_error raised instead of" &
- " argument_error for -1**1");
- when others =>
- Report.Failed ("wrong exception raised for -1**1");
- end;
-
- begin
- X4 := (-2.0) ** 2.0;
- Report.Failed ("exception not raised for -2**2");
- exception
- when Ada.Numerics.Argument_Error => null; -- ok
- when Constraint_Error =>
- Report.Failed ("constraint_error raised instead of" &
- " argument_error for -2**2");
- when others =>
- Report.Failed ("wrong exception raised for -2**2");
- end;
-
- -- optimizer thwarting
- if Report.Ident_Bool (False) then
- Report.Comment (Real'Image (X1+X2+X3+X4));
- end if;
- end Exception_Test;
-
-
- procedure Do_Test is
- begin
- Real_To_Integer_Test;
- Special_Value_Test;
- Small_Range_Test;
- Large_Range_Test;
- Exception_Test;
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- package Float_Check is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package A_Long_Float_Check is new Generic_Check (A_Long_Float);
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-
-begin
- Report.Test ("CXG2012",
- "Check the accuracy of the ** operator");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
-
- Report.Result;
-end CXG2012;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2013.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2013.a
deleted file mode 100644
index 94f180b804d..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2013.a
+++ /dev/null
@@ -1,367 +0,0 @@
--- CXG2013.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the TAN and COT functions return
--- results that are within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test consists of a generic package that is
--- instantiated to check both Float and a long float type.
--- The test for each floating point type is divided into
--- several parts:
--- Special value checks where the result is a known constant.
--- Checks that use an identity for determining the result.
--- Exception checks.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 11 Mar 96 SAIC Initial release for 2.1
--- 17 Aug 96 SAIC Commentary fixes.
--- 03 Feb 97 PWB.CTA Removed checks with explicit Cycle => 2.0*Pi
--- 02 DEC 97 EDS Change Max_Samples constant to 1001.
--- 29 JUN 98 EDS Deleted Special_Angle_Test as fatally flawed.
-
---!
-
---
--- References:
---
--- Software Manual for the Elementary Functions
--- William J. Cody, Jr. and William Waite
--- Prentice-Hall, 1980
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
--- Implementation and Testing of Function Software
--- W. J. Cody
--- Problems and Methodologies in Mathematical Software Production
--- editors P. C. Messina and A. Murli
--- Lecture Notes in Computer Science Volume 142
--- Springer Verlag, 1982
---
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Elementary_Functions;
-procedure CXG2013 is
- Verbose : constant Boolean := False;
- Max_Samples : constant := 1001;
-
- -- CRC Standard Mathematical Tables; 23rd Edition; pg 738
- Sqrt2 : constant :=
- 1.41421_35623_73095_04880_16887_24209_69807_85696_71875_37695;
- Sqrt3 : constant :=
- 1.73205_08075_68877_29352_74463_41505_87236_69428_05253_81039;
-
- Pi : constant := Ada.Numerics.Pi;
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Elementary_Functions is new
- Ada.Numerics.Generic_Elementary_Functions (Real);
- function Sqrt (X : Real) return Real renames
- Elementary_Functions.Sqrt;
- function Tan (X : Real) return Real renames
- Elementary_Functions.Tan;
- function Cot (X : Real) return Real renames
- Elementary_Functions.Cot;
- function Tan (X, Cycle : Real) return Real renames
- Elementary_Functions.Tan;
- function Cot (X, Cycle : Real) return Real renames
- Elementary_Functions.Cot;
-
- -- flag used to terminate some tests early
- Accuracy_Error_Reported : Boolean := False;
-
- -- factor to be applied in computing MRE
- Maximum_Relative_Error : constant Real := 4.0;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
-
- procedure Exact_Result_Test is
- No_Error : constant := 0.0;
- begin
- -- A.5.1(38);6.0
- Check (Tan (0.0), 0.0, "tan(0)", No_Error);
-
- -- A.5.1(41);6.0
- Check (Tan (180.0, 360.0), 0.0, "tan(180,360)", No_Error);
- Check (Tan (360.0, 360.0), 0.0, "tan(360,360)", No_Error);
- Check (Tan (720.0, 360.0), 0.0, "tan(720,360)", No_Error);
-
- -- A.5.1(41);6.0
- Check (Cot ( 90.0, 360.0), 0.0, "cot( 90,360)", No_Error);
- Check (Cot (270.0, 360.0), 0.0, "cot(270,360)", No_Error);
- Check (Cot (810.0, 360.0), 0.0, "cot(810,360)", No_Error);
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Exact_Result Test");
- when others =>
- Report.Failed ("exception in Exact_Result Test");
- end Exact_Result_Test;
-
-
- procedure Tan_Test (A, B : Real) is
- -- Use identity Tan(X) = [2*Tan(x/2)]/[1-Tan(x/2) ** 2]
- -- checks over the range -pi/4 .. pi/4 require no argument reduction
- -- checks over the range 7pi/8 .. 9pi/8 require argument reduction
- X, Y : Real;
- Actual1, Actual2 : Real;
- begin
- Accuracy_Error_Reported := False; -- reset
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
- -- argument purification to insure x and x/2 are exact
- -- See Cody page 170.
- Y := Real'Machine (X*0.5);
- X := Real'Machine (Y + Y);
-
- Actual1 := Tan(X);
- Actual2 := (2.0 * Tan (Y)) / (1.0 - Tan (Y) ** 2);
-
- if abs (X - Pi) > ( (B-A)/Real(2*Max_Samples) ) then
- Check (Actual1, Actual2,
- "Tan_Test " & Integer'Image (I) & ": tan(" &
- Real'Image (X) & ") ",
- (1.0 + Sqrt2) * Maximum_Relative_Error);
- -- see Cody pg 165 for error bound info
- end if;
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
-
- end loop;
-
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Tan_Test");
- when others =>
- Report.Failed ("exception in Tan_Test");
- end Tan_Test;
-
-
-
- procedure Cot_Test is
- -- Use identity Cot(X) = [Cot(X/2)**2 - 1]/[2*Cot(X/2)]
- A : constant := 6.0 * Pi;
- B : constant := 25.0 / 4.0 * Pi;
- X, Y : Real;
- Actual1, Actual2 : Real;
- begin
- Accuracy_Error_Reported := False; -- reset
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
- -- argument purification to insure x and x/2 are exact.
- -- See Cody page 170.
- Y := Real'Machine (X*0.5);
- X := Real'Machine (Y + Y);
-
- Actual1 := Cot(X);
- Actual2 := (Cot (Y) ** 2 - 1.0) / (2.0 * Cot (Y));
-
- Check (Actual1, Actual2,
- "Cot_Test " & Integer'Image (I) & ": cot(" &
- Real'Image (X) & ") ",
- (1.0 + Sqrt2) * Maximum_Relative_Error);
- -- see Cody pg 165 for error bound info
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
-
- end loop;
-
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Cot_Test");
- when others =>
- Report.Failed ("exception in Cot_Test");
- end Cot_Test;
-
-
- procedure Exception_Test is
- X1, X2, X3, X4, X5 : Real := 0.0;
- begin
-
-
- begin -- A.5.1(20);6.0
- X1 := Tan (0.0, Cycle => 0.0);
- Report.Failed ("no exception for cycle = 0.0");
- exception
- when Ada.Numerics.Argument_Error => null;
- when others =>
- Report.Failed ("wrong exception for cycle = 0.0");
- end;
-
- begin -- A.5.1(20);6.0
- X2 := Cot (1.0, Cycle => -3.0);
- Report.Failed ("no exception for cycle < 0.0");
- exception
- when Ada.Numerics.Argument_Error => null;
- when others =>
- Report.Failed ("wrong exception for cycle < 0.0");
- end;
-
- -- the remaining tests only apply to machines that overflow
- if Real'Machine_Overflows then -- A.5.1(28);6.0
-
- begin -- A.5.1(29);6.0
- X3 := Cot (0.0);
- Report.Failed ("exception not raised for cot(0)");
- exception
- when Constraint_Error => null; -- ok
- when others =>
- Report.Failed ("wrong exception raised for cot(0)");
- end;
-
- begin -- A.5.1(31);6.0
- X4 := Tan (90.0, 360.0);
- Report.Failed ("exception not raised for tan(90,360)");
- exception
- when Constraint_Error => null; -- ok
- when others =>
- Report.Failed ("wrong exception raised for tan(90,360)");
- end;
-
- begin -- A.5.1(32);6.0
- X5 := Cot (180.0, 360.0);
- Report.Failed ("exception not raised for cot(180,360)");
- exception
- when Constraint_Error => null; -- ok
- when others =>
- Report.Failed ("wrong exception raised for cot(180,360)");
- end;
- end if;
-
- -- optimizer thwarting
- if Report.Ident_Bool (False) then
- Report.Comment (Real'Image (X1+X2+X3+X4+X5));
- end if;
- end Exception_Test;
-
-
- procedure Do_Test is
- begin
- Exact_Result_Test;
- Tan_Test (-Pi/4.0, Pi/4.0);
- Tan_Test (7.0*Pi/8.0, 9.0*Pi/8.0);
- Cot_Test;
- Exception_Test;
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- package Float_Check is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package A_Long_Float_Check is new Generic_Check (A_Long_Float);
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-
-begin
- Report.Test ("CXG2013",
- "Check the accuracy of the TAN and COT functions");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
-
- Report.Result;
-end CXG2013;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2014.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2014.a
deleted file mode 100644
index 48499a2556f..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2014.a
+++ /dev/null
@@ -1,399 +0,0 @@
--- CXG2014.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the SINH and COSH functions return
--- results that are within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test consists of a generic package that is
--- instantiated to check both Float and a long float type.
--- The test for each floating point type is divided into
--- several parts:
--- Special value checks where the result is a known constant.
--- Checks that use an identity for determining the result.
--- Exception checks.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 15 Mar 96 SAIC Initial release for 2.1
--- 03 Jun 98 EDS In line 80, change 1000 to 1024, making it a model
--- number. Add Taylor Series terms in line 281.
--- 15 Feb 99 RLB Repaired Subtraction_Error_Test to avoid precision
--- problems.
---!
-
---
--- References:
---
--- Software Manual for the Elementary Functions
--- William J. Cody, Jr. and William Waite
--- Prentice-Hall, 1980
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
--- Implementation and Testing of Function Software
--- W. J. Cody
--- Problems and Methodologies in Mathematical Software Production
--- editors P. C. Messina and A. Murli
--- Lecture Notes in Computer Science Volume 142
--- Springer Verlag, 1982
---
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Elementary_Functions;
-procedure CXG2014 is
- Verbose : constant Boolean := False;
- Max_Samples : constant := 1024;
-
- E : constant := Ada.Numerics.E;
- Cosh1 : constant := (E + 1.0 / E) / 2.0; -- cosh(1.0)
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Elementary_Functions is new
- Ada.Numerics.Generic_Elementary_Functions (Real);
- function Sinh (X : Real) return Real renames
- Elementary_Functions.Sinh;
- function Cosh (X : Real) return Real renames
- Elementary_Functions.Cosh;
- function Log (X : Real) return Real renames
- Elementary_Functions.Log;
-
- -- flag used to terminate some tests early
- Accuracy_Error_Reported : Boolean := False;
-
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Small instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Small;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Special_Value_Test is
- -- In the following tests the expected result is accurate
- -- to the machine precision so the minimum guaranteed error
- -- bound can be used.
- Minimum_Error : constant := 8.0;
- begin
- Check (Sinh (1.0),
- (E - 1.0 / E) / 2.0,
- "sinh(1)",
- Minimum_Error);
- Check (Cosh (1.0),
- Cosh1,
- "cosh(1)",
- Minimum_Error);
- Check (Sinh (2.0),
- (E * E - (1.0 / (E * E))) / 2.0,
- "sinh(2)",
- Minimum_Error);
- Check (Cosh (2.0),
- (E * E + (1.0 / (E * E))) / 2.0,
- "cosh(2)",
- Minimum_Error);
- Check (Sinh (-1.0),
- (1.0 / E - E) / 2.0,
- "sinh(-1)",
- Minimum_Error);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in special value test");
- when others =>
- Report.Failed ("exception in special value test");
- end Special_Value_Test;
-
-
-
- procedure Exact_Result_Test is
- No_Error : constant := 0.0;
- begin
- -- A.5.1(38);6.0
- Check (Sinh (0.0), 0.0, "sinh(0)", No_Error);
- Check (Cosh (0.0), 1.0, "cosh(0)", No_Error);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Exact_Result Test");
- when others =>
- Report.Failed ("exception in Exact_Result Test");
- end Exact_Result_Test;
-
-
- procedure Identity_1_Test is
- -- For the Sinh test use the identity
- -- 2 * Sinh(x) * Cosh(1) = Sinh(x+1) + Sinh (x-1)
- -- which is transformed to
- -- Sinh(x) = ((Sinh(x+1) + Sinh(x-1)) * C
- -- where C = 1/(2*Cosh(1))
- --
- -- For the Cosh test use the identity
- -- 2 * Cosh(x) * Cosh(1) = Cosh(x+1) + Cosh(x-1)
- -- which is transformed to
- -- Cosh(x) = C * (Cosh(x+1) + Cosh(x-1))
- -- where C is the same as above
- --
- -- see Cody pg 230-231 for details on the error analysis.
- -- The net result is a relative error bound of 16 * Model_Epsilon.
-
- A : constant := 3.0;
- -- large upper bound but not so large as to cause Cosh(B)
- -- to overflow
- B : constant Real := Log(Real'Safe_Last) - 2.0;
- X_Minus_1, X, X_Plus_1 : Real;
- Actual1, Actual2 : Real;
- C : constant := 1.0 / (2.0 * Cosh1);
- begin
- Accuracy_Error_Reported := False; -- reset
- for I in 1..Max_Samples loop
- -- make sure there is no error in x-1, x, and x+1
- X_Plus_1 := (B - A) * Real (I) / Real (Max_Samples) + A;
- X_Plus_1 := Real'Machine (X_Plus_1);
- X := Real'Machine (X_Plus_1 - 1.0);
- X_Minus_1 := Real'Machine (X - 1.0);
-
- -- Sinh(x) = ((Sinh(x+1) + Sinh(x-1)) * C
- Actual1 := Sinh(X);
- Actual2 := C * (Sinh(X_Plus_1) + Sinh(X_Minus_1));
-
- Check (Actual1, Actual2,
- "Identity_1_Test " & Integer'Image (I) & ": sinh(" &
- Real'Image (X) & ") ",
- 16.0);
-
- -- Cosh(x) = C * (Cosh(x+1) + Cosh(x-1))
- Actual1 := Cosh (X);
- Actual2 := C * (Cosh(X_Plus_1) + Cosh (X_Minus_1));
- Check (Actual1, Actual2,
- "Identity_1_Test " & Integer'Image (I) & ": cosh(" &
- Real'Image (X) & ") ",
- 16.0);
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
-
- end loop;
-
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Identity_1_Test" &
- " for X=" & Real'Image (X));
- when others =>
- Report.Failed ("exception in Identity_1_Test" &
- " for X=" & Real'Image (X));
- end Identity_1_Test;
-
-
-
- procedure Subtraction_Error_Test is
- -- This test detects the error resulting from subtraction if
- -- the obvious algorithm was used for computing sinh. That is,
- -- it it is computed as (e**x - e**-x)/2.
- -- We check the result by using a Taylor series expansion that
- -- will produce a result accurate to the machine precision for
- -- the range under test.
- --
- -- The maximum relative error bound for this test is
- -- 8 for the sinh operation and 7 for the Taylor series
- -- for a total of 15 * Model_Epsilon
- A : constant := 0.0;
- B : constant := 0.5;
- X : Real;
- X_Squared : Real;
- Actual, Expected : Real;
- begin
- if Real'digits > 15 then
- return; -- The approximation below is not accurate beyond
- -- 15 digits. Adding more terms makes the error
- -- larger, so it makes the test worse for more normal
- -- values. Thus, we skip this subtest for larger than
- -- 15 digits.
- end if;
- Accuracy_Error_Reported := False; -- reset
- for I in 1..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
- X_Squared := X * X;
-
- Actual := Sinh(X);
-
- -- The Taylor series regrouped a bit
- Expected :=
- X * (1.0 + (X_Squared / 6.0) *
- (1.0 + (X_Squared/20.0) *
- (1.0 + (X_Squared/42.0) *
- (1.0 + (X_Squared/72.0) *
- (1.0 + (X_Squared/110.0) *
- (1.0 + (X_Squared/156.0)
- ))))));
-
- Check (Actual, Expected,
- "Subtraction_Error_Test " & Integer'Image (I) & ": sinh(" &
- Real'Image (X) & ") ",
- 15.0);
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
-
- end loop;
-
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Subtraction_Error_Test");
- when others =>
- Report.Failed ("exception in Subtraction_Error_Test");
- end Subtraction_Error_Test;
-
-
- procedure Exception_Test is
- X1, X2 : Real := 0.0;
- begin
- -- this part of the test is only applicable if 'Machine_Overflows
- -- is true.
- if Real'Machine_Overflows then
-
- begin
- X1 := Sinh (Real'Safe_Last / 2.0);
- Report.Failed ("no exception for sinh overflow");
- exception
- when Constraint_Error => null;
- when others =>
- Report.Failed ("wrong exception sinh overflow");
- end;
-
- begin
- X2 := Cosh (Real'Safe_Last / 2.0);
- Report.Failed ("no exception for cosh overflow");
- exception
- when Constraint_Error => null;
- when others =>
- Report.Failed ("wrong exception cosh overflow");
- end;
-
- end if;
-
- -- optimizer thwarting
- if Report.Ident_Bool (False) then
- Report.Comment (Real'Image (X1 + X2));
- end if;
- end Exception_Test;
-
-
- procedure Do_Test is
- begin
- Special_Value_Test;
- Exact_Result_Test;
- Identity_1_Test;
- Subtraction_Error_Test;
- Exception_Test;
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- package Float_Check is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package A_Long_Float_Check is new Generic_Check (A_Long_Float);
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-
-begin
- Report.Test ("CXG2014",
- "Check the accuracy of the SINH and COSH functions");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
-
- Report.Result;
-end CXG2014;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2015.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2015.a
deleted file mode 100644
index 50fda5e1f4f..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2015.a
+++ /dev/null
@@ -1,686 +0,0 @@
--- CXG2015.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the ARCSIN and ARCCOS functions return
--- results that are within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test consists of a generic package that is
--- instantiated to check both Float and a long float type.
--- The test for each floating point type is divided into
--- several parts:
--- Special value checks where the result is a known constant.
--- Checks in a specific range where a Taylor series can be
--- used to compute an accurate result for comparison.
--- Exception checks.
--- The Taylor series tests are a direct translation of the
--- FORTRAN code found in the reference.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 18 Mar 96 SAIC Initial release for 2.1
--- 24 Apr 96 SAIC Fixed error bounds.
--- 17 Aug 96 SAIC Added reference information and improved
--- checking for machines with more than 23
--- digits of precision.
--- 03 Feb 97 PWB.CTA Removed checks with explicit Cycle => 2.0*Pi
--- 22 Dec 99 RLB Added model range checking to "exact" results,
--- in order to avoid too strictly requiring a specific
--- result, and too weakly checking results.
---
--- CHANGE NOTE:
--- According to Ken Dritz, author of the Numerics Annex of the RM,
--- one should never specify the cycle 2.0*Pi for the trigonometric
--- functions. In particular, if the machine number for the first
--- argument is not an exact multiple of the machine number for the
--- explicit cycle, then the specified exact results cannot be
--- reasonably expected. The affected checks in this test have been
--- marked as comments, with the additional notation "pwb-math".
--- Phil Brashear
---!
-
---
--- References:
---
--- Software Manual for the Elementary Functions
--- William J. Cody, Jr. and William Waite
--- Prentice-Hall, 1980
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
--- Implementation and Testing of Function Software
--- W. J. Cody
--- Problems and Methodologies in Mathematical Software Production
--- editors P. C. Messina and A. Murli
--- Lecture Notes in Computer Science Volume 142
--- Springer Verlag, 1982
---
--- CELEFUNT: A Portable Test Package for Complex Elementary Functions
--- ACM Collected Algorithms number 714
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Elementary_Functions;
-procedure CXG2015 is
- Verbose : constant Boolean := False;
- Max_Samples : constant := 1000;
-
-
- -- CRC Standard Mathematical Tables; 23rd Edition; pg 738
- Sqrt2 : constant :=
- 1.41421_35623_73095_04880_16887_24209_69807_85696_71875_37695;
- Sqrt3 : constant :=
- 1.73205_08075_68877_29352_74463_41505_87236_69428_05253_81039;
-
- Pi : constant := Ada.Numerics.Pi;
-
- -- relative error bound from G.2.4(7);6.0
- Minimum_Error : constant := 4.0;
-
- generic
- type Real is digits <>;
- Half_PI_Low : in Real; -- The machine number closest to, but not greater
- -- than PI/2.0.
- Half_PI_High : in Real;-- The machine number closest to, but not less
- -- than PI/2.0.
- PI_Low : in Real; -- The machine number closest to, but not greater
- -- than PI.
- PI_High : in Real; -- The machine number closest to, but not less
- -- than PI.
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Elementary_Functions is new
- Ada.Numerics.Generic_Elementary_Functions (Real);
-
- function Arcsin (X : Real) return Real renames
- Elementary_Functions.Arcsin;
- function Arcsin (X, Cycle : Real) return Real renames
- Elementary_Functions.Arcsin;
- function Arccos (X : Real) return Real renames
- Elementary_Functions.ArcCos;
- function Arccos (X, Cycle : Real) return Real renames
- Elementary_Functions.ArcCos;
-
- -- needed for support
- function Log (X, Base : Real) return Real renames
- Elementary_Functions.Log;
-
- -- flag used to terminate some tests early
- Accuracy_Error_Reported : Boolean := False;
-
- -- The following value is a lower bound on the accuracy
- -- required. It is normally 0.0 so that the lower bound
- -- is computed from Model_Epsilon. However, for tests
- -- where the expected result is only known to a certain
- -- amount of precision this bound takes on a non-zero
- -- value to account for that level of precision.
- Error_Low_Bound : Real := 0.0;
-
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- -- take into account the low bound on the error
- if Max_Error < Error_Low_Bound then
- Max_Error := Error_Low_Bound;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Special_Value_Test is
- -- In the following tests the expected result is accurate
- -- to the machine precision so the minimum guaranteed error
- -- bound can be used.
-
- type Data_Point is
- record
- Degrees,
- Radians,
- Argument,
- Error_Bound : Real;
- end record;
-
- type Test_Data_Type is array (Positive range <>) of Data_Point;
-
- -- the values in the following tables only involve static
- -- expressions so no loss of precision occurs. However,
- -- rounding can be an issue with expressions involving Pi
- -- and square roots. The error bound specified in the
- -- table takes the sqrt error into account but not the
- -- error due to Pi. The Pi error is added in in the
- -- radians test below.
-
- Arcsin_Test_Data : constant Test_Data_Type := (
- -- degrees radians sine error_bound test #
- --( 0.0, 0.0, 0.0, 0.0 ), -- 1 - In Exact_Result_Test.
- ( 30.0, Pi/6.0, 0.5, 4.0 ), -- 2
- ( 60.0, Pi/3.0, Sqrt3/2.0, 5.0 ), -- 3
- --( 90.0, Pi/2.0, 1.0, 4.0 ), -- 4 - In Exact_Result_Test.
- --(-90.0, -Pi/2.0, -1.0, 4.0 ), -- 5 - In Exact_Result_Test.
- (-60.0, -Pi/3.0, -Sqrt3/2.0, 5.0 ), -- 6
- (-30.0, -Pi/6.0, -0.5, 4.0 ), -- 7
- ( 45.0, Pi/4.0, Sqrt2/2.0, 5.0 ), -- 8
- (-45.0, -Pi/4.0, -Sqrt2/2.0, 5.0 ) ); -- 9
-
- Arccos_Test_Data : constant Test_Data_Type := (
- -- degrees radians cosine error_bound test #
- --( 0.0, 0.0, 1.0, 0.0 ), -- 1 - In Exact_Result_Test.
- ( 30.0, Pi/6.0, Sqrt3/2.0, 5.0 ), -- 2
- ( 60.0, Pi/3.0, 0.5, 4.0 ), -- 3
- --( 90.0, Pi/2.0, 0.0, 4.0 ), -- 4 - In Exact_Result_Test.
- (120.0, 2.0*Pi/3.0, -0.5, 4.0 ), -- 5
- (150.0, 5.0*Pi/6.0, -Sqrt3/2.0, 5.0 ), -- 6
- --(180.0, Pi, -1.0, 4.0 ), -- 7 - In Exact_Result_Test.
- ( 45.0, Pi/4.0, Sqrt2/2.0, 5.0 ), -- 8
- (135.0, 3.0*Pi/4.0, -Sqrt2/2.0, 5.0 ) ); -- 9
-
- Cycle_Error,
- Radian_Error : Real;
- begin
- for I in Arcsin_Test_Data'Range loop
-
- -- note exact result requirements A.5.1(38);6.0 and
- -- G.2.4(12);6.0
- if Arcsin_Test_Data (I).Error_Bound = 0.0 then
- Cycle_Error := 0.0;
- Radian_Error := 0.0;
- else
- Cycle_Error := Arcsin_Test_Data (I).Error_Bound;
- -- allow for rounding error in the specification of Pi
- Radian_Error := Cycle_Error + 1.0;
- end if;
-
- Check (Arcsin (Arcsin_Test_Data (I).Argument),
- Arcsin_Test_Data (I).Radians,
- "test" & Integer'Image (I) &
- " arcsin(" &
- Real'Image (Arcsin_Test_Data (I).Argument) &
- ")",
- Radian_Error);
---pwb-math Check (Arcsin (Arcsin_Test_Data (I).Argument, 2.0 * Pi),
---pwb-math Arcsin_Test_Data (I).Radians,
---pwb-math "test" & Integer'Image (I) &
---pwb-math " arcsin(" &
---pwb-math Real'Image (Arcsin_Test_Data (I).Argument) &
---pwb-math ", 2pi)",
---pwb-math Cycle_Error);
- Check (Arcsin (Arcsin_Test_Data (I).Argument, 360.0),
- Arcsin_Test_Data (I).Degrees,
- "test" & Integer'Image (I) &
- " arcsin(" &
- Real'Image (Arcsin_Test_Data (I).Argument) &
- ", 360)",
- Cycle_Error);
- end loop;
-
-
- for I in Arccos_Test_Data'Range loop
-
- -- note exact result requirements A.5.1(39);6.0 and
- -- G.2.4(12);6.0
- if Arccos_Test_Data (I).Error_Bound = 0.0 then
- Cycle_Error := 0.0;
- Radian_Error := 0.0;
- else
- Cycle_Error := Arccos_Test_Data (I).Error_Bound;
- -- allow for rounding error in the specification of Pi
- Radian_Error := Cycle_Error + 1.0;
- end if;
-
- Check (Arccos (Arccos_Test_Data (I).Argument),
- Arccos_Test_Data (I).Radians,
- "test" & Integer'Image (I) &
- " arccos(" &
- Real'Image (Arccos_Test_Data (I).Argument) &
- ")",
- Radian_Error);
---pwb-math Check (Arccos (Arccos_Test_Data (I).Argument, 2.0 * Pi),
---pwb-math Arccos_Test_Data (I).Radians,
---pwb-math "test" & Integer'Image (I) &
---pwb-math " arccos(" &
---pwb-math Real'Image (Arccos_Test_Data (I).Argument) &
---pwb-math ", 2pi)",
---pwb-math Cycle_Error);
- Check (Arccos (Arccos_Test_Data (I).Argument, 360.0),
- Arccos_Test_Data (I).Degrees,
- "test" & Integer'Image (I) &
- " arccos(" &
- Real'Image (Arccos_Test_Data (I).Argument) &
- ", 360)",
- Cycle_Error);
- end loop;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in special value test");
- when others =>
- Report.Failed ("exception in special value test");
- end Special_Value_Test;
-
-
- procedure Check_Exact (Actual, Expected_Low, Expected_High : Real;
- Test_Name : String) is
- -- If the expected result is not a model number, then Expected_Low is
- -- the first machine number less than the (exact) expected
- -- result, and Expected_High is the first machine number greater than
- -- the (exact) expected result. If the expected result is a model
- -- number, Expected_Low = Expected_High = the result.
- Model_Expected_Low : Real := Expected_Low;
- Model_Expected_High : Real := Expected_High;
- begin
- -- Calculate the first model number nearest to, but below (or equal)
- -- to the expected result:
- while Real'Model (Model_Expected_Low) /= Model_Expected_Low loop
- -- Try the next machine number lower:
- Model_Expected_Low := Real'Adjacent(Model_Expected_Low, 0.0);
- end loop;
- -- Calculate the first model number nearest to, but above (or equal)
- -- to the expected result:
- while Real'Model (Model_Expected_High) /= Model_Expected_High loop
- -- Try the next machine number higher:
- Model_Expected_High := Real'Adjacent(Model_Expected_High, 100.0);
- end loop;
-
- if Actual < Model_Expected_Low or Actual > Model_Expected_High then
- Accuracy_Error_Reported := True;
- if Actual < Model_Expected_Low then
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected low: " & Real'Image (Model_Expected_Low) &
- " expected high: " & Real'Image (Model_Expected_High) &
- " difference: " & Real'Image (Actual - Expected_Low));
- else
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected low: " & Real'Image (Model_Expected_Low) &
- " expected high: " & Real'Image (Model_Expected_High) &
- " difference: " & Real'Image (Expected_High - Actual));
- end if;
- elsif Verbose then
- Report.Comment (Test_Name & " passed");
- end if;
- end Check_Exact;
-
-
- procedure Exact_Result_Test is
- begin
- -- A.5.1(38)
- Check_Exact (Arcsin (0.0), 0.0, 0.0, "arcsin(0)");
- Check_Exact (Arcsin (0.0, 45.0), 0.0, 0.0, "arcsin(0,45)");
-
- -- A.5.1(39)
- Check_Exact (Arccos (1.0), 0.0, 0.0, "arccos(1)");
- Check_Exact (Arccos (1.0, 75.0), 0.0, 0.0, "arccos(1,75)");
-
- -- G.2.4(11-13)
- Check_Exact (Arcsin (1.0), Half_PI_Low, Half_PI_High, "arcsin(1)");
- Check_Exact (Arcsin (1.0, 360.0), 90.0, 90.0, "arcsin(1,360)");
-
- Check_Exact (Arcsin (-1.0), -Half_PI_High, -Half_PI_Low, "arcsin(-1)");
- Check_Exact (Arcsin (-1.0, 360.0), -90.0, -90.0, "arcsin(-1,360)");
-
- Check_Exact (Arccos (0.0), Half_PI_Low, Half_PI_High, "arccos(0)");
- Check_Exact (Arccos (0.0, 360.0), 90.0, 90.0, "arccos(0,360)");
-
- Check_Exact (Arccos (-1.0), PI_Low, PI_High, "arccos(-1)");
- Check_Exact (Arccos (-1.0, 360.0), 180.0, 180.0, "arccos(-1,360)");
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Exact_Result Test");
- when others =>
- Report.Failed ("Exception in Exact_Result Test");
- end Exact_Result_Test;
-
-
- procedure Arcsin_Taylor_Series_Test is
- -- the following range is chosen so that the Taylor series
- -- used will produce a result accurate to machine precision.
- --
- -- The following formula is used for the Taylor series:
- -- TS(x) = x { 1 + (xsq/2) [ (1/3) + (3/4)xsq { (1/5) +
- -- (5/6)xsq [ (1/7) + (7/8)xsq/9 ] } ] }
- -- where xsq = x * x
- --
- A : constant := -0.125;
- B : constant := 0.125;
- X : Real;
- Y, Y_Sq : Real;
- Actual, Sum, Xm : Real;
- -- terms in Taylor series
- K : constant Integer := Integer (
- Log (
- Real (Real'Machine_Radix) ** Real'Machine_Mantissa,
- 10.0)) + 1;
- begin
- Accuracy_Error_Reported := False; -- reset
- for I in 1..Max_Samples loop
- -- make sure there is no error in x-1, x, and x+1
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
-
- Y := X;
- Y_Sq := Y * Y;
- Sum := 0.0;
- Xm := Real (K + K + 1);
- for M in 1 .. K loop
- Sum := Y_Sq * (Sum + 1.0/Xm);
- Xm := Xm - 2.0;
- Sum := Sum * (Xm /(Xm + 1.0));
- end loop;
- Sum := Sum * Y;
- Actual := Y + Sum;
- Sum := (Y - Actual) + Sum;
- if not Real'Machine_Rounds then
- Actual := Actual + (Sum + Sum);
- end if;
-
- Check (Actual, Arcsin (X),
- "Taylor Series test" & Integer'Image (I) & ": arcsin(" &
- Real'Image (X) & ") ",
- Minimum_Error);
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
-
- end loop;
-
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Arcsin_Taylor_Series_Test" &
- " for X=" & Real'Image (X));
- when others =>
- Report.Failed ("exception in Arcsin_Taylor_Series_Test" &
- " for X=" & Real'Image (X));
- end Arcsin_Taylor_Series_Test;
-
-
-
- procedure Arccos_Taylor_Series_Test is
- -- the following range is chosen so that the Taylor series
- -- used will produce a result accurate to machine precision.
- --
- -- The following formula is used for the Taylor series:
- -- TS(x) = x { 1 + (xsq/2) [ (1/3) + (3/4)xsq { (1/5) +
- -- (5/6)xsq [ (1/7) + (7/8)xsq/9 ] } ] }
- -- arccos(x) = pi/2 - TS(x)
- A : constant := -0.125;
- B : constant := 0.125;
- C1, C2 : Real;
- X : Real;
- Y, Y_Sq : Real;
- Actual, Sum, Xm, S : Real;
- -- terms in Taylor series
- K : constant Integer := Integer (
- Log (
- Real (Real'Machine_Radix) ** Real'Machine_Mantissa,
- 10.0)) + 1;
- begin
- if Real'Digits > 23 then
- -- constants in this section only accurate to 23 digits
- Error_Low_Bound := 0.00000_00000_00000_00000_001;
- Report.Comment ("arctan accuracy checked to 23 digits");
- end if;
-
- -- C1 + C2 equals Pi/2 accurate to 23 digits
- if Real'Machine_Radix = 10 then
- C1 := 1.57;
- C2 := 7.9632679489661923132E-4;
- else
- C1 := 201.0 / 128.0;
- C2 := 4.8382679489661923132E-4;
- end if;
-
- Accuracy_Error_Reported := False; -- reset
- for I in 1..Max_Samples loop
- -- make sure there is no error in x-1, x, and x+1
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
-
- Y := X;
- Y_Sq := Y * Y;
- Sum := 0.0;
- Xm := Real (K + K + 1);
- for M in 1 .. K loop
- Sum := Y_Sq * (Sum + 1.0/Xm);
- Xm := Xm - 2.0;
- Sum := Sum * (Xm /(Xm + 1.0));
- end loop;
- Sum := Sum * Y;
-
- -- at this point we have arcsin(x).
- -- We compute arccos(x) = pi/2 - arcsin(x).
- -- The following code segment is translated directly from
- -- the CELEFUNT FORTRAN implementation
-
- S := C1 + C2;
- Sum := ((C1 - S) + C2) - Sum;
- Actual := S + Sum;
- Sum := ((S - Actual) + Sum) - Y;
- S := Actual;
- Actual := S + Sum;
- Sum := (S - Actual) + Sum;
-
- if not Real'Machine_Rounds then
- Actual := Actual + (Sum + Sum);
- end if;
-
- Check (Actual, Arccos (X),
- "Taylor Series test" & Integer'Image (I) & ": arccos(" &
- Real'Image (X) & ") ",
- Minimum_Error);
-
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- exit when Accuracy_Error_Reported;
- end loop;
- Error_Low_Bound := 0.0; -- reset
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Arccos_Taylor_Series_Test" &
- " for X=" & Real'Image (X));
- when others =>
- Report.Failed ("exception in Arccos_Taylor_Series_Test" &
- " for X=" & Real'Image (X));
- end Arccos_Taylor_Series_Test;
-
-
-
- procedure Identity_Test is
- -- test the identity arcsin(-x) = -arcsin(x)
- -- range chosen to be most of the valid range of the argument.
- A : constant := -0.999;
- B : constant := 0.999;
- X : Real;
- begin
- Accuracy_Error_Reported := False; -- reset
- for I in 1..Max_Samples loop
- -- make sure there is no error in x-1, x, and x+1
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
-
- Check (Arcsin(-X), -Arcsin (X),
- "Identity test" & Integer'Image (I) & ": arcsin(" &
- Real'Image (X) & ") ",
- 8.0); -- 2 arcsin evaluations => twice the error bound
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
- end loop;
- end Identity_Test;
-
-
- procedure Exception_Test is
- X1, X2 : Real := 0.0;
- begin
- begin
- X1 := Arcsin (1.1);
- Report.Failed ("no exception for Arcsin (1.1)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error instead of " &
- "Argument_Error for Arcsin (1.1)");
- when Ada.Numerics.Argument_Error =>
- null; -- expected result
- when others =>
- Report.Failed ("wrong exception for Arcsin(1.1)");
- end;
-
- begin
- X2 := Arccos (-1.1);
- Report.Failed ("no exception for Arccos (-1.1)");
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error instead of " &
- "Argument_Error for Arccos (-1.1)");
- when Ada.Numerics.Argument_Error =>
- null; -- expected result
- when others =>
- Report.Failed ("wrong exception for Arccos(-1.1)");
- end;
-
-
- -- optimizer thwarting
- if Report.Ident_Bool (False) then
- Report.Comment (Real'Image (X1 + X2));
- end if;
- end Exception_Test;
-
-
- procedure Do_Test is
- begin
- Special_Value_Test;
- Exact_Result_Test;
- Arcsin_Taylor_Series_Test;
- Arccos_Taylor_Series_Test;
- Identity_Test;
- Exception_Test;
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- -- These expressions must be truly static, which is why we have to do them
- -- outside of the generic, and we use the named numbers. Note that we know
- -- that PI is not a machine number (it is irrational), and it should be
- -- represented to more digits than supported by the target machine.
- Float_Half_PI_Low : constant := Float'Adjacent(PI/2.0, 0.0);
- Float_Half_PI_High : constant := Float'Adjacent(PI/2.0, 10.0);
- Float_PI_Low : constant := Float'Adjacent(PI, 0.0);
- Float_PI_High : constant := Float'Adjacent(PI, 10.0);
- package Float_Check is new Generic_Check (Float,
- Half_PI_Low => Float_Half_PI_Low,
- Half_PI_High => Float_Half_PI_High,
- PI_Low => Float_PI_Low,
- PI_High => Float_PI_High);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- A_Long_Float_Half_PI_Low : constant := A_Long_Float'Adjacent(PI/2.0, 0.0);
- A_Long_Float_Half_PI_High : constant := A_Long_Float'Adjacent(PI/2.0, 10.0);
- A_Long_Float_PI_Low : constant := A_Long_Float'Adjacent(PI, 0.0);
- A_Long_Float_PI_High : constant := A_Long_Float'Adjacent(PI, 10.0);
- package A_Long_Float_Check is new Generic_Check (A_Long_Float,
- Half_PI_Low => A_Long_Float_Half_PI_Low,
- Half_PI_High => A_Long_Float_Half_PI_High,
- PI_Low => A_Long_Float_PI_Low,
- PI_High => A_Long_Float_PI_High);
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-
-begin
- Report.Test ("CXG2015",
- "Check the accuracy of the ARCSIN and ARCCOS functions");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
-
- Report.Result;
-end CXG2015;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2016.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2016.a
deleted file mode 100644
index 832b118224a..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2016.a
+++ /dev/null
@@ -1,482 +0,0 @@
--- CXG2016.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the ARCTAN function returns a
--- result that is within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test consists of a generic package that is
--- instantiated to check both Float and a long float type.
--- The test for each floating point type is divided into
--- several parts:
--- Special value checks where the result is a known constant.
--- Exception checks.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 19 Mar 96 SAIC Initial release for 2.1
--- 30 APR 96 SAIC Fixed optimization issue
--- 17 AUG 96 SAIC Incorporated Reviewer's suggestions.
--- 12 OCT 96 SAIC Incorporated Reviewer's suggestions.
--- 02 DEC 97 EDS Remove procedure Identity_1_Test and calls to
--- procedure.
--- 29 JUN 98 EDS Replace -0.0 with call to ImpDef.Annex_G.Negative_Zero
--- 28 APR 99 RLB Replaced comma accidentally deleted in above change.
--- 15 DEC 99 RLB Added model range checking to "exact" results,
--- in order to avoid too strictly requiring a specific
--- result.
---!
-
---
--- References:
---
--- Software Manual for the Elementary Functions
--- William J. Cody, Jr. and William Waite
--- Prentice-Hall, 1980
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
--- Implementation and Testing of Function Software
--- W. J. Cody
--- Problems and Methodologies in Mathematical Software Production
--- editors P. C. Messina and A. Murli
--- Lecture Notes in Computer Science Volume 142
--- Springer Verlag, 1982
---
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Elementary_Functions;
-with Impdef.Annex_G;
-procedure CXG2016 is
- Verbose : constant Boolean := False;
- Max_Samples : constant := 1000;
-
- -- CRC Standard Mathematical Tables; 23rd Edition; pg 738
- Sqrt2 : constant :=
- 1.41421_35623_73095_04880_16887_24209_69807_85696_71875_37695;
- Sqrt3 : constant :=
- 1.73205_08075_68877_29352_74463_41505_87236_69428_05253_81039;
-
- Pi : constant := Ada.Numerics.Pi;
-
- generic
- type Real is digits <>;
- Half_PI_Low : in Real; -- The machine number closest to, but not greater
- -- than PI/2.0.
- Half_PI_High : in Real;-- The machine number closest to, but not less
- -- than PI/2.0.
- PI_Low : in Real; -- The machine number closest to, but not greater
- -- than PI.
- PI_High : in Real; -- The machine number closest to, but not less
- -- than PI.
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Elementary_Functions is new
- Ada.Numerics.Generic_Elementary_Functions (Real);
-
- function Arctan (Y : Real;
- X : Real := 1.0) return Real renames
- Elementary_Functions.Arctan;
- function Arctan (Y : Real;
- X : Real := 1.0;
- Cycle : Real) return Real renames
- Elementary_Functions.Arctan;
-
- -- flag used to terminate some tests early
- Accuracy_Error_Reported : Boolean := False;
-
- -- The following value is a lower bound on the accuracy
- -- required. It is normally 0.0 so that the lower bound
- -- is computed from Model_Epsilon. However, for tests
- -- where the expected result is only known to a certain
- -- amount of precision this bound takes on a non-zero
- -- value to account for that level of precision.
- Error_Low_Bound : Real := 0.0;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon
- -- instead of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- -- take into account the low bound on the error
- if Max_Error < Error_Low_Bound then
- Max_Error := Error_Low_Bound;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Special_Value_Test is
- -- If eta is very small, arctan(x + eta) ~= arctan(x) + eta/(1+x*x).
- --
- -- For tests 4 and 5, there is an error of 4.0ME for arctan + an
- -- additional error of 1.0ME because pi is not exact for a total of 5.0ME.
- --
- -- In test 3 there is the error for pi plus an additional error
- -- of (1.0ME)/4 since sqrt3 is not exact, for a total of 5.25ME.
- --
- -- In test 2 there is the error for pi plus an additional error
- -- of (3/4)(1.0ME) since sqrt3 is not exact, for a total of 5.75ME.
-
-
- type Data_Point is
- record
- Degrees,
- Radians,
- Tangent,
- Allowed_Error : Real;
- end record;
-
- type Test_Data_Type is array (Positive range <>) of Data_Point;
-
- -- the values in the following table only involve static
- -- expressions so no additional loss of precision occurs.
- Test_Data : constant Test_Data_Type := (
- -- degrees radians tangent error test #
- ( 0.0, 0.0, 0.0, 4.0 ), -- 1
- ( 30.0, Pi/6.0, Sqrt3/3.0, 5.75), -- 2
- ( 60.0, Pi/3.0, Sqrt3, 5.25), -- 3
- ( 45.0, Pi/4.0, 1.0, 5.0 ), -- 4
- (-45.0, -Pi/4.0, -1.0, 5.0 ) ); -- 5
-
- begin
- for I in Test_Data'Range loop
- Check (Arctan (Test_Data (I).Tangent),
- Test_Data (I).Radians,
- "special value test" & Integer'Image (I) &
- " arctan(" &
- Real'Image (Test_Data (I).Tangent) &
- ")",
- Test_Data (I).Allowed_Error);
- Check (Arctan (Test_Data (I).Tangent, Cycle => 360.0),
- Test_Data (I).Degrees,
- "special value test" & Integer'Image (I) &
- " arctan(" &
- Real'Image (Test_Data (I).Tangent) &
- ", cycle=>360)",
- Test_Data (I).Allowed_Error);
- end loop;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in special value test");
- when others =>
- Report.Failed ("exception in special value test");
- end Special_Value_Test;
-
-
-
- procedure Check_Exact (Actual, Expected_Low, Expected_High : Real;
- Test_Name : String) is
- -- If the expected result is not a model number, then Expected_Low is
- -- the first machine number less than the (exact) expected
- -- result, and Expected_High is the first machine number greater than
- -- the (exact) expected result. If the expected result is a model
- -- number, Expected_Low = Expected_High = the result.
- Model_Expected_Low : Real := Expected_Low;
- Model_Expected_High : Real := Expected_High;
- begin
- -- Calculate the first model number nearest to, but below (or equal)
- -- to the expected result:
- while Real'Model (Model_Expected_Low) /= Model_Expected_Low loop
- -- Try the next machine number lower:
- Model_Expected_Low := Real'Adjacent(Model_Expected_Low, 0.0);
- end loop;
- -- Calculate the first model number nearest to, but above (or equal)
- -- to the expected result:
- while Real'Model (Model_Expected_High) /= Model_Expected_High loop
- -- Try the next machine number higher:
- Model_Expected_High := Real'Adjacent(Model_Expected_High, 100.0);
- end loop;
-
- if Actual < Model_Expected_Low or Actual > Model_Expected_High then
- Accuracy_Error_Reported := True;
- if Actual < Model_Expected_Low then
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected low: " & Real'Image (Model_Expected_Low) &
- " expected high: " & Real'Image (Model_Expected_High) &
- " difference: " & Real'Image (Actual - Expected_Low));
- else
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected low: " & Real'Image (Model_Expected_Low) &
- " expected high: " & Real'Image (Model_Expected_High) &
- " difference: " & Real'Image (Expected_High - Actual));
- end if;
- elsif Verbose then
- Report.Comment (Test_Name & " passed");
- end if;
- end Check_Exact;
-
-
- procedure Exact_Result_Test is
- begin
- -- A.5.1(40);6.0
- Check_Exact (Arctan (0.0, 1.0), 0.0, 0.0, "arctan(0,1)");
- Check_Exact (Arctan (0.0, 1.0, 27.0), 0.0, 0.0, "arctan(0,1,27)");
-
- -- G.2.4(11-13);6.0
-
- Check_Exact (Arctan (1.0, 0.0), Half_PI_Low, Half_PI_High,
- "arctan(1,0)");
- Check_Exact (Arctan (1.0, 0.0, 360.0), 90.0, 90.0, "arctan(1,0,360)");
-
- Check_Exact (Arctan (-1.0, 0.0), -Half_PI_High, -Half_PI_Low,
- "arctan(-1,0)");
- Check_Exact (Arctan (-1.0, 0.0, 360.0), -90.0, -90.0,
- "arctan(-1,0,360)");
-
- if Real'Signed_Zeros then
- Check_Exact (Arctan (0.0, -1.0), PI_Low, PI_High, "arctan(+0,-1)");
- Check_Exact (Arctan (0.0, -1.0, 360.0), 180.0, 180.0,
- "arctan(+0,-1,360)");
- Check_Exact (Arctan ( Real ( ImpDef.Annex_G.Negative_Zero ), -1.0),
- -PI_High, -PI_Low, "arctan(-0,-1)");
- Check_Exact (Arctan ( Real ( ImpDef.Annex_G.Negative_Zero ), -1.0,
- 360.0), -180.0, -180.0, "arctan(-0,-1,360)");
- else
- Check_Exact (Arctan (0.0, -1.0), PI_Low, PI_High, "arctan(0,-1)");
- Check_Exact (Arctan (0.0, -1.0, 360.0), 180.0, 180.0,
- "arctan(0,-1,360)");
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Exact_Result Test");
- when others =>
- Report.Failed ("Exception in Exact_Result Test");
- end Exact_Result_Test;
-
-
- procedure Taylor_Series_Test is
- -- This test checks the Arctan by using a taylor series expansion that
- -- will produce a result accurate to 19 decimal digits for
- -- the range under test.
- --
- -- The maximum relative error bound for this test is
- -- 4 for the arctan operation and 2 for the Taylor series
- -- for a total of 6 * Model_Epsilon
-
- A : constant := -1.0/16.0;
- B : constant := 1.0/16.0;
- X : Real;
- Actual, Expected : Real;
- Sum, Em, X_Squared : Real;
- begin
- if Real'Digits > 19 then
- -- Taylor series calculation produces result accurate to 19
- -- digits. If type being tested has more digits then set
- -- the error low bound to account for this.
- -- The error low bound is conservatively set to 6*10**-19
- Error_Low_Bound := 0.00000_00000_00000_0006;
- Report.Comment ("arctan accuracy checked to 19 digits");
- end if;
-
- Accuracy_Error_Reported := False; -- reset
- for I in 0..Max_Samples loop
- X := (B - A) * Real (I) / Real (Max_Samples) + A;
- X_Squared := X * X;
- Em := 17.0;
- Sum := X_Squared / Em;
-
- for II in 1 .. 7 loop
- Em := Em - 2.0;
- Sum := (1.0 / Em - Sum) * X_Squared;
- end loop;
- Sum := -X * Sum;
- Expected := X + Sum;
- Sum := (X - Expected) + Sum;
- if not Real'Machine_Rounds then
- Expected := Expected + (Sum + Sum);
- end if;
-
- Actual := Arctan (X);
-
- Check (Actual, Expected,
- "Taylor_Series_Test " & Integer'Image (I) & ": arctan(" &
- Real'Image (X) & ") ",
- 6.0);
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
-
- end loop;
- Error_Low_Bound := 0.0; -- reset
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Taylor_Series_Test");
- when others =>
- Report.Failed ("exception in Taylor_Series_Test");
- end Taylor_Series_Test;
-
-
- procedure Exception_Test is
- X1, X2, X3 : Real := 0.0;
- begin
-
- begin -- A.5.1(20);6.0
- X1 := Arctan(0.0, Cycle => 0.0);
- Report.Failed ("no exception for cycle = 0.0");
- exception
- when Ada.Numerics.Argument_Error => null;
- when others =>
- Report.Failed ("wrong exception for cycle = 0.0");
- end;
-
- begin -- A.5.1(20);6.0
- X2 := Arctan (0.0, Cycle => -1.0);
- Report.Failed ("no exception for cycle < 0.0");
- exception
- when Ada.Numerics.Argument_Error => null;
- when others =>
- Report.Failed ("wrong exception for cycle < 0.0");
- end;
-
- begin -- A.5.1(25);6.0
- X3 := Arctan (0.0, 0.0);
- Report.Failed ("no exception for arctan(0,0)");
- exception
- when Ada.Numerics.Argument_Error => null;
- when others =>
- Report.Failed ("wrong exception for arctan(0,0)");
- end;
-
- -- optimizer thwarting
- if Report.Ident_Bool (False) then
- Report.Comment (Real'Image (X1 + X2 + X3));
- end if;
- end Exception_Test;
-
-
- procedure Do_Test is
- begin
- Special_Value_Test;
- Exact_Result_Test;
- Taylor_Series_Test;
- Exception_Test;
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- -- These expressions must be truly static, which is why we have to do them
- -- outside of the generic, and we use the named numbers. Note that we know
- -- that PI is not a machine number (it is irrational), and it should be
- -- represented to more digits than supported by the target machine.
- Float_Half_PI_Low : constant := Float'Adjacent(PI/2.0, 0.0);
- Float_Half_PI_High : constant := Float'Adjacent(PI/2.0, 10.0);
- Float_PI_Low : constant := Float'Adjacent(PI, 0.0);
- Float_PI_High : constant := Float'Adjacent(PI, 10.0);
- package Float_Check is new Generic_Check (Float,
- Half_PI_Low => Float_Half_PI_Low,
- Half_PI_High => Float_Half_PI_High,
- PI_Low => Float_PI_Low,
- PI_High => Float_PI_High);
-
- -- check the Floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- A_Long_Float_Half_PI_Low : constant := A_Long_Float'Adjacent(PI/2.0, 0.0);
- A_Long_Float_Half_PI_High : constant := A_Long_Float'Adjacent(PI/2.0, 10.0);
- A_Long_Float_PI_Low : constant := A_Long_Float'Adjacent(PI, 0.0);
- A_Long_Float_PI_High : constant := A_Long_Float'Adjacent(PI, 10.0);
- package A_Long_Float_Check is new Generic_Check (A_Long_Float,
- Half_PI_Low => A_Long_Float_Half_PI_Low,
- Half_PI_High => A_Long_Float_Half_PI_High,
- PI_Low => A_Long_Float_PI_Low,
- PI_High => A_Long_Float_PI_High);
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-
-begin
- Report.Test ("CXG2016",
- "Check the accuracy of the ARCTAN function");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
-
- Report.Result;
-end CXG2016;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2017.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2017.a
deleted file mode 100644
index 50add975f7f..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2017.a
+++ /dev/null
@@ -1,296 +0,0 @@
--- CXG2017.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the TANH function returns
--- a result that is within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test consists of a generic package that is
--- instantiated to check both Float and a long float type.
--- The test for each floating point type is divided into
--- several parts:
--- Special value checks where the result is a known constant.
--- Checks that use an identity for determining the result.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 20 Mar 96 SAIC Initial release for 2.1
--- 17 Aug 96 SAIC Incorporated reviewer comments.
--- 03 Jun 98 EDS Add parens to remove the potential for overflow.
--- Remove the invocation of Identity_Test that checks
--- Tanh values that are too close to zero for the
--- test's error bounds.
---!
-
---
--- References:
---
--- Software Manual for the Elementary Functions
--- William J. Cody, Jr. and William Waite
--- Prentice-Hall, 1980
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
--- Implementation and Testing of Function Software
--- W. J. Cody
--- Problems and Methodologies in Mathematical Software Production
--- editors P. C. Messina and A. Murli
--- Lecture Notes in Computer Science Volume 142
--- Springer Verlag, 1982
---
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Elementary_Functions;
-procedure CXG2017 is
- Verbose : constant Boolean := False;
- Max_Samples : constant := 1000;
-
- E : constant := Ada.Numerics.E;
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Elementary_Functions is new
- Ada.Numerics.Generic_Elementary_Functions (Real);
-
- function Tanh (X : Real) return Real renames
- Elementary_Functions.Tanh;
-
- function Log (X : Real) return Real renames
- Elementary_Functions.Log;
-
- -- flag used to terminate some tests early
- Accuracy_Error_Reported : Boolean := False;
-
-
- -- The following value is a lower bound on the accuracy
- -- required. It is normally 0.0 so that the lower bound
- -- is computed from Model_Epsilon. However, for tests
- -- where the expected result is only known to a certain
- -- amount of precision this bound takes on a non-zero
- -- value to account for that level of precision.
- Error_Low_Bound : Real := 0.0;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Small instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Small;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
- -- take into account the low bound on the error
- if Max_Error < Error_Low_Bound then
- Max_Error := Error_Low_Bound;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Special_Value_Test is
- -- In the following tests the expected result is accurate
- -- to the machine precision so the minimum guaranteed error
- -- bound can be used.
- Minimum_Error : constant := 8.0;
- E2 : constant := E * E;
- begin
- Check (Tanh (1.0),
- (E - 1.0 / E) / (E + 1.0 / E),
- "tanh(1)",
- Minimum_Error);
- Check (Tanh (2.0),
- (E2 - 1.0 / E2) / (E2 + 1.0 / E2),
- "tanh(2)",
- Minimum_Error);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in special value test");
- when others =>
- Report.Failed ("exception in special value test");
- end Special_Value_Test;
-
-
-
- procedure Exact_Result_Test is
- No_Error : constant := 0.0;
- begin
- -- A.5.1(38);6.0
- Check (Tanh (0.0), 0.0, "tanh(0)", No_Error);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Exact_Result Test");
- when others =>
- Report.Failed ("exception in Exact_Result Test");
- end Exact_Result_Test;
-
-
- procedure Identity_Test (A, B : Real) is
- -- For this test we use the identity
- -- TANH(u+v) = [TANH(u) + TANH(v)] / [1 + TANH(u)*TANH(v)]
- -- which is transformed to
- -- TANH(x) = [TANH(y)+C] / [1 + TANH(y) * C]
- -- where C = TANH(1/8) and y = x - 1/8
- --
- -- see Cody pg 248-249 for details on the error analysis.
- -- The net result is a relative error bound of 16 * Model_Epsilon.
- --
- -- The second part of this test checks the identity
- -- TANH(-x) = -TANH(X)
-
- X, Y : Real;
- Actual1, Actual2 : Real;
- C : constant := 1.2435300177159620805e-1;
- begin
- if Real'Digits > 20 then
- -- constant C is accurate to 20 digits. Set the low bound
- -- on the error to 16*10**-20
- Error_Low_Bound := 0.00000_00000_00000_00016;
- Report.Comment ("tanh accuracy checked to 20 digits");
- end if;
-
- Accuracy_Error_Reported := False; -- reset
- for I in 1..Max_Samples loop
- X := (B - A) * (Real (I) / Real (Max_Samples)) + A;
- Actual1 := Tanh(X);
-
- -- TANH(x) = [TANH(y)+C] / [1 + TANH(y) * C]
- Y := X - (1.0 / 8.0);
- Actual2 := (Tanh (Y) + C) / (1.0 + Tanh(Y) * C);
-
- Check (Actual1, Actual2,
- "Identity_1_Test " & Integer'Image (I) & ": tanh(" &
- Real'Image (X) & ") ",
- 16.0);
-
- -- TANH(-x) = -TANH(X)
- Actual2 := Tanh(-X);
- Check (-Actual1, Actual2,
- "Identity_2_Test " & Integer'Image (I) & ": tanh(" &
- Real'Image (X) & ") ",
- 16.0);
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
-
- end loop;
- Error_Low_Bound := 0.0; -- reset
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Identity_Test" &
- " for X=" & Real'Image (X));
- when others =>
- Report.Failed ("exception in Identity_Test" &
- " for X=" & Real'Image (X));
- end Identity_Test;
-
-
-
- procedure Do_Test is
- begin
- Special_Value_Test;
- Exact_Result_Test;
- -- cover a large range
- Identity_Test (1.0, Real'Safe_Last);
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- package Float_Check is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package A_Long_Float_Check is new Generic_Check (A_Long_Float);
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-
-begin
- Report.Test ("CXG2017",
- "Check the accuracy of the TANH function");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
-
- Report.Result;
-end CXG2017;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2018.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2018.a
deleted file mode 100644
index be4f1a82faf..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2018.a
+++ /dev/null
@@ -1,355 +0,0 @@
--- CXG2018.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the complex EXP function returns
--- a result that is within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test consists of a generic package that is
--- instantiated to check complex numbers based upon
--- both Float and a long float type.
--- The test for each floating point type is divided into
--- several parts:
--- Special value checks where the result is a known constant.
--- Checks that use an identity for determining the result.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 21 Mar 96 SAIC Initial release for 2.1
--- 17 Aug 96 SAIC Incorporated reviewer comments.
--- 27 Aug 99 RLB Repair on the error result of checks.
--- 02 Apr 03 RLB Added code to discard excess precision in the
--- construction of the test value for the
--- Identity_Test.
---
---!
-
---
--- References:
---
--- W. J. Cody
--- CELEFUNT: A Portable Test Package for Complex Elementary Functions
--- Algorithm 714, Collected Algorithms from ACM.
--- Published in Transactions On Mathematical Software,
--- Vol. 19, No. 1, March, 1993, pp. 1-21.
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Complex_Types;
-with Ada.Numerics.Generic_Complex_Elementary_Functions;
-procedure CXG2018 is
- Verbose : constant Boolean := False;
- -- Note that Max_Samples is the number of samples taken in
- -- both the real and imaginary directions. Thus, for Max_Samples
- -- of 100 the number of values checked is 10000.
- Max_Samples : constant := 100;
-
- E : constant := Ada.Numerics.E;
- Pi : constant := Ada.Numerics.Pi;
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Complex_Type is new
- Ada.Numerics.Generic_Complex_Types (Real);
- use Complex_Type;
-
- package CEF is new
- Ada.Numerics.Generic_Complex_Elementary_Functions (Complex_Type);
-
- function Exp (X : Complex) return Complex renames CEF.Exp;
- function Exp (X : Imaginary) return Complex renames CEF.Exp;
-
- -- flag used to terminate some tests early
- Accuracy_Error_Reported : Boolean := False;
-
-
- -- The following value is a lower bound on the accuracy
- -- required. It is normally 0.0 so that the lower bound
- -- is computed from Model_Epsilon. However, for tests
- -- where the expected result is only known to a certain
- -- amount of precision this bound takes on a non-zero
- -- value to account for that level of precision.
- Error_Low_Bound : Real := 0.0;
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Small instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Small;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- -- take into account the low bound on the error
- if Max_Error < Error_Low_Bound then
- Max_Error := Error_Low_Bound;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Check (Actual, Expected : Complex;
- Test_Name : String;
- MRE : Real) is
- begin
- Check (Actual.Re, Expected.Re, Test_Name & " real part", MRE);
- Check (Actual.Im, Expected.Im, Test_Name & " imaginary part", MRE);
- end Check;
-
-
- procedure Special_Value_Test is
- -- In the following tests the expected result is accurate
- -- to the machine precision so the minimum guaranteed error
- -- bound can be used.
- --
- -- The error bounds given assumed z is exact. When using
- -- pi there is an extra error of 1.0ME.
- -- The pi inside the exp call requires that the complex
- -- component have an extra error allowance of 1.0*angle*ME.
- -- Thus for pi/2,the Minimum_Error_I is
- -- (2.0 + 1.0(pi/2))ME <= 3.6ME.
- -- For pi, it is (2.0 + 1.0*pi)ME <= 5.2ME,
- -- and for 2pi, it is (2.0 + 1.0(2pi))ME <= 8.3ME.
-
- -- The addition of 1 or i to a result is so that neither of
- -- the components of an expected result is 0. This is so
- -- that a reasonable relative error is allowed.
- Minimum_Error_C : constant := 7.0; -- for exp(Complex)
- Minimum_Error_I : constant := 2.0; -- for exp(Imaginary)
- begin
- Check (Exp (1.0 + 0.0*i) + i,
- E + i,
- "exp(1+0i)",
- Minimum_Error_C);
- Check (Exp ((Pi / 2.0) * i) + 1.0,
- 1.0 + 1.0*i,
- "exp(pi/2*i)",
- 3.6);
- Check (Exp (Pi * i) + i,
- -1.0 + 1.0*i,
- "exp(pi*i)",
- 5.2);
- Check (Exp (Pi * 2.0 * i) + i,
- 1.0 + i,
- "exp(2pi*i)",
- 8.3);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in special value test");
- when others =>
- Report.Failed ("exception in special value test");
- end Special_Value_Test;
-
-
-
- procedure Exact_Result_Test is
- No_Error : constant := 0.0;
- begin
- -- G.1.2(36);6.0
- Check (Exp(0.0 + 0.0*i), 1.0 + 0.0 * i, "exp(0+0i)", No_Error);
- Check (Exp( 0.0*i), 1.0 + 0.0 * i, "exp(0i)", No_Error);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Exact_Result Test");
- when others =>
- Report.Failed ("exception in Exact_Result Test");
- end Exact_Result_Test;
-
-
- procedure Identity_Test (A, B : Real) is
- -- For this test we use the identity
- -- Exp(Z) = Exp(Z-W) * Exp (W)
- -- where W = (1+i)/16
- --
- -- The second part of this test checks the identity
- -- Exp(Z) * Exp(-Z) = 1
- --
-
- X, Y : Complex;
- Actual1, Actual2 : Complex;
- W : constant Complex := (0.0625, 0.0625);
- -- the following constant was taken from the CELEFUNC EXP test.
- -- This is the value EXP(W) - 1
- C : constant Complex := (6.2416044877018563681e-2,
- 6.6487597751003112768e-2);
- begin
- if Real'Digits > 20 then
- -- constant ExpW is accurate to 20 digits.
- -- The low bound is 19 * 10**-20
- Error_Low_Bound := 0.00000_00000_00019;
- Report.Comment ("complex exp accuracy checked to 20 digits");
- end if;
-
- Accuracy_Error_Reported := False; -- reset
- for II in 1..Max_Samples loop
- X.Re := Real'Machine ((B - A) * Real (II) / Real (Max_Samples)
- + A);
- for J in 1..Max_Samples loop
- X.Im := Real'Machine ((B - A) * Real (J) / Real (Max_Samples)
- + A);
-
- Actual1 := Exp(X);
-
- -- Exp(X) = Exp(X-W) * Exp (W)
- -- = Exp(X-W) * (1 - (1-Exp(W))
- -- = Exp(X-W) * (1 + (Exp(W) - 1))
- -- = Exp(X-W) * (1 + C)
- Y := X - W;
- Actual2 := Exp(Y);
- Actual2 := Actual2 + Actual2 * C;
-
- Check (Actual1, Actual2,
- "Identity_1_Test " & Integer'Image (II) &
- Integer'Image (J) & ": Exp((" &
- Real'Image (X.Re) & ", " &
- Real'Image (X.Im) & ")) ",
- 20.0); -- 2 exp and 1 multiply and 1 add = 2*7+1*5+1
- -- Note: The above is not strictly correct, as multiply
- -- has a box error, rather than a relative error.
- -- Supposedly, the interval is chosen to avoid the need
- -- to worry about this.
-
- -- Exp(X) * Exp(-X) + i = 1 + i
- -- The addition of i is to allow a reasonable relative
- -- error in the imaginary part
- Actual2 := (Actual1 * Exp(-X)) + i;
- Check (Actual2, (1.0, 1.0),
- "Identity_2_Test " & Integer'Image (II) &
- Integer'Image (J) & ": Exp((" &
- Real'Image (X.Re) & ", " &
- Real'Image (X.Im) & ")) ",
- 20.0); -- 2 exp and 1 multiply and one add = 2*7+1*5+1
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
- end loop;
- end loop;
- Error_Low_Bound := 0.0;
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Identity_Test" &
- " for X=(" & Real'Image (X.Re) &
- ", " & Real'Image (X.Im) & ")");
- when others =>
- Report.Failed ("exception in Identity_Test" &
- " for X=(" & Real'Image (X.Re) &
- ", " & Real'Image (X.Im) & ")");
- end Identity_Test;
-
-
-
- procedure Do_Test is
- begin
- Special_Value_Test;
- Exact_Result_Test;
- -- test regions where we can avoid cancellation error problems
- -- See Cody page 10.
- Identity_Test (0.0625, 1.0);
- Identity_Test (15.0, 17.0);
- Identity_Test (1.625, 3.0);
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- package Float_Check is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package A_Long_Float_Check is new Generic_Check (A_Long_Float);
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-
-begin
- Report.Test ("CXG2018",
- "Check the accuracy of the complex EXP function");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
-
- Report.Result;
-end CXG2018;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2019.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2019.a
deleted file mode 100644
index 0a4dddcc906..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2019.a
+++ /dev/null
@@ -1,338 +0,0 @@
--- CXG2019.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the complex LOG function returns
--- a result that is within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test consists of a generic package that is
--- instantiated to check complex numbers based upon
--- both Float and a long float type.
--- The test for each floating point type is divided into
--- several parts:
--- Special value checks where the result is a known constant.
--- Checks that use an identity for determining the result.
--- Exception conditions.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 22 Mar 96 SAIC Initial release for 2.1
---
---!
-
---
--- References:
---
--- W. J. Cody
--- CELEFUNT: A Portable Test Package for Complex Elementary Functions
--- Algorithm 714, Collected Algorithms from ACM.
--- Published in Transactions On Mathematical Software,
--- Vol. 19, No. 1, March, 1993, pp. 1-21.
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Complex_Types;
-with Ada.Numerics.Generic_Complex_Elementary_Functions;
-procedure CXG2019 is
- Verbose : constant Boolean := False;
- -- Note that Max_Samples is the number of samples taken in
- -- both the real and imaginary directions. Thus, for Max_Samples
- -- of 100 the number of values checked is 10000.
- Max_Samples : constant := 100;
-
- E : constant := Ada.Numerics.E;
- Pi : constant := Ada.Numerics.Pi;
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Complex_Type is new
- Ada.Numerics.Generic_Complex_Types (Real);
- use Complex_Type;
-
- package CEF is new
- Ada.Numerics.Generic_Complex_Elementary_Functions (Complex_Type);
-
- function Log (X : Complex) return Complex renames CEF.Log;
-
- -- flag used to terminate some tests early
- Accuracy_Error_Reported : Boolean := False;
-
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Small instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * abs Expected * Real'Model_Epsilon;
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Check (Actual, Expected : Complex;
- Test_Name : String;
- MRE : Real) is
- begin
- Check (Actual.Re, Expected.Re, Test_Name & " real part", MRE);
- Check (Actual.Im, Expected.Im, Test_Name & " imaginary part", MRE);
- end Check;
-
-
- procedure Special_Value_Test is
- -- In the following tests the expected result is accurate
- -- to the machine precision so the minimum guaranteed error
- -- bound can be used if the argument is exact.
- --
- -- When using pi there is an extra error of 1.0ME.
- -- Although the real component has an error bound of 13.0,
- -- the complex component must take into account this error
- -- in the value for Pi.
- --
- -- One or i is added to the actual and expected results in
- -- order to prevent the expected result from having a
- -- real or imaginary part of 0. This is to allow a reasonable
- -- relative error for that component.
- Minimum_Error : constant := 13.0;
- begin
- Check (1.0 + Log (0.0 + i),
- 1.0 + Pi / 2.0 * i,
- "1+log(0+i)",
- Minimum_Error + 1.0);
- Check (1.0 + Log ((-1.0, 0.0)),
- 1.0 + (Pi * i),
- "log(-1+0i)+1 ",
- Minimum_Error + 1.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in special value test");
- when others =>
- Report.Failed ("exception in special value test");
- end Special_Value_Test;
-
-
-
- procedure Exact_Result_Test is
- No_Error : constant := 0.0;
- begin
- -- G.1.2(37);6.0
- Check (Log(1.0 + 0.0*i), 0.0 + 0.0 * i, "log(1+0i)", No_Error);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Exact_Result Test");
- when others =>
- Report.Failed ("exception in Exact_Result Test");
- end Exact_Result_Test;
-
-
- procedure Identity_Test (RA, RB, IA, IB : Real) is
- -- Tests an identity over a range of values specified
- -- by the 4 parameters. RA and RB denote the range for the
- -- real part while IA and IB denote the range for the
- -- imaginary part.
- --
- -- For this test we use the identity
- -- Log(Z*Z) = 2 * Log(Z)
- --
-
- Scale : Real := Real (Real'Machine_Radix) ** (Real'Mantissa / 2 + 4);
- W, X, Y, Z : Real;
- CX, CY : Complex;
- Actual1, Actual2 : Complex;
- begin
- Accuracy_Error_Reported := False; -- reset
- for II in 1..Max_Samples loop
- X := (RB - RA) * Real (II) / Real (Max_Samples) + RA;
- for J in 1..Max_Samples loop
- Y := (IB - IA) * Real (J) / Real (Max_Samples) + IA;
-
- -- purify the arguments to minimize roundoff error.
- -- We construct the values so that the products X*X,
- -- Y*Y, and X*Y are all exact machine numbers.
- -- See Cody page 7 and CELEFUNT code.
- Z := X * Scale;
- W := Z + X;
- X := W - Z;
- Z := Y * Scale;
- W := Z + Y;
- Y := W - Z;
- CX := Compose_From_Cartesian(X,Y);
- Z := X*X - Y*Y;
- W := X*Y;
- CY := Compose_From_Cartesian(Z,W+W);
-
- -- The arguments are now ready so on with the
- -- identity computation.
- Actual1 := Log(CX);
-
- Actual2 := Log(CY) * 0.5;
-
- Check (Actual1, Actual2,
- "Identity_1_Test " & Integer'Image (II) &
- Integer'Image (J) & ": Log((" &
- Real'Image (CX.Re) & ", " &
- Real'Image (CX.Im) & ")) ",
- 26.0); -- 2 logs = 2*13. no error from this multiply
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
- end loop;
- end loop;
-
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Identity_Test" &
- " for X=(" & Real'Image (X) &
- ", " & Real'Image (X) & ")");
- when others =>
- Report.Failed ("exception in Identity_Test" &
- " for X=(" & Real'Image (X) &
- ", " & Real'Image (X) & ")");
- end Identity_Test;
-
-
- procedure Exception_Test is
- -- Check that log((0,0)) causes constraint_error.
- -- G.1.2(29);
-
- X : Complex := (0.0, 0.0);
- begin
- if not Real'Machine_Overflows then
- -- not applicable: G.1.2(28);6.0
- return;
- end if;
-
- begin
- X := Log ((0.0, 0.0));
- Report.Failed ("exception not raised for log(0,0)");
- exception
- when Constraint_Error => null; -- ok
- when others =>
- Report.Failed ("wrong exception raised for log(0,0)");
- end;
-
- -- optimizer thwarting
- if Report.Ident_Bool(False) then
- Report.Comment (Real'Image (X.Re + X.Im));
- end if;
- end Exception_Test;
-
-
- procedure Do_Test is
- begin
- Special_Value_Test;
- Exact_Result_Test;
- -- test regions that do not include the unit circle so that
- -- the real part of LOG(Z) does not vanish
- -- See Cody page 9.
- Identity_Test ( 2.0, 10.0, 0.0, 10.0);
- Identity_Test (1000.0, 2000.0, -4000.0, -1000.0);
- Identity_Test (Real'Model_Epsilon, 0.25,
- -0.25, -Real'Model_Epsilon);
- Exception_Test;
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- package Float_Check is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package A_Long_Float_Check is new Generic_Check (A_Long_Float);
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-
-begin
- Report.Test ("CXG2019",
- "Check the accuracy of the complex LOG function");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
-
- Report.Result;
-end CXG2019;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2020.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2020.a
deleted file mode 100644
index 1aed4ca5735..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2020.a
+++ /dev/null
@@ -1,351 +0,0 @@
--- CXG2020.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the complex SQRT function returns
--- a result that is within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test consists of a generic package that is
--- instantiated to check complex numbers based upon
--- both Float and a long float type.
--- The test for each floating point type is divided into
--- several parts:
--- Special value checks where the result is a known constant.
--- Checks that use an identity for determining the result.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 24 Mar 96 SAIC Initial release for 2.1
--- 17 Aug 96 SAIC Incorporated reviewer comments.
--- 03 Jun 98 EDS Added parens to ensure that the expression is not
--- evaluated by multiplying its two large terms
--- together and overflowing.
---!
-
---
--- References:
---
--- W. J. Cody
--- CELEFUNT: A Portable Test Package for Complex Elementary Functions
--- Algorithm 714, Collected Algorithms from ACM.
--- Published in Transactions On Mathematical Software,
--- Vol. 19, No. 1, March, 1993, pp. 1-21.
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Complex_Types;
-with Ada.Numerics.Generic_Complex_Elementary_Functions;
-procedure CXG2020 is
- Verbose : constant Boolean := False;
- -- Note that Max_Samples is the number of samples taken in
- -- both the real and imaginary directions. Thus, for Max_Samples
- -- of 100 the number of values checked is 10000.
- Max_Samples : constant := 100;
-
- E : constant := Ada.Numerics.E;
- Pi : constant := Ada.Numerics.Pi;
-
- -- CRC Standard Mathematical Tables; 23rd Edition; pg 738
- Sqrt2 : constant :=
- 1.41421_35623_73095_04880_16887_24209_69807_85696_71875_37695;
- Sqrt3 : constant :=
- 1.73205_08075_68877_29352_74463_41505_87236_69428_05253_81039;
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Complex_Type is new
- Ada.Numerics.Generic_Complex_Types (Real);
- use Complex_Type;
-
- package CEF is new
- Ada.Numerics.Generic_Complex_Elementary_Functions (Complex_Type);
-
- function Sqrt (X : Complex) return Complex renames CEF.Sqrt;
-
- -- flag used to terminate some tests early
- Accuracy_Error_Reported : Boolean := False;
-
-
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon
- -- instead of Model_Epsilon and Expected.
- Rel_Error := MRE * (abs Expected * Real'Model_Epsilon);
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed");
- end if;
- end if;
- end Check;
-
-
- procedure Check (Actual, Expected : Complex;
- Test_Name : String;
- MRE : Real) is
- begin
- Check (Actual.Re, Expected.Re, Test_Name & " real part", MRE);
- Check (Actual.Im, Expected.Im, Test_Name & " imaginary part", MRE);
- end Check;
-
-
- procedure Special_Value_Test is
- -- In the following tests the expected result is accurate
- -- to the machine precision so the minimum guaranteed error
- -- bound can be used if the argument is exact.
- --
- -- One or i is added to the actual and expected results in
- -- order to prevent the expected result from having a
- -- real or imaginary part of 0. This is to allow a reasonable
- -- relative error for that component.
- Minimum_Error : constant := 6.0;
- Z1, Z2 : Complex;
- begin
- Check (Sqrt(9.0+0.0*i) + i,
- 3.0+1.0*i,
- "sqrt(9+0i)+i",
- Minimum_Error);
- Check (Sqrt (-2.0 + 0.0 * i) + 1.0,
- 1.0 + Sqrt2 * i,
- "sqrt(-2)+1 ",
- Minimum_Error);
-
- -- make sure no exception occurs when taking the sqrt of
- -- very large and very small values.
-
- Z1 := (Real'Safe_Last * 0.9, Real'Safe_Last * 0.9);
- Z2 := Sqrt (Z1);
- begin
- Check (Z2 * Z2,
- Z1,
- "sqrt((big,big))",
- Minimum_Error + 5.0); -- +5 for multiply
- exception
- when others =>
- Report.Failed ("unexpected exception in sqrt((big,big))");
- end;
-
- Z1 := (Real'Model_Epsilon * 10.0, Real'Model_Epsilon * 10.0);
- Z2 := Sqrt (Z1);
- begin
- Check (Z2 * Z2,
- Z1,
- "sqrt((little,little))",
- Minimum_Error + 5.0); -- +5 for multiply
- exception
- when others =>
- Report.Failed ("unexpected exception in " &
- "sqrt((little,little))");
- end;
-
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in special value test");
- when others =>
- Report.Failed ("exception in special value test");
- end Special_Value_Test;
-
-
-
- procedure Exact_Result_Test is
- No_Error : constant := 0.0;
- begin
- -- G.1.2(36);6.0
- Check (Sqrt(0.0 + 0.0*i), 0.0 + 0.0 * i, "sqrt(0+0i)", No_Error);
-
- -- G.1.2(37);6.0
- Check (Sqrt(1.0 + 0.0*i), 1.0 + 0.0 * i, "sqrt(1+0i)", No_Error);
-
- -- G.1.2(38-39);6.0
- Check (Sqrt(-1.0 + 0.0*i), 0.0 + 1.0 * i, "sqrt(-1+0i)", No_Error);
-
- -- G.1.2(40);6.0
- if Real'Signed_Zeros then
- Check (Sqrt(-1.0-0.0*i), 0.0 - 1.0 * i, "sqrt(-1-0i)", No_Error);
- end if;
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Exact_Result Test");
- when others =>
- Report.Failed ("exception in Exact_Result Test");
- end Exact_Result_Test;
-
-
- procedure Identity_Test (RA, RB, IA, IB : Real) is
- -- Tests an identity over a range of values specified
- -- by the 4 parameters. RA and RB denote the range for the
- -- real part while IA and IB denote the range for the
- -- imaginary part of the result.
- --
- -- For this test we use the identity
- -- Sqrt(Z*Z) = Z
- --
-
- Scale : Real := Real (Real'Machine_Radix) ** (Real'Mantissa / 2 + 4);
- W, X, Y, Z : Real;
- CX : Complex;
- Actual, Expected : Complex;
- begin
- Accuracy_Error_Reported := False; -- reset
- for II in 1..Max_Samples loop
- X := (RB - RA) * Real (II) / Real (Max_Samples) + RA;
- for J in 1..Max_Samples loop
- Y := (IB - IA) * Real (J) / Real (Max_Samples) + IA;
-
- -- purify the arguments to minimize roundoff error.
- -- We construct the values so that the products X*X,
- -- Y*Y, and X*Y are all exact machine numbers.
- -- See Cody page 7 and CELEFUNT code.
- Z := X * Scale;
- W := Z + X;
- X := W - Z;
- Z := Y * Scale;
- W := Z + Y;
- Y := W - Z;
- -- G.1.2(21);6.0 - real part of result is non-negative
- Expected := Compose_From_Cartesian( abs X,Y);
- Z := X*X - Y*Y;
- W := X*Y;
- CX := Compose_From_Cartesian(Z,W+W);
-
- -- The arguments are now ready so on with the
- -- identity computation.
- Actual := Sqrt(CX);
-
- Check (Actual, Expected,
- "Identity_1_Test " & Integer'Image (II) &
- Integer'Image (J) & ": Sqrt((" &
- Real'Image (CX.Re) & ", " &
- Real'Image (CX.Im) & ")) ",
- 8.5); -- 6.0 from sqrt, 2.5 from argument.
- -- See Cody pg 7-8 for analysis of additional error amount.
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- return;
- end if;
- end loop;
- end loop;
-
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Identity_Test" &
- " for X=(" & Real'Image (X) &
- ", " & Real'Image (X) & ")");
- when others =>
- Report.Failed ("exception in Identity_Test" &
- " for X=(" & Real'Image (X) &
- ", " & Real'Image (X) & ")");
- end Identity_Test;
-
-
- procedure Do_Test is
- begin
- Special_Value_Test;
- Exact_Result_Test;
- -- ranges where the sign is the same and where it
- -- differs.
- Identity_Test ( 0.0, 10.0, 0.0, 10.0);
- Identity_Test ( 0.0, 100.0, -100.0, 0.0);
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- package Float_Check is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package A_Long_Float_Check is new Generic_Check (A_Long_Float);
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-
-begin
- Report.Test ("CXG2020",
- "Check the accuracy of the complex SQRT function");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
-
- Report.Result;
-end CXG2020;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2021.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2021.a
deleted file mode 100644
index db49fc845f2..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2021.a
+++ /dev/null
@@ -1,386 +0,0 @@
--- CXG2021.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the complex SIN and COS functions return
--- a result that is within the error bound allowed.
---
--- TEST DESCRIPTION:
--- This test consists of a generic package that is
--- instantiated to check complex numbers based upon
--- both Float and a long float type.
--- The test for each floating point type is divided into
--- several parts:
--- Special value checks where the result is a known constant.
--- Checks that use an identity for determining the result.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 27 Mar 96 SAIC Initial release for 2.1
--- 22 Aug 96 SAIC No longer skips test for systems with
--- more than 20 digits of precision.
---
---!
-
---
--- References:
---
--- W. J. Cody
--- CELEFUNT: A Portable Test Package for Complex Elementary Functions
--- Algorithm 714, Collected Algorithms from ACM.
--- Published in Transactions On Mathematical Software,
--- Vol. 19, No. 1, March, 1993, pp. 1-21.
---
--- CRC Standard Mathematical Tables
--- 23rd Edition
---
-
-with System;
-with Report;
-with Ada.Numerics.Generic_Complex_Types;
-with Ada.Numerics.Generic_Complex_Elementary_Functions;
-procedure CXG2021 is
- Verbose : constant Boolean := False;
- -- Note that Max_Samples is the number of samples taken in
- -- both the real and imaginary directions. Thus, for Max_Samples
- -- of 100 the number of values checked is 10000.
- Max_Samples : constant := 100;
-
- E : constant := Ada.Numerics.E;
- Pi : constant := Ada.Numerics.Pi;
-
- generic
- type Real is digits <>;
- package Generic_Check is
- procedure Do_Test;
- end Generic_Check;
-
- package body Generic_Check is
- package Complex_Type is new
- Ada.Numerics.Generic_Complex_Types (Real);
- use Complex_Type;
-
- package CEF is new
- Ada.Numerics.Generic_Complex_Elementary_Functions (Complex_Type);
-
- function Sin (X : Complex) return Complex renames CEF.Sin;
- function Cos (X : Complex) return Complex renames CEF.Cos;
-
- -- flag used to terminate some tests early
- Accuracy_Error_Reported : Boolean := False;
-
- -- The following value is a lower bound on the accuracy
- -- required. It is normally 0.0 so that the lower bound
- -- is computed from Model_Epsilon. However, for tests
- -- where the expected result is only known to a certain
- -- amount of precision this bound takes on a non-zero
- -- value to account for that level of precision.
- Error_Low_Bound : Real := 0.0;
-
- -- the E_Factor is an additional amount added to the Expected
- -- value prior to computing the maximum relative error.
- -- This is needed because the error analysis (Cody pg 17-20)
- -- requires this additional allowance.
- procedure Check (Actual, Expected : Real;
- Test_Name : String;
- MRE : Real;
- E_Factor : Real := 0.0) is
- Max_Error : Real;
- Rel_Error : Real;
- Abs_Error : Real;
- begin
- -- In the case where the expected result is very small or 0
- -- we compute the maximum error as a multiple of Model_Epsilon instead
- -- of Model_Epsilon and Expected.
- Rel_Error := MRE * Real'Model_Epsilon * (abs Expected + E_Factor);
- Abs_Error := MRE * Real'Model_Epsilon;
- if Rel_Error > Abs_Error then
- Max_Error := Rel_Error;
- else
- Max_Error := Abs_Error;
- end if;
-
- -- take into account the low bound on the error
- if Max_Error < Error_Low_Bound then
- Max_Error := Error_Low_Bound;
- end if;
-
- if abs (Actual - Expected) > Max_Error then
- Accuracy_Error_Reported := True;
- Report.Failed (Test_Name &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) &
- " efactor:" & Real'Image (E_Factor) );
- elsif Verbose then
- if Actual = Expected then
- Report.Comment (Test_Name & " exact result");
- else
- Report.Comment (Test_Name & " passed" &
- " actual: " & Real'Image (Actual) &
- " expected: " & Real'Image (Expected) &
- " difference: " & Real'Image (Actual - Expected) &
- " max err:" & Real'Image (Max_Error) &
- " efactor:" & Real'Image (E_Factor) );
- end if;
- end if;
- end Check;
-
-
- procedure Check (Actual, Expected : Complex;
- Test_Name : String;
- MRE : Real;
- R_Factor, I_Factor : Real := 0.0) is
- begin
- Check (Actual.Re, Expected.Re, Test_Name & " real part",
- MRE, R_Factor);
- Check (Actual.Im, Expected.Im, Test_Name & " imaginary part",
- MRE, I_Factor);
- end Check;
-
-
- procedure Special_Value_Test is
- -- In the following tests the expected result is accurate
- -- to the machine precision so the minimum guaranteed error
- -- bound can be used if the argument is exact.
- -- Since the argument involves Pi, we must allow for this
- -- inexact argument.
- Minimum_Error : constant := 11.0;
- begin
- Check (Sin (Pi/2.0 + 0.0*i),
- 1.0 + 0.0*i,
- "sin(pi/2+0i)",
- Minimum_Error + 1.0);
- Check (Cos (Pi/2.0 + 0.0*i),
- 0.0 + 0.0*i,
- "cos(pi/2+0i)",
- Minimum_Error + 1.0);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in special value test");
- when others =>
- Report.Failed ("exception in special value test");
- end Special_Value_Test;
-
-
-
- procedure Exact_Result_Test is
- No_Error : constant := 0.0;
- begin
- -- G.1.2(36);6.0
- Check (Sin(0.0 + 0.0*i), 0.0 + 0.0 * i, "sin(0+0i)", No_Error);
- Check (Cos(0.0 + 0.0*i), 1.0 + 0.0 * i, "cos(0+0i)", No_Error);
- exception
- when Constraint_Error =>
- Report.Failed ("Constraint_Error raised in Exact_Result Test");
- when others =>
- Report.Failed ("exception in Exact_Result Test");
- end Exact_Result_Test;
-
-
- procedure Identity_Test (RA, RB, IA, IB : Real) is
- -- Tests an identity over a range of values specified
- -- by the 4 parameters. RA and RB denote the range for the
- -- real part while IA and IB denote the range for the
- -- imaginary part.
- --
- -- For this test we use the identity
- -- Sin(Z) = Sin(Z-W) * Cos(W) + Cos(Z-W) * Sin(W)
- -- and
- -- Cos(Z) = Cos(Z-W) * Cos(W) - Sin(Z-W) * Sin(W)
- --
-
- X, Y : Real;
- Z : Complex;
- W : constant Complex := Compose_From_Cartesian(0.0625, 0.0625);
- ZmW : Complex; -- Z - W
- Sin_ZmW,
- Cos_ZmW : Complex;
- Actual1, Actual2 : Complex;
- R_Factor : Real; -- additional real error factor
- I_Factor : Real; -- additional imaginary error factor
- Sin_W : constant Complex := (6.2581348413276935585E-2,
- 6.2418588008436587236E-2);
- -- numeric stability is enhanced by using Cos(W) - 1.0 instead of
- -- Cos(W) in the computation.
- Cos_W_m_1 : constant Complex := (-2.5431314180235545803E-6,
- -3.9062493377261771826E-3);
-
-
- begin
- if Real'Digits > 20 then
- -- constants used here accurate to 20 digits. Allow 1
- -- additional digit of error for computation.
- Error_Low_Bound := 0.00000_00000_00000_0001;
- Report.Comment ("accuracy checked to 19 digits");
- end if;
-
- Accuracy_Error_Reported := False; -- reset
- for II in 0..Max_Samples loop
- X := (RB - RA) * Real (II) / Real (Max_Samples) + RA;
- for J in 0..Max_Samples loop
- Y := (IB - IA) * Real (J) / Real (Max_Samples) + IA;
-
- Z := Compose_From_Cartesian(X,Y);
- ZmW := Z - W;
- Sin_ZmW := Sin (ZmW);
- Cos_ZmW := Cos (ZmW);
-
- -- now for the first identity
- -- Sin(Z) = Sin(Z-W) * Cos(W) + Cos(Z-W) * Sin(W)
- -- = Sin(Z-W) * (1+(Cos(W)-1)) + Cos(Z-W) * Sin(W)
- -- = Sin(Z-W) + Sin(Z-W)*(Cos(W)-1) + Cos(Z-W)*Sin(W)
-
-
- Actual1 := Sin (Z);
- Actual2 := Sin_ZmW + (Sin_ZmW * Cos_W_m_1 + Cos_ZmW * Sin_W);
-
- -- The computation of the additional error factors are taken
- -- from Cody pages 17-20.
-
- R_Factor := abs (Re (Sin_ZmW) * Re (1.0 - Cos_W_m_1)) +
- abs (Im (Sin_ZmW) * Im (1.0 - Cos_W_m_1)) +
- abs (Re (Cos_ZmW) * Re (Sin_W)) +
- abs (Re (Cos_ZmW) * Re (1.0 - Cos_W_m_1));
-
- I_Factor := abs (Re (Sin_ZmW) * Im (1.0 - Cos_W_m_1)) +
- abs (Im (Sin_ZmW) * Re (1.0 - Cos_W_m_1)) +
- abs (Re (Cos_ZmW) * Im (Sin_W)) +
- abs (Im (Cos_ZmW) * Re (1.0 - Cos_W_m_1));
-
- Check (Actual1, Actual2,
- "Identity_1_Test " & Integer'Image (II) &
- Integer'Image (J) & ": Sin((" &
- Real'Image (Z.Re) & ", " &
- Real'Image (Z.Im) & ")) ",
- 11.0, R_Factor, I_Factor);
-
- -- now for the second identity
- -- Cos(Z) = Cos(Z-W) * Cos(W) - Sin(Z-W) * Sin(W)
- -- = Cos(Z-W) * (1+(Cos(W)-1) - Sin(Z-W) * Sin(W)
- Actual1 := Cos (Z);
- Actual2 := Cos_ZmW + (Cos_ZmW * Cos_W_m_1 - Sin_ZmW * Sin_W);
-
- -- The computation of the additional error factors are taken
- -- from Cody pages 17-20.
-
- R_Factor := abs (Re (Sin_ZmW) * Re (Sin_W)) +
- abs (Im (Sin_ZmW) * Im (Sin_W)) +
- abs (Re (Cos_ZmW) * Re (1.0 - Cos_W_m_1)) +
- abs (Im (Cos_ZmW) * Im (1.0 - Cos_W_m_1));
-
- I_Factor := abs (Re (Sin_ZmW) * Im (Sin_W)) +
- abs (Im (Sin_ZmW) * Re (Sin_W)) +
- abs (Re (Cos_ZmW) * Im (1.0 - Cos_W_m_1)) +
- abs (Im (Cos_ZmW) * Re (1.0 - Cos_W_m_1));
-
- Check (Actual1, Actual2,
- "Identity_2_Test " & Integer'Image (II) &
- Integer'Image (J) & ": Cos((" &
- Real'Image (Z.Re) & ", " &
- Real'Image (Z.Im) & ")) ",
- 11.0, R_Factor, I_Factor);
-
- if Accuracy_Error_Reported then
- -- only report the first error in this test in order to keep
- -- lots of failures from producing a huge error log
- Error_Low_Bound := 0.0; -- reset
- return;
- end if;
- end loop;
- end loop;
-
- Error_Low_Bound := 0.0; -- reset
- exception
- when Constraint_Error =>
- Report.Failed
- ("Constraint_Error raised in Identity_Test" &
- " for Z=(" & Real'Image (X) &
- ", " & Real'Image (Y) & ")");
- when others =>
- Report.Failed ("exception in Identity_Test" &
- " for Z=(" & Real'Image (X) &
- ", " & Real'Image (Y) & ")");
- end Identity_Test;
-
-
- procedure Do_Test is
- begin
- Special_Value_Test;
- Exact_Result_Test;
- -- test regions where sin and cos have the same sign and
- -- about the same magnitude. This will minimize subtraction
- -- errors in the identities.
- -- See Cody page 17.
- Identity_Test (0.0625, 10.0, 0.0625, 10.0);
- Identity_Test ( 16.0, 17.0, 16.0, 17.0);
- end Do_Test;
- end Generic_Check;
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- package Float_Check is new Generic_Check (Float);
-
- -- check the floating point type with the most digits
- type A_Long_Float is digits System.Max_Digits;
- package A_Long_Float_Check is new Generic_Check (A_Long_Float);
-
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
-
-begin
- Report.Test ("CXG2021",
- "Check the accuracy of the complex SIN and COS functions");
-
- if Verbose then
- Report.Comment ("checking Standard.Float");
- end if;
-
- Float_Check.Do_Test;
-
- if Verbose then
- Report.Comment ("checking a digits" &
- Integer'Image (System.Max_Digits) &
- " floating point type");
- end if;
-
- A_Long_Float_Check.Do_Test;
-
-
- Report.Result;
-end CXG2021;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2022.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2022.a
deleted file mode 100644
index f9e4d1cae33..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2022.a
+++ /dev/null
@@ -1,309 +0,0 @@
--- CXG2022.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that multiplication and division of binary fixed point
--- numbers with compatible 'small values produce exact results.
---
--- TEST DESCRIPTION:
--- Signed, unsigned, and a mixture of signed and unsigned
--- binary fixed point values are multiplied and divided.
--- The result is checked against the expected "perfect result set"
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
---
---
--- CHANGE HISTORY:
--- 1 Apr 96 SAIC Initial release for 2.1
--- 29 Jan 1998 EDS Repaired fixed point errors ("**" and
--- assumptions about 'Small)
---!
-
-with System;
-with Report;
-procedure CXG2022 is
- Verbose : constant Boolean := False;
-
-procedure Check_Signed is
- type Pairs is delta 2.0 range -2.0 ** (System.Max_Mantissa) ..
- 2.0 ** (System.Max_Mantissa) - 1.0;
- type Halves is delta 0.5 range -2.0 ** (System.Max_Mantissa-2) ..
- 2.0 ** (System.Max_Mantissa-2) - 1.0;
- P1, P2, P3, P4 : Pairs;
- H1, H2, H3, H4 : Halves;
-
- procedure Dont_Opt is
- -- keep optimizer from knowing the constant value of expressions
- begin
- if Report.Ident_Bool (False) then
- P1 := 2.0; P2 := 4.0; P3 := 6.0;
- H1 := -2.0; H2 := 9.0; H3 := 3.0;
- end if;
- end Dont_Opt;
-
-begin
- H1 := -0.5;
- H2 := Halves'First;
- H3 := 1.0;
- P1 := 12.0;
- P2 := Pairs'First;
- P3 := Pairs'Last;
- Dont_Opt;
-
- P4 := Pairs (P1 * H1); -- 12.0 * -0.5
- if P4 /= -6.0 then
- Report.Failed ("12.0 * -0.5 = " & Pairs'Image (P4));
- end if;
-
- H4 := Halves (P1 / H1); -- 12.0 / -0.5
- if H4 /= -24.0 then
- Report.Failed ("12.0 / -0.5 = " & Halves'Image (H4));
- end if;
-
- P4 := P3 * H3; -- Pairs'Last * 1.0
- if P4 /= Pairs'Last then
- Report.Failed ("Pairs'Last * 1.0 = " & Pairs'Image (P4));
- end if;
-
- P4 := P3 / H3; -- Pairs'Last / 1.0
- if P4 /= Pairs'Last then
- Report.Failed ("Pairs'Last / 1.0 = " & Pairs'Image (P4));
- end if;
-
- P4 := P2 * 0.25; -- Pairs'First * 0.25
- if P4 /= Pairs (-2.0 ** (System.Max_Mantissa - 2)) then
- Report.Failed ("Pairs'First * 0.25 = " & Pairs'Image (P4));
- end if;
-
- P4 := 100.5 / H1; -- 100.5 / -0.5
- if P4 = -201.0 then
- null; -- Perfect result
- elsif Pairs'Small = 2.0 and ( P4 = -200.0 or P4 = -202.0 ) then
- null; -- Allowed variation
- else
- Report.Failed ("Pairs'Small =" & Pairs'Image (Pairs'Small) &
- " and 100.5/-0.5 = " & Pairs'Image (P4) );
- end if;
-
- H4 := H1 * H2; -- -0.5 * Halves'First
- if H4 /= Halves (2.0 ** (System.Max_Mantissa-3)) then
- Report.Failed ("-0.5 * Halves'First =" & Halves'Image (H4) &
- " instead of " &
- Halves'Image( Halves(2.0 ** (System.Max_Mantissa-3))));
- end if;
-
-exception
- when others =>
- Report.Failed ("unexpected exception in Check_Signed");
-end Check_Signed;
-
-
-
-procedure Check_Unsigned is
- type Pairs is delta 2.0 range 0.0 .. 2.0 ** (System.Max_Mantissa+1) - 1.0;
- type Halves is delta 0.5 range 0.0 .. 2.0 ** (System.Max_Mantissa-1) - 1.0;
- P1, P2, P3, P4 : Pairs;
- H1, H2, H3, H4 : Halves;
-
- procedure Dont_Opt is
- -- keep optimizer from knowing the constant value of expressions
- begin
- if Report.Ident_Bool (False) then
- P1 := 2.0; P2 := 4.0; P3 := 6.0;
- H1 := 2.0; H2 := 9.0; H3 := 3.0;
- end if;
- end Dont_Opt;
-
-begin
- H1 := 10.5;
- H2 := Halves(2.0 ** (System.Max_Mantissa - 6));
- H3 := 1.0;
- P1 := 12.0;
- P2 := Pairs'Last / 2;
- P3 := Pairs'Last;
- Dont_Opt;
-
- P4 := Pairs (P1 * H1); -- 12.0 * 10.5
- if P4 /= 126.0 then
- Report.Failed ("12.0 * 10.5 = " & Pairs'Image (P4));
- end if;
-
- H4 := Halves (P1 / H1); -- 12.0 / 10.5
- if H4 /= 1.0 and H4 /= 1.5 then
- Report.Failed ("12.0 / 10.5 = " & Halves'Image (H4));
- end if;
-
- P4 := P3 * H3; -- Pairs'Last * 1.0
- if P4 /= Pairs'Last then
- Report.Failed ("Pairs'Last * 1.0 = " & Pairs'Image (P4));
- end if;
-
- P4 := P3 / H3; -- Pairs'Last / 1.0
- if P4 /= Pairs'Last then
- Report.Failed ("Pairs'Last / 1.0 = " & Pairs'Image (P4));
- end if;
-
- P4 := P1 * 0.25; -- 12.0 * 0.25
- if P4 /= 2.0 and P4 /= 4.0 then
- Report.Failed ("12.0 * 0.25 = " & Pairs'Image (P4));
- end if;
-
- P4 := 100.5 / H1; -- 100.5 / 10.5 = 9.571...
- if P4 /= 8.0 and P4 /= 10.0 then
- Report.Failed ("100.5/10.5 = " & Pairs'Image (P4));
- end if;
-
- H4 := H2 * 2; -- 2**(max_mantissa-6) * 2
- if H4 /= Halves(2.0 ** (System.Max_Mantissa-5)) then
- Report.Failed ("2**(System.Max_Mantissa-6) * 2=" & Halves'Image (H4) &
- " instead of " &
- Halves'Image( Halves(2.0 ** (System.Max_Mantissa-5))));
- end if;
-
-exception
- when others =>
- Report.Failed ("unexpected exception in Check_Unsigned");
-end Check_Unsigned;
-
-
-
-procedure Check_Mixed is
- type Pairs is delta 2.0 range -2.0 ** (System.Max_Mantissa) ..
- 2.0 ** (System.Max_Mantissa) - 1.0;
- type Halves is delta 0.5 range 0.0 .. 2.0 ** (System.Max_Mantissa-1) - 1.0;
- P1, P2, P3, P4 : Pairs;
- H1, H2, H3, H4 : Halves;
-
- procedure Dont_Opt is
- -- keep optimizer from knowing the constant value of expressions
- begin
- if Report.Ident_Bool (False) then
- P1 := 2.0; P2 := 4.0; P3 := 6.0;
- H1 := 2.0; H2 := 9.0; H3 := 3.0;
- end if;
- end Dont_Opt;
-
-begin
- H1 := 10.5;
- H2 := Halves(2.0 ** (System.Max_Mantissa - 6));
- H3 := 1.0;
- P1 := 12.0;
- P2 := -4.0;
- P3 := Pairs'Last;
- Dont_Opt;
-
- P4 := Pairs (P1 * H1); -- 12.0 * 10.5
- if P4 /= 126.0 then
- Report.Failed ("12.0 * 10.5 = " & Pairs'Image (P4));
- end if;
-
- H4 := Halves (P1 / H1); -- 12.0 / 10.5
- if H4 /= 1.0 and H4 /= 1.5 then
- Report.Failed ("12.0 / 10.5 = " & Halves'Image (H4));
- end if;
-
- P4 := P3 * H3; -- Pairs'Last * 1.0
- if P4 /= Pairs'Last then
- Report.Failed ("Pairs'Last * 1.0 = " & Pairs'Image (P4));
- end if;
-
- P4 := P3 / H3; -- Pairs'Last / 1.0
- if P4 /= Pairs'Last then
- Report.Failed ("Pairs'Last / 1.0 = " & Pairs'Image (P4));
- end if;
-
- P4 := P1 * 0.25; -- 12.0 * 0.25
- if P4 = 3.0 then
- null; -- Perfect result
- elsif Pairs'Small = 2.0 and then ( P4 = 2.0 or P4 = 4.0 ) then
- null; -- Allowed deviation
- else
- Report.Failed ("Pairs'Small =" & Pairs'Image (Pairs'Small) &
- "and 12.0 * 0.25 = " & Pairs'Image (P4) );
- end if;
-
- P4 := 100.5 / H1; -- 100.5 / 10.5 = 9.571...
- if P4 = 9.0 then
- null; -- Perfect result
- elsif Pairs'Small = 2.0 and then ( P4 = 8.0 or P4 = 10.0 ) then
- null; -- Allowed values
- else
- Report.Failed ("Pairs'Small =" & Pairs'Image (Pairs'Small) &
- "and 100.5/10.5 = " & Pairs'Image (P4) );
- end if;
-
- H4 := H2 * 2; -- 2**(max_mantissa-6) * 2
- if H4 /= Halves(2.0 ** (System.Max_Mantissa-5)) then
- Report.Failed ("2**(System.Max_Mantissa-6) * 2=" & Halves'Image (H4) &
- " instead of " &
- Halves'Image( Halves(2.0 ** (System.Max_Mantissa-5))));
- end if;
-
- P4 := Pairs(P1 * 6) / P2; -- 12 * 6 / -4
- if (P4 /= -18.0) then
- Report.Failed ("12*6/-4 = " & Pairs'Image(P4));
- end if;
-
- P4 := Halves(P1 * 6.0) / P2; -- 12 * 6 / -4
- if (P4 /= -18.0) then
- Report.Failed ("Halves(12*6)/-4 = " & Pairs'Image(P4));
- end if;
-
-exception
- when others =>
- Report.Failed ("unexpected exception in Check_Mixed");
-end Check_Mixed;
-
-
-begin -- main
- Report.Test ("CXG2022",
- "Check the accuracy of multiplication and division" &
- " of binary fixed point numbers");
- if Verbose then
- Report.Comment ("starting signed test");
- end if;
- Check_Signed;
-
- if Verbose then
- Report.Comment ("starting unsigned test");
- end if;
- Check_Unsigned;
-
- if Verbose then
- Report.Comment ("starting mixed sign test");
- end if;
- Check_Mixed;
-
- Report.Result;
-end CXG2022;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2023.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2023.a
deleted file mode 100644
index 0cdd5574e09..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2023.a
+++ /dev/null
@@ -1,351 +0,0 @@
--- CXG2023.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that multiplication and division of decimal fixed point
--- numbers produce exact results.
---
--- TEST DESCRIPTION:
--- Check that multiplication and division of decimal fixed point
--- numbers produce exact results.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
--- This test applies only to implementations supporting
--- decimal fixed point types of at least 9 digits.
---
---
--- CHANGE HISTORY:
--- 3 Apr 96 SAIC Initial release for 2.1
---
---!
-
-with System;
-with Report;
-procedure CXG2023 is
- Verbose : constant Boolean := False;
-
-procedure Check_1 is
- Num_Digits : constant := 6;
- type Pennies is delta 0.01 digits Num_Digits;
- type Franklins is delta 100.0 digits Num_Digits;
- type Dollars is delta 1.0 digits Num_Digits;
-
- P1 : Pennies;
- F1 : Franklins;
- D1 : Dollars;
-
- -- optimization thwarting functions
-
- function P (X : Pennies) return Pennies is
- begin
- if Report.Ident_Bool (True) then
- return X;
- else
- return 3.21; -- never executed
- end if;
- end P;
-
-
- function F (X : Franklins) return Franklins is
- begin
- if Report.Ident_Bool (True) then
- return X;
- else
- return 32100.0; -- never executed
- end if;
- end F;
-
-
- function D (X : Dollars) return Dollars is
- begin
- if Report.Ident_Bool (True) then
- return X;
- else
- return 321.0; -- never executed
- end if;
- end D;
-
-
-begin
- -- multiplication where one operand is universal real
-
- P1 := P(0.05) * 200.0;
- if P1 /= 10.00 then
- Report.Failed ("1 - expected 10.00 got " & Pennies'Image (P1));
- end if;
-
- D1 := P(0.05) * 100.0;
- if D1 /= 5.00 then
- Report.Failed ("2 - expected 5.00 got " & Dollars'Image (D1));
- end if;
-
- F1 := P(0.05) * 50_000.0;
- if F1 /= 2500.00 then
- Report.Failed ("3 - expected 2500.0 got " & Franklins'Image (F1));
- end if;
-
- -- multiplication where both operands are decimal fixed
-
- P1 := P(0.05) * D(-200.0);
- if P1 /= -10.00 then
- Report.Failed ("4 - expected -10.00 got " & Pennies'Image (P1));
- end if;
-
- D1 := P(0.05) * P(-100.0);
- if D1 /= -5.00 then
- Report.Failed ("5 - expected -5.00 got " & Dollars'Image (D1));
- end if;
-
- F1 := P(-0.05) * F(50_000.0);
- if F1 /= -2500.00 then
- Report.Failed ("6 - expected -2500.0 got " & Franklins'Image (F1));
- end if;
-
- -- division where one operand is universal real
-
- P1 := P(0.05) / 0.001;
- if P1 /= 50.00 then
- Report.Failed ("7 - expected 50.00 got " & Pennies'Image (P1));
- end if;
-
- D1 := D(1000.0) / 3.0;
- if D1 /= 333.00 then
- Report.Failed ("8 - expected 333.00 got " & Dollars'Image (D1));
- end if;
-
- F1 := P(1234.56) / 0.0001;
- if F1 /= 12345600.00 then
- Report.Failed ("9 - expected 12345600.0 got " & Franklins'Image (F1));
- end if;
-
-
- -- division where both operands are decimal fixed
-
- P1 := P(0.05) / D(1.0);
- if P1 /= 0.05 then
- Report.Failed ("10 - expected 0.05 got " & Pennies'Image (P1));
- end if;
-
- -- check for truncation toward 0
- D1 := P(-101.00) / P(2.0);
- if D1 /= -50.00 then
- Report.Failed ("11 - expected -50.00 got " & Dollars'Image (D1));
- end if;
-
- P1 := P(-102.03) / P(-0.5);
- if P1 /= 204.06 then
- Report.Failed ("12 - expected 204.06 got " & Pennies'Image (P1));
- end if;
-
- F1 := P(876.54) / P(0.03);
- if F1 /= 29200.00 then
- Report.Failed ("13 - expected 29200.0 got " & Franklins'Image (F1));
- end if;
-
-exception
- when others =>
- Report.Failed ("unexpected exception in Check_1");
-end Check_1;
-
-generic
- type Pennies is delta<> digits<>;
- type Dollars is delta<> digits<>;
- type Franklins is delta<> digits<>;
-procedure Generic_Check;
-procedure Generic_Check is
-
- -- the following code is copied directly from the
- -- above procedure Check_1
-
- P1 : Pennies;
- F1 : Franklins;
- D1 : Dollars;
-
- -- optimization thwarting functions
-
- function P (X : Pennies) return Pennies is
- begin
- if Report.Ident_Bool (True) then
- return X;
- else
- return 3.21; -- never executed
- end if;
- end P;
-
-
- function F (X : Franklins) return Franklins is
- begin
- if Report.Ident_Bool (True) then
- return X;
- else
- return 32100.0; -- never executed
- end if;
- end F;
-
-
- function D (X : Dollars) return Dollars is
- begin
- if Report.Ident_Bool (True) then
- return X;
- else
- return 321.0; -- never executed
- end if;
- end D;
-
-
-begin
- -- multiplication where one operand is universal real
-
- P1 := P(0.05) * 200.0;
- if P1 /= 10.00 then
- Report.Failed ("1 - expected 10.00 got " & Pennies'Image (P1));
- end if;
-
- D1 := P(0.05) * 100.0;
- if D1 /= 5.00 then
- Report.Failed ("2 - expected 5.00 got " & Dollars'Image (D1));
- end if;
-
- F1 := P(0.05) * 50_000.0;
- if F1 /= 2500.00 then
- Report.Failed ("3 - expected 2500.0 got " & Franklins'Image (F1));
- end if;
-
- -- multiplication where both operands are decimal fixed
-
- P1 := P(0.05) * D(-200.0);
- if P1 /= -10.00 then
- Report.Failed ("4 - expected -10.00 got " & Pennies'Image (P1));
- end if;
-
- D1 := P(0.05) * P(-100.0);
- if D1 /= -5.00 then
- Report.Failed ("5 - expected -5.00 got " & Dollars'Image (D1));
- end if;
-
- F1 := P(-0.05) * F(50_000.0);
- if F1 /= -2500.00 then
- Report.Failed ("6 - expected -2500.0 got " & Franklins'Image (F1));
- end if;
-
- -- division where one operand is universal real
-
- P1 := P(0.05) / 0.001;
- if P1 /= 50.00 then
- Report.Failed ("7 - expected 50.00 got " & Pennies'Image (P1));
- end if;
-
- D1 := D(1000.0) / 3.0;
- if D1 /= 333.00 then
- Report.Failed ("8 - expected 333.00 got " & Dollars'Image (D1));
- end if;
-
- F1 := P(1234.56) / 0.0001;
- if F1 /= 12345600.00 then
- Report.Failed ("9 - expected 12345600.0 got " & Franklins'Image (F1));
- end if;
-
-
- -- division where both operands are decimal fixed
-
- P1 := P(0.05) / D(1.0);
- if P1 /= 0.05 then
- Report.Failed ("10 - expected 0.05 got " & Pennies'Image (P1));
- end if;
-
- -- check for truncation toward 0
- D1 := P(-101.00) / P(2.0);
- if D1 /= -50.00 then
- Report.Failed ("11 - expected -50.00 got " & Dollars'Image (D1));
- end if;
-
- P1 := P(-102.03) / P(-0.5);
- if P1 /= 204.06 then
- Report.Failed ("12 - expected 204.06 got " & Pennies'Image (P1));
- end if;
-
- F1 := P(876.54) / P(0.03);
- if F1 /= 29200.00 then
- Report.Failed ("13 - expected 29200.0 got " & Franklins'Image (F1));
- end if;
-
-end Generic_Check;
-
-
-procedure Check_G6 is
- Num_Digits : constant := 6;
- type Pennies is delta 0.01 digits Num_Digits;
- type Franklins is delta 100.0 digits Num_Digits;
- type Dollars is delta 1.0 digits Num_Digits;
-
- procedure G is new Generic_Check (Pennies, Dollars, Franklins);
-begin
- G;
-end Check_G6;
-
-
-procedure Check_G9 is
- Num_Digits : constant := 9;
- type Pennies is delta 0.01 digits Num_Digits;
- type Franklins is delta 100.0 digits Num_Digits;
- type Dollars is delta 1.0 digits Num_Digits;
-
- procedure G is new Generic_Check (Pennies, Dollars, Franklins);
-begin
- G;
-end Check_G9;
-
-
-begin -- main
- Report.Test ("CXG2023",
- "Check the accuracy of multiplication and division" &
- " of decimal fixed point numbers");
-
- if Verbose then
- Report.Comment ("starting Check_1");
- end if;
- Check_1;
-
- if Verbose then
- Report.Comment ("starting Check_G6");
- end if;
- Check_G6;
-
- if Verbose then
- Report.Comment ("starting Check_G9");
- end if;
- Check_G9;
-
- Report.Result;
-end CXG2023;
diff --git a/gcc/testsuite/ada/acats/tests/cxg/cxg2024.a b/gcc/testsuite/ada/acats/tests/cxg/cxg2024.a
deleted file mode 100644
index 55648283eba..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxg/cxg2024.a
+++ /dev/null
@@ -1,191 +0,0 @@
--- CXG2024.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that multiplication and division of decimal
--- and binary fixed point numbers that result in a
--- decimal fixed point type produce acceptable results.
---
--- TEST DESCRIPTION:
--- Multiplication and division of mixed binary and decimal
--- values are performed. Identity functions are used so
--- that the operands of the expressions will not be seen
--- as static by the compiler.
---
--- SPECIAL REQUIREMENTS
--- The Strict Mode for the numerical accuracy must be
--- selected. The method by which this mode is selected
--- is implementation dependent.
---
--- APPLICABILITY CRITERIA:
--- This test applies only to implementations supporting the
--- Numerics Annex.
--- This test only applies to the Strict Mode for numerical
--- accuracy.
--- This test applies only to implementations supporting
--- decimal fixed point types of at least 9 digits.
---
---
--- CHANGE HISTORY:
--- 4 Apr 96 SAIC Initial release for 2.1
--- 17 Aug 96 SAIC Removed checks for close results
---
---!
-
-with System;
-with Report;
-procedure CXG2024 is
-
-procedure Do_Check is
- Num_Digits : constant := 9;
- type Pennies is delta 0.01 digits Num_Digits;
- type Dollars is delta 1.0 digits Num_Digits;
-
- type Signed_Sixteenths is delta 0.0625
- range -2.0 ** (System.Max_Mantissa-5) ..
- 2.0 ** (System.Max_Mantissa-5) - 1.0;
- type Unsigned_Sixteenths is delta 0.0625
- range 0.0 .. 2.0 ** (System.Max_Mantissa-4) - 1.0;
-
- P1 : Pennies;
- D1 : Dollars;
-
- -- optimization thwarting functions
-
- function P (X : Pennies) return Pennies is
- begin
- if Report.Ident_Bool (True) then
- return X;
- else
- return 3.21; -- never executed
- end if;
- end P;
-
-
- function D (X : Dollars) return Dollars is
- begin
- if Report.Ident_Bool (True) then
- return X;
- else
- return 321.0; -- never executed
- end if;
- end D;
-
-
- function US (X : Unsigned_Sixteenths) return Unsigned_Sixteenths is
- begin
- if Report.Ident_Bool (True) then
- return X;
- else
- return 321.0; -- never executed
- end if;
- end US;
-
-
- function SS (X : Signed_Sixteenths) return Signed_Sixteenths is
- begin
- if Report.Ident_Bool (True) then
- return X;
- else
- return 321.0; -- never executed
- end if;
- end SS;
-
-
-begin
-
- P1 := P(0.05) * SS(-200.0);
- if P1 /= -10.00 then
- Report.Failed ("1 - expected -10.00 got " & Pennies'Image (P1));
- end if;
-
- D1 := P(0.05) * SS(-100.0);
- if D1 /= -5.00 then
- Report.Failed ("2 - expected -5.00 got " & Dollars'Image (D1));
- end if;
-
- P1 := P(0.05) * US(200.0);
- if P1 /= 10.00 then
- Report.Failed ("3 - expected 10.00 got " & Pennies'Image (P1));
- end if;
-
- D1 := P(-0.05) * US(100.0);
- if D1 /= -5.00 then
- Report.Failed ("4 - expected -5.00 got " & Dollars'Image (D1));
- end if;
-
-
-
- P1 := P(0.05) / US(1.0);
- if P1 /= 0.05 then
- Report.Failed ("6 - expected 0.05 got " & Pennies'Image (P1));
- end if;
-
-
- -- check rounding
-
- D1 := Dollars'Round (Pennies (P(-101.00) / US(2.0)));
- if D1 /= -51.00 then
- Report.Failed ("11 - expected -51.00 got " & Dollars'Image (D1));
- end if;
-
- D1 := Dollars'Round (Pennies (P(101.00) / US(2.0)));
- if D1 /= 51.00 then
- Report.Failed ("12 - expected 51.00 got " & Dollars'Image (D1));
- end if;
-
- D1 := Dollars'Round (Pennies (SS(-101.00) / P(2.0)));
- if D1 /= -51.00 then
- Report.Failed ("13 - expected -51.00 got " & Dollars'Image (D1));
- end if;
-
- D1 := Dollars'Round (Pennies (US(101.00) / P(2.0)));
- if D1 /= 51.00 then
- Report.Failed ("14 - expected 51.00 got " & Dollars'Image (D1));
- end if;
-
-
-
- P1 := P(-102.03) / SS(-0.5);
- if P1 /= 204.06 then
- Report.Failed ("15 - expected 204.06 got " & Pennies'Image (P1));
- end if;
-
-
-exception
- when others =>
- Report.Failed ("unexpected exception in Do_Check");
-end Do_Check;
-
-
-begin -- main
- Report.Test ("CXG2024",
- "Check the accuracy of multiplication and division" &
- " of mixed decimal and binary fixed point numbers");
-
- Do_Check;
-
- Report.Result;
-end CXG2024;
diff --git a/gcc/testsuite/ada/acats/tests/cxh/cxh1001.a b/gcc/testsuite/ada/acats/tests/cxh/cxh1001.a
deleted file mode 100644
index 12379a1a551..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxh/cxh1001.a
+++ /dev/null
@@ -1,349 +0,0 @@
--- CXH1001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE
--- Check pragma Normalize_Scalars.
--- Check that this configuration pragma causes uninitialized scalar
--- objects to be set to a predictable value. Check that multiple
--- compilation units are affected. Check for uninitialized scalar
--- objects that are subcomponents of composite objects, unassigned
--- out parameters, objects that have been allocated without an initial
--- value, and objects that are stand alone.
---
--- TEST DESCRIPTION
--- The test requires that the configuration pragma Normalize_Scalars
--- be processed. It then defines a few scalar types (some enumeration,
--- some integer) in a few packages. The scalar types are designed such
--- that the representation will easily allow for an out of range value.
--- Unchecked_Conversion and the 'Valid attribute are both used to verify
--- that the default values of the various kinds of objects are indeed
--- invalid for the type.
---
--- Note that this test relies on having uninitialized objects, compilers
--- may generate several warnings to this effect.
---
--- SPECIAL REQUIREMENTS
--- The implementation must process configuration pragmas which
--- are not part of any Compilation Unit; the method employed
--- is implementation defined.
---
--- APPLICABILITY CRITERIA:
--- This test is only applicable for a compiler attempting validation
--- for the Safety and Security Annex.
---
---
--- CHANGE HISTORY:
--- 26 OCT 95 SAIC Initial version
--- 04 NOV 96 SAIC Added cases, upgraded commentary
---
---!
-
----------------------------- CONFIGURATION PRAGMAS -----------------------
-
-pragma Normalize_Scalars; -- OK
- -- configuration pragma
-
------------------------- END OF CONFIGURATION PRAGMAS --------------------
-
-
------------------------------------------------------------------ CXH1001_0
-
-with Impdef.Annex_H;
-with Unchecked_Conversion;
-package CXH1001_0 is
-
- package Imp_H renames Impdef.Annex_H;
- use type Imp_H.Small_Number;
- use type Imp_H.Scalar_To_Normalize;
-
- Global_Object : Imp_H.Scalar_To_Normalize;
- -- if the pragma is in effect, this should come up with the predictable
- -- value
-
- Global_Number : Imp_H.Small_Number;
- -- if the pragma is in effect, this should come up with the predictable
- -- value
-
- procedure Package_Check;
-
- type Num is range 0..2**Imp_H.Scalar_To_Normalize'Size-1;
- for Num'Size use Imp_H.Scalar_To_Normalize'Size;
-
- function STN_2_Num is
- new Unchecked_Conversion( Imp_H.Scalar_To_Normalize, Num );
-
- Small_Last : constant Integer := Integer(Imp_H.Small_Number'Last);
-
-end CXH1001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body CXH1001_0 is
-
- procedure Heap_Check( A_Value : access Imp_H.Scalar_To_Normalize;
- A_Number : access Imp_H.Small_Number ) is
- Value : Num;
- Number : Integer;
- begin
-
- if A_Value.all'Valid then
- Value := STN_2_Num ( A_Value.all );
- if Imp_H.Default_For_Scalar_To_Normalize_Is_In_Range then
- if Imp_H.Scalar_To_Normalize'Val(Value)
- /= Imp_H.Default_For_Scalar_To_Normalize then
- Report.Failed("Implicit initial value for local variable is not "
- & "the predicted value");
- end if;
- else
- if Value in 0 ..
- Imp_H.Scalar_To_Normalize'Pos(Imp_H.Scalar_To_Normalize'Last) then
- Report.Failed("Implicit initial value for local variable is a "
- & "value of the type");
- end if;
- end if;
- end if;
-
- if A_Number.all'Valid then
- Number := Integer( A_Number.all );
- if Imp_H.Default_For_Small_Number_Is_In_Range then
- if Global_Number /= Imp_H.Default_For_Small_Number then
- Report.Failed("Implicit initial value for number is not "
- & "the predicted value");
- end if;
- else
- if Integer( Global_Number ) in 0 .. Report.Ident_Int(Small_Last) then
- Report.Failed("Implicit initial value for number is a "
- & "value of the type");
- end if;
- end if;
- end if;
-
- end Heap_Check;
-
- procedure Package_Check is
- Value : Num;
- Number : Integer;
- begin
-
- if Global_Object'Valid then
- Value := STN_2_Num ( Global_Object );
- if Imp_H.Default_For_Scalar_To_Normalize_Is_In_Range then
- if Imp_H.Scalar_To_Normalize'Val(Value)
- /= Imp_H.Default_For_Scalar_To_Normalize then
- Report.Failed("Implicit initial value for local variable is not "
- & "the predicted value");
- end if;
- else
- if Value in 0 ..
- Imp_H.Scalar_To_Normalize'Pos(Imp_H.Scalar_To_Normalize'Last) then
- Report.Failed("Implicit initial value for local variable is a "
- & "value of the type");
- end if;
- end if;
- end if;
-
- if Global_Number'Valid then
- Number := Integer( Global_Number );
- if Imp_H.Default_For_Small_Number_Is_In_Range then
- if Global_Number /= Imp_H.Default_For_Small_Number then
- Report.Failed("Implicit initial value for number is not "
- & "the predicted value");
- end if;
- else
- if Integer( Global_Number ) in 0 .. Report.Ident_Int(Small_Last) then
- Report.Failed("Implicit initial value for number is a "
- & "value of the type");
- end if;
- end if;
- end if;
-
- Heap_Check( new Imp_H.Scalar_To_Normalize, new Imp_H.Small_Number );
-
- end Package_Check;
-
-end CXH1001_0;
-
------------------------------------------------------------------ CXH1001_1
-
-with Unchecked_Conversion;
-package CXH1001_0.CXH1001_1 is
-
- -- kill as many birds as possible with a single stone:
- -- embed a protected object in the body of a child package,
- -- checks the multiple compilation unit case,
- -- and part of the subcomponent case.
-
- protected Thingy is
- procedure Check_Embedded_Values;
- private
- Hidden_Object : Imp_H.Scalar_To_Normalize; -- not initialized
- Hidden_Number : Imp_H.Small_Number; -- not initialized
- end Thingy;
-
-end CXH1001_0.CXH1001_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body CXH1001_0.CXH1001_1 is
-
- Childs_Object : Imp_H.Scalar_To_Normalize; -- not initialized
-
- protected body Thingy is
-
- procedure Check_Embedded_Values is
- begin
-
- if Imp_H.Default_For_Scalar_To_Normalize_Is_In_Range then
- if Childs_Object /= Imp_H.Default_For_Scalar_To_Normalize then
- Report.Failed("Implicit initial value for child object is not "
- & "the predicted value");
- end if;
- elsif Childs_Object'Valid and then STN_2_Num( Childs_Object ) in 0 ..
- Imp_H.Scalar_To_Normalize'Pos(Imp_H.Scalar_To_Normalize'Last) then
- Report.Failed("Implicit initial value for child object is a "
- & "value of the type");
- end if;
-
- if Imp_H.Default_For_Scalar_To_Normalize_Is_In_Range then
- if Hidden_Object /= Imp_H.Default_For_Scalar_To_Normalize then
- Report.Failed("Implicit initial value for protected package object "
- & "is not the predicted value");
- end if;
- elsif Hidden_Object'Valid and then STN_2_Num( Hidden_Object ) in 0 ..
- Imp_H.Scalar_To_Normalize'Pos(Imp_H.Scalar_To_Normalize'Last) then
- Report.Failed("Implicit initial value for protected component "
- & "is a value of the type");
- end if;
-
- if Imp_H.Default_For_Small_Number_Is_In_Range then
- if Hidden_Number /= Imp_H.Default_For_Small_Number then
- Report.Failed("Implicit initial value for protected number "
- & "is not the predicted value");
- end if;
- elsif Hidden_Number'Valid and then Hidden_Number in
- 0 .. Imp_H.Small_Number(Report.Ident_Int(Small_Last)) then
- Report.Failed("Implicit initial value for protected number "
- & "is a value of the type");
- end if;
-
- end Check_Embedded_Values;
-
- end Thingy;
-
-end CXH1001_0.CXH1001_1;
-
-------------------------------------------------------------------- CXH1001
-
-with Impdef.Annex_H;
-with Report;
-with CXH1001_0.CXH1001_1;
-procedure CXH1001 is
-
- package Imp_H renames Impdef.Annex_H;
- use type CXH1001_0.Num;
-
- My_Object : Imp_H.Scalar_To_Normalize; -- not initialized
-
- Value : CXH1001_0.Num := CXH1001_0.STN_2_Num ( My_Object );
- -- My_Object is not initialized
-
- Parameter_Value : Imp_H.Scalar_To_Normalize
- := Imp_H.Scalar_To_Normalize'Last;
-
- type Structure is record -- not initialized
- Std_Int : Integer;
- Scalar : Imp_H.Scalar_To_Normalize;
- Num : CXH1001_0.Num;
- end record;
-
- S : Structure; -- not initialized
-
- procedure Bad_Code( Unassigned : out Imp_H.Scalar_To_Normalize ) is
- -- returns uninitialized OUT parameter
- begin
-
- if Report.Ident_Int( 0 ) = 1 then
- Report.Failed( "Nothing is something" );
- Unassigned := Imp_H.Scalar_To_Normalize'First;
- end if;
-
- end Bad_Code;
-
- procedure Check( V : CXH1001_0.Num; Message : String ) is
- begin
-
-
- if Imp_H.Default_For_Scalar_To_Normalize_Is_In_Range then
- if V /= Imp_H.Scalar_To_Normalize'Pos(
- Imp_H.Default_For_Scalar_To_Normalize) then
- Report.Failed(Message & ": Implicit initial value for object "
- & "is not the predicted value");
- end if;
- elsif V'Valid and then V in
- 0 .. Imp_H.Scalar_To_Normalize'Pos(Imp_H.Scalar_To_Normalize'Last) then
- Report.Failed(Message & ": Implicit initial value for object "
- & "is a value of the type");
- end if;
-
- end Check;
-
-begin -- Main test procedure.
-
- Report.Test ("CXH1001", "Check that the configuration pragma " &
- "Normalize_Scalars causes uninitialized scalar " &
- "objects to be set to a predictable value. " &
- "Check that multiple compilation units are " &
- "affected. Check for uninitialized scalar " &
- "objects that are subcomponents of composite " &
- "objects, unassigned out parameters, have been " &
- "allocated without an initial value, and are " &
- "stand alone." );
-
- CXH1001_0.Package_Check;
-
- if My_Object'Valid then
- Value := CXH1001_0.STN_2_Num ( My_Object ); -- My_Object not initialized
- end if;
- -- otherwise, we just leave Value uninitialized
-
- Check( Value, "main procedure variable" );
-
- Bad_Code( Parameter_Value );
-
- if Parameter_Value'Valid then
- Check( CXH1001_0.STN_2_Num ( Parameter_Value ), "Out parameter return" );
- end if;
-
- if S.Scalar'Valid then
- Check( CXH1001_0.STN_2_Num ( S.Scalar ), "Record component" );
- end if;
-
- CXH1001_0.CXH1001_1.Thingy.Check_Embedded_Values;
-
- Report.Result;
-
-end CXH1001;
diff --git a/gcc/testsuite/ada/acats/tests/cxh/cxh3001.a b/gcc/testsuite/ada/acats/tests/cxh/cxh3001.a
deleted file mode 100644
index 4ed41b4d06f..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxh/cxh3001.a
+++ /dev/null
@@ -1,243 +0,0 @@
--- CXH3001.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE
--- Check pragma Reviewable.
--- Check that pragma Reviewable is accepted as a configuration pragma.
---
--- TEST DESCRIPTION
--- The test requires that the configuration pragma Reviewable
--- be processed. The following package contains a simple "one of each
--- construct in the language" to check that the configuration pragma has
--- not disallowed some feature of the language. This test should generate
--- no errors.
---
--- APPLICABILITY CRITERIA:
--- This test is only applicable for a compiler attempting validation
--- for the Safety and Security Annex.
---
--- PASS/FAIL CRITERIA:
--- This test passes if it correctly compiles, executes, and reports PASS.
--- It fails if the pragma is rejected. The effect of the pragma should
--- be to produce a listing with information, including warnings, as
--- required in H.3.1. Specific form and contents of this listing are not
--- required by this test and are not part of the PASS/FAIL criteria.
---
--- SPECIAL REQUIREMENTS
--- The implementation must process a configuration pragma which is not
--- part of any Compilation Unit; the method employed is implementation
--- defined.
---
--- Pragma Reviewable requires that the implementation provide the
--- following information for the compilation units in this test:
---
--- o Where compiler-generated run-time checks remain (6)
---
--- o Identification of any construct with a language-defined check
--- that is recognized prior to runtime as certain to fail if
--- executed (7)
---
--- o For each reference to a scalar object, an identification of
--- the reference as either "known to be initialized,"
--- or "possibly uninitialized" (8)
---
--- o Where run-time support routines are implicitly invoked (9)
---
--- o An object code listing including: (10)
---
--- o Machine instructions with relative offsets (11)
---
--- o Where each data object is stored during its lifetime (12)
---
--- o Correspondence with the source program (13)
---
--- o Identification of each construct for which the implementation
--- detects the possibility of erroneous execution (14)
---
--- o For each subprogram, block, task or other construct implemented by
--- reserving and subsequently freezing an area of the run-time stack,
--- an identification of the length of the fixed-size portion of
--- the area and an indication of whether the non-fixed size portion
--- is reserved on the stack or in a dynamically managed storage
--- region (15)
---
---
--- CHANGE HISTORY:
--- 26 OCT 95 SAIC Initial version
--- 12 NOV 96 SAIC Revised for 2.1
--- 27 AUG 99 RLB Removed result dependence on uninitialized object.
--- 30 AUG 99 RLB Repaired the above.
---
---!
-
----------------------------- CONFIGURATION PRAGMAS -----------------------
-
-pragma Reviewable; -- OK
- -- configuration pragma
-
------------------------- END OF CONFIGURATION PRAGMAS --------------------
-
-
------------------------------------------------------------------ CXH3001_0
-
-package CXH3001_0 is
-
- type Enum is (Item,Stuff,Things);
-
- type Int is range 0..256;
-
- type Unt is mod 256;
-
- type Flt is digits 5;
-
- type Fix is delta 0.5 range -1.0..1.0;
-
- type Root(Disc: Enum) is tagged record
- I: Int; U:Unt;
- end record;
-
- type List is array(Unt) of Root(Stuff);
-
- type A_List is access List;
- type A_Proc is access procedure(R:Root);
-
- procedure P(R:Root);
-
- function F return A_Proc;
-
- protected PT is
- entry Set(Switch: Boolean);
- function Enquire return Boolean;
- private
- Toggle : Boolean;
- end PT;
-
- task TT is
- entry Release;
- end TT;
-
- Global_Variable : Boolean := False;
-
-end CXH3001_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-with Report;
-package body CXH3001_0 is
-
- procedure P(R:Root) is
- Warnable : Positive := 0; -- (7) -- OPTIONAL WARNING
- -- this would raise Constraint_Error if P were ever called, however
- -- this test never calls P.
- begin
- case R.Disc is
- when Item => Report.Comment("Got Item");
- when Stuff => Report.Comment("Got Stuff");
- when Things => Report.Comment("Got Things");
- end case;
- if Report.Ident_Int( Warnable ) = 0 then
- Global_Variable := not Global_Variable; -- (8) known to be initialized
- end if;
- end P;
-
- function F return A_Proc is
- begin
- return P'Access;
- end F;
-
- protected body PT is
-
- entry Set(Switch: Boolean) when True is
- begin
- Toggle := Switch;
- end Set;
-
- function Enquire return Boolean is
- begin
- return Toggle;
- end Enquire;
-
- end PT;
-
- task body TT is
- begin
- loop
- accept Release;
- exit when Global_Variable;
- end loop;
- end TT;
-
- -- (9) TT activation
-end CXH3001_0;
-
-------------------------------------------------------------------- CXH3001
-
-with Report;
-with CXH3001_0;
-procedure CXH3001 is
-begin
- Report.Test("CXH3001", "Check pragma Reviewable as a configuration pragma");
-
- Block: declare
- A_Truth : Boolean;
- Message : String := Report.Ident_Str( "Bad value encountered" );
- begin
- begin
- A_Truth := Report.Ident_Bool( True ) or A_Truth; -- (8) not initialized
- if not A_Truth then
- Report.Comment ("True or Uninit = False");
- A_Truth := Report.Ident_Bool (True);
- else
- A_Truth := Report.Ident_Bool (True);
- -- We do this separately on each branch in order to insure that a
- -- clever optimizer can find out little about this value. Ident_Bool
- -- is supposed to be opaque to any optimizer.
- end if;
- exception
- when Constraint_Error | Program_Error =>
- -- Possible results of accessing an uninitialized object.
- A_Truth := Report.Ident_Bool (True);
- end;
-
- CXH3001_0.PT.Set( A_Truth );
-
- CXH3001_0.Global_Variable := A_Truth;
-
- CXH3001_0.TT.Release; -- (9) rendezvous with TT
-
- while CXH3001_0.TT'Callable loop
- delay 1.0; -- wait for TT to become non-callable
- end loop;
-
- if not CXH3001_0.PT.Enquire
- or not CXH3001_0.Global_Variable
- or CXH3001_0.TT'Callable then
- Report.Failed(Message);
- end if;
-
- end Block;
-
- Report.Result;
-end CXH3001;
diff --git a/gcc/testsuite/ada/acats/tests/cxh/cxh3002.a b/gcc/testsuite/ada/acats/tests/cxh/cxh3002.a
deleted file mode 100644
index 5e9f7b9cc9e..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxh/cxh3002.a
+++ /dev/null
@@ -1,343 +0,0 @@
--- CXH3002.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE
--- Check that pragma Inspection_Point is allowed whereever a declarative
--- item or statement is allowed. Check that pragma Inspection_Point may
--- have zero or more arguments. Check that the execution of pragma
--- Inspection_Point has no effect.
---
--- TEST DESCRIPTION
--- Check pragma Inspection_Point applied to:
--- A no objects,
--- B one object,
--- C multiple objects.
--- Check pragma Inspection_Point applied to:
--- D Enumeration type objects,
--- E Integer type objects (signed and unsigned),
--- F access type objects,
--- G Floating Point type objects,
--- H Fixed point type objects,
--- I array type objects,
--- J record type objects,
--- K tagged type objects,
--- L protected type objects,
--- M controlled type objects,
--- N task type objects.
--- Check pragma Inspection_Point applied in:
--- O declarations (package, procedure)
--- P statements (incl package elaboration)
--- Q subprogram (procedure, function, finalization)
--- R package
--- S specification
--- T body (PO entry, task body, loop body, accept body, select body)
--- U task
--- V protected object
---
---
--- APPLICABILITY CRITERIA:
--- This test is only applicable for a compiler attempting validation
--- for the Safety and Security Annex.
---
---
--- CHANGE HISTORY:
--- 26 OCT 95 SAIC Initial version
--- 12 NOV 96 SAIC Revised for 2.1
---
---!
-
------------------------------------------------------------------ CXH3002_0
-
-package CXH3002_0 is
-
- type Enum is (Item,Stuff,Things);
-
- type Int is range 0..256;
-
- type Unt is mod 256;
-
- type Flt is digits 5;
-
- type Fix is delta 0.5 range -1.0..1.0;
-
- type Root(Disc: Enum) is record
- I: Int;
- U: Unt;
- end record;
-
- type List is array(Unt) of Root(Stuff);
-
- type A_List is access all List;
- type A_Proc is access procedure(R:Root);
-
- procedure Proc(R:Root);
- function Func return A_Proc;
-
- protected type PT is
- entry Prot_Entry(Switch: Boolean);
- private
- Toggle : Boolean := False;
- end PT;
-
- task type TT is
- entry Task_Entry(Items: in A_List);
- end TT;
-
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- pragma Inspection_Point; -- AORS
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
-
-end CXH3002_0;
-
------------------------------------------------------------------ CXH3002_1
-
-with Ada.Finalization;
-package CXH3002_0.CXH3002_1 is
-
- type Final is new Ada.Finalization.Controlled with
- record
- Value : Natural;
- end record;
-
- procedure Initialize( F: in out Final );
- procedure Adjust( F: in out Final );
- procedure Finalize( F: in out Final );
-
-end CXH3002_0.CXH3002_1;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- CXH3002_0
-
-package body CXH3002_0 is
-
- Global_Variable : Character := 'A';
-
- procedure Proc(R:Root) is
- begin
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---=====
- pragma Inspection_Point( Global_Variable ); -- BDPQT
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---=====
- case R.Disc is
- when Item => Global_Variable := 'I';
- when Stuff => Global_Variable := 'S';
- when Things => Global_Variable := 'T';
- end case;
- end Proc;
-
- function Func return A_Proc is
- begin
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- pragma Inspection_Point; -- APQT
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- return Proc'Access;
- end Func;
-
- protected body PT is
- entry Prot_Entry(Switch: Boolean) when True is
- begin
- Toggle := Switch;
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- pragma Inspection_Point; -- APVT
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- end Prot_Entry;
- end PT;
-
- task body TT is
- List_Copy : A_List;
- begin
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- pragma Inspection_Point; -- APUT
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- loop
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- pragma Inspection_Point; -- APUT
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- select
- accept Task_Entry(Items: in A_List) do
- List_Copy := Items;
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---=====
- pragma Inspection_Point( List_Copy ); -- BFPUT
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---=====
- end Task_Entry;
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- pragma Inspection_Point; -- APUT
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- or terminate;
- end select;
- end loop;
- end TT;
-
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---=====
- pragma Inspection_Point; -- ARTO
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---=====
-
-end CXH3002_0;
-
--- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- CXH3002_1
-
-with Report;
-package body CXH3002_0.CXH3002_1 is
-
- Embedded_Final_Object : Final
- := (Ada.Finalization.Controlled with Value => 1);
- -- attempt to call Initialize here would P_E!
-
- procedure Initialize( F: in out Final ) is
- begin
- F.Value := 1;
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---=====
- pragma Inspection_Point( Embedded_Final_Object ); -- BKQP
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---=====
- end Initialize;
-
- procedure Adjust( F: in out Final ) is
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---=====
- pragma Inspection_Point; -- AQO
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---=====
- begin
- F.Value := 2;
- end Adjust;
-
- procedure Finalize( F: in out Final ) is
- begin
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- pragma Inspection_Point; -- AQP
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- if F.Value not in 1..10 then
- Report.Failed("Bad value in controlled object at finalization");
- end if;
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- pragma Inspection_Point; -- AQP
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---====
- end Finalize;
-
-begin
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---======
- pragma Inspection_Point( Embedded_Final_Object ); -- BKRTP
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---======
- null;
-end CXH3002_0.CXH3002_1;
-
-------------------------------------------------------------------- CXH3002
-
-with Report;
-with CXH3002_0.CXH3002_1;
-procedure CXH3002 is
-
- use type CXH3002_0.Enum, CXH3002_0.Int, CXH3002_0.Unt, CXH3002_0.Flt,
- CXH3002_0.Fix, CXH3002_0.Root;
-
- Main_Enum : CXH3002_0.Enum := CXH3002_0.Item;
- Main_Int : CXH3002_0.Int;
- Main_Unt : CXH3002_0.Unt;
- Main_Flt : CXH3002_0.Flt;
- Main_Fix : CXH3002_0.Fix;
- Main_Rec : CXH3002_0.Root(CXH3002_0.Stuff)
- := (CXH3002_0.Stuff, I => 1, U => 2);
-
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---=====
- pragma Inspection_Point( Main_Rec ); -- BJQO
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---=====
-
- Main_List : CXH3002_0.List := ( others => Main_Rec );
-
- Main_A_List : CXH3002_0.A_List := new CXH3002_0.List'( others => Main_Rec );
- Main_A_Proc : CXH3002_0.A_Proc := CXH3002_0.Func;
- -- CXH3002_0.Proc'Access
- Main_PT : CXH3002_0.PT;
- Main_TT : CXH3002_0.TT;
-
- type Test_Range is (First, Second);
-
- procedure Assert( Truth : Boolean; Message : String ) is
- begin
- if not Truth then
- Report.Failed( "Unexpected value found in " & Message );
- end if;
- end Assert;
-
-begin -- Main test procedure.
-
- Report.Test ("CXH3002", "Check pragma Inspection_Point" );
-
- Enclosure:declare
- Main_Final : CXH3002_0.CXH3002_1.Final;
- Xtra_Final : CXH3002_0.CXH3002_1.Final;
- begin
- for Test_Case in Test_Range loop
-
-
- case Test_Case is
- when First =>
- Main_Final.Value := 5;
- Xtra_Final := Main_Final; -- call Adjust
- Main_Enum := CXH3002_0.Things;
- Main_Int := CXH3002_0.Int'First;
- Main_Unt := CXH3002_0.Unt'Last;
- Main_Flt := 3.14;
- Main_Fix := 0.5;
- Main_Rec := (CXH3002_0.Stuff, I => 3, U => 4);
- Main_List(Main_Unt) := Main_Rec;
- Main_A_List(CXH3002_0.Unt'First) := (CXH3002_0.Stuff, I => 5, U => 6);
- Main_A_Proc( Main_A_List(2) );
- Main_PT.Prot_Entry(True);
- Main_TT.Task_Entry( null );
-
- when Second =>
- Assert( Main_Final.Value = 5, "Main_Final" );
- Assert( Xtra_Final.Value = 2, "Xtra_Final" );
- Assert( Main_Enum = CXH3002_0.Things, "Main_Enum" );
- Assert( Main_Int = CXH3002_0.Int'First, "Main_Int" );
- Assert( Main_Unt = CXH3002_0.Unt'Last, "Main_Unt" );
- Assert( Main_Flt in 3.0..3.5, "Main_Flt" );
- Assert( Main_Fix = 0.5, "Main_Fix" );
- Assert( Main_Rec = (CXH3002_0.Stuff, I => 3, U => 4), "Main_Rec" );
- Assert( Main_List(Main_Unt) = Main_Rec, "Main_List" );
- Assert( Main_A_List(CXH3002_0.Unt'First)
- = (CXH3002_0.Stuff, I => 5, U => 6), "Main_A_List" );
-
- end case;
-
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---==
- pragma Inspection_Point( -- CQP
- Main_Final, -- M
- Main_Enum, -- D
- Main_Int, -- E
- Main_Unt, -- E
- Main_Flt, -- G
- Main_Fix, -- H
- Main_Rec, -- J
- Main_List, -- I
- Main_A_List, -- F
- Main_A_Proc, -- F
- Main_PT, -- L
- Main_TT ); -- N
- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- ---==
-
- end loop;
- end Enclosure;
-
- Report.Result;
-
-end CXH3002;
diff --git a/gcc/testsuite/ada/acats/tests/cxh/cxh30030.a b/gcc/testsuite/ada/acats/tests/cxh/cxh30030.a
deleted file mode 100644
index 1b1399c598d..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxh/cxh30030.a
+++ /dev/null
@@ -1,54 +0,0 @@
--- CXH30030.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE
--- See CHX30031.AM
---
--- TEST DESCRIPTION
--- See CHX30031.AM
---
--- TEST FILES:
--- The following files comprise this test:
---
--- => CXH30030.A
--- CXH30031.AM
---
--- APPLICABILITY CRITERIA:
--- See CHX30031.AM
---
--- SPECIAL REQUIREMENTS
--- See CHX30031.AM
---
--- CHANGE HISTORY:
--- 26 OCT 95 SAIC Initial version for 2.1
--- 07 JUN 96 SAIC Revised by reviewer request, split to multifile
---
---!
-
- pragma Reviewable;
-
--- This test requires that this configuration pragma be applied to all
--- following compilation units in the environment; specifically the ones
--- in file CXH30031.AM
diff --git a/gcc/testsuite/ada/acats/tests/l/la140010.a b/gcc/testsuite/ada/acats/tests/l/la140010.a
deleted file mode 100644
index 58ba661958e..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140010.a
+++ /dev/null
@@ -1,51 +0,0 @@
--- LA140010.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140011.AM.
---
--- TEST DESCRIPTION:
--- See LA140011.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140011.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140010.A
--- LA140011.AM
--- LA140012.A
---
--- PASS/FAIL CRITERIA:
--- See LA140011.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-package LA140010_0 is
- TC_Var : integer := 100;
-end LA140010_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140012.a b/gcc/testsuite/ada/acats/tests/l/la140012.a
deleted file mode 100644
index 1dc8a7c9273..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140012.a
+++ /dev/null
@@ -1,55 +0,0 @@
--- LA140012.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140011.AM.
---
--- TEST DESCRIPTION:
--- See LA140011.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140011.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140010.A
--- LA140011.AM
--- -> LA140012.A
---
--- PASS/FAIL CRITERIA:
--- See LA140011.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007I baseline version
--- 08 MAY 95 SAIC Initial version
--- 16 NOV 96 SAIC Modified prologue to conform to standards.
--- 07 DEC 96 SAIC Modified prologue to reflect new test
--- file organization.
---
---!
-
-package LA140010_0 is
- TC_Var : integer := -10;
-end LA140010_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140020.a b/gcc/testsuite/ada/acats/tests/l/la140020.a
deleted file mode 100644
index 6b49ca2d11e..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140020.a
+++ /dev/null
@@ -1,60 +0,0 @@
--- LA140020.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140021.AM.
---
--- TEST DESCRIPTION:
--- See LA140021.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140021.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140020.A
--- LA140021.AM
--- LA140022.A
---
--- PASS/FAIL CRITERIA:
--- See LA140021.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-package LA140020_0 is
- procedure P (TC_change : out integer);
-
- TC_Var : integer := 100;
-end LA140020_0;
-
-package body LA140020_0 is
- procedure P (TC_change : out integer) is
- begin
- TC_change := TC_Var;
- end P;
-end LA140020_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140022.a b/gcc/testsuite/ada/acats/tests/l/la140022.a
deleted file mode 100644
index 75a4c4483e6..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140022.a
+++ /dev/null
@@ -1,66 +0,0 @@
--- LA140022.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140021.AM.
---
--- TEST DESCRIPTION:
--- See LA140021.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140021.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140020.A
--- LA140021.AM
--- -> LA140022.A
---
--- PASS/FAIL CRITERIA:
--- See LA140021.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007J baseline version
--- 08 MAY 95 SAIC Initial version
--- 16 NOV 96 SAIC Modified prologue to conform to coding
--- conventions.
--- 07 DEC 96 SAIC Modified prologue to reflect new test
--- file organization. Added body for unit to
--- allow automatic recompilation.
---
---!
-
-package LA140020_0 is
- procedure P (TC_change : out integer);
-
- TC_Var : integer := -10;
-end LA140020_0;
-
-package body LA140020_0 is
- procedure P (TC_change : out integer) is
- begin
- TC_change := TC_Var;
- end P;
-end LA140020_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140030.a b/gcc/testsuite/ada/acats/tests/l/la140030.a
deleted file mode 100644
index 82d97e787ff..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140030.a
+++ /dev/null
@@ -1,57 +0,0 @@
--- LA140030.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140032.AM.
---
--- TEST DESCRIPTION:
--- See LA140032.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140032.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- => LA140030.A
--- LA140031.A
--- LA140032.AM
--- LA140033.A
---
--- PASS/FAIL CRITERIA:
--- See LA140032.AM.
---
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007K baseline version
--- 09 MAY 95 SAIC Initial version
--- 16 NOV 96 SAIC Modified prologue to conform to coding
--- conventions.
---
---!
-
-package LA140030 is
- TC_named_number : constant := 100;
- TC_Var : integer := 100;
-end LA140030;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140031.a b/gcc/testsuite/ada/acats/tests/l/la140031.a
deleted file mode 100644
index 250162b28f1..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140031.a
+++ /dev/null
@@ -1,66 +0,0 @@
--- LA140031.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140032.AM.
---
--- TEST DESCRIPTION:
--- See LA140032.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140032.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140030.A
--- => LA140031.A
--- LA140032.AM
--- LA140033.A
---
--- PASS/FAIL CRITERIA:
--- See LA140032.AM.
---
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007K baseline version
--- 09 MAY 95 SAIC Initial version
--- 16 NOV 96 SAIC Modified prologue to conform to coding
--- conventions.
---
---!
-
-package LA140031 is
- procedure P (TC_Change : out integer);
-end LA140031;
-
-with LA140030; -- when LA140030 is revised and recompiled,
- -- this semantic dependency has to be handled
-
-package body LA140031 is
- procedure P (TC_Change : out integer) is
- begin
- TC_Change := LA140030.TC_Var;
- end P;
-end LA140031;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140033.a b/gcc/testsuite/ada/acats/tests/l/la140033.a
deleted file mode 100644
index 9d7f13366c5..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140033.a
+++ /dev/null
@@ -1,56 +0,0 @@
--- LA140033.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140032.AM.
---
--- TEST DESCRIPTION:
--- See LA140032.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140032.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140030.A
--- LA140031.A
--- LA140032.AM
--- => LA140033.A
---
--- PASS/FAIL CRITERIA:
--- See LA140032.AM.
---
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007K baseline version
--- 09 MAY 95 SAIC Initial version
--- 16 NOV 96 SAIC Modified prologue to conform to coding
--- conventions.
---
---!
-
-package LA140030 is
- TC_Var : integer := -10;
-end LA140030;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140040.a b/gcc/testsuite/ada/acats/tests/l/la140040.a
deleted file mode 100644
index eef6d987457..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140040.a
+++ /dev/null
@@ -1,52 +0,0 @@
--- LA140040.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140041.AM.
---
--- TEST DESCRIPTION:
--- See LA140041.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140041.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140040.A
--- LA140041.AM
--- LA140042.A
---
--- PASS/FAIL CRITERIA:
--- See LA140041.AM.
---
--- CHANGE HISTORY:
--- 09 MAY 95 SAIC Initial version
--- 10 DEC 96 SAIC Reorganized to permit automatic recompilation.
---
---!
-
-package LA14004_0 is
- TC_Var : integer := 100;
-end LA14004_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140042.a b/gcc/testsuite/ada/acats/tests/l/la140042.a
deleted file mode 100644
index bb4ba6c09b3..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140042.a
+++ /dev/null
@@ -1,53 +0,0 @@
--- LA140042.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140041.AM.
---
--- TEST DESCRIPTION:
--- See LA140041.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140041.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140040.A
--- LA140041.AM
--- -> LA140042.A
---
--- PASS/FAIL CRITERIA:
--- See LA140041.AM.
---
--- CHANGE HISTORY:
--- 09 MAY 95 SAIC Initial version
--- 10 DEC 96 SAIC Reorganized to permit automatic recompilation.
---
---!
-
-package LA14004_0 is
- Small_array : array (1..15) of integer;
- TC_Var : integer := -10;
-end LA14004_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140050.a b/gcc/testsuite/ada/acats/tests/l/la140050.a
deleted file mode 100644
index 542c1ffddbe..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140050.a
+++ /dev/null
@@ -1,60 +0,0 @@
--- LA140050.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140052.AM.
---
--- TEST DESCRIPTION:
--- See LA140052.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140052.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140050.A
--- LA140051.A
--- LA140052.AM
--- LA140053.A
---
--- PASS/FAIL CRITERIA:
--- See LA140052.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-generic
- hi : integer;
- lo : integer;
- type flt is digits <>;
-package LA14005_0 is
- TC_var : flt := flt(lo);
- type gen_flt is new flt range flt(lo)..flt(hi);
- max : integer := hi;
- min : integer := lo;
- avg : integer := (hi + lo)/ (integer(2.0));
-end LA14005_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140051.a b/gcc/testsuite/ada/acats/tests/l/la140051.a
deleted file mode 100644
index 6af550a3a3e..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140051.a
+++ /dev/null
@@ -1,56 +0,0 @@
--- LA140051.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140052.AM.
---
--- TEST DESCRIPTION:
--- See LA140052.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140052.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140050.A
--- -> LA140051.A
--- LA140052.AM
--- LA140053.A
---
--- PASS/FAIL CRITERIA:
--- See LA140052.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-with LA14005_0;
-generic
- with package types is new LA14005_0 (<>);
-package LA14005_1 is
- TC_constant_flt : constant types.gen_flt := types.gen_flt(types.avg);
- function return_flt return types.gen_flt;
-end LA14005_1;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140053.a b/gcc/testsuite/ada/acats/tests/l/la140053.a
deleted file mode 100644
index 406b3abb082..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140053.a
+++ /dev/null
@@ -1,60 +0,0 @@
--- LA140053.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140052.AM.
---
--- TEST DESCRIPTION:
--- See LA140052.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140052.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140050.A
--- LA140051.A
--- LA140052.AM
--- -> LA140053.A
---
--- PASS/FAIL CRITERIA:
--- See LA140052.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008I baseline version
--- 09 MAY 95 SAIC Initial version
--- 07 DEC 96 SAIC Modified prologue to reflect new test
--- file organization.
---
---!
-
-with LA14005_0;
-generic
- with package types is new LA14005_0 (<>);
-package LA14005_1 is
- TC_constant_flt : constant
- types.gen_flt := types.gen_flt(types.min); --changed line
- function return_flt return types.gen_flt;
-end LA14005_1;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140060.a b/gcc/testsuite/ada/acats/tests/l/la140060.a
deleted file mode 100644
index 4f54da1e630..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140060.a
+++ /dev/null
@@ -1,54 +0,0 @@
--- LA140060.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140062.AM.
---
--- TEST DESCRIPTION:
--- See LA140062.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140062.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140060.A
--- LA140061.A
--- LA140062.AM
--- LA140063.A
---
--- PASS/FAIL CRITERIA:
--- See LA140062.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-package LA14006_types is
- type t_type is tagged record
- f : integer := 87;
- end record;
-end LA14006_types;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140061.a b/gcc/testsuite/ada/acats/tests/l/la140061.a
deleted file mode 100644
index 40ff151cb0d..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140061.a
+++ /dev/null
@@ -1,66 +0,0 @@
--- LA140061.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140062.AM.
---
--- TEST DESCRIPTION:
--- See LA140062.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140062.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140060.A
--- -> LA140061.A
--- LA140062.AM
--- LA140063.A
---
--- PASS/FAIL CRITERIA:
--- See LA140062.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-with LA14006_types;
-use LA14006_types;
-generic
- type t is new t_type with private;
-package LA14006_0 is
-
- type T2 is new t with record
- g : integer := 100;
- end record;
-
- TC_var : T2;
-
-private
- type type_t is new t with record
- g2 : integer := 99;
- end record;
-end LA14006_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140063.a b/gcc/testsuite/ada/acats/tests/l/la140063.a
deleted file mode 100644
index e4e6457d0e3..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140063.a
+++ /dev/null
@@ -1,70 +0,0 @@
--- LA140063.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140062.AM.
---
--- TEST DESCRIPTION:
--- See LA140062.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140062.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140060.A
--- LA140061.A
--- LA140062.AM
--- -> LA140063.A
---
--- PASS/FAIL CRITERIA:
--- See LA140062.AM.
---
--- CHANGE HISTORY:
--- 09 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified unit names and prologue to conform
--- to coding conventions.
--- 07 DEC 96 SAIC Modified prologue to reflect new test
--- file organization.
---
---!
-
-with LA14006_types;
-use LA14006_types;
-generic
- type t is new t_type with private;
-package LA14006_0 is
- type T2 is new t with record
- g : integer := -10;
- end record;
-
- TC_var : T2;
- Other_var : integer := 12;
-
- private
- type type_t is new t with record
- g2 : integer := 88;
- end record;
-end LA14006_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140070.a b/gcc/testsuite/ada/acats/tests/l/la140070.a
deleted file mode 100644
index e3c864ac467..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140070.a
+++ /dev/null
@@ -1,62 +0,0 @@
--- LA140070.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140072.AM.
---
--- TEST DESCRIPTION:
--- See LA140072.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140072.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140070.A
--- LA140071.A
--- LA140072.AM
--- LA140073.A
---
--- PASS/FAIL CRITERIA:
--- See LA140072.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007L baseline version
--- 12 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-package LA14007_0 is -- this will be modified and recompiled
- type mod_16 is new integer;
- type rec is tagged record
- f: mod_16 := 12;
- end record;
- type t_rec is new rec with record
- g : mod_16 := -2;
- end record;
- TC_Var : t_rec;
-end LA14007_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140071.a b/gcc/testsuite/ada/acats/tests/l/la140071.a
deleted file mode 100644
index e895b874479..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140071.a
+++ /dev/null
@@ -1,72 +0,0 @@
--- LA140071.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140072.AM.
---
--- TEST DESCRIPTION:
--- See LA140072.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140072.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140070.A
--- -> LA140071.A
--- LA140072.AM
--- LA140073.A
---
--- PASS/FAIL CRITERIA:
--- See LA140072.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007L baseline version
--- 12 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform to coding
--- conventions. Deleted extraneous procedure
--- specification.
---
---!
-
-procedure LA14007_1 (TC_Parent : in out integer);
-
- --================================================================--
-
-procedure LA14007_1 (TC_Parent : in out integer) is
- procedure LA14007_2 (TC_Local : in out integer) is separate;
-begin
- LA14007_2 (TC_Parent);
-end LA14007_1;
-
- --================================================================--
-
-with LA14007_0;
-
-separate (LA14007_1)
-procedure LA14007_2 (TC_Local : in out integer) is
-begin
- TC_Local := integer (LA14007_0.TC_Var.f);
-end LA14007_2;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140073.a b/gcc/testsuite/ada/acats/tests/l/la140073.a
deleted file mode 100644
index 01e07151938..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140073.a
+++ /dev/null
@@ -1,63 +0,0 @@
--- LA140073.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140072.AM.
---
--- TEST DESCRIPTION:
--- See LA140072.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140072.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140070.A
--- LA140071.A
--- LA140072.AM
--- -> LA140073.A
---
--- PASS/FAIL CRITERIA:
--- See LA140072.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007L baseline version
--- 12 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-package LA14007_0 is -- this is the corrected version
- extra_integer : integer;
- type mod_16 is new integer;
- type rec is tagged record
- f: mod_16 := 3;
- end record;
- type t_rec is new rec with record
- null;
- end record;
- TC_Var : t_rec;
-end LA14007_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140080.a b/gcc/testsuite/ada/acats/tests/l/la140080.a
deleted file mode 100644
index 506c182512c..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140080.a
+++ /dev/null
@@ -1,52 +0,0 @@
--- LA140080.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140082.AM.
---
--- TEST DESCRIPTION:
--- See LA140082.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140082.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140080.A
--- LA140081.A
--- LA140082.AM
--- LA140083.A
---
--- PASS/FAIL CRITERIA:
--- See LA140082.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007M baseline version
--- 25 MAY 95 SAIC Initial version
--- 10 DEC 96 SAIC Reorganized to permit automatic recompilation.
---
---!
-
-function LA14008_0 return integer;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140081.a b/gcc/testsuite/ada/acats/tests/l/la140081.a
deleted file mode 100644
index b800da79916..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140081.a
+++ /dev/null
@@ -1,63 +0,0 @@
--- LA140081.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140082.AM.
---
--- TEST DESCRIPTION:
--- See LA140082.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140082.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140080.A
--- -> LA140081.A
--- LA140082.AM
--- LA140083.A
---
--- PASS/FAIL CRITERIA:
--- See LA140082.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007M baseline version
--- 25 MAY 95 SAIC Initial version
--- 10 DEC 96 SAIC Reorganized to permit automatic recompilation.
---
---!
-
-function LA14008_0 return integer is
- TC_local : integer := 0;
- TC_var : integer := 100;
-
- function LA14008_1 return integer is separate;
- -- when LA14008_0 is revised and recompiled,
- -- this semantic dependency has to be
- -- handled
-begin
- TC_local := LA14008_1;
- return TC_local;
-end LA14008_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140083.a b/gcc/testsuite/ada/acats/tests/l/la140083.a
deleted file mode 100644
index cad1cf311d5..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140083.a
+++ /dev/null
@@ -1,61 +0,0 @@
--- LA140083.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140082.AM.
---
--- TEST DESCRIPTION:
--- See LA140082.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140082.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140080.A
--- LA140081.A
--- LA140082.AM
--- -> LA140083.A
---
--- PASS/FAIL CRITERIA:
--- See LA140082.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007M baseline version
--- 25 MAY 95 SAIC Initial version
--- 10 DEC 96 SAIC Reorganized to permit automatic recompilation.
---
-
-function LA14008_0 return integer is
- Another_var : integer := 1000;
- TC_local : integer := 0;
- TC_var : integer := -10;
-
- function LA14008_1 return integer is separate;
-
-begin
- TC_local := LA14008_1;
- return TC_local;
-end LA14008_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140090.a b/gcc/testsuite/ada/acats/tests/l/la140090.a
deleted file mode 100644
index d2e02c71484..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140090.a
+++ /dev/null
@@ -1,60 +0,0 @@
--- LA140090.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140092.AM.
---
--- TEST DESCRIPTION:
--- See LA140092.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140092.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140090.A
--- LA140091.A
--- LA140092.AM
--- LA140093.A
---
--- PASS/FAIL CRITERIA:
--- See LA140092.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007N baseline version
--- 25 MAY 95 SAIC Initial version
--- 12 DEC 96 SAIC Reorganized to permit automatic recompilation.
---
---!
-
-package LA14009_0 is
-
- package LA14009_1 is
-
- procedure P (TC_local : in out integer);
-
- end LA14009_1;
-
-end LA14009_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140091.a b/gcc/testsuite/ada/acats/tests/l/la140091.a
deleted file mode 100644
index 550b908fbb4..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140091.a
+++ /dev/null
@@ -1,60 +0,0 @@
--- LA140091.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140092.AM.
---
--- TEST DESCRIPTION:
--- See LA140092.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140092.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140090.A
--- -> LA140091.A
--- LA140092.AM
--- LA140093.A
---
--- PASS/FAIL CRITERIA:
--- See LA140092.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007N baseline version
--- 25 MAY 95 SAIC Initial version
--- 12 DEC 96 SAIC Reorganized to permit automatic recompilation.
---
---!
-
-package body LA14009_0 is
- TC_var : integer := 100;
-
- package body LA14009_1 is separate;
- -- when LA14009_0 is revised and recompiled,
- -- this semantic dependency has to be
- -- handled
-
-end LA14009_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140093.a b/gcc/testsuite/ada/acats/tests/l/la140093.a
deleted file mode 100644
index 375570675ff..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140093.a
+++ /dev/null
@@ -1,59 +0,0 @@
--- LA140093.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140092.AM.
---
--- TEST DESCRIPTION:
--- See LA140092.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140092.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140090.A
--- LA140091.A
--- LA140092.AM
--- -> LA140093.A
---
--- PASS/FAIL CRITERIA:
--- See LA140092.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007N baseline version
--- 25 MAY 95 SAIC Initial version
--- 12 DEC 96 SAIC Reorganized to permit automatic recompilation.
---
---!
-
-package body LA14009_0 is
- New_TC_var : integer := 50;
- Dummy_array : array (1..100) of boolean := (others => False);
- TC_var : constant integer := -10;
-
- package body LA14009_1 is separate;
-
-end LA14009_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140100.a b/gcc/testsuite/ada/acats/tests/l/la140100.a
deleted file mode 100644
index dfa78696628..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140100.a
+++ /dev/null
@@ -1,56 +0,0 @@
--- LA140100.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140102.AM.
---
--- TEST DESCRIPTION:
--- See LA140102.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140102.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140100.A
--- LA140101.A
--- LA140102.AM
--- LA140103.A
---
--- PASS/FAIL CRITERIA:
--- See LA140102.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008O baseline version
--- 29 JUN 95 SAIC Initial version
--- 29 FEB 96 SAIC First revision after review
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-package LA14010_0 is
- delta_v : integer := 1;
-end LA14010_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140101.a b/gcc/testsuite/ada/acats/tests/l/la140101.a
deleted file mode 100644
index 332f5ff20b5..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140101.a
+++ /dev/null
@@ -1,89 +0,0 @@
--- LA140101.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140102.AM.
---
--- TEST DESCRIPTION:
--- See LA140102.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140102.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140100.A
--- -> LA140101.A
--- LA140102.AM
--- LA140103.A
---
--- PASS/FAIL CRITERIA:
--- See LA140102.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008O baseline version
--- 29 JUN 95 SAIC Initial version
--- 29 FEB 96 SAIC First revision after review
--- 17 NOV 96 SAIC Modified prologue to conform to coding
--- conventions. Changed task to task type.
---
---!
-
-generic
- type scalar is range <>;
-package LA14010_1 is
- procedure inc (param : in out scalar);
-end LA14010_1;
-
-with LA14010_0;
-use LA14010_0;
-
-package body LA14010_1 is
- procedure inc (param : in out scalar) is
- begin
- for i in 1..delta_v loop
- param := param + 1;
- end loop;
- end inc;
-
- task type inc_task is
- entry increment (param : in out scalar);
- end inc_task;
-
- task body inc_task is separate;
-end LA14010_1;
-
-
-separate (LA14010_1)
-
-task body inc_task is
- static_zero : integer := 0;
-begin
- accept increment (param : in out scalar) do
- static_zero := LA14010_0.delta_v + static_zero;
- static_zero := static_zero - LA14010_0.delta_v;
- inc (param);
- end increment;
-end inc_task;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140103.a b/gcc/testsuite/ada/acats/tests/l/la140103.a
deleted file mode 100644
index a16d7debfff..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140103.a
+++ /dev/null
@@ -1,58 +0,0 @@
--- LA140103.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140102.AM.
---
--- TEST DESCRIPTION:
--- See LA140102.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140102.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140100.A
--- LA140101.A
--- LA140102.AM
--- -> LA140103.A
---
--- PASS/FAIL CRITERIA:
--- See LA140102.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008O baseline version
--- 29 JUN 95 SAIC Initial version
--- 29 FEB 96 SAIC First revision after review
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-package LA14010_0 is
- New_var : integer := 100;
- Local_array : array (1..51) of integer;
- delta_v : constant integer := 10;
-end LA14010_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140110.a b/gcc/testsuite/ada/acats/tests/l/la140110.a
deleted file mode 100644
index 3f69c92a9ec..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140110.a
+++ /dev/null
@@ -1,64 +0,0 @@
--- LA140110.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140112.AM.
---
--- TEST DESCRIPTION:
--- See LA140112.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140112.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140110.A
--- LA140111.A
--- LA140112.AM
--- LA140113.A
---
--- PASS/FAIL CRITERIA:
--- See LA140112.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007P baseline version
--- 25 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-
-procedure LA14011_0 (Change_this : in out integer);
-
-
-procedure LA14011_0 (Change_this : in out integer) is
-begin
- if Change_this = 10 then
- Change_this := 100;
- else
- Change_this := 50;
- end if;
-end LA14011_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140111.a b/gcc/testsuite/ada/acats/tests/l/la140111.a
deleted file mode 100644
index c3a1cf1a18f..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140111.a
+++ /dev/null
@@ -1,62 +0,0 @@
--- LA140111.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140112.AM.
---
--- TEST DESCRIPTION:
--- See LA140112.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140112.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140110.A
--- -> LA140111.A
--- LA140112.AM
--- LA140113.A
---
--- PASS/FAIL CRITERIA:
--- See LA140112.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007P baseline version
--- 25 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-
-with LA14011_0;
-
-procedure LA14011_1 (Change_this1 : in out integer);
-
-
-procedure LA14011_1 (Change_this1 : in out integer) is
-begin
- LA14011_0(Change_this1);
-end LA14011_1;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140113.a b/gcc/testsuite/ada/acats/tests/l/la140113.a
deleted file mode 100644
index 8dd9683e353..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140113.a
+++ /dev/null
@@ -1,59 +0,0 @@
--- LA140113.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140112.AM.
---
--- TEST DESCRIPTION:
--- See LA140112.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140112.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140110.A
--- LA140111.A
--- LA140112.AM
--- -> LA140113.A
---
--- PASS/FAIL CRITERIA:
--- See LA140112.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007P baseline version
--- 25 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-procedure LA14011_0 (Change_this : in out integer);
-
-
-procedure LA14011_0 (Change_this : in out integer) is
-begin
- Change_this := -Change_this;
-end LA14011_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140120.a b/gcc/testsuite/ada/acats/tests/l/la140120.a
deleted file mode 100644
index d21525ed470..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140120.a
+++ /dev/null
@@ -1,63 +0,0 @@
--- LA140120.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140122.AM.
---
--- TEST DESCRIPTION:
--- See LA140122.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140122.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140120.A
--- LA140121.A
--- LA140122.AM
--- LA140123.A
---
--- PASS/FAIL CRITERIA:
--- See LA140122.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007Q baseline version
--- 25 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-function LA14012_0 (Parm_1 : integer) return integer;
-
-
-function LA14012_0 (Parm_1 : integer) return integer is
-begin
- if Parm_1 >= 0 then
- return 100;
- else
- return 200;
- end if;
-end LA14012_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140121.a b/gcc/testsuite/ada/acats/tests/l/la140121.a
deleted file mode 100644
index e4ea3ed9a55..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140121.a
+++ /dev/null
@@ -1,64 +0,0 @@
--- LA140121.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140122.AM.
---
--- TEST DESCRIPTION:
--- See LA140122.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140122.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140120.A
--- -> LA140121.A
--- LA140122.AM
--- LA140123.A
---
--- PASS/FAIL CRITERIA:
--- See LA140122.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007Q baseline version
--- 25 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-
-with LA14012_0;
-
-function LA14012_1 return integer;
-
-
-function LA14012_1 return integer is
- Local_val : integer := 5;
-begin
- Local_val := LA14012_0 (Parm_1 => Local_val);
- return Local_val;
-end LA14012_1;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140123.a b/gcc/testsuite/ada/acats/tests/l/la140123.a
deleted file mode 100644
index cacbf64e45b..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140123.a
+++ /dev/null
@@ -1,59 +0,0 @@
--- LA140123.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140122.AM.
---
--- TEST DESCRIPTION:
--- See LA140122.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140122.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140120.A
--- LA140121.A
--- LA140122.AM
--- -> LA140123.A
---
--- PASS/FAIL CRITERIA:
--- See LA140122.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007Q baseline version
--- 25 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-function LA14012_0 (Parm_1 : integer) return integer;
-
-
-function LA14012_0 (Parm_1 : integer) return integer is
-begin
- return -(2 * Parm_1);
-end LA14012_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140130.a b/gcc/testsuite/ada/acats/tests/l/la140130.a
deleted file mode 100644
index a65ce80013d..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140130.a
+++ /dev/null
@@ -1,57 +0,0 @@
--- LA140130.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140132.AM.
---
--- TEST DESCRIPTION:
--- See LA140132.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140132.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140130.A
--- LA140131.A
--- LA140132.AM
--- LA140133.A
---
--- PASS/FAIL CRITERIA:
--- See LA140132.AM.
---
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007R baseline version
--- 26 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-package LA140130 is
- subtype TC_type is integer range 0..100;
- TC_var : TC_type := TC_type'last;
-end LA140130;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140131.a b/gcc/testsuite/ada/acats/tests/l/la140131.a
deleted file mode 100644
index fe03f670568..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140131.a
+++ /dev/null
@@ -1,58 +0,0 @@
--- LA140131.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140132.AM.
---
--- TEST DESCRIPTION:
--- See LA140132.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140132.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140130.A
--- -> LA140131.A
--- LA140132.AM
--- LA140133.A
---
--- PASS/FAIL CRITERIA:
--- See LA140132.AM.
---
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007R baseline version
--- 26 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-with LA140130;
-
-package LA140131 is
- TC_local : LA140130.TC_type := LA140130.TC_var;
-end LA140131;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140133.a b/gcc/testsuite/ada/acats/tests/l/la140133.a
deleted file mode 100644
index 4d1451e4e53..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140133.a
+++ /dev/null
@@ -1,58 +0,0 @@
--- LA140133.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140132.AM.
---
--- TEST DESCRIPTION:
--- See LA140132.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140132.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140130.A
--- LA140131.A
--- LA140132.AM
--- -> LA140133.A
---
--- PASS/FAIL CRITERIA:
--- See LA140132.AM.
---
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007R baseline version
--- 26 MAY 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-package LA140130 is
- subtype TC_type is integer range -49..50;
- TC_const : constant TC_type := TC_type'first;
- TC_var : TC_type := TC_const;
-end LA140130;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140140.a b/gcc/testsuite/ada/acats/tests/l/la140140.a
deleted file mode 100644
index 21168913c3e..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140140.a
+++ /dev/null
@@ -1,55 +0,0 @@
--- LA140140.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140142.AM.
---
--- TEST DESCRIPTION:
--- See LA140142.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140142.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140140.A
--- LA140141.A
--- LA140142.AM
--- LA140143.A
---
--- PASS/FAIL CRITERIA:
--- See LA140142.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007S baseline version
--- 26 MAY 95 SAIC Initial version
--- 12 DEC 96 SAIC Reorganized to permit automatic recompilation.
---
---!
-
-procedure LA14014_0 (Change_one : in out integer) is
-begin
- Change_one := Change_one * 5;
-end LA14014_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140141.a b/gcc/testsuite/ada/acats/tests/l/la140141.a
deleted file mode 100644
index d0406e6e581..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140141.a
+++ /dev/null
@@ -1,57 +0,0 @@
--- LA140141.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140142.AM.
---
--- TEST DESCRIPTION:
--- See LA140142.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140142.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140140.A
--- -> LA140141.A
--- LA140142.AM
--- LA140143.A
---
--- PASS/FAIL CRITERIA:
--- See LA140142.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007S baseline version
--- 26 MAY 95 SAIC Initial version
--- 12 DEC 96 SAIC Reorganized to permit automatic recompilation.
---
---!
-
-with LA14014_0;
-procedure LA14014_1 (Change_this : out integer) is
-begin
- Change_this := 10;
- LA14014_0(Change_one => Change_this);
-end LA14014_1;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140143.a b/gcc/testsuite/ada/acats/tests/l/la140143.a
deleted file mode 100644
index 2c21b1bef95..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140143.a
+++ /dev/null
@@ -1,64 +0,0 @@
--- LA140143.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140142.AM.
---
--- TEST DESCRIPTION:
--- See LA140142.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140142.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140140.A
--- LA140141.A
--- LA140142.AM
--- -> LA140143.A
---
--- PASS/FAIL CRITERIA:
--- See LA140142.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007S baseline version
--- 26 MAY 95 SAIC Initial version
--- 12 DEC 96 SAIC Reorganized to permit automatic recompilation.
---
---!
-
-procedure LA14014_0 (Change_two : in integer := 0;
- Change_one : out integer) is
-begin
-
- if Change_two = 10 then
- Change_one := 70;
- elsif Change_two = 0 then
- Change_one := -10;
- else
- Change_one := 30;
- end if;
-
-end LA14014_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140150.a b/gcc/testsuite/ada/acats/tests/l/la140150.a
deleted file mode 100644
index 77a5a21a854..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140150.a
+++ /dev/null
@@ -1,56 +0,0 @@
--- LA140150.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140152.AM.
---
--- TEST DESCRIPTION:
--- See LA140152.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140152.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140150.A
--- LA140151.A
--- LA140152.AM
--- LA140153.A
---
--- PASS/FAIL CRITERIA:
--- See LA140152.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007T baseline version
--- 06 JUN 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-function LA14015_0 (Param_1 : integer) return boolean is
-begin
- return Param_1 = 5;
-end LA14015_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140151.a b/gcc/testsuite/ada/acats/tests/l/la140151.a
deleted file mode 100644
index 6cd0d1a6410..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140151.a
+++ /dev/null
@@ -1,65 +0,0 @@
--- LA140151.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140152.AM.
---
--- TEST DESCRIPTION:
--- See LA140152.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140152.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140150.A
--- -> LA140151.A
--- LA140152.AM
--- LA140153.A
---
--- PASS/FAIL CRITERIA:
--- See LA140152.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007T baseline version
--- 06 JUN 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-with LA14015_0; -- when LA140150 is revised and recompiled,
- -- this semantic dependency has to be
- -- handled
-
-
-function LA14015_1 (P : integer) return integer is
-begin
- if LA14015_0 (Param_1 => P) then
- return 100;
- else
- return -10;
- end if;
-end LA14015_1;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140153.a b/gcc/testsuite/ada/acats/tests/l/la140153.a
deleted file mode 100644
index 812644595e4..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140153.a
+++ /dev/null
@@ -1,61 +0,0 @@
--- LA140153.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140152.AM.
---
--- TEST DESCRIPTION:
--- See LA140152.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140152.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140150.A
--- LA140151.A
--- LA140152.AM
--- -> LA140153.A
---
--- PASS/FAIL CRITERIA:
--- See LA140152.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007T baseline version
--- 06 JUN 95 SAIC Initial version
--- 17 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-function LA14015_0 (Param_2 : boolean := false;
- Param_1 : integer := 10) return boolean is
-begin
- if Param_2 then
- return true;
- else
- return Param_1 = 10;
- end if;
-end LA14015_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140160.a b/gcc/testsuite/ada/acats/tests/l/la140160.a
deleted file mode 100644
index 38c396d9622..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140160.a
+++ /dev/null
@@ -1,54 +0,0 @@
--- LA140160.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140162.AM.
---
--- TEST DESCRIPTION:
--- See LA140162.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140162.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140160.A
--- LA140161.A
--- LA140162.AM
--- LA140163.A
---
--- PASS/FAIL CRITERIA:
--- See LA140162.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-package LA14016_0 is
- subtype status_code is integer range 0..10;
- type tagged_type is abstract tagged null record;
- function status (param : tagged_type) return status_code is abstract;
-end LA14016_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140161.a b/gcc/testsuite/ada/acats/tests/l/la140161.a
deleted file mode 100644
index 4be9f1dfd8c..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140161.a
+++ /dev/null
@@ -1,63 +0,0 @@
--- LA140161.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140162.AM.
---
--- TEST DESCRIPTION:
--- See LA140162.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140162.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140160.A
--- -> LA140161.A
--- LA140162.AM
--- LA140162.A
---
--- PASS/FAIL CRITERIA:
--- See LA140162.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-with LA14016_0;
-generic
- type T is new LA14016_0.tagged_type with private;
- type count_type is range <>;
-package LA14016_1 is
- default_status : constant LA14016_0.status_code := 0;
- type new_t is new T with
- record
- count : count_type;
- end record;
- function status (param : new_t) return LA14016_0.status_code;
-
- procedure inc (param : in out new_t);
-end LA14016_1;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140163.a b/gcc/testsuite/ada/acats/tests/l/la140163.a
deleted file mode 100644
index d91923a6c63..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140163.a
+++ /dev/null
@@ -1,67 +0,0 @@
--- LA140163.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140162.AM.
---
--- TEST DESCRIPTION:
--- See LA140162.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140162.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140160.A
--- LA140161.A
--- LA140162.AM
--- -> LA140163.A
---
--- PASS/FAIL CRITERIA:
--- See LA140162.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008L baseline version
--- 16 JUN 95 SAIC Initial version
--- 07 DEC 96 SAIC Modified unit names and prologue to conform
--- to coding conventions and to reflect new
--- test file organization.
---
---!
-
-with LA14016_0;
-generic
- type T is new LA14016_0.tagged_type with private;
- type count_type is range <>;
-package LA14016_1 is
- default_status : constant LA14016_0.status_code := 5;
- type new_t is new T with
- record
- count : count_type;
- end record;
- function status (param : new_t) return LA14016_0.status_code;
-
- procedure inc (param : in out new_t);
-end LA14016_1;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140170.a b/gcc/testsuite/ada/acats/tests/l/la140170.a
deleted file mode 100644
index 0c041d00a26..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140170.a
+++ /dev/null
@@ -1,64 +0,0 @@
--- LA140170.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140172.AM.
---
--- TEST DESCRIPTION:
--- See LA140172.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140172.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140170.A
--- LA140171.A
--- LA140172.AM
--- LA140173.A
---
--- PASS/FAIL CRITERIA:
--- See LA140172.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-package LA14017_0 is
- type swap_type_ptr is record
- p_all : integer;
- end record;
- subtype count_type is integer;
-end LA14017_0;
-
------------------------------------------------------
-
-with LA14017_0;
-use LA14017_0;
-generic
- type swap_type is private;
-function LA14017_1 (P1, P2 : swap_type_ptr;
- count : count_type) return count_type;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140171.a b/gcc/testsuite/ada/acats/tests/l/la140171.a
deleted file mode 100644
index d7f37663c9a..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140171.a
+++ /dev/null
@@ -1,69 +0,0 @@
--- LA140171.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140172.AM.
---
--- TEST DESCRIPTION:
--- See LA140172.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140172.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140170.A
--- -> LA140171.A
--- LA140172.AM
--- LA140173.A
---
--- PASS/FAIL CRITERIA:
--- See LA140172.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-function LA14017_1 (P1, P2 : swap_type_ptr;
- count : count_type) return count_type is
- temp : integer := 0;
- count_factor : count_type := 10;
-
- function Inc (Param : integer) return integer;
-
- function Inc (Param : integer) return integer is separate;
-
- procedure Swap_Ptrs (P1, P2 : in out swap_type_ptr) is
- temp : integer := 0;
- begin
- temp := P1.p_all;
- P1.p_all := P2.p_all;
- P2.p_all := temp;
- end Swap_Ptrs;
-
-begin
- return count_type (Inc (integer(count)));
-end LA14017_1;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140173.a b/gcc/testsuite/ada/acats/tests/l/la140173.a
deleted file mode 100644
index 73f382e72aa..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140173.a
+++ /dev/null
@@ -1,75 +0,0 @@
--- LA140173.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140172.AM.
---
--- TEST DESCRIPTION:
--- See LA140172.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140172.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140170.A
--- LA140171.A
--- LA140172.AM
--- -> LA140173.A
---
--- PASS/FAIL CRITERIA:
--- See LA140172.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008M baseline version
--- 16 JUN 95 SAIC Initial version
--- 03 MAR 96 SAIC First revision after review
--- 17 NOV 96 SAIC Modified unit names and prologue to conform
--- to coding conventions.
--- 07 DEC 96 SAIC Modified prologue to reflect new test
--- file organization.
---
---!
-
-function LA14017_1 (P1, P2 : swap_type_ptr;
- count : count_type) return count_type is
- count_factor : count_type := -10;
-
- procedure Swap_Ptrs (P1, P2 : in out swap_type_ptr) is
- temp : integer := 0;
- begin
- temp := P1.p_all;
- P1.p_all := P2.p_all;
- P2.p_all := temp;
- end Swap_Ptrs;
-
- function Inc (Param : integer) return integer;
-
- function Inc (Param : integer) return integer is separate;
-
- temp : integer := 0;
-begin
- return count_type (Inc (integer(count)));
-end LA14017_1;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140180.a b/gcc/testsuite/ada/acats/tests/l/la140180.a
deleted file mode 100644
index 185ca21f438..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140180.a
+++ /dev/null
@@ -1,65 +0,0 @@
--- LA140180.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140182.AM.
---
--- TEST DESCRIPTION:
--- See LA140182.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140182.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140180.A
--- LA140181.A
--- LA140182.AM
--- LA140183.A
---
--- PASS/FAIL CRITERIA:
--- See LA140182.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-generic
- type unsigned is mod <>;
- mod_value : unsigned := 1;
-package LA14018_0 is
- --types declared locally
-
- generic
- type discrete is (<>);
- package utils_18 is
- procedure Dec (Param : in out unsigned);
-
- -- other utilities
- end utils_18;
-
- --routines that make this generic useful
-end LA14018_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140181.a b/gcc/testsuite/ada/acats/tests/l/la140181.a
deleted file mode 100644
index 3d9847a98ae..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140181.a
+++ /dev/null
@@ -1,54 +0,0 @@
--- LA140181.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140182.AM.
---
--- TEST DESCRIPTION:
--- See LA140182.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140182.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140180.A
--- -> LA140181.A
--- LA140182.AM
--- LA140183.A
---
--- PASS/FAIL CRITERIA:
--- See LA140182.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-package body LA14018_0 is
- offset : constant unsigned := mod_value;
-
- package body utils_18 is separate;
-end LA14018_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140183.a b/gcc/testsuite/ada/acats/tests/l/la140183.a
deleted file mode 100644
index f50ae15ba18..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140183.a
+++ /dev/null
@@ -1,60 +0,0 @@
--- LA140183.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140182.AM.
---
--- TEST DESCRIPTION:
--- See LA140182.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140182.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140180.A
--- LA140181.A
--- LA140182.AM
--- -> LA140183.A
---
--- PASS/FAIL CRITERIA:
--- See LA140182.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008N baseline version
--- 16 JUN 95 SAIC Initial version
--- 07 DEC 96 SAIC Modified unit names and prologue to conform
--- to coding conventions, and to reflect new test
--- file organization.
---
---!
-
-package body LA14018_0 is
- New_TC_var : integer := 101;
- New_array : array (1..101) of integer := (others => 0);
- offset : constant unsigned := mod_value + 2;
-
- package body utils_18 is separate;
-end LA14018_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140190.a b/gcc/testsuite/ada/acats/tests/l/la140190.a
deleted file mode 100644
index 0c4c3a9d656..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140190.a
+++ /dev/null
@@ -1,61 +0,0 @@
--- LA140190.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140192.AM.
---
--- TEST DESCRIPTION:
--- See LA140192.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140192.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140190.A
--- LA140191.A
--- LA140192.AM
--- LA140193.A
---
--- PASS/FAIL CRITERIA:
--- See LA140192.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008P baseline version
--- 23 JUN 95 SAIC Initial version
--- 29 JAN 96 SAIC First revision after review
--- 17 NOV 96 SAIC Modified unit names and prologue to conform
--- to coding conventions.
---
---!
-
-procedure LA14019_0 (Param : in out integer);
-
-
-procedure LA14019_0 (Param : in out integer) is
- TC_offset : constant integer := 1;
-begin
- Param := Param + TC_offset;
-end LA14019_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140191.a b/gcc/testsuite/ada/acats/tests/l/la140191.a
deleted file mode 100644
index 8b7af2e7c90..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140191.a
+++ /dev/null
@@ -1,74 +0,0 @@
--- LA140191.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140192.AM.
---
--- TEST DESCRIPTION:
--- See LA140192.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140192.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140190.A
--- -> LA140191.A
--- LA140192.AM
--- LA140193.A
---
--- PASS/FAIL CRITERIA:
--- See LA140192.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008P baseline version
--- 23 JUN 95 SAIC Initial version
--- 29 JAN 96 SAIC First revision after review
--- 17 NOV 96 SAIC Modified unit names and prologue to conform
--- to coding conventions.
---
---!
-
-generic
- type integer_type is range <>;
-procedure LA14019_1 (Test_val : in out integer);
-
-with LA14019_0;
-procedure LA14019_1 (Test_val : in out integer) is
- arr : array (1..5) of integer;
- sum : integer := 0;
- temp_val : integer := 0;
-begin
- arr(1) := Test_val;
- for i in 2..arr'last loop
- temp_val := arr(i-1);
- LA14019_0 (temp_val);
- arr(i) := temp_val;
- end loop;
- for i in 1..arr'last loop
- sum := sum + arr(i);
- end loop;
- Test_val := sum;
-end LA14019_1;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140193.a b/gcc/testsuite/ada/acats/tests/l/la140193.a
deleted file mode 100644
index 717cc633ba7..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140193.a
+++ /dev/null
@@ -1,64 +0,0 @@
--- LA140193.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140192.AM.
---
--- TEST DESCRIPTION:
--- See LA140192.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140192.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140190.A
--- LA140191.A
--- LA140192.AM
--- -> LA140193.A
---
--- PASS/FAIL CRITERIA:
--- See LA140192.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008P baseline version
--- 23 JUN 95 SAIC Initial version
--- 29 JAN 96 SAIC First revision after review
--- 17 NOV 96 SAIC Modified unit names and prologue to conform
--- to coding conventions.
---
---!
-
-procedure LA14019_0 (Param : in out integer);
-
-
-procedure LA14019_0 (Param : in out integer) is
- Local_array : array (1..10) of float := (others => 0.0);
- Local_var : integer := 0;
- TC_var : constant integer := -9;
-
-begin
- Param := (1 + Param) * 2;
-end LA14019_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140200.a b/gcc/testsuite/ada/acats/tests/l/la140200.a
deleted file mode 100644
index 9adf75e67bf..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140200.a
+++ /dev/null
@@ -1,76 +0,0 @@
--- LA140200.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140202.AM.
---
--- TEST DESCRIPTION:
--- See LA140202.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140202.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140200.A
--- LA140201.A
--- LA140202.AM
--- LA140203.A
---
--- PASS/FAIL CRITERIA:
--- See LA140202.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008Q baseline version
--- 23 JUN 95 SAIC Initial version
--- 29 FEB 96 SAIC First revision after review
--- 12 DEC 96 SAIC Reorganized to permit automatic recompilation.
--- Reworded objective. Moved instance to
--- library-level and redesigned to use generic
--- formal function. Fixed arithmetic errors.
---
---!
-
-package LA14020_0 is
-
- subtype apples is integer range 0..100;
- subtype oranges is integer range 0..200;
-
- type Fruit_Basket is tagged record
- App : apples;
- Ora : oranges;
- end record;
-
-end LA14020_0;
-
- --==================================================================--
-
-package LA14020_0.LA14020_1 is
-
- type Bigger_Basket is new Fruit_Basket with record
- Total : integer;
- end record;
-
-end LA14020_0.LA14020_1;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140201.a b/gcc/testsuite/ada/acats/tests/l/la140201.a
deleted file mode 100644
index 66822553207..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140201.a
+++ /dev/null
@@ -1,71 +0,0 @@
--- LA140201.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140202.AM.
---
--- TEST DESCRIPTION:
--- See LA140202.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140202.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140200.A
--- -> LA140201.A
--- LA140202.AM
--- LA140203.A
---
--- PASS/FAIL CRITERIA:
--- See LA140202.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008Q baseline version
--- 23 JUN 95 SAIC Initial version
--- 29 FEB 96 SAIC First revision after review
--- 12 DEC 96 SAIC Reorganized to permit automatic recompilation.
--- Reworded objective. Moved instance to
--- library-level and redesigned to use generic
--- formal function. Fixed arithmetic errors.
---
---!
-
-with LA14020_0;
-generic
- type Basket is new LA14020_0.Fruit_Basket with private;
-function LA14020_2 (Left, Right : Basket) return Basket;
-
- --==================================================================--
-
-function LA14020_2 (Left, Right : Basket) return Basket is
- Result : Basket;
-begin
- Result.App := Left.App + Left.App;
- Result.Ora := Right.Ora + Right.Ora;
- -- wrong algorithm, to be corrected later
-
- return Result;
-end LA14020_2;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140203.a b/gcc/testsuite/ada/acats/tests/l/la140203.a
deleted file mode 100644
index f2965b407c4..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140203.a
+++ /dev/null
@@ -1,71 +0,0 @@
--- LA140203.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140202.AM.
---
--- TEST DESCRIPTION:
--- See LA140202.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140202.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140200.A
--- LA140201.A
--- LA140202.AM
--- -> LA140203.A
---
--- PASS/FAIL CRITERIA:
--- See LA140202.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008Q baseline version
--- 23 JUN 95 SAIC Initial version
--- 29 FEB 96 SAIC First revision after review
--- 12 DEC 96 SAIC Reorganized to permit automatic recompilation.
--- Reworded objective. Moved instance to
--- library-level and redesigned to use generic
--- formal function. Fixed arithmetic errors.
---
---!
-
-with LA14020_0;
-generic
- type Basket is new LA14020_0.Fruit_Basket with private;
-function LA14020_2 (Left, Right : Basket) return Basket;
-
- --==================================================================--
-
-function LA14020_2 (Left, Right : Basket) return Basket is
- Result : Basket;
-begin
- Result.App := Left.App + Right.App;
- Result.Ora := Left.Ora + Right.Ora;
- -- correct algorithm
-
- return Result;
-end LA14020_2;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140210.a b/gcc/testsuite/ada/acats/tests/l/la140210.a
deleted file mode 100644
index ab3ad5f776a..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140210.a
+++ /dev/null
@@ -1,69 +0,0 @@
--- LA140210.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140211.AM.
---
--- TEST DESCRIPTION:
--- See LA140211.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140211.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140210.A
--- LA140211.AM
--- LA140212.A
---
--- PASS/FAIL CRITERIA:
--- See LA140211.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-generic
- type swap_type is private;
- type int_type is range <>;
- times : int_type :=1;
-package LA14021_0 is
- procedure swap (this, for_that : in out swap_type);
-end LA14021_0;
-
----------------------------------------------------------
-
-package body LA14021_0 is
- procedure swap (this, for_that : in out swap_type) is
- temp : swap_type;
- begin
- for i in int_type'first..times loop
- temp := this;
- this := for_that;
- for_that := temp;
- end loop;
- end swap;
-end LA14021_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140212.a b/gcc/testsuite/ada/acats/tests/l/la140212.a
deleted file mode 100644
index 0c689b9996a..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140212.a
+++ /dev/null
@@ -1,74 +0,0 @@
--- LA140212.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140211.AM.
---
--- TEST DESCRIPTION:
--- See LA140211.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140211.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140210.A
--- LA140211.AM
--- -> LA140212.A
---
--- PASS/FAIL CRITERIA:
--- See LA140211.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008R baseline version
--- 23 JUN 95 SAIC Initial version
--- 18 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
--- 07 DEC 96 SAIC Modified prologue to reflect new test
--- file organization.
---
---!
-
-generic
- type swap_type is private;
- type int_type is range <>;
- times : int_type :=2; --this line contains the change
-package LA14021_0 is
- procedure swap (this, for_that : in out swap_type);
-end LA14021_0;
-
----------------------------------------------------------
-
-package body LA14021_0 is
- procedure swap (this, for_that : in out swap_type) is
- temp : swap_type;
- begin
- for i in int_type'first..times loop
- temp := this;
- this := for_that;
- for_that := temp;
- end loop;
- end swap;
-end LA14021_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140220.a b/gcc/testsuite/ada/acats/tests/l/la140220.a
deleted file mode 100644
index c5e4c6575e2..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140220.a
+++ /dev/null
@@ -1,64 +0,0 @@
--- LA140220.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140221.AM.
---
--- TEST DESCRIPTION:
--- See LA140221.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140221.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140220.A
--- LA140221.AM
--- LA140222.A
---
--- PASS/FAIL CRITERIA:
--- See LA140221.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-generic
- type stuff is private;
- type ptr is access stuff;
- type return_result is range <>;
- delta_val : return_result := 1;
-procedure LA14022_0 (pointer : in out ptr;
- result : in out return_result);
-
--------------------------------------------------------
-
-procedure LA14022_0 (pointer : in out ptr;
- result : in out return_result) is
-begin
- pointer := new stuff;
- result := result + delta_val;
-end LA14022_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140222.a b/gcc/testsuite/ada/acats/tests/l/la140222.a
deleted file mode 100644
index 424236b3efc..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140222.a
+++ /dev/null
@@ -1,69 +0,0 @@
--- LA140222.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140221.AM.
---
--- TEST DESCRIPTION:
--- See LA140221.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140221.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140220.A
--- LA140221.AM
--- -> LA140222.A
---
--- PASS/FAIL CRITERIA:
--- See LA140221.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008S baseline version
--- 23 JUN 95 SAIC Initial version
--- 18 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
--- 07 DEC 96 SAIC Modified prologue to reflect new test
--- file organization.
---
---!
-
-generic
- type stuff is private;
- type ptr is access stuff;
- type return_result is range <>;
- delta_val : return_result := 1;
-procedure LA14022_0 (pointer : in out ptr;
- result : in out return_result);
-
--------------------------------------------------------
-
-procedure LA14022_0 (pointer : in out ptr;
- result : in out return_result) is
-begin
- pointer := null;
- result := result + return_result'first;
-end LA14022_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140240.a b/gcc/testsuite/ada/acats/tests/l/la140240.a
deleted file mode 100644
index e5541006ec1..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140240.a
+++ /dev/null
@@ -1,61 +0,0 @@
--- LA140240.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140242.AM.
---
--- TEST DESCRIPTION:
--- See LA140242.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140242.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140240.A
--- LA140241.A
--- LA140242.AM
--- LA140243.A
---
--- PASS/FAIL CRITERIA:
--- See LA140242.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008U baseline version
--- 29 JUN 95 SAIC Initial version
--- 18 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-generic
- Local_max : positive;
- type Thing is private;
-package LA14024_0 is
- type Goodies is tagged
- record
- X, Y : integer := 100;
- end record;
-end LA14024_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140241.a b/gcc/testsuite/ada/acats/tests/l/la140241.a
deleted file mode 100644
index dde3b3db520..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140241.a
+++ /dev/null
@@ -1,55 +0,0 @@
--- LA140241.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140242.AM.
---
--- TEST DESCRIPTION:
--- See LA140242.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140242.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140240.A
--- -> LA140241.A
--- LA140242.AM
--- LA140243.A
---
--- PASS/FAIL CRITERIA:
--- See LA140242.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008U baseline version
--- 29 JUN 95 SAIC Initial version
--- 18 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-with LA14024_0;
-
-package LA14024_1 is new LA14024_0 (100, integer);
diff --git a/gcc/testsuite/ada/acats/tests/l/la140243.a b/gcc/testsuite/ada/acats/tests/l/la140243.a
deleted file mode 100644
index 98b03438bc4..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140243.a
+++ /dev/null
@@ -1,61 +0,0 @@
--- LA140243.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140242.AM.
---
--- TEST DESCRIPTION:
--- See LA140242.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140242.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140240.A
--- LA140241.A
--- LA140242.AM
--- -> LA140243.A
---
--- PASS/FAIL CRITERIA:
--- See LA140242.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008U baseline version
--- 29 JUN 95 SAIC Initial version
--- 18 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-generic
- Local_max : positive;
- type Thing is private;
-package LA14024_0 is
- type Goodies is tagged
- record
- Y, X : integer := -10;
- end record;
-end LA14024_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140250.a b/gcc/testsuite/ada/acats/tests/l/la140250.a
deleted file mode 100644
index 44477df4d70..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140250.a
+++ /dev/null
@@ -1,56 +0,0 @@
--- LA140250.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140251.AM.
---
--- TEST DESCRIPTION:
--- See LA140251.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140251.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140050.A
--- LA140051.AM
--- LA140052.A
---
--- PASS/FAIL CRITERIA:
--- See LA140251.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-package LA14025_0 is
- subtype byte is integer range 0..511;
- byte_val : constant byte := 128;
- type Data_rec is tagged record
- Id : integer := 1;
- Val: byte := byte_val;
- end record;
-end LA14025_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140252.a b/gcc/testsuite/ada/acats/tests/l/la140252.a
deleted file mode 100644
index 2fce76cea6f..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140252.a
+++ /dev/null
@@ -1,59 +0,0 @@
--- LA140252.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140251.AM.
---
--- TEST DESCRIPTION:
--- See LA140251.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140251.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140050.A
--- LA140051.AM
--- -> LA140052.A
---
--- PASS/FAIL CRITERIA:
--- See LA140251.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008V baseline version
--- 06 JUL 95 SAIC Initial version
--- 07 DEC 96 SAIC Modified prologue to reflect new test
--- file organization.
---
---!
-
-package LA14025_0 is
- subtype byte is integer range 0..511;
- byte_val : constant byte := 64;
- type Data_rec is tagged record
- Id : integer := 1;
- Val: byte := byte_val;
- end record;
-end LA14025_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140260.a b/gcc/testsuite/ada/acats/tests/l/la140260.a
deleted file mode 100644
index fae1736673b..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140260.a
+++ /dev/null
@@ -1,98 +0,0 @@
--- LA140260.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140262.AM.
---
--- TEST DESCRIPTION:
--- See LA140262.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140262.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140260.A
--- LA140261.A
--- LA140262.AM
--- LA140263.A
---
--- PASS/FAIL CRITERIA:
--- See LA140262.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-package LA14026_0 is
- type basic_rec is tagged
- record
- null;
- end record;
-end LA14026_0;
-
----------------------------------------------------------
-
-with LA14026_0;
-generic
- type data_type is private;
- type serial_type is range <>;
- serial_init : serial_type;
-package LA14026_1 is
-
- pragma Elaborate_Body;
-
- function get_serial_num return serial_type;
-
- type node_type is new LA14026_0.basic_rec with
- record
- data_field : data_type;
- serial_no : serial_type := get_serial_num;
- end record;
-end LA14026_1;
-
----------------------------------------------------------
-
-package body LA14026_1 is
- serial : serial_type := serial_init;
- function get_serial_num return serial_type is
- begin
- serial := serial + 1;
- return serial;
- end;
-end LA14026_1;
-
----------------------------------------------------------
-
-package LA14026_2 is
- subtype serial_type is integer range 0..5;
- subtype data_type is integer range 0..100;
-
- type data_rec is record
- F1 : data_type := data_type'first;
- F2 : data_type := data_type'last;
- end record;
-end LA14026_2;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140261.a b/gcc/testsuite/ada/acats/tests/l/la140261.a
deleted file mode 100644
index 73cd334ed42..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140261.a
+++ /dev/null
@@ -1,52 +0,0 @@
--- LA140261.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140262.AM.
---
--- TEST DESCRIPTION:
--- See LA140262.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140262.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140260.A
--- -> LA140261.A
--- LA140262.AM
--- LA140263.A
---
--- PASS/FAIL CRITERIA:
--- See LA140262.AM.
---
--- CHANGE HISTORY:
--- 07 DEC 96 SAIC ACVC 2.1: Initial version.
---
---!
-
-with LA14026_2, LA14026_1;
-package LA14026_3 is new LA14026_1 (LA14026_2.data_rec,
- LA14026_2.serial_type, 0);
diff --git a/gcc/testsuite/ada/acats/tests/l/la140263.a b/gcc/testsuite/ada/acats/tests/l/la140263.a
deleted file mode 100644
index c0224894d2d..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140263.a
+++ /dev/null
@@ -1,57 +0,0 @@
--- LA140263.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140262.AM.
---
--- TEST DESCRIPTION:
--- See LA140262.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140262.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140260.A
--- LA140261.A
--- LA140262.AM
--- -> LA140263.A
---
--- PASS/FAIL CRITERIA:
--- See LA140262.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5008W baseline version
--- 06 JUL 95 SAIC Initial version
--- 18 NOV 96 SAIC Modified unit names and prologue to conform
--- to coding conventions.
--- 07 DEC 96 SAIC Modified prologue to reflect new test
--- file organization.
---
---!
-
-with LA14026_2, LA14026_1;
-package LA14026_3 is new LA14026_1 (LA14026_2.data_rec,
- LA14026_2.serial_type, 3);
diff --git a/gcc/testsuite/ada/acats/tests/l/la140270.a b/gcc/testsuite/ada/acats/tests/l/la140270.a
deleted file mode 100644
index dab574cd682..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140270.a
+++ /dev/null
@@ -1,56 +0,0 @@
--- LA140270.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140272.AM.
---
--- TEST DESCRIPTION:
--- See LA140272.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140272.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- -> LA140270.A
--- LA140271.A
--- LA140272.AM
--- LA140273.A
---
--- PASS/FAIL CRITERIA:
--- See LA140272.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007O baseline version
--- 28 JUL 95 SAIC Initial version
--- 29 JAN 96 SAIC First revision after review
--- 18 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-package LA14027_0 is
- Sample_value : integer := 100;
-end LA14027_0;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140271.a b/gcc/testsuite/ada/acats/tests/l/la140271.a
deleted file mode 100644
index 703b1b8aee1..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140271.a
+++ /dev/null
@@ -1,93 +0,0 @@
--- LA140271.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140272.AM.
---
--- TEST DESCRIPTION:
--- See LA140272.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140272.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140270.A
--- -> LA140271.A
--- LA140272.AM
--- LA140273.A
---
--- PASS/FAIL CRITERIA:
--- See LA140272.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007O baseline version
--- 28 JUL 95 SAIC Initial version
--- 29 JAN 96 SAIC First revision after review
--- 18 NOV 96 SAIC Modified unit names and prologue to conform
--- to coding conventions. Removed loop from
--- task body to prevent hang.
---
---!
-
-package LA14027_1 is
- procedure Random (Number : out integer);
-end LA14027_1;
-
- --------------------------------------------
-
-package body LA14027_1 is
- task LA14027_2 is
- entry Get (Value : out integer);
- end LA14027_2;
-
- task body LA14027_2 is separate;
-
- procedure Random (Number : out integer) is
- begin
- -- get a random number from sampling task
- LA14027_2.Get (Number);
- -- massage it
- Number := Number + 10;
- -- and return it
- end;
-end LA14027_1;
-
- --------------------------------------------
-
-with LA14027_0; -- must resolve this
-
-separate (LA14027_1)
-
-task body LA14027_2 is
- begin
- select
- accept Get (Value : out integer) do
- -- sample some random physical process
- Value := LA14027_0.Sample_value;
- -- and return it
- end Get;
- end select;
-end LA14027_2;
diff --git a/gcc/testsuite/ada/acats/tests/l/la140273.a b/gcc/testsuite/ada/acats/tests/l/la140273.a
deleted file mode 100644
index 0e535f10c62..00000000000
--- a/gcc/testsuite/ada/acats/tests/l/la140273.a
+++ /dev/null
@@ -1,58 +0,0 @@
--- LA140273.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- See LA140272.AM.
---
--- TEST DESCRIPTION:
--- See LA140272.AM.
---
--- SPECIAL REQUIREMENTS:
--- See LA140272.AM.
---
--- TEST FILES:
--- This test consists of the following files:
--- LA140270.A
--- LA140271.A
--- LA140272.AM
--- -> LA140273.A
---
--- PASS/FAIL CRITERIA:
--- See LA140272.AM.
---
--- CHANGE HISTORY:
--- 01 MAY 95 ACVC 1.12 LA5007O baseline version
--- 28 JUL 95 SAIC Initial version
--- 29 JAN 96 SAIC First revision after review
--- 18 NOV 96 SAIC Modified prologue to conform
--- to coding conventions.
---
---!
-
-package LA14027_0 is
- New_var : integer := 100;
- Local_array : array (1..51) of integer;
- Sample_value : constant integer := -10;
-end LA14027_0;