r251419 - [ms-inline-asm] Test case for alignment directive change in LLVM r251418
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 27 10:34:33 PDT 2015
Author: rnk
Date: Tue Oct 27 12:34:29 2015
New Revision: 251419
URL: http://llvm.org/viewvc/llvm-project?rev=251419&view=rev
Log:
[ms-inline-asm] Test case for alignment directive change in LLVM r251418
Added:
cfe/trunk/test/CodeGen/ms-inline-asm-align.c
Added: cfe/trunk/test/CodeGen/ms-inline-asm-align.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-inline-asm-align.c?rev=251419&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/ms-inline-asm-align.c (added)
+++ cfe/trunk/test/CodeGen/ms-inline-asm-align.c Tue Oct 27 12:34:29 2015
@@ -0,0 +1,30 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fasm-blocks -emit-llvm -o - | FileCheck %s --check-prefix=DARWIN
+// RUN: %clang_cc1 %s -triple i686-pc-win32 -fasm-blocks -emit-llvm -o - | FileCheck %s --check-prefix=WINDOWS
+
+// On Windows, .align is in bytes, and on Darwin, .align is in log2 form. The
+// Intel inline assembly parser should rewrite to the appropriate form depending
+// on the platform.
+
+void align_test() {
+ __asm align 8
+ __asm align 16;
+ __asm align 128;
+ __asm ALIGN 256;
+}
+
+// DARWIN-LABEL: define void @align_test()
+// DARWIN: call void asm sideeffect inteldialect
+// DARWIN-SAME: .align 3
+// DARWIN-SAME: .align 4
+// DARWIN-SAME: .align 7
+// DARWIN-SAME: .align 8
+// DARWIN-SAME: "~{dirflag},~{fpsr},~{flags}"()
+
+// WINDOWS-LABEL: define void @align_test()
+// WINDOWS: call void asm sideeffect inteldialect
+// WINDOWS-SAME: .align 8
+// WINDOWS-SAME: .align 16
+// WINDOWS-SAME: .align 128
+// WINDOWS-SAME: .align 256
+// WINDOWS-SAME: "~{dirflag},~{fpsr},~{flags}"()
More information about the cfe-commits
mailing list