~mdw
/
finally
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add half-hearted support for Clang, because its `blocks' are deficient.
[finally]
/
finally-test.c
diff --git
a/finally-test.c
b/finally-test.c
index
e95f16b
..
d33ff70
100644
(file)
--- a/
finally-test.c
+++ b/
finally-test.c
@@
-36,6
+36,7
@@
#include <stdio.h>
#include <stdio.h>
+#define FINALLY_TOLERATE_BUG_CAPTURE_COPIES 1
#include "finally.h"
#include "finally-test.h"
#include "finally.h"
#include "finally-test.h"
@@
-59,6
+60,7
@@
static int test_ordering(void)
return (3);
}
return (3);
}
+#ifndef FINALLY_BUG_CAPTURE_COPIES
static int test_capture(void)
{
int n = -1; FINALLY({ STEP(n); });
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);
}
STEP(0);
n = 1; return (2);
}
+#endif
static int test_internal_block(void)
{
static int test_internal_block(void)
{
@@
-146,7
+149,11
@@
int main(void)
RUNTEST(softball);
RUNTEST(ordering);
RUNTEST(local_xfer);
RUNTEST(softball);
RUNTEST(ordering);
RUNTEST(local_xfer);
+#ifndef FINALLY_BUG_CAPTURE_COPIES
RUNTEST(capture);
RUNTEST(capture);
+#else
+ SKIPTEST(capture, "selected flavour captures copies");
+#endif
RUNTEST(internal_block);
#if defined(HAVE_FEXCEPTIONS)
RUNTEST(try_catch);
RUNTEST(internal_block);
#if defined(HAVE_FEXCEPTIONS)
RUNTEST(try_catch);