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
5 #include <sanitizer/dfsan_interface.h>
7 __attribute__((noinline
)) uint64_t foo(uint64_t x
, uint64_t y
) { return x
+ y
; }
9 int main(int argc
, char *argv
[]) {
12 dfsan_set_label(8, &a
, sizeof(a
));
13 uint64_t c
= foo(a
, b
);
14 for (int i
= 0; i
< argc
; ++i
)
16 dfsan_print_origin_trace(&c
, NULL
);
19 // CHECK: Taint value 0x8 {{.*}} origin tracking ()
20 // CHECK: Origin value: {{.*}}, Taint value was stored to memory at
21 // CHECK: #0 {{.*}} in main {{.*}}origin_branch.c:[[@LINE-6]]
23 // CHECK: Origin value: {{.*}}, Taint value was stored to memory at
24 // CHECK: #0 {{.*}} in main {{.*}}origin_branch.c:[[@LINE-11]]
26 // CHECK: Origin value: {{.*}}, Taint value was created at
27 // CHECK: #0 {{.*}} in main {{.*}}origin_branch.c:[[@LINE-15]]