From b96fd2ce9e2148e076bb755b6a2fc39979a37f6b Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Mon, 24 Feb 2014 16:02:18 +0000 Subject: Fixed AliasFunction.c and AliasFunctionExit.c to work also when optimizations are enabled. --- test/Feature/AliasFunction.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'test/Feature/AliasFunction.c') diff --git a/test/Feature/AliasFunction.c b/test/Feature/AliasFunction.c index 16d89ef6..176b152e 100644 --- a/test/Feature/AliasFunction.c +++ b/test/Feature/AliasFunction.c @@ -1,25 +1,28 @@ // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t1.bc // RUN: %klee %t1.bc > %t1.log // RUN: grep -c foo %t1.log | grep 5 -// RUN: grep -c bar %t1.log | grep 3 +// RUN: grep -c bar %t1.log | grep 4 #include #include -void foo() { printf(" foo()\n"); } -void bar() { printf(" bar()\n"); } +void __attribute__ ((noinline)) foo() { printf(" foo()\n"); } +void __attribute__ ((noinline)) bar() { printf(" bar()\n"); } int main() { int x; klee_make_symbolic(&x, sizeof(x), "x"); + // call once, so that it is not removed by optimizations + bar(); + // no aliases foo(); if (x > 10) { // foo -> bar - klee_alias_function("foo", "bar"); + klee_alias_function("foo", "bar"); if (x > 20) foo(); -- cgit 1.4.1