1 ; RUN: opt -S -lowerbitsets < %s | FileCheck %s
3 ; Tests that non-string metadata nodes may be used as bitset identifiers.
5 target datalayout = "e-p:32:32"
7 ; CHECK: @[[BNAME:.*]] = private constant { [2 x i32] }
8 ; CHECK: @[[ANAME:.*]] = private constant { i32 }
11 @b = constant [2 x i32] [i32 2, i32 3]
13 !0 = !{!2, i32* @a, i32 0}
14 !1 = !{!3, [2 x i32]* @b, i32 0}
18 !llvm.bitsets = !{ !0, !1 }
20 declare i1 @llvm.bitset.test(i8* %ptr, metadata %bitset) nounwind readnone
23 define i1 @foo(i8* %p) {
24 ; CHECK: icmp eq i32 {{.*}}, ptrtoint ({ i32 }* @[[ANAME]] to i32)
25 %x = call i1 @llvm.bitset.test(i8* %p, metadata !2)
30 define i1 @bar(i8* %p) {
31 ; CHECK: icmp eq i32 {{.*}}, ptrtoint ({ [2 x i32] }* @[[BNAME]] to i32)
32 %x = call i1 @llvm.bitset.test(i8* %p, metadata !3)