39 lines · plain
1; Test MD_prof "VP" validation2 3; RUN: split-file %s %t4; RUN: opt -passes=verify %t/valid.ll --disable-output5; RUN: not opt -passes=verify %t/invalid-kind.ll --disable-output 2>&1 | FileCheck %s --check-prefix=INVALID-KIND6; RUN: not opt -passes=verify %t/invalid-count.ll --disable-output 2>&1 | FileCheck %s --check-prefix=INVALID-COUNT7; RUN: not opt -passes=verify %t/invalid-place.ll --disable-output 2>&1 | FileCheck %s --check-prefix=INVALID-PLACE8 9;--- valid.ll10define void @test(ptr %0) {11 call void %0(), !prof !012 ret void13}14!0 = !{!"VP", i32 0, i32 20, i64 1234, i64 10, i64 5678, i64 5}15 16;--- invalid-kind.ll17define void @test(ptr %0) {18 call void %0(), !prof !019 ret void20}21!0 = !{!"VP", i32 3, i32 20, i64 1234, i64 10, i64 5678, i64 5}22; INVALID-KIND: Invalid VP !prof kind23 24;--- invalid-count.ll25define void @test(ptr %0) {26 call void %0(), !prof !027 ret void28}29!0 = !{!"VP", i32 1, i64 1234, i64 10, i64 5678, i64 5}30; INVALID-COUNT: VP !prof should have an even number of arguments after 'VP'31 32;--- invalid-place.ll33define i32 @test(i32 %0) {34 %r = add i32 %0, 1, !prof !035 ret i32 %r36}37!0 = !{!"VP", i32 1, i32 20, i64 1234, i64 10, i64 5678, i64 5}38; INVALID-PLACE: VP !prof indirect call or memop size expected to be applied to CallBase instructions only39