about summary refs log tree commit diff homepage
path: root/test/Feature/MultipleFreeResolution.c
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2018-09-05 09:55:48 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2018-09-06 13:29:31 +0100
commitcdce3e8385927bf2cf2a21902d6563ecea37262c (patch)
tree3b3daf8731b30acddb7783a28e8eb97637dae291 /test/Feature/MultipleFreeResolution.c
parentd2285e097656936c866ae6518e0a496cf4499517 (diff)
downloadklee-cdce3e8385927bf2cf2a21902d6563ecea37262c.tar.gz
Use FileCheck and LINE instead of grep if possible
As we do not support LLVM 2.9 anymore, we can use FileCheck LINE instead of hard coding line numbers.
Diffstat (limited to 'test/Feature/MultipleFreeResolution.c')
-rw-r--r--test/Feature/MultipleFreeResolution.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/Feature/MultipleFreeResolution.c b/test/Feature/MultipleFreeResolution.c
index 704057f9..5c7dfdd8 100644
--- a/test/Feature/MultipleFreeResolution.c
+++ b/test/Feature/MultipleFreeResolution.c
@@ -4,13 +4,14 @@
 // RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 4
 // RUN: ls %t.klee-out/ | grep .err | wc -l | grep 3
 
-#include <stdlib.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 unsigned klee_urange(unsigned start, unsigned end) {
   unsigned x;
   klee_make_symbolic(&x, sizeof x, "x");
-  if (x-start>=end-start) klee_silent_exit(0);
+  if (x - start >= end - start)
+    klee_silent_exit(0);
   return x;
 }
 
@@ -22,21 +23,20 @@ int *make_int(int i) {
 
 int main() {
   int *buf[4];
-  int i,s;
+  int i, s;
 
-  for (i=0; i<3; i++)
+  for (i = 0; i < 3; i++)
     buf[i] = make_int(i);
   buf[3] = 0;
 
-  s = klee_urange(0,4);
+  s = klee_urange(0, 4);
 
   free(buf[s]);
 
-  // CHECK: MultipleFreeResolution.c:40: memory error: out of bound pointer
-  // CHECK: MultipleFreeResolution.c:40: memory error: out of bound pointer
-  // CHECK: MultipleFreeResolution.c:40: memory error: out of bound pointer
-  // FIXME: Use FileCheck's relative line numbers
-  for (i=0; i<3; i++) {
+  for (i = 0; i < 3; i++) {
+    // CHECK: MultipleFreeResolution.c:[[@LINE+3]]: memory error: out of bound pointer
+    // CHECK: MultipleFreeResolution.c:[[@LINE+2]]: memory error: out of bound pointer
+    // CHECK: MultipleFreeResolution.c:[[@LINE+1]]: memory error: out of bound pointer
     printf("*buf[%d] = %d\n", i, *buf[i]);
   }