From 5cbab07d02a34dcf4405f71688f7ad43629c490c Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 7 Aug 2013 22:47:26 +0000 Subject: DataFlowSanitizer; compiler-rt changes. DataFlowSanitizer is a generalised dynamic data flow analysis. Unlike other Sanitizer tools, this tool is not designed to detect a specific class of bugs on its own. Instead, it provides a generic dynamic data flow analysis framework to be used by clients to help detect application-specific issues within their own code. Differential Revision: http://llvm-reviews.chandlerc.com/D967 llvm-svn: 187924 --- compiler-rt/lib/dfsan/lit_tests/basic.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 compiler-rt/lib/dfsan/lit_tests/basic.c (limited to 'compiler-rt/lib/dfsan/lit_tests/basic.c') diff --git a/compiler-rt/lib/dfsan/lit_tests/basic.c b/compiler-rt/lib/dfsan/lit_tests/basic.c new file mode 100644 index 00000000000..db1acb71208 --- /dev/null +++ b/compiler-rt/lib/dfsan/lit_tests/basic.c @@ -0,0 +1,17 @@ +// RUN: %clang_dfsan -m64 %s -o %t && %t + +// Tests that labels are propagated through loads and stores. + +#include +#include + +int main(void) { + int i = 1; + dfsan_label i_label = dfsan_create_label("i", 0); + dfsan_set_label(i_label, &i, sizeof(i)); + + dfsan_label new_label = dfsan_get_label(i); + assert(i_label == new_label); + + return 0; +} -- cgit v1.2.3