Skip to content

Commit 21038d5

Browse files
committed
[Comgr] Remove hipv4 tests from Unbundle API tests
This reflects upstream changes which make hip and hipv4 compatible: llvm#91637 Change-Id: Ia00f0cabce442c12b88ae2007045869243602fec
1 parent 693ce9b commit 21038d5

File tree

1 file changed

+12
-97
lines changed

1 file changed

+12
-97
lines changed

amd/comgr/test/unbundle_hip_test.c

Lines changed: 12 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
//
5656
// // Manually unbundle object file bundle
5757
// clang-offload-bundler -type=o \
58-
// -targets=hipv4-amdgcn-amd-amdhsa-gfx900 \
58+
// -targets=hip-amdgcn-amd-amdhsa-gfx900 \
5959
// -input=double.o -output=double-gfx900.o \
6060
// -unbundle -allow-missing-bundles
6161
//
@@ -133,11 +133,11 @@ int main(int Argc, char *Argv[]) {
133133
checkError(Status, "amd_comgr_action_info_set_language");
134134

135135
const char *BundleEntryIDs[] = {"host-x86_64-unknown-linux-gnu",
136-
"hip-amdgcn-amd-amdhsa-gfx900","hipv4-amdgcn-amd-amdhsa-gfx900"};
136+
"hip-amdgcn-amd-amdhsa-gfx900"};
137137
size_t BundleEntryIDsCount =
138138
sizeof(BundleEntryIDs) / sizeof(BundleEntryIDs[0]);
139139
Status = amd_comgr_action_info_set_bundle_entry_ids(ActionInfoUnbundle,
140-
BundleEntryIDs, 3);
140+
BundleEntryIDs, 2);
141141

142142
// Unbundle
143143
Status = amd_comgr_create_data_set(&DataSetUnbundled);
@@ -153,12 +153,13 @@ int main(int Argc, char *Argv[]) {
153153
AMD_COMGR_DATA_KIND_BC, &Count);
154154
checkError(Status, "amd_comgr_action_data_count");
155155

156-
if (Count != 3) {
157-
printf("Unbundle: produced %zu bitcodes (expected 3)\n", Count);
156+
if (Count != 2) {
157+
printf("Unbundle: produced %zu bitcodes (expected 2)\n", Count);
158158
exit(1);
159159
}
160160

161161
amd_comgr_data_t DataElement;
162+
162163
// bitcode host element (empty)
163164
Status = amd_comgr_action_data_get_data(DataSetUnbundled,
164165
AMD_COMGR_DATA_KIND_BC,
@@ -217,44 +218,15 @@ int main(int Argc, char *Argv[]) {
217218
exit(1);
218219
}
219220

220-
// bitcode hipv4-gfx900 element (empty)
221-
Status = amd_comgr_action_data_get_data(DataSetUnbundled,
222-
AMD_COMGR_DATA_KIND_BC,
223-
2, &DataElement);
224-
checkError(Status, "amd_comgr_action_data_get_data");
225-
226-
Status = amd_comgr_get_data_name(DataElement, &name_size, NULL);
227-
checkError(Status, "amd_comgr_get_data_name");
228-
Status = amd_comgr_get_data_name(DataElement, &name_size, &Name[0]);
229-
checkError(Status, "amd_comgr_get_data_name");
230-
231-
expectedName = "square-hipv4-amdgcn-amd-amdhsa-gfx900.bc";
232-
if (strcmp(Name, expectedName)) {
233-
printf("Bitcode hipv4-gfx900 element name mismatch: %s (expected %s)\n",
234-
Name, expectedName);
235-
}
236-
237-
bytesSize = 0;
238-
Status = amd_comgr_get_data(DataElement, &bytesSize, NULL);
239-
checkError(Status, "amd_comgr_get_data");
240-
Status = amd_comgr_release_data(DataElement);
241-
checkError(Status, "amd_comgr_release_data");
242-
243-
if (bytesSize != 0) {
244-
printf("Bitcode hipv4-gfx900 element size: %ld (expected 0)\n",
245-
bytesSize);
246-
exit(1);
247-
}
248-
249221
// --------
250222
// Check ObjectFile count, element names, and element sizes
251223
Status = amd_comgr_action_data_count(DataSetUnbundled,
252224
AMD_COMGR_DATA_KIND_EXECUTABLE,
253225
&Count);
254226
checkError(Status, "amd_comgr_action_data_count");
255227

256-
if (Count != 3) {
257-
printf("Unbundle: produced %zu object files (expected 3)\n", Count);
228+
if (Count != 2) {
229+
printf("Unbundle: produced %zu object files (expected 2)\n", Count);
258230
exit(1);
259231
}
260232

@@ -286,7 +258,7 @@ int main(int Argc, char *Argv[]) {
286258
exit(1);
287259
}
288260

289-
// object hip-gfx900 element (empty)
261+
// object hip-gfx900 element (non-empty)
290262
Status = amd_comgr_action_data_get_data(DataSetUnbundled,
291263
AMD_COMGR_DATA_KIND_EXECUTABLE,
292264
1, &DataElement);
@@ -309,36 +281,8 @@ int main(int Argc, char *Argv[]) {
309281
Status = amd_comgr_release_data(DataElement);
310282
checkError(Status, "amd_comgr_release_data");
311283

312-
if (bytesSize != 0) {
313-
printf("Object hip-gfx900 element size: %ld (expected 0)\n", bytesSize);
314-
exit(1);
315-
}
316-
317-
// object hipv4-gfx900 element (non-empty)
318-
Status = amd_comgr_action_data_get_data(DataSetUnbundled,
319-
AMD_COMGR_DATA_KIND_EXECUTABLE,
320-
2, &DataElement);
321-
checkError(Status, "amd_comgr_action_data_get_data");
322-
323-
Status = amd_comgr_get_data_name(DataElement, &name_size, NULL);
324-
checkError(Status, "amd_comgr_get_data_name");
325-
Status = amd_comgr_get_data_name(DataElement, &name_size, &Name[0]);
326-
checkError(Status, "amd_comgr_get_data_name");
327-
328-
expectedName = "double-hipv4-amdgcn-amd-amdhsa-gfx900.o";
329-
if (strcmp(Name, expectedName)) {
330-
printf("Object hipv4-gfx900 element name mismatch: %s (expected %s)\n",
331-
Name, expectedName);
332-
}
333-
334-
bytesSize = 0;
335-
Status = amd_comgr_get_data(DataElement, &bytesSize, NULL);
336-
checkError(Status, "amd_comgr_get_data");
337-
Status = amd_comgr_release_data(DataElement);
338-
checkError(Status, "amd_comgr_release_data");
339-
340284
if (bytesSize == 0) {
341-
printf("Object hipv4-gfx900 empty (expected non-empty)\n");
285+
printf("Object hip-gfx900 empty (expected non-empty)\n");
342286
exit(1);
343287
}
344288

@@ -348,8 +292,8 @@ int main(int Argc, char *Argv[]) {
348292
AMD_COMGR_DATA_KIND_AR, &Count);
349293
checkError(Status, "amd_comgr_action_data_count");
350294

351-
if (Count != 3) {
352-
printf("Unbundle: produced %zu archives (expected 3)\n", Count);
295+
if (Count != 2) {
296+
printf("Unbundle: produced %zu archives (expected 2)\n", Count);
353297
exit(1);
354298
}
355299

@@ -410,35 +354,6 @@ int main(int Argc, char *Argv[]) {
410354
exit(1);
411355
}
412356

413-
// archive hip-gfx900 element (empty, size 8)
414-
Status = amd_comgr_action_data_get_data(DataSetUnbundled,
415-
AMD_COMGR_DATA_KIND_AR,
416-
2, &DataElement);
417-
checkError(Status, "amd_comgr_action_data_get_data");
418-
419-
Status = amd_comgr_get_data_name(DataElement, &name_size, NULL);
420-
checkError(Status, "amd_comgr_get_data_name");
421-
Status = amd_comgr_get_data_name(DataElement, &name_size, &Name[0]);
422-
checkError(Status, "amd_comgr_get_data_name");
423-
424-
expectedName = "cube-hipv4-amdgcn-amd-amdhsa-gfx900.a";
425-
if (strcmp(Name, expectedName)) {
426-
printf("Archive hipv4-gfx900 bundle name mismatch: %s (expected %s)\n",
427-
Name, expectedName);
428-
}
429-
430-
bytesSize = 0;
431-
Status = amd_comgr_get_data(DataElement, &bytesSize, NULL);
432-
checkError(Status, "amd_comgr_get_data");
433-
Status = amd_comgr_release_data(DataElement);
434-
checkError(Status, "amd_comgr_release_data");
435-
436-
if (bytesSize != 8) {
437-
printf("Arvhive hipv4-gfx900 element size: %ld (expected 8)\n",
438-
bytesSize);
439-
exit(1);
440-
}
441-
442357
// --------
443358
// Check Bundle Entry IDs
444359
size_t BundleCount;

0 commit comments

Comments
 (0)