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 28KB

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