summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug1337835.c
blob: 7abccb4090bb771fb71fa99a0aa48b91b7c08a77 (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
24
25
26
27
28
29
/*
   bug1337835.c
*/

#include <testfwk.h>

#ifdef __SDCC
#pragma std_sdcc99
#endif

#include <stdbool.h>

char e;

void foo (unsigned long ul, bool b, char c) __reentrant
{
	if (b && (long) ul < 0)
		e = 0;
	if (ul && b && c)
		e = 1;
}

void
test_1337835(void)
{
  e = 2;
  foo(0, 1, 0);
  ASSERT( e == 2 );
}