[llvm] [Support][ScopedPrinter] Emit valid JSON in printHex<ulittle16_t> (PR #200071)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 01:27:41 PDT 2026


================
@@ -235,10 +235,12 @@ Sections:
 # RUN:  | FileCheck %s -DFILE=%t.invalid2 -DSECHDRCOUNT="<?>" -DSECHDRSTRTABINDEX="<?>" --check-prefix=INVALID-GNU
 
 ## --elf-output-style=JSON must emit well-formed JSON when e_machine is not
-## in any known enum table (regression: raw "Machine: 0x..." inside JSON).
+## in any known enum table.
 # RUN: yaml2obj %s --docnum=5 -o %t.unknown-machine
 # RUN: llvm-readobj --elf-output-style=JSON --pretty-print --file-header \
-# RUN:   %t.unknown-machine | FileCheck %s --check-prefix=JSON-UNKNOWN-MACHINE
+# RUN:   %t.unknown-machine > %t.unknown-machine.json
+# RUN: FileCheck %s --check-prefix=JSON-UNKNOWN-MACHINE < %t.unknown-machine.json
+# RUN: %python -c 'import json, sys; json.load(sys.stdin)' < %t.unknown-machine.json
----------------
jh7370 wrote:

This is probably worth a comment to explain the specific purpose.

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


More information about the llvm-commits mailing list