[llvm-commits] CVS: llvm/test/Regression/Transforms/GlobalConstifier/phi-select.llx

Chris Lattner lattner at cs.uiuc.edu
Sat Aug 14 13:48:08 PDT 2004



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

phi-select.llx added (r1.1)
---
Log message:

New testcase that the constifier should handle


---
Diffs of the changes:  (+29 -0)

Index: llvm/test/Regression/Transforms/GlobalConstifier/phi-select.llx
diff -c /dev/null llvm/test/Regression/Transforms/GlobalConstifier/phi-select.llx:1.1
*** /dev/null	Sat Aug 14 15:48:06 2004
--- llvm/test/Regression/Transforms/GlobalConstifier/phi-select.llx	Sat Aug 14 15:47:56 2004
***************
*** 0 ****
--- 1,29 ----
+ ; Test that PHI nodes and select instructions do not necessarily make stuff
+ ; non-constant.
+ 
+ ; RUN: llvm-as < %s | opt -constify | llvm-dis | not grep global
+ 
+ %X = internal global int 4
+ %Y = internal global int 5
+ 
+ int %test1(bool %C) {
+ 	%P = select bool %C, int* %X, int* %Y
+ 	%V = load int* %P
+ 	ret int %V
+ }
+ 
+ 
+ int %test2(bool %C) {
+ 	br bool %C, label %T, label %Cont
+ T:
+ 	br label %Cont
+ Cont:
+ 	%P = phi int* [%X, %0], [%Y, %T]
+ 	%V = load int* %P
+ 	ret int %V
+ }
+ 
+ 
+ 
+ 
+ 






More information about the llvm-commits mailing list