llvm-project/llvm/test/Verifier/access_group.ll
Nikita Popov f00cd27646 [Verifier] Verify llvm.access.group metadata
According to LangRef, an access scope must have zero operands and
be distinct. The access group may either be a single access scope
or a list of access scopes.

LoopInfo may assert if this is not the case.
2022-03-14 16:16:36 +01:00

19 lines
462 B
LLVM

; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
define void @test(i8* %p) {
; CHECK: Access scope list contains invalid access scope
load i8, i8* %p, !llvm.access.group !1
; CHECK: Access scope list must consist of MDNodes
load i8, i8* %p, !llvm.access.group !2
; CHECK-NOT: Access scope
load i8, i8* %p, !llvm.access.group !3
load i8, i8* %p, !llvm.access.group !4
ret void
}
!0 = !{}
!1 = !{!0}
!2 = !{!"foo"}
!3 = distinct !{}
!4 = !{!3}