mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-24 06:30:19 +00:00
63540f5cf1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25111 91177308-0d34-0410-b5e6-96231b3b80d8
30 lines
1.6 KiB
Plaintext
30 lines
1.6 KiB
Plaintext
; This test checks to make sure that constant exprs fold in some simple situations
|
|
|
|
; RUN: llvm-as < %s | llvm-dis | not grep '(' &&
|
|
; RUN: llvm-as < %s
|
|
|
|
%A = global long 0
|
|
|
|
global long* cast (long add (long cast (long* %A to long), long 0) to long*) ; X + 0 == X
|
|
global long* cast (long sub (long cast (long* %A to long), long 0) to long*) ; X - 0 == X
|
|
global long* cast (long mul (long cast (long* %A to long), long 0) to long*) ; X * 0 == 0
|
|
global long* cast (long div (long cast (long* %A to long), long 1) to long*) ; X / 1 == X
|
|
global long* cast (long rem (long cast (long* %A to long), long 1) to long*) ; X % 1 == 0
|
|
global long* cast (long and (long cast (long* %A to long), long 0) to long*) ; X & 0 == 0
|
|
global long* cast (long and (long cast (long* %A to long), long -1) to long*) ; X & -1 == X
|
|
global long or (long cast (long* %A to long), long -1) ; X | -1 == -1
|
|
global long* cast (long xor (long cast (long* %A to long), long 0) to long*) ; X ^ 0 == X
|
|
|
|
%Ty = type { int, int }
|
|
%B = external global %Ty
|
|
|
|
global bool setlt (long* %A, long* getelementptr (long* %A, long 1)) ; true
|
|
global bool setlt (long* %A, long* getelementptr (long* %A, long 0)) ; false
|
|
global bool setlt (int* getelementptr (%Ty* %B, long 0, ubyte 0),
|
|
int* getelementptr (%Ty* %B, long 0, ubyte 1)) ; true
|
|
;global bool setne (long* %A, long* cast (%Ty* %B to long*)) ; true
|
|
|
|
global bool seteq ({ short }* cast (int 1 to { short }*), { short }* null)
|
|
global bool setlt ({ short }* cast (int 1 to { short }*), { short }* cast (int 2 to { short }*))
|
|
|