2014-05-01 05:34:17 +08:00
|
|
|
// RUN: %clang_dfsan -m64 %s -o %t && %run %t
|
|
|
|
// RUN: %clang_dfsan -mllvm -dfsan-args-abi -m64 %s -o %t && %run %t
|
2013-08-08 06:47:26 +08:00
|
|
|
|
|
|
|
// 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);
|
|
|
|
|
2013-08-14 06:15:40 +08:00
|
|
|
dfsan_label read_label = dfsan_read_label(&i, sizeof(i));
|
|
|
|
assert(i_label == read_label);
|
|
|
|
|
2013-08-08 06:47:26 +08:00
|
|
|
return 0;
|
|
|
|
}
|