[llvm-commits] [llvm] r168997 - /llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll

Evgeniy Stepanov eugeni.stepanov at gmail.com
Tue Dec 4 03:43:54 PST 2012


Sorry for the delay. I did something along these lines in r169256.

On Fri, Nov 30, 2012 at 4:24 PM, Chandler Carruth <chandlerc at google.com> wrote:
> On Fri, Nov 30, 2012 at 4:12 AM, Evgeniy Stepanov
> <eugeni.stepanov at gmail.com> wrote:
>> Author: eugenis
>> Date: Fri Nov 30 06:12:20 2012
>> New Revision: 168997
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=168997&view=rev
>> Log:
>> [msan] Tests for vector manipulation instructions.
>>
>> Modified:
>>     llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll
>>
>> Modified: llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll?rev=168997&r1=168996&r2=168997&view=diff
>> ==============================================================================
>> --- llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll (original)
>> +++ llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll Fri Nov 30 06:12:20 2012
>> @@ -305,3 +305,40 @@
>>  ; 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: }
>
> Can you make these tests much more precise and comment what the
> intended behavior is? Look at some of the other LLVM tests. A few
> common patterns:
>
> 1) The function name isn't what needs to be precise. Usually these
> just are "CHECK: @FunctionName"
> 2) The terminator is usually what we check for to end the series
> "CHECK: ret ...", often this will give a tighter bound on mis-fires.
> 3) Comments in tests are really useful. =] Don't underestimate their value.
>
>> +
>> +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> <i32 0, i32 4, i32 1, i32 5>
>> +  ret <4 x i32> %vec2
>> +}
>> +
>> +; CHECK: define <4 x i32> @ShuffleVector
>> +; CHECK: shufflevector
>> +; CHECK-NOT: br
>> +; CHECK: shufflevector
>> +; CHECK: }
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list