mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-14 04:57:33 +00:00
4797826e17
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
17 lines
460 B
LLVM
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
|
|
}
|