blob: 21a796cb697aabd9c9f59f2cb6f08bd3bcf17d9f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// RUN: %llvmgcc %s -fsanitize=signed-integer-overflow -emit-llvm -g -O0 -c -o %t.bc
// RUN: %klee %t.bc 2> %t.log
// RUN: grep -c "overflow on unsigned multiplication" %t.log
// RUN: grep -c "ubsan_smul_overflow.c:16: overflow" %t.log
#include "klee/klee.h"
int main()
{
int x;
int y;
volatile int result;
klee_make_symbolic(&x, sizeof(x), "signed mul 1");
klee_make_symbolic(&y, sizeof(y), "signed mul 2");
result = x * y;
return 0;
}
|