+
    -i                       R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^RIHt ^ RI	H
t
 ^ RI	Ht ^ RI	Ht ]
P                  ! ^4      t]
P                  ! ^4      t]
P                  ! ^4      t]
P                  ! ^ 4      t]
P                  ! ^@4      t]
P(                  ! 4       t]
P,                  ! 4       t]
P0                  ! 4       t ! R R]4      t ! R R	]4      t ! R
 R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t  ! R R]4      t!R t" ! R R]4      t# ! R R]4      t$ ! R R]4      t%]&R8X  d   ]PN                  ! 4        R# R# )z
IR Construction Tests
N)TestCase)ir)binding)ir_layer_typed_pointers_enabledc                      a  ] tR t^t o RtR tR tR tR tR t	RR lt
RR	 ltR
 tR tR tR tR tR tR tR tR tRtV tR# )TestBasez
Utilities for IR tests.
c                    R pRP                  \        W14      4      p\        P                  ! RRV4      pV P	                  W$4       R# )zZ
Assert *pattern* is in *text*, ignoring any whitespace differences
(including newlines).
c                 p    V P                  4       '       g    V P                  4       '       g
   R V ,           # V # )\)isalnumisspace)cs   &T/var/www/html/photoedit/myenv/lib/python3.14/site-packages/llvmlite/tests/test_ir.pyescape%TestBase.assertInText.<locals>.escape'   s%    99;;qyy{{axH     z\s+z\\s*N)joinmapresubassertRegex)selfpatterntextr   regexs   &&&  r   assertInTextTestBase.assertInText!   s<    	
 ''#f./vw0%r   c                    \        V4      P                  4        Uu. uF  qP                  4       NK  	  ppV P                  XV4       R # u upi N)str
splitlinesstripassertIn)r   linemodliness   &&& r   assert_ir_lineTestBase.assert_ir_line0   s=    *-c(*=*=*?@*?$*?@dE" As   A
c                D    \         P                  ! \        V4      4       R # r   )llvmparse_assemblyr    r   r%   s   &&r   assert_valid_irTestBase.assert_valid_ir4   s    CH%r   c                    \         P                  ! \         P                  ! VRR7      4      pV P                  VP                  VP                  4       V P                  \        V4      \        V4      4       V# )zoAssert that the IR object pickles and unpickles correctly.
The IR string is equal and that their type is equal
)protocol)pickleloadsdumpsassertIs	__class__assertEqualr    )r   irobject	newobjects   && r   assert_pickle_correctly TestBase.assert_pickle_correctly7   sU     LLh!DE	h(()*=*=>XI7r   c                ,    \         P                  ! 4       # r   )r   Moduler   s   &r   moduleTestBase.module@   s    yy{r   Nc           	         T;'       g    V P                  4       p\        P                  ! \        \        \        \        \        P
                  ! \        4      34      p\        P                  ! WV4      # r   )r?   r   FunctionTypeint32dblPointerTypeFunction)r   r?   namefntys   &&& r   functionTestBase.functionC   sM    ((4;;=uueS')~~e'<'> ?{{6..r   c                X    T;'       g    V P                  4       pVP                  V4      # r   )rI   append_basic_block)r   funcrG   s   &&&r   blockTestBase.blockI   s&    &&t}}&&t,,r   c                J    . pVP                  V4       R P                  V4      # )r   )descrr   )r   thingbufs   && r   rQ   TestBase.descrM   s!    Cwws|r   c                V    \         P                  ! V4      pVP                  R R4      pV# )z
    z
  )textwrapdedentreplace)r   asms   &&r   _normalize_asmTestBase._normalize_asmR   s%    ooc"kk(F+
r   c                J    V P                  V4      pV P                  W4       R # r   )rZ   r   r   rQ   rY   expecteds   &&& r   check_descr_regexTestBase.check_descr_regexX        &&s+)r   c                J    V P                  V4      pV P                  W4       R # r   )rZ   r7   r]   s   &&& r   check_descrTestBase.check_descr\   ra   r   c                H    V P                  V P                  V4      V4       R # r   )rc   rQ   r   rN   rY   s   &&&r   check_blockTestBase.check_block`   s    E*C0r   c                H    V P                  V P                  V4      V4       R # r   )r_   rQ   rf   s   &&&r   check_block_regexTestBase.check_block_regexc   s    tzz%0#6r   c                    V P                  V4      pVP                  4       pV P                  VP                  4       VP                  4       4       R # r   )rZ   _stringify_bodyr7   r"   r   r?   rY   r^   actuals   &&&  r   check_module_bodyTestBase.check_module_bodyf   s=    &&s+''))9:r   c                    V P                  V4      pVP                  4       pV P                  VP                  4       VP                  4       4       R# )z&
Check module metadata against *asm*.
N)rZ   _stringify_metadatar7   r"   rn   s   &&&  r   check_metadataTestBase.check_metadatak   s?     &&s+++-)9:r   c                   V P                  V4      pV P                  V4      pVP                  R 4      ^,          P                  R4      ^ ,          pV P	                  VP                  4       VP                  4       4       R# ){}N)rZ   rQ   	partition
rpartitionr7   r"   )r   rM   rY   r^   ro   s   &&&  r   check_func_bodyTestBase.check_func_bodys   sb    &&s+D!!!#&q)44S9!<)9:r    )Nmy_func)Nr   )__name__
__module____qualname____firstlineno____doc__r   r'   r-   r:   r?   rI   rN   rQ   rZ   r_   rc   rg   rj   rp   rt   r{   __static_attributes____classdictcell____classdict__s   @r   r   r      s_     &#&/-
**17;
;; ;r   r   c                      a  ] tR t^zt o ]'       g   RMRtR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tRtV tR# )TestFunctionz=i32 @"my_func"(i32 %".1", i32 %".2", double %".3", ptr %".4")z>i32 @"my_func"(i32 %".1", i32 %".2", double %".3", i32* %".4")c                    V P                  4       pV P                  V4      P                  4       pV P                  VP                  4       R V P                  ,          4       R# )z
declare %sN)rI   rQ   r"   r7   protor   rM   rY   s   &  r   test_declareTestFunction.test_declare   sC    }}jj$$&lTZZ&?@r   c                   V P                  4       pVP                  P                  R 4       VP                  P                  R4       VP                  P                  R4       ^VP                  n        \        P
                  ! \        R	RR7      p\        P                  ! V P                  4       VR4      pW1P                  n	        V P                  V4      P                  4       p\        '       g%   V P                  VRV P                  ,          4       M#V P                  VRV P                  ,          4       V P                  V4       R# )
optsizealwaysinline
convergentTvar_arg__gxx_personality_v0zadeclare %s alwaysinline convergent optsize alignstack(16) personality ptr @"__gxx_personality_v0"zgdeclare %s alwaysinline convergent optsize alignstack(16) personality i8 (...)* @"__gxx_personality_v0"Nr}   )rI   
attributesadd
alignstackr   rB   int8rF   r?   personalityrQ   r"   r   r7   r   r:   )r   rM   tp_perspersrY   s   &    r   test_declare_attributes$TestFunction.test_declare_attributes   s    }}I&N+L)%'"//$D9{{4;;='3IJ&*#jj$$&..SJ "ZZ() SD "ZZ() 	$$T*r   c                r   V P                  4       pVP                  ^ ,          P                  R4       ^VP                  ^,          P                  n        ^
VP                  ^,          P                  n        ^VP                  ^,          P                  n        VP                  ^,          P                  R4       VP                  P                  R4       V P                  V4      P                  4       p\        '       g   V P                  VR4       MV P                  VR4       V P                  V4       R# )    zeroextnonnullnoaliaszdeclare noalias i32 @"my_func"(i32 zeroext %".1", i32 dereferenceable(5) dereferenceable_or_null(10) %".2", double %".3", ptr nonnull align 4 %".4")zdeclare noalias i32 @"my_func"(i32 zeroext %".1", i32 dereferenceable(5) dereferenceable_or_null(10) %".2", double %".3", i32* nonnull align 4 %".4")N)rI   argsadd_attributer   dereferenceabledereferenceable_or_nullalignreturn_valuerQ   r"   r   r7   r:   r   s   &  r   test_function_attributes%TestFunction.test_function_attributes   s    }}		!""9-23		!/:<		!7()		!%		!""9-''	2jj$$&..S x S y 	$$T*r   c                *   V P                  4       pV P                  V4      pVP                  R VP                  . 4      4       V P	                  V4      P                  4       pV P                  VRV P                   R24       V P                  V4       R# )dbgdeclare z !dbg !0N)	r?   rI   set_metadataadd_metadatarQ   r"   r7   r   r:   r   r?   rM   rY   s   &   r   test_function_metadata#TestFunction.test_function_metadata   s}    }}V$%!4!4R!89jj$$&#DJJ<x8	 	$$T*r   c                    V P                  4       pR Vn        V P                  V4      P                  4       pV P	                  VRV P
                   R24       V P                  V4       R# )	a_sectionr   z section "a_section"N)rI   sectionrQ   r"   r7   r   r:   r   s   &  r   test_function_section"TestFunction.test_function_section   s\    }}"jj$$&#DJJ</CD	 	$$T*r   c                8   V P                  4       pV P                  V4      pR Vn        VP                  RVP	                  . 4      4       V P                  V4      P                  4       pV P                  VRV P                   R24       V P                  V4       R# )r   r   r   z section "a_section" !dbg !0N)
r?   rI   r   r   r   rQ   r"   r7   r   r:   r   s   &   r   test_function_section_meta'TestFunction.test_function_section_meta   s    }}V$"%!4!4R!89jj$$&#DJJ</KL	 	$$T*r   c                `   V P                  4       pV P                  V4      pVP                  P                  R 4       VP	                  RVP                  . 4      4       V P                  V4      P                  4       pV P                  VRV P                   R24       V P                  V4       R# )r   r   r   z alwaysinline !dbg !0N)r?   rI   r   r   r   r   rQ   r"   r7   r   r:   r   s   &   r   test_function_attr_meta$TestFunction.test_function_attr_meta   s    }}V$N+%!4!4R!89jj$$&#DJJ</DE	 	$$T*r   c                
   V P                  4       pVP                  P                  R 4       RVn        V P	                  V4      P                  4       pV P                  VRV P                   R24       V P                  V4       R# )r   r   r   z optsize section "a_section"N)	rI   r   r   r   rQ   r"   r7   r   r:   r   s   &  r   test_function_attr_section'TestFunction.test_function_attr_section   so    }}I&"jj$$&#DJJ</KL	N 	$$T*r   c                n   V P                  4       pV P                  V4      pVP                  P                  R 4       RVn        VP                  RVP                  . 4      4       V P                  V4      P                  4       pV P                  VRV P                   R24       V P                  V4       R# )r   r   r   r   z) alwaysinline section "a_section" !dbg !0N)r?   rI   r   r   r   r   r   rQ   r"   r7   r   r:   r   s   &   r   test_function_attr_section_meta,TestFunction.test_function_attr_section_meta   s    }}V$N+"%!4!4R!89jj$$&#DJJ</XY	 	$$T*r   c                D   V P                  4       pVP                  P                  R 4       VP                  R4      p\        P
                  ! V4      pVP                  4        V P                  V4      pV P                  VRP                  V P                  R7      4       R# )r   my_blockz            define {proto} alwaysinline
            {{
            my_block:
                ret void
            }}
            )r   N)rI   r   r   rL   r   	IRBuilderret_voidrQ   rc   formatr   )r   rM   rN   builderrY   s   &    r   test_defineTestFunction.test_define   s~    }}N+''
3,,u%jj  TZZ(	*r   c                L   V P                  4       p\        P                  4       pVP                  R \        .4      pVP                  RV\
        .4      pVP                  RW"\
        .4      pVP                  R4      pV P                  V P                  V4      P                  4       R4       \        '       g`   V P                  V P                  V4      P                  4       R4       V P                  V P                  V4      P                  4       R4       M^V P                  V P                  V4      P                  4       R4       V P                  V P                  V4      P                  4       R4       V P                  V P                  V4      P                  4       R	4       R
# )	llvm.powizllvm.memsetzllvm.memcpyzllvm.assumezD            declare double @"llvm.powi.f64"(double %".1", i32 %".2")z\                declare void @"llvm.memset.p0.i32"(ptr %".1", i8 %".2", i32 %".3", i1 %".4")z`                declare void @"llvm.memcpy.p0.p0.i32"(ptr %".1", ptr %".2", i32 %".3", i1 %".4")z^                declare void @"llvm.memset.p0i8.i32"(i8* %".1", i8 %".2", i32 %".3", i1 %".4")zd                declare void @"llvm.memcpy.p0i8.p0i8.i32"(i8* %".1", i8* %".2", i32 %".3", i1 %".4")z1            declare void @"llvm.assume"(i1 %".1")N)
r?   r   
as_pointerdeclare_intrinsicrD   rC   rc   rQ   r"   r   )r   r?   pint8powimemsetmemcpyassumes   &      r   test_declare_intrinsics$TestFunction.test_declare_intrinsics  sf   !''cU;))-%H))-%9NO))-8D)//1 4H 	I..TZZ/557 :` aTZZ/557 :d e TZZ/557 :b cTZZ/557 :h iF+113 65 	6r   c                    V P                  4       pVP                  R \        .4      pVP                  R \        .4      pV P                  W#4       R# )r   N)r?   r   rD   r5   )r   r?   r   powi2s   &   r   test_redeclare_intrinsic%TestFunction.test_redeclare_intrinsic'  sA    ''cU;((se<d"r   c                H    V P                  4       pV P                  V4       R # r   )rI   r:   )r   fns   & r   test_picklingTestFunction.test_pickling-  s    ]]_$$R(r   c                .   V P                  4       pV P                  V4      pVP                  P                  R 4       RpV P	                  \
        V4      ;_uu_ 4        VP                  P                  R4       RRR4       R#   + '       g   i     R# ; i)r   $Can't have alwaysinline and noinlinenoinlineNr?   rI   r   r   assertRaisesRegex
ValueErrorr   r?   rM   msgs   &   r   %test_alwaysinline_noinline_disallowed2TestFunction.test_alwaysinline_noinline_disallowed1  sf    }}V$N+4##J44OO
+ 5444   BB	c                .   V P                  4       pV P                  V4      pVP                  P                  R 4       RpV P	                  \
        V4      ;_uu_ 4        VP                  P                  R4       RRR4       R#   + '       g   i     R# ; i)r   r   r   Nr   r   s   &   r   %test_noinline_alwaysinline_disallowed2TestFunction.test_noinline_alwaysinline_disallowed:  sf    }}V$J'4##J44OO/ 5444r   r}   N)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r   r   r   z   si      / 	LL 

A+4+*
+	+++	++* 6.#),0 0r   r   c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tRtV tR# )TestIRiD  c                    V P                  4       pVP                  \        ^{4      \        ^*4      .4       V P	                  RV4       V P                  V4       R# ){   z!0 = !{ i32 123, i8 42 }N)r?   r   rC   r   r'   r-   r,   s   & r   test_unnamed_metadataTestIR.test_unnamed_metadataF  sG    kkm%*d2h/06<S!r   c                   V P                  4       pVP                  \        ^{4      R.4      pVP                  \        R4      V.4      pVP                  \        R4      V.4      pV P	                  WC4       VP                  W#V.4       V P                  RV4       V P                  RV4       V P                  RV4       R# )r   kernel  z!0 = !{ i32 123, !"kernel" }z!1 = !{ i64 456, !0 }z!2 = !{ !0, !1, !1 }N)r?   r   rC   int64r5   r'   )r   r%   m0m1m2s   &    r   test_unnamed_metadata_2TestIR.test_unnamed_metadata_2M  s    kkmuSz845uSz2./uSz2./b""&:C@3S92C8r   c                
   V P                  4       pVP                  \        ^{4      \        R4      .\        R4      .\        R4      ..4       V P                  RV4       V P                  RV4       V P                  RV4       R# )r   r   i  z!0 = !{ i32 456 }z!1 = !{ i32 789 }z!2 = !{ i32 123, !0, !1, !0 }N)r?   r   rC   r'   r,   s   & r   test_unnamed_metadata_3TestIR.test_unnamed_metadata_3]  sm    kkm%*uSzlU3ZL5:,OP/5/5;SAr   c                n    V P                  4       pVP                  R .4       V P                  RV4       R# )z"\$z!0 = !{ !"\22\5c$" }N)r?   r   r'   r,   s   & r   test_metadata_stringTestIR.test_metadata_stringe  s.    kkm'#4c:r   c                6   V P                  4       pVP                  \        ^{4      .4      pVP                  \        R4      .4      pVP	                  R4      pVP                  V4       VP                  V4       VP                  V4       V P                  RV4       V P                  V4       V P                  WAP                  R4      4       V P                  \        4      ;_uu_ 4        VP                  R4       RRR4       R#   + '       g   i     R# ; i)r   r   fooz!foo = !{ !0, !1, !0 }barN)r?   r   rC   r   add_named_metadatar   r'   r-   r5   get_named_metadataassertRaisesKeyError)r   r%   r   r   nmds   &    r   test_named_metadataTestIR.test_named_metadatak  s    kkmuSzl+uSzl+$$U+4c:S!c11%89x((""5) )(((s   +DD	c                   V P                  4       pVP                  \        ^{4      .4      pVP                  RV4       VP                  R\	        R4      .4       VP                  RR.4       VP                  R. 4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  R	V4       V P                  R
V4       V P                  V4       R# )r   r  r   r   r  z!foo = !{ !0, !1, !2 }z!0 = !{ i32 123 }z!1 = !{ i64 456 }z!2 = !{ !"kernel" }z!bar = !{ !3 }z
!3 = !{  }N)r?   r   rC   r  r   r'   r-   )r   r%   r   s   &  r   test_named_metadata_2TestIR.test_named_metadata_2{  s    kkmuSzl+ub)uuSzl3uxj1ub)4c:/5/5137,c2L#.S!r   c                   V P                  4       pVP                  \        P                  4       ! R 4      .4       \        '       g   V P                  RV4       MV P                  RV4       V P                  V4       V P                  4       pVP                  R \        ^{4      .4       V P                  RV4       V P                  V4       R # )Nz!0 = !{ ptr null }z!0 = !{ i32* null }z!0 = !{ null, i32 123 })r?   r   rC   r   r   r'   r-   r,   s   & r   test_metadata_nullTestIR.test_metadata_null  s    kkm%**,T234.. 4c: 5s;S!kkm$c
+,5s;S!r   c                *   V P                  4       pVP                  R RRRR/4      pVP                  RRVP                  R.4      /4      pVP                  RR	\        P                  ! R
4      RVRRR^ RR/RR7      pVP                  RRRRVR^RVRRRV/RR7       \        V4      pV P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  V4       R# )DIFilefilenamer  	directoryr  DISubroutineTypetypesNDICompileUnitlanguageDW_LANG_PythonfileproducerARTIQruntimeVersionisOptimizedTis_distinctDISubprogramrG   r~   r$   typeisLocalFunit/!0 = !DIFile(directory: "bar", filename: "foo")z!1 = !{ null }z!!2 = !DISubroutineType(types: !1)zy!3 = distinct !DICompileUnit(file: !0, isOptimized: true, language: DW_LANG_Python, producer: "ARTIQ", runtimeVersion: 0)zd!4 = distinct !DISubprogram(file: !0, isLocal: false, line: 11, name: "my_func", type: !2, unit: !3))r?   add_debug_infor   r   DITokenr    r'   r-   )r   r%   di_filedi_func_typedi_compileunitstrmods   &     r   test_debug_infoTestIR.test_debug_info  se    kkm$$X0
  ))*<S%%tf-?
  ++O

#34Ga4>
  ,  	>IGBLuN,
  	 	 SM"	$,f5?H D #	$ 	 " #	$ 	S!r   c                   V P                  4       pVP                  R RRRR/4      pVP                  R RRRR/4      pVP                  R RRRR/4      pVP                  R RRRR/RR7      pV P                  W#4       V P                  \	        W#WE04      ^4       \        V4      pV P                  RV4       V P                  RV4       V P                  R	V4       V P                  V4       R
# )r  r  r  r  r  Tr!  r'  z/!1 = !DIFile(directory: "foo", filename: "bar")z8!2 = distinct !DIFile(directory: "bar", filename: "foo")N)r?   r(  r5   r7   lenr    r'   r-   )r   r%   di1di2di3di4r-  s   &      r   test_debug_info_2TestIR.test_debug_info_2  s   kkm  ",e"-u"$%   ",e"-u"$%   ",e"-u"$%   ",e"-u"$15 ! 7 	cc12A6SM"	$M"	$ %&,	.S!r   c                   V P                  4       pVP                  R RRR^R\        P                  ! R4      /4      pVP                  R RRR^R\        P                  ! R4      /4      pVP                  R RRR^ R\        P                  ! R4      /4      pVP                  R RRR^R\        P                  ! R4      /4      pVP                  R RRR^R\        P                  ! R4      /4      pVP                  R RRR^ R\        P                  ! R4      /4      pVP                  R RRR^@R\        P                  ! R4      /4      pVP                  R RRR^@R\        P                  ! R4      /4      p	VP                  R RRR^@R\        P                  ! R4      /4      p
V P	                  W#4       V P	                  W%4       V P	                  W&4       V P	                  WG4       V P	                  W4       V P	                  W4       V P                  \        W#WEWgWV
0	4      ^4       \        V4      pV P                  R	V4       V P                  R
V4       V P                  RV4       V P                  V4       R# )DIBasicTyperG   i8sizeencodingDW_ATE_unsignedi32i64DW_ATE_signedzA!0 = !DIBasicType(encoding: DW_ATE_unsigned, name: "i8", size: 8)zC!1 = !DIBasicType(encoding: DW_ATE_unsigned, name: "i32", size: 32)zA!2 = !DIBasicType(encoding: DW_ATE_signed, name: "i64", size: 64)N)
r?   r(  r   r)  r5   r7   r1  r    r'   r-   )r   r%   r2  r3  r4  r5  di5di6di7di8di9r-  s   &           r   test_debug_info_3TestIR.test_debug_info_3  s   kkm  DA

#451
 
   DA

#451
 
   EB

#451
 
   DA

#451
 
   DA

#451
 
   EB

#451
 
   EB

?31
 
   EB

?31
 
   EB

?31
 
 	ccccccc#CcJKQOS 34:	< 56<	> 56<	>S!r   c                   V P                  4       pVP                  R RRR^ R\        P                  ! R4      /4      pVP                  R RRR^R\        P                  ! R4      /4      pVP                  RR\        P                  ! R	4      RR
RVR^ R\        P                  ! ^ 4      ! ^4      /4       VP                  RR\        P                  ! R	4      RRRVR^R\        P                  ! ^4      ! ^4      /4       \        V4      pV P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  V4       R# )r9  rG   rC   r;  r<  r@  r   DIDerivedTypetagDW_TAG_member	field_i32baseType	extraDatafield_i8zC!0 = !DIBasicType(encoding: DW_ATE_signed, name: "int32", size: 32)zA!1 = !DIBasicType(encoding: DW_ATE_signed, name: "int8", size: 8)zd!2 = !DIDerivedType(baseType: !0, extraData: i32 1, name: "field_i32", size: 32, tag: DW_TAG_member)za!3 = !DIDerivedType(baseType: !1, extraData: i8 2, name: "field_i8", size: 8, tag: DW_TAG_member)N)r?   r(  r   r)  IntTyper    r'   r-   )r   r%   di_base_i32
di_base_i8r-  s   &    r   test_debug_info_4TestIR.test_debug_info_4'  sq   kkm((GB

?39
 
 ''FA

?38
 
 	?2::o.KBB*-
 	 	?2::o.J
AAq)-
 	 S 78>	@ 56<	>?@F	H 	=>D	F 	S!r   c                6   V P                  4       p\        P                  ! V\        P                  ! 4       R 4      p\        P                  ! \        P                  ! 4       ^*4      Vn        VP                  RRRR^ R\        P                  ! R4      /4      pVP                  RRVP                  R	/ 4      R
VP                  RRVP                  RVRR/RR7      /4      pVP                  RV4       \        V4      pV P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       \        P                  ! ^ 4      ! ^4      R\        P                  ! ^ 4      ! ^4      .p\        P                  ! ^ 4      ! ^4      R\        P                  ! ^ 4      ! ^4      .pVP                  V4      pVP                  V4      pVP                  R4      pVP                  V4       VP                  V4       VP                  RRRRR/4      p	VP                  RR\        P                  ! R 4      R!V	R"\        P                  ! R#4      R$VP                  V.4      /RR7      p
VP                  R%V
4       R&# )'gvarr9  rG   floatr;  r<  DW_ATE_floatDIGlobalVariableExpressionexprDIExpressionvarDIGlobalVariabler$  isDefinitionTr!  r   zB!0 = !DIBasicType(encoding: DW_ATE_float, name: "float", size: 32)z!1 = !DIExpression()zK!2 = distinct !DIGlobalVariable(isDefinition: true, name: "gvar", type: !0)z3!3 = !DIGlobalVariableExpression(expr: !1, var: !2)z2@"gvar" = global float 0x4045000000000000, !dbg !3zDwarf VersionzDebug Info Versionzllvm.module.flagsr  r  r  r  r  r  r  r  r  emissionKind	FullDebugglobalszllvm.dbg.cuN)r?   r   GlobalVariable	FloatTypeConstantinitializerr(  r)  rG   r   r    r'   rP  r   r  r   )r   r%   rV  di_floatdi_gvarr-  dverdiverflagsr*  di_cus   &          r   test_debug_info_gvarTestIR.test_debug_info_gvarR  s|    kkm  bllnf=;;r||~r:%%mGB

>26
 
 $$%AC&&~r:3%%&8		;  	 & !D
  	%) S 78>	@2F; <=C	E '(.	0 &'-	/ 

2q!?BJJrN14EFB"$8"**R.:KL%  '&&':;		$		%$$X0
  ""?

#34GBJJ{3s''	2	5

  #  	}e4r   c                    V P                  4       pVP                  R RR/4       \        V4      pRP                  \	        R RP                  4       4      4      pV P                  RV R2V4       R# )	DILocalVariablerG   u   a∆r   c                     R V R 2# )r
   02xr}   )xs   &r   <lambda>7TestIR.test_debug_info_unicode_string.<locals>.<lambda>  s    r!C\r   u   ∆z!0 = !DILocalVariable(name: "az")N)r?   r(  r    r   r   encoder'   )r   r%   r-  rG   s   &   r   test_debug_info_unicode_string%TestIR.test_debug_info_unicode_string  sb    kkm,vv.>?Swws15<<>BC<TF"EvNr   c                   V P                  4       p\        P                  ! V\        P                  ! \        P                  ! 4       . 4      R 4      p\        P
                  ! VP                  R4      4      p\        P                  ! \        \        .4      p\        P                  ! VRRRR7      pVP                  V\        ^{4      .4       VP                  4        RpV P                  V\        V4      4       V P                  V4       R# )r  r   
mov $1, $2=r,rTside_effectz7call i32 asm sideeffect "mov $1, $2", "=r,r"( i32 123 )N)r?   r   rF   rB   VoidTyper   rL   rC   	InlineAsmcallr   r   r    r-   )r   r%   r  r   asmtyrY   pats   &      r   test_inline_assemblyTestIR.test_inline_assembly  s    kkmkk#rr{{}bA5I,,s55b9:w/ll5,DIS5:,'G#s3x(S!r   c                   V P                  4       p\        P                  ! V\        P                  ! \        P                  ! 4       . 4      R 4      p\        P
                  ! VP                  R4      4      p\        P                  ! \        \        .4      pVP                  VRR\        ^{4      .RR7       VP                  4        RpV P                  V\        V4      4       V P                  V4       R# )r  r   ry  rz  Tr{  z8call i32 asm sideeffect "mov $1, $2", "=r,r" ( i32 123 )N)r?   r   rF   rB   r}  r   rL   rC   rY   r   r   r    r-   )r   r%   r  r   r  r  s   &     r   test_builder_asmTestIR.test_builder_asm  s    kkmkk#rr{{}bA5I,,s55b9:w/E<%*4PH#s3x(S!r   c                   V P                  4       p\        P                  ! V\        P                  ! \        P                  ! 4       . 4      R 4      p\        P
                  ! VP                  R4      4      pVP                  \        P                  ! ^@4      R4       VP                  4        RpV P                  V\        V4      4       V P                  V4       R# )r  r   raxzcall i64 asm "", "={rax}"N)r?   r   rF   rB   r}  r   rL   load_regrP  r   r   r    r-   r   r%   r  r   r  s   &    r   test_builder_load_regTestIR.test_builder_load_reg  s    kkmkk#rr{{}bA5I,,s55b9:B/)#s3x(S!r   c                   V P                  4       p\        P                  ! V\        P                  ! \        P                  ! 4       . 4      R 4      p\        P
                  ! VP                  R4      4      pVP                  \        ^{4      \        P                  ! ^@4      R4       VP                  4        RpV P                  V\        V4      4       V P                  V4       R# )r  r   r  z0call void asm sideeffect "", "{rax}" ( i64 123 )N)r?   r   rF   rB   r}  r   rL   	store_regr   rP  r   r   r    r-   r  s   &    r   test_builder_store_regTestIR.test_builder_store_reg  s    kkmkk#rr{{}bA5I,,s55b9:%*bjjne<@#s3x(S!r   r}   N)r   r   r   r   r   r   r   r  r  r  r  r.  r6  rF  rS  rl  rv  r  r  r  r  r   r   r   s   @r   r   r   D  sf     "9 B;* " "+"Z">?"B)"VB5HO
"	""" "r   r   c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )TestGlobalValuesi  c                   V P                  4       p\        P                  ! V\        P                  ! \        P                  ! 4       . 4      R 4      p\        P                  ! V\        P                  ! \        P                  ! 4       . 4      R4       \        P
                  ! V\        P                  ! 4       R4      pV P                  VP                  R 4      V4       V P                  VP                  R4      V4       V P                  \        4      ;_uu_ 4        VP                  R4       RRR4       \        '       g   V P                  \        V4      R4       R# V P                  \        V4      R4       R#   + '       g   i     LV; i)r  r  
globdoublekkkNz.<ir.GlobalVariable 'globdouble' of type 'ptr'>z2<ir.GlobalVariable 'globdouble' of type 'double*'>)r?   r   rF   rB   r}  rb  
DoubleTyper7   
get_globalr  r	  r   repr)r   r%   r  r  s   &   r   test_globals_access$TestGlobalValues.test_globals_access  s   kkmkk#rr{{}bA5I
C;UC&&sBMMO\J
.45zBx((NN5! ) /.T*-MO Z DF )(s   E;;F	c                   V P                  4       p\        P                  ! \        P                  ! 4       . 4      p\        P                  ! WR4      p\        P                  ! WR4      p\        P
                  ! V\        P                  ! 4       R4      pV P                  \        VP                  4      \        W434      4       V P                  \        VP                  4      \        W4V34      4       R# )zZ
Accessing functions and global values through Module.functions
and Module.global_values.
r  r  r  N)r?   r   rB   r}  rF   rb  r  r7   set	functionsglobal_values)r   r%   ftyr  r  r  s   &     r   #test_functions_global_values_access4TestGlobalValues.test_functions_global_values_access  s    
 kkmoobkkmR0kk#E*kk#E*&&sBMMO\J
S]]+S#_=S../c
5K1LMr   c                V   V P                  4       p\        P                  ! V\        R4      p\        P                  ! V\        R^*R7      p\        P                  ! V\        R4      p\	        ^{4      Vn        \        P                  ! V\        R4      pRVn        \        P                  ! V\        R4      pRVn        \        P                  ! V\        R	R
R7      pRVn        \        P                  ! V\        R4      pRVn        \	        ^{4      Vn        ^Vn	        \        P                  ! V\        R4      p	RV	n        \	        ^{4      V	n        RV	n
        \        P                  ! V\        R4      p
RV
n        \	        R
4      V
n        ^V
n	        RV
n
        V P                  VR4       R# )z'
IR serialization of global variables.
ab	addrspacer   dTeinternalfr   gh	h_sectioni	i_sectiona              @"a" = external global i8
            @"b" = external addrspace(42) global i8
            @"c" = global i32 123
            @"d" = external constant i32
            @"e" = internal global i32 undef
            @"f" = external unnamed_addr addrspace(456) global i32
            @"g" = internal global i32 123, align 16
            @"h" = internal global i32 123, section "h_section"
            @"i" = internal global i32 456, section "i_section", align 8
            N)r?   r   rb  r   rC   re  global_constantlinkageunnamed_addrr   r   rp   )r   r%   r  r  r   r  r  r  r  r  r  s   &          r   test_global_variables_ir)TestGlobalValues.test_global_variables_ir  sO    kkmc4-c4;c5#.c
c5#. c5#.	c5#=c5#.	c
c5#.	c
	c5#.	c
	s 
% 
	r   c                H    V P                  4       pV P                  V4       R # r   )r?   r:   r,   s   & r   test_pickleTestGlobalValues.test_pickle  s    kkm$$S)r   r}   N)
r   r   r   r   r  r  r  r  r   r   r   s   @r   r  r    s!     F$N)V* *r   r  c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )	TestBlocki  c                    V P                  4       p\        P                  ! VR R7      pV P                  VP                  V4       V P                  VP                  4       R# )startparentrG   N)rI   r   Blockr5   r  assertFalseis_terminatedr   rM   rN   s   &  r   test_attributesTestBlock.test_attributes  sC    }}73ellD),,-r   c                    V P                  R R7      pV P                  V P                  V4      R4       VP                  P	                  RR.4       V P                  V P                  V4      R4       R# )r   rG   z
my_block:
r  r  zmy_block:
  a
  b
N)rN   r7   rQ   instructionsextend)r   rN   s   & r   
test_descrTestBlock.test_descr$  s]    



+E*M:!!3*-E*,CDr   c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  W4R4      pVP                  W4R4      pVP                  WdR4       \        P                  ! WP                  RWT3R4      pV P                  VR4       VP                  Wg4       V P                  VR	4       R
# )r   r  N   Nr   r  r  sdivr  z            my_block:
                %"c" = add i32 %".1", %".2"
                %"d" = sub i32 %".1", %".2"
                %"e" = mul i32 %"d", %".2"
            z            my_block:
                %"c" = add i32 %".1", %".2"
                %"f" = sdiv i32 %"c", %".2"
                %"e" = mul i32 %"f", %".2"
            N)rN   r   r   rI   r   r   r   mulInstructionr$  rg   rX   )r   rN   r   r  r  r   r  r  s   &       r   test_replaceTestBlock.test_replace*  s    



+,,u%$$R(KKc"KKc"A#NN5&&&1&#> ! 	 	a ! 	r   c                    V P                  4       p\        P                  ! VRR7      pV P                  \	        V4      R4       R# )z$
Blocks should have a useful repr()
r  r  z"<ir.Block 'start' of type 'label'>N)rI   r   r  r7   r  r  s   &  r   	test_reprTestBlock.test_repr@  s4     }}73e&JKr   r}   N)
r   r   r   r   r  r  r  r  r   r   r   s   @r   r  r    s!     .E,L Lr   r  c                   r  a  ] tR tRt o RtRtR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R  t"R! t#R" t$R# t%R$ t&R% t'R& t(R' t)R( t*R) t+R* t,R+ t-R, t.R- t/R. t0R/ t1R0 t2R1 t3R2 t4R3 t5R4 t6R5 t7R6 t8R7 t9R8 t:R9 t;R: t<R;t=V t>R<# )=TestBuildInstructionsiI  zF
Test IR generation of LLVM instructions through the IRBuilder class.
i  c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  W4R4      pV P                  VR4       V P                  \        V4      R4       R# )r   r  r  reszP            my_block:
                %"res" = add i32 %".1", %".2"
            z}<ir.Instruction 'res' of type 'i32', opname 'add', operands (<ir.Argument '.1' of type i32>, <ir.Argument '.2' of type i32>)>N)	rN   r   r   rI   r   r   rg   r7   r  )r   rN   r   r  r  insts   &     r   test_simple!TestBuildInstructions.test_simpleP  sx    



+,,u%$$R({{1' ! 	
 	d<	=r   c                V   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4pVP                  W4R4       VP                  W4R4       VP                  W4R4       VP                  W4R4       VP                  W4R4       VP                  W4R4       VP                  W4R	4       VP                  W4R
4       VP                  W4R4       VP                  W4R4       VP                  W4R4       VP!                  W4R4       VP#                  W4R4       VP%                  W4R4       VP'                  W4R4       VP)                  W4R4       VP+                  W4R4       VP-                  W4R4       V P/                  \0        4      ;_uu_ 4       pVP                  W54       RRR4       V P3                  \5        XP6                  4      R4       V P9                  VP:                  4       V P=                  VR4       R#   + '       g   i     Ld; i)r   r  N   Nr   r  r  r  r  r  r  jklmnopqrstNz1Operands must be the same type, got (i32, double)aD              my_block:
                %"c" = add i32 %".1", %".2"
                %"d" = fadd i32 %".1", %".2"
                %"e" = sub i32 %".1", %".2"
                %"f" = fsub i32 %".1", %".2"
                %"g" = mul i32 %".1", %".2"
                %"h" = fmul i32 %".1", %".2"
                %"i" = udiv i32 %".1", %".2"
                %"j" = sdiv i32 %".1", %".2"
                %"k" = fdiv i32 %".1", %".2"
                %"l" = urem i32 %".1", %".2"
                %"m" = srem i32 %".1", %".2"
                %"n" = frem i32 %".1", %".2"
                %"o" = or i32 %".1", %".2"
                %"p" = and i32 %".1", %".2"
                %"q" = xor i32 %".1", %".2"
                %"r" = shl i32 %".1", %".2"
                %"s" = ashr i32 %".1", %".2"
                %"t" = lshr i32 %".1", %".2"
            )rN   r   r   rI   r   r   faddr   fsubr  fmuludivr  fdivuremsremfremor_and_xorshlashrlshrr  r   r7   r    	exceptionr  r  rg   )r   rN   r   r  r  ffcms   &      r   test_binops!TestBuildInstructions.test_binops_  s   



+,,u%##((,bA#Q3A#Q3A#Q3Q3Q3Q3Q3Q3Q3A#Q3A#A#Q3Q3z**bKK +R\\*L	N,,- ! 	 +*s   *HH(	c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  W4RR
R7       VP                  W4RRR.R7       V P                  VR4       R	# )r   r  r  r   nuwrj  r  nswz            my_block:
                %"c" = add nuw i32 %".1", %".2"
                %"d" = sub nuw nsw i32 %".1", %".2"
            N)r  )rN   r   r   rI   r   r   r   rg   r   rN   r   r  r  s   &    r   test_binop_flags&TestBuildInstructions.test_binop_flags  su    



+,,u%$$R(A#X.A#eU^4 ! 	r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  W4RR
R7       VP                  W4RRR.R7       V P                  VR4       R	# )r   r  r  r   r  r  ninfnszz            my_block:
                %"c" = fadd fast i32 %".1", %".2"
                %"d" = fsub ninf nsz i32 %".1", %".2"
            Nfast)rN   r   r   rI   r   r  r  rg   r  s   &    r   test_binop_fastmath_flags/TestBuildInstructions.test_binop_fastmath_flags  su    



+,,u%$$R(Q3i0Q3vuo6 ! 	r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  W4R4       VP                  W4R4       VP                  W4R4       VP                  W4R4       VP                  W4R4       VP                  W4R4       V P                  VR	4       R
# )r   r  r  r   r  r  r  r  r  a  my_block:
    %"c" = call {i32, i1} @"llvm.sadd.with.overflow.i32"(i32 %".1", i32 %".2")
    %"d" = call {i32, i1} @"llvm.smul.with.overflow.i32"(i32 %".1", i32 %".2")
    %"e" = call {i32, i1} @"llvm.ssub.with.overflow.i32"(i32 %".1", i32 %".2")
    %"f" = call {i32, i1} @"llvm.uadd.with.overflow.i32"(i32 %".1", i32 %".2")
    %"g" = call {i32, i1} @"llvm.umul.with.overflow.i32"(i32 %".1", i32 %".2")
    %"h" = call {i32, i1} @"llvm.usub.with.overflow.i32"(i32 %".1", i32 %".2")
            N)rN   r   r   rI   r   sadd_with_overflowsmul_with_overflowssub_with_overflowuadd_with_overflowumul_with_overflowusub_with_overflowrg   r  s   &    r   test_binops_with_overflow/TestBuildInstructions.test_binops_with_overflow  s    



+,,u%$$R(""1-""1-""1-""1-""1-""1- ! 	r   c                \   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4pVP                  VR4       VP                  VR4       VP                  VR4       V P                  VP                  4       V P                  VR4       R# )r   r  r  r  r  r  z            my_block:
                %"d" = sub i32 0, %".1"
                %"e" = xor i32 %".2", -1
                %"f" = fneg double %".3"
            N)rN   r   r   rI   r   negnot_fnegr  r  rg   r   rN   r   r  r  r   s   &     r   test_unary_ops$TestBuildInstructions.test_unary_ops  s    



+,,u%""''+aAsQQ,,- ! 	r   c                (   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4\        P
                  ! \        P                  ! ^ 4      \        P                  4      p\        P
                  ! \        P                  ! ^ 4      \        P                  4      pVP                  WVR4      pV P                  VR4       VP                  WS4       VP                  Wd4       V P                  VR4       R# )r   r  r  r   zN            my_block:
                %"c" = add i32 undef, undef
            zN            my_block:
                %"c" = add i32 %".1", %".2"
            N)rN   r   r   rI   r   rd  rP  	Undefinedr   rg   replace_usage)r   rN   r   r  r  undef1undef2r   s   &       r   test_replace_operand*TestBuildInstructions.test_replace_operand  s    



+,,u%$$R(RZZ^R\\:RZZ^R\\:KK, ! 	 	
"	" ! 	r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  RW4R4       VP                  RW4R4       VP                  RW4R4       VP                  R	W4R
4       VP                  RW4R4       VP                  RW4R4       VP                  RW4R4       VP                  RW4R4       VP                  RW4R4       VP                  R	W4R4       VP                  RW4R4       VP                  RW4R4       V P                  \        4      ;_uu_ 4        VP                  RW4R4       RRR4       V P                  \        4      ;_uu_ 4        VP                  RW4R4       RRR4       V P                  VP                  4       V P                  VR4       R#   + '       g   i     Lx; i  + '       g   i     LR; i)r   r  r  ==r   !=r  <r  <=r  >r  >=r  r  r  r  r  r  r  unozzNr  aj              my_block:
                %"c" = icmp eq i32 %".1", %".2"
                %"d" = icmp ne i32 %".1", %".2"
                %"e" = icmp ult i32 %".1", %".2"
                %"f" = icmp ule i32 %".1", %".2"
                %"g" = icmp ugt i32 %".1", %".2"
                %"h" = icmp uge i32 %".1", %".2"
                %"i" = icmp eq i32 %".1", %".2"
                %"j" = icmp ne i32 %".1", %".2"
                %"k" = icmp slt i32 %".1", %".2"
                %"l" = icmp sle i32 %".1", %".2"
                %"m" = icmp sgt i32 %".1", %".2"
                %"n" = icmp sge i32 %".1", %".2"
            )rN   r   r   rI   r   icmp_unsignedicmp_signedr  r   r  r  rg   r  s   &    r   test_integer_comparisons.TestBuildInstructions.test_integer_comparisons  s   



+,,u%$$R(dA#.dA#.c1-dA#.c1-dA#.D!,D!,Cs+D!,Cs+D!,z**qT2 +z**qT2 +,,- ! 	 +***s   	GG G	 G0	c                |   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  RW4R4       VP                  RW4R4       VP                  RW4R4       VP                  R	W4R
4       VP                  RW4R4       VP                  RW4R4       VP                  RW4R4       VP                  RW4R4       VP                  RW4R4       VP                  R	W4R4       VP                  RW4R4       VP                  RW4R4       VP                  RW4R4       VP                  RW4R4       VP                  RW4R4       VP                  RW4R4       VP                  RW4R. R OR7       V P                  VP                  4       V P                  VR4       R# )!r   r  r  r#  r   r$  r  r%  r  r&  r  r'  r  r(  r  r  r  r  r  r  r  ordur)  vwrr  oltyr  a{              my_block:
                %"c" = fcmp oeq i32 %".1", %".2"
                %"d" = fcmp one i32 %".1", %".2"
                %"e" = fcmp olt i32 %".1", %".2"
                %"f" = fcmp ole i32 %".1", %".2"
                %"g" = fcmp ogt i32 %".1", %".2"
                %"h" = fcmp oge i32 %".1", %".2"
                %"i" = fcmp ueq i32 %".1", %".2"
                %"j" = fcmp une i32 %".1", %".2"
                %"k" = fcmp ult i32 %".1", %".2"
                %"l" = fcmp ule i32 %".1", %".2"
                %"m" = fcmp ugt i32 %".1", %".2"
                %"n" = fcmp uge i32 %".1", %".2"
                %"u" = fcmp ord i32 %".1", %".2"
                %"v" = fcmp uno i32 %".1", %".2"
                %"w" = fcmp ord i32 %".1", %".2"
                %"x" = fcmp uno i32 %".1", %".2"
                %"y" = fcmp nnan ninf nsz arcp fast olt i32 %".1", %".2"
            N)nnanr  r  arcpr  )
rN   r   r   rI   r   fcmp_orderedfcmp_unorderedr  r  rg   r  s   &    r   test_float_comparisons,TestBuildInstructions.test_float_comparisons  s   



+,,u%$$R(T1-T1-S!,T1-S!,T1-tQ3/tQ3/sA#.tQ3/sA#.tQ3/UA#.UA#.uaC0uaC0uaC%L 	 	N,,- ! 	r   c                   V P                  R R7      p\        P                  ! \        R4      p\        P                  ! V4      pVP
                  P                  R,          w  rEVP                  W$VRRR7       V P                  VP                  4       VP                  4        V P                  VP                  4       V P                  VR4       R# )	r   r  Tr  r   r  z            my_block:
                %"c" = select arcp nnan i1 true, i32 %".1", i32 %".2"
                unreachable
            N)r7  r6  )rN   r   rd  int1r   rI   r   selectr  r  unreachable
assertTruerg   )r   rN   r  r   r  r  s   &     r   test_misc_ops#TestBuildInstructions.test_misc_ops3  s    



+KKd#,,u%$$R(qQ+;<,,-++, ! 	r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  P                  R4      pVP                  P                  R4      pVP                  \        RR	R7      pVP                  W54       VP                  WF4       V P                  VP                  4       V P                  VR4       R# )
r   r  r  b2b3my_phir  zj            my_block:
                %"my_phi" = phi fast i32 [%".1", %"b2"], [%".2", %"b3"]
            Nr  )rN   r   r   rI   r   rL   phirC   add_incomingr  r  rg   )r   rN   r   r  r  bb2bb3rG  s   &       r   test_phiTestBuildInstructions.test_phiB  s    



+,,u%$$R(11$711$7kk%k;  ,,- ! 	r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4pVP                  \        RR7      pVP                  \        ^*RR7      pVP                  \        VRR7      p^Vn        V P                  VP                  \        P                  ! \        4      4       VP                  WX4      p	V P                  V	P                  \        P                  ! 4       4       VP                  WF4      p
V P                  V
P                  \        P                  ! 4       4       VP                  VR4      pV P                  VP                  \        4       VP                  WF^R7      pV P                  VP                  \        P                  ! 4       4       VP                  VR	^R7      pV P                  VP                  \        4       VP                  WFR
^R7      pV P                  VP                  \        P                  ! 4       4       VP!                  VR
^RR7      pV P                  VP                  \        4       \"        '       g,   \        P$                  ! \        P                  ! 4       R4      pM/\        P$                  ! \        P                  ! \        4      R4      pVP                  \        P$                  ! \        ^4      V4       V P'                  \(        4      ;_uu_ 4        VP                  WC4       RRR4       V P'                  \(        4      ;_uu_ 4        VP                  V4       RRR4       V P'                  \(        4      ;_uu_ 4       pVP                  WH4       RRR4       \"        '       g:   V P                  \+        XP,                  4      R4       V P/                  VR4       R# V P                  \+        XP,                  4      R4       V P/                  VR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i)r   r  r  r   r  )r;  rG   r  r  )r   r  seq_cst)orderingr   r  )rO  r   rG   Nz*cannot store i32 to ptr: mismatching typesal                  my_block:
                    %"c" = alloca i32
                    %"d" = alloca i32, i32 42
                    %"e" = alloca double, i32 %".1", align 8
                    store double %".3", ptr %"e"
                    store i32 %".2", ptr %"c"
                    %"g" = load i32, ptr %"c"
                    store i32 %".2", ptr %"c", align 1
                    %"i" = load i32, ptr %"c", align 1
                    store atomic i32 %".2", ptr %"c" seq_cst, align 4
                    %"k" = load atomic i32, ptr %"c" seq_cst, align 4
                    store i32 5, ptr null
                z.cannot store i32 to double*: mismatching typesaw                  my_block:
                    %"c" = alloca i32
                    %"d" = alloca i32, i32 42
                    %"e" = alloca double, i32 %".1", align 8
                    store double %".3", double* %"e"
                    store i32 %".2", i32* %"c"
                    %"g" = load i32, i32* %"c"
                    store i32 %".2", i32* %"c", align 1
                    %"i" = load i32, i32* %"c", align 1
                    store atomic i32 %".2", i32* %"c" seq_cst, align 4
                    %"k" = load atomic i32, i32* %"c" seq_cst, align 4
                    store i32 5, i32* null
                )rN   r   r   rI   r   allocarC   rD   r   r7   r$  rE   storer}  loadstore_atomicload_atomicr   rd  r  	TypeErrorr    r  rg   )r   rN   r   r  r  zr   r  r  eer  r  r  r  r  r  ptrr  s   &                 r   test_mem_ops"TestBuildInstructions.test_mem_opsQ  s   



+,,u%""''+aNN5sN+NN5rN4NN3QSN1!45]]1 "++-0MM!/LLC 'MM!aM(/LLCqL)'  	 C/IQSI'..++bnn.5C++bnnU3T:Cbkk%+S1y))MM! *y))LLO * y))RMM! * /.S.IKU %  S.MOU % 9 *))) *)s$   PP2QP/	2Q	Q	c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  \        P                  ! \        4      RR7      pVP                  V\        P                  ! \        ^4      V.RR7      pV P                  VP                  \        P                  ! \        4      4       \        '       g   V P                  VR4       R# V P                  VR4       R# )r   r  r  r   r  z                my_block:
                    %"c" = alloca ptr
                    %"d" = getelementptr ptr, ptr %"c", i32 5, i32 %".1"
                z                my_block:
                    %"c" = alloca i32*
                    %"d" = getelementptr i32*, i32** %"c", i32 5, i32 %".1"
                N)rN   r   r   rI   r   rP  rE   rC   geprd  r7   r$  r   rg   r   rN   r   r  r  r   r  s   &      r   test_gepTestBuildInstructions.test_gep  s    



+,,u%$$R(NN2>>%0sN;KKBKKq115CK@!67..U %  U % r   c           
        V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4\
        P                  4       p\        P                  ! \        WUV\        .4      pVP                  W6P                  4       RR7      pTP                  TR Uu. uF  p\        P                  ! \        V4      NK   	  upRR7      p	V P                  V	P                  \        P                  ! V4      4       \         '       g   V P#                  VR4       R# V P#                  VR4       R# u upi )	r   r  r  r  r  z                my_block:
                    %"d" = bitcast i32 %".1" to ptr
                    %"e" = getelementptr {i64, ptr, ptr, ptr, i64}, ptr %"d", i32 0, i32 3
                z                my_block:
                    %"d" = bitcast i32 %".1" to {i64, i8*, i8*, i8*, i64}*
                    %"e" = getelementptr {i64, i8*, i8*, i8*, i64}, {i64, i8*, i8*, i8*, i64}* %"d", i32 0, i32 3
                Nr   r  )rN   r   r   rI   r   r   r   LiteralStructTyper   bitcastr\  rd  rC   r7   r$  rE   r   rg   )
r   rN   r   r  r  int8ptrlsr  rr  r  s
   &         r   test_gep_castinstr(TestBuildInstructions.test_gep_castinstr  s     



+,,u%$$R(//#!!5'GU"KLOOA}}SO9KK6B6aBKKq16BKM!89..U %  U %  Cs   /$E 
c           
        V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4^p\
        P                  4       p\        P                  ! \        WfV\        .4      pVP                  W7P                  VR7      RR7      pTP                  TR	 U	u. uF  p	\        P                  ! \        V	4      NK   	  up	RR7      p
V P                  V
P                  P                  V4       V P                  V
P                  \        P                   ! WeR7      4       \"        '       g   V P%                  VR4       R# V P%                  VR4       R# u up	i )
r   r  r  r  r  r  z                my_block:
                    %"d" = bitcast i32 %".1" to ptr addrspace(4)
                    %"e" = getelementptr {i64, ptr, ptr, ptr, i64}, ptr addrspace(4) %"d", i32 0, i32 3
                a                  my_block:
                    %"d" = bitcast i32 %".1" to {i64, i8*, i8*, i8*, i64} addrspace(4)*
                    %"e" = getelementptr {i64, i8*, i8*, i8*, i64}, {i64, i8*, i8*, i8*, i64} addrspace(4)* %"d", i32 0, i32 3
                Nra  )rN   r   r   rI   r   r   r   rb  r   rc  r\  rd  rC   r7   r$  r  rE   r   rg   )r   rN   r   r  r  r  rd  re  r  rr  r  s   &          r   test_gep_castinstr_addrspace2TestBuildInstructions.test_gep_castinstr_addrspace  s    



+,,u%$$R(	//#!!5'GU"KLOOA}}y}AOLKK6B6aBKKq16BKM))95!MN..U %  U %  Cs   3$E+
c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4^pVP                  \        P                  ! \        VR7      RR7      p\        '       g'   V P                  \        VP                  4      R4       M%V P                  \        VP                  4      R4       V P                  VP                  P                  P                  V4       VP                  V\        P                  ! \        ^4      V.RR7      pV P                  VP                  P                  V4       VP                  V\        P                  ! \        ^
4      .RR7      pV P                  VP                  P                  V4       \        '       g   V P!                  VR	4       R# V P!                  VR
4       R# )r   r  r  r  r   rX  zi32 addrspace(4)**r  r  z                my_block:
                    %"c" = alloca ptr addrspace(4)
                    %"d" = getelementptr ptr addrspace(4), ptr %"c", i32 5, i32 %".1"
                    %"e" = getelementptr i32, ptr addrspace(4) %"d", i32 10
                a                  my_block:
                    %"c" = alloca i32 addrspace(4)*
                    %"d" = getelementptr i32 addrspace(4)*, i32 addrspace(4)** %"c", i32 5, i32 %".1"
                    %"e" = getelementptr i32, i32 addrspace(4)* %"d", i32 10
                N)rN   r   r   rI   r   rP  rE   rC   r   r7   r    r$  pointeer  r\  rd  rg   )	r   rN   r   r  r  r  r   r  r  s	   &        r   test_gep_addrspace(TestBuildInstructions.test_gep_addrspace  s[   



+,,u%$$R(	NN2>>%9ECNP..S[%0S[*>?119=KKBKKq115CK@))95KKBKKr23#K>))95..U %  U % r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4\        P
                  ! \        \        .4      p\        P
                  ! \        V.4      p\        P                  ! V\        P                  ! \        ^4      \        P                  ! \        R4      34      pVP                  V^ RR7      pVP                  Ws^ RR7      p	VP                  V	\        P                  ! \        R4      ^RR7      p
V P                  V	P                  V4       V P                  V
P                  V4       VP                  VRR7      pVP                  VR	R7      pVP                  V^ R
R7      pVP                  V^RR7      pVP                  VRRR7      pVP                  VRRR7      pVP                  W^RR7      pVP                  WRRR7      pV P                  VP                  \        4       V P                  VP                  V4       V P                  VP                  \        4       V P                  VP                  \        4       V P                  VP                  V4       V P                  VP                  V4       V P!                  \"        4      ;_uu_ 4        VP                  V^ 4       RRR4       V P!                  \"        4      ;_uu_ 4        VP                  VR4       RRR4       V P!                  \"        4      ;_uu_ 4        VP                  V^4       RRR4       V P!                  \"        4      ;_uu_ 4        VP                  W4^ 4       RRR4       V P!                  \"        4      ;_uu_ 4        VP                  Ws^4       RRR4       \$        '       g   V P'                  VR4       R# V P'                  VR4       R#   + '       g   i     EL%; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i)r   r  r  Tr   r  Fr  rX  r  r  r  r  r  r  r  Na                  my_block:
                    %"c" = extractvalue {i32, i1} {i32 4, i1 true}, 0
                    %"d" = insertvalue {i32, i1} {i32 4, i1 true}, i32 %".1", 0
                    %"e" = insertvalue {i32, i1} %"d", i1 false, 1
                    %"ptr" = alloca {i8, {i32, i1}}
                    %"j" = load {i8, {i32, i1}}, ptr %"ptr"
                    %"k" = extractvalue {i8, {i32, i1}} %"j", 0
                    %"l" = extractvalue {i8, {i32, i1}} %"j", 1
                    %"m" = extractvalue {i8, {i32, i1}} %"j", 1, 0
                    %"n" = extractvalue {i8, {i32, i1}} %"j", 1, 1
                    %"o" = insertvalue {i8, {i32, i1}} %"j", {i32, i1} %"l", 1
                    %"p" = insertvalue {i8, {i32, i1}} %"j", i32 %".1", 1, 0
                a"                  my_block:
                    %"c" = extractvalue {i32, i1} {i32 4, i1 true}, 0
                    %"d" = insertvalue {i32, i1} {i32 4, i1 true}, i32 %".1", 0
                    %"e" = insertvalue {i32, i1} %"d", i1 false, 1
                    %"ptr" = alloca {i8, {i32, i1}}
                    %"j" = load {i8, {i32, i1}}, {i8, {i32, i1}}* %"ptr"
                    %"k" = extractvalue {i8, {i32, i1}} %"j", 0
                    %"l" = extractvalue {i8, {i32, i1}} %"j", 1
                    %"m" = extractvalue {i8, {i32, i1}} %"j", 1, 0
                    %"n" = extractvalue {i8, {i32, i1}} %"j", 1, 1
                    %"o" = insertvalue {i8, {i32, i1}} %"j", {i32, i1} %"l", 1
                    %"p" = insertvalue {i8, {i32, i1}} %"j", i32 %".1", 1, 0
                )   r   )rp  rp  )r   r   )rN   r   r   rI   r   rb  rC   r=  r   rd  extract_valueinsert_valuer7   r$  rP  rR  r  rU  r   rg   )r   rN   r   r  r  tp_innertp_outerc_innerr   r  r  p_outerr  r  r  r  r  r  r  s   &                  r   test_extract_insert_value/TestBuildInstructions.test_extract_insert_value   sc   



+,,u%$$R(''6''x(89++hUA)>)+T4)@)B C !!'13!7  QS 9  BKKe$<ac J**...6LLsL+!!!QS!1!!!QS!1!!!V#!6!!!V#!6  qs 3  vC 8&*'&**y))!!'1- * y))!!'62 * y))!!'1- * y))  q) * y))  Q/ * /.U %  U % A *)) *)) *) *) *)s<   O;P<P#4P6,Q	;P	P 	#P3	6Q		Q	c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4rVVP                  V\        RR7      pVP                  V\        RR7      pVP                  V\        RR7      p	VP                  V\        R4      p
VP                  V
\        R4      pVP                  V\        R4      pVP                  V\        R	4      pVP!                  V\        R
4      pVP#                  V\        R4      pVP%                  V\        R4      pVP'                  V\        P(                  ! \        4      R4      pVP+                  V\        R4      pV P-                  VP.                  4       \0        '       g   V P3                  VR4       R# V P3                  VR4       R# )r   r  :N   Nr   r  r  fbfcr  r  fdfer  r  r  a                  my_block:
                    %"c" = trunc i32 %".1" to i8
                    %"d" = zext i8 %"c" to i32
                    %"e" = sext i8 %"c" to i32
                    %"fb" = fptrunc double %".3" to float
                    %"fc" = fpext float %"fb" to double
                    %"g" = fptoui double %".3" to i32
                    %"h" = fptosi double %".3" to i8
                    %"fd" = uitofp i32 %"g" to float
                    %"fe" = sitofp i8 %"h" to double
                    %"i" = ptrtoint ptr %".4" to i32
                    %"j" = inttoptr i32 %"i" to ptr
                    %"k" = bitcast i32 %".1" to float
                a                  my_block:
                    %"c" = trunc i32 %".1" to i8
                    %"d" = zext i8 %"c" to i32
                    %"e" = sext i8 %"c" to i32
                    %"fb" = fptrunc double %".3" to float
                    %"fc" = fpext float %"fb" to double
                    %"g" = fptoui double %".3" to i32
                    %"h" = fptosi double %".3" to i8
                    %"fd" = uitofp i32 %"g" to float
                    %"fe" = sitofp i8 %"h" to double
                    %"i" = ptrtoint i32* %".4" to i32
                    %"j" = inttoptr i32 %"i" to i8*
                    %"k" = bitcast i32 %".1" to float
                N)rN   r   r   rI   r   truncr   zextrC   sextfptruncfltfpextrD   fptouifptosiuitofpsitofpptrtointinttoptrrE   rc  r  r  r   rg   )r   rN   r   r  r  farX  r   r  r  r{  r|  r  r  r}  r~  r  r  r  s   &                  r   test_cast_ops#TestBuildInstructions.test_cast_opsM  sk   



+,,u%((--b1bMM!TM,LLEL,LLEL,__Rd+]]2sD)NN2uc*NN2tS)^^AsD)^^AsD)S%-Qt 4c:OOAsC(,,-..U %   U % r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  \        RR7      pVP                  RWSRR4      pV P                  VP                  \        4       \        '       g   V P                  VR4       R	# V P                  VR4       R	# )
r   r  r  r   r   	monotonicr  z                my_block:
                    %"c" = alloca i32
                    %"d" = atomicrmw add ptr %"c", i32 %".1" monotonic
                z                my_block:
                    %"c" = alloca i32
                    %"d" = atomicrmw add i32* %"c", i32 %".1" monotonic
                N)rN   r   r   rI   r   rP  rC   
atomic_rmwr7   r$  r   rg   r]  s   &      r   test_atomicrmw$TestBuildInstructions.test_atomicrmw  s    



+,,u%$$R(NN5sN+uaK='..U %  U % r   c                
   V P                  R R7      p\        P                  ! V4      pVP                  P	                  RR7      pVP                  V4       V P                  VP                  4       V P                  VR4       R# )r   r  targetzE            my_block:
                br label %"target"
            N)	rN   r   r   rI   rL   branchr@  r  rg   )r   rN   r   	bb_targets   &   r   test_branch!TestBuildInstructions.test_branch  sl    



+,,u%$$77X7F	y!++, ! 	r   c                v   V P                  R R7      p\        P                  ! V4      pVP                  P	                  RR7      pVP                  P	                  RR7      pVP                  \        P                  ! \        R4      W44       V P                  VP                  4       V P                  VR4       R# )r   r  b_trueb_falseFza            my_block:
                br i1 false, label %"b_true", label %"b_false"
            N)rN   r   r   rI   rL   cbranchrd  r=  r@  r  rg   )r   rN   r   bb_truebb_falses   &    r   test_cbranch"TestBuildInstructions.test_cbranch  s    



+,,u%""5585D##66I6FD%0'D++, ! 	r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P	                  RR7      pVP                  P	                  RR7      pVP                  \        P                  ! \        R4      W44      pVP                  ^^*.4       V P                  VP                  4       V P                  VR4       V P                  VP                  R4       R# )r   r  r  r  Fzk            my_block:
                br i1 false, label %"b_true", label %"b_false", !prof !0
            zC            !0 = !{ !"branch_weights", i32 5, i32 42 }
            N)rN   r   r   rI   rL   r  rd  r=  set_weightsr@  r  rg   rt   r?   )r   rN   r   r  r  brs   &     r   test_cbranch_weights*TestBuildInstructions.test_cbranch_weights  s    



+,,u%""5585D##66I6F__R[[u5wI
2w++, ! 	 	GNN - 	r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P	                  RR7      pVP                  P	                  RR7      pVP                  \        P                  ! VP                  V4      4      pVP                  V4       VP                  V4       V P                  VP                  4       \        '       g   V P                  VR4       R# V P                  VR4       R# )r   r  b_1b_2z                my_block:
                    indirectbr ptr blockaddress(@"my_func", %"b_1"), [label %"b_1", label %"b_2"]
                z                my_block:
                    indirectbr i8* blockaddress(@"my_func", %"b_1"), [label %"b_1", label %"b_2"]
                N)rN   r   r   rI   rL   branch_indirectBlockAddressadd_destinationr@  r  r   rg   )r   rN   r   bb_1bb_2
indirectbrs   &     r   test_branch_indirect*TestBuildInstructions.test_branch_indirect  s    



+,,u%222>222>,,OOG,,d35
""4(""4(++,..U % 
 U % r   c                  a  V 3R  lpS P                  RR7      p\        P                  ! V4      pVP                  4        V! VR4       S P                  RR7      p\        P                  ! V4      pVP	                  \        ^4      4       V! VR4       S P                  RR7      p\        P                  ! V4      pVP                  4       pVP                  RVP                  P                  R
4      4       V! VR4       S P                  RR7      p\        P                  ! V4      pVP	                  \        ^4      4      pVP                  RVP                  P                  R
4      4       V! VR4       R	# )c                 `   < SP                  V P                  4       SP                  W4       R # r   )r@  r  rg   )rN   expected_irr   s   &&r   check1TestBuildInstructions.test_returns.<locals>.check  s#    OOE//0U0r   r   r  z;            my_block:
                ret void
            other_blockz?            other_block:
                ret i32 5
            r   zD            my_block:
                ret void, !dbg !0
            zE            my_block:
                ret i32 6, !dbg !0
            Nr}   )	rN   r   r   r   retrC   r   r?   r   )r   r  rN   r   r  s   f    r   test_returns"TestBuildInstructions.test_returns  s>   	1 



+,,u%e  	
 


.,,u%E!He  	 



+,,u%!%!:!:2!>?e  	
 



+,,u%{{58$%!:!:2!>?e  	r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  P                  RR7      pVP                  P                  RR7      pVP                  P                  RR7      pVP                  P                  RR7      pVP                  W84      p	V	P                  \        P                  ! \        ^ 4      V4       V	P                  \        P                  ! \        ^4      V4       V	P                  ^V4       V P                  VP                  4       V P                  VR4       R# )	r   r  r  onzeroononeontwo	otherwisez            my_block:
                switch i32 %".1", label %"otherwise" [i32 0, label %"onzero" i32 1, label %"onone" i32 2, label %"ontwo"]
            N)rN   r   r   rI   r   rL   switchadd_caserd  rC   r@  r  rg   )
r   rN   r   r  r  	bb_onzerobb_ononebb_ontwobb_elsesws
   &         r   test_switch!TestBuildInstructions.test_switch  s   



+,,u%$$R($$77X7F	##66G6D##66G6D""55;5G^^A'
BKKq)95
BKKq)84
Ax ++, ! 	r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4\        P
                  ! \        \        \        34      p\        P
                  ! \        \        3RR7      p\        P
                  ! \        \        \        34      p\        P                  ! VP                  P                  VR4      p\        P                  ! VP                  P                  VR4      p	\        P                  ! VP                  P                  VR4      p
VP                  WV3R4       VP                  WV3R	4       VP                  WV3R
4       VP                  WV3RRR7       VP                  WV3R4      pVP                  P                  R4       VP                  WV3RRR7       VP                  WV3RRR7       VP                  WV3RRR7       VP                  WV3RRR7       VP                  WV3RRR7       VP                  WV3RRR7       V P                  VR4       R# ) r   r  r  Tr   r  r  r  res_fres_gres_h
res_f_fastfastcc)cconvres_f_readonlyreadonlyres_fastr  )fastmathres_nnan_ninfres_noinliner   )attrsres_alwaysinliner   res_noinline_rores_convergentr   aT          my_block:
            %"res_f" = call float @"f"(i32 %".1", i32 %".2")
            %"res_g" = call double (i32, ...) @"g"(i32 %".2", i32 %".1")
            %"res_h" = call half @"h"(i32 %".1", i32 %".2")
            %"res_f_fast" = call fastcc float @"f"(i32 %".1", i32 %".2")
            %"res_f_readonly" = call float @"f"(i32 %".1", i32 %".2") readonly
            %"res_fast" = call fast float @"f"(i32 %".1", i32 %".2")
            %"res_nnan_ninf" = call ninf nnan float @"f"(i32 %".1", i32 %".2")
            %"res_noinline" = call float @"f"(i32 %".1", i32 %".2") noinline
            %"res_alwaysinline" = call float @"f"(i32 %".1", i32 %".2") alwaysinline
            %"res_noinline_ro" = call float @"f"(i32 %".1", i32 %".2") noinline readonly
            %"res_convergent" = call float @"f"(i32 %".1", i32 %".2") convergent
        N)r6  r  )r   r  )rN   r   r   rI   r   rB   r  rC   rD   hlfrF   r?   r  r   r   rg   )r   rN   r   r  r  tp_ftp_gtp_hr  r  r  r  s   &           r   	test_callTestBuildInstructions.test_call
  s   



+,,u%$$R(sUEN3sUHd;sUEN3KK((//s;KK((//s;KK((//s;QA(QA(QA(QAH= aQ1AB!!%%j1QA
V<QA:JKQAjAQA 2.IQA 1 :F 	GQA 0E ! 	r   c                   V P                  RR7      p\        P                  ! V4      p\        P                  ! \        P                  ! 4       \        P
                  ! 4       .^,          4      p\        P                  ! VP                  VR4      pVP                  \        RR7      pVP                  P                  R4      pVP                  WEWf34       \        '       g   V P                  VR4       R# V P                  VR4       R# )	z)
Function calls with metadata arguments.
r   r  zllvm.dbg.declarer  z                my_block:
                    %"a" = alloca i32
                    call void @"llvm.dbg.declare"(metadata ptr %"a", metadata !0, metadata !0)
                z                my_block:
                    %"a" = alloca i32
                    call void @"llvm.dbg.declare"(metadata i32* %"a", metadata !0, metadata !0)
                Nr}   )rN   r   r   rB   r}  MetaDataTyperF   r?   rP  rC   r   r  r   rg   )r   rN   r   dbg_declare_tydbg_declarer  r  s   &      r   test_call_metadata(TestBuildInstructions.test_call_metadata0  s     



+,,u%9J8Ka8OPkkNN  NN5sN+NN''+[a),..U %  U % r   c                   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        P                  ! 4       \
        P                  4       \
        \
        P                  4       34      p\        P                  ! VP                  P                  VR4      pVP                  ^ ,          P                  R4       VP                  \
        RR7      pVP                  \
        RR7      pVP                  VV\        P                  ! \
        ^*4      V3^ R^R/R7       \        '       g   V P!                  VR4       R
# V P!                  VR	4       R
# )r   r  funsretretvalotherr   	arg_attrsz            my_block:
                %"retval" = alloca i32
                %"other" = alloca i32
                call void @"fun"\(ptr noalias sret(\(i32\))? %"retval", i32 42, ptr noalias %"other"\)
            z            my_block:
                %"retval" = alloca i32
                %"other" = alloca i32
                call void @"fun"\(i32\* noalias sret(\(i32\))? %"retval", i32 42, i32\* noalias %"other"\)
            Nr  r   )rN   r   r   rB   r}  rC   r   rF   rI   r?   r   r   rP  r  rd  r   rj   )r   rN   r   fun_tyr  r  r  s   &      r   test_call_attributes*TestBuildInstructions.test_call_attributesK  s   



+,,u%KKME,,.u7G7G7IJLkk'**1165A!!&)H5u73R[[+U3&9 	 	
 /.""5 +  ""5 + r   c                b   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        P                  ! 4       R4      p\        P
                  ! VP                  P                  VR4      pVP                  VR4       VP                  VRRR7       VP                  VRRR7       VP                  VRRR7       VP                  VRRR7       VP                  VRRR7       VP                  VR. R7       VP                  VRR	R7       V P                  VR
4       R# )r   r  my_funF)tailTr  notailmusttailznot a markeraI          my_block:
            call void @"my_fun"()
            call void @"my_fun"()
            tail call void @"my_fun"()
            tail call void @"my_fun"()
            notail call void @"my_fun"()
            musttail call void @"my_fun"()
            call void @"my_fun"()
            tail call void @"my_fun"()
        Nr}   )
rN   r   r   rB   r}  rF   rI   r?   r  rg   r   rN   r   r  r  s   &    r   test_call_tail$TestBuildInstructions.test_call_tailk  s    



+,,u%3kk'**1168DS"S"5)S"4(S"6*S"8,S":.S"2&S">2 
! 
	r   c                   V P                  4       p\        P                  ! V4      p\        P                  ! \        P                  ! 4       R4      p\        P
                  ! VP                  P                  VR 4      pV P                  \        4      ;_uu_ 4        VP                  VR^ R/R7       RRR4       R#   + '       g   i     R# ; i)r  r  r  Nr}   )rN   r   r   rB   r}  rF   rI   r?   r  r   r  r  s   &    r   test_invalid_call_attributes2TestBuildInstructions.test_invalid_call_attributes  s    

,,u%3kk'**1165Az**LLbQKL8 +***s   B;;C	c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4\        P
                  ! \        \        \        34      p\        P                  ! VP                  P                  VR4      pVP                  P                  RR7      pVP                  P                  RR7      pVP                  WcV3WxR4       V P                  VR4       R# )	r   r  r  r  normalunwindr  z            my_block:
                %"res_f" = invoke float @"f"(i32 %".1", i32 %".2")
                    to label %"normal" unwind label %"unwind"
            N)rN   r   r   rI   r   rB   r  rC   rF   r?   rL   invokerg   )	r   rN   r   r  r  r  r  	bb_normal	bb_unwinds	   &        r   test_invoke!TestBuildInstructions.test_invoke  s    



+,,u%$$R(sUEN3KK((//s;$$77X7F	$$77X7F	qa&)@ ! 	r   c                L   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        P                  ! 4       \
        P                  4       \
        \
        P                  4       34      p\        P                  ! VP                  P                  VR4      pRVn
        VP                  ^ ,          P                  R4       VP                  \
        RR7      pVP                  \
        RR7      pVP                  P                  RR7      pVP                  P                  RR7      pVP                  VV\        P                   ! \
        ^*4      V3VVRR	R
^ R^R/R7       \"        '       g   V P%                  VR4       R# V P%                  VR4       R# )r   r  r  r  r  r  r  r  r  r  r   r   )r  r  r  r  a+              my_block:
                %"retval" = alloca i32
                %"other" = alloca i32
                invoke fast fastcc void @"fun"\(ptr noalias sret(\(i32\))? %"retval", i32 42, ptr noalias %"other"\) noinline
                    to label %"normal" unwind label %"unwind"
            a/              my_block:
                %"retval" = alloca i32
                %"other" = alloca i32
                invoke fast fastcc void @"fun"\(i32\* noalias sret(\(i32\))? %"retval", i32 42, i32\* noalias %"other"\) noinline
                    to label %"normal" unwind label %"unwind"
            Nr  )rN   r   r   rB   r}  rC   r   rF   rI   r?   calling_conventionr   r   rP  rL   r  rd  r   rj   )	r   rN   r   r  r  r  r  r  r   s	   &        r   test_invoke_attributes,TestBuildInstructions.test_invoke_attributes  sa   



+,,u%KKME,,.u7G7G7IJLkk'**1165A!)!!&)H5u73$$77X7F	$$77X7F	R[[+U3&9 	 	
 /.""5 +  ""5 + r   c           
        V P                  R R7      p\        P                  ! V4      pVP                  \        P                  ! \
        \        P                  4       .4      R4      p\        P                  ! VP                  P                  \        P                  4       R4      pRVn        VP                  \        P                  ! V4      4       VP                  \        P                  ! \        P                  ! \        P                   ! VP"                  ^4      V.4      4      4       VP%                  V4       \&        '       g   V P)                  VR4       R# V P)                  VR4       R# )r   r  lp_ZTIiTz                my_block:
                    %"lp" = landingpad {i32, ptr}
                        catch ptr @"_ZTIi"
                        filter [1 x ptr] [ptr @"_ZTIi"]
                    resume {i32, ptr} %"lp"
                z                my_block:
                    %"lp" = landingpad {i32, i8*}
                        catch i8** @"_ZTIi"
                        filter [1 x i8**] [i8** @"_ZTIi"]
                    resume {i32, i8*} %"lp"
                N)rN   r   r   
landingpadrb  rC   r   r   rb  rI   r?   r  
add_clauseCatchClauseFilterClauserd  	ArrayTyper$  resumer   rg   )r   rN   r   r  int_typeinfos   &    r   test_landingpad%TestBuildInstructions.test_landingpad  s   



+,,u% 4 4e6:oo6G6I !JKOQ(()9)9)@)@)-):GE'+$
bnn\23
boobkk",,q3"$0>'3 4 	5r..U %  U % r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  RW4RR7      pVP                  V4       V P                  VR4       R# )r   r  r  r'  r   z            my_block:
                %"c" = icmp sgt i32 %".1", %".2"
                call void @"llvm.assume"(i1 %"c")
            N)rN   r   r   rI   r   r,  r   rg   r  s   &     r   test_assume!TestBuildInstructions.test_assume  sp    



+,,u%$$R(Q4q ! 	r   c                   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4RVn        RVn        \        P                  ! VP                  ^4      p\        P                  ! V\        P                  4      p\        P                  ! ^ 4      pVP                  WcV! ^ 4      RR7      pVP                  WdV! ^4      RR7      pV P                  VR4       VP                  R4      pVP                  V4       VP                  V4       \        P                  ! V^^ .4      pVP!                  WfVR	R7       V P                  VR
4       VP                  R4      pVP                  V4       VP                  V4       VP#                  WfRR7       V P                  VR4       VP                  R4      pVP                  V4       VP                  V4       VP%                  Wg! ^ 4      RR7      p	VP%                  Wg! ^4      RR7      p
V P                  VR4       VP'                  VP#                  W4      4       V P)                  VP*                  4       R# )insert_blockr  r  r  r  vec1vec2zinsert_block:
    %"vec1" = insertelement <2 x i32> <i32 undef, i32 undef>, i32 %"a", i32 0
    %"vec2" = insertelement <2 x i32> %"vec1", i32 %"b", i32 1
            shuffle_blockshufz            shuffle_block:
                %"shuf" = shufflevector <2 x i32> %"vec2", <2 x i32> %"vec2", <2 x i32> <i32 1, i32 0>
            	add_blocksumz[            add_block:
                %"sum" = add <2 x i32> %"vec2", %"vec2"
            extract_blockex1ex2z            extract_block:
              %"ex1" = extractelement <2 x i32> %"vec2", i32 0
              %"ex2" = extractelement <2 x i32> %"vec2", i32 1
            N)rN   r   r   rI   r   rG   
VectorTyper$  rd  r  rP  insert_elementrg   rL   r  position_at_endshuffle_vectorr   extract_elementr  r-   r?   )r   rN   r   r  r  vectyvecidxtymaskr   r  s   &          r   test_vector_ops%TestBuildInstructions.test_vector_ops  s!   


/,,u%$$R(affa(kk%.

2$$SU1XF$C$$SU1XF$C ! 	 **?;u&{{51a&)sF; ! 	
 **;7u&C5) ! 	
 **?;u&##Cq#>##Cq#> ! 	 	GKK%&W^^,r   c                    V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      pVP                  VRR7      pVP                  V4       V P                  VR4       R# )r   r  r   z}            my_block:
                %"c" = call i64 @"llvm.bitreverse.i64"(i64 5)
                ret i64 %"c"
            N)rN   r   r   rd  r   
bitreverser  rg   r   rN   r   r  r   s   &    r   test_bitreverse%TestBuildInstructions.test_bitreverse+  se    



+,,u%KKq!qs+A ! 	r   c                n   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      pV P                  \        4      ;_uu_ 4       pVP                  VRR7       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; ir   r  r   Nz#expected an integer type, got float)rN   r   r   rd  r  r  rU  r-  r#   r    r  r   rN   r   r  raisess   &    r   test_bitreverse_wrongtype/TestBuildInstructions.test_bitreverse_wrongtype7  s    



+,,u%KKQy))Vqs+ *1  !	# *)   !B$$B4	c                   V P                  R R7      p\        P                  ! V4      pV P                  \        4      ;_uu_ 4       pVP                  RR4       RRR4       V P                  R\        XP                  4      4       V P                  \        4      ;_uu_ 4       pVP                  RR4       RRR4       V P                  R\        VP                  4      4       VP                  RR4       VP                  RR4       VP                  R	R4       VP                  R
4       VP                  4        V P                  VR4       R#   + '       g   i     L; i  + '       g   i     L; i)r   r  r  Nz#Invalid fence ordering "monotonic"!zInvalid fence ordering "None"!acquirereleasesinglethreadacq_relrN  z            my_block:
                fence acquire
                fence syncscope("singlethread") release
                fence syncscope("singlethread") acq_rel
                fence seq_cst
                ret void
            )rN   r   r   r  r   fencer#   r    r  r   rg   )r   rN   r   r4  s   &   r   
test_fence TestBuildInstructions.test_fenceB  s   



+,,u%z**fMM+t, +3  !	# z**fMM$, +.  !	# 	i&i0i0i  ! 	 +*
 +*s   E#E!E	!E1	c                P   V P                  R R7      p\        P                  ! V4      pV P                  \        4      ;_uu_ 4        VP                  R4       RRR4       VP                  R4       VP                  4        V P                  VR4       R#   + '       g   i     LE; i)r   r  zso
many linesNz
my commentzX            my_block:
                ; my comment
                ret void
            )rN   r   r   r  AssertionErrorcommentr   rg   r   rN   r   s   &  r   test_comment"TestBuildInstructions.test_comment]  sy    



+,,u%~..OO,- /% ! 		 /.s   BB%	c                    V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      pVP                  VRR7      pVP                  V4       V P                  VR4       R# )r   r  r   zx            my_block:
                %"c" = call i32 @"llvm.bswap.i32"(i32 5)
                ret i32 %"c"
            N)rN   r   r   rd  rC   bswapr  rg   r.  s   &    r   
test_bswap TestBuildInstructions.test_bswapj  b    



+,,u%KKq!MM!#M&A ! 	r   c                    V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      pVP                  VRR7      pVP                  V4       V P                  VR4       R# )r   r  r   zx            my_block:
                %"c" = call i16 @"llvm.ctpop.i16"(i16 5)
                ret i16 %"c"
            N)rN   r   r   rd  int16ctpopr  rg   r.  s   &    r   
test_ctpop TestBuildInstructions.test_ctpopv  rJ  r   c                .   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      p\        P                  ! \
        ^4      pVP                  W4RR7      pVP                  V4       V P                  VR4       R# )r   r  r   z}            my_block:
                %"c" = call i16 @"llvm.ctlz.i16"(i16 5, i1 1)
                ret i16 %"c"
            N)	rN   r   r   rd  rL  r=  ctlzr  rg   r  s   &     r   	test_ctlzTestBuildInstructions.test_ctlz  r    



+,,u%KKq!KKa LLCL(A ! 	r   c                    V P                  R R7      p\        P                  ! V4      p\        P                  ! \        R4      pVP                  VRR7      pVP                  V4       V P                  VR4       R# )r   r  g      @r  z            my_block:
                %"b" = call i16 @"llvm.convert.to.fp16.f32"(float 0x4014000000000000)
                ret i16 %"b"
            N)rN   r   r   rd  r  convert_to_fp16r  rg   r  s   &    r   test_convert_to_fp16_f32.TestBuildInstructions.test_convert_to_fp16_f32  se    



+,,u%KKS!##AC#0A ! 	r   c                n   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      pV P                  \        4      ;_uu_ 4       pVP                  VRR7       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r   r  r  Nexpected a float type, got i16)rN   r   r   rd  rL  r  rU  rV  r#   r    r  r3  s   &    r   "test_convert_to_fp16_f32_wrongtype8TestBuildInstructions.test_convert_to_fp16_f32_wrongtype  s    



+,,u%KKq!y))V##AC#0 *,  !	# *)r7  c                   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      pVP                  VR\        R7      pVP                  V4       V P                  VR4       R# )r   r  r  rG   toz            my_block:
                %"b" = call float @"llvm.convert.from.fp16.f32"(i16 5)
                ret float %"b"
            N)	rN   r   r   rd  rL  convert_from_fp16r  r  rg   r  s   &    r   test_convert_from_fp16_f320TestBuildInstructions.test_convert_from_fp16_f32  sg    



+,,u%KKq!%%acc%:A ! 	r   c                n   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        R4      pV P                  \        4      ;_uu_ 4       pVP                  VRR7       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r   r        @r  Nzexpected a float return typerN   r   r   rd  r  r  rU  r`  r#   r    r  r3  s   &    r   !test_convert_from_fp16_f32_notype7TestBuildInstructions.test_convert_from_fp16_f32_notype  s    



+,,u%KKS!y))V%%ac%2 **  !	# *)r7  c                x   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        R4      pV P                  \        4      ;_uu_ 4       pVP                  VR\        R7       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r   r  rd  r  r^  Nzexpected an i16 type, got floatre  r3  s   &    r   $test_convert_from_fp16_f32_wrongtype:TestBuildInstructions.test_convert_from_fp16_f32_wrongtype  s    



+,,u%KKS!y))V%%acc%: *-  !	# *)   !B))B9	c                x   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        R4      pV P                  \        4      ;_uu_ 4       pVP                  VR\        R7       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r   r  rd  r  r^  NrZ  )rN   r   r   rd  r  r  rU  r`  rL  r#   r    r  r3  s   &    r   %test_convert_from_fp16_f32_wrongtype2;TestBuildInstructions.test_convert_from_fp16_f32_wrongtype2  s    



+,,u%KKS!y))V%%ace%< *,  !	# *)rk  c                .   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      p\        P                  ! \
        ^4      pVP                  W4RR7      pVP                  V4       V P                  VR4       R# )r   r  r   z}            my_block:
                %"c" = call i64 @"llvm.cttz.i64"(i64 5, i1 1)
                ret i64 %"c"
            N)	rN   r   r   rd  r   r=  cttzr  rg   r  s   &     r   	test_cttzTestBuildInstructions.test_cttz  rT  r   c                   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      p\        P                  ! \
        ^4      pV P                  \        4      ;_uu_ 4       pVP                  W4RR7       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r   r  r   Nzexpected an i1 type, got i32)rN   r   r   rd  r   rC   r  rU  rp  r#   r    r  r   rN   r   r  r  r4  s   &     r   test_cttz_wrongflag)TestBuildInstructions.test_cttz_wrongflag  s    



+,,u%KKq!KKq!y))VLLCL( **  !	# *)   <B??C	c                   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      p\        P                  ! \
        ^4      pV P                  \        4      ;_uu_ 4       pVP                  W4RR7       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; ir2  )rN   r   r   rd  r  r=  r  rU  rp  r#   r    r  rt  s   &     r   test_cttz_wrongtype)TestBuildInstructions.test_cttz_wrongtype  s    



+,,u%KKQKKa y))VLLCL( *1  !	# *)rw  c                f   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      p\        P                  ! \        ^4      p\        P                  ! \        ^4      pVP                  W4VRR7      pVP                  V4       V P                  VR4       R# )r   r  fmaz            my_block:
                %"fma" = call float @"llvm.fma.f32"(float 0x4014000000000000, float 0x3ff0000000000000, float 0x4000000000000000)
                ret float %"fma"
            N)rN   r   r   rd  r  r|  r  rg   )r   rN   r   r  r  r   r|  s   &      r   test_fmaTestBuildInstructions.test_fma  s    



+,,u%KKQKKQKKQkk!k.C ! 	r   c           	        V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      p\        P                  ! \        ^4      p\        P                  ! \        ^4      pV P                  \        4      ;_uu_ 4       pVP                  W4VRR7       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r   r  r|  Nz(expected an floating point type, got i32)rN   r   r   rd  rC   r  rU  r|  r#   r    r  r   rN   r   r  r  r   r4  s   &      r   test_fma_wrongtype(TestBuildInstructions.test_fma_wrongtype  s    



+,,u%KKq!KKq!KKq!y))VKKaeK, *6  !	# *)   CC+	c           	        V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^4      p\        P                  ! \
        ^4      p\        P                  ! \        ^4      pV P                  \        4      ;_uu_ 4       pVP                  W4VRR7       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r   r  r|  Nz7expected types to be the same, got float, double, float)rN   r   r   rd  r  rD   r  rU  r|  r#   r    r  r  s   &      r   test_fma_mixedtypes)TestBuildInstructions.test_fma_mixedtypes  s    



+,,u%KKQKKQKKQy))VKKaeK, *E  !	# *)r  c                V    R  pR F  p\         P                  ! V! V4      4       K!  	  R# )c                    \         P                  ! \         P                  ! ^ 4      \         P                  ! ^ 4      P                  4       \         P                  ! ^ 4      .4      p\         P                  ! 4       p\         P
                  ! W!RR7      pVP                  4       pVP                  4       pVP                  4       p\         P                  ! 4       pVP                  V4       VP                  V4       VP                  V4       VP                  \         P                  ! ^ 4      4      pVP                  \         P                  ! VP                  ^ 4      V4       VP                  \         P                  ! ^ 4      4      p	V	P                  \         P                  ! V	P                  ^ 4      V4       VP                  ^ ,          P                  V 4       VP!                  VP                  ^ ,          V.4      p
VP#                  V
4      pVP%                  W4      pV	P                  W4       VP%                  V\         P                  ! VP                  ^4      4      pVP                  W4       VP'                  RWP                  ^,          4      pVP)                  WV4       VP                  V4       VP+                  V4       \-        V4      # )    r  r  r%  )r   rB   rP  r   r=   rF   rL   r   r#  r  rG  rH  rd  r$  r   r   r\  rR  r   r+  r  r  r    )	attr_namerH   r?   rM   bb_entrybb_loopbb_exitr   indexaccumrX  valueaddedindexp1conds   &              r   gen_code;TestBuildInstructions.test_arg_attributes.<locals>.gen_code!  s   ??2::b>BJJrN4M4M4O46JJrN4D EDYY[F;;v%8D..0H--/G--/GllnG##H-NN7###G,KK

2/Er{{5::q98DKK

2/Er{{5::q98DIIaL&&y1++diilUG4CLL%EKK-Eu.kk%UZZ)CDGw0((gyy|DDOOD73##G,KKv;r   N)byrefbyvalelementtypeimmarginallocainregnestr   	nocapturenofreer   noundefpreallocatedreturnedsignext
swiftasync
swifterror	swiftselfr   )r*   r+   )r   r  r  s   &  r   test_arg_attributes)TestBuildInstructions.test_arg_attributes   s)    &	P
I,  34-
r   r}   N)?r   r   r   r   r   maxDiffr  r  r  r	  r  r  r   r-  r:  rA  rK  rY  r^  rf  ri  rm  rw  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r*  r/  r5  r>  rD  rH  rN  rR  rW  r[  ra  rf  ri  rm  rq  ru  ry  r}  r  r  r  r   r   r   s   @r   r  r  I  s6     G=/b($#J+ZHT*04<KZ0d(	
 *&P&$L6@69(T:
8-t
	#6


	#
	#	#	#
#
###?5 ?5r   r  c                   f   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tR tRtV tR# )TestBuilderMiscic  z5
Test various other features of the IRBuilder class.
c                   V P                  R R7      p\        P                  ! V4      pV P                  VP                  VP
                  4       V P                  VP                  \        P                  4       V P                  VP                  VP
                  P                  4       V P                  VP                  \        P                  4       R# )r  r  N)
rN   r   r   r5   rI   r  assertIsInstancerF   r?   r=   rC  s   &  r   r  TestBuilderMisc.test_attributesh  s    


(,,u%g&&5g..<gnnell&9&9:gnnbii8r   c           	     6   V P                  R R7      p\        P                  ! V4      pVP                  P                  R,          w  r4VP                  W4R4       VP                  RR7      pVP                  V4      ;_uu_ 4        VP                  W4R4       VP                  4       ;_uu_ 4        VP                  W4R4       RRR4       VP                  W4R4       VP                  V4       RRR4       VP                  W4R	4       VP                  V4      ;_uu_ 4        VP                  W4R
4       RRR4       V P                  VR4       V P                  VR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L\; i)r   r  r  r   r  r  r  Nr  r  r  z            my_block:
                %"c" = add i32 %".1", %".2"
                %"e" = sub i32 %".1", %".2"
                %"g" = mul i32 %".1", %".2"
            z            foo:
                %"d" = fadd i32 %".1", %".2"
                %"f" = fsub i32 %".1", %".2"
                %"h" = fmul i32 %".1", %".2"
                br label %"foo"
            )rN   r   r   rI   r   r   rL   
goto_blockr  goto_entry_blockr   r  r  r  r  rg   )r   rN   r   r  r  bb_news   &     r   test_goto_blockTestBuilderMisc.test_goto_blockp  s4   



+,,u%$$R(A#+++7''LLs#))++A#& ,LLs#NN6" ( 	A#''LLs# ( ! 	 	 " 	 ,+ (' ('s0   +E50E"	+E5!F"E2-E55F	F	c                   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^ 4      pVP                  W3R4      pVP                  V4      ;_uu_ 4       pVP                  W3R4       RRR4       V P                  VP                   X4       VP                  W3R4      pVP                  V4      ;_uu_ 4        VP                  W3R4       VP                  V4       RRR4       V P                  VP                  R4       R#   + '       g   i     L; i  + '       g   i     LA; i)oner  r  r  Nr   r  a              one:
                %"a" = add i1 0, 0
                br i1 %"a", label %"one.if", label %"one.endif"
            one.if:
                %"b" = add i1 0, 0
                br label %"one.endif"
            one.endif:
                %"c" = add i1 0, 0
                br i1 %"c", label %"one.endif.if", label %"one.endif.endif"
            one.endif.if:
                %"d" = add i1 0, 0
                br label %"one"
            one.endif.endif:
            )rN   r   r   rd  r=  r   if_thenr5   r  r{   rI   )r   rN   r   rV  r  bbendr   s   &      r   test_if_thenTestBuilderMisc.test_if_then  s    


&,,u%KKa KKc"__Q5KKc"   	gmmU+KKc"__QKKc"NN5!   	W-- 0 	  
  s   /D$D.D+	.D>	c           	     $   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^ 4      pVP                  W3R4      pVP                  V4      ;_uu_ 4        VP                  W3R4      pVP                  V4      ;_uu_ 4        VP                  W3R4       RRR4       RRR4       VP                  4        V P                  VP                  R4       R#   + '       g   i     LF; i  + '       g   i     LQ; i)r  r  r  r  r   Na              one:
                %"a" = add i1 0, 0
                br i1 %"a", label %"one.if", label %"one.endif"
            one.if:
                %"b" = add i1 0, 0
                br i1 %"b", label %"one.if.if", label %"one.if.endif"
            one.endif:
                ret void
            one.if.if:
                %"c" = add i1 0, 0
                br label %"one.if.endif"
            one.if.endif:
                br label %"one.endif"
            )
rN   r   r   rd  r=  r   r  r   r{   rI   )r   rN   r   rV  r  r  s   &     r   test_if_then_nested#TestBuilderMisc.test_if_then_nested  s    


&,,u%KKa KKc"__QA#&A##A#& $   	W-- 0 	 $#  s$   /,C?C,	.C?,C<7C??D	c           	     d   R
pV P                  VR7      p\        P                  ! V4      p\        P                  ! \        ^ 4      pVP                  WDR4      pVP                  V4      ;_uu_ 4        VP                  WDR4      pVP                  V4      ;_uu_ 4        VP                  WDR4       RRR4       RRR4       VP                  4        V P                  VP                  RP                  WR,          R,           R	7      4       R#   + '       g   i     Ld; i  + '       g   i     Lo; i)Longr  r  r  r   Na              {full_label}:
                %"a" = add i1 0, 0
                br i1 %"a", label %"{label}.if", label %"{label}.endif"
            {label}.if:
                %"b" = add i1 0, 0
                br i1 %"b", label %"{label}.if.if", label %"{label}.if.endif"
            {label}.endif:
                ret void
            {label}.if.if:
                %"c" = add i1 0, 0
                br label %"{label}.if.endif"
            {label}.if.endif:
                br label %"{label}.endif"
            :N   Nz..)
full_labellabelPLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong)rN   r   r   rd  r=  r   r  r   r{   rI   r   )r   r  rN   r   rV  r  r  s   &      r   test_if_then_long_label'TestBuilderMisc.test_if_then_long_label  s     




+,,u%KKa KKc"__QA#&A##A#& $   	W-- 0 *sOd4JK	M $#  s$   1,DD	0DDDD/	c                   a  V 3R  lpV! R4      pS P                  VP                  R4       V! R4      pS P                  VP                  R4       R# )c                    < SP                  R R7      p\        P                  ! V4      p\        P                  ! \        ^ 4      pVP                  W0R7      ;_uu_ 4         RRR4       SP                  VR4       V#   + '       g   i     L$; i)r  r  likelyNzp                one:
                    br i1 0, label %"one.if", label %"one.endif", !prof !0
                )rN   r   r   rd  r=  r  rg   )r  rN   r   rV  r   s   &   r   r  2TestBuilderMisc.test_if_then_likely.<locals>.check  so    JJEJ*Ell5)GD!$A22 3U %  N 32s   A==B	TC            !0 = !{ !"branch_weights", i32 99, i32 1 }
            FC            !0 = !{ !"branch_weights", i32 1, i32 99 }
            Nrt   r?   r   r  r   s   f  r   test_if_then_likely#TestBuilderMisc.test_if_then_likely  sP    
	 +GNN - 	 ,GNN - 	r   c           	     ~   V P                  R R7      p\        P                  ! V4      p\        P                  ! \        ^ 4      pVP                  W3R4      pVP                  V4      ;_uu_ 4       w  rVV;_uu_ 4        VP                  W3R4       RRR4       V;_uu_ 4        VP                  W3R4       RRR4       RRR4       VP                  V4      ;_uu_ 4       w  rVV;_uu_ 4        VP                  V4       RRR4       V;_uu_ 4        VP                  4        RRR4       RRR4       V P                  VP                  R4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i)r  r  r  r  Nr   a)              one:
                %"a" = add i1 0, 0
                br i1 %"a", label %"one.if", label %"one.else"
            one.if:
                %"b" = add i1 0, 0
                br label %"one.endif"
            one.else:
                %"c" = add i1 0, 0
                br label %"one.endif"
            one.endif:
                br i1 %"a", label %"one.endif.if", label %"one.endif.else"
            one.endif.if:
                br label %"one"
            one.endif.else:
                ret void
            one.endif.endif:
            )rN   r   r   rd  r=  r   if_elser  r   r{   rI   )r   rN   r   rV  r  thenr  s   &      r   test_if_elseTestBuilderMisc.test_if_else  s   


&,,u%KKa KKc"__Q#4DA#& A#&    __Q#4Du%   "    	W-- 0 	      sx   /E3<E	E3!E 	4E3F,*F	<F,F	F,EE3 E0+E33F	FF,F)$F,,F<	c                   a  V 3R  lpV! R4      pS P                  VP                  R4       V! R4      pS P                  VP                  R4       R# )c           	        < SP                  R R7      p\        P                  ! V4      p\        P                  ! \        ^ 4      pVP                  W0R7      ;_uu_ 4       w  rEV;_uu_ 4        VP                  V4       RRR4       V;_uu_ 4        VP                  4        RRR4       RRR4       SP                  VP                  R4       V#   + '       g   i     LY; i  + '       g   i     LI; i  + '       g   i     LT; i)r  r  r  Nz                one:
                    br i1 0, label %"one.if", label %"one.else", !prof !0
                one.if:
                    br label %"one"
                one.else:
                    ret void
                one.endif:
                )
rN   r   r   rd  r=  r  r  r   r{   rI   )r  rN   r   rV  r  r  r   s   &     r   r  2TestBuilderMisc.test_if_else_likely.<locals>.check	  s    JJEJ*Ell5)GD!$A226GtTNN5) Y$$&  3
   !1!1 4  N TY 32s<   C5,C	>C5C"	!C5CC5"C2-C55D	Tr  Fr  Nr  r  s   f  r   test_if_else_likely#TestBuilderMisc.test_if_else_likely	  sP    	& +GNN - 	 ,GNN - 	r   c                J   V P                  4       p\        P                  ! 4       p\        P                  ! \        ^ 4      pVP                  RR7      pVP                  RR7      pVP                  RR7      pVP                  V4       VP                  W3R4       VP                  V4       VP                  W3R4       VP                  W3R4       VP                  V4       VP                  W3R4      pVP                  W3R	4       VP                  V4       VP                  W3R
4      pVP                  V4       VP                  W3R4       VP                  V4       VP                  W3R4       V P                  VR4       V P                  VR4       V P                  VR4       R# )z9
Test IRBuilder.position_{before,after,at_start,at_end}.
r  r  twothreer  r  r  r  r  r  r  r   z            one:
                %"a" = add i32 0, 0
                %"c" = add i32 0, 0
                %"b" = add i32 0, 0
            z            two:
                %"o" = add i32 0, 0
                %"q" = add i32 0, 0
                %"p" = add i32 0, 0
                %"m" = add i32 0, 0
                %"n" = add i32 0, 0
            z            three:
            N)rI   r   r   rd  rC   rL   position_at_startr   r#  position_afterposition_beforerg   )	r   rM   r   rV  bb_onebb_twobb_threer  r  s	   &        r   test_positioning TestBuilderMisc.test_positioning7	  sn    }},,.KKq!((e(4((e(4***8!!&)A#'A#A#!!&)KKc"A#'KKc"q!A#"A# " 	 	 " 	 	 $ 	r   c                   V P                  4       p\        P                  ! 4       pVP                  R R7      pVP	                  V4       \        P
                  ! \        R4      pVP                  WDR4      pVP                  4       pV P                  VP                  4       VP                  V4       V P                  VP                  4       VP                  WUR4      pVP                  WwR4      pVP                  V4       VP                  4        V P                  VP                  4       V P                  VR4       R# )entryr  i  r  r  r   z            entry:
                %"a" = add i32 1234, 1234
                %"b" = mul i32 %"a", %"a"
                ret void
        N)rI   r   r   rL   r#  rd  rC   r   r   r@  r  remover  r  rg   )	r   rM   r   blkr  r  retvoidr  r   s	   &        r   test_instruction_removal(TestBuilderMisc.test_instruction_removalg	  s    }},,.%%7%3$KKt$KKc"""$))*w**+KKc"KKc"q))*  	r   c                P   V P                  R R7      p\        P                  ! V4      pVP                  P	                  . 4      Vn        VP                  \        P                  ! \        4      RR7       \        '       g   V P                  VR4       R# V P                  VR4       R# )r   r  r   zY                my_block:
                    %"c" = alloca ptr, !dbg !0
                zZ                my_block:
                    %"c" = alloca i32*, !dbg !0
                N)rN   r   r   r?   r   debug_metadatarP  rE   rC   r   rg   rC  s   &  r   test_metadataTestBuilderMisc.test_metadata~	  s    



+,,u%!(!<!<R!@r~~e,37..U % 
 U % r   r}   N)r   r   r   r   r   r  r  r  r  r  r  r  r  r  r  r  r   r   r   s   @r   r  r  c  sI     9:<6M6*"H:.`. r   r  c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tRtV tR# )	TestTypesi	  c                    \        V\        P                  4      '       d   VP                  pK.  \        V\        P                  4      '       * # r   )
isinstancer   rE   rl  	LabelType)r   tys   &&r   has_logical_equalityTestTypes.has_logical_equality	  s0    R^^,,Bb",,///r   c                   \         P                  ! 4       p\         P                  ! 4       \         P                  ! 4       \         P                  ! \
        \        \        34      \         P                  ! \
        \        34      \         P                  ! \
        \        3RR7      \         P                  ! \        \        34      \
        \        \        \        \        \         P                  ! \        ^4      \         P                  ! \        ^4      \         P                  ! \        ^4      \         P                  ! \
        \        34      \         P                  ! \        \
        34      VP                  R4      VP                  R4      .pY" Uu. uFK  p\        V\         P                  \         P                  34      '       d   K5  \         P                  ! V4      NKM  	  up,          pV# u upi )z#
A bunch of mutually unequal types
Tr   MyType1MyType2)r   Contextr  r}  rB   r=  r   rC   r  rD   r  rb  get_identified_typer  rE   )r   contextr  tps   &   r   assorted_typesTestTypes.assorted_types	  s;   
 **,LLNBKKMOOD4,/w1OOOD4'48OOD4'*$sCLLa ",,sA"6S!8L  $.0D0DdFJFL 1M''	2''	2
 	u Fu#Bbll(CD %"..$u F 	F Fs   2G(G(c                    V P                  4       pV F>  pV P                  V4      pV P                  V4      '       g   K-  V P                  W24       K@  	  R # r   )r  r:   r  r7   )r   r  r  newtys   &   r   r   TestTypes.test_pickling	  sI    ##%B004E((,,  + r   c                   V P                  4       p\        P                  ! W4       F6  w  r#W#Jg   K  V P                  W#8H  W#34       V P	                  W#8g  W#34       K8  	  V F  p\
        P
                  ! V4      pV P                  V4      '       d-   V P	                  WE8H  WE34       V P                  WE8g  WE34       K\  V P                  WE8H  WE34       V P	                  WE8g  WE34       K  	  R # r   )r  	itertoolsproductr  r@  copyr  )r   r  r  r  r  r  s   &     r   test_comparisonsTestTypes.test_comparisons	  s    ##%%%e3DAz  !0/ 4
 BIIbME((,,b[9  rk:  rk:b[9 r   c                  a  R \         P                  ! 4       R\         P                  ! ^R7      R\         P                  ! \        4      R\         P                  ! \        ^R7      R\         P                  ! \        4      R\         P                  ! \        ^R7      /pV 3R lpV 3R lpVP	                  4        FL  pS P                  4        F-  p\        V\         P                  4      '       d   K%  V! WE4       K/  	  V! WD4       KN  	  V! VR ,          VR,          4       V! VR ,          VR,          4       V! VR ,          VR,          4       V! VR ,          VR,          4       V! VR ,          VR,          4       V! VR,          VR,          4       V! VR,          VR,          4       V! VR,          VR,          4       V! VR,          VR,          4       V! VR,          VR,          4       V! VR,          VR,          4       V! VR,          VR,          4       V! VR,          VR,          4       V! VR,          VR,          4       V! VR,          VR,          4       R	# )
op_a0op_a1r  tp_i1_a0tp_i1_a1tp_i8_a0tp_i8_a1c                    < SP                  W8H  W34       SP                  W8H  W34       SP                  W8g  W34       SP                  W8g  W34       R # r   )r@  r  ptr1ptr2r   s   &&r   	assert_eq1TestTypes.test_ptr_comparisons.<locals>.assert_eq	  sO    OODL4,7OODL4,7T\D<8T\D<8r   c                    < SP                  W8H  W34       SP                  W8H  W34       SP                  W8g  W34       SP                  W8g  W34       R # r   )r  r@  r  s   &&r   	assert_ne1TestTypes.test_ptr_comparisons.<locals>.assert_ne	  sO    T\D<8T\D<8OODL4,7OODL4,7r   N)r   rE   r=  r   valuesr  r  )r   ptrsr  r  rX  r  s   f     r   test_ptr_comparisonsTestTypes.test_ptr_comparisons	  s    R^^%R^^a0t,tq9t,tq9
	9	8 ;;=C,,.!%88c) / c ! 	$w-g/$w-j!12$w-j!12$w-j!12$w-j!12$w-j!12$w-j!12$w-j!12$w-j!12$z"D$45$z"D$45$z"D$45$z"D$45$z"D$45$z"D$45r   c                h   \         P                  ! 4       p\         P                  ! ^R7      pV P                  VP                  4       V P                  VP                  4       V P	                  \        V4      R4       V P	                  \        V4      R4       VP                  4       pVP                  4       pVP                  ^R7      pV P                  VP                  4       V P                  VP                  4       V P                  VP                  4       V P	                  \        V4      R4       V P	                  \        V4      R4       V P	                  \        V4      R4       \         P                  ! ^ 4      P                  4       p\         P                  ! ^ 4      P                  ^R7      pV P                  VP                  '       * 4       V P                  VP                  '       * 4       \        '       d8   V P	                  \        V4      R4       V P	                  \        V4      R4       M6V P	                  \        V4      R4       V P	                  \        V4      R4       VP                  4       pVP                  4       p	VP                  ^R7      p
V P                  VP                  '       * 4       V P                  V	P                  '       * 4       V P                  V
P                  '       * 4       \        '       dT   V P	                  \        V4      R4       V P	                  \        V	4      R4       V P	                  \        V
4      R	4       R
# V P	                  \        V4      R4       V P	                  \        V	4      R4       V P	                  \        V
4      R4       R
# )r  r  rX  zptr addrspace(2)zptr addrspace(3)i32*zi32 addrspace(2)*i32**zi32 addrspace(2)**zi32 addrspace(2)* addrspace(3)*N)	r   rE   r@  	is_opaquer7   r    r   rP  r   )r   rX  r  ptr_ptrptr2_ptr	ptr2_ptr3tptrtptr2tptr_ptr	tptr2_ptr
tptr2_ptr3s   &          r   test_pointersTestTypes.test_pointers	  s   nn~~*&'S5)T$67 .."??$OOaO0	))***+	++,Wu-X.Y);< zz"~((*

2))A)6DNN*+EOO+,**SY/SZ)<=SY.SZ);< ??$$$&	%%%2
H.../I///0J0001**S]G4S^-ABS_.OPS]E2S^U3S_.@Ar   c                   V P                  \        P                  ! 4       P                  R 4       V P                  \        P                  ! ^R7      P                  R4       \        '       gl   V P                  \        P                  ! \
        4      P                  R 4       V P                  \        P                  ! \
        ^4      P                  R4       R# V P                  \        P                  ! \
        4      P                  R4       V P                  \        P                  ! \
        ^4      P                  R4       R# )p0r  p1p0i1p1i1N)r7   r   rE   intrinsic_namer   r=  r>   s   &r   test_ptr_intrinsic_name!TestTypes.test_ptr_intrinsic_name7
  s    )88$?!4CCTJ..R^^D1@@$GR^^D!4CCTJR^^D1@@&IR^^D!4CCVLr   c                   V P                  \        \        4      R4       V P                  \        \        P                  ! ^4      4      R4       V P                  \        \
        4      R4       V P                  \        \        4      R4       V P                  \        \        P                  ! 4       4      R4       V P                  \        \        P                  ! \        R#4      4      R4       V P                  \        \        P                  ! \        \
        34      4      R4       V P                  \        \        P                  ! \        \
        \        34      4      R4       V P                  \        \        P                  ! \        R#R	R
7      4      R4       V P                  \        \        P                  ! \        \
        3R	R
7      4      R4       V P                  \        \        P                  ! \        \
        \        3R	R
7      4      R4       \        '       g|   V P                  \        \        P                  ! \        4      4      R4       V P                  \        \        P                  ! \        P                  ! \        4      4      4      R4       MzV P                  \        \        P                  ! \        4      4      R4       V P                  \        \        P                  ! \        P                  ! \        4      4      4      R4       V P                  \        \        P                  ! \        ^4      4      R4       \        '       g   V P                  \        \        P                  ! \        P                  ! \        4      ^4      4      R4       V P                  \        \        P                  ! \        P                  ! \        ^4      4      4      R4       MV P                  \        \        P                  ! \        P                  ! \        4      ^4      4      R4       V P                  \        \        P                  ! \        P                  ! \        ^4      4      4      R4       V P                  \        \        P                  ! \        34      4      R4       V P                  \        \        P                  ! \        \
        34      4      R4       \        '       gi   V P                  \        \        P                  ! \        P                  ! \        4      \        P                  ! \        \        34      34      4      R4       MgV P                  \        \        P                  ! \        P                  ! \        4      \        P                  ! \        \        34      34      4      R4       V P                  \        \        P                  ! \        3R	R7      4      R4       V P                  \        \        P                  ! \        \
        3R	R7      4      R4       \        P                  ! 4       pVP!                  R4      pV P                  \        V4      R4       VP!                  R4      pV P                  \        V4      R4       VP!                  R 4      pV P                  \        V4      R!4       R"# )$z*
Test the string representation of types.
i1i29rW  doublevoidzi1 ()z
i1 (float)zi1 (float, double)Tr   zi1 (...)zi1 (float, ...)zi1 (float, double, ...)rX  r  r   z[5 x i1]z	[5 x ptr]z	[5 x i1*]z	[5 x i1]*z{i1}z{i1, float}z{ptr, {i32, i8}}z{i1*, {i32, i8}})packedz<{i1}>z<{i1, float}>MyTypez	%"MyType"zMyType\z%"MyType\5c"zMyType"z%"MyType\22"Nr}   )r7   r    r=  r   rP  r  rD   r}  rB   r   rE   rC   r  rb  r   r  r  )r   r  mytypemytype1mytype2s   &    r   test_strTestTypes.test_strA
  sk    	TD)RZZ^,e4S7+S8,R[[]+V4R__T267AR__TC6:;\JR__TC:>?-	/R__T2tDE#	%R__TC64HI*	,R__TC:tLM2	4..S!67?Su0E!FGOS!67@Su0E!FG$&R\\$23Z@..SbnnT.BA!FG(*ST10E!FGOSbnnT.BA!FG(*ST10E!FG(*R114':;VDR114+>?O..S!5!5t$b&:&:E4=&I7K "L M"$ S!5!5t$b&:&:E4=&I7K "L M"$ 	R114'$GH!	#R114+dKL(	* **,,,X6Vm4--j9W'89--j9W'89r   c           	         \        V P                  V P                  4       4       F;  pV P                  \	        V4      \	        \
        P
                  ! V4      4      4       K=  	  R # r   )filterr  r  r7   hashr  )r   typs   & r   	test_hashTestTypes.test_hash}
  sD    $33T5H5H5JKCT#YTYYs^(<= Lr   c                  a  V 3R  lpV 3R lp\         P                  ! \        4      p\        ^4       F  pV! W4\        4       K  	  V! V4       \         P                  ! \
        ^4      p\        ^4       F  pV! W4\
        4       K  	  V! V4       \         P                  ! \        \         P                  ! \
        \        34      34      pV! V^ \        4       V! V^\         P                  ! \
        \        34      4       S P                  \        4      ;_uu_ 4        VP                  \         P                  ! \        ^4      4       RRR4       V! V4       \         P                  ! 4       p\         P                  ! VR4      pVP                  \        \         P                  ! \
        \        34      4       V! V^ \        4       V! V^\         P                  ! \
        \        34      4       S P                  \        4      ;_uu_ 4        VP                  \         P                  ! \        ^4      4       RRR4       V! V4       R#   + '       g   i     EL	; i  + '       g   i     L.; i)c                 ~   < V P                  \        P                  ! \        V4      4      pSP	                  W24       R # r   )r\  r   rd  rC   r7   )r  r  r^   ro   r   s   &&& r   check_constant*TestTypes.test_gep.<locals>.check_constant
  s*    VVBKKq12FV.r   c                    < \         P                  ! \        R 4      pSP                  \        4      ;_uu_ 4        V P                  V4       RRR4       R#   + '       g   i     R# ; i)g      ?N)r   rd  rD   r  rU  r\  )r  r  r   s   & r   check_index_type,TestTypes.test_gep.<locals>.check_index_type
  s>    KKS)E""9--u .---s   AA'	Nr:  )r   rE   rD   ranger  r=  rb  r   r  
IndexErrorr\  rd  rC   r  IdentifiedStructTypeset_body)r   rH  rK  r  r  r  s   f     r   r^  TestTypes.test_gep
  s   	/	
 ^^C qA2#& \\$"qA2$' !!3(<(<dD\(J"KLr1c"r1b22D$<@Az**FF2;;ua() +**,$$Wh7
C--tTl;<r1c"r1b22D$<@Az**FF2;;ua() + +** +*s   +I	+I	I	I-	c                r  a a \         P                  ! R 4      oV V3R lpV! \        ^4       V! \        ^4       V! \        ^4       V! \
        P                  ! \        ^4      ^4       V! \
        P                  ! \        ^4      ^4       V! \
        P                  ! \        \        \        34      ^4       R# )%e-m:e-i64:64-f80:128-n8:16:32:64-S128c                 J   < SP                  V P                  S4      V4       R # r   )r7   get_abi_sizer  r^   r   tds   &&r   r  &TestTypes.test_abi_size.<locals>.check
  s    R__R0(;r   N
r*   create_target_datar   rC   r   r   r  rb  rD   r  r   r  rW  s   f @r   test_abi_sizeTestTypes.test_abi_size
  sy    $$%LM	<dAeQeQbll4#Q'bll5!$b)b""Cc?3R8r   c                r  a a \         P                  ! R 4      oV V3R lpV! \        R4       V! \        R4       V! \        R4       V! \
        P                  ! \        ^4      R4       V! \
        P                  ! \        ^4      R4       V! \
        P                  ! \        \        \        34      R4       R# )rS  c                 J   < SP                  V P                  S4      V4       R # r   )r#   get_abi_alignmentrV  s   &&r   r  +TestTypes.test_abi_alignment.<locals>.check
  s    MM"..r2H=r   N)rp  r  rz  )rz  )   rY  r[  s   f @r   test_abi_alignmentTestTypes.test_abi_alignment
  s|    $$%LM	>dIeTeTbll4#Y/bll5!$d+b""Cc?3T:r   c                   \         P                  ! 4       pVP                  R 4      p\         P                  ! VR7      pV P	                  VP
                  4       V P                  V4       \        V4      pVP                  \         P                  ! ^ 4      \         P                  ! ^@4      \         P                  ! 4       4       V P                  VP
                  4       V P                  V4       V P                  V\        V4      4       R# )r:  r  N)r   r  r  r=   r@  r!  r-   r    rP  rP  rc  r  assertNotEqual)r   r  r;  r?   oldstrs   &    r   test_identified_struct TestTypes.test_identified_struct
  s    **,,,X67+(()V$V

2

2G))*V$FCK0r   c                   \         P                  ! R 4      p\        P                  ! 4       pVP	                  RR4      p\        P
                  ! VR7      pV P                  VP                  4       V P                  V4       \        V4      pVP                  \        P                  ! ^4      \        P                  ! ^@4      \        P                  ! 4       4       V P                  VP                  V^V4      ^4       V P                  VP                  4       V P                  V4       V P!                  V\        V4      4       R# )rS  r:  Trf  N)r*   rZ  r   r  r  r=   r@  r!  r-   r    rP  rP  rc  r7   get_element_offsetr  rg  )r   rW  r  r;  r?   rh  s   &     r   test_identified_struct_packed'TestTypes.test_identified_struct_packed
  s    $$%LM**,,,Xt<7+(()V$V

2

2G222q'BAF))*V$FCK0r   c                    \         P                  ! 4       pVP                  R 4      p\         P                  ! ^ 4      .Vn        \
        P                  ! R4      pV P                  VP                  W1R7      ^4       R# )r:  rS  rf  N)	r   r  r  rP  elementsr*   rZ  r7   rU  )r   r  r;  rW  s   &   r   $test_target_data_non_default_context.TestTypes.test_target_data_non_default_context
  s^    **,,,X6::b>*$$%LM,,R,A1Er   c                    \         P                  ! \         P                  ! ^ 4      ^4      pV P                  \	        V4      R4       R# )r  z	<8 x i32>N)r   r!  rP  r7   r    )r   r&  s   & r   test_vectorTestTypes.test_vector
  s.    bjjna0U[1r   r}   N)r   r   r   r   r  r  r   r  r  r*  r2  r>  rD  r^  r\  rc  ri  rm  rq  rt  r   r   r   s   @r   r  r  	  sa     0
.,: 96v6BpM::x>"H
9
;
11F2 2r   r  c                 8    \         P                  ! \        V 4      # r   )r   rd  rC   )r  s   &r   c32rw  
  s    ;;ua  r   c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"V t#R!# )"TestConstanti
  c                   \         P                  ! \        ^*4      pV P                  \	        V4      R4       \         P                  ! \
        ^4      pV P                  \	        V4      R4       \         P                  ! \
        ^ 4      pV P                  \	        V4      R4       \         P                  ! \
        R4      pV P                  \	        V4      R4       \         P                  ! \
        R4      pV P                  \	        V4      R4       \         P                  ! \
        \         P                  4      pV P                  \	        V4      R4       \         P                  ! \
        R	4      pV P                  \	        V4      R4       R	# )
*   zi32 42zi1 1zi1 0Ti1 trueFzi1 falsezi1 undefN)r   rd  rC   r7   r    r=  r  r   r   s   & r   test_integersTestConstant.test_integers
  s   KKr"Q*KKa Q(KKa Q(KKd#Q+KKe$Q,KKbll+Q,KKd#Q(r   c                   \         P                  ! \        R 4      pV P                  \	        V4      R4       \         P                  ! \        R4      pV P                  \	        V4      R4       \         P                  ! \
        R 4      pV P                  \	        V4      R4       \         P                  ! \
        R4      pV P                  \	        V4      R4       \         P                  ! \
        \         P                  4      pV P                  \	        V4      R4       \         P                  ! \
        R4      pV P                  \	        V4      R4       R# )	      ?zfloat 0x3ff8000000000000zfloat 0xbff8000000000000zdouble 0x3ff8000000000000zdouble 0xbff8000000000000zdouble undefNz
double 0.0g      )r   rd  r  r7   r    rD   r  r}  s   & r   
test_realsTestConstant.test_reals
  s    KKS!Q!;<KKT"Q!;<KKS!Q!<=KKT"Q!<=KKR\\*Q0KKT"Q.r   c           	        \         P                  ! \         P                  ! \        ^4      \	        ^4      \	        ^4      \	        ^4      34      pV P                  \        V4      R4       \         P                  ! \         P                  ! \        ^4      \	        ^4      \	        \         P                  4      34      pV P                  \        V4      R4       \         P                  P                  \	        ^4      \	        ^4      \	        \         P                  4      34      pV P                  \        V4      R4       V P                  \        4      ;_uu_ 4       p\         P                  P                  \	        ^4      \         P                  ! \        R4      34       RRR4       V P                  \        XP                  4      R4       \         P                  ! \         P                  ! \        ^4      \         P                  4      pV P                  \        V4      R4       \         P                  ! \         P                  ! \        ^4      R4      pV P                  \        V4      R4       \         P                  ! \         P                  ! \        ^4      \        R	4      4      pV P                  \        V4      R
4       \         P                  ! \         P                  ! \        ^4      \        R4      4      pV P                  \        V4      R4       \         P                  ! \         P                  ! \        ^4      ^\         P                  ^34      pV P                  \        V4      R4       V P                  \        4      ;_uu_ 4        \         P                  ! \         P                  ! \        ^4      R4       RRR4       R#   + '       g   i     EL6; i  + '       g   i     R# ; i)r  z[3 x i32] [i32 5, i32 6, i32 4]z[2 x i32] [i32 5, i32 undef]z#[3 x i32] [i32 5, i32 6, i32 undef]r  Nz$all elements must have the same typez[2 x i32] undefz[2 x i32] zeroinitializers   foobar_123z[11 x i8] c"foobar_123\80"s    z[4 x i8] c"\00\01\04\ff"z#[3 x i32] [i32 5, i32 undef, i32 6])      )r   rd  r  rC   rw  r7   r    r  literal_arrayr  rU  r  r  r   	bytearrayr   )r   r   r4  s   &  r   test_arraysTestConstant.test_arrays  s|   KKUA.QQQ0HIQ!BCKKUA.QR\\9J0KLQ!?@KK%%s1vs1vs2<<7H&IJQ!FGy))VKK%%s1vr{{3/D&EF *V--.?	A KKUA.=Q!23KKUA.5Q!<=KKT2.	:K0LMQ!>?KKT1-y9L/MNQ!<=KKUA.BLL!0DEQ!FGz**KKUA.7 +*% *))$ +**s   AO1OO	O0	c                .   \         P                  ! \         P                  ! ^ 4      ^4      p. ROp\         P                  ! W4      pRP	                  RP                  \        RP                  V4      4      4      pV P                  \        V4      V4       R# )r  z<8 x i32> <{}>z, zi32 {}N)rp  r  rz  r  rb  r  	      )	r   r!  rP  rd  r   r   r   r7   r    )r   r&  valsr'  vec_reprs   &    r   rt  TestConstant.test_vector%  sh    bjjna0'kk%&#**IIc(//4013S8,r   c                    \         P                  ! \         P                  ! ^ 4      R4      P                  pV P	                  V^ 4       R# )r  N)r   rd  rP  constantr7   )r   r  s   & r   test_non_nullable_int"TestConstant.test_non_nullable_int-  s0    ;;rzz"~t4==1%r   c                   \         P                  ! \        \        34      p\         P                  ! \        V34      p\         P
                  ! V\         P
                  ! \         P                  ! 4       R 4      \         P
                  ! \        R4      34      pV P                  \        V4      R4       \         P
                  P                  \         P
                  ! \         P                  ! 4       R 4      \         P
                  ! \        R4      34      pV P                  VP                  V4       V P                  \        V4      R4       \         P
                  P                  \         P
                  ! \         P                  ! 4       R 4      \         P
                  ! \        \         P                  4      34      pV P                  VP                  V4       V P                  \        V4      R4       \         P
                  ! V\         P                  4      pV P                  \        V4      R4       \         P
                  ! VR4      pV P                  \        V4      R4       \         P
                  ! VR4      pV P                  \        V4      R4       \         P
                  ! V^*V34      pV P                  \        V4      R4       \         P
                  ! VR	4      pV P                  \        V4      \        V4      4       V P                  \        4      ;_uu_ 4        \         P
                  ! VR
4       RRR4       R#   + '       g   i     R# ; i)r  T/{float, i1} {float 0x3ff8000000000000, i1 true}z0{float, i1} {float 0x3ff8000000000000, i1 undef}z{float, i1} undefNz{float, i1} zeroinitializerL{i32, {float, i1}} {i32 42, {float, i1} {float 0x3ff8000000000000, i1 true}}r  Tr{  r  rz  r  r  )r   rb  r  r=  rC   rd  rc  r7   r    literal_structr$  r  r  r   )r   st1st2r   c1c2c3s   &      r   test_structsTestConstant.test_structs1  sH   ""C;/""E3<0KKbkk",,.#> kk$57 8QJ	LKK&&BLLNC(H(*D$(?(A B%QJ	LKK&&BLLNC(H(*D",,(G(I J%QK	MKKR\\*Q!45KKT"Q!>?[[k*RJ	L[[r2h'R $J 	L[[/0R#b'*z**KKY' +***s   "MM	c                    \         P                  ! ^4      p\         P                  ! \         P                  ! W.4      \         P                  4      pV P                  V4       R# )rb  N)r   rP  rd  rb  r  r:   )r   r:  sts   &  r   &test_undefined_literal_struct_pickling3TestConstant.test_undefined_literal_struct_picklingS  s>    ZZ][[--rh7F$$R(r   c                   \        ^*4      pV P                  V\        P                  4       V P	                  \        V4      R4       \        R4      pV P                  V\        P                  4       V P	                  \        V4      R4       \        P                  ! \        ^4      pV! \        ^4      \        ^4      \        ^4      .4      pV P	                  \        V4      R4       V! . R	O4      pV P	                  \        V4      R4       V! R4      pV P	                  \        V4      R4       V P                  \        4      ;_uu_ 4        V! . R
O4       RRR4       \        P                  ! \        \        34      p\        P                  ! \        V34      pV! R4      pV P	                  \        V4      R4       V! R4      pV P	                  \        V4      R4       R#   + '       g   i     L; i)z0
Instantiating a type should create a constant.
zi8 42Tr|  z[3 x i32] [i32 4, i32 5, i32 6]Nz[3 x i32] zeroinitializerr  r  r  )rz  r  r  r  r  r  )r   r  r   rd  r7   r    r=  r  rC   rw  r  r   rb  r  )r   r   atr  r  s   &    r   test_type_instantiaton#TestConstant.test_type_instantiatonX  s~    Ha-Q)Ja-Q+\\%#AAA'(Q!BCyMQ!BCtHQ!<=z**| + ""C;/""E3<0Q #* 	,!"Q #I 	K +*s   G%%G5	c                R    \        ^*4      pV P                  \        V4      R4       R# )z(
Constants should have a useful repr().
z!<ir.Constant type='i32' value=42>N)rC   r7   r  r}  s   & r   r  TestConstant.test_reprv  s"     "Ia"EFr   c                   \         P                  ! \         P                  ! \         P                  ! ^4      R4      \	        \        R4      4      4      pV P                  4       p\         P                  ! W!P                  R4      pRVn	        Wn
        \        P                  ! \        V4      4      p\        P                  ! \        V4      4      pV P                  \        V4      \        V4      4       R# )rb     
myconstantTN)r   rd  r  rP  r  rM  r?   rb  r$  r  re  r*   r+   r    r7   )r   r   r  gvparsedreparseds   &     r   test_encoding_problem"TestConstant.test_encoding_problem}  s    KKRZZ]C8!%*-/KKMq&&,7! $$SV,&&s6{3Vc(m4r   c           	        V P                  4       p\        P                  ! \        \        34      p\        P
                  ! WR 4      pTP                  R Uu. uF  p\        P                  ! \        V4      NK   	  up4      p\        '       g   V P                  \        V4      R4       MV P                  \        V4      R4       V P                  VP                  \        P                  ! \        4      4       \        P                  ! VR4      pV P                  \        4      ;_uu_ 4        VP                  \        P                  ! \        ^ 4      .4       RRR4       \        P                  ! VP!                  4       R4      pVP                  \        P                  ! \        ^ 4      .4      p\        '       g   V P                  \        V4      R4       MV P                  \        V4      R4       V P                  VP                  \        P                  ! \        4      4       R# u upi   + '       g   i     L; i)r  z<getelementptr ({float, i1}, ptr @"myconstant", i32 0, i32 1)zEgetelementptr ({float, i1}, {float, i1}* @"myconstant", i32 0, i32 1)Nz,getelementptr ({float, i1}, ptr null, i32 0)z5getelementptr ({float, i1}, {float, i1}* null, i32 0)r   rp  )r?   r   rb  r  r=  rb  r\  rd  rC   r   r7   r    r$  rE   r  rU  r   )	r   r  r  r  rr  r   const	const_ptrr  s	   &        r   r^  TestConstant.test_gep  s   KKM!!3+.ql3FF6:6aBKKq)6:;..SV[] SVdf!56B%y))IIr{{5!,-. * KK6	]]BKKq123..SWKM SWTV!56+ ; *)s   $H*-,H//H?	c           	        V P                  4       p\        P                  ! \        \        34      p^p\        P
                  ! WRVR7      pV P                  VP                  V4       TP                  R Uu. uF  p\        P                  ! \        V4      NK   	  up4      pV P                  VP                  P                  V4       \        '       g   V P                  \        V4      R4       MV P                  \        V4      R4       V P                  VP                  \        P                  ! \        VR7      4       R# u upi )rz  r  r  zIgetelementptr ({float, i1}, ptr addrspace(4) @"myconstant", i32 0, i32 1)zRgetelementptr ({float, i1}, {float, i1} addrspace(4)* @"myconstant", i32 0, i32 1)Nr  )r?   r   rb  r  r=  rb  r7   r  r\  rd  rC   r$  r   r    rE   )r   r  r  r  r  rr  r   s   &      r   test_gep_addrspace_globalvar)TestConstant.test_gep_addrspace_globalvar  s    KKM!!3+.	qliHy1FF6:6aBKKq)6:;))95..SVJL SVKM 		!JK ;s   7$Ec                    \         P                  ! \        ^4      P                  \        4      pV P                  \        V4      R4       R# )rp  ztrunc (i64 1 to i32)N)r   rd  r   r  rC   r7   r    r}  s   & r   
test_truncTestConstant.test_trunc  s2    KKq!''.Q!78r   c                    \         P                  ! \        ^4      P                  \        4      pV P                  \        V4      R4       R# )rp  zzext (i32 1 to i64)N)r   rd  rC   r  r   r7   r    r}  s   & r   	test_zextTestConstant.test_zext  s2    KKq!&&u-Q!67r   c                    \         P                  ! \        R4      P                  \        4      pV P                  \        V4      R4       R# )rp  zsext (i32 -1 to i64)Nr1   )r   rd  rC   r  r   r7   r    r}  s   & r   	test_sextTestConstant.test_sext  s2    KKr"''.Q!78r   c                    \         P                  ! \        ^4      P                  \        4      pV P                  \        V4      R4       R# )rp  z*fptrunc (float 0x3ff0000000000000 to half)N)r   rd  r  r  r  r7   r    r}  s   & r   test_fptruncTestConstant.test_fptrunc  s2    KKQ'',Q!MNr   c                    \         P                  ! \        ^4      P                  \        4      pV P                  \        V4      R4       R# )rp  z*fpext (float 0x3ff0000000000000 to double)N)r   rd  r  r  rD   r7   r    r}  s   & r   
test_fpextTestConstant.test_fpext  s2    KKQ%%c*Q!MNr   c                ,   V P                  4       p\        P                  ! V\        R 4      pVP	                  \
        P                  4       4      p\        '       g   V P                  \        V4      R4       R# V P                  \        V4      R4       R# )r  z"bitcast (ptr @"myconstant" to ptr)z$bitcast (i32* @"myconstant" to i64*)N)
r?   r   rb  rC   rc  r   r   r   r7   r    )r   r  r  r   s   &   r   test_bitcastTestConstant.test_bitcast  sh    KKMq%6JJu'')*..SV%IJSV%KLr   c                    \         P                  ! \        ^4      P                  \        4      pV P                  \        V4      R4       R# )rp  z(fptoui (float 0x3ff0000000000000 to i32)N)r   rd  r  r  rC   r7   r    r}  s   & r   test_fptouiTestConstant.test_fptoui  2    KKQ&&u-Q!KLr   c                    \         P                  ! \        ^4      P                  \        4      pV P                  \        V4      R4       R# )rp  zuitofp (i32 1 to float)N)r   rd  rC   r  r  r7   r    r}  s   & r   test_uitofpTestConstant.test_uitofp  2    KKq!((-Q!:;r   c                    \         P                  ! \        ^4      P                  \        4      pV P                  \        V4      R4       R# )rp  z(fptosi (float 0x3ff0000000000000 to i32)N)r   rd  r  r  rC   r7   r    r}  s   & r   test_fptosiTestConstant.test_fptosi  r  r   c                    \         P                  ! \        ^4      P                  \        4      pV P                  \        V4      R4       R# )rp  zsitofp (i32 1 to float)N)r   rd  rC   r  r  r7   r    r}  s   & r   test_sitofpTestConstant.test_sitofp  r  r   c                   \         P                  ! \        P                  4       R 4      p\         P                  ! \        ^4      pVP                  \        4      pV P                  \        VP
                  \        4       V P                  \        VP
                  \        4       \        '       g   V P                  \        V4      R4       R # V P                  \        V4      R4       R # )Nzptrtoint (ptr null to i32)zptrtoint (i64* null to i32))r   rd  r   r   rC   r  r  rU  r  r   r7   r    )r   rX  r  r   s   &   r   test_ptrtoint_1TestConstant.test_ptrtoint_1  s    kk%**,d3kk%#LL)S\\59)S\\37..SV%ABSV%BCr   c                `   V P                  4       p\        P                  ! V\        R 4      pVP	                  \
        4      p\        '       gQ   V P                  \        V4      R4       V P                  \        RVP                  \
        P                  4       4       MOV P                  \        V4      R4       V P                  \        RVP                  \
        P                  4       4       \        P                  ! \        ^ 4      pV P                  \        RVP                  \
        4       R# )r  z#ptrtoint (ptr @"myconstant" to i64)z0can only ptrtoint\(\) to integer type, not 'ptr'z$ptrtoint (i32* @"myconstant" to i64)z2can only ptrtoint\(\) to integer type, not 'i64\*'z5can only call ptrtoint\(\) on pointer type, not 'i32'N)r?   r   rb  rC   r  r   r   r7   r    r   rU  r   rd  )r   r  r  r   r  s   &    r   test_ptrtoint_2TestConstant.test_ptrtoint_2  s    KKMq%6KK..SV%JK""C  "	$ SV%KL""E  "	$ [["DKK		r   c                   \         P                  ! \        ^4      p\         P                  ! \        R4      pVP	                  \
        P                  4       4      pV P                  \        VP                  \
        4       V P                  \        VP                  \
        P                  4       4       \        '       g   V P                  \        V4      R4       R# V P                  \        V4      R4       R# )rp  gQ	@zinttoptr (i32 1 to ptr)zinttoptr (i32 1 to i64*)N)r   rd  rC   r  r  r   r   r  rU  r   r7   r    )r   r  pir   s   &   r   test_inttoptrTestConstant.test_inttoptr  s    kk%#[[d#LL))+,)S\\59)R[[%2B2B2DE..SV%>?SV%?@r   c                    \         P                  ! \        ^4      pV P                  \	        VP                  4       4      R4       R# )rp  zsub (i32 0, i32 1)N)r   rd  rC   r7   r    r  r   r  s   & r   test_negTestConstant.test_neg  s-    kk%#SWWY)=>r   c                    \         P                  ! \        ^4      pV P                  \	        VP                  4       4      R4       R# )rp  zxor (i32 1, i32 -1)N)r   rd  rC   r7   r    r  r  s   & r   test_notTestConstant.test_not  s-    kk%#SXXZ*?@r   c                    \         P                  ! \        ^4      pV P                  \	        VP                  4       4      R4       R# )rp  zfneg (float 0x3ff0000000000000)N)r   rd  r  r7   r    r  r  s   & r   	test_fnegTestConstant.test_fneg#  s-    kk#q!SXXZ*KLr   c                   \         P                  ! \        ^4      p\         P                  ! \        ^4      pVP                  RVP                  RVP
                  RVP                  RVP                  RVP                  RVP                  RVP                  RVP                  R	VP                  R
VP                  RVP                  RVP                  R/pVP!                  4        F-  w  rEV P#                  \%        V! V4      4      VR,           4       K/  	  RRRRRRRRRRRR/pVP!                  4        F@  w  rg\%        VP'                  Wb4      4      pRV,           R,           p	V P#                  W4       KB  	  RRRRRRRRRRRR/pVP!                  4        F@  w  rg\%        VP)                  Wb4      4      pRV,           R,           p	V P#                  W4       KB  	  R # )!rp  r  r  r  r   r   r  r  r  r  r  orandr  z (i32 1, i32 2)r#  eqr$  ner'  ugtr(  uger%  ultr&  ulezicmp sgtsgesltsleN)r   rd  rC   r  r  r  r   r   r  r  r  r  r  r  r  r  itemsr7   r    r+  r,  )
r   r  r  oracler   iropcopr  ro   r^   s
   &         r   test_int_binopsTestConstant.test_int_binops'  s   kk%#kk%#''ECHHfchh''ECGGecgg((FCHHfchh((FCGGdchh''E	#
 HBSC\42C+CD ' dD#uc5$?IC**345F~(99HV. ( dDudE3tUDIC23F~(99HV. (r   c                   \         P                  ! \        ^4      p\         P                  ! \        ^4      pVP                  RVP                  RVP
                  RVP                  RVP                  R/pVP                  4        F0  w  rE\        V! V4      4      pVR,           pV P                  Wg4       K2  	  RRR	R
RRRRRRRR/pVP                  4        F@  w  r\        VP                  W4      4      pRV	,           R,           pV P                  Wg4       KB  	  RRR	RRRRRRRRR/pVP                  4        F@  w  r\        VP                  W4      4      pRV	,           R,           pV P                  Wg4       KB  	  R# )rp  r  r  r  r  r  z5 (float 0x3ff0000000000000, float 0x4000000000000000)r#  oeqr$  r  r'  ogtr(  oger%  r4  r&  olezfcmp uequner  r  r  r  N)r   rd  r  r  r  r  r  r  r  r    r7   r8  r9  )
r   r  r  r  r   r   ro   r^   r  r  s
   &         r   test_flt_binopsTestConstant.test_flt_binopsC  si   kk#q!kk#q!((FCHHfchh((FCHHf6HBC\F  < =HV.	 ' tUCeudE+IC))#34F~ *F GHV.	 ( tUCeudE+IC++C56F~ *F GHV.	 (r   r}   N)$r   r   r   r   r~  r  r  rt  r  r  r  r  r  r  r^  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r   s   @r   ry  ry  
  s     ) /8:-& (D)
K<G576L&989OOMM<M<
D8
A?AM/8/ /r   ry  c                   &   a  ] tR tRt o R tRtV tR# )TestTransformsib  c                   \         P                  ! 4       p\         P                  ! V\         P                  ! \         P                  ! 4       R4      R 4      p\         P                  ! V\         P                  ! \         P                  ! 4       R4      R4      p\         P
                  ! 4       pVP                  VP                  4       4       VP                  VR4      pV P                  VP                  V4       \         P                  ! WV4      pV P                  WV4       V P                  VP                  V4       V P                  VP                  V4       R# )r  r  Nr}   )r   r=   rF   rB   r}  r   r#  rL   r  r7   calleereplace_all_callsr#   rg  )r   r%   r  r  r   r  modifieds   &      r   test_call_transform"TestTransforms.test_call_transformc  s    iikkk#rr{{}bA5Ikk#rr{{}bA5I,,. 6 6 89||C$c*''#6d%DKK-c*r   r}   N)r   r   r   r   r  r   r   r   s   @r   r  r  b  s     + +r   r  c                   &   a  ] tR tRt o R tRtV tR# )TestSingletoniq  c                   V P                  \        P                  \        P                  P	                  4       4       V P                  \        P                  \
        P
                  ! \        P                  4      4       V P                  \        P                  \
        P                  ! \        P                  4      4       V P                  \        P                  4       R # r   )r5   r   r  r  
_Undefinedr  deepcopyr:   r>   s   &r   test_undefinedTestSingleton.test_undefinedr  sq    bllBII$8$8$:;bllDIIbll$;<bllDMM",,$?@$$R\\2r   r}   N)r   r   r   r   r  r   r   r   s   @r   r  r  q  s     3 3r   r  __main__)(r   r  r  r2   r   rV   unittestr   r   llvmliter   r   r*   r   rP  r=  r   rL  rC   r   HalfTyper  rc  r  r  rD   r   r   r   r  r  r  r  r  rw  ry  r  r  r   mainr}   r   r   <module>r!     sJ      	     $ 4 
zz!}	zz!}


2


2


2kkmllnmmo[;x [;|G08 G0TD"X D"NN*x N*b*L *LZV5H V5t(ih iX	Q2 Q2h
!x/8 x/v+X +3H 3 zMMO r   