[compiler-rt] r267967 - [msan] Tests for vector compare intrinsics.
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 28 18:20:06 PDT 2016
Author: eugenis
Date: Thu Apr 28 20:20:05 2016
New Revision: 267967
URL: http://llvm.org/viewvc/llvm-project?rev=267967&view=rev
Log:
[msan] Tests for vector compare intrinsics.
Modified:
compiler-rt/trunk/lib/msan/tests/msan_test.cc
Modified: compiler-rt/trunk/lib/msan/tests/msan_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/msan_test.cc?rev=267967&r1=267966&r2=267967&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/tests/msan_test.cc (original)
+++ compiler-rt/trunk/lib/msan/tests/msan_test.cc Thu Apr 28 20:20:05 2016
@@ -3955,7 +3955,48 @@ TEST(VectorMaddTest, mmx_pmadd_wd) {
EXPECT_EQ((unsigned)(2 * 102 + 3 * 103), c[1]);
}
-#endif // defined(__clang__)
+
+TEST(VectorCmpTest, mm_cmpneq_ps) {
+ V4x32 c;
+ c = _mm_cmpneq_ps(V4x32{Poisoned<U4>(), 1, 2, 3}, V4x32{4, 5, Poisoned<U4>(), 6});
+ EXPECT_POISONED(c[0]);
+ EXPECT_NOT_POISONED(c[1]);
+ EXPECT_POISONED(c[2]);
+ EXPECT_NOT_POISONED(c[3]);
+
+ c = _mm_cmpneq_ps(V4x32{0, 1, 2, 3}, V4x32{4, 5, 6, 7});
+ EXPECT_NOT_POISONED(c);
+}
+
+TEST(VectorCmpTest, mm_cmpneq_sd) {
+ V2x64 c;
+ c = _mm_cmpneq_sd(V2x64{Poisoned<U8>(), 1}, V2x64{2, 3});
+ EXPECT_POISONED(c[0]);
+ c = _mm_cmpneq_sd(V2x64{1, 2}, V2x64{Poisoned<U8>(), 3});
+ EXPECT_POISONED(c[0]);
+ c = _mm_cmpneq_sd(V2x64{1, 2}, V2x64{3, 4});
+ EXPECT_NOT_POISONED(c[0]);
+ c = _mm_cmpneq_sd(V2x64{1, Poisoned<U8>()}, V2x64{2, Poisoned<U8>()});
+ EXPECT_NOT_POISONED(c[0]);
+ c = _mm_cmpneq_sd(V2x64{1, Poisoned<U8>()}, V2x64{1, Poisoned<U8>()});
+ EXPECT_NOT_POISONED(c[0]);
+}
+
+TEST(VectorCmpTest, builtin_ia32_ucomisdlt) {
+ U4 c;
+ c = __builtin_ia32_ucomisdlt(V2x64{Poisoned<U8>(), 1}, V2x64{2, 3});
+ EXPECT_POISONED(c);
+ c = __builtin_ia32_ucomisdlt(V2x64{1, 2}, V2x64{Poisoned<U8>(), 3});
+ EXPECT_POISONED(c);
+ c = __builtin_ia32_ucomisdlt(V2x64{1, 2}, V2x64{3, 4});
+ EXPECT_NOT_POISONED(c);
+ c = __builtin_ia32_ucomisdlt(V2x64{1, Poisoned<U8>()}, V2x64{2, Poisoned<U8>()});
+ EXPECT_NOT_POISONED(c);
+ c = __builtin_ia32_ucomisdlt(V2x64{1, Poisoned<U8>()}, V2x64{1, Poisoned<U8>()});
+ EXPECT_NOT_POISONED(c);
+}
+
+#endif // defined(__x86_64__) && defined(__clang__)
TEST(MemorySanitizerOrigins, SetGet) {
EXPECT_EQ(TrackingOrigins(), !!__msan_get_track_origins());
More information about the llvm-commits
mailing list