[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2003-07-21-ExternalConstant.ll

John Criswell criswell at choi.cs.uiuc.edu
Mon Jul 21 14:43:03 PDT 2003


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

2003-07-21-ExternalConstant.ll added (r1.1)

---
Log message:

Regression test for the Instruction Combining optimizization.
This test helps to see if the optimization correctly handles variables that
are declared constant and external.


---
Diffs of the changes:

Index: llvm/test/Regression/Transforms/InstCombine/2003-07-21-ExternalConstant.ll
diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2003-07-21-ExternalConstant.ll:1.1
*** /dev/null	Mon Jul 21 14:42:01 2003
--- llvm/test/Regression/Transforms/InstCombine/2003-07-21-ExternalConstant.ll	Mon Jul 21 14:41:51 2003
***************
*** 0 ****
--- 1,46 ----
+ ;
+ ; Test: ExternalConstant
+ ;
+ ; Description:
+ ;	This regression test helps check whether the instruction combining
+ ;	optimization pass correctly handles global variables which are marked
+ ;	as external and constant.
+ ;
+ ;	If a problem occurs, we should die on an assert().  Otherwise, we
+ ;	should pass through the optimizer without failure.
+ ;
+ ; Extra code:
+ ; RUN: as < %s | opt -instcombine
+ ;
+ 
+ target endian = little
+ target pointersize = 32
+ %silly = external constant int		; <int*> [#uses=1]
+ 
+ implementation   ; Functions:
+ 
+ declare void %bzero(sbyte*, uint)
+ 
+ declare void %bcopy(sbyte*, sbyte*, uint)
+ 
+ declare int %bcmp(sbyte*, sbyte*, uint)
+ 
+ declare int %fputs(sbyte*, sbyte*)
+ 
+ declare int %fputs_unlocked(sbyte*, sbyte*)
+ 
+ int %function(int %a.1) {
+ entry:		; No predecessors!
+ 	%a.0 = alloca int		; <int*> [#uses=2]
+ 	%result = alloca int		; <int*> [#uses=2]
+ 	store int %a.1, int* %a.0
+ 	%tmp.0 = load int* %a.0		; <int> [#uses=1]
+ 	%tmp.1 = load int* %silly		; <int> [#uses=1]
+ 	%tmp.2 = add int %tmp.0, %tmp.1		; <int> [#uses=1]
+ 	store int %tmp.2, int* %result
+ 	br label %return
+ 
+ return:		; preds = %entry
+ 	%tmp.3 = load int* %result		; <int> [#uses=1]
+ 	ret int %tmp.3
+ }





More information about the llvm-commits mailing list