diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-08-30 09:36:32 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-10-21 05:27:27 +0200 |
commit | 10fd1d83ecd96e67e2a8f392a9c41f5252b7752d (patch) | |
tree | cc628328257b0b4f0bee18034c77963978b8bea4 | |
parent | 2d3af347e4a217f95b4f939fed9e76541d8b72f2 (diff) | |
download | sparse-10fd1d83ecd96e67e2a8f392a9c41f5252b7752d.tar.gz |
optim: fix some testcases related to bitfield manipulation
The patterns used here were based on looser semantic for OP_{SEXT,TRUNC}.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | validation/optim/sext.c | 7 | ||||
-rw-r--r-- | validation/optim/trunc-or-shl.c | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/validation/optim/sext.c b/validation/optim/sext.c index 719730d5..3769a05c 100644 --- a/validation/optim/sext.c +++ b/validation/optim/sext.c @@ -6,10 +6,9 @@ int sext(int x) /* * check-name: sext * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore - * check-output-contains: sext\\.$27 - * check-output-excludes: asr\\. - * check-output-excludes: shl\\. + * check-output-excludes: sext\\. + * check-output-contains: asr\\.32 + * check-output-contains: shl\\.32 */ diff --git a/validation/optim/trunc-or-shl.c b/validation/optim/trunc-or-shl.c index 70d8bd1d..8660d0f0 100644 --- a/validation/optim/trunc-or-shl.c +++ b/validation/optim/trunc-or-shl.c @@ -1,3 +1,6 @@ +// because of the cast to char, the fist arg should be eliminated +// and the whole reduced to TRUNC(%arg2, 8) + char foo(int a, int b) { return (a << 8) | b; @@ -9,5 +12,6 @@ char foo(int a, int b) * check-known-to-fail * * check-output-ignore - * check-output-contains: ret\\..*%arg2 + * check-output-excludes: %arg1 + * check-output-contains: trunc\\..*%arg2 */ |