Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / dfsan / fast8labels.c
blob22dded47a0d20b5183e4e8a6350069eb38f4a996
1 // RUN: %clang_dfsan %s -o %t
2 // RUN: %run %t
3 //
4 #include <sanitizer/dfsan_interface.h>
6 #include <assert.h>
7 #include <stdio.h>
8 #include <string.h>
10 int foo(int a, int b) {
11 return a + b;
14 int main(int argc, char *argv[]) {
15 int a = 10;
16 int b = 20;
17 dfsan_set_label(8, &a, sizeof(a));
18 dfsan_set_label(128, &b, sizeof(b));
19 int c = foo(a, b);
20 printf("A: 0x%x\n", dfsan_get_label(a));
21 printf("B: 0x%x\n", dfsan_get_label(b));
22 dfsan_label l = dfsan_get_label(c);
23 printf("C: 0x%x\n", l);
24 assert(l == 136); // OR of the other two labels.