diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-12-29 04:09:59 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-12-29 04:09:59 +0000 |
commit | c63fa612e46ec56776474580c72c7fb761e8777d (patch) | |
tree | b7989c465e3b6c15531a0ee7677d276f914479f7 /clang/test/Sema/asm.c | |
parent | c52f300698e86195cff4b8e9eadbb184c42d29eb (diff) | |
download | bcm5719-llvm-c63fa612e46ec56776474580c72c7fb761e8777d.tar.gz bcm5719-llvm-c63fa612e46ec56776474580c72c7fb761e8777d.zip |
Sema: Forbid inconsistent constraint alternatives
Verify that asm constraints have the same number of alternatives
llvm-svn: 224911
Diffstat (limited to 'clang/test/Sema/asm.c')
-rw-r--r-- | clang/test/Sema/asm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Sema/asm.c b/clang/test/Sema/asm.c index 13ae25f265c..e49888ff3eb 100644 --- a/clang/test/Sema/asm.c +++ b/clang/test/Sema/asm.c @@ -164,3 +164,10 @@ double f_output_constraint(void) { __asm("foo1": "=f" (result)); // expected-error {{invalid output constraint '=f' in asm}} return result; } + +void fn1() { + int l; + __asm__("" + : [l] "=r"(l) + : "[l],m"(l)); // expected-error {{asm constraint has an unexpected number of alternatives: 1 vs 2}} +} |