cconst.c
1.07 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
#include "os.h"
#include "corefunc.h"
int
cconst( void )
{
int numFailures = 0;
static s64 i1 = 34567890123LL + 1111111111LL;
static s64 i2 = 34567890123LL - 1111111111LL;
static s64 i3 = 34567890123LL * -10LL;
static s64 i4 = -34567890123LL / 10LL ;
static s64 i5 = 34567890123LL % 1000000000LL;
static s64 i6 = 0xabcdabcdabcdLL << 4;
static s64 i7 = 0xabcdabcdabcdLL >> 36;
static s64 i8 = 0xabcdabcdabcdLL & 0x111111111111LL;
static s64 i9 = 0xabcdabcdabcdLL ^ 0x111111111111LL;
static s64 i10 = 0xabcdabcdabcdLL | 0x111111111111LL;
numFailures += check_equal(i1, 35679001234LL);
numFailures += check_equal(i2, 33456779012LL);
numFailures += check_equal(i3, -345678901230LL);
numFailures += check_equal(i4, -3456789012LL);
numFailures += check_equal(i5, 567890123LL);
numFailures += check_equal(i6, 0xabcdabcdabcd0LL);
numFailures += check_equal(i7, 0xabcLL);
numFailures += check_equal(i8, 0x10101010101LL);
numFailures += check_equal(i9, 0xbadcbadcbadcLL);
numFailures += check_equal(i10, 0xbbddbbddbbddLL);
return(numFailures);
}