Skip to content

Commit 87ac65a

Browse files
authored
[flang] Match the length size in comparison (NFC) (#78302)
The template function call CheckDescriptorEqInt((exitStat.get(), 127) is deduced to have INT_T equal to std::int32_t instead of std::int64_t, but the length descriptor points to a 64-byte storage. The comparison does not work in a big endian. Co-authored-by: Mark Danial <[email protected]>
1 parent fe4d502 commit 87ac65a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

flang/unittests/Runtime/CommandTest.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ TEST_F(ZeroArguments, ECLValidCommandAndPadSync) {
319319
(*command.get(), wait, exitStat.get(), cmdStat.get(), cmdMsg.get());
320320

321321
std::string spaces(cmdMsg->ElementBytes(), ' ');
322-
CheckDescriptorEqInt(exitStat.get(), 0);
323-
CheckDescriptorEqInt(cmdStat.get(), 0);
322+
CheckDescriptorEqInt<std::int64_t>(exitStat.get(), 0);
323+
CheckDescriptorEqInt<std::int64_t>(cmdStat.get(), 0);
324324
CheckDescriptorEqStr(cmdMsg.get(), "No change");
325325
}
326326

@@ -334,8 +334,8 @@ TEST_F(ZeroArguments, ECLValidCommandStatusSetSync) {
334334
RTNAME(ExecuteCommandLine)
335335
(*command.get(), wait, exitStat.get(), cmdStat.get(), cmdMsg.get());
336336

337-
CheckDescriptorEqInt(exitStat.get(), 0);
338-
CheckDescriptorEqInt(cmdStat.get(), 0);
337+
CheckDescriptorEqInt<std::int64_t>(exitStat.get(), 0);
338+
CheckDescriptorEqInt<std::int64_t>(cmdStat.get(), 0);
339339
CheckDescriptorEqStr(cmdMsg.get(), "No change");
340340
}
341341

@@ -351,9 +351,9 @@ TEST_F(ZeroArguments, ECLInvalidCommandErrorSync) {
351351
#ifdef _WIN32
352352
CheckDescriptorEqInt(exitStat.get(), 1);
353353
#else
354-
CheckDescriptorEqInt(exitStat.get(), 127);
354+
CheckDescriptorEqInt<std::int64_t>(exitStat.get(), 127);
355355
#endif
356-
CheckDescriptorEqInt(cmdStat.get(), 3);
356+
CheckDescriptorEqInt<std::int64_t>(cmdStat.get(), 3);
357357
CheckDescriptorEqStr(cmdMsg.get(), "Invalid command lineXXXX");
358358
}
359359

@@ -387,7 +387,7 @@ TEST_F(ZeroArguments, ECLValidCommandAndExitStatNoChangeAndCMDStatusSetAsync) {
387387
(*command.get(), wait, exitStat.get(), cmdStat.get(), cmdMsg.get());
388388

389389
CheckDescriptorEqInt(exitStat.get(), 404);
390-
CheckDescriptorEqInt(cmdStat.get(), 0);
390+
CheckDescriptorEqInt<std::int64_t>(cmdStat.get(), 0);
391391
CheckDescriptorEqStr(cmdMsg.get(), "No change");
392392
}
393393

0 commit comments

Comments
 (0)