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) {
2931
2931
FT->getParamType (i));
2932
2932
Check (Arg.getType ()->isFirstClassType (),
2933
2933
" Function arguments must have first-class types!" , &Arg);
2934
+ Check (!Arg.getType ()->isLabelTy (),
2935
+ " Function argument cannot be of label type!" , &Arg, &F);
2934
2936
if (!IsIntrinsic) {
2935
2937
Check (!Arg.getType ()->isMetadataTy (),
2936
2938
" 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