WindowsTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: OSTargetInfo<Target>(Triple, Opts) {
this->WCharType = TargetInfo::UnsignedShort;
+ this->WIntType = TargetInfo::UnsignedShort;
}
};
// AARCH64-MSVC: #define __SIZEOF_SHORT__ 2
// AARCH64-MSVC: #define __SIZEOF_SIZE_T__ 8
// AARCH64-MSVC: #define __SIZEOF_WCHAR_T__ 2
-// AARCH64-MSVC: #define __SIZEOF_WINT_T__ 4
+// AARCH64-MSVC: #define __SIZEOF_WINT_T__ 2
// AARCH64-MSVC: #define __SIZE_MAX__ 18446744073709551615ULL
// AARCH64-MSVC: #define __SIZE_TYPE__ long long unsigned int
// AARCH64-MSVC: #define __SIZE_WIDTH__ 64
// AARCH64-MSVC: #define __WCHAR_TYPE__ unsigned short
// AARCH64-MSVC: #define __WCHAR_UNSIGNED__ 1
// AARCH64-MSVC: #define __WCHAR_WIDTH__ 16
-// AARCH64-MSVC: #define __WINT_TYPE__ int
-// AARCH64-MSVC: #define __WINT_WIDTH__ 32
+// AARCH64-MSVC: #define __WINT_TYPE__ unsigned short
+// AARCH64-MSVC: #define __WINT_WIDTH__ 16
// AARCH64-MSVC: #define __aarch64__ 1
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm-none-none < /dev/null | FileCheck -match-full-lines -check-prefix ARM %s
// CHECK: #define __SIZEOF_SHORT__ 2
// CHECK: #define __SIZEOF_SIZE_T__ 4
// CHECK: #define __SIZEOF_WCHAR_T__ 2
-// CHECK: #define __SIZEOF_WINT_T__ 4
+// CHECK: #define __SIZEOF_WINT_T__ 2
// CHECK: #define __SIZE_TYPE__ unsigned int
// CHECK: #define __UINTPTR_TYPE__ unsigned int
printf("%I32d", i32); // expected-warning{{'I32' length modifier is not supported by ISO C}}
printf("%I64d", i64); // expected-warning{{'I64' length modifier is not supported by ISO C}}
printf("%wc", c); // expected-warning{{'w' length modifier is not supported by ISO C}}
+ // expected-warning@-1{{format specifies type 'wint_t' (aka 'unsigned short') but the argument has type 'wchar_t' (aka 'unsigned short')}}
printf("%Z", p); // expected-warning{{'Z' conversion specifier is not supported by ISO C}}
}
}
void w_test(wchar_t c, wchar_t *s) {
- printf("%wc", c);
+ printf("%wc", c); // expected-warning{{format specifies type 'wint_t' (aka 'unsigned short') but the argument has type 'wchar_t' (aka 'unsigned short')}}
printf("%wC", c);
printf("%C", c);
printf("%ws", s);
scanf("%S", s);
double bad;
- printf("%wc", bad); // expected-warning{{format specifies type 'wint_t' (aka 'int') but the argument has type 'double'}}
+ printf("%wc", bad); // expected-warning{{format specifies type 'wint_t' (aka 'unsigned short') but the argument has type 'double'}}
printf("%wC", bad); // expected-warning{{format specifies type 'wchar_t' (aka 'unsigned short') but the argument has type 'double'}}
printf("%C", bad); // expected-warning{{format specifies type 'wchar_t' (aka 'unsigned short') but the argument has type 'double'}}
printf("%ws", bad); // expected-warning{{format specifies type 'wchar_t *' (aka 'unsigned short *') but the argument has type 'double'}}