aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/bitwise-is-signed.c
blob: dd9c147173cdd48270f216b7047f7ff537b3dd0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#define __bitwise __attribute__((bitwise))

#define is_signed_type(type)  (((type)-1) <= 0)

typedef   signed int __bitwise s;
typedef unsigned int __bitwise u;

int fos(void);
int fou(void);


int fos(void) { return  is_signed_type(s); }
int fou(void) { return !is_signed_type(u); }

/*
 * check-name: bitwise-is-signed
 * check-command: test-linearize -Wno-decl $file
 * check-known-to-fail
 *
 * check-output-ignore
 * check-output-returns: 1
 */