projects
/
fw
/
sdcc
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Interrupt context registers WSAVE and SSAVE were not getting allocated.
[fw/sdcc]
/
src
/
regression
/
add4.c
1
#define __16F873
2
#include "p16f873.h"
3
4
unsigned char success = 0;
5
unsigned char failures = 0;
6
unsigned char dummy = 0;
7
8
//bit bit0 = 0;
9
int int0 = 0;
10
int int1 = 0;
11
char char0 = 0;
12
char char1 = 0;
13
long long0 = 0;
14
long long1 = 0;
15
unsigned long ulong0 = 0;
16
unsigned long ulong1 = 0;
17
#define NULL 0
18
char *cP0=NULL;
19
char *cP1=NULL;
20
int *iP0=NULL;
21
int *iP1=NULL;
22
23
void
24
done ()
25
{
26
27
dummy++;
28
29
}
30
31
32
/* pointer to char arithmetic */
33
34
void pc_add(void)
35
{
36
37
if(*cP1)
38
failures++;
39
40
*cP1 += 1;
41
if(*cP1 != 1)
42
failures++;
43
44
if(char0 != 1)
45
failures++;
46
47
char0++;
48
49
if(*cP1 != 2)
50
failures++;
51
52
char1 = char0 + *cP1;
53
54
if(char1 != 4)
55
failures++;
56
}
57
58
/* pointer to integer arithmetic */
59
void pi_add(void)
60
{
61
if(*iP0)
62
failures++;
63
64
*iP0 += 1;
65
66
if(*iP0 != 1)
67
failures++;
68
69
if(int0 != 1)
70
failures++;
71
72
int1 = int0 + *iP0;
73
if(int1 != 2)
74
failures++;
75
}
76
77
void main(void)
78
{
79
80
cP1 = &char0;
81
pc_add();
82
83
iP0 = &int0;
84
pi_add();
85
86
success = failures;
87
done();
88
}