summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/dfsan/lit_tests/basic.c
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2013-08-07 22:47:26 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2013-08-07 22:47:26 +0000
commit5cbab07d02a34dcf4405f71688f7ad43629c490c (patch)
treece3c98971e82a14a3fef8d4a31841c4ec469aa98 /compiler-rt/lib/dfsan/lit_tests/basic.c
parente5d5b0c71e8a27bc5582a6f296e65b78d40b14a5 (diff)
downloadbcm5719-llvm-5cbab07d02a34dcf4405f71688f7ad43629c490c.tar.gz
bcm5719-llvm-5cbab07d02a34dcf4405f71688f7ad43629c490c.zip
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
Diffstat (limited to 'compiler-rt/lib/dfsan/lit_tests/basic.c')
-rw-r--r--compiler-rt/lib/dfsan/lit_tests/basic.c17
1 files changed, 17 insertions, 0 deletions
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 <sanitizer/dfsan_interface.h>
+#include <assert.h>
+
+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;
+}
OpenPOWER on IntegriCloud