kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

cg_x64_inline_asm_machine_constraints.c (394B)


      1 int test_main(void) {
      2 #if defined(__x86_64__)
      3   int aout = 0;
      4   int bout = 0;
      5 
      6   __asm__ volatile("movl %1, %0\n\taddl %2, %0"
      7                    : "=a"(aout)
      8                    : "c"(20), "d"(22));
      9   __asm__ volatile("movl %1, %0\n\taddl %2, %0"
     10                    : "=b"(bout)
     11                    : "S"(17), "D"(25));
     12 
     13   return (aout == 42 && bout == 42) ? 42 : 1;
     14 #else
     15   return 42;
     16 #endif
     17 }