Skip to content

Commit 6d3333a

Browse files
committed
[Comgr] Fix bugs with mangled name test
Check after linking bitcodes instead of before. Also fix issue with wrong variable being printed after check Change-Id: I14d219a2f5656c6789d5abbf164a04c27d4ab395
1 parent e710ee9 commit 6d3333a

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

amd/comgr/docs/ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ unbundling.
128128
- Add git branch and commit hash for Comgr, and commit hash for LLVM to log
129129
output for Comgr actions. This can help us debug issues more quickly in cases
130130
where reporters provide Comgr logs.
131+
- Fix multiple bugs with mangled names test
131132

132133
New Targets
133134
-----------

amd/comgr/test/mangled_names_test.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,28 @@ int main(int argc, char *argv[]) {
116116
exit(1);
117117
}
118118

119+
Status = amd_comgr_create_data_set(&DataSetLinked);
120+
checkError(Status, "amd_comgr_create_data_set");
121+
122+
Status = amd_comgr_do_action(AMD_COMGR_ACTION_LINK_BC_TO_BC, DataAction,
123+
DataSetBc, DataSetLinked);
124+
checkError(Status, "amd_comgr_do_action");
125+
126+
Status = amd_comgr_action_data_count(DataSetLinked, AMD_COMGR_DATA_KIND_BC,
127+
&Count);
128+
checkError(Status, "amd_comgr_action_data_count");
129+
130+
if (Count != 1) {
131+
printf("AMD_COMGR_ACTION_LINK_BC_TO_BC Failed: "
132+
"produced %zu BC objects (expected 1)\n",
133+
Count);
134+
exit(1);
135+
}
136+
119137
// Get bitcode mangled names
120138
amd_comgr_data_t DataBc;
121139

122-
Status = amd_comgr_action_data_get_data(DataSetBc,
140+
Status = amd_comgr_action_data_get_data(DataSetLinked,
123141
AMD_COMGR_DATA_KIND_BC,
124142
0, &DataBc);
125143
checkError(Status, "amd_comgr_action_data_get_data");
@@ -158,7 +176,7 @@ int main(int argc, char *argv[]) {
158176
if (numNames != 2) {
159177
printf("amd_populate_mangled_names Failed: "
160178
"produced %zu bitcode names (expected 2)\n",
161-
Count);
179+
numNames);
162180
exit(1);
163181
}
164182

@@ -183,24 +201,6 @@ int main(int argc, char *argv[]) {
183201
free(mName);
184202
}
185203

186-
Status = amd_comgr_create_data_set(&DataSetLinked);
187-
checkError(Status, "amd_comgr_create_data_set");
188-
189-
Status = amd_comgr_do_action(AMD_COMGR_ACTION_LINK_BC_TO_BC, DataAction,
190-
DataSetBc, DataSetLinked);
191-
checkError(Status, "amd_comgr_do_action");
192-
193-
Status = amd_comgr_action_data_count(DataSetLinked, AMD_COMGR_DATA_KIND_BC,
194-
&Count);
195-
checkError(Status, "amd_comgr_action_data_count");
196-
197-
if (Count != 1) {
198-
printf("AMD_COMGR_ACTION_LINK_BC_TO_BC Failed: "
199-
"produced %zu BC objects (expected 1)\n",
200-
Count);
201-
exit(1);
202-
}
203-
204204
Status = amd_comgr_create_data_set(&DataSetReloc);
205205
checkError(Status, "amd_comgr_create_data_set");
206206

0 commit comments

Comments
 (0)