1 // Tests -fsanitize-coverage=trace-pc,trace-loads,trace-stores
3 // REQUIRES: has_sancovcc,stable-runtime,x86_64
5 // RUN: %clangxx -O0 %s -fsanitize-coverage=trace-pc,trace-loads,trace-stores -o %t
6 // RUN: %run %t 2>&1 | FileCheck %s
12 void __sanitizer_cov_load1(uint8_t *addr
) { printf("load1: %p\n", addr
); }
13 void __sanitizer_cov_load2(uint16_t *addr
) { printf("load2: %p\n", addr
); }
14 void __sanitizer_cov_load4(uint32_t *addr
) { printf("load4: %p\n", addr
); }
15 void __sanitizer_cov_load8(uint64_t *addr
) { printf("load8: %p\n", addr
); }
16 void __sanitizer_cov_load16(__int128
*addr
) { printf("load16: %p\n", addr
); }
18 void __sanitizer_cov_store1(uint8_t *addr
) { printf("store1: %p\n", addr
); }
19 void __sanitizer_cov_store2(uint16_t *addr
) { printf("store2: %p\n", addr
); }
20 void __sanitizer_cov_store4(uint32_t *addr
) { printf("store4: %p\n", addr
); }
21 void __sanitizer_cov_store8(uint64_t *addr
) { printf("store8: %p\n", addr
); }
22 void __sanitizer_cov_store16(__int128
*addr
) { printf("store16: %p\n", addr
); }
30 static volatile int sink
;
33 printf("var1: %p\n", &var1
);
36 // CHECK: var1: [[ADDR:0x.*]]
37 // CHECK: load1: [[ADDR]]
38 // CHECK: store1: [[ADDR]]
40 printf("var2: %p\n", &var2
);
43 // CHECK: var2: [[ADDR:0x.*]]
44 // CHECK: load2: [[ADDR]]
45 // CHECK: store2: [[ADDR]]
47 printf("var4: %p\n", &var4
);
50 // CHECK: var4: [[ADDR:0x.*]]
51 // CHECK: load4: [[ADDR]]
52 // CHECK: store4: [[ADDR]]
54 printf("var8: %p\n", &var8
);
57 // CHECK: var8: [[ADDR:0x.*]]
58 // CHECK: load8: [[ADDR]]
59 // CHECK: store8: [[ADDR]]
61 printf("var16: %p\n", &var16
);
64 // CHECK: var16: [[ADDR:0x.*]]
65 // CHECK: load16: [[ADDR]]
66 // CHECK: store16: [[ADDR]]