1 // Verify that we do check for constraints in device-side inline
2 // assembly. Passing an illegal input/output constraint and look
3 // for corresponding error
4 // RUN: %clang_cc1 -triple nvptx-unknown-cuda -fsyntax-only -fcuda-is-device -verify %s
6 __attribute__((device)) void df() {
9 // asm with PTX constraints. Some of them are PTX-specific.
10 __asm__("output constraints"
11 : "=h"(h), // .u16 reg, OK
12 "=a"(a) // expected-error {{invalid output constraint '=a' in asm}}
15 __asm__("input constraints"
17 : "f"(0.0), // .f32 reg, OK
18 "d"(0.0), // .f64 reg, OK
19 "h"(0), // .u16 reg, OK
20 "r"(0), // .u32 reg, OK
21 "l"(0), // .u64 reg, OK
22 "a"(0) // expected-error {{invalid input constraint 'a' in asm}}