llvm-project/clang/test/CodeGen/avr/avr-unsupported-inline-asm-constraints.c
Ben Shi b0524f3329
[clang][AVR] Improve compatibility of inline assembly with avr-gcc (#136534)
Allow the value 64 to be round up to 0 for constraint 'I'.
2025-04-23 18:42:07 +08:00

11 lines
546 B
C

// RUN: %clang_cc1 -triple avr-unknown-unknown -verify %s
const unsigned char val = 0;
int foo(void) {
__asm__ volatile("foo %0, 1" : : "fo" (val)); // expected-error {{invalid input constraint 'fo' in asm}}
__asm__ volatile("foo %0, 1" : : "Nd" (val)); // expected-error {{invalid input constraint 'Nd' in asm}}
__asm__ volatile("subi r30, %0" : : "G" (1)); // expected-error {{value '1' out of range for constraint 'G'}}
__asm__ volatile("out %0, r20" : : "I" (65)); // expected-error {{value '65' out of range for constraint 'I'}}
}