14 lines · c
1// RUN: %clang %s -o %t && %run %t 2>&12 3#include <assert.h>4#include <stdio.h>5#include <string.h>6 7int main(int argc, char **argv) {8 char buf[20];9 long double ld = 4.0;10 snprintf(buf, sizeof buf, "%Lf %d", ld, 123);11 assert(!strcmp(buf, "4.000000 123"));12 return 0;13}14