summary refs log tree commit diff
path: root/stdlib/tst-atof1.c
blob: 879d866558407b7df574c44b55ecadcaa122b471 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

static int
do_test (void)
{
  char buf[100];
  snprintf (buf, sizeof (buf), "%g", atof ("0x10p-1"));
  if (strcmp (buf, "8") != 0)
    {
      printf ("got \"%s\", expected \"8\"\n", buf);
      return 1;
    }
  return 0;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"