Fix test hip_bitextract.cpp (#1784)

The randomly generated offset+width may exceeds 32, which causes
a left shift operation with 32-offset-width. As an unsigned number
that is greater than 32 and causes undefined behavior. When the
test is compiled without -mavx it is still OK. However when
the test is compiled with -mavx, the undefined behavior causes
wrong results and test failure.

This patch adjusts width so that offset+width<=32 always.

[ROCm/clr commit: 55525fa466]
이 커밋은 다음에 포함됨:
Yaxun (Sam) Liu 작성하고 Maneesh Gupta가 2020-01-10 13:46:57 +05:30를 커밋함
1 부모 d814f1e292
커밋 87887f6152
1 파일이 변경됨
+2
+2
파일 보기
@@ -123,6 +123,8 @@ int main() {
hostSrc032[i] = uint32_src0_dist(rd);
hostSrc132[i] = uint32_src12_dist(rd);
hostSrc232[i] = uint32_src12_dist(rd);
if (hostSrc132[i] + hostSrc232[i] > 32)
hostSrc232[i] = 32 - hostSrc132[i];
hostOut64[i] = 0;
hostSrc064[i] = uint64_src0_dist(rd);
hostSrc164[i] = uint64_src12_dist(rd);