No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

050-TestStructsLayout.Generated.cs 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. // -----------------------------------------------------------
  2. // This file was generated automatically from 050-TestStructsLayout.cs
  3. // DO NOT EDIT THIS FILE MANUALLY
  4. // -----------------------------------------------------------
  5. using Unity.Collections.LowLevel.Unsafe;
  6. namespace Burst.Compiler.IL.Tests
  7. {
  8. partial class TestStructsLayout
  9. {
  10. [TestCompiler]
  11. public static int Test_CheckHoleInner_Size()
  12. {
  13. return UnsafeUtility.SizeOf<CheckHoleInner>();
  14. }
  15. [TestCompiler]
  16. public static unsafe int Test_CheckHoleInner_FieldOffset_m_Ptr()
  17. {
  18. var value = new CheckHoleInner();
  19. var addressStart = &value;
  20. var addressField = &value.m_Ptr;
  21. return (int)((byte*)addressField - (byte*)addressStart);
  22. }
  23. [TestCompiler(OverrideOn32BitNative = 20)]
  24. public static int Test_CheckHoleOuter_Size()
  25. {
  26. return UnsafeUtility.SizeOf<CheckHoleOuter>();
  27. }
  28. [TestCompiler]
  29. public static unsafe int Test_CheckHoleOuter_FieldOffset_a()
  30. {
  31. var value = new CheckHoleOuter();
  32. var addressStart = &value;
  33. var addressField = &value.a;
  34. return (int)((byte*)addressField - (byte*)addressStart);
  35. }
  36. [TestCompiler]
  37. public static unsafe int Test_CheckHoleOuter_FieldOffset_b()
  38. {
  39. var value = new CheckHoleOuter();
  40. var addressStart = &value;
  41. var addressField = &value.b;
  42. return (int)((byte*)addressField - (byte*)addressStart);
  43. }
  44. [TestCompiler(OverrideOn32BitNative = 12)]
  45. public static unsafe int Test_CheckHoleOuter_FieldOffset_c()
  46. {
  47. var value = new CheckHoleOuter();
  48. var addressStart = &value;
  49. var addressField = &value.c;
  50. return (int)((byte*)addressField - (byte*)addressStart);
  51. }
  52. [TestCompiler]
  53. public static int Test_ExplicitStructWithoutSize2_Size()
  54. {
  55. return UnsafeUtility.SizeOf<ExplicitStructWithoutSize2>();
  56. }
  57. [TestCompiler]
  58. public static unsafe int Test_ExplicitStructWithoutSize2_FieldOffset_a()
  59. {
  60. var value = new ExplicitStructWithoutSize2();
  61. var addressStart = &value;
  62. var addressField = &value.a;
  63. return (int)((byte*)addressField - (byte*)addressStart);
  64. }
  65. [TestCompiler]
  66. public static unsafe int Test_ExplicitStructWithoutSize2_FieldOffset_b()
  67. {
  68. var value = new ExplicitStructWithoutSize2();
  69. var addressStart = &value;
  70. var addressField = &value.b;
  71. return (int)((byte*)addressField - (byte*)addressStart);
  72. }
  73. [TestCompiler]
  74. public static unsafe int Test_ExplicitStructWithoutSize2_FieldOffset_c()
  75. {
  76. var value = new ExplicitStructWithoutSize2();
  77. var addressStart = &value;
  78. var addressField = &value.c;
  79. return (int)((byte*)addressField - (byte*)addressStart);
  80. }
  81. [TestCompiler]
  82. public static int Test_ExplicitStructWithoutSize_Size()
  83. {
  84. return UnsafeUtility.SizeOf<ExplicitStructWithoutSize>();
  85. }
  86. [TestCompiler]
  87. public static unsafe int Test_ExplicitStructWithoutSize_FieldOffset_a()
  88. {
  89. var value = new ExplicitStructWithoutSize();
  90. var addressStart = &value;
  91. var addressField = &value.a;
  92. return (int)((byte*)addressField - (byte*)addressStart);
  93. }
  94. [TestCompiler]
  95. public static unsafe int Test_ExplicitStructWithoutSize_FieldOffset_b()
  96. {
  97. var value = new ExplicitStructWithoutSize();
  98. var addressStart = &value;
  99. var addressField = &value.b;
  100. return (int)((byte*)addressField - (byte*)addressStart);
  101. }
  102. [TestCompiler]
  103. public static unsafe int Test_ExplicitStructWithoutSize_FieldOffset_c()
  104. {
  105. var value = new ExplicitStructWithoutSize();
  106. var addressStart = &value;
  107. var addressField = &value.c;
  108. return (int)((byte*)addressField - (byte*)addressStart);
  109. }
  110. [TestCompiler]
  111. public static int Test_SequentialStructWithSize3_Size()
  112. {
  113. return UnsafeUtility.SizeOf<SequentialStructWithSize3>();
  114. }
  115. [TestCompiler]
  116. public static unsafe int Test_SequentialStructWithSize3_FieldOffset_a()
  117. {
  118. var value = new SequentialStructWithSize3();
  119. var addressStart = &value;
  120. var addressField = &value.a;
  121. return (int)((byte*)addressField - (byte*)addressStart);
  122. }
  123. [TestCompiler]
  124. public static unsafe int Test_SequentialStructWithSize3_FieldOffset_b()
  125. {
  126. var value = new SequentialStructWithSize3();
  127. var addressStart = &value;
  128. var addressField = &value.b;
  129. return (int)((byte*)addressField - (byte*)addressStart);
  130. }
  131. [TestCompiler]
  132. public static unsafe int Test_SequentialStructWithSize3_FieldOffset_c()
  133. {
  134. var value = new SequentialStructWithSize3();
  135. var addressStart = &value;
  136. var addressField = &value.c;
  137. return (int)((byte*)addressField - (byte*)addressStart);
  138. }
  139. [TestCompiler]
  140. public static int Test_SequentialStructWithoutSize_Size()
  141. {
  142. return UnsafeUtility.SizeOf<SequentialStructWithoutSize>();
  143. }
  144. [TestCompiler]
  145. public static unsafe int Test_SequentialStructWithoutSize_FieldOffset_a()
  146. {
  147. var value = new SequentialStructWithoutSize();
  148. var addressStart = &value;
  149. var addressField = &value.a;
  150. return (int)((byte*)addressField - (byte*)addressStart);
  151. }
  152. [TestCompiler]
  153. public static unsafe int Test_SequentialStructWithoutSize_FieldOffset_b()
  154. {
  155. var value = new SequentialStructWithoutSize();
  156. var addressStart = &value;
  157. var addressField = &value.b;
  158. return (int)((byte*)addressField - (byte*)addressStart);
  159. }
  160. [TestCompiler]
  161. public static unsafe int Test_SequentialStructWithoutSize_FieldOffset_c()
  162. {
  163. var value = new SequentialStructWithoutSize();
  164. var addressStart = &value;
  165. var addressField = &value.c;
  166. return (int)((byte*)addressField - (byte*)addressStart);
  167. }
  168. [TestCompiler]
  169. public static int Test_SequentialStructEmptyNoAttributes_Size()
  170. {
  171. return UnsafeUtility.SizeOf<SequentialStructEmptyNoAttributes>();
  172. }
  173. [TestCompiler]
  174. public static int Test_ExplicitStructWithEmptySequentialFields_Size()
  175. {
  176. return UnsafeUtility.SizeOf<ExplicitStructWithEmptySequentialFields>();
  177. }
  178. [TestCompiler]
  179. public static unsafe int Test_ExplicitStructWithEmptySequentialFields_FieldOffset_FieldA()
  180. {
  181. var value = new ExplicitStructWithEmptySequentialFields();
  182. var addressStart = &value;
  183. var addressField = &value.FieldA;
  184. return (int)((byte*)addressField - (byte*)addressStart);
  185. }
  186. [TestCompiler]
  187. public static unsafe int Test_ExplicitStructWithEmptySequentialFields_FieldOffset_FieldB()
  188. {
  189. var value = new ExplicitStructWithEmptySequentialFields();
  190. var addressStart = &value;
  191. var addressField = &value.FieldB;
  192. return (int)((byte*)addressField - (byte*)addressStart);
  193. }
  194. [TestCompiler]
  195. public static int Test_ExplicitStrictWithEmptyAndNonEmptySequentialFields_Size()
  196. {
  197. return UnsafeUtility.SizeOf<ExplicitStrictWithEmptyAndNonEmptySequentialFields>();
  198. }
  199. [TestCompiler]
  200. public static unsafe int Test_ExplicitStrictWithEmptyAndNonEmptySequentialFields_FieldOffset_FieldA()
  201. {
  202. var value = new ExplicitStrictWithEmptyAndNonEmptySequentialFields();
  203. var addressStart = &value;
  204. var addressField = &value.FieldA;
  205. return (int)((byte*)addressField - (byte*)addressStart);
  206. }
  207. [TestCompiler]
  208. public static unsafe int Test_ExplicitStrictWithEmptyAndNonEmptySequentialFields_FieldOffset_FieldB()
  209. {
  210. var value = new ExplicitStrictWithEmptyAndNonEmptySequentialFields();
  211. var addressStart = &value;
  212. var addressField = &value.FieldB;
  213. return (int)((byte*)addressField - (byte*)addressStart);
  214. }
  215. [TestCompiler]
  216. public static int Test_StructWithPack8_Size()
  217. {
  218. return UnsafeUtility.SizeOf<StructWithPack8>();
  219. }
  220. [TestCompiler]
  221. public static unsafe int Test_StructWithPack8_FieldOffset_FieldA()
  222. {
  223. var value = new StructWithPack8();
  224. var addressStart = &value;
  225. var addressField = &value.FieldA;
  226. return (int)((byte*)addressField - (byte*)addressStart);
  227. }
  228. [TestCompiler]
  229. public static unsafe int Test_StructWithPack8_FieldOffset_FieldB()
  230. {
  231. var value = new StructWithPack8();
  232. var addressStart = &value;
  233. var addressField = &value.FieldB;
  234. return (int)((byte*)addressField - (byte*)addressStart);
  235. }
  236. [TestCompiler]
  237. public static int Test_StructPack2WithBytesAndInt_Size()
  238. {
  239. return UnsafeUtility.SizeOf<StructPack2WithBytesAndInt>();
  240. }
  241. [TestCompiler]
  242. public static unsafe int Test_StructPack2WithBytesAndInt_FieldOffset_FieldA()
  243. {
  244. var value = new StructPack2WithBytesAndInt();
  245. var addressStart = &value;
  246. var addressField = &value.FieldA;
  247. return (int)((byte*)addressField - (byte*)addressStart);
  248. }
  249. [TestCompiler]
  250. public static unsafe int Test_StructPack2WithBytesAndInt_FieldOffset_FieldB()
  251. {
  252. var value = new StructPack2WithBytesAndInt();
  253. var addressStart = &value;
  254. var addressField = &value.FieldB;
  255. return (int)((byte*)addressField - (byte*)addressStart);
  256. }
  257. [TestCompiler]
  258. public static unsafe int Test_StructPack2WithBytesAndInt_FieldOffset_FieldC()
  259. {
  260. var value = new StructPack2WithBytesAndInt();
  261. var addressStart = &value;
  262. var addressField = &value.FieldC;
  263. return (int)((byte*)addressField - (byte*)addressStart);
  264. }
  265. [TestCompiler]
  266. public static int Test_StructPack2WithBytesAndInts_Size()
  267. {
  268. return UnsafeUtility.SizeOf<StructPack2WithBytesAndInts>();
  269. }
  270. [TestCompiler]
  271. public static unsafe int Test_StructPack2WithBytesAndInts_FieldOffset_FieldA()
  272. {
  273. var value = new StructPack2WithBytesAndInts();
  274. var addressStart = &value;
  275. var addressField = &value.FieldA;
  276. return (int)((byte*)addressField - (byte*)addressStart);
  277. }
  278. [TestCompiler]
  279. public static unsafe int Test_StructPack2WithBytesAndInts_FieldOffset_FieldB()
  280. {
  281. var value = new StructPack2WithBytesAndInts();
  282. var addressStart = &value;
  283. var addressField = &value.FieldB;
  284. return (int)((byte*)addressField - (byte*)addressStart);
  285. }
  286. [TestCompiler]
  287. public static unsafe int Test_StructPack2WithBytesAndInts_FieldOffset_FieldC()
  288. {
  289. var value = new StructPack2WithBytesAndInts();
  290. var addressStart = &value;
  291. var addressField = &value.FieldC;
  292. return (int)((byte*)addressField - (byte*)addressStart);
  293. }
  294. [TestCompiler]
  295. public static unsafe int Test_StructPack2WithBytesAndInts_FieldOffset_FieldD()
  296. {
  297. var value = new StructPack2WithBytesAndInts();
  298. var addressStart = &value;
  299. var addressField = &value.FieldD;
  300. return (int)((byte*)addressField - (byte*)addressStart);
  301. }
  302. [TestCompiler]
  303. public static int Test_StructPack1WithBytesAndInt_Size()
  304. {
  305. return UnsafeUtility.SizeOf<StructPack1WithBytesAndInt>();
  306. }
  307. [TestCompiler]
  308. public static unsafe int Test_StructPack1WithBytesAndInt_FieldOffset_FieldA()
  309. {
  310. var value = new StructPack1WithBytesAndInt();
  311. var addressStart = &value;
  312. var addressField = &value.FieldA;
  313. return (int)((byte*)addressField - (byte*)addressStart);
  314. }
  315. [TestCompiler]
  316. public static unsafe int Test_StructPack1WithBytesAndInt_FieldOffset_FieldB()
  317. {
  318. var value = new StructPack1WithBytesAndInt();
  319. var addressStart = &value;
  320. var addressField = &value.FieldB;
  321. return (int)((byte*)addressField - (byte*)addressStart);
  322. }
  323. [TestCompiler]
  324. public static unsafe int Test_StructPack1WithBytesAndInt_FieldOffset_FieldC()
  325. {
  326. var value = new StructPack1WithBytesAndInt();
  327. var addressStart = &value;
  328. var addressField = &value.FieldC;
  329. return (int)((byte*)addressField - (byte*)addressStart);
  330. }
  331. [TestCompiler]
  332. public static int Test_StructPack1WithByteAndInt_Size()
  333. {
  334. return UnsafeUtility.SizeOf<StructPack1WithByteAndInt>();
  335. }
  336. [TestCompiler]
  337. public static unsafe int Test_StructPack1WithByteAndInt_FieldOffset_FieldA()
  338. {
  339. var value = new StructPack1WithByteAndInt();
  340. var addressStart = &value;
  341. var addressField = &value.FieldA;
  342. return (int)((byte*)addressField - (byte*)addressStart);
  343. }
  344. [TestCompiler]
  345. public static unsafe int Test_StructPack1WithByteAndInt_FieldOffset_FieldB()
  346. {
  347. var value = new StructPack1WithByteAndInt();
  348. var addressStart = &value;
  349. var addressField = &value.FieldB;
  350. return (int)((byte*)addressField - (byte*)addressStart);
  351. }
  352. [TestCompiler]
  353. public static int Test_StructPack1WithByteAndIntWrapper_Size()
  354. {
  355. return UnsafeUtility.SizeOf<StructPack1WithByteAndIntWrapper>();
  356. }
  357. [TestCompiler]
  358. public static unsafe int Test_StructPack1WithByteAndIntWrapper_FieldOffset_FieldA()
  359. {
  360. var value = new StructPack1WithByteAndIntWrapper();
  361. var addressStart = &value;
  362. var addressField = &value.FieldA;
  363. return (int)((byte*)addressField - (byte*)addressStart);
  364. }
  365. [TestCompiler]
  366. public static unsafe int Test_StructPack1WithByteAndIntWrapper_FieldOffset_FieldB()
  367. {
  368. var value = new StructPack1WithByteAndIntWrapper();
  369. var addressStart = &value;
  370. var addressField = &value.FieldB;
  371. return (int)((byte*)addressField - (byte*)addressStart);
  372. }
  373. [TestCompiler]
  374. public static int Test_StructPack1WithByteAndIntWrapper2_Size()
  375. {
  376. return UnsafeUtility.SizeOf<StructPack1WithByteAndIntWrapper2>();
  377. }
  378. [TestCompiler]
  379. public static unsafe int Test_StructPack1WithByteAndIntWrapper2_FieldOffset_FieldA()
  380. {
  381. var value = new StructPack1WithByteAndIntWrapper2();
  382. var addressStart = &value;
  383. var addressField = &value.FieldA;
  384. return (int)((byte*)addressField - (byte*)addressStart);
  385. }
  386. [TestCompiler]
  387. public static unsafe int Test_StructPack1WithByteAndIntWrapper2_FieldOffset_FieldB()
  388. {
  389. var value = new StructPack1WithByteAndIntWrapper2();
  390. var addressStart = &value;
  391. var addressField = &value.FieldB;
  392. return (int)((byte*)addressField - (byte*)addressStart);
  393. }
  394. [TestCompiler]
  395. public static int Test_StructWithSizeAndPack_Size()
  396. {
  397. return UnsafeUtility.SizeOf<StructWithSizeAndPack>();
  398. }
  399. [TestCompiler]
  400. public static unsafe int Test_StructWithSizeAndPack_FieldOffset_FieldA()
  401. {
  402. var value = new StructWithSizeAndPack();
  403. var addressStart = &value;
  404. var addressField = &value.FieldA;
  405. return (int)((byte*)addressField - (byte*)addressStart);
  406. }
  407. [TestCompiler]
  408. public static unsafe int Test_StructWithSizeAndPack_FieldOffset_FieldB()
  409. {
  410. var value = new StructWithSizeAndPack();
  411. var addressStart = &value;
  412. var addressField = &value.FieldB;
  413. return (int)((byte*)addressField - (byte*)addressStart);
  414. }
  415. [TestCompiler]
  416. public static int Test_StructWithSizeAndPackWrapper_Size()
  417. {
  418. return UnsafeUtility.SizeOf<StructWithSizeAndPackWrapper>();
  419. }
  420. [TestCompiler]
  421. public static unsafe int Test_StructWithSizeAndPackWrapper_FieldOffset_FieldA()
  422. {
  423. var value = new StructWithSizeAndPackWrapper();
  424. var addressStart = &value;
  425. var addressField = &value.FieldA;
  426. return (int)((byte*)addressField - (byte*)addressStart);
  427. }
  428. [TestCompiler]
  429. public static unsafe int Test_StructWithSizeAndPackWrapper_FieldOffset_FieldB()
  430. {
  431. var value = new StructWithSizeAndPackWrapper();
  432. var addressStart = &value;
  433. var addressField = &value.FieldB;
  434. return (int)((byte*)addressField - (byte*)addressStart);
  435. }
  436. [TestCompiler]
  437. public static int Test_StructWithSizeAndPack4_Size()
  438. {
  439. return UnsafeUtility.SizeOf<StructWithSizeAndPack4>();
  440. }
  441. [TestCompiler]
  442. public static unsafe int Test_StructWithSizeAndPack4_FieldOffset_FieldA()
  443. {
  444. var value = new StructWithSizeAndPack4();
  445. var addressStart = &value;
  446. var addressField = &value.FieldA;
  447. return (int)((byte*)addressField - (byte*)addressStart);
  448. }
  449. [TestCompiler]
  450. public static unsafe int Test_StructWithSizeAndPack4_FieldOffset_FieldB()
  451. {
  452. var value = new StructWithSizeAndPack4();
  453. var addressStart = &value;
  454. var addressField = &value.FieldB;
  455. return (int)((byte*)addressField - (byte*)addressStart);
  456. }
  457. [TestCompiler]
  458. public static int Test_StructWithSizeAndPack4Wrapper_Size()
  459. {
  460. return UnsafeUtility.SizeOf<StructWithSizeAndPack4Wrapper>();
  461. }
  462. [TestCompiler]
  463. public static unsafe int Test_StructWithSizeAndPack4Wrapper_FieldOffset_FieldA()
  464. {
  465. var value = new StructWithSizeAndPack4Wrapper();
  466. var addressStart = &value;
  467. var addressField = &value.FieldA;
  468. return (int)((byte*)addressField - (byte*)addressStart);
  469. }
  470. [TestCompiler]
  471. public static unsafe int Test_StructWithSizeAndPack4Wrapper_FieldOffset_FieldB()
  472. {
  473. var value = new StructWithSizeAndPack4Wrapper();
  474. var addressStart = &value;
  475. var addressField = &value.FieldB;
  476. return (int)((byte*)addressField - (byte*)addressStart);
  477. }
  478. [TestCompiler]
  479. public static int Test_StructExplicitPack1WithByteAndInt_Size()
  480. {
  481. return UnsafeUtility.SizeOf<StructExplicitPack1WithByteAndInt>();
  482. }
  483. [TestCompiler]
  484. public static unsafe int Test_StructExplicitPack1WithByteAndInt_FieldOffset_FieldA()
  485. {
  486. var value = new StructExplicitPack1WithByteAndInt();
  487. var addressStart = &value;
  488. var addressField = &value.FieldA;
  489. return (int)((byte*)addressField - (byte*)addressStart);
  490. }
  491. [TestCompiler]
  492. public static unsafe int Test_StructExplicitPack1WithByteAndInt_FieldOffset_FieldB()
  493. {
  494. var value = new StructExplicitPack1WithByteAndInt();
  495. var addressStart = &value;
  496. var addressField = &value.FieldB;
  497. return (int)((byte*)addressField - (byte*)addressStart);
  498. }
  499. [TestCompiler]
  500. public static int Test_StructExplicitPack1WithByteAndIntWrapper_Size()
  501. {
  502. return UnsafeUtility.SizeOf<StructExplicitPack1WithByteAndIntWrapper>();
  503. }
  504. [TestCompiler]
  505. public static unsafe int Test_StructExplicitPack1WithByteAndIntWrapper_FieldOffset_FieldA()
  506. {
  507. var value = new StructExplicitPack1WithByteAndIntWrapper();
  508. var addressStart = &value;
  509. var addressField = &value.FieldA;
  510. return (int)((byte*)addressField - (byte*)addressStart);
  511. }
  512. [TestCompiler]
  513. public static unsafe int Test_StructExplicitPack1WithByteAndIntWrapper_FieldOffset_FieldB()
  514. {
  515. var value = new StructExplicitPack1WithByteAndIntWrapper();
  516. var addressStart = &value;
  517. var addressField = &value.FieldB;
  518. return (int)((byte*)addressField - (byte*)addressStart);
  519. }
  520. [TestCompiler]
  521. public static int Test_StructExplicitPack1WithByteAndIntWrapper2_Size()
  522. {
  523. return UnsafeUtility.SizeOf<StructExplicitPack1WithByteAndIntWrapper2>();
  524. }
  525. [TestCompiler]
  526. public static unsafe int Test_StructExplicitPack1WithByteAndIntWrapper2_FieldOffset_FieldA()
  527. {
  528. var value = new StructExplicitPack1WithByteAndIntWrapper2();
  529. var addressStart = &value;
  530. var addressField = &value.FieldA;
  531. return (int)((byte*)addressField - (byte*)addressStart);
  532. }
  533. [TestCompiler]
  534. public static unsafe int Test_StructExplicitPack1WithByteAndIntWrapper2_FieldOffset_FieldB()
  535. {
  536. var value = new StructExplicitPack1WithByteAndIntWrapper2();
  537. var addressStart = &value;
  538. var addressField = &value.FieldB;
  539. return (int)((byte*)addressField - (byte*)addressStart);
  540. }
  541. [TestCompiler]
  542. public static int Test_StructExplicitWithSizeAndPack_Size()
  543. {
  544. return UnsafeUtility.SizeOf<StructExplicitWithSizeAndPack>();
  545. }
  546. [TestCompiler]
  547. public static unsafe int Test_StructExplicitWithSizeAndPack_FieldOffset_FieldA()
  548. {
  549. var value = new StructExplicitWithSizeAndPack();
  550. var addressStart = &value;
  551. var addressField = &value.FieldA;
  552. return (int)((byte*)addressField - (byte*)addressStart);
  553. }
  554. [TestCompiler]
  555. public static unsafe int Test_StructExplicitWithSizeAndPack_FieldOffset_FieldB()
  556. {
  557. var value = new StructExplicitWithSizeAndPack();
  558. var addressStart = &value;
  559. var addressField = &value.FieldB;
  560. return (int)((byte*)addressField - (byte*)addressStart);
  561. }
  562. [TestCompiler]
  563. public static int Test_StructExplicitWithSizeAndPackWrapper_Size()
  564. {
  565. return UnsafeUtility.SizeOf<StructExplicitWithSizeAndPackWrapper>();
  566. }
  567. [TestCompiler]
  568. public static unsafe int Test_StructExplicitWithSizeAndPackWrapper_FieldOffset_FieldA()
  569. {
  570. var value = new StructExplicitWithSizeAndPackWrapper();
  571. var addressStart = &value;
  572. var addressField = &value.FieldA;
  573. return (int)((byte*)addressField - (byte*)addressStart);
  574. }
  575. [TestCompiler]
  576. public static unsafe int Test_StructExplicitWithSizeAndPackWrapper_FieldOffset_FieldB()
  577. {
  578. var value = new StructExplicitWithSizeAndPackWrapper();
  579. var addressStart = &value;
  580. var addressField = &value.FieldB;
  581. return (int)((byte*)addressField - (byte*)addressStart);
  582. }
  583. [TestCompiler]
  584. public static int Test_StructExplicitWithSizeAndPack4_Size()
  585. {
  586. return UnsafeUtility.SizeOf<StructExplicitWithSizeAndPack4>();
  587. }
  588. [TestCompiler]
  589. public static unsafe int Test_StructExplicitWithSizeAndPack4_FieldOffset_FieldA()
  590. {
  591. var value = new StructExplicitWithSizeAndPack4();
  592. var addressStart = &value;
  593. var addressField = &value.FieldA;
  594. return (int)((byte*)addressField - (byte*)addressStart);
  595. }
  596. [TestCompiler]
  597. public static unsafe int Test_StructExplicitWithSizeAndPack4_FieldOffset_FieldB()
  598. {
  599. var value = new StructExplicitWithSizeAndPack4();
  600. var addressStart = &value;
  601. var addressField = &value.FieldB;
  602. return (int)((byte*)addressField - (byte*)addressStart);
  603. }
  604. [TestCompiler]
  605. public static int Test_StructExplicitWithSizeAndPack4Wrapper_Size()
  606. {
  607. return UnsafeUtility.SizeOf<StructExplicitWithSizeAndPack4Wrapper>();
  608. }
  609. [TestCompiler]
  610. public static unsafe int Test_StructExplicitWithSizeAndPack4Wrapper_FieldOffset_FieldA()
  611. {
  612. var value = new StructExplicitWithSizeAndPack4Wrapper();
  613. var addressStart = &value;
  614. var addressField = &value.FieldA;
  615. return (int)((byte*)addressField - (byte*)addressStart);
  616. }
  617. [TestCompiler]
  618. public static unsafe int Test_StructExplicitWithSizeAndPack4Wrapper_FieldOffset_FieldB()
  619. {
  620. var value = new StructExplicitWithSizeAndPack4Wrapper();
  621. var addressStart = &value;
  622. var addressField = &value.FieldB;
  623. return (int)((byte*)addressField - (byte*)addressStart);
  624. }
  625. }
  626. }