Relax the MemOperands on atomics a bit. Fixes -verify-machineinstrs failures for...
[oota-llvm.git] / test / CodeGen / ARM / atomic-load-store.ll
1 ; RUN: llc < %s -mtriple=armv7-apple-ios -verify-machineinstrs | FileCheck %s -check-prefix=ARM
2 ; RUN: llc < %s -mtriple=armv7-apple-ios -O0 | FileCheck %s -check-prefix=ARM
3 ; RUN: llc < %s -mtriple=thumbv7-apple-ios | FileCheck %s -check-prefix=THUMBTWO
4 ; RUN: llc < %s -mtriple=thumbv6-apple-ios | FileCheck %s -check-prefix=THUMBONE
5
6 define void @test1(i32* %ptr, i32 %val1) {
7 ; ARM: test1
8 ; ARM: dmb ish
9 ; ARM-NEXT: str
10 ; ARM-NEXT: dmb ish
11 ; THUMBONE: test1
12 ; THUMBONE: __sync_lock_test_and_set_4
13 ; THUMBTWO: test1
14 ; THUMBTWO: dmb ish
15 ; THUMBTWO-NEXT: str
16 ; THUMBTWO-NEXT: dmb ish
17   store atomic i32 %val1, i32* %ptr seq_cst, align 4
18   ret void
19 }
20
21 define i32 @test2(i32* %ptr) {
22 ; ARM: test2
23 ; ARM: ldr
24 ; ARM-NEXT: dmb ish
25 ; THUMBONE: test2
26 ; THUMBONE: __sync_val_compare_and_swap_4
27 ; THUMBTWO: test2
28 ; THUMBTWO: ldr
29 ; THUMBTWO-NEXT: dmb ish
30   %val = load atomic i32* %ptr seq_cst, align 4
31   ret i32 %val
32 }