aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/bool-cast-explicit.c
blob: 4e3c2b7cea8495822b24af71f373c26652af1b94 (plain)
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
typedef unsigned int	u32;
typedef          int	s32;
typedef void *vdp;
typedef int  *sip;
typedef double dbl;
typedef unsigned short __attribute__((bitwise)) le16;

static _Bool fs32(s32 a) { return (_Bool)a; }
static _Bool fu32(u32 a) { return (_Bool)a; }
static _Bool fvdp(vdp a) { return (_Bool)a; }
static _Bool fsip(sip a) { return (_Bool)a; }
static _Bool fdbl(dbl a) { return (_Bool)a; }
static _Bool ffun(void)  { return (_Bool)ffun; }

static _Bool fres(le16 a) { return (_Bool)a; }

/*
 * check-name: bool-cast-explicit
 * check-command: test-linearize -m64 $file
 * check-output-ignore
 * check-output-excludes: cast\\.
 *
 * check-error-start
bool-cast-explicit.c:15:37: warning: cast from restricted le16
 * check-error-end
 */