32 lines · plain
1; RUN: not opt -passes=verify < %s 2>&1 | FileCheck %s2 3declare void @g()4 5define void @test_ptrauth_bundle(i64 %arg0, i32 %arg1, ptr %arg2) {6 7; CHECK: Multiple ptrauth operand bundles8; CHECK-NEXT: call void %arg2() [ "ptrauth"(i32 42, i64 100), "ptrauth"(i32 42, i64 %arg0) ]9 call void %arg2() [ "ptrauth"(i32 42, i64 100), "ptrauth"(i32 42, i64 %arg0) ]10 11; CHECK: Ptrauth bundle key operand must be an i32 constant12; CHECK-NEXT: call void %arg2() [ "ptrauth"(i32 %arg1, i64 120) ]13 call void %arg2() [ "ptrauth"(i32 %arg1, i64 120) ]14 15; CHECK: Ptrauth bundle key operand must be an i32 constant16; CHECK-NEXT: call void %arg2() [ "ptrauth"(i64 42, i64 120) ]17 call void %arg2() [ "ptrauth"(i64 42, i64 120) ]18 19; CHECK: Ptrauth bundle discriminator operand must be an i6420; CHECK-NEXT: call void %arg2() [ "ptrauth"(i32 42, i32 120) ]21 call void %arg2() [ "ptrauth"(i32 42, i32 120) ]22 23; CHECK: Direct call cannot have a ptrauth bundle24; CHECK-NEXT: call void @g() [ "ptrauth"(i32 42, i64 120) ]25 call void @g() [ "ptrauth"(i32 42, i64 120) ]26 27; CHECK-NOT: call void28 call void %arg2() [ "ptrauth"(i32 42, i64 120) ] ; OK29 call void %arg2() [ "ptrauth"(i32 42, i64 %arg0) ] ; OK30 ret void31}32