[llvm] Improving ThinLTO error message for inline assembly errors (PR #102211)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 10:00:25 PDT 2024


================
@@ -0,0 +1,17 @@
+// RUN: clang -emit-llvm -c %s -g -o %t
+// RUN: llc %t 2>&1 | FileCheck %s
+void bad_asm() {
+  asm volatile ("BAD SYNTAX$%"); // CHECK: inline-asm-debuginfo.c:4:{{[0-9]+}}: <inline asm>:1:14: error: unknown token in expression
+}
+
+void bad_multi_asm() {
+  asm ( ";"
+        "BAD SYNTAX;"   // CHECK: inline-asm-debuginfo.c:8:{{[0-9]+}}: <inline asm>:1:3: error: invalid instruction mnemonic 'bad'
+        ";" );
+}
+
+void bad_multi_asm_linechg() {
+  asm ( ";\n"
----------------
MaskRay wrote:

you can use more `\n` to enhance the test

https://github.com/llvm/llvm-project/pull/102211


More information about the llvm-commits mailing list