[llvm] r205484 - Add test case for [Constant Hoisting] Erase dead cast instructions (r204538).

David Blaikie dblaikie at gmail.com
Thu Apr 3 08:25:10 PDT 2014


On Thu, Apr 3, 2014 at 2:42 AM, Eric Christopher <echristo at gmail.com> wrote:
> On Wed, Apr 2, 2014 at 4:06 PM, Juergen Ributzka <juergen at apple.com> wrote:
>> Author: ributzka
>> Date: Wed Apr  2 18:06:22 2014
>> New Revision: 205484
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=205484&view=rev
>> Log:
>> Add test case for [Constant Hoisting] Erase dead cast instructions (r204538).
>>
>> Added:
>>     llvm/trunk/test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll
>>
>> Added: llvm/trunk/test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll?rev=205484&view=auto
>> ==============================================================================
>> --- llvm/trunk/test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll (added)
>> +++ llvm/trunk/test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll Wed Apr  2 18:06:22 2014
>> @@ -0,0 +1,16 @@
>> +; Test if this compiles without assertions.
>> +; RUN: opt -S -consthoist < %s
>> +
>
> Probably want a REQUIRES:asserts here then? (I mean, I guess not
> really, but since we're just checking that we don't assert you might
> as well only run it if asserts are on).

For that matter - tests that simply test that we don't crash always
seem rather suspect. What is the behavior we expect that we weren't
getting due to the crash being in the way? We should really test for
that.

- David

>
> -eric
>
>> +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
>> +target triple = "x86_64-apple-macosx10.9.0"
>> +
>> +%T = type { i32, i32, i32, i32 }
>> +
>> +define i32 @test1() nounwind {
>> +  %base = inttoptr i32 12345678 to %T*
>> +  %addr1 = getelementptr %T* %base, i32 0, i32 1
>> +  %addr2 = getelementptr %T* %base, i32 0, i32 2
>> +  %addr3 = getelementptr %T* %base, i32 0, i32 3
>> +  ret i32 12345678
>> +}
>> +
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> _______________________________________________
> 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