[docs] Fix build-docs.sh
[llvm-project.git] / compiler-rt / test / dfsan / origin_overlapped.c
blob60774c8419baf46de476e2f86b04b0e83f9a5643
1 // RUN: %clang_dfsan -gmlt -mllvm -dfsan-track-origins=1 %s -o %t && \
2 // RUN: %run %t >%t.out 2>&1
3 // RUN: FileCheck %s < %t.out
4 //
5 // REQUIRES: x86_64-target-arch
7 #include <sanitizer/dfsan_interface.h>
9 int main(int argc, char *argv[]) {
10 char volatile z1;
11 char volatile z2;
12 dfsan_set_label(8, (void *)&z1, sizeof(z1));
13 dfsan_set_label(16, (void *)&z2, sizeof(z2)); // overwritting the old origin.
14 char c = z1;
15 dfsan_print_origin_trace(&c, "bar");
16 return 0;
19 // CHECK: Taint value 0x8 {{.*}} origin tracking (bar)
20 // CHECK: Origin value: {{.*}}, Taint value was stored to memory at
21 // CHECK: #0 {{.*}} in main {{.*}}origin_overlapped.c:[[@LINE-7]]
23 // CHECK: Origin value: {{.*}}, Taint value was created at
25 // CHECK: #0 {{.*}} in main {{.*}}origin_overlapped.c:[[@LINE-12]]