Skip to content

Commit

Permalink
Fixed regression tests bits/interleave_bits_*.c
Browse files Browse the repository at this point in the history
The old loop unrolling bound (32) in the two files was unnecessarily large.
I reduced it to the proper value (16). Corral flags and time limits are
also adjusted accordingly.
  • Loading branch information
shaobo-he committed Sep 21, 2017
1 parent a61feba commit 9d98228
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/bits/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
flags: [--bit-precise]
time-limit: 600
time-limit: 90
6 changes: 3 additions & 3 deletions test/bits/interleave_bits_fail.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* https://graphics.stanford.edu/~seander/bithacks.html#InterleaveTableObvious */
#include "smack.h"

// @flag --loop-limit=33
// @flag --unroll=33
// @flag --loop-limit=17
// @flag --unroll=17
// @expect error

int main()
Expand All @@ -19,7 +19,7 @@ int main()
unsigned int z = 0; /* z gets the resulting Morton Number. */
unsigned int i = 0;

while (i < 32U) {
while (i < sizeof(x) * 8) {
z |= ((x & (1U << i)) << i) | ((y & (1U << i)) << (i + 1));
i += 1U;
}
Expand Down
6 changes: 3 additions & 3 deletions test/bits/interleave_bits_true.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* https://graphics.stanford.edu/~seander/bithacks.html#InterleaveTableObvious */
#include "smack.h"

// @flag --loop-limit=33
// @flag --unroll=33
// @flag --loop-limit=17
// @flag --unroll=17
// @expect verified

int main()
Expand All @@ -19,7 +19,7 @@ int main()
unsigned int z = 0; /* z gets the resulting Morton Number. */
unsigned int i = 0;

while (i < 32U) {
while (i < sizeof(x) * 8) {
z |= ((x & (1U << i)) << i) | ((y & (1U << i)) << (i + 1));
i += 1U;
}
Expand Down

0 comments on commit 9d98228

Please sign in to comment.