File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -2931,6 +2931,8 @@ void Verifier::visitFunction(const Function &F) {
29312931 FT->getParamType (i));
29322932 Check (Arg.getType ()->isFirstClassType (),
29332933 " Function arguments must have first-class types!" , &Arg);
2934+ Check (!Arg.getType ()->isLabelTy (),
2935+ " Function argument cannot be of label type!" , &Arg, &F);
29342936 if (!IsIntrinsic) {
29352937 Check (!Arg.getType ()->isMetadataTy (),
29362938 " Function takes metadata but isn't an intrinsic" , &Arg, &F);
Original file line number Diff line number Diff line change 1+ ; RUN: not llvm-as < %s 2>&1 | FileCheck %s
2+
3+ define void @invalid_arg_type (i32 %0 ) {
4+ 1 :
5+ call void @foo (label %1 )
6+ ret void
7+ }
8+
9+ declare void @foo (label )
10+ ; CHECK: Function argument cannot be of label type!
11+ ; CHECK-NEXT: label %0
12+ ; CHECK-NEXT: ptr @foo
13+
14+
You can’t perform that action at this time.
0 commit comments