1 #include <stdio.h> 2 #include <inttypes.h> 3 #include "../../drd/drd.h" 4 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; 11 12 int main(int argc, char** argv) 13 { 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); 20 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 __sync_add_and_fetch(&i32, 1); 36 fprintf(stderr, "uint64_t\n"); 37 i64 = 9; 38 __sync_add_and_fetch(&i64, 0x12345678ULL); 39 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); 46 47 fprintf(stderr, "Done.\n"); 48 return 0; 49 } 50