xref: /llvm-project/llvm/test/Verifier/nonnull_metadata.ll (revision 474f20ba26400559e5d99fd4f29926253092f00b)
1; RUN: not llvm-as < %s 2>&1 | FileCheck %s
2
3declare ptr @dummy()
4
5; CHECK: nonnull applies only to pointer types
6define void @test_not_pointer(ptr %p) {
7  load i32, ptr %p, !nonnull !{}
8  ret void
9}
10
11; CHECK: nonnull applies only to load instructions, use attributes for calls or invokes
12define void @test_not_load() {
13  call ptr @dummy(), !nonnull !{}
14  ret void
15}
16
17; CHECK: nonnull metadata must be empty
18define void @test_invalid_arg(ptr %p) {
19  load ptr, ptr %p, !nonnull !{i32 0}
20  ret void
21}
22