[llvm] [llvm-objdump] Add the --visualize-jumps option (PR #74858)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 14 01:01:43 PST 2023


================
@@ -0,0 +1,204 @@
+# RUN: rm -rf %t && split-file %s %t && cd %t
+
+// RUN: llvm-mc < input.s -triple aarch64 -filetype=obj | \
+// RUN:   llvm-objdump --triple aarch64 -d --visualize-jumps=unicode - | \
+// RUN:   diff - expected-unicode.txt
+
+// RUN: llvm-mc < input.s -triple aarch64 -filetype=obj | \
+// RUN:   llvm-objdump --triple aarch64 -d --visualize-jumps=ascii - | \
+// RUN:   diff - expected-ascii.txt
+
+// RUN: llvm-mc < input.s -triple aarch64 -filetype=obj | \
+// RUN:   llvm-objdump --triple aarch64 -d --visualize-jumps=unicode,color - | \
+// RUN:   diff - expected-unicode-color.txt
+
+// RUN: llvm-mc < input.s -triple aarch64 -filetype=obj | \
+// RUN:   llvm-objdump --triple aarch64 -d --visualize-jumps=unicode --reloc - | \
+// RUN:   diff - expected-unicode-relocs.txt
+
+//--- input.s
+test_func:
+  // Relocated instructions don't get control-flow edges.
+  bl extern_func
+  b extern_func
+  
+  // Two branches to the same label, one forward and one backward.
+  b .Llabel1
+.Llabel1:
+  nop
+  b .Llabel1
+
+  // Branch to self, no CFG edge shown
----------------
jh7370 wrote:

Nit: missing full stop, here and in other comments.

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


More information about the llvm-commits mailing list