[llvm] [MC,ELF] Emit warning if a string constant contains newline char. (PR #98060)
Dmitriy Chestnykh via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 15 01:39:58 PDT 2024
================
@@ -0,0 +1,54 @@
+// RUN: llvm-mc -filetype=obj -triple x86_64 %s 2>&1 -o /dev/null | FileCheck -DFILE=%s --strict-whitespace %s --implicit-check-not="{{[0-9]+:[0-9]+: warning: unterminated string}}" --check-prefix=CHECK-WARN
+
+.string "abcd\xFFefg
+12345678"
+
+// CHECK-WARN: [[#@LINE-3]]:21: warning: unterminated string; newline inserted
+// CHECK-NEXT: .string "abcd\xFFefg
+
+.ascii "some test ascii
+
+sequence
+with
+newlines\x0A
+"
+
+// CHECK-WARN: [[#@LINE-7]]:24: warning: unterminated string; newline inserted
+// CHECK-NEXT: .ascii "some test ascii
----------------
chestnykh wrote:
Done
https://github.com/llvm/llvm-project/pull/98060
More information about the llvm-commits
mailing list