[clang] 14035d5 - Fix this C99 DR to be more robust
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 1 04:34:25 PDT 2022
Author: Aaron Ballman
Date: 2022-07-01T07:33:37-04:00
New Revision: 14035d5147a2e2e910341556cef3b16b66a2be66
URL: https://github.com/llvm/llvm-project/commit/14035d5147a2e2e910341556cef3b16b66a2be66
DIFF: https://github.com/llvm/llvm-project/commit/14035d5147a2e2e910341556cef3b16b66a2be66.diff
LOG: Fix this C99 DR to be more robust
This should fix the following test issue on ARM:
https://lab.llvm.org/buildbot/#/builders/171/builds/16815
Added:
Modified:
clang/test/C/drs/dr2xx.c
Removed:
################################################################################
diff --git a/clang/test/C/drs/dr2xx.c b/clang/test/C/drs/dr2xx.c
index 0fa0f97858197..7cf692cb1a712 100644
--- a/clang/test/C/drs/dr2xx.c
+++ b/clang/test/C/drs/dr2xx.c
@@ -31,16 +31,23 @@ void dr204(void) {
/* If the implementation supports a standard integer type larger than signed
* long, it's okay for size_t and ptr
diff _t to have a greater integer
* conversion rank than signed long.
+ *
+ * Note, it's not required that the implementation use that larger conversion
+ * rank; it's acceptable to use an unsigned long or unsigned int for the size
+ * type (those ranks are not greater than that of signed long).
*/
- (void)_Generic(s + sl, __typeof__(s) : 1);
- (void)_Generic(p + sl, __typeof__(p) : 1);
+ (void)_Generic(s + sl, __typeof__(s) : 1, unsigned long : 1, unsigned int : 1);
+ (void)_Generic(p + sl, __typeof__(p) : 1, signed long : 1, signed int : 1);
#elif __LLONG_WIDTH__ == __LONG_WIDTH__
/* But if the implementation doesn't support a larger standard integer type
* than signed long, the conversion rank should prefer signed long if the type
* is signed (ptr
diff _t) or unsigned long if the type is unsigned (size_t).
+ *
+ * Note, as above, unsigned/signed int is also acceptable due to having a
+ * lesser integer conversion rank.
*/
- (void)_Generic(s + sl, unsigned long : 1);
- (void)_Generic(p + sl, signed long : 1);
+ (void)_Generic(s + sl, unsigned long : 1, unsigned int : 1);
+ (void)_Generic(p + sl, signed long : 1, signed int : 1);
#else
#error "Something has gone off the rails"
#endif
More information about the cfe-commits
mailing list