llvm-6502/test/Transforms/DSAnalysis/physicalsubtype.ll
John Criswell 4797826e17 Changed all of these tests to be TestRunner tests (or, at least they can be
TestRunner tests).
This makes creating the new test database class easier to implement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8841 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-03 18:42:25 +00:00

17 lines
460 B
LLVM

; A test for "physical subtyping" used in some C programs...
;
; RUN: analyze %s -tddatastructure
;
%ST = type { int, int* } ; "Subtype"
%DT = type { int, int*, int } ; "derived type"
int %test(%DT* %DT) {
%DTp = getelementptr %DT* %DT, long 0, ubyte 0
%A = load int* %DTp
%ST = cast %DT* %DT to %ST*
%STp = getelementptr %ST* %ST, long 0, ubyte 0
%B = load int* %STp
%C = sub int %A, %B ; A & B are equal, %C = 0
ret int %C
}