Commit 3993a824 authored by Michael Beck's avatar Michael Beck
Browse files

more tests added

[r15794]
parent e7ed2daa
...@@ -99,6 +99,14 @@ int add1(int x) { ...@@ -99,6 +99,14 @@ int add1(int x) {
return x + ~x; return x + ~x;
} }
int shr1(int x) {
return -(x >> 31);
}
int shrs1(unsigned x) {
return -(x >> 31);
}
int main(void) int main(void)
{ {
#define TU(func,x,expect) \ #define TU(func,x,expect) \
...@@ -130,4 +138,6 @@ int main(void) ...@@ -130,4 +138,6 @@ int main(void)
TB(and1, 42, 17, 42); TB(and1, 42, 17, 42);
TB(and2, 42, 17, 42^17); TB(and2, 42, 17, 42^17);
TU(add1, -3, -1); TU(add1, -3, -1);
TU(shr1, -3, 1);
TU(shrs1, -3, -1);
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment