Skip to content

Commit b8979c6

Browse files
authored
[PPC][InlineASM] Mark the 'a' constraint as unsupported (#96109)
'a' is an input/output constraint for restraining assembly variables to an indexed or indirect address operand. It previously was marked as supported but would throw an assertion for unknown constraint type in the back-end when this test case was compiled. This change marks it as unsupported until we can add full support for address operands constraining to the compiler code generation.
1 parent c053ec9 commit b8979c6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

clang/lib/Basic/Targets/PPC.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,11 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public TargetInfo {
305305
// asm statements)
306306
Info.setAllowsMemory();
307307
break;
308-
case 'R': // AIX TOC entry
309308
case 'a': // Address operand that is an indexed or indirect from a
310309
// register (`p' is preferable for asm statements)
310+
// TODO: Add full support for this constraint
311+
return false;
312+
case 'R': // AIX TOC entry
311313
case 'S': // Constant suitable as a 64-bit mask operand
312314
case 'T': // Constant suitable as a 32-bit mask operand
313315
case 'U': // System V Release 4 small data area reference
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %clang_cc1 -emit-llvm -triple powerpc64-ibm-aix-xcoff -verify %s
2+
// RUN: %clang_cc1 -emit-llvm -triple powerpc-ibm-aix-xcoff -verify %s
3+
// This test case exist to test marking the 'a' inline assembly constraint as
4+
// unsupported because powerpc previously marked it as supported.
5+
int foo(int arg){
6+
asm goto ("bc 12,2,%l[TEST_LABEL]" : : "a"(&&TEST_LABEL) : : TEST_LABEL); //expected-error {{invalid input constraint 'a' in asm}}
7+
return 0;
8+
TEST_LABEL: return arg + 1;
9+
}

0 commit comments

Comments
 (0)