1 ; RUN: not opt -S -passes=verify < %s 2>&1 | FileCheck %s
3 define void @foo(ptr %ptr, i32 %x) {
5 ; CHECK: !mmra metadata attached to unexpected instruction kind
7 %bad.add = add i32 %x, 42, !mmra !{}
9 ; CHECK: !mmra metadata attached to unexpected instruction kind
10 ; CHECK-NEXT: %bad.sub
11 %bad.sub = sub i32 %x, 42, !mmra !{}
13 ; CHECK: !mmra metadata attached to unexpected instruction kind
14 ; CHECK-NEXT: %bad.sqrt
15 %bad.sqrt = call float @llvm.sqrt.f32(float undef), !mmra !{}
17 ; CHECK: !mmra expected to be a metadata tuple
18 ; CHECK-NEXT: %bad.md0
20 %bad.md0 = load atomic i32, ptr %ptr acquire, align 4, !mmra !0
22 ; CHECK: !mmra expected to be a metadata tuple
23 ; CHECK-NEXT: %bad.md1
25 %bad.md1 = load atomic i32, ptr %ptr acquire, align 4, !mmra !0
27 ; CHECK: !mmra metadata tuple operand is not an MMRA tag
28 ; CHECK-NEXT: %bad.md2
30 %bad.md2 = load atomic i32, ptr %ptr acquire, align 4, !mmra !1
32 ; CHECK: !mmra metadata tuple operand is not an MMRA tag
33 ; CHECK-NEXT: %bad.md3
35 %bad.md3 = load atomic i32, ptr %ptr acquire, align 4, !mmra !2
39 declare float @llvm.sqrt.f32(float)
41 !0 = !DIFile(filename: "test.c", directory: "")
42 !1 = !{!"foo", !"bar", !"bux"}