summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2014-05-13 11:11:24 +0000
committerNico Weber <nicolasweber@gmx.de>2014-05-13 11:11:24 +0000
commitad8e36c41aa15f525ec50bffcf755428e45d8f14 (patch)
tree3bd50c91bf2cf7b6375143aecbe3bc261e1a8638 /clang/test
parent7d07fe20a03aa19579e5c52e380dfd91b855e651 (diff)
downloadbcm5719-llvm-ad8e36c41aa15f525ec50bffcf755428e45d8f14.tar.gz
bcm5719-llvm-ad8e36c41aa15f525ec50bffcf755428e45d8f14.zip
Support -masm= flag for x86 targets.
`clang -S -o - file.c -masm=att` will write assembly to stdout in at&t syntax (the default), `-masm=intel` will instead output intel style asm. llvm-svn: 208683
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Driver/masm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Driver/masm.c b/clang/test/Driver/masm.c
new file mode 100644
index 00000000000..e9e4422aedf
--- /dev/null
+++ b/clang/test/Driver/masm.c
@@ -0,0 +1,12 @@
+// RUN: %clang -target i386-unknown-linux -masm=intel %s -S -o - | FileCheck --check-prefix=CHECK-INTEL %s
+// RUN: %clang -target i386-unknown-linux -masm=att %s -S -o - | FileCheck --check-prefix=CHECK-ATT %s
+// RUN: not %clang -target i386-unknown-linux -masm=somerequired %s -S -o - 2>&1 | FileCheck --check-prefix=CHECK-SOMEREQUIRED %s
+// RUN: %clang -target arm-unknown-eabi -masm=intel %s -S -o - 2>&1 | FileCheck --check-prefix=CHECK-ARM %s
+
+int f() {
+// CHECK-ATT: movl $0, %eax
+// CHECK-INTEL: mov eax, 0
+// CHECK-SOMEREQUIRED: error: unsupported argument 'somerequired' to option 'masm='
+// CHECK-ARM: warning: argument unused during compilation: '-masm=intel'
+ return 0;
+}
OpenPOWER on IntegriCloud