summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/ms-inline-asm.c
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2014-10-08 17:28:34 +0000
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2014-10-08 17:28:34 +0000
commit42924431012107c78d77af227020757b371c4e2f (patch)
tree5ea712504fbe5914b9847b108b3d5b3720172822 /clang/test/Sema/ms-inline-asm.c
parent731685e6bcf04bf40254430de5356692d7bffa27 (diff)
downloadbcm5719-llvm-42924431012107c78d77af227020757b371c4e2f.tar.gz
bcm5719-llvm-42924431012107c78d77af227020757b371c4e2f.zip
ms-inline-asm: Correctly mark MS inline ASM labels as used
Summary: This fixes PR21155. Test Plan: The patch includes a test. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5619 llvm-svn: 219322
Diffstat (limited to 'clang/test/Sema/ms-inline-asm.c')
-rw-r--r--clang/test/Sema/ms-inline-asm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/test/Sema/ms-inline-asm.c b/clang/test/Sema/ms-inline-asm.c
index 6eac7695054..4c6948f4d45 100644
--- a/clang/test/Sema/ms-inline-asm.c
+++ b/clang/test/Sema/ms-inline-asm.c
@@ -1,5 +1,5 @@
// REQUIRES: x86-registered-target
-// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -fasm-blocks -Wno-microsoft -verify -fsyntax-only
+// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -fasm-blocks -Wno-microsoft -Wunused-label -verify -fsyntax-only
void t1(void) {
__asm __asm // expected-error {{__asm used with no assembly instructions}}
@@ -146,5 +146,11 @@ void t10() {
void t11() {
foo:
- __asm mov eax, foo // expected-error {{use of undeclared label 'foo'}}
+ __asm mov eax, foo // expected-error {{use of undeclared label 'foo'}} expected-warning {{unused label 'foo'}}
+}
+
+void t12() {
+ __asm foo:
+ __asm bar: // expected-warning {{unused label 'bar'}}
+ __asm jmp foo
}
OpenPOWER on IntegriCloud