Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: gcc/gcc/testsuite/g++.dg/eh/init-temp1.C

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/gcc/testsuite/g++.dg/eh/builtin3.C ('k') | gcc/gcc/testsuite/g++.dg/eh/simd-1.C » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/gcc/testsuite/g++.dg/eh/init-temp1.C
diff --git a/gcc/gcc/testsuite/g++.dg/eh/init-temp1.C b/gcc/gcc/testsuite/g++.dg/eh/init-temp1.C
index 29eae6972d63629e17dd79fb76e220088df3a911..529014f497f2052ca5fc94ac035e28f3d5983463 100644
--- a/gcc/gcc/testsuite/g++.dg/eh/init-temp1.C
+++ b/gcc/gcc/testsuite/g++.dg/eh/init-temp1.C
@@ -1,19 +1,24 @@
// PR c++/15764
+// { dg-do run }
extern "C" void abort ();
-int counter = 0;
int thrown;
-struct a {
- ~a () { if (thrown++ == 0) throw 42; }
+
+int as;
+struct a {
+ a () { ++as; }
+ ~a () { --as; if (thrown++ == 0) throw 42; }
};
int f (a const&) { return 1; }
int f (a const&, a const&) { return 1; }
-
+
+int bs;
+int as_sav;
struct b {
- b (...) { ++counter; }
- ~b () { --counter; }
+ b (...) { ++bs; }
+ ~b () { --bs; as_sav = as; }
};
bool p;
@@ -29,7 +34,12 @@ int main () {
g();
}
- catch (...) {}
+ catch (...) {}
+
+ // We throw when the first a is destroyed, which should destroy b before
+ // the other a.
+ if (as_sav != 1)
+ abort ();
thrown = 0;
try {
@@ -39,6 +49,6 @@ int main () {
}
catch (...) {}
- if (counter != 0)
+ if (bs != 0)
abort ();
}
« no previous file with comments | « gcc/gcc/testsuite/g++.dg/eh/builtin3.C ('k') | gcc/gcc/testsuite/g++.dg/eh/simd-1.C » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698