aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2014-11-25 12:44:18 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2014-11-25 12:44:18 +0000
commit521b1af4ea51a137ed35a82209ab50f5049cfc96 (patch)
tree24fc0cb68a2ac8fd29d7f87bdd646cdb4b7ba7f1 /contrib
parent993a751eb3caae5ad8b1df4fc3e2ed63fec1dc36 (diff)
downloadsrc-521b1af4ea51a137ed35a82209ab50f5049cfc96.tar.gz
src-521b1af4ea51a137ed35a82209ab50f5049cfc96.zip
Only pass 6 arguments to the 'run' function on amd64. amd64's
makecontext on FreeBSD only supports a maximum of 6 arguments. This fixes the setcontext_link test on amd64. PR: 194828
Notes
Notes: svn path=/head/; revision=275033
Diffstat (limited to 'contrib')
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_getcontext.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c b/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c
index ed43df57eb04..46c0ff1a71f7 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c
@@ -51,7 +51,11 @@ run(int n, ...)
ATF_REQUIRE_EQ(n, DEPTH - calls - 1);
va_start(va, n);
+#if defined(__FreeBSD__) && defined(__amd64__)
+ for (i = 0; i < 5; i++) {
+#else
for (i = 0; i < 9; i++) {
+#endif
ia = va_arg(va, int);
ATF_REQUIRE_EQ(i, ia);
}
@@ -101,13 +105,6 @@ ATF_TC_BODY(setcontext_link, tc)
ucontext_t save;
volatile int i = 0; /* avoid longjmp clobbering */
-#ifdef __FreeBSD__
-#ifdef __amd64__
- atf_tc_expect_fail("setcontext in this testcase fails on "
- "FreeBSD/amd64 with rc == -1/errno == EINVAL; see PR # 194828");
-#endif
-#endif
-
for (i = 0; i < DEPTH; ++i) {
ATF_REQUIRE_EQ(getcontext(&uc[i]), 0);
@@ -115,21 +112,20 @@ ATF_TC_BODY(setcontext_link, tc)
uc[i].uc_stack.ss_size = STACKSZ;
uc[i].uc_link = (i > 0) ? &uc[i - 1] : &save;
+#if defined(__FreeBSD__) && defined(__amd64__)
+ /* FreeBSD/amd64 only permits up to 6 arguments. */
+ makecontext(&uc[i], (void *)run, 6, i,
+ 0, 1, 2, 3, 4);
+#else
makecontext(&uc[i], (void *)run, 10, i,
0, 1, 2, 3, 4, 5, 6, 7, 8);
+#endif
}
ATF_REQUIRE_EQ(getcontext(&save), 0);
-#ifdef __FreeBSD__
- if (calls == 0) {
- int rc = setcontext(&uc[DEPTH-1]);
- ATF_REQUIRE_EQ_MSG(rc, 0, "%d != 0; (errno = %d)", rc, errno);
- }
-#else
if (calls == 0)
ATF_REQUIRE_EQ(setcontext(&uc[DEPTH-1]), 0);
-#endif
}
ATF_TP_ADD_TCS(tp)