1 ; RUN: opt -S -globalopt < %s | FileCheck %s
3 ; PR6112 - When globalopt does RAUW(@G, %G), the metadata reference should drop
4 ; to null. Function local metadata that references @G from a different function
5 ; to that containing %G should likewise drop to null.
6 @G = internal global i8** null
8 define i32 @main(i32 %argc, i8** %argv) {
11 store i8** %argv, i8*** @G
15 define void @foo(i32 %x) {
16 call void @llvm.foo(metadata !{i8*** @G, i32 %x})
17 ; CHECK: call void @llvm.foo(metadata !{null, i32 %x})
21 declare void @llvm.foo(metadata) nounwind readnone
25 !0 = metadata !{i8*** @G}
26 ; CHECK: !0 = metadata !{null}