[clang] [clang] Fix handling of asm string literals (PR #169803)

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 7 19:58:51 PDT 2026


================
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple s390x-none-zos -fexec-charset IBM-1047 %s -std=c++23 -fsyntax-only -verify
+// RUN: %clang_cc1 -triple s390x-none-zos -fexec-charset UTF-8 %s -std=c++23 -fsyntax-only -verify
+
+long inline_asm_ucn_named_operand(long a, long b) {
+  // The \N{...} escape encodes to U+0130.  IBM-1047 has no code point for
+  // U+0130, so the conversion reports an error.
+  asm("\tLGR %0, %[\N{LATIN CAPITAL LETTER I WITH DOT ABOVE}]\n" // expected-error-re {{encoding conversion failed: {{.*}}}}
----------------
hubert-reinterpretcast wrote:

I think information about this situation might be good to add into some Clang platform-specific considerations documentation.

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


More information about the cfe-commits mailing list