| 1 |
// RUN: %clang_cc1 -triple arm64-windows -fsyntax-only -verify \ |
| 2 |
// RUN: -fms-compatibility -ffreestanding -fms-compatibility-version=17.00 %s |
| 3 |
|
| 4 |
#include <intrin.h> |
| 5 |
|
| 6 |
void check__break(int x) { |
| 7 |
__break(-1); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 8 |
__break(65536); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 9 |
__break(x); // expected-error {{argument to '__break' must be a constant integer}} |
| 10 |
} |
| 11 |
|
| 12 |
void check__hlt() { |
| 13 |
__hlt(-1); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 14 |
__hlt(65536); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 15 |
} |
| 16 |
|
| 17 |
void check__getReg(void) { |
| 18 |
__getReg(-1); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 19 |
__getReg(32); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 20 |
} |
| 21 |
|
| 22 |
void check_ReadWriteStatusReg(int v) { |
| 23 |
int x; |
| 24 |
_ReadStatusReg(x); // expected-error {{argument to '_ReadStatusReg' must be a constant integer}} |
| 25 |
_WriteStatusReg(x, v); // expected-error {{argument to '_WriteStatusReg' must be a constant integer}} |
| 26 |
} |
| 27 |
|
| 28 |
void check__sys(int v) { |
| 29 |
int x; |
| 30 |
__sys(x, v); // expected-error {{argument to '__sys' must be a constant integer}} |
| 31 |
} |
| 32 |
|
| 33 |
unsigned int check__sys_retval() { |
| 34 |
return __sys(0, 1); // builtin has superfluous return value for MSVC compatibility |
| 35 |
} |