From d27ab822c9d84238c87b54250f752736ea5e7498 Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Fri, 30 Nov 2012 12:12:20 +0000 Subject: [PATCH] [msan] Tests for vector manipulation instructions. llvm-svn: 168997 --- .../MemorySanitizer/msan_basic.ll | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test/Instrumentation/MemorySanitizer/msan_basic.ll b/test/Instrumentation/MemorySanitizer/msan_basic.ll index 8d729d6d417..99a44d583b9 100644 --- a/test/Instrumentation/MemorySanitizer/msan_basic.ll +++ b/test/Instrumentation/MemorySanitizer/msan_basic.ll @@ -305,3 +305,40 @@ define i32 @ShadowLoadAlignmentSmall() nounwind uwtable { ; CHECK: load i32* {{.*}} align 2 ; CHECK: load volatile i32* {{.*}} align 2 ; CHECK: } + + +; Test vector manipulation instructions. + +define i32 @ExtractElement(<4 x i32> %vec, i32 %idx) { + %x = extractelement <4 x i32> %vec, i32 %idx + ret i32 %x +} + +; CHECK: define i32 @ExtractElement +; CHECK: extractelement +; CHECK: br +; CHECK: extractelement +; CHECK: } + +define <4 x i32> @InsertElement(<4 x i32> %vec, i32 %idx, i32 %x) { + %vec1 = insertelement <4 x i32> %vec, i32 %x, i32 %idx + ret <4 x i32> %vec1 +} + +; CHECK: define <4 x i32> @InsertElement +; CHECK: insertelement +; CHECK: br +; CHECK: insertelement +; CHECK: } + +define <4 x i32> @ShuffleVector(<4 x i32> %vec, <4 x i32> %vec1) { + %vec2 = shufflevector <4 x i32> %vec, <4 x i32> %vec1, + <4 x i32> + ret <4 x i32> %vec2 +} + +; CHECK: define <4 x i32> @ShuffleVector +; CHECK: shufflevector +; CHECK-NOT: br +; CHECK: shufflevector +; CHECK: }