aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Verifier/nonnull_metadata.ll
blob: 9ef67dc163c59c69d6acae3786c578df9633f938 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
; RUN: not llvm-as < %s 2>&1 | FileCheck %s

declare ptr @dummy()

; CHECK: nonnull applies only to pointer types
define void @test_not_pointer(ptr %p) {
  load i32, ptr %p, !nonnull !{}
  ret void
}

; CHECK: nonnull applies only to load instructions, use attributes for calls or invokes
define void @test_not_load() {
  call ptr @dummy(), !nonnull !{}
  ret void
}

; CHECK: nonnull metadata must be empty
define void @test_invalid_arg(ptr %p) {
  load ptr, ptr %p, !nonnull !{i32 0}
  ret void
}