about summary refs log tree commit diff homepage
path: root/test/Feature
diff options
context:
space:
mode:
Diffstat (limited to 'test/Feature')
-rw-r--r--test/Feature/Alias.c9
-rw-r--r--test/Feature/LargeReturnTypes.cpp3
-rw-r--r--test/Feature/LinkLLVMLib.c2
-rw-r--r--test/Feature/LongDouble.c (renamed from test/Feature/LongDouble.cpp)29
-rw-r--r--test/Feature/MemoryLimit.c6
-rw-r--r--test/Feature/Realloc.c4
-rw-r--r--test/Feature/Vararg.c1
7 files changed, 25 insertions, 29 deletions
diff --git a/test/Feature/Alias.c b/test/Feature/Alias.c
index 381bcc2a..09abb3e0 100644
--- a/test/Feature/Alias.c
+++ b/test/Feature/Alias.c
@@ -1,10 +1,9 @@
+// Darwin does not have strong aliases.
+// REQUIRES: not-darwin
 // RUN: %llvmgcc %s -emit-llvm -g -c -o %t1.bc
 // RUN: rm -rf %t.klee-out
 // RUN: %klee --output-dir=%t.klee-out --exit-on-error %t1.bc
 
-// Darwin does not have strong aliases.
-// XFAIL: darwin
-
 #include <assert.h>
 
 // alias for global
@@ -17,10 +16,10 @@ extern int foo() __attribute__((alias("__foo")));
 
 int *c = &a;
 
-int main() { 
+int main() {
   assert(a == 52);
   assert(foo() == 52);
   assert(*c == 52);
-  
+
   return 0;
 }
diff --git a/test/Feature/LargeReturnTypes.cpp b/test/Feature/LargeReturnTypes.cpp
index 937b0758..84119624 100644
--- a/test/Feature/LargeReturnTypes.cpp
+++ b/test/Feature/LargeReturnTypes.cpp
@@ -1,3 +1,4 @@
+// REQUIRES: not-darwin
 // RUN: %llvmgxx -g -fno-exceptions -emit-llvm -O0 -c -o %t.bc %s
 // RUN: rm -rf %t.klee-out
 // RUN: %klee --output-dir=%t.klee-out --libc=klee --no-output --exit-on-error %t.bc > %t.log
@@ -9,8 +10,6 @@
 // This test currently doesn't work on darwin because this isn't how things work
 // in libc++. This test should be rewritten to not depend on an external
 // dependency.
-//
-// XFAIL: darwin
 
 #include <fstream>
 
diff --git a/test/Feature/LinkLLVMLib.c b/test/Feature/LinkLLVMLib.c
index 95437094..34931409 100644
--- a/test/Feature/LinkLLVMLib.c
+++ b/test/Feature/LinkLLVMLib.c
@@ -3,7 +3,7 @@
 //
 // RUN: %llvmgcc %s -g -emit-llvm -O0 -c -o %t2.bc -DLINK_LLVM_LIB_TEST_EXEC
 // RUN: rm -rf %t.klee-out
-// RUN: %klee --link-llvm-lib %t1.a --output-dir=%t.klee-out --emit-all-errors %t2.bc 2>&1 | FileCheck %s
+// RUN: %klee --link-llvm-lib %t1.a --output-dir=%t.klee-out --emit-all-errors --warnings-only-to-file=false %t2.bc 2>&1 | FileCheck %s
 
 #ifdef LINK_LLVM_LIB_TEST_EXEC
 extern void printint(int d);
diff --git a/test/Feature/LongDouble.cpp b/test/Feature/LongDouble.c
index 08924293..ad4c1a79 100644
--- a/test/Feature/LongDouble.cpp
+++ b/test/Feature/LongDouble.c
@@ -1,6 +1,7 @@
-// RUN: %llvmgxx -I../../../include -g -fno-exceptions -emit-llvm -O0 -c -o %t.bc %s
+// RUN: %llvmgcc  -g -emit-llvm -O0 -c -o %t.bc %s
 // RUN: rm -rf %t.klee-out
 // RUN: %klee --output-dir=%t.klee-out --libc=klee --no-output --exit-on-error %t.bc > %t.log
+// FIXME: When we remove LLVM 2.9 support just use FileCheck and remove these `grep`s.
 // RUN: grep -q powl\(-11\\.0,0\)=1\\.0\\+ %t.log
 // RUN: grep -q powl\(-11\\.0,1\)=-11\\.0\\+ %t.log
 // RUN: grep -q powl\(-11\\.0,2\)=121\\.0\\+ %t.log
@@ -8,28 +9,26 @@
 // RUN: grep -q 1/-1=-1\\.0\\+ %t.log
 // RUN: grep -q 1/-2=-0\\.50\\+ %t.log
 
-#include <cstdio>
-#include <cstdlib>
-#include <cmath>
-#include <cassert>
-
 #include "klee/klee.h"
+#include <assert.h>
+#include <math.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;
 }
 
-int main(int argc, char ** argv)
-{
-
-  int a = klee_urange(0,3);
+int main(int argc, char **argv) {
+  int a = klee_urange(0, 3);
   int b;
 
   // fork states
-  switch(a) {
+  switch (a) {
   case 0:
     b = -0;
     break;
@@ -40,7 +39,7 @@ int main(int argc, char ** argv)
     b = -2;
     break;
   default:
-    assert(false && "Impossible switch target");
+    assert(0 && "Impossible switch target");
   }
 
   // test 80-bit external dispatch
@@ -52,7 +51,7 @@ int main(int argc, char ** argv)
   printf("powl(-11.0,%d)=%Lf\n", a, d);
 
   // test 80-bit fdiv
-  long double e = (long double) 1 / (long double) b;
+  long double e = (long double)1 / (long double)b;
   // CHECK-DAG: 1/0=inf
   // CHECK-DAG: 1/1-1=-1.0
   // CHECK-DAG: 1/-2=-0.50
@@ -60,5 +59,3 @@ int main(int argc, char ** argv)
 
   return 0;
 }
-
-
diff --git a/test/Feature/MemoryLimit.c b/test/Feature/MemoryLimit.c
index fb9f2c86..ce4bc00f 100644
--- a/test/Feature/MemoryLimit.c
+++ b/test/Feature/MemoryLimit.c
@@ -4,17 +4,17 @@
 
 // RUN: %llvmgcc -emit-llvm -DLITTLE_ALLOC -g -c %s -o %t.little.bc
 // RUN: rm -rf %t.klee-out
-// RUN: %klee --output-dir=%t.klee-out --max-memory=20 %t.little.bc > %t.little.log 2> %t.little.err
+// RUN: %klee --output-dir=%t.klee-out --max-memory=20 %t.little.bc > %t.little.log
 // RUN: not grep -q "MALLOC FAILED" %t.little.log
 // RUN: not grep -q "DONE" %t.little.log
-// RUN: grep "WARNING: killing 1 states (over memory cap)" %t.little.err
+// RUN: grep "WARNING: killing 1 states (over memory cap)" %t.klee-out/warnings.txt
 
 // RUN: %llvmgcc -emit-llvm -g -c %s -o %t.big.bc
 // RUN: rm -rf %t.klee-out
 // RUN: %klee --output-dir=%t.klee-out --max-memory=20 %t.big.bc > %t.big.log 2> %t.big.err
 // RUN: not grep -q "MALLOC FAILED" %t.big.log
 // RUN: not grep -q "DONE" %t.big.log
-// RUN: grep "WARNING: killing 1 states (over memory cap)" %t.big.err
+// RUN: grep "WARNING: killing 1 states (over memory cap)" %t.klee-out/warnings.txt
 
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/test/Feature/Realloc.c b/test/Feature/Realloc.c
index 76016fb7..d0c85b21 100644
--- a/test/Feature/Realloc.c
+++ b/test/Feature/Realloc.c
@@ -1,6 +1,6 @@
 // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t1.bc
 // RUN: rm -rf %t.klee-out
-// RUN: %klee --output-dir=%t.klee-out --exit-on-error %t1.bc 2>&1 | FileCheck %s
+// RUN: %klee --output-dir=%t.klee-out --exit-on-error --warnings-only-to-file=false %t1.bc 2>&1 | FileCheck %s
 
 #include <assert.h>
 #include <stdlib.h>
@@ -13,7 +13,7 @@ int main() {
 
   // CHECK: KLEE: WARNING ONCE: Large alloc
   int *p2 = realloc(p, 1<<30);
-  assert(p2[1] == 52);
+  assert(!p2 || p2[1] == 52);
 
   return 0;
 }
diff --git a/test/Feature/Vararg.c b/test/Feature/Vararg.c
index 82fbe4f1..a78b784e 100644
--- a/test/Feature/Vararg.c
+++ b/test/Feature/Vararg.c
@@ -1,3 +1,4 @@
+// REQUIRES: not-darwin
 // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t1.bc
 // RUN: rm -rf %t.klee-out
 // RUN: %klee --output-dir=%t.klee-out %t1.bc > %t2.out