CCTLib
Calling-context and data-object attribution library for Intel Pin
redspy_immediate_tp.c
Go to the documentation of this file.
1 // redspy ISA test: repeatedly write the SAME 32-bit immediate to the same
2 // dword. The second store is redundant (same value already at address).
3 // Exercises immediate-operand instrumentation.
4 #include <stdint.h>
5 #define WORK_COUNT 20000
6 static volatile uint64_t sink;
7 static uint32_t buf[WORK_COUNT];
8 int main(int argc, char** argv) {
9  (void)argc; (void)argv;
10  for (int i = 0; i < WORK_COUNT; ++i) {
11  __asm__ __volatile__(
12  "movl $0xC0FFEE, (%0)\n\t"
13  "movl $0xC0FFEE, (%0)\n\t" // same immediate -- redundant
14  :
15  : "r"(&buf[i])
16  : "memory");
17  }
18  sink = buf[0];
19  return 0;
20 }
static uint32_t buf[WORK_COUNT]
#define WORK_COUNT
int main(int argc, char **argv)
static volatile uint64_t sink