2006-12-02 20:34:08 +00:00
|
|
|
; This test checks to make sure that constant exprs fold in some simple
|
|
|
|
; situations
|
2004-01-13 05:32:27 +00:00
|
|
|
|
Convert all tests using TCL-style quoting to use shell-style quoting.
This was done through the aid of a terrible Perl creation. I will not
paste any of the horrors here. Suffice to say, it require multiple
staged rounds of replacements, state carried between, and a few
nested-construct-parsing hacks that I'm not proud of. It happens, by
luck, to be able to deal with all the TCL-quoting patterns in evidence
in the LLVM test suite.
If anyone is maintaining large out-of-tree test trees, feel free to poke
me and I'll send you the steps I used to convert things, as well as
answer any painful questions etc. IRC works best for this type of thing
I find.
Once converted, switch the LLVM lit config to use ShTests the same as
Clang. In addition to being able to delete large amounts of Python code
from 'lit', this will also simplify the entire test suite and some of
lit's architecture.
Finally, the test suite runs 33% faster on Linux now. ;]
For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159525 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 12:47:22 +00:00
|
|
|
; RUN: llvm-as < %s | llvm-dis | not grep "("
|
2014-08-19 21:08:27 +00:00
|
|
|
; RUN: verify-uselistorder %s
|
2004-01-13 05:32:27 +00:00
|
|
|
|
2008-02-16 23:27:24 +00:00
|
|
|
@A = global i64 0
|
2004-01-13 05:32:27 +00:00
|
|
|
|
2008-02-16 23:27:24 +00:00
|
|
|
global i64* inttoptr (i64 add (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X + 0 == X
|
|
|
|
global i64* inttoptr (i64 sub (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X - 0 == X
|
|
|
|
global i64* inttoptr (i64 mul (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X * 0 == 0
|
|
|
|
global i64* inttoptr (i64 sdiv (i64 ptrtoint (i64* @A to i64), i64 1) to i64*) ; X / 1 == X
|
|
|
|
global i64* inttoptr (i64 srem (i64 ptrtoint (i64* @A to i64), i64 1) to i64*) ; X % 1 == 0
|
|
|
|
global i64* inttoptr (i64 and (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X & 0 == 0
|
|
|
|
global i64* inttoptr (i64 and (i64 ptrtoint (i64* @A to i64), i64 -1) to i64*) ; X & -1 == X
|
|
|
|
global i64 or (i64 ptrtoint (i64* @A to i64), i64 -1) ; X | -1 == -1
|
|
|
|
global i64* inttoptr (i64 xor (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X ^ 0 == X
|
2004-01-13 05:32:27 +00:00
|
|
|
|
2008-02-16 23:27:24 +00:00
|
|
|
%Ty = type { i32, i32 }
|
|
|
|
@B = external global %Ty
|
2004-01-13 05:32:27 +00:00
|
|
|
|
2008-02-16 23:27:24 +00:00
|
|
|
global i1 icmp slt (i64* @A, i64* getelementptr (i64* @A, i64 1)) ; true
|
2009-09-20 04:27:06 +00:00
|
|
|
global i1 icmp ult (i64* @A, i64* getelementptr (i64* @A, i64 1)) ; true
|
2008-02-16 23:27:24 +00:00
|
|
|
global i1 icmp slt (i64* @A, i64* getelementptr (i64* @A, i64 0)) ; false
|
|
|
|
global i1 icmp slt (i32* getelementptr (%Ty* @B, i64 0, i32 0),
|
|
|
|
i32* getelementptr (%Ty* @B, i64 0, i32 1)) ; true
|
2008-02-17 00:09:08 +00:00
|
|
|
;global i1 icmp ne (i64* @A, i64* bitcast (%Ty* @B to i64*)) ; true
|
2004-01-13 05:32:27 +00:00
|
|
|
|
2008-04-19 22:17:26 +00:00
|
|
|
; PR2206
|
|
|
|
@cons = weak global i32 0, align 8 ; <i32*> [#uses=1]
|
|
|
|
global i64 and (i64 ptrtoint (i32* @cons to i64), i64 7)
|
|
|
|
|