aboutsummaryrefslogtreecommitdiff
path: root/llvm/test
diff options
context:
space:
mode:
authorTimur Baydyusenov <t.baydyusenov@syntacore.com>2025-11-12 05:29:40 +0300
committerGitHub <noreply@github.com>2025-11-11 18:29:40 -0800
commita100a6c97be0259c8d0b5758830cba14d4eb5c4d (patch)
tree3c13b923c303fafa74c59c7b048f63883fe0b45f /llvm/test
parentc1f18a2518898e5f593ce1341d19f61b5ee58cdd (diff)
downloadllvm-a100a6c97be0259c8d0b5758830cba14d4eb5c4d.zip
llvm-a100a6c97be0259c8d0b5758830cba14d4eb5c4d.tar.gz
llvm-a100a6c97be0259c8d0b5758830cba14d4eb5c4d.tar.bz2
[llvm][llvm-dis] Fix 'llvm-dis' with '--materialize-metadata --show-annotations' crashes (#167487)
Added handling the case of a non-materialized module, also don't call printInfoComment for immaterializable values
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Assembler/metadata-annotations.ll22
1 files changed, 18 insertions, 4 deletions
diff --git a/llvm/test/Assembler/metadata-annotations.ll b/llvm/test/Assembler/metadata-annotations.ll
index 4fd4713..2a08a17 100644
--- a/llvm/test/Assembler/metadata-annotations.ll
+++ b/llvm/test/Assembler/metadata-annotations.ll
@@ -1,9 +1,23 @@
; RUN: llvm-as < %s | llvm-dis --materialize-metadata --show-annotations | FileCheck %s
+; CHECK: @global_var = global i32 1
+; CHECK: @alias = alias i32, ptr @global_var
+; CHECK: @ifunc = ifunc i32 (), ptr @ifunc_resolver
+@global_var = global i32 1
+@alias = alias i32, ptr @global_var
+@ifunc = ifunc i32 (), ptr @ifunc_resolver
+
+; CHECK: ; Materializable
+; CHECK-NEXT: define ptr @ifunc_resolver() {}
+define ptr @ifunc_resolver() {
+ ret ptr @defined_function
+}
+
; CHECK: ; Materializable
-; CHECK-NEXT: define dso_local i32 @test() {}
-define dso_local i32 @test() {
-entry:
- ret i32 0
+; CHECK-NEXT: define void @defined_function() {}
+define void @defined_function() {
+ ret void
}
+; CHECK: declare void @declared_function()
+declare void @declared_function()