1; RUN: llvm-dis < %s.bc | FileCheck %s 2 3; Check that function-local metadata is dropped correctly when it's not a 4; direct argument to a call instruction. 5; 6; Bitcode assembled by llvm-as v3.5.0. 7 8define void @foo(i32 %v) { 9; CHECK: entry: 10entry: 11; CHECK-NEXT: call void @llvm.bar(metadata i32 %v) 12 call void @llvm.bar(metadata !{i32 %v}) 13 14; Note: these supposedly legal instructions fired an assertion in llvm-as: 15; 16; Assertion failed: (I != ValueMap.end() && "Value not in slotcalculator!"), function getValueID, file lib/Bitcode/Writer/ValueEnumerator.cpp, line 138. 17; 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 !{}}) 23 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}}) 28 29; CHECK-NEXT: ret void{{$}} 30 ret void, !baz !{i32 %v} 31} 32 33declare void @llvm.bar(metadata) 34 35; CHECK: !0 = !{} 36