]> granicus.if.org Git - llvm/commit
[llvm-profdata] Reinstate tools/llvm-profdata/malformed-ptr-to-counter-array.test
authorVedant Kumar <vsk@apple.com>
Tue, 15 Oct 2019 17:53:48 +0000 (17:53 +0000)
committerVedant Kumar <vsk@apple.com>
Tue, 15 Oct 2019 17:53:48 +0000 (17:53 +0000)
commit005139adc83294dffb6b787c4ff7d1b05b8ce202
tree9f0dfe8047d39b7ce380c42787c16abf2dd2c898
parentb62ebb253e823367de4da4c1e17bfd531554d01e
[llvm-profdata] Reinstate tools/llvm-profdata/malformed-ptr-to-counter-array.test

I removed this test to unblock the ARM bots while looking into failures
(r374915), and am reinstating it now with a fix.

I believe the problem was that counter ptr address I used,
'\0\0\6\0\1\0\0\1', set the high bits of the pointer, not the low bits
like I wanted. On x86_64 this superficially looks like it tests r370826,
but it doesn't, as it would have been caught before r370826. However, on
ARM (or, 32-bit hosts more generally), I suspect the high bits were
cleared, and you get a 'valid' profile.

I verified that setting the *low* bits of the pointer does trigger the
new condition:

-// Note: The CounterPtr here is off-by-one. This should trigger a malformed profile error.
-RUN: printf '\0\0\6\0\1\0\0\1' >> %t.profraw
+// Note: The CounterPtr here is off-by-one.
+//
+// Octal '\11' is 9 in decimal: this should push CounterOffset to 1. As there are two counters,
+// the profile reader should error out.
+RUN: printf '\11\0\6\0\1\0\0\0' >> %t.profraw

This reverts commit c7cf5b3e4b918c9769fd760f28485b8d943ed968.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374927 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-profdata/malformed-ptr-to-counter-array.test [new file with mode: 0644]