diff --git a/llvm/test/CodeGen/AArch64/fence-singlethread.ll b/llvm/test/CodeGen/AArch64/fence-singlethread.ll new file mode 100644 index 000000000000..2ed744277385 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/fence-singlethread.ll @@ -0,0 +1,21 @@ +; RUN: llc -mtriple=aarch64-linux-gnu %s -o - | FileCheck %s --check-prefix=LINUX +; RUN: llc -mtriple=aarch64-apple-ios %s -o - | FileCheck %s --check-prefix=IOS +; RUN: llc -mtriple=aarch64-linux-gnueabihf %s -filetype=obj -o %t +; RUN: llvm-objdump -d %t | FileCheck %s --check-prefix=OBJ + +; OBJ-NOT: dmb + +define void @fence_singlethread() { +; LINUX-LABEL: fence_singlethread: +; LINUX-NOT: dmb +; LINUX: // COMPILER BARRIER +; LINUX-NOT: dmb + +; IOS-LABEL: fence_singlethread: +; IOS-NOT: dmb +; IOS: ; COMPILER BARRIER +; IOS-NOT: dmb + + fence singlethread seq_cst + ret void +}