Esempio n. 1
0
int main() {
    FITIN_MONITOR_VARIABLE(a);
		char b = 'c';
    FITIN_MONITOR_VARIABLE(b);
		a[0] += 1;
		b += 1;

		printf("%c %c\n", a[1], b);

    return 0;
}
Esempio n. 2
0
int main() {
    float a = 1.25, b = 0;
    FITIN_MONITOR_VARIABLE(a);

    b += a;
    b += a;
    b += a;

    printf("%.2f\n", a);
    return 0;
}
Esempio n. 3
0
int main() {
    int a = 1, b = 1, c = 0;
    FITIN_MONITOR_VARIABLE(a);

    asm("movl %0, %%eax"::"m"(a):"eax");
    asm("movl %0, %%ebx"::"m"(b):"ebx");
    asm("addl %eax, %ebx");
    asm("movl %%ebx, %0":"=m"(b));
    asm("imull %eax, %ebx");
    asm("movl %%ebx, %0":"=m"(b));
    asm("subl %eax, %ebx");
    asm("movl %%ebx, %0":"=m"(b));
    asm("movl %%eax, %0":"=m"(c));

    printf("%d\n", c);
    printf("%d\n", b);
    return 0;
}
Esempio n. 4
0
int main() {
    unsigned int a = 1, ref = 0, flip = 0;
    FITIN_MONITOR_VARIABLE(a);

    /* Valgrind will create a dirty helper here to fake CPUID. */
    asm("movl $0, %eax");
    asm("cpuid");
    asm("movl %%eax, %0":"=m"(ref));

    asm("movl %0, %%eax"::"m"(a):"%eax");
    asm("cpuid");
    asm("movl %%eax, %0":"=m"(flip));

    /* If a has been flipped to 0, this should be '1'. */
    printf("%u\n", flip == ref);

    return 0;
}