xref: /llvm-project/llvm/test/Verifier/metadata-function-kcfi-type.ll (revision cff5bef948c91e4919de8a5fb9765e0edc13f3de)
1; RUN: not llvm-as %s -disable-output 2>&1 | FileCheck %s
2
3define void @a() {
4  unreachable
5}
6
7define void @b() !kcfi_type !0 {
8  unreachable
9}
10
11; CHECK: function must have a single !kcfi_type attachment
12define void @f0() !kcfi_type !0 !kcfi_type !0 {
13  unreachable
14}
15!0 = !{i32 10}
16
17; CHECK: !kcfi_type must have exactly one operand
18define void @f1() !kcfi_type !1 {
19  unreachable
20}
21!1 = !{!"string", i32 0}
22
23; CHECK: expected a constant operand for !kcfi_type
24define void @f2() !kcfi_type !2 {
25  unreachable
26}
27!2 = !{!"string"}
28
29; CHECK: expected a constant integer operand for !kcfi_type
30define void @f3() !kcfi_type !3 {
31  unreachable
32}
33!3 = !{ptr @f3}
34
35; CHECK: expected a 32-bit integer constant operand for !kcfi_type
36define void @f4() !kcfi_type !4 {
37  unreachable
38}
39!4 = !{i64 10}
40