diff options
author | Dylan McKay <dylanmckay34@gmail.com> | 2017-02-06 09:01:59 +0000 |
---|---|---|
committer | Dylan McKay <dylanmckay34@gmail.com> | 2017-02-06 09:01:59 +0000 |
commit | c0b70cd682309388825cdd5284b5afb849c053df (patch) | |
tree | 6a5a71269e888a175f14ab9abcaa60c597518fbf /test/CodeGen/avr-unsupported-inline-asm-constraints.c | |
parent | e11d70efe73d57e9a794bad46e7921c506012241 (diff) |
[AVR] Add support for the full set of inline asm constraints
Summary:
Previously the method would simply return false, causing every single
inline assembly constraint to trigger a compile error.
This adds inline assembly constraint support for the AVR target.
This patch is derived from the code in
AVRISelLowering::getConstraintType.
More details can be found on the AVR-GCC reference wiki
http://www.nongnu.org/avr-libc/user-manual/inline_asm.html
Reviewers: jroelofs, asl
Reviewed By: asl
Subscribers: asl, ahatanak, saaadhu, cfe-commits
Differential Revision: https://reviews.llvm.org/D28344
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/avr-unsupported-inline-asm-constraints.c')
-rw-r--r-- | test/CodeGen/avr-unsupported-inline-asm-constraints.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CodeGen/avr-unsupported-inline-asm-constraints.c b/test/CodeGen/avr-unsupported-inline-asm-constraints.c new file mode 100644 index 0000000000..5a875979a9 --- /dev/null +++ b/test/CodeGen/avr-unsupported-inline-asm-constraints.c @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -triple avr-unknown-unknown -verify %s + +const unsigned char val = 0; + +int foo() { + __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}} +} |