[PATCH] D29770: [Assembler] Inline assembly diagnostics test.

Sanne Wouda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 05:54:04 PST 2017


sanwou01 updated this revision to Diff 88188.
sanwou01 added a comment.

Use clang_cc1 -verify for testing as suggested by @rnk.

@echristo, llc does use the same diags interfaces as clang, however, it is
lacking the infrastructure to make use of LocCookies.

In any case, I think this test is useful to prevent regressions in inline
assembly diagnostics in clang.


https://reviews.llvm.org/D29770

Files:
  test/Misc/inline-asm-diags.c


Index: test/Misc/inline-asm-diags.c
===================================================================
--- /dev/null
+++ test/Misc/inline-asm-diags.c
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -S -emit-obj -triple armv7a-arm-none-eabi %s -o /dev/null -verify
+
+void foo2() {
+	asm(" wibble"); // expected-error{{invalid instruction}}
+}
+
+void foo() {
+	asm(" .word -bar");  // expected-error {{expected relocatable expression}}
+	asm(" .word -foo");  // expected-error {{expected relocatable expression}}
+}
+
+// expected-note at 1 {{instantiated into assembly here}}
+// expected-note at 1 {{instantiated into assembly here}}
+// expected-note at 1 {{instantiated into assembly here}}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29770.88188.patch
Type: text/x-patch
Size: 676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170213/14eb8af4/attachment.bin>


More information about the cfe-commits mailing list