[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
Tue Jul 9 22:19:22 PDT 2024


================
@@ -0,0 +1,69 @@
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s 2>&1 -o /dev/null | FileCheck --strict-whitespace %s --check-prefix=CHECK-WARN
+
+.string "abcd\xFFefg
+12345678"
+
+.ascii "some test ascii
+
+sequence
+with
+newlines\x0A
+"
+
+.asciz "another test string
+
+with
+newline characters
+
+
+"
+
+// CHECK-WARN:   warn-newline-in-escaped-string.s:3:21: warning: unterminated string; newline inserted
----------------
chestnykh wrote:

Thx, reworked

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


More information about the llvm-commits mailing list