llvm-project
56d319e7 - [Support] Fix LEB128 test when building with MSVC (#93184)

Commit
1 year ago
[Support] Fix LEB128 test when building with MSVC (#93184) The VALUE expansion might be compiled in the different ways, because of string pooling which isn't always enabled/guaranteed. When building with MSVC, previously I was seeing for example empty strings `""` pointing to different addresses, thus the negative offsets below in the log. Previous test log: ``` Note: Google Test filter = LEB128Test.DecodeInvalidULEB128 [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from LEB128Test [ RUN ] LEB128Test.DecodeInvalidULEB128 C:\src\git\llvm-project\llvm\unittests\Support\LEB128Test.cpp(167): error: Expected equality of these values: 0u Which is: 0 Value - reinterpret_cast<const uint8_t *>("") Which is: -5 C:\src\git\llvm-project\llvm\unittests\Support\LEB128Test.cpp(168): error: Expected equality of these values: 1u Which is: 1 Value - reinterpret_cast<const uint8_t *>("\x80") Which is: -167 C:\src\git\llvm-project\llvm\unittests\Support\LEB128Test.cpp(171): error: Expected equality of these values: 9u Which is: 9 Value - reinterpret_cast<const uint8_t *>("\x80\x80\x80\x80\x80\x80\x80\x80\x80\x02") Which is: -167 C:\src\git\llvm-project\llvm\unittests\Support\LEB128Test.cpp(172): error: Expected equality of these values: 10u Which is: 10 Value - reinterpret_cast<const uint8_t *>("\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x02") Which is: -166 [ FAILED ] LEB128Test.DecodeInvalidULEB128 (2 ms) [----------] 1 test from LEB128Test (2 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test suite ran. (4 ms total) [ PASSED ] 0 tests. [ FAILED ] 1 test, listed below: [ FAILED ] LEB128Test.DecodeInvalidULEB128 1 FAILED TEST ```
Author
Parents
Loading