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

2017-02-07 Thread Sanne Wouda via Phabricator via cfe-commits
sanwou01 updated this revision to Diff 87461.
sanwou01 added a comment.

Update the tests.  Note that the diagnostics for backend errors are missing the
"instantiated into assembly here" messages.  This is unfortunate but expected:
the origin information is no longer available at this stage.


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,25 @@
+// 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: :1:3: note: instantiated into assembly here
+// CHECK:  wibble
+// CHECK:  ^~
+
+void foo() {
+   asm(" .word -bar");
+   asm(" .word -foo");
+}
+
+// CHECK: :1:3: error: expected relocatable expression
+// CHECK:  .word -bar
+// CHECK:  ^
+
+// CHECK: :1:3: error: expected relocatable expression
+// CHECK:  .word -foo
+// CHECK:  ^


Index: test/Misc/inline-asm-diags.c
===
--- /dev/null
+++ test/Misc/inline-asm-diags.c
@@ -0,0 +1,25 @@
+// 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: :1:3: note: instantiated into assembly here
+// CHECK:  wibble
+// CHECK:  ^~
+
+void foo() {
+	asm(" .word -bar");
+	asm(" .word -foo");
+}
+
+// CHECK: :1:3: error: expected relocatable expression
+// CHECK:  .word -bar
+// CHECK:  ^
+
+// CHECK: :1:3: error: expected relocatable expression
+// CHECK:  .word -foo
+// CHECK:  ^
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2017-02-01 Thread Sanne Wouda via Phabricator via cfe-commits
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: :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: :1:3: note: instantiated into assembly here
+// CHECK:  .word -bar
+// CHECK:  ^


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: :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: :1:3: note: instantiated into assembly here
+// CHECK:  .word -bar
+// CHECK:  ^
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits