Skip to content

Commit c8639a5

Browse files
committed
[AVR][NFC] Supplement a test for inline assembly constraint 'I'
1 parent 1dcd2d9 commit c8639a5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

clang/lib/Basic/Targets/AVR.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ class LLVM_LIBRARY_VISIBILITY AVRTargetInfo : public TargetInfo {
124124
Info.setAllowsRegister();
125125
return true;
126126
case 'I': // 6-bit positive integer constant
127+
// Due to issue https://github.com/llvm/llvm-project/issues/51513, we
128+
// allow value 64 in the frontend and let it be dinied in the backend.
127129
Info.setRequiresImmediate(0, 64);
128130
return true;
129131
case 'J': // 6-bit negative integer constant

llvm/test/CodeGen/AVR/inline-asm/inline-asm-invalid.ll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ define void @foo2() {
2121
call void asm sideeffect "ldd r24, X+2", ""()
2222
ret void
2323
}
24+
25+
define void @foo3() {
26+
; AVR6: error: value out of range for constraint 'I'
27+
call void asm sideeffect "out $0, r20", "I"(i16 64)
28+
ret void
29+
}

0 commit comments

Comments
 (0)