This revision was automatically updated to reflect the committed changes.
Closed by commit rL292729: [test] Fix page address logic in clear_cache_test
(authored by mgorny).
Changed prior to commit:
https://reviews.llvm.org/D28849?vs=85208=85248#toc
Repository:
rL LLVM
compnerd accepted this revision.
compnerd added a comment.
This revision is now accepted and ready to land.
Would be nice to clang-format those lines, but its no worse than before.
https://reviews.llvm.org/D28849
___
cfe-commits mailing list
mgorny updated this revision to Diff 85208.
mgorny marked an inline comment as done.
mgorny added a comment.
Fixed the missing change. Also created a local variable to avoid calling the
sysconf three times.
https://reviews.llvm.org/D28849
Files:
test/builtins/Unit/clear_cache_test.c
compnerd added inline comments.
Comment at: test/builtins/Unit/clear_cache_test.c:71
+char* start = (char*)((uintptr_t)execution_buffer & (-get_page_size()));
+char* end = (char*)((uintptr_t)(_buffer[128+4096]) &
(-get_page_size()));
#if defined(_WIN32)
mgorny updated this revision to Diff 84947.
mgorny retitled this revision from "[compiler-rt] [test] Fix page address logic
in clear_cache_test to use binary negation" to "[compiler-rt] [test] Fix page
address logic in clear_cache_test".
mgorny edited the summary of this revision.
mgorny added a
compnerd added a comment.
I wonder if we should take this a bit further. Use something like a
`PAGE_SIZE` constant to avoid this confusion entirely. Furthremore, different
targets could use different page sizes. IIRC, SPARC has a 8K page size by
default.
Repository:
rL LLVM
mgorny created this revision.
Herald added a subscriber: dberris.
Fix the logic used to calculate page address in clear_cache_test to use
the binary negation of 4095 rather than arithmetic. The latter gives
incorrect result since:
-4095 -> 0xf001
~4095 -> 0xf000
Alternatively, -4096