1 // RUN: %clang_dfsan %s -o %t && %run %t
3 // REQUIRES: x86_64-target-arch
5 // Tests that labels are propagated through loads and stores.
7 #include <sanitizer/dfsan_interface.h>
12 dfsan_label i_label
= 1;
13 dfsan_set_label(i_label
, &i
, sizeof(i
));
15 dfsan_label new_label
= dfsan_get_label(i
);
16 assert(i_label
== new_label
);
18 dfsan_label read_label
= dfsan_read_label(&i
, sizeof(i
));
19 assert(i_label
== read_label
);
21 dfsan_label j_label
= 2;
22 dfsan_add_label(j_label
, &i
, sizeof(i
));
24 read_label
= dfsan_read_label(&i
, sizeof(i
));
25 assert(dfsan_has_label(read_label
, i_label
));
26 assert(dfsan_has_label(read_label
, j_label
));