diff --git a/llvm/test/Bitcode/2021-07-22-Metadata-Operand-Bundles.ll b/llvm/test/Bitcode/2021-07-22-Metadata-Operand-Bundles.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Bitcode/2021-07-22-Metadata-Operand-Bundles.ll @@ -0,0 +1,12 @@ +; This test ensures that we get a metadata operand bundle value in and out. +; RUN: llvm-as < %s | llvm-dis | FileCheck %s + +declare void @callee() + +; CHECK-LABEL: call_with_operand_bundle( +define void @call_with_operand_bundle() { + ; CHECK: call void @op_bundle_callee() [ "op_type"(metadata !"metadata_string") ] + call void @callee() [ "op_type"(metadata !"metadata_string") ] + + ret void +} diff --git a/llvm/test/Bitcode/compatibility.ll b/llvm/test/Bitcode/compatibility.ll --- a/llvm/test/Bitcode/compatibility.ll +++ b/llvm/test/Bitcode/compatibility.ll @@ -1771,6 +1771,14 @@ ret void } +define void @call_with_operand_bundle5(i32* %ptr) { +; CHECK-LABEL: call_with_operand_bundle5( + entry: + call void @op_bundle_callee_0() [ "foo"(metadata !"metadata_string") ] +; CHECK: call void @op_bundle_callee_0() [ "foo"(metadata !"metadata_string") ] + ret void +} + ; Invoke versions of the above tests: @@ -1866,6 +1874,19 @@ ret void } +define void @invoke_with_operand_bundle5(i32* %ptr) personality i8 3 { +; CHECK-LABEL: @invoke_with_operand_bundle5( + entry: + invoke void @op_bundle_callee_0() [ "foo"(metadata !"metadata_string") ] to label %normal unwind label %exception +; CHECK: invoke void @op_bundle_callee_0() [ "foo"(metadata !"metadata_string") ] + +exception: + %cleanup = landingpad i8 cleanup + br label %normal +normal: + ret void +} + declare void @vaargs_func(...) define void @invoke_with_operand_bundle_vaarg(i32* %ptr) personality i8 3 { ; CHECK-LABEL: @invoke_with_operand_bundle_vaarg( diff --git a/llvm/test/Bitcode/operand-bundles.ll b/llvm/test/Bitcode/operand-bundles.ll --- a/llvm/test/Bitcode/operand-bundles.ll +++ b/llvm/test/Bitcode/operand-bundles.ll @@ -56,6 +56,14 @@ ret void } +define void @f5(i32* %ptr) { +; CHECK-LABEL: @f5( + entry: + call void @callee0() [ "foo"(metadata !"metadata_string") ] +; CHECK: call void @callee0() [ "foo"(metadata !"metadata_string") ] + ret void +} + ; Invoke versions of the above tests: @@ -150,3 +158,16 @@ normal: ret void } + +define void @g5(i32* %ptr) personality i8 3 { +; CHECK-LABEL: @g5( + entry: + invoke void @callee0() [ "foo"(metadata !"metadata_string") ] to label %normal unwind label %exception +; CHECK: invoke void @callee0() [ "foo"(metadata !"metadata_string") ] + +exception: + %cleanup = landingpad i8 cleanup + br label %normal +normal: + ret void +}