1 ; RUN: llvm-dis < %s.bc | FileCheck %s
3 ; Check that function-local metadata is dropped correctly when it's not a
4 ; direct argument to a call instruction.
6 ; Bitcode assembled by llvm-as v3.5.0.
8 define void @foo(i32 %v) {
11 ; CHECK-NEXT: call void @llvm.bar(metadata i32 %v)
12 call void @llvm.bar(metadata !{i32 %v})
14 ; Note: these supposedly legal instructions fired an assertion in llvm-as:
16 ; Assertion failed: (I != ValueMap.end() && "Value not in slotcalculator!"), function getValueID, file lib/Bitcode/Writer/ValueEnumerator.cpp, line 138.
18 ; So, I didn't test them; it looks like bitcode compatability is irrelevant.
19 ; call void @llvm.bar(metadata !{i32 0, i32 %v})
20 ; call void @llvm.bar(metadata !{i32 %v, i32 0})
21 ; call void @llvm.bar(metadata !{metadata !{}, i32 %v})
22 ; call void @llvm.bar(metadata !{i32 %v, metadata !{}})
24 ; CHECK-NEXT: call void @llvm.bar(metadata !0)
25 ; CHECK-NEXT: call void @llvm.bar(metadata !0)
26 call void @llvm.bar(metadata !{i32 %v, i32 %v})
27 call void @llvm.bar(metadata !{metadata !{i32 %v}})
29 ; CHECK-NEXT: ret void{{$}}
30 ret void, !baz !{i32 %v}
33 declare void @llvm.bar(metadata)