Print this page
11972 resync smatch
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/smatch/src/validation/backend/arithmetic-ops.c
+++ new/usr/src/tools/smatch/src/validation/backend/arithmetic-ops.c
1 1 static int add(int x, int y)
2 2 {
3 3 return x + y;
4 4 }
5 5
6 6 static unsigned int uadd(unsigned int x, unsigned int y)
7 7 {
8 8 return x + y;
9 9 }
10 10
11 11 static float fadd(float x, float y)
12 12 {
13 13 return x + y;
14 14 }
15 15
16 16 static double dadd(double x, double y)
17 17 {
18 18 return x + y;
19 19 }
20 20
21 21 static int sub(int x, int y)
22 22 {
23 23 return x - y;
24 24 }
25 25
26 26 static unsigned int usub(unsigned int x, unsigned int y)
27 27 {
28 28 return x - y;
29 29 }
30 30
31 31 static float fsub(float x, float y)
32 32 {
33 33 return x - y;
34 34 }
35 35
36 36 static double dsub(double x, double y)
37 37 {
38 38 return x - y;
39 39 }
40 40
41 41 static int mul(int x, int y)
42 42 {
43 43 return x * y;
44 44 }
45 45
46 46 static unsigned int umul(unsigned int x, unsigned int y)
47 47 {
48 48 return x * y;
49 49 }
50 50
51 51 static float fmul(float x, float y)
52 52 {
53 53 return x * y;
54 54 }
55 55
56 56 static double dmul(double x, double y)
57 57 {
58 58 return x * y;
59 59 }
60 60
61 61 static int div(int x, int y)
62 62 {
63 63 return x / y;
64 64 }
65 65
66 66 static unsigned int udiv(unsigned int x, unsigned int y)
67 67 {
68 68 return x / y;
69 69 }
70 70
71 71 static float fdiv(float x, float y)
72 72 {
73 73 return x / y;
74 74 }
75 75
76 76 static double ddiv(double x, double y)
77 77 {
78 78 return x / y;
79 79 }
80 80
↓ open down ↓ |
80 lines elided |
↑ open up ↑ |
81 81 static int mod(int x, int y)
82 82 {
83 83 return x % y;
84 84 }
85 85
86 86 static unsigned int umod(unsigned int x, unsigned int y)
87 87 {
88 88 return x % y;
89 89 }
90 90
91 +static int neg(int x)
92 +{
93 + return -x;
94 +}
95 +
96 +static unsigned int uneg(unsigned int x)
97 +{
98 + return -x;
99 +}
100 +
101 +static float fneg(float x)
102 +{
103 + return -x;
104 +}
105 +
106 +static double dneg(double x)
107 +{
108 + return -x;
109 +}
110 +
91 111 /*
92 112 * check-name: Arithmetic operator code generation
93 113 * check-command: sparsec -c $file -o tmp.o
94 114 */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX