This is an archive of the discontinued LLVM Phabricator instance.

[OMPT] Fix cast and printf of wait_id in lock test
ClosedPublic

Authored by Hahnfeld on Jan 9 2018, 2:08 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

Hahnfeld created this revision.Jan 9 2018, 2:08 AM
protze.joachim accepted this revision.Jan 9 2018, 9:30 AM

I would have expected, that

printf("%" PRIu64 ": &lock: %lu\n", ompt_get_thread_data()->value, (unsigned long) &lock);

would also fix the issue.

But (uint64_t) &lock actually extends the 32-bit address to 64-bit signed integer: fffef9c8 -> fffffffffffef9c8
This is the same value as provided by the callback function.

The spec only requires a unique identifier here, so this behavior is fine.

This revision is now accepted and ready to land.Jan 9 2018, 9:30 AM

But (uint64_t) &lock actually extends the 32-bit address to 64-bit signed integer: fffef9c8 -> fffffffffffef9c8
This is the same value as provided by the callback function.

Yes, that's the "problem": For FileCheck to succeed, the value needs to be the same.

This revision was automatically updated to reflect the committed changes.