[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / nvptx-inlineasm-ptx.c
blobad1567fb3020fa2aad323c6b1bbb6d322c3722e9
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
4 void constraints(void) {
5 char c;
6 unsigned char uc;
7 short s;
8 unsigned short us;
9 int i;
10 unsigned int ui;
11 long long ll;
12 unsigned long long ull;
13 float f;
14 double d;
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));
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));
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));
31 // CHECK: i64 asm sideeffect "mov.b64 $0, $1;", "=l,l"
32 asm volatile ("mov.b64 %0, %1;" : "=l"(ll) : "l"(ll));
33 // CHECK: i64 asm sideeffect "mov.b64 $0, $1;", "=l,l"
34 asm volatile ("mov.b64 %0, %1;" : "=l"(ull) : "l"(ull));
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));