This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/9] Gccgo port to s390[x] -- part I


A test case added to golang for the previous patch.

gcc/testsuite/ChangeLog
2014-09-05  Dominik Vogt  <vogt@linux.vnet.ibm.com>

        * go.test/test/recover.go (test1): Test recover() from deferred
        recursive function.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany
>From a3cc3d043d580d083f5dd573cb66d299cd985604 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Tue, 9 Sep 2014 09:30:09 +0100
Subject: [PATCH 2/9] TEST: Add a recover test.

---
 gcc/testsuite/go.test/test/recover.go | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gcc/testsuite/go.test/test/recover.go b/gcc/testsuite/go.test/test/recover.go
index 071be66..b31b5ac 100644
--- a/gcc/testsuite/go.test/test/recover.go
+++ b/gcc/testsuite/go.test/test/recover.go
@@ -113,10 +113,23 @@ func withoutRecover() {
 	mustNotRecover() // because it's a sub-call
 }
 
+func withoutRecoverRecursive(n int) {
+	if (n == 0) {
+		withoutRecoverRecursive(1)
+	} else {
+		v := recover()
+		if v != nil {
+			println("spurious recover (recursive)", v)
+			die()
+		}
+	}
+}
+
 func test1() {
 	defer mustNotRecover() // because mustRecover will squelch it
 	defer mustRecover(1)   // because of panic below
 	defer withoutRecover() // should be no-op, leaving for mustRecover to find
+	defer withoutRecoverRecursive(0) // ditto
 	panic(1)
 }
 
-- 
1.8.4.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]