Mercurial > hg > CbC > CbC_llvm
view compiler-rt/test/dfsan/basic.c @ 266:00f31e85ec16 default tip
Added tag current for changeset 31d058e83c98
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 14 Oct 2023 10:13:55 +0900 |
parents | 1f2b6ac9f198 |
children |
line wrap: on
line source
// RUN: %clang_dfsan %s -o %t && %run %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 = 1; dfsan_set_label(i_label, &i, sizeof(i)); dfsan_label new_label = dfsan_get_label(i); assert(i_label == new_label); dfsan_label read_label = dfsan_read_label(&i, sizeof(i)); assert(i_label == read_label); dfsan_label j_label = 2; dfsan_add_label(j_label, &i, sizeof(i)); read_label = dfsan_read_label(&i, sizeof(i)); assert(dfsan_has_label(read_label, i_label)); assert(dfsan_has_label(read_label, j_label)); return 0; }