Home | History | Annotate | Download | only in CodeGen
      1 // REQUIRES: mips-registered-target
      2 // RUN: %clang_cc1 -triple mips-linux-gnu -emit-llvm -o - %s | FileCheck %s
      3 
      4 int data;
      5 
      6 void m () {
      7   asm("lw $1, %0" :: "m"(data));
      8   // CHECK: call void asm sideeffect "lw $$1, $0", "*m,~{$1}"(i32* @data)
      9 }
     10 
     11 void ZC () {
     12   asm("ll $1, %0" :: "ZC"(data));
     13   // CHECK: call void asm sideeffect "ll $$1, $0", "*^ZC,~{$1}"(i32* @data)
     14 }
     15 
     16 void R () {
     17   asm("lw $1, %0" :: "R"(data));
     18   // CHECK: call void asm sideeffect "lw $$1, $0", "*R,~{$1}"(i32* @data)
     19 }
     20 
     21 int additionalClobberedRegisters () {
     22   int temp0;
     23   asm volatile(
     24                 "mfhi %[temp0], $ac1 \n\t"
     25                   : [temp0]"=&r"(temp0)
     26                   :
     27                   : "memory", "t0", "t1", "$ac1hi", "$ac1lo", "$ac2hi", "$ac2lo", "$ac3hi", "$ac3lo"
     28   );
     29   return 0;
     30   // CHECK: call i32 asm sideeffect "mfhi $0, $$ac1 \0A\09", "=&r,~{memory},~{$8},~{$9},~{$ac1hi},~{$ac1lo},~{$ac2hi},~{$ac2lo},~{$ac3hi},~{$ac3lo},~{$1}"
     31 }
     32