[llvm-commits] CVS: llvm/test/Programs/LLVMSource/InvokeUnwind.ll

Chris Lattner lattner at cs.uiuc.edu
Sun Aug 24 07:56:00 PDT 2003


Changes in directory llvm/test/Programs/LLVMSource:

InvokeUnwind.ll added (r1.1)

---
Log message:

New testcase for the llvm.unwind intrinsic


---
Diffs of the changes:

Index: llvm/test/Programs/LLVMSource/InvokeUnwind.ll
diff -c /dev/null llvm/test/Programs/LLVMSource/InvokeUnwind.ll:1.1
*** /dev/null	Sun Aug 24 07:54:16 2003
--- llvm/test/Programs/LLVMSource/InvokeUnwind.ll	Sun Aug 24 07:54:06 2003
***************
*** 0 ****
--- 1,28 ----
+ ; Test to make sure the invoke instruction and llvm.unwind intrinsic are 
+ ; working...
+ 
+ implementation
+ 
+ declare void %llvm.unwind()
+ declare void %abort()
+ 
+ internal void %throw(bool %ShouldThrow) {
+ 	br bool %ShouldThrow, label %Throw, label %NoThrow
+ Throw:
+ 	call void %llvm.unwind()
+ 	call void %abort()           ;;; dead
+ 	ret void
+ NoThrow:
+ 	ret void
+ }
+ 
+ int %main() {
+ 	invoke void %throw(bool false) to label %Cont except label %Abort
+ Cont:
+ 	invoke void %throw(bool true) to label %Abort except label %Exc
+ Abort:
+ 	call void %abort()
+ 	ret int 1
+ Exc:
+ 	ret int 0
+ }





More information about the llvm-commits mailing list