@@ -292,9 +292,27 @@ public Task UnsignedIntBitshiftTest()
292
292
const int ShiftSignedLong = 1 << SignedLong;
293
293
const int ShiftUnsigned = 1 << Unsigned;
294
294
295
+ const int Char = 1 << (signed char)1;
296
+ const int UChar = 1 << (unsigned char)1;
297
+
295
298
const int CInt = 1 << 1;
296
299
const int CUint = 1 << 1U;
297
300
301
+ const int Negative = 1 << -1;
302
+
303
+ const int OutOfRangePos = 1 << 10000000000;
304
+ const int OutOfRangeNeg = 1 << -10000000000;
305
+
306
+ const int IntMax = 1 << 2147483647;
307
+ const int IntMin = 1 << -2147483648;
308
+
309
+ const int LongMax = 1 << 9223372036854775807;
310
+ const int LongMin = 1 << -9223372036854775808;
311
+
312
+ const int ULongMax = 1 << 18446744073709551615;
313
+
314
+ const int Hexadecimal = 1 << 0x01;
315
+
298
316
#define Left 1 << 1U
299
317
#define Right 1 >> 1U
300
318
@@ -307,6 +325,11 @@ public Task UnsignedIntBitshiftTest()
307
325
#define Complex ((((unsigned int)(0)) << 29U) | (((unsigned int)(1)) << 22U) | (((unsigned int)(0)) << 12U) | ((unsigned int)(0)))
308
326
" ;
309
327
328
+ // Non-ideal cases:
329
+ // UChar
330
+ // IntMin
331
+ // ULongMax
332
+ // Hexadecimal
310
333
var expectedOutputContents = @"namespace ClangSharp.Test
311
334
{
312
335
public static partial class Methods
@@ -329,12 +352,45 @@ public static partial class Methods
329
352
[NativeTypeName(""const int"")]
330
353
public const int ShiftUnsigned = 1 << (int)(Unsigned);
331
354
355
+ [NativeTypeName(""const int"")]
356
+ public const int Char = 1 << (sbyte)(1);
357
+
358
+ [NativeTypeName(""const int"")]
359
+ public const int UChar = unchecked(1 << (byte)(1));
360
+
332
361
[NativeTypeName(""const int"")]
333
362
public const int CInt = 1 << 1;
334
363
335
364
[NativeTypeName(""const int"")]
336
365
public const int CUint = 1 << 1;
337
366
367
+ [NativeTypeName(""const int"")]
368
+ public const int Negative = 1 << -1;
369
+
370
+ [NativeTypeName(""const int"")]
371
+ public const int OutOfRangePos = unchecked(1 << (int)(10000000000));
372
+
373
+ [NativeTypeName(""const int"")]
374
+ public const int OutOfRangeNeg = unchecked(1 << (int)(-10000000000));
375
+
376
+ [NativeTypeName(""const int"")]
377
+ public const int IntMax = 1 << 2147483647;
378
+
379
+ [NativeTypeName(""const int"")]
380
+ public const int IntMin = unchecked(1 << -2147483648);
381
+
382
+ [NativeTypeName(""const int"")]
383
+ public const int LongMax = unchecked(1 << (int)(9223372036854775807));
384
+
385
+ [NativeTypeName(""const int"")]
386
+ public const int LongMin = unchecked(1 << (int)(-9223372036854775808));
387
+
388
+ [NativeTypeName(""const int"")]
389
+ public const int ULongMax = 1 << -1;
390
+
391
+ [NativeTypeName(""const int"")]
392
+ public const int Hexadecimal = 1 << 1;
393
+
338
394
[NativeTypeName(""#define Left 1 << 1U"")]
339
395
public const int Left = 1 << 1;
340
396
0 commit comments