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

Sanne Wouda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 1 12:03:32 PST 2017


sanwou01 created this revision.
Herald added a subscriber: mehdi_amini.

Add a test for improved inline assembly diagnostics in llvm.


https://reviews.llvm.org/D29415

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,23 @@
+// RUN: not %clang -c --target=armv7a-arm-none-eabi %s -o /dev/null 2>&1 | FileCheck %s
+
+void foo2() {
+	asm(" wibble");
+}
+
+// CHECK: 4:6: error: invalid instruction
+// CHECK:   asm(" wibble");
+// CHECK:       ^
+// CHECK: <inline asm>:1:3: note: instantiated into assembly here
+// CHECK:          wibble
+// CHECK:          ^~~~~~
+
+void foo() {
+	asm(" .word -bar");
+}
+
+// CHECK: 15:6: error: expected relocatable expression
+// CHECK:   asm(" .word -bar");
+// CHECK:       ^
+// CHECK: <inline asm>:1:3: note: instantiated into assembly here
+// CHECK:          .word -bar
+// CHECK:          ^


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29415.86694.patch
Type: text/x-patch
Size: 780 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170201/12ff4cf3/attachment.bin>


More information about the cfe-commits mailing list