aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite/gasp/exp.asm
blob: 041608a818e72fd58b0ebcf8d1b17668917070ac (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

; test all ops

a1	.EQU	4+10
a2	.EQU	4-10
a3	.EQU	4&10
a4	.EQU	4|2
a5	.EQU	4~2
a6	.EQU	4*10
a7	.EQU	40/10
a8	.EQU	+7
a9	.EQU	-7
a10	.EQU	~7


	a1 a2 a3 a4 a5 a6 a7 a8 a9 a10

; test the priorities

b1	.EQU	1|2~3&4+5-8*7/2
b2	.EQU	(1|2~(3&(4+5-(8*(7/2)))))
b3	.EQU	10*2/3*4
b4	.EQU	(((10*2)/3)*4)
b5	.EQU	10+2-3+4
b6	.EQU	(((10+2)-3)+4)

	b1 b2 b3 b4

; test association

c1	.EQU	-~3
c2	.EQU	~-3
c3	.EQU	-(~3)
c4	.EQU	~(-3)

	c1 c2 c3 c4

; test rules for symbols

ok1	.EQU	FOO
ok2	.EQU	FOO+10
ok3	.EQU	10+FOO
ok4	.EQU	FOO-10

	ok1
	ok2 
	ok3 
	ok4

ok5	.EQU	FOO+3+4+5+6
ok6	.EQU	FOO-BAR

	ok5
	ok6

bad1	.EQU	FOO+FOO
bad2	.EQU	FOO*2
bad3	.EQU	FOO/2
bad4	.EQU	FOO|2
bad5	.EQU	FOO&2
bad6	.EQU	FOO~2
bad7	.EQU	FOO*2

; test spacing

space1	.EQU	1 +	2	+3+FOO + 3
space2

; from the SH manual

	.DATA.L	1+(2-(3+(4-5))),1

	.DATA.L	-H'fffffff1+H'000000f0*H'00000010|H'000000f0&H'0000ffff,H'00000fff

	.DATA.L	-~-~H'0000000f,H'00


	

	.END