1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=i386-linux-gnu %s -o - | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker; XFAIL: * 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Workerdefine i64 @test_add(i64* %addr, i64 %inc) { 5*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_add: 6*9880d681SAndroid Build Coastguard Worker; CHECK: calll __sync_fetch_and_add_8 7*9880d681SAndroid Build Coastguard Worker %old = atomicrmw add i64* %addr, i64 %inc seq_cst 8*9880d681SAndroid Build Coastguard Worker ret i64 %old 9*9880d681SAndroid Build Coastguard Worker} 10*9880d681SAndroid Build Coastguard Worker 11*9880d681SAndroid Build Coastguard Workerdefine i64 @test_sub(i64* %addr, i64 %inc) { 12*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_sub: 13*9880d681SAndroid Build Coastguard Worker; CHECK: calll __sync_fetch_and_sub_8 14*9880d681SAndroid Build Coastguard Worker %old = atomicrmw sub i64* %addr, i64 %inc seq_cst 15*9880d681SAndroid Build Coastguard Worker ret i64 %old 16*9880d681SAndroid Build Coastguard Worker} 17*9880d681SAndroid Build Coastguard Worker 18*9880d681SAndroid Build Coastguard Workerdefine i64 @test_and(i64* %andr, i64 %inc) { 19*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_and: 20*9880d681SAndroid Build Coastguard Worker; CHECK: calll __sync_fetch_and_and_8 21*9880d681SAndroid Build Coastguard Worker %old = atomicrmw and i64* %andr, i64 %inc seq_cst 22*9880d681SAndroid Build Coastguard Worker ret i64 %old 23*9880d681SAndroid Build Coastguard Worker} 24*9880d681SAndroid Build Coastguard Worker 25*9880d681SAndroid Build Coastguard Workerdefine i64 @test_or(i64* %orr, i64 %inc) { 26*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_or: 27*9880d681SAndroid Build Coastguard Worker; CHECK: calll __sync_fetch_and_or_8 28*9880d681SAndroid Build Coastguard Worker %old = atomicrmw or i64* %orr, i64 %inc seq_cst 29*9880d681SAndroid Build Coastguard Worker ret i64 %old 30*9880d681SAndroid Build Coastguard Worker} 31*9880d681SAndroid Build Coastguard Worker 32*9880d681SAndroid Build Coastguard Workerdefine i64 @test_xor(i64* %xorr, i64 %inc) { 33*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_xor: 34*9880d681SAndroid Build Coastguard Worker; CHECK: calll __sync_fetch_and_xor_8 35*9880d681SAndroid Build Coastguard Worker %old = atomicrmw xor i64* %xorr, i64 %inc seq_cst 36*9880d681SAndroid Build Coastguard Worker ret i64 %old 37*9880d681SAndroid Build Coastguard Worker} 38*9880d681SAndroid Build Coastguard Worker 39*9880d681SAndroid Build Coastguard Workerdefine i64 @test_nand(i64* %nandr, i64 %inc) { 40*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_nand: 41*9880d681SAndroid Build Coastguard Worker; CHECK: calll __sync_fetch_and_nand_8 42*9880d681SAndroid Build Coastguard Worker %old = atomicrmw nand i64* %nandr, i64 %inc seq_cst 43*9880d681SAndroid Build Coastguard Worker ret i64 %old 44*9880d681SAndroid Build Coastguard Worker} 45