chiark / gitweb /
Add half-hearted support for Clang, because its `blocks' are deficient.
[finally] / finally-test.c
index e95f16bd9294605ca2016bbdeea780f0dcf5d6f2..d33ff70159ce22f47e3a85307eee2a48e3aad7a6 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <stdio.h>
 
+#define FINALLY_TOLERATE_BUG_CAPTURE_COPIES 1
 #include "finally.h"
 #include "finally-test.h"
 
@@ -59,6 +60,7 @@ static int test_ordering(void)
   return (3);
 }
 
+#ifndef FINALLY_BUG_CAPTURE_COPIES
 static int test_capture(void)
 {
   int n = -1; FINALLY({ STEP(n); });
@@ -66,6 +68,7 @@ static int test_capture(void)
   STEP(0);
   n = 1; return (2);
 }
+#endif
 
 static int test_internal_block(void)
 {
@@ -146,7 +149,11 @@ int main(void)
   RUNTEST(softball);
   RUNTEST(ordering);
   RUNTEST(local_xfer);
+#ifndef FINALLY_BUG_CAPTURE_COPIES
   RUNTEST(capture);
+#else
+  SKIPTEST(capture, "selected flavour captures copies");
+#endif
   RUNTEST(internal_block);
 #if defined(HAVE_FEXCEPTIONS)
   RUNTEST(try_catch);