diff --git a/argp/Makefile b/argp/Makefile
index 6e4799c220..8ca95c70a0 100644
--- a/argp/Makefile
+++ b/argp/Makefile
@@ -35,4 +35,16 @@ CFLAGS-argp-fmtstream.c += -fexceptions
 bug-argp1-ARGS = -- --help
 bug-argp2-ARGS = -- -d 111 --dstaddr 222 -p 333 --peer 444
 
+tests-internal += tst-ldbl-argp-error tst-ldbl-argp-failure
+
+ifeq ($(run-built-tests),yes)
+tests-special += $(objpfx)tst-ldbl-argp-error.out
+tests-special += $(objpfx)tst-ldbl-argp-failure.out
+endif
+
+$(objpfx)tst-ldbl-argp-%.out: \
+  tst-ldbl-argp-%.sh $(objpfx)tst-ldbl-argp-%
+	$(SHELL) $^ '$(test-program-prefix)' $@; \
+	$(evaluate-test)
+
 include ../Rules
diff --git a/argp/tst-ldbl-argp-error.c b/argp/tst-ldbl-argp-error.c
new file mode 100644
index 0000000000..8b24bd984d
--- /dev/null
+++ b/argp/tst-ldbl-argp-error.c
@@ -0,0 +1,3 @@
+#define ARGP_FUNCTION		argp_error
+#define ARGP_FUNCTION_PARAMS	(state, "%Lf%f%Lf%f", (long double) -1, (double) -2, (long double) -3, (double) -4)
+#include <tst-ldbl-argp-template.c>
diff --git a/argp/tst-ldbl-argp-error.sh b/argp/tst-ldbl-argp-error.sh
new file mode 100644
index 0000000000..49a3c62ce9
--- /dev/null
+++ b/argp/tst-ldbl-argp-error.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+# Testing of long double conversions in argp_error.
+# Copyright (C) 2018 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library; if not, see
+# <http://www.gnu.org/licenses/>.
+
+set -e
+
+test_program=$1; shift
+test_program_prefix=$1; shift
+test_program_output=$1; shift
+
+status=0
+
+# Allow argp_error to end with non-zero exit status, run the test
+# program, then restore the exit-on-error behavior
+set +e
+${test_program_prefix} \
+  ${test_program} \
+  2> ${test_program_output}
+set -e
+
+cat <<'EOF' |
+test-argp: -1.000000-2.000000-3.000000-4.000000
+Try `test-argp --help' or `test-argp --usage' for more information.
+EOF
+cmp - ${test_program_output} > /dev/null 2>&1 ||
+{
+  status=1
+  echo "*** output comparison failed"
+}
+
+exit $status
diff --git a/argp/tst-ldbl-argp-failure.c b/argp/tst-ldbl-argp-failure.c
new file mode 100644
index 0000000000..92a82ceadb
--- /dev/null
+++ b/argp/tst-ldbl-argp-failure.c
@@ -0,0 +1,3 @@
+#define ARGP_FUNCTION		argp_failure
+#define ARGP_FUNCTION_PARAMS	(state, 0, 0, "%Lf%f%Lf%f", (long double) -1, (double) -2, (long double) -3, (double) -4)
+#include <tst-ldbl-argp-template.c>
diff --git a/argp/tst-ldbl-argp-failure.sh b/argp/tst-ldbl-argp-failure.sh
new file mode 100644
index 0000000000..f3f251702a
--- /dev/null
+++ b/argp/tst-ldbl-argp-failure.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+# Testing of long double conversions in argp_failure.
+# Copyright (C) 2018 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library; if not, see
+# <http://www.gnu.org/licenses/>.
+
+set -e
+
+test_program=$1; shift
+test_program_prefix=$1; shift
+test_program_output=$1; shift
+
+status=0
+
+# Allow argp_failure to end with non-zero exit status, run the test
+# program, then restore the exit-on-error behavior
+set +e
+${test_program_prefix} \
+  ${test_program} \
+  2> ${test_program_output}
+set -e
+
+cat <<'EOF' |
+test-argp: -1.000000-2.000000-3.000000-4.000000
+EOF
+cmp - ${test_program_output} > /dev/null 2>&1 ||
+{
+  status=1
+  echo "*** output comparison failed"
+}
+
+exit $status
diff --git a/argp/tst-ldbl-argp-template.c b/argp/tst-ldbl-argp-template.c
new file mode 100644
index 0000000000..f52cd352e5
--- /dev/null
+++ b/argp/tst-ldbl-argp-template.c
@@ -0,0 +1,69 @@
+/* Testing of long double conversions in argp.h functions.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <argp.h>
+#include <string.h>
+
+#include <support/check.h>
+
+static const struct argp_option
+options[] =
+{
+  { "test", 't', "format", 0, "Run argp function with a format string", 0 },
+  { NULL, 0, NULL, 0, NULL }
+};
+
+static error_t
+parser (int key, char *arg, struct argp_state *state)
+{
+  switch (key)
+    {
+      case 't':
+	ARGP_FUNCTION ARGP_FUNCTION_PARAMS;
+	break;
+      default:
+	return ARGP_ERR_UNKNOWN;
+    }
+  return 0;
+}
+
+static struct argp
+argp =
+{
+  options, parser
+};
+
+static int
+do_test (void)
+{
+  int remaining;
+  int argc = 3;
+  char *argv[4] =
+    {
+      (char *) "test-argp",
+      (char *) "--test",
+      (char *) "%Lf - %f - %Lf - %f",
+      NULL
+    };
+
+  argp_parse (&argp, argc, argv, 0, &remaining, NULL);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
