Skip to content

Commit 61769b3

Browse files
committed
Add test case similar to Vulkan's version define
1 parent 957976c commit 61769b3

File tree

1 file changed

+6
-0
lines changed
  • tests/ClangSharp.PInvokeGenerator.UnitTests

1 file changed

+6
-0
lines changed

tests/ClangSharp.PInvokeGenerator.UnitTests/CTest.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,14 @@ public Task UnsignedIntBitshiftTest()
297297
298298
#define Left 1 << 1U
299299
#define Right 1 >> 1U
300+
300301
#define Int 1 << 1
301302
#define Long 1 << 1L
302303
#define LongLong 1 << 1LL
303304
#define ULong 1 << 1UL
304305
#define ULongLong 1 << 1ULL
306+
307+
#define Complex ((((unsigned int)(0)) << 29U) | (((unsigned int)(1)) << 22U) | (((unsigned int)(0)) << 12U) | ((unsigned int)(0)))
305308
";
306309

307310
var expectedOutputContents = @"namespace ClangSharp.Test
@@ -352,6 +355,9 @@ public static partial class Methods
352355
353356
[NativeTypeName(""#define ULongLong 1 << 1ULL"")]
354357
public const int ULongLong = 1 << 1;
358+
359+
[NativeTypeName(""#define Complex ((((unsigned int)(0)) << 29U) | (((unsigned int)(1)) << 22U) | (((unsigned int)(0)) << 12U) | ((unsigned int)(0)))"")]
360+
public const uint Complex = ((((uint)(0)) << 29) | (((uint)(1)) << 22) | (((uint)(0)) << 12) | ((uint)(0)));
355361
}
356362
}
357363
";

0 commit comments

Comments
 (0)