1 // RUN: %clang_cc1 -triple nvptx-unknown-unknown -O3 -S -o - %s -emit-llvm | FileCheck %s 2 // RUN: %clang_cc1 -triple nvptx64-unknown-unknown -O3 -S -o - %s -emit-llvm | FileCheck %s 3 4 void constraints() { 5 char c; 6 unsigned char uc; 7 short s; 8 unsigned short us; 9 int i; 10 unsigned int ui; 11 long l; 12 unsigned long ul; 13 float f; 14 double d; 15 16 // CHECK: i8 asm sideeffect "mov.b8 $0, $1;", "=c,c" 17 asm volatile ("mov.b8 %0, %1;" : "=c"(c) : "c"(c)); 18 // CHECK: i8 asm sideeffect "mov.b8 $0, $1;", "=c,c" 19 asm volatile ("mov.b8 %0, %1;" : "=c"(uc) : "c"(uc)); 20 21 // CHECK: i16 asm sideeffect "mov.b16 $0, $1;", "=h,h" 22 asm volatile ("mov.b16 %0, %1;" : "=h"(s) : "h"(s)); 23 // CHECK: i16 asm sideeffect "mov.b16 $0, $1;", "=h,h" 24 asm volatile ("mov.b16 %0, %1;" : "=h"(us) : "h"(us)); 25 26 // CHECK: i32 asm sideeffect "mov.b32 $0, $1;", "=r,r" 27 asm volatile ("mov.b32 %0, %1;" : "=r"(i) : "r"(i)); 28 // CHECK: i32 asm sideeffect "mov.b32 $0, $1;", "=r,r" 29 asm volatile ("mov.b32 %0, %1;" : "=r"(ui) : "r"(ui)); 30 31 // CHECK: i64 asm sideeffect "mov.b64 $0, $1;", "=l,l" 32 asm volatile ("mov.b64 %0, %1;" : "=l"(l) : "l"(l)); 33 // CHECK: i64 asm sideeffect "mov.b64 $0, $1;", "=l,l" 34 asm volatile ("mov.b64 %0, %1;" : "=l"(ul) : "l"(ul)); 35 36 // CHECK: float asm sideeffect "mov.b32 $0, $1;", "=f,f" 37 asm volatile ("mov.b32 %0, %1;" : "=f"(f) : "f"(f)); 38 // CHECK: double asm sideeffect "mov.b64 $0, $1;", "=d,d" 39 asm volatile ("mov.b64 %0, %1;" : "=d"(d) : "d"(d)); 40 } 41