view compiler-rt/test/sanitizer_common/TestCases/printf-ldbl.c @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 1d019706d866
children c4bab56944e8
line wrap: on
line source

// 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;
}