summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-930513-1.c
blob: 88fbd6048f20eec3b5880fd73d5541fe5da8cf39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
   930513-1.c from the execute part of the gcc torture suite.
 */

#include <testfwk.h>
#include <stdio.h>

char buf[12];

void f (int (*fp)(char *, const char *, ...))
{
  (*fp)(buf, "%.0f", 5.0);
}

void
testTortureExecute (void)
{
#if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
  f (&sprintf);
  ASSERT ((buf[0] == '<' && buf[1] == 'N') ||   // "<NO FLOAT>""
          (buf[0] == '5' && buf[1] == 0));      // "5"
#endif
}