libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] [PATCH 16/57] Default to non-verbose mode in Ltest-cxx


From: Tommi Rantala
Subject: [Libunwind-devel] [PATCH 16/57] Default to non-verbose mode in Ltest-cxx-exceptions
Date: Fri, 21 Sep 2012 14:11:17 +0300

---
 tests/Ltest-cxx-exceptions.cxx |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tests/Ltest-cxx-exceptions.cxx b/tests/Ltest-cxx-exceptions.cxx
index 827ba98..24bcd13 100644
--- a/tests/Ltest-cxx-exceptions.cxx
+++ b/tests/Ltest-cxx-exceptions.cxx
@@ -21,18 +21,17 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
IN AN ACTION
 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <libunwind.h>
+#include "compiler.h"
 
 #define panic(args...)                         \
        { fprintf (stderr, args); exit (-1); }
 
+static int verbose;
+
 struct Test
 {
   public: // --- ctor/dtor ---
@@ -55,13 +54,16 @@ extern "C" void bar()
     throw 5;
   } catch (...) {
     Test t;
-    printf("Throwing an int\n");
+    if (verbose)
+      printf("Throwing an int\n");
     throw 6;
   }
 }
 
-int main()
+int main(int argc, char **argv UNUSED)
 {
+  if (argc > 1)
+    verbose = 1;
   try {
     Test t;
     bar();
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]