1 ; RUN: llc -O1 < %s -mtriple=armv7 -mattr=+db | FileCheck %s
3 @x1 = global i32 0, align 4
4 @x2 = global i32 0, align 4
10 for.body: ; preds = %for.body, %entry
11 %i.013 = phi i32 [ 1, %entry ], [ %inc6, %for.body ]
12 store atomic i32 %i.013, i32* @x1 seq_cst, align 4
13 store atomic i32 %i.013, i32* @x1 seq_cst, align 4
14 store atomic i32 %i.013, i32* @x2 seq_cst, align 4
15 %inc6 = add nsw i32 %i.013, 1
16 %exitcond = icmp eq i32 %inc6, 2
17 br i1 %exitcond, label %for.end, label %for.body
19 for.end: ; preds = %for.body
22 ; The for.body contains 3 seq_cst stores.
23 ; Hence it should have 3 dmb;str;dmb sequences with the middle dmbs collapsed
47 define void @test2() {
48 call void @llvm.arm.dmb(i32 11)
49 tail call void @test()
50 call void @llvm.arm.dmb(i32 11)
52 ; the call should prevent the two dmbs from collapsing
59 define void @test3() {
60 call void @llvm.arm.dmb(i32 11)
61 call void @llvm.arm.dsb(i32 9)
62 call void @llvm.arm.dmb(i32 11)
64 ; the call should prevent the two dmbs from collapsing
73 declare void @llvm.arm.dmb(i32)
74 declare void @llvm.arm.dsb(i32)