diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Feature/ubsan/ubsan_bool.c | 2 | ||||
-rw-r--r-- | test/Feature/ubsan/ubsan_builtin.c | 2 | ||||
-rw-r--r-- | test/Feature/ubsan/ubsan_enum.cpp (renamed from test/Feature/ubsan/ubsan_enum.c) | 2 | ||||
-rw-r--r-- | test/Feature/ubsan/ubsan_implicit_signed_integer_truncation.c | 2 | ||||
-rw-r--r-- | test/Feature/ubsan/ubsan_implicit_unsigned_integer_truncation.c | 2 | ||||
-rw-r--r-- | test/Feature/ubsan/ubsan_integer_divide_by_zero.c | 10 | ||||
-rw-r--r-- | test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_nonnull_pointer.c | 1 | ||||
-rw-r--r-- | test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_nonnull_pointer_10.c | 1 | ||||
-rw-r--r-- | test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_null_pointer.c | 6 | ||||
-rw-r--r-- | test/Feature/ubsan/ubsan_pointer_overflow-applying_zero_offset_to_null_pointer.c | 5 | ||||
-rw-r--r-- | test/Feature/ubsan/ubsan_return.cpp (renamed from test/Feature/ubsan/ubsan_return.c) | 2 | ||||
-rw-r--r-- | test/Feature/ubsan/ubsan_unreachable.c | 2 |
12 files changed, 17 insertions, 20 deletions
diff --git a/test/Feature/ubsan/ubsan_bool.c b/test/Feature/ubsan/ubsan_bool.c index 360af183..6873299d 100644 --- a/test/Feature/ubsan/ubsan_bool.c +++ b/test/Feature/ubsan/ubsan_bool.c @@ -2,7 +2,7 @@ // RUN: rm -rf %t.klee-out // RUN: %klee --output-dir=%t.klee-out --emit-all-errors --ubsan-runtime %t.bc 2>&1 | FileCheck %s // RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 2 -// RUN: ls %t.klee-out/ | grep undefined_behavior.err | wc -l | grep 1 +// RUN: ls %t.klee-out/ | grep .invalid_load.err | wc -l | grep 1 #include "klee/klee.h" diff --git a/test/Feature/ubsan/ubsan_builtin.c b/test/Feature/ubsan/ubsan_builtin.c index 72ff73da..cb04987e 100644 --- a/test/Feature/ubsan/ubsan_builtin.c +++ b/test/Feature/ubsan/ubsan_builtin.c @@ -2,7 +2,7 @@ // RUN: rm -rf %t.klee-out // RUN: %klee --output-dir=%t.klee-out --emit-all-errors --ubsan-runtime %t.bc 2>&1 | FileCheck %s // RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 2 -// RUN: ls %t.klee-out/ | grep .undefined_behavior.err | wc -l | grep 1 +// RUN: ls %t.klee-out/ | grep .invalid_builtin_use.err | wc -l | grep 1 #include "klee/klee.h" diff --git a/test/Feature/ubsan/ubsan_enum.c b/test/Feature/ubsan/ubsan_enum.cpp index 1c79629a..fe01f978 100644 --- a/test/Feature/ubsan/ubsan_enum.c +++ b/test/Feature/ubsan/ubsan_enum.cpp @@ -2,7 +2,7 @@ // RUN: rm -rf %t.klee-out // RUN: %klee --output-dir=%t.klee-out --emit-all-errors --ubsan-runtime %t.bc 2>&1 | FileCheck %s // RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 2 -// RUN: ls %t.klee-out/ | grep .undefined_behavior.err | wc -l | grep 1 +// RUN: ls %t.klee-out/ | grep .invalid_load.err | wc -l | grep 1 #include "klee/klee.h" diff --git a/test/Feature/ubsan/ubsan_implicit_signed_integer_truncation.c b/test/Feature/ubsan/ubsan_implicit_signed_integer_truncation.c index 23213808..95002907 100644 --- a/test/Feature/ubsan/ubsan_implicit_signed_integer_truncation.c +++ b/test/Feature/ubsan/ubsan_implicit_signed_integer_truncation.c @@ -2,7 +2,7 @@ // RUN: rm -rf %t.klee-out // RUN: %klee --output-dir=%t.klee-out --emit-all-errors --ubsan-runtime %t.bc 2>&1 | FileCheck %s // RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 2 -// RUN: ls %t.klee-out/ | grep .implicit_conversion.err | wc -l | grep 1 +// RUN: ls %t.klee-out/ | grep .implicit_truncation.err | wc -l | grep 1 #include "klee/klee.h" diff --git a/test/Feature/ubsan/ubsan_implicit_unsigned_integer_truncation.c b/test/Feature/ubsan/ubsan_implicit_unsigned_integer_truncation.c index f14b65ca..0db03cb0 100644 --- a/test/Feature/ubsan/ubsan_implicit_unsigned_integer_truncation.c +++ b/test/Feature/ubsan/ubsan_implicit_unsigned_integer_truncation.c @@ -2,7 +2,7 @@ // RUN: rm -rf %t.klee-out // RUN: %klee --output-dir=%t.klee-out --emit-all-errors --ubsan-runtime %t.bc 2>&1 | FileCheck %s // RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 2 -// RUN: ls %t.klee-out/ | grep .implicit_conversion.err | wc -l | grep 1 +// RUN: ls %t.klee-out/ | grep .implicit_truncation.err | wc -l | grep 1 #include "klee/klee.h" diff --git a/test/Feature/ubsan/ubsan_integer_divide_by_zero.c b/test/Feature/ubsan/ubsan_integer_divide_by_zero.c index c33bab38..09591e29 100644 --- a/test/Feature/ubsan/ubsan_integer_divide_by_zero.c +++ b/test/Feature/ubsan/ubsan_integer_divide_by_zero.c @@ -6,15 +6,9 @@ #include "klee/klee.h" -#if defined(__SIZEOF_INT128__) && !defined(_WIN32) -typedef __int128 intmax; -#else -typedef long long intmax; -#endif - int main() { - intmax x; - volatile intmax result; + int x; + volatile int result; klee_make_symbolic(&x, sizeof(x), "x"); diff --git a/test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_nonnull_pointer.c b/test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_nonnull_pointer.c index dcbba073..007a8ee2 100644 --- a/test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_nonnull_pointer.c +++ b/test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_nonnull_pointer.c @@ -17,6 +17,7 @@ int main() { klee_assume(address != 0); char *ptr = (char *)address; + // CHECK: runtime/Sanitizer/ubsan/ubsan_handlers.cpp:35: pointer-overflow result = ptr + 1; return 0; diff --git a/test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_nonnull_pointer_10.c b/test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_nonnull_pointer_10.c index cb126742..20286bcc 100644 --- a/test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_nonnull_pointer_10.c +++ b/test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_nonnull_pointer_10.c @@ -17,6 +17,7 @@ int main() { klee_assume(address != 0); char *ptr = (char *)address; + // CHECK: runtime/Sanitizer/ubsan/ubsan_handlers.cpp:35: nullptr-after-nonzero-offset result = ptr + 1; return 0; diff --git a/test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_null_pointer.c b/test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_null_pointer.c index 20286bcc..f36dca61 100644 --- a/test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_null_pointer.c +++ b/test/Feature/ubsan/ubsan_pointer_overflow-applying_nonzero_offset_to_null_pointer.c @@ -3,7 +3,7 @@ // RUN: %clang %s -fsanitize=pointer-overflow -emit-llvm -g %O0opt -c -o %t.bc // RUN: rm -rf %t.klee-out // RUN: %klee --output-dir=%t.klee-out --emit-all-errors --ubsan-runtime %t.bc 2>&1 | FileCheck %s -// RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 2 +// RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 1 // RUN: ls %t.klee-out/ | grep .ptr.err | wc -l | grep 1 #include "klee/klee.h" @@ -14,11 +14,11 @@ int main() { volatile char *result; klee_make_symbolic(&address, sizeof(address), "address"); - klee_assume(address != 0); + klee_assume(address == 0); char *ptr = (char *)address; - // CHECK: runtime/Sanitizer/ubsan/ubsan_handlers.cpp:35: nullptr-after-nonzero-offset + // CHECK: runtime/Sanitizer/ubsan/ubsan_handlers.cpp:35: nullptr-with-nonzero-offset result = ptr + 1; return 0; } diff --git a/test/Feature/ubsan/ubsan_pointer_overflow-applying_zero_offset_to_null_pointer.c b/test/Feature/ubsan/ubsan_pointer_overflow-applying_zero_offset_to_null_pointer.c index 301952b9..b39b65e2 100644 --- a/test/Feature/ubsan/ubsan_pointer_overflow-applying_zero_offset_to_null_pointer.c +++ b/test/Feature/ubsan/ubsan_pointer_overflow-applying_zero_offset_to_null_pointer.c @@ -3,7 +3,7 @@ // RUN: %clang %s -fsanitize=pointer-overflow -emit-llvm -g %O0opt -c -o %t.bc // RUN: rm -rf %t.klee-out // RUN: %klee --output-dir=%t.klee-out --emit-all-errors --ubsan-runtime %t.bc 2>&1 | FileCheck %s -// RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 2 +// RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 1 // RUN: ls %t.klee-out/ | grep .ptr.err | wc -l | grep 1 #include "klee/klee.h" @@ -14,8 +14,9 @@ int main() { volatile char *result; klee_make_symbolic(&address, sizeof(address), "address"); + klee_assume(address == 0); - char *ptr = (char *)address;; + char *ptr = (char *)address; // CHECK: runtime/Sanitizer/ubsan/ubsan_handlers.cpp:35: nullptr-with-offset result = ptr + 0; diff --git a/test/Feature/ubsan/ubsan_return.c b/test/Feature/ubsan/ubsan_return.cpp index c2327db4..05f82098 100644 --- a/test/Feature/ubsan/ubsan_return.c +++ b/test/Feature/ubsan/ubsan_return.cpp @@ -2,7 +2,7 @@ // RUN: rm -rf %t.klee-out // RUN: %klee --output-dir=%t.klee-out --emit-all-errors --ubsan-runtime %t.bc 2>&1 | FileCheck %s // RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 1 -// RUN: ls %t.klee-out/ | grep .undefined_behavior.err | wc -l | grep 1 +// RUN: ls %t.klee-out/ | grep .missing_return.err | wc -l | grep 1 #include "klee/klee.h" diff --git a/test/Feature/ubsan/ubsan_unreachable.c b/test/Feature/ubsan/ubsan_unreachable.c index 76e2e909..bfc7f6ad 100644 --- a/test/Feature/ubsan/ubsan_unreachable.c +++ b/test/Feature/ubsan/ubsan_unreachable.c @@ -2,7 +2,7 @@ // RUN: rm -rf %t.klee-out // RUN: %klee --output-dir=%t.klee-out --emit-all-errors --ubsan-runtime %t.bc 2>&1 | FileCheck %s // RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 1 -// RUN: ls %t.klee-out/ | grep .undefined_behavior.err | wc -l | grep 1 +// RUN: ls %t.klee-out/ | grep .unreachable_call.err | wc -l | grep 1 #include "klee/klee.h" |