CCTLib
Calling-context and data-object attribution library for Intel Pin
deadspy_tp_minimal.c
Go to the documentation of this file.
1 // Absolute minimal victim: exactly 1 dead 8-byte write via store8, nothing else.
2 #include <stdint.h>
3 
4 static volatile uint64_t sink;
5 
6 __attribute__((noinline)) void store8(volatile uint64_t* p, uint64_t v) {
7  *p = v;
8 }
9 
10 int main(int argc, char** argv) {
11  (void)argc; (void)argv;
12  volatile uint64_t x = 0xAA;
13  store8(&x, 1);
14  store8(&x, 2); // dead: the previous store to &x has not been read
15  sink = x;
16  return 0;
17 }
int main(int argc, char **argv)
__attribute__((noinline))
static volatile uint64_t sink