about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorFrank Busse <bb0xfb@gmail.com>2022-01-06 18:00:30 +0000
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2022-01-07 12:46:01 +0000
commit0ba95edbad26fe70c8132f0731778d94f9609874 (patch)
treec02d8a100be7609e6559bb40ffc9de1e0c5dddcd
parent4173ffbf8cedfe394015b08a3eb13f7fc261d5e7 (diff)
downloadklee-0ba95edbad26fe70c8132f0731778d94f9609874.tar.gz
tests: add Feature/KleeStatsNoBr.c
-rw-r--r--test/Feature/KleeStatsNoBr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Feature/KleeStatsNoBr.c b/test/Feature/KleeStatsNoBr.c
new file mode 100644
index 00000000..45d48b74
--- /dev/null
+++ b/test/Feature/KleeStatsNoBr.c
@@ -0,0 +1,15 @@
+// RUN: %clang %s -emit-llvm -g %O0opt -c -o %t.bc
+// RUN: rm -rf %t.klee-out
+// RUN: %klee --output-dir=%t.klee-out %t.bc 2> %t.log
+// RUN: %klee-stats --print-columns 'BCov(%),Branches,FullBranches,PartialBranches' --table-format=csv %t.klee-out > %t.stats
+// RUN: FileCheck -check-prefix=CHECK-STATS -input-file=%t.stats %s
+
+int main(){
+  int a = 42;
+  a -= 42;
+  return a;
+}
+
+// Check that there are no branches in stats but 100% coverage
+// CHECK-STATS: BCov(%),Branches,FullBranches,PartialBranches
+// CHECK-STATS: 100.00,0,0,0