[llvm-commits] CVS: llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll

Chris Lattner lattner at cs.uiuc.edu
Mon Jun 16 07:06:00 PDT 2003


Changes in directory llvm/test/Regression/Transforms/DSAnalysis:

physicalsubtype.ll added (r1.1)

---
Log message:

New testcases for bugs and the new DAE pass


---
Diffs of the changes:

Index: llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll
diff -c /dev/null llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll:1.1
*** /dev/null	Mon Jun 16 07:05:48 2003
--- llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll	Mon Jun 16 07:05:38 2003
***************
*** 0 ****
--- 1,14 ----
+ ; A test for "physical subtyping" used in some C programs...
+ ;
+ %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
+ }





More information about the llvm-commits mailing list