-> 3.17.0.RC2
[valgrind.git] / drd / tests / annotate_trace_memory.c
blobf539336fc1b288cbca46edf31bbb776a612d8ba1
1 #include <stdio.h>
2 #include <inttypes.h>
3 #include "../../drd/drd.h"
5 volatile float f;
6 volatile double d;
7 volatile int8_t i8;
8 volatile int16_t i16;
9 volatile int32_t i32;
10 volatile int64_t i64;
12 int main(int argc, char** argv)
14 DRD_TRACE_VAR(f);
15 DRD_TRACE_VAR(d);
16 DRD_TRACE_VAR(i8);
17 DRD_TRACE_VAR(i16);
18 DRD_TRACE_VAR(i32);
19 DRD_TRACE_VAR(i64);
21 fprintf(stderr, "float\n");
22 f = 1;
23 f += 2;
24 fprintf(stderr, "double\n");
25 d = 3;
26 d += 4;
27 fprintf(stderr, "uint8_t\n");
28 i8 = 5;
29 i8 += 6;
30 fprintf(stderr, "uint16_t\n");
31 i16 = 7;
32 i16++;
33 fprintf(stderr, "uint32_t\n");
34 i32 = 8;
35 i32++;
36 fprintf(stderr, "uint64_t\n");
37 i64 = 9;
38 i64 += 0x12345678ULL;
40 DRD_STOP_TRACING_VAR(f);
41 DRD_STOP_TRACING_VAR(d);
42 DRD_STOP_TRACING_VAR(i8);
43 DRD_STOP_TRACING_VAR(i16);
44 DRD_STOP_TRACING_VAR(i32);
45 DRD_STOP_TRACING_VAR(i64);
47 fprintf(stderr, "Done.\n");
48 return 0;