diff options
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/linear/pointer-arith32.c | 12 | ||||
| -rw-r--r-- | validation/linear/pointer-arith64.c | 10 | ||||
| -rw-r--r-- | validation/optim/canonical-arg.c | 20 | ||||
| -rw-r--r-- | validation/optim/canonical-not.c | 9 | ||||
| -rw-r--r-- | validation/optim/cse-arg01.c | 9 | ||||
| -rw-r--r-- | validation/optim/cse-not01.c | 11 | ||||
| -rw-r--r-- | validation/optim/cse-not02.c | 11 | ||||
| -rw-r--r-- | validation/optim/cse-reg01.c | 9 |
8 files changed, 80 insertions, 11 deletions
diff --git a/validation/linear/pointer-arith32.c b/validation/linear/pointer-arith32.c index 531fd232..c0163a6f 100644 --- a/validation/linear/pointer-arith32.c +++ b/validation/linear/pointer-arith32.c @@ -42,7 +42,7 @@ cps: .L0: <entry-point> sext.32 %r2 <- (16) %arg2 - add.32 %r5 <- %arg1, %r2 + add.32 %r5 <- %r2, %arg1 ret.32 %r5 @@ -51,7 +51,7 @@ ipss: <entry-point> sext.32 %r10 <- (16) %arg2 mul.32 %r11 <- %r10, $4 - add.32 %r14 <- %arg1, %r11 + add.32 %r14 <- %r11, %arg1 ret.32 %r14 @@ -60,7 +60,7 @@ ipus: <entry-point> zext.32 %r19 <- (16) %arg2 mul.32 %r20 <- %r19, $4 - add.32 %r23 <- %arg1, %r20 + add.32 %r23 <- %r20, %arg1 ret.32 %r23 @@ -68,7 +68,7 @@ cpq: .L6: <entry-point> trunc.32 %r28 <- (64) %arg2 - add.32 %r31 <- %arg1, %r28 + add.32 %r31 <- %r28, %arg1 ret.32 %r31 @@ -77,7 +77,7 @@ ipq_ref: <entry-point> trunc.32 %r37 <- (64) %arg2 mul.32 %r38 <- %r37, $4 - add.32 %r39 <- %arg1, %r38 + add.32 %r39 <- %r38, %arg1 ret.32 %r39 @@ -86,7 +86,7 @@ ipq: <entry-point> trunc.32 %r43 <- (64) %arg2 mul.32 %r44 <- %r43, $4 - add.32 %r47 <- %arg1, %r44 + add.32 %r47 <- %r44, %arg1 ret.32 %r47 diff --git a/validation/linear/pointer-arith64.c b/validation/linear/pointer-arith64.c index dad10331..7f1aac56 100644 --- a/validation/linear/pointer-arith64.c +++ b/validation/linear/pointer-arith64.c @@ -35,7 +35,7 @@ cps: .L0: <entry-point> sext.64 %r2 <- (16) %arg2 - add.64 %r5 <- %arg1, %r2 + add.64 %r5 <- %r2, %arg1 ret.64 %r5 @@ -44,7 +44,7 @@ ipss: <entry-point> sext.64 %r10 <- (16) %arg2 mul.64 %r11 <- %r10, $4 - add.64 %r14 <- %arg1, %r11 + add.64 %r14 <- %r11, %arg1 ret.64 %r14 @@ -53,7 +53,7 @@ ipus: <entry-point> zext.64 %r19 <- (16) %arg2 mul.64 %r20 <- %r19, $4 - add.64 %r23 <- %arg1, %r20 + add.64 %r23 <- %r20, %arg1 ret.64 %r23 @@ -62,7 +62,7 @@ ipsi: <entry-point> sext.64 %r28 <- (32) %arg2 mul.64 %r29 <- %r28, $4 - add.64 %r32 <- %arg1, %r29 + add.64 %r32 <- %r29, %arg1 ret.64 %r32 @@ -71,7 +71,7 @@ ipui: <entry-point> zext.64 %r37 <- (32) %arg2 mul.64 %r38 <- %r37, $4 - add.64 %r41 <- %arg1, %r38 + add.64 %r41 <- %r38, %arg1 ret.64 %r41 diff --git a/validation/optim/canonical-arg.c b/validation/optim/canonical-arg.c new file mode 100644 index 00000000..a8ecc9bd --- /dev/null +++ b/validation/optim/canonical-arg.c @@ -0,0 +1,20 @@ +int def(void); + +int canon_arg_arg(int a, int b) +{ + return (a + b) == (b + a); +} + +int canon_arg_reg(int a) +{ + int b = def(); + return (a + b) == (b + a); +} + +/* + * check-name: canonical-arg + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-returns: 1 + */ diff --git a/validation/optim/canonical-not.c b/validation/optim/canonical-not.c new file mode 100644 index 00000000..9698590f --- /dev/null +++ b/validation/optim/canonical-not.c @@ -0,0 +1,9 @@ +int canon_not(int a, int b) { return (a & ~b) == (~b & a); } + +/* + * check-name: canonical-not + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-returns: 1 + */ diff --git a/validation/optim/cse-arg01.c b/validation/optim/cse-arg01.c new file mode 100644 index 00000000..3e3e141a --- /dev/null +++ b/validation/optim/cse-arg01.c @@ -0,0 +1,9 @@ +int foo(int a, int b) { return (a < b) == (b > a); } + +/* + * check-name: cse-arg01 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-returns: 1 + */ diff --git a/validation/optim/cse-not01.c b/validation/optim/cse-not01.c new file mode 100644 index 00000000..ea1bb7cf --- /dev/null +++ b/validation/optim/cse-not01.c @@ -0,0 +1,11 @@ +int and(int a) { return (~a & a) == 0; } +int ior(int a) { return (~a | a) == ~0; } +int xor(int a) { return (~a ^ a) == ~0; } + +/* + * check-name: cse-not01 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-returns: 1 + */ diff --git a/validation/optim/cse-not02.c b/validation/optim/cse-not02.c new file mode 100644 index 00000000..70addebc --- /dev/null +++ b/validation/optim/cse-not02.c @@ -0,0 +1,11 @@ +int and(int a, int b) { return ((a == b) & (a != b)) == 0; } +int ior(int a, int b) { return ((a == b) | (a != b)) == 1; } +int xor(int a, int b) { return ((a == b) ^ (a != b)) == 1; } + +/* + * check-name: cse-not02 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-returns: 1 + */ diff --git a/validation/optim/cse-reg01.c b/validation/optim/cse-reg01.c new file mode 100644 index 00000000..3ea283d3 --- /dev/null +++ b/validation/optim/cse-reg01.c @@ -0,0 +1,9 @@ +int foo(int a, int b) { int x = a + b, y = ~b; return (x < y) == (y > x); } + +/* + * check-name: cse-reg01 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-returns: 1 + */ |
