diff options
Diffstat (limited to 'test/sanitizer_common/TestCases/printf-ldbl.c')
-rw-r--r-- | test/sanitizer_common/TestCases/printf-ldbl.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sanitizer_common/TestCases/printf-ldbl.c b/test/sanitizer_common/TestCases/printf-ldbl.c new file mode 100644 index 0000000000000..f6629ab81c3b3 --- /dev/null +++ b/test/sanitizer_common/TestCases/printf-ldbl.c @@ -0,0 +1,13 @@ +// RUN: %clang %s -o %t && %run %t 2>&1 + +#include <assert.h> +#include <stdio.h> +#include <string.h> + +int main(int argc, char **argv) { + char buf[20]; + long double ld = 4.0; + snprintf(buf, sizeof buf, "%Lf %d", ld, 123); + assert(!strcmp(buf, "4.000000 123")); + return 0; +} |