summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/builtins-arm-msvc-compat-error.c
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-12-17 17:52:30 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-12-17 17:52:30 +0000
commit86b881c63e489256e779ad7d72aa8aac17fa3d06 (patch)
treee940cba666eeb5c7303f949f30492b9c971bb42a /clang/test/CodeGen/builtins-arm-msvc-compat-error.c
parent44ee1c0e91baeae6ea240c3224698b59174b3aee (diff)
downloadbcm5719-llvm-86b881c63e489256e779ad7d72aa8aac17fa3d06.tar.gz
bcm5719-llvm-86b881c63e489256e779ad7d72aa8aac17fa3d06.zip
CodeGen: implement __emit intrinsic
For MSVC compatibility, add the `__emit' builtin. This is used in the Windows SDK headers, and must therefore be implemented as a builtin rather than an intrinsic. The `__emit' builtin provides a mechanism to emit a 16-bit opcode instruction into the stream. The value must be a compile time constant expression. No guarantees are made about the CPU and memory states after the execution of the instruction. Due to the unchecked nature of the builtin, only support this on Windows on ARM. llvm-svn: 224438
Diffstat (limited to 'clang/test/CodeGen/builtins-arm-msvc-compat-error.c')
-rw-r--r--clang/test/CodeGen/builtins-arm-msvc-compat-error.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/CodeGen/builtins-arm-msvc-compat-error.c b/clang/test/CodeGen/builtins-arm-msvc-compat-error.c
new file mode 100644
index 00000000000..29469deb6a7
--- /dev/null
+++ b/clang/test/CodeGen/builtins-arm-msvc-compat-error.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -triple thumbv7-windows -fms-extensions -verify %s
+
+void emit_error(unsigned int opcode) {
+ __emit(opcode); // expected-error {{argument to '__emit' must be a constant integer}}
+}
+
OpenPOWER on IntegriCloud