llvm-project/clang/test/CodeGen/builtins-arm-msvc-compat-error.c
Saleem Abdulrasool 86b881c63e 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
2014-12-17 17:52:30 +00:00

7 lines
201 B
C

// 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}}
}