| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970 |
- // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
- // Exceptions. See /LICENSE for license information.
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/convert_checked.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/int/convert_checked.carbon
- // --- int_ops.carbon
- library "[[@TEST_NAME]]";
- fn NegateI32(a: i32) -> i32 = "int.snegate";
- fn SubI32(a: i32, b: i32) -> i32 = "int.ssub";
- fn AddU32(a: u32, b: u32) -> u32 = "int.uadd";
- fn IntLiteral() -> type = "int_literal.make_type";
- // Size preserving
- fn Int32ToInt32(a: i32) -> i32 = "int.convert_checked";
- fn Int32ToUint32(a: i32) -> u32 = "int.convert_checked";
- fn Uint32ToInt32(a: u32) -> i32 = "int.convert_checked";
- fn Uint32ToUint32(a: u32) -> u32 = "int.convert_checked";
- fn IntLiteralToIntLiteral(a: IntLiteral()) -> IntLiteral() =
- "int.convert_checked";
- // Narrowing
- fn Int32ToInt16(a: i32) -> i16 = "int.convert_checked";
- fn Int32ToUint16(a: i32) -> u16 = "int.convert_checked";
- fn Uint32ToInt16(a: u32) -> i16 = "int.convert_checked";
- fn Uint32ToUint16(a: u32) -> u16 = "int.convert_checked";
- fn IntLiteralToInt16(a: IntLiteral()) -> i16 = "int.convert_checked";
- fn IntLiteralToUint16(a: IntLiteral()) -> u16 = "int.convert_checked";
- // Widening
- fn Int32ToInt64(a: i32) -> i64 = "int.convert_checked";
- fn Int32ToUint64(a: i32) -> u64 = "int.convert_checked";
- fn Uint32ToInt64(a: u32) -> i64 = "int.convert_checked";
- fn Uint32ToUint64(a: u32) -> u64 = "int.convert_checked";
- fn Int32ToIntLiteral(a: i32) -> IntLiteral() = "int.convert_checked";
- fn Uint32ToUintLiteral(a: u32) -> IntLiteral() = "int.convert_checked";
- // --- identity.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- let a: i32 = Int32ToInt32(0);
- let b: i32 = Int32ToInt32(0x7FFF_FFFF);
- let c: i32 = Int32ToInt32(SubI32(NegateI32(0x7FFF_FFFF), 1));
- let d: IntLiteral() = IntLiteralToIntLiteral(Int32ToIntLiteral(NegateI32(1)));
- // --- same_size.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- let max: u32 = Int32ToUint32(0x7FFF_FFFF);
- let max_roundtrip: i32 = Uint32ToInt32(Int32ToUint32(0x7FFF_FFFF));
- // --- truncate.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- let a: u16 = Int32ToUint16(0);
- let b: u16 = Int32ToUint16(0xFFFF);
- let c: i16 = Int32ToInt16(0x7FFF);
- let d: i16 = Int32ToInt16(NegateI32(0x8000));
- let e: u16 = Uint32ToUint16(Int32ToUint32(0));
- let f: u16 = Uint32ToUint16(Int32ToUint32(0xFFFF));
- let g: i16 = Uint32ToInt16(Int32ToUint32(0));
- let h: i16 = Uint32ToInt16(Int32ToUint32(0x7FFF));
- let lit_i16_min: i16 = IntLiteralToInt16(Int32ToIntLiteral(NegateI32(0x8000)));
- let lit_i16_max: i16 = IntLiteralToInt16(Int32ToIntLiteral(0x7FFF));
- let lit_u16_min: u16 = IntLiteralToUint16(Int32ToIntLiteral(0));
- let lit_u16_max: u16 = IntLiteralToUint16(Int32ToIntLiteral(0xFFFF));
- // --- zero_extend.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- let a: u64 = Uint32ToUint64(Int32ToUint32(0));
- let b: u64 = Uint32ToUint64(
- AddU32(
- AddU32(Int32ToUint32(0x7FFF_FFFF), Int32ToUint32(0x7FFF_FFFF)),
- Int32ToUint32(1)));
- let c: i64 = Uint32ToInt64(Int32ToUint32(0));
- let d: i64 = Uint32ToInt64(
- AddU32(
- AddU32(Int32ToUint32(0x7FFF_FFFF), Int32ToUint32(0x7FFF_FFFF)),
- Int32ToUint32(1)));
- // --- sign_extend.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- let a: u64 = Int32ToUint64(0);
- let b: u64 = Int32ToUint64(0x7FFF_FFFF);
- let c: i64 = Int32ToInt64(SubI32(NegateI32(0x7FFF_FFFF), 1));
- let d: i64 = Int32ToInt64(0x7FFF_FFFF);
- // --- fail_too_large_u32_for_i32.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- let max_plus_one: i32 =
- // CHECK:STDERR: fail_too_large_u32_for_i32.carbon:[[@LINE+4]]:3: error: integer value 2147483648 too large for type `i32` [IntTooLargeForType]
- // CHECK:STDERR: Uint32ToInt32(
- // CHECK:STDERR: ^~~~~~~~~~~~~~
- // CHECK:STDERR:
- Uint32ToInt32(
- AddU32(Int32ToUint32(0x7FFF_FFFF),
- Int32ToUint32(1)));
- // --- fail_too_large_i32_for_i16.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- // CHECK:STDERR: fail_too_large_i32_for_i16.carbon:[[@LINE+4]]:25: error: integer value 32768 too large for type `i16` [IntTooLargeForType]
- // CHECK:STDERR: let max_plus_one: i16 = Int32ToInt16(0x8000);
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- let max_plus_one: i16 = Int32ToInt16(0x8000);
- // --- fail_too_large_i32_for_u16.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- // CHECK:STDERR: fail_too_large_i32_for_u16.carbon:[[@LINE+4]]:25: error: integer value 65536 too large for type `u16` [IntTooLargeForType]
- // CHECK:STDERR: let max_plus_one: u16 = Int32ToUint16(0x1_0000);
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- let max_plus_one: u16 = Int32ToUint16(0x1_0000);
- // --- fail_too_large_u32_for_i16.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- // CHECK:STDERR: fail_too_large_u32_for_i16.carbon:[[@LINE+4]]:25: error: integer value 32768 too large for type `i16` [IntTooLargeForType]
- // CHECK:STDERR: let max_plus_one: i16 = Uint32ToInt16(Int32ToUint32(0x8000));
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- let max_plus_one: i16 = Uint32ToInt16(Int32ToUint32(0x8000));
- // --- fail_too_large_u32_for_u16.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- // CHECK:STDERR: fail_too_large_u32_for_u16.carbon:[[@LINE+4]]:25: error: integer value 65536 too large for type `u16` [IntTooLargeForType]
- // CHECK:STDERR: let max_plus_one: u16 = Uint32ToUint16(Int32ToUint32(0x1_0000));
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- let max_plus_one: u16 = Uint32ToUint16(Int32ToUint32(0x1_0000));
- // --- fail_negative_i32_to_u16.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- // CHECK:STDERR: fail_negative_i32_to_u16.carbon:[[@LINE+4]]:29: error: negative integer value -1 converted to unsigned type `u16` [NegativeIntInUnsignedType]
- // CHECK:STDERR: let minus_one_to_u16: u16 = Int32ToUint16(SubI32(0, 1));
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- let minus_one_to_u16: u16 = Int32ToUint16(SubI32(0, 1));
- // --- fail_negative_i32_to_u32.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- // CHECK:STDERR: fail_negative_i32_to_u32.carbon:[[@LINE+4]]:29: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
- // CHECK:STDERR: let minus_one_to_u32: u32 = Int32ToUint32(SubI32(0, 1));
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- let minus_one_to_u32: u32 = Int32ToUint32(SubI32(0, 1));
- // --- fail_negative_i32_to_u64.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- // CHECK:STDERR: fail_negative_i32_to_u64.carbon:[[@LINE+4]]:29: error: negative integer value -1 converted to unsigned type `u64` [NegativeIntInUnsignedType]
- // CHECK:STDERR: let minus_one_to_u64: u64 = Int32ToUint64(SubI32(0, 1));
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- let minus_one_to_u64: u64 = Int32ToUint64(SubI32(0, 1));
- // --- fail_too_small_i32_for_i16.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- // CHECK:STDERR: fail_too_small_i32_for_i16.carbon:[[@LINE+4]]:26: error: integer value -32769 too large for type `i16` [IntTooLargeForType]
- // CHECK:STDERR: let min_minus_one: i16 = Int32ToInt16(NegateI32(0x8001));
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- let min_minus_one: i16 = Int32ToInt16(NegateI32(0x8001));
- // --- fail_not_constant.carbon
- library "[[@TEST_NAME]]";
- import library "int_ops";
- let not_constant: i32 = 0;
- // CHECK:STDERR: fail_not_constant.carbon:[[@LINE+8]]:40: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
- // CHECK:STDERR: let convert_not_constant_narrow: i16 = Int32ToInt16(not_constant);
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR: fail_not_constant.carbon:[[@LINE-7]]:1: in import [InImport]
- // CHECK:STDERR: int_ops.carbon:18:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
- // CHECK:STDERR: fn Int32ToInt16(a: i32) -> i16 = "int.convert_checked";
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- let convert_not_constant_narrow: i16 = Int32ToInt16(not_constant);
- // CHECK:STDERR: fail_not_constant.carbon:[[@LINE+8]]:38: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
- // CHECK:STDERR: let convert_not_constant_same: i32 = Int32ToInt32(not_constant);
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR: fail_not_constant.carbon:[[@LINE-17]]:1: in import [InImport]
- // CHECK:STDERR: int_ops.carbon:10:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
- // CHECK:STDERR: fn Int32ToInt32(a: i32) -> i32 = "int.convert_checked";
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- let convert_not_constant_same: i32 = Int32ToInt32(not_constant);
- // CHECK:STDERR: fail_not_constant.carbon:[[@LINE+7]]:39: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
- // CHECK:STDERR: let convert_not_constant_widen: i64 = Int32ToInt64(not_constant);
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR: fail_not_constant.carbon:[[@LINE-27]]:1: in import [InImport]
- // CHECK:STDERR: int_ops.carbon:26:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
- // CHECK:STDERR: fn Int32ToInt64(a: i32) -> i64 = "int.convert_checked";
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- let convert_not_constant_widen: i64 = Int32ToInt64(not_constant);
- // CHECK:STDOUT: --- int_ops.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template]
- // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template]
- // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template]
- // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template]
- // CHECK:STDOUT: %AddU32.type: type = fn_type @AddU32 [template]
- // CHECK:STDOUT: %AddU32: %AddU32.type = struct_value () [template]
- // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template]
- // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template]
- // CHECK:STDOUT: %Int32ToInt32.type: type = fn_type @Int32ToInt32 [template]
- // CHECK:STDOUT: %Int32ToInt32: %Int32ToInt32.type = struct_value () [template]
- // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template]
- // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template]
- // CHECK:STDOUT: %Uint32ToInt32.type: type = fn_type @Uint32ToInt32 [template]
- // CHECK:STDOUT: %Uint32ToInt32: %Uint32ToInt32.type = struct_value () [template]
- // CHECK:STDOUT: %Uint32ToUint32.type: type = fn_type @Uint32ToUint32 [template]
- // CHECK:STDOUT: %Uint32ToUint32: %Uint32ToUint32.type = struct_value () [template]
- // CHECK:STDOUT: %IntLiteralToIntLiteral.type: type = fn_type @IntLiteralToIntLiteral [template]
- // CHECK:STDOUT: %IntLiteralToIntLiteral: %IntLiteralToIntLiteral.type = struct_value () [template]
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template]
- // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template]
- // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template]
- // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template]
- // CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template]
- // CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template]
- // CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template]
- // CHECK:STDOUT: %Uint32ToInt16.type: type = fn_type @Uint32ToInt16 [template]
- // CHECK:STDOUT: %Uint32ToInt16: %Uint32ToInt16.type = struct_value () [template]
- // CHECK:STDOUT: %Uint32ToUint16.type: type = fn_type @Uint32ToUint16 [template]
- // CHECK:STDOUT: %Uint32ToUint16: %Uint32ToUint16.type = struct_value () [template]
- // CHECK:STDOUT: %IntLiteralToInt16.type: type = fn_type @IntLiteralToInt16 [template]
- // CHECK:STDOUT: %IntLiteralToInt16: %IntLiteralToInt16.type = struct_value () [template]
- // CHECK:STDOUT: %IntLiteralToUint16.type: type = fn_type @IntLiteralToUint16 [template]
- // CHECK:STDOUT: %IntLiteralToUint16: %IntLiteralToUint16.type = struct_value () [template]
- // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template]
- // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template]
- // CHECK:STDOUT: %Int32ToInt64.type: type = fn_type @Int32ToInt64 [template]
- // CHECK:STDOUT: %Int32ToInt64: %Int32ToInt64.type = struct_value () [template]
- // CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template]
- // CHECK:STDOUT: %Int32ToUint64.type: type = fn_type @Int32ToUint64 [template]
- // CHECK:STDOUT: %Int32ToUint64: %Int32ToUint64.type = struct_value () [template]
- // CHECK:STDOUT: %Uint32ToInt64.type: type = fn_type @Uint32ToInt64 [template]
- // CHECK:STDOUT: %Uint32ToInt64: %Uint32ToInt64.type = struct_value () [template]
- // CHECK:STDOUT: %Uint32ToUint64.type: type = fn_type @Uint32ToUint64 [template]
- // CHECK:STDOUT: %Uint32ToUint64: %Uint32ToUint64.type = struct_value () [template]
- // CHECK:STDOUT: %Int32ToIntLiteral.type: type = fn_type @Int32ToIntLiteral [template]
- // CHECK:STDOUT: %Int32ToIntLiteral: %Int32ToIntLiteral.type = struct_value () [template]
- // CHECK:STDOUT: %Uint32ToUintLiteral.type: type = fn_type @Uint32ToUintLiteral [template]
- // CHECK:STDOUT: %Uint32ToUintLiteral: %Uint32ToUintLiteral.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .Int = %import_ref.1
- // CHECK:STDOUT: .UInt = %import_ref.5
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .NegateI32 = %NegateI32.decl
- // CHECK:STDOUT: .SubI32 = %SubI32.decl
- // CHECK:STDOUT: .AddU32 = %AddU32.decl
- // CHECK:STDOUT: .IntLiteral = %IntLiteral.decl
- // CHECK:STDOUT: .Int32ToInt32 = %Int32ToInt32.decl
- // CHECK:STDOUT: .Int32ToUint32 = %Int32ToUint32.decl
- // CHECK:STDOUT: .Uint32ToInt32 = %Uint32ToInt32.decl
- // CHECK:STDOUT: .Uint32ToUint32 = %Uint32ToUint32.decl
- // CHECK:STDOUT: .IntLiteralToIntLiteral = %IntLiteralToIntLiteral.decl
- // CHECK:STDOUT: .Int32ToInt16 = %Int32ToInt16.decl
- // CHECK:STDOUT: .Int32ToUint16 = %Int32ToUint16.decl
- // CHECK:STDOUT: .Uint32ToInt16 = %Uint32ToInt16.decl
- // CHECK:STDOUT: .Uint32ToUint16 = %Uint32ToUint16.decl
- // CHECK:STDOUT: .IntLiteralToInt16 = %IntLiteralToInt16.decl
- // CHECK:STDOUT: .IntLiteralToUint16 = %IntLiteralToUint16.decl
- // CHECK:STDOUT: .Int32ToInt64 = %Int32ToInt64.decl
- // CHECK:STDOUT: .Int32ToUint64 = %Int32ToUint64.decl
- // CHECK:STDOUT: .Uint32ToInt64 = %Uint32ToInt64.decl
- // CHECK:STDOUT: .Uint32ToUint64 = %Uint32ToUint64.decl
- // CHECK:STDOUT: .Int32ToIntLiteral = %Int32ToIntLiteral.decl
- // CHECK:STDOUT: .Uint32ToUintLiteral = %Uint32ToUintLiteral.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %NegateI32.decl: %NegateI32.type = fn_decl @NegateI32 [template = constants.%NegateI32] {
- // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_32.loc4_25: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32.loc4_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc4: type = splice_block %i32.loc4_17 [template = constants.%i32] {
- // CHECK:STDOUT: %int_32.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32.loc4_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %SubI32.decl: %SubI32.type = fn_decl @SubI32 [template = constants.%SubI32] {
- // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b
- // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1
- // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_32.loc5_30: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32.loc5_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc5_14: type = splice_block %i32.loc5_14 [template = constants.%i32] {
- // CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
- // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1
- // CHECK:STDOUT: %.loc5_22: type = splice_block %i32.loc5_22 [template = constants.%i32] {
- // CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param
- // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2
- // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %AddU32.decl: %AddU32.type = fn_decl @AddU32 [template = constants.%AddU32] {
- // CHECK:STDOUT: %a.patt: %u32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %b.patt: %u32 = binding_pattern b
- // CHECK:STDOUT: %b.param_patt: %u32 = value_param_pattern %b.patt, runtime_param1
- // CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param2
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_32.loc6_30: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %u32.loc6_30: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32]
- // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc6_14: type = splice_block %u32.loc6_14 [template = constants.%u32] {
- // CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %u32.loc6_14: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param
- // CHECK:STDOUT: %b.param: %u32 = value_param runtime_param1
- // CHECK:STDOUT: %.loc6_22: type = splice_block %u32.loc6_22 [template = constants.%u32] {
- // CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %u32.loc6_22: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %b: %u32 = bind_name b, %b.param
- // CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param2
- // CHECK:STDOUT: %return: ref %u32 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] {
- // CHECK:STDOUT: %return.patt: type = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %return.param: ref type = out_param runtime_param0
- // CHECK:STDOUT: %return: ref type = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Int32ToInt32.decl: %Int32ToInt32.type = fn_decl @Int32ToInt32 [template = constants.%Int32ToInt32] {
- // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_32.loc10_28: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32.loc10_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc10: type = splice_block %i32.loc10_20 [template = constants.%i32] {
- // CHECK:STDOUT: %int_32.loc10_20: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32.loc10_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Int32ToUint32.decl: %Int32ToUint32.type = fn_decl @Int32ToUint32 [template = constants.%Int32ToUint32] {
- // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_32.loc11_29: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32]
- // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc11: type = splice_block %i32 [template = constants.%i32] {
- // CHECK:STDOUT: %int_32.loc11_21: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %u32 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Uint32ToInt32.decl: %Uint32ToInt32.type = fn_decl @Uint32ToInt32 [template = constants.%Uint32ToInt32] {
- // CHECK:STDOUT: %a.patt: %u32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc12: type = splice_block %u32 [template = constants.%u32] {
- // CHECK:STDOUT: %int_32.loc12_21: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Uint32ToUint32.decl: %Uint32ToUint32.type = fn_decl @Uint32ToUint32 [template = constants.%Uint32ToUint32] {
- // CHECK:STDOUT: %a.patt: %u32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_32.loc13_30: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %u32.loc13_30: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32]
- // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc13: type = splice_block %u32.loc13_22 [template = constants.%u32] {
- // CHECK:STDOUT: %int_32.loc13_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %u32.loc13_22: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %u32 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %IntLiteralToIntLiteral.decl: %IntLiteralToIntLiteral.type = fn_decl @IntLiteralToIntLiteral [template = constants.%IntLiteralToIntLiteral] {
- // CHECK:STDOUT: %a.patt: Core.IntLiteral = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: Core.IntLiteral = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %IntLiteral.ref.loc14_47: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
- // CHECK:STDOUT: %int_literal.make_type.loc14_58: init type = call %IntLiteral.ref.loc14_47() [template = Core.IntLiteral]
- // CHECK:STDOUT: %.loc14_58.1: type = value_of_initializer %int_literal.make_type.loc14_58 [template = Core.IntLiteral]
- // CHECK:STDOUT: %.loc14_58.2: type = converted %int_literal.make_type.loc14_58, %.loc14_58.1 [template = Core.IntLiteral]
- // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0
- // CHECK:STDOUT: %.loc14_41.3: type = splice_block %.loc14_41.2 [template = Core.IntLiteral] {
- // CHECK:STDOUT: %IntLiteral.ref.loc14_30: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
- // CHECK:STDOUT: %int_literal.make_type.loc14_41: init type = call %IntLiteral.ref.loc14_30() [template = Core.IntLiteral]
- // CHECK:STDOUT: %.loc14_41.1: type = value_of_initializer %int_literal.make_type.loc14_41 [template = Core.IntLiteral]
- // CHECK:STDOUT: %.loc14_41.2: type = converted %int_literal.make_type.loc14_41, %.loc14_41.1 [template = Core.IntLiteral]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
- // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Int32ToInt16.decl: %Int32ToInt16.type = fn_decl @Int32ToInt16 [template = constants.%Int32ToInt16] {
- // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %i16 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16]
- // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16]
- // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc18: type = splice_block %i32 [template = constants.%i32] {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %i16 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Int32ToUint16.decl: %Int32ToUint16.type = fn_decl @Int32ToUint16 [template = constants.%Int32ToUint16] {
- // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %u16 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16]
- // CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16]
- // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc19: type = splice_block %i32 [template = constants.%i32] {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %u16 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Uint32ToInt16.decl: %Uint32ToInt16.type = fn_decl @Uint32ToInt16 [template = constants.%Uint32ToInt16] {
- // CHECK:STDOUT: %a.patt: %u32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %i16 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16]
- // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16]
- // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc20: type = splice_block %u32 [template = constants.%u32] {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %i16 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Uint32ToUint16.decl: %Uint32ToUint16.type = fn_decl @Uint32ToUint16 [template = constants.%Uint32ToUint16] {
- // CHECK:STDOUT: %a.patt: %u32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %u16 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16]
- // CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16]
- // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc21: type = splice_block %u32 [template = constants.%u32] {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %u16 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %IntLiteralToInt16.decl: %IntLiteralToInt16.type = fn_decl @IntLiteralToInt16 [template = constants.%IntLiteralToInt16] {
- // CHECK:STDOUT: %a.patt: Core.IntLiteral = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: Core.IntLiteral = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %i16 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16]
- // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16]
- // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0
- // CHECK:STDOUT: %.loc22_36.3: type = splice_block %.loc22_36.2 [template = Core.IntLiteral] {
- // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
- // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
- // CHECK:STDOUT: %.loc22_36.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
- // CHECK:STDOUT: %.loc22_36.2: type = converted %int_literal.make_type, %.loc22_36.1 [template = Core.IntLiteral]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %i16 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %IntLiteralToUint16.decl: %IntLiteralToUint16.type = fn_decl @IntLiteralToUint16 [template = constants.%IntLiteralToUint16] {
- // CHECK:STDOUT: %a.patt: Core.IntLiteral = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: Core.IntLiteral = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %u16 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16]
- // CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16]
- // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0
- // CHECK:STDOUT: %.loc23_37.3: type = splice_block %.loc23_37.2 [template = Core.IntLiteral] {
- // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
- // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
- // CHECK:STDOUT: %.loc23_37.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
- // CHECK:STDOUT: %.loc23_37.2: type = converted %int_literal.make_type, %.loc23_37.1 [template = Core.IntLiteral]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %u16 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Int32ToInt64.decl: %Int32ToInt64.type = fn_decl @Int32ToInt64 [template = constants.%Int32ToInt64] {
- // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %i64 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64]
- // CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64]
- // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc26: type = splice_block %i32 [template = constants.%i32] {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %i64 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Int32ToUint64.decl: %Int32ToUint64.type = fn_decl @Int32ToUint64 [template = constants.%Int32ToUint64] {
- // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %u64 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %u64 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64]
- // CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64]
- // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc27: type = splice_block %i32 [template = constants.%i32] {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %u64 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %u64 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Uint32ToInt64.decl: %Uint32ToInt64.type = fn_decl @Uint32ToInt64 [template = constants.%Uint32ToInt64] {
- // CHECK:STDOUT: %a.patt: %u32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %i64 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64]
- // CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64]
- // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc28: type = splice_block %u32 [template = constants.%u32] {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %i64 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Uint32ToUint64.decl: %Uint32ToUint64.type = fn_decl @Uint32ToUint64 [template = constants.%Uint32ToUint64] {
- // CHECK:STDOUT: %a.patt: %u32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %u64 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %u64 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64]
- // CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64]
- // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc29: type = splice_block %u32 [template = constants.%u32] {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %u64 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %u64 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Int32ToIntLiteral.decl: %Int32ToIntLiteral.type = fn_decl @Int32ToIntLiteral [template = constants.%Int32ToIntLiteral] {
- // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
- // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
- // CHECK:STDOUT: %.loc30_44.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
- // CHECK:STDOUT: %.loc30_44.2: type = converted %int_literal.make_type, %.loc30_44.1 [template = Core.IntLiteral]
- // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc30_25: type = splice_block %i32 [template = constants.%i32] {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
- // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Uint32ToUintLiteral.decl: %Uint32ToUintLiteral.type = fn_decl @Uint32ToUintLiteral [template = constants.%Uint32ToUintLiteral] {
- // CHECK:STDOUT: %a.patt: %u32 = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
- // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
- // CHECK:STDOUT: %.loc31_46.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
- // CHECK:STDOUT: %.loc31_46.2: type = converted %int_literal.make_type, %.loc31_46.1 [template = Core.IntLiteral]
- // CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0
- // CHECK:STDOUT: %.loc31_27: type = splice_block %u32 [template = constants.%u32] {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
- // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @AddU32(%a.param_patt: %u32, %b.param_patt: %u32) -> %u32 = "int.uadd";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: %i32) -> %i32 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %u32) -> %i32 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToUint32(%a.param_patt: %u32) -> %u32 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @IntLiteralToIntLiteral(%a.param_patt: Core.IntLiteral) -> Core.IntLiteral = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %u32) -> %i16 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %u32) -> %u16 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @IntLiteralToInt16(%a.param_patt: Core.IntLiteral) -> %i16 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @IntLiteralToUint16(%a.param_patt: Core.IntLiteral) -> %u16 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToInt64(%a.param_patt: %i32) -> %i64 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToInt64(%a.param_patt: %u32) -> %i64 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToUint64(%a.param_patt: %u32) -> %u64 = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToUintLiteral(%a.param_patt: %u32) -> Core.IntLiteral = "int.convert_checked";
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- identity.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %Int32ToInt32.type: type = fn_type @Int32ToInt32 [template]
- // CHECK:STDOUT: %Int32ToInt32: %Int32ToInt32.type = struct_value () [template]
- // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound.1: <bound method> = bound_method %int_0.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.1: <specific function> = specific_function %Convert.bound.1, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template]
- // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template]
- // CHECK:STDOUT: %Convert.bound.2: <bound method> = bound_method %int_2147483647.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.2: <specific function> = specific_function %Convert.bound.2, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template]
- // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template]
- // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template]
- // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template]
- // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template]
- // CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template]
- // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template]
- // CHECK:STDOUT: %Convert.bound.3: <bound method> = bound_method %int_1.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.3: <specific function> = specific_function %Convert.bound.3, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template]
- // CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template]
- // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template]
- // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template]
- // CHECK:STDOUT: %IntLiteralToIntLiteral.type: type = fn_type @IntLiteralToIntLiteral [template]
- // CHECK:STDOUT: %IntLiteralToIntLiteral: %IntLiteralToIntLiteral.type = struct_value () [template]
- // CHECK:STDOUT: %Int32ToIntLiteral.type: type = fn_type @Int32ToIntLiteral [template]
- // CHECK:STDOUT: %Int32ToIntLiteral: %Int32ToIntLiteral.type = struct_value () [template]
- // CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template]
- // CHECK:STDOUT: %int_-1.2: Core.IntLiteral = int_value -1 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, NegateI32, loaded [template = constants.%NegateI32]
- // CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32]
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4: %IntLiteral.type = import_ref Main//int_ops, IntLiteral, loaded [template = constants.%IntLiteral]
- // CHECK:STDOUT: %import_ref.5: %Int32ToInt32.type = import_ref Main//int_ops, Int32ToInt32, loaded [template = constants.%Int32ToInt32]
- // CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9: %IntLiteralToIntLiteral.type = import_ref Main//int_ops, IntLiteralToIntLiteral, loaded [template = constants.%IntLiteralToIntLiteral]
- // CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20: %Int32ToIntLiteral.type = import_ref Main//int_ops, Int32ToIntLiteral, loaded [template = constants.%Int32ToIntLiteral]
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .Int = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.26
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .a = @__global_init.%a
- // CHECK:STDOUT: .b = @__global_init.%b
- // CHECK:STDOUT: .c = @__global_init.%c
- // CHECK:STDOUT: .d = @__global_init.%d
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: %i32) -> %i32 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @IntLiteralToIntLiteral(%a.param_patt: Core.IntLiteral) -> Core.IntLiteral = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Int32ToInt32.ref.loc5: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32]
- // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1]
- // CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc5: <bound method> = bound_method %int_0, %impl.elem0.loc5 [template = constants.%Convert.bound.1]
- // CHECK:STDOUT: %Convert.specific_fn.loc5: <specific function> = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1]
- // CHECK:STDOUT: %int.convert_checked.loc5_27: init %i32 = call %Convert.specific_fn.loc5(%int_0) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc5_27.1: %i32 = value_of_initializer %int.convert_checked.loc5_27 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc5_27.2: %i32 = converted %int_0, %.loc5_27.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %int.convert_checked.loc5_28: init %i32 = call %Int32ToInt32.ref.loc5(%.loc5_27.2) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc5_29.1: %i32 = value_of_initializer %int.convert_checked.loc5_28 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc5_29.2: %i32 = converted %int.convert_checked.loc5_28, %.loc5_29.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %a: %i32 = bind_name a, %.loc5_29.2
- // CHECK:STDOUT: %Int32ToInt32.ref.loc6: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32]
- // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1]
- // CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc6: <bound method> = bound_method %int_2147483647.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc6: <specific function> = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc6_27: init %i32 = call %Convert.specific_fn.loc6(%int_2147483647.loc6) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc6_27.1: %i32 = value_of_initializer %int.convert_checked.loc6_27 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc6_27.2: %i32 = converted %int_2147483647.loc6, %.loc6_27.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %int.convert_checked.loc6_38: init %i32 = call %Int32ToInt32.ref.loc6(%.loc6_27.2) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc6_39.1: %i32 = value_of_initializer %int.convert_checked.loc6_38 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc6_39.2: %i32 = converted %int.convert_checked.loc6_38, %.loc6_39.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %b: %i32 = bind_name b, %.loc6_39.2
- // CHECK:STDOUT: %Int32ToInt32.ref.loc7: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32]
- // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32]
- // CHECK:STDOUT: %NegateI32.ref.loc7: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32]
- // CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1]
- // CHECK:STDOUT: %impl.elem0.loc7_44: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc7_44: <bound method> = bound_method %int_2147483647.loc7, %impl.elem0.loc7_44 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc7_44: <specific function> = specific_function %Convert.bound.loc7_44, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc7_44: init %i32 = call %Convert.specific_fn.loc7_44(%int_2147483647.loc7) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc7_44.1: %i32 = value_of_initializer %int.convert_checked.loc7_44 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc7_44.2: %i32 = converted %int_2147483647.loc7, %.loc7_44.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %int.snegate.loc7: init %i32 = call %NegateI32.ref.loc7(%.loc7_44.2) [template = constants.%int_-2147483647]
- // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
- // CHECK:STDOUT: %.loc7_55.1: %i32 = value_of_initializer %int.snegate.loc7 [template = constants.%int_-2147483647]
- // CHECK:STDOUT: %.loc7_55.2: %i32 = converted %int.snegate.loc7, %.loc7_55.1 [template = constants.%int_-2147483647]
- // CHECK:STDOUT: %impl.elem0.loc7_58: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc7_58: <bound method> = bound_method %int_1.loc7, %impl.elem0.loc7_58 [template = constants.%Convert.bound.3]
- // CHECK:STDOUT: %Convert.specific_fn.loc7_58: <specific function> = specific_function %Convert.bound.loc7_58, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3]
- // CHECK:STDOUT: %int.convert_checked.loc7_58: init %i32 = call %Convert.specific_fn.loc7_58(%int_1.loc7) [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc7_58.1: %i32 = value_of_initializer %int.convert_checked.loc7_58 [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc7_58.2: %i32 = converted %int_1.loc7, %.loc7_58.1 [template = constants.%int_1.2]
- // CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc7_55.2, %.loc7_58.2) [template = constants.%int_-2147483648]
- // CHECK:STDOUT: %.loc7_59.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_-2147483648]
- // CHECK:STDOUT: %.loc7_59.2: %i32 = converted %int.ssub, %.loc7_59.1 [template = constants.%int_-2147483648]
- // CHECK:STDOUT: %int.convert_checked.loc7_60: init %i32 = call %Int32ToInt32.ref.loc7(%.loc7_59.2) [template = constants.%int_-2147483648]
- // CHECK:STDOUT: %.loc7_61.1: %i32 = value_of_initializer %int.convert_checked.loc7_60 [template = constants.%int_-2147483648]
- // CHECK:STDOUT: %.loc7_61.2: %i32 = converted %int.convert_checked.loc7_60, %.loc7_61.1 [template = constants.%int_-2147483648]
- // CHECK:STDOUT: %c: %i32 = bind_name c, %.loc7_61.2
- // CHECK:STDOUT: %IntLiteralToIntLiteral.ref: %IntLiteralToIntLiteral.type = name_ref IntLiteralToIntLiteral, imports.%import_ref.9 [template = constants.%IntLiteralToIntLiteral]
- // CHECK:STDOUT: %Int32ToIntLiteral.ref: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral]
- // CHECK:STDOUT: %NegateI32.ref.loc8: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32]
- // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
- // CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc8: <bound method> = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.3]
- // CHECK:STDOUT: %Convert.specific_fn.loc8: <specific function> = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3]
- // CHECK:STDOUT: %int.convert_checked.loc8_74: init %i32 = call %Convert.specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc8_74.1: %i32 = value_of_initializer %int.convert_checked.loc8_74 [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc8_74.2: %i32 = converted %int_1.loc8, %.loc8_74.1 [template = constants.%int_1.2]
- // CHECK:STDOUT: %int.snegate.loc8: init %i32 = call %NegateI32.ref.loc8(%.loc8_74.2) [template = constants.%int_-1.1]
- // CHECK:STDOUT: %.loc8_75.1: %i32 = value_of_initializer %int.snegate.loc8 [template = constants.%int_-1.1]
- // CHECK:STDOUT: %.loc8_75.2: %i32 = converted %int.snegate.loc8, %.loc8_75.1 [template = constants.%int_-1.1]
- // CHECK:STDOUT: %int.convert_checked.loc8_76: init Core.IntLiteral = call %Int32ToIntLiteral.ref(%.loc8_75.2) [template = constants.%int_-1.2]
- // CHECK:STDOUT: %.loc8_76.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc8_76 [template = constants.%int_-1.2]
- // CHECK:STDOUT: %.loc8_76.2: Core.IntLiteral = converted %int.convert_checked.loc8_76, %.loc8_76.1 [template = constants.%int_-1.2]
- // CHECK:STDOUT: %int.convert_checked.loc8_77: init Core.IntLiteral = call %IntLiteralToIntLiteral.ref(%.loc8_76.2) [template = constants.%int_-1.2]
- // CHECK:STDOUT: %.loc8_78.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc8_77 [template = constants.%int_-1.2]
- // CHECK:STDOUT: %.loc8_78.2: Core.IntLiteral = converted %int.convert_checked.loc8_77, %.loc8_78.1 [template = constants.%int_-1.2]
- // CHECK:STDOUT: %d: Core.IntLiteral = bind_name d, %.loc8_78.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- same_size.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template]
- // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template]
- // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2147483647.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template]
- // CHECK:STDOUT: %int_2147483647.3: %u32 = int_value 2147483647 [template]
- // CHECK:STDOUT: %Uint32ToInt32.type: type = fn_type @Uint32ToInt32 [template]
- // CHECK:STDOUT: %Uint32ToInt32: %Uint32ToInt32.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded
- // CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %import_ref.7: %Uint32ToInt32.type = import_ref Main//int_ops, Uint32ToInt32, loaded [template = constants.%Uint32ToInt32]
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .UInt = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.29
- // CHECK:STDOUT: .Int = %import_ref.217
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .max = @__global_init.%max
- // CHECK:STDOUT: .max_roundtrip = @__global_init.%max_roundtrip
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %u32) -> %i32 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Int32ToUint32.ref.loc5: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_2147483647.loc5: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1]
- // CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc5: <bound method> = bound_method %int_2147483647.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound]
- // CHECK:STDOUT: %Convert.specific_fn.loc5: <specific function> = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
- // CHECK:STDOUT: %int.convert_checked.loc5_30: init %i32 = call %Convert.specific_fn.loc5(%int_2147483647.loc5) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc5_30.1: %i32 = value_of_initializer %int.convert_checked.loc5_30 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc5_30.2: %i32 = converted %int_2147483647.loc5, %.loc5_30.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %int.convert_checked.loc5_41: init %u32 = call %Int32ToUint32.ref.loc5(%.loc5_30.2) [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc5_42.1: %u32 = value_of_initializer %int.convert_checked.loc5_41 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc5_42.2: %u32 = converted %int.convert_checked.loc5_41, %.loc5_42.1 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %max: %u32 = bind_name max, %.loc5_42.2
- // CHECK:STDOUT: %Uint32ToInt32.ref: %Uint32ToInt32.type = name_ref Uint32ToInt32, imports.%import_ref.7 [template = constants.%Uint32ToInt32]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc6: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1]
- // CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc6: <bound method> = bound_method %int_2147483647.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound]
- // CHECK:STDOUT: %Convert.specific_fn.loc6: <specific function> = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
- // CHECK:STDOUT: %int.convert_checked.loc6_54: init %i32 = call %Convert.specific_fn.loc6(%int_2147483647.loc6) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc6_54.1: %i32 = value_of_initializer %int.convert_checked.loc6_54 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc6_54.2: %i32 = converted %int_2147483647.loc6, %.loc6_54.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %int.convert_checked.loc6_65: init %u32 = call %Int32ToUint32.ref.loc6(%.loc6_54.2) [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc6_65.1: %u32 = value_of_initializer %int.convert_checked.loc6_65 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc6_65.2: %u32 = converted %int.convert_checked.loc6_65, %.loc6_65.1 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %int.convert_checked.loc6_66: init %i32 = call %Uint32ToInt32.ref(%.loc6_65.2) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc6_67.1: %i32 = value_of_initializer %int.convert_checked.loc6_66 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc6_67.2: %i32 = converted %int.convert_checked.loc6_66, %.loc6_67.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %max_roundtrip: %i32 = bind_name max_roundtrip, %.loc6_67.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- truncate.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template]
- // CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template]
- // CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template]
- // CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound.1: <bound method> = bound_method %int_0.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.1: <specific function> = specific_function %Convert.bound.1, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template]
- // CHECK:STDOUT: %int_0.3: %u16 = int_value 0 [template]
- // CHECK:STDOUT: %int_65535.1: Core.IntLiteral = int_value 65535 [template]
- // CHECK:STDOUT: %Convert.bound.2: <bound method> = bound_method %int_65535.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.2: <specific function> = specific_function %Convert.bound.2, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_65535.2: %i32 = int_value 65535 [template]
- // CHECK:STDOUT: %int_65535.3: %u16 = int_value 65535 [template]
- // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template]
- // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template]
- // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template]
- // CHECK:STDOUT: %int_32767.1: Core.IntLiteral = int_value 32767 [template]
- // CHECK:STDOUT: %Convert.bound.3: <bound method> = bound_method %int_32767.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.3: <specific function> = specific_function %Convert.bound.3, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_32767.2: %i32 = int_value 32767 [template]
- // CHECK:STDOUT: %int_32767.3: %i16 = int_value 32767 [template]
- // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template]
- // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template]
- // CHECK:STDOUT: %int_32768.1: Core.IntLiteral = int_value 32768 [template]
- // CHECK:STDOUT: %Convert.bound.4: <bound method> = bound_method %int_32768.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.4: <specific function> = specific_function %Convert.bound.4, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template]
- // CHECK:STDOUT: %int_-32768.1: %i32 = int_value -32768 [template]
- // CHECK:STDOUT: %int_-32768.2: %i16 = int_value -32768 [template]
- // CHECK:STDOUT: %Uint32ToUint16.type: type = fn_type @Uint32ToUint16 [template]
- // CHECK:STDOUT: %Uint32ToUint16: %Uint32ToUint16.type = struct_value () [template]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template]
- // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template]
- // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template]
- // CHECK:STDOUT: %int_0.4: %u32 = int_value 0 [template]
- // CHECK:STDOUT: %int_65535.4: %u32 = int_value 65535 [template]
- // CHECK:STDOUT: %Uint32ToInt16.type: type = fn_type @Uint32ToInt16 [template]
- // CHECK:STDOUT: %Uint32ToInt16: %Uint32ToInt16.type = struct_value () [template]
- // CHECK:STDOUT: %int_0.5: %i16 = int_value 0 [template]
- // CHECK:STDOUT: %int_32767.4: %u32 = int_value 32767 [template]
- // CHECK:STDOUT: %IntLiteralToInt16.type: type = fn_type @IntLiteralToInt16 [template]
- // CHECK:STDOUT: %IntLiteralToInt16: %IntLiteralToInt16.type = struct_value () [template]
- // CHECK:STDOUT: %Int32ToIntLiteral.type: type = fn_type @Int32ToIntLiteral [template]
- // CHECK:STDOUT: %Int32ToIntLiteral: %Int32ToIntLiteral.type = struct_value () [template]
- // CHECK:STDOUT: %int_-32768.3: Core.IntLiteral = int_value -32768 [template]
- // CHECK:STDOUT: %IntLiteralToUint16.type: type = fn_type @IntLiteralToUint16 [template]
- // CHECK:STDOUT: %IntLiteralToUint16: %IntLiteralToUint16.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, NegateI32, loaded [template = constants.%NegateI32]
- // CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [template = constants.%Int32ToInt16]
- // CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, Int32ToUint16, loaded [template = constants.%Int32ToUint16]
- // CHECK:STDOUT: %import_ref.12: %Uint32ToInt16.type = import_ref Main//int_ops, Uint32ToInt16, loaded [template = constants.%Uint32ToInt16]
- // CHECK:STDOUT: %import_ref.13: %Uint32ToUint16.type = import_ref Main//int_ops, Uint32ToUint16, loaded [template = constants.%Uint32ToUint16]
- // CHECK:STDOUT: %import_ref.14: %IntLiteralToInt16.type = import_ref Main//int_ops, IntLiteralToInt16, loaded [template = constants.%IntLiteralToInt16]
- // CHECK:STDOUT: %import_ref.15: %IntLiteralToUint16.type = import_ref Main//int_ops, IntLiteralToUint16, loaded [template = constants.%IntLiteralToUint16]
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20: %Int32ToIntLiteral.type = import_ref Main//int_ops, Int32ToIntLiteral, loaded [template = constants.%Int32ToIntLiteral]
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .UInt = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.29
- // CHECK:STDOUT: .Int = %import_ref.217
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .a = @__global_init.%a
- // CHECK:STDOUT: .b = @__global_init.%b
- // CHECK:STDOUT: .c = @__global_init.%c
- // CHECK:STDOUT: .d = @__global_init.%d
- // CHECK:STDOUT: .e = @__global_init.%e
- // CHECK:STDOUT: .f = @__global_init.%f
- // CHECK:STDOUT: .g = @__global_init.%g
- // CHECK:STDOUT: .h = @__global_init.%h
- // CHECK:STDOUT: .lit_i16_min = @__global_init.%lit_i16_min
- // CHECK:STDOUT: .lit_i16_max = @__global_init.%lit_i16_max
- // CHECK:STDOUT: .lit_u16_min = @__global_init.%lit_u16_min
- // CHECK:STDOUT: .lit_u16_max = @__global_init.%lit_u16_max
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %u32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %u32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @IntLiteralToInt16(%a.param_patt: Core.IntLiteral) -> %i16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @IntLiteralToUint16(%a.param_patt: Core.IntLiteral) -> %u16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Int32ToUint16.ref.loc5: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16]
- // CHECK:STDOUT: %int_0.loc5: Core.IntLiteral = int_value 0 [template = constants.%int_0.1]
- // CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc5: <bound method> = bound_method %int_0.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound.1]
- // CHECK:STDOUT: %Convert.specific_fn.loc5: <specific function> = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1]
- // CHECK:STDOUT: %int.convert_checked.loc5_28: init %i32 = call %Convert.specific_fn.loc5(%int_0.loc5) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc5_28.1: %i32 = value_of_initializer %int.convert_checked.loc5_28 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc5_28.2: %i32 = converted %int_0.loc5, %.loc5_28.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %int.convert_checked.loc5_29: init %u16 = call %Int32ToUint16.ref.loc5(%.loc5_28.2) [template = constants.%int_0.3]
- // CHECK:STDOUT: %.loc5_30.1: %u16 = value_of_initializer %int.convert_checked.loc5_29 [template = constants.%int_0.3]
- // CHECK:STDOUT: %.loc5_30.2: %u16 = converted %int.convert_checked.loc5_29, %.loc5_30.1 [template = constants.%int_0.3]
- // CHECK:STDOUT: %a: %u16 = bind_name a, %.loc5_30.2
- // CHECK:STDOUT: %Int32ToUint16.ref.loc6: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16]
- // CHECK:STDOUT: %int_65535.loc6: Core.IntLiteral = int_value 65535 [template = constants.%int_65535.1]
- // CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc6: <bound method> = bound_method %int_65535.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc6: <specific function> = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6(%int_65535.loc6) [template = constants.%int_65535.2]
- // CHECK:STDOUT: %.loc6_28.1: %i32 = value_of_initializer %int.convert_checked.loc6_28 [template = constants.%int_65535.2]
- // CHECK:STDOUT: %.loc6_28.2: %i32 = converted %int_65535.loc6, %.loc6_28.1 [template = constants.%int_65535.2]
- // CHECK:STDOUT: %int.convert_checked.loc6_34: init %u16 = call %Int32ToUint16.ref.loc6(%.loc6_28.2) [template = constants.%int_65535.3]
- // CHECK:STDOUT: %.loc6_35.1: %u16 = value_of_initializer %int.convert_checked.loc6_34 [template = constants.%int_65535.3]
- // CHECK:STDOUT: %.loc6_35.2: %u16 = converted %int.convert_checked.loc6_34, %.loc6_35.1 [template = constants.%int_65535.3]
- // CHECK:STDOUT: %b: %u16 = bind_name b, %.loc6_35.2
- // CHECK:STDOUT: %Int32ToInt16.ref.loc8: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16]
- // CHECK:STDOUT: %int_32767.loc8: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1]
- // CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc8: <bound method> = bound_method %int_32767.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.3]
- // CHECK:STDOUT: %Convert.specific_fn.loc8: <specific function> = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3]
- // CHECK:STDOUT: %int.convert_checked.loc8_27: init %i32 = call %Convert.specific_fn.loc8(%int_32767.loc8) [template = constants.%int_32767.2]
- // CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %int.convert_checked.loc8_27 [template = constants.%int_32767.2]
- // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_32767.loc8, %.loc8_27.1 [template = constants.%int_32767.2]
- // CHECK:STDOUT: %int.convert_checked.loc8_33: init %i16 = call %Int32ToInt16.ref.loc8(%.loc8_27.2) [template = constants.%int_32767.3]
- // CHECK:STDOUT: %.loc8_34.1: %i16 = value_of_initializer %int.convert_checked.loc8_33 [template = constants.%int_32767.3]
- // CHECK:STDOUT: %.loc8_34.2: %i16 = converted %int.convert_checked.loc8_33, %.loc8_34.1 [template = constants.%int_32767.3]
- // CHECK:STDOUT: %c: %i16 = bind_name c, %.loc8_34.2
- // CHECK:STDOUT: %Int32ToInt16.ref.loc9: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16]
- // CHECK:STDOUT: %NegateI32.ref.loc9: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32]
- // CHECK:STDOUT: %int_32768.loc9: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1]
- // CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc9: <bound method> = bound_method %int_32768.loc9, %impl.elem0.loc9 [template = constants.%Convert.bound.4]
- // CHECK:STDOUT: %Convert.specific_fn.loc9: <specific function> = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4]
- // CHECK:STDOUT: %int.convert_checked.loc9_37: init %i32 = call %Convert.specific_fn.loc9(%int_32768.loc9) [template = constants.%int_32768.2]
- // CHECK:STDOUT: %.loc9_37.1: %i32 = value_of_initializer %int.convert_checked.loc9_37 [template = constants.%int_32768.2]
- // CHECK:STDOUT: %.loc9_37.2: %i32 = converted %int_32768.loc9, %.loc9_37.1 [template = constants.%int_32768.2]
- // CHECK:STDOUT: %int.snegate.loc9: init %i32 = call %NegateI32.ref.loc9(%.loc9_37.2) [template = constants.%int_-32768.1]
- // CHECK:STDOUT: %.loc9_43.1: %i32 = value_of_initializer %int.snegate.loc9 [template = constants.%int_-32768.1]
- // CHECK:STDOUT: %.loc9_43.2: %i32 = converted %int.snegate.loc9, %.loc9_43.1 [template = constants.%int_-32768.1]
- // CHECK:STDOUT: %int.convert_checked.loc9_44: init %i16 = call %Int32ToInt16.ref.loc9(%.loc9_43.2) [template = constants.%int_-32768.2]
- // CHECK:STDOUT: %.loc9_45.1: %i16 = value_of_initializer %int.convert_checked.loc9_44 [template = constants.%int_-32768.2]
- // CHECK:STDOUT: %.loc9_45.2: %i16 = converted %int.convert_checked.loc9_44, %.loc9_45.1 [template = constants.%int_-32768.2]
- // CHECK:STDOUT: %d: %i16 = bind_name d, %.loc9_45.2
- // CHECK:STDOUT: %Uint32ToUint16.ref.loc11: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1]
- // CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc11: <bound method> = bound_method %int_0.loc11, %impl.elem0.loc11 [template = constants.%Convert.bound.1]
- // CHECK:STDOUT: %Convert.specific_fn.loc11: <specific function> = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1]
- // CHECK:STDOUT: %int.convert_checked.loc11_43: init %i32 = call %Convert.specific_fn.loc11(%int_0.loc11) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc11_43.1: %i32 = value_of_initializer %int.convert_checked.loc11_43 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc11_43.2: %i32 = converted %int_0.loc11, %.loc11_43.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %int.convert_checked.loc11_44: init %u32 = call %Int32ToUint32.ref.loc11(%.loc11_43.2) [template = constants.%int_0.4]
- // CHECK:STDOUT: %.loc11_44.1: %u32 = value_of_initializer %int.convert_checked.loc11_44 [template = constants.%int_0.4]
- // CHECK:STDOUT: %.loc11_44.2: %u32 = converted %int.convert_checked.loc11_44, %.loc11_44.1 [template = constants.%int_0.4]
- // CHECK:STDOUT: %int.convert_checked.loc11_45: init %u16 = call %Uint32ToUint16.ref.loc11(%.loc11_44.2) [template = constants.%int_0.3]
- // CHECK:STDOUT: %.loc11_46.1: %u16 = value_of_initializer %int.convert_checked.loc11_45 [template = constants.%int_0.3]
- // CHECK:STDOUT: %.loc11_46.2: %u16 = converted %int.convert_checked.loc11_45, %.loc11_46.1 [template = constants.%int_0.3]
- // CHECK:STDOUT: %e: %u16 = bind_name e, %.loc11_46.2
- // CHECK:STDOUT: %Uint32ToUint16.ref.loc12: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_65535.loc12: Core.IntLiteral = int_value 65535 [template = constants.%int_65535.1]
- // CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc12: <bound method> = bound_method %int_65535.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc12: <specific function> = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12(%int_65535.loc12) [template = constants.%int_65535.2]
- // CHECK:STDOUT: %.loc12_43.1: %i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%int_65535.2]
- // CHECK:STDOUT: %.loc12_43.2: %i32 = converted %int_65535.loc12, %.loc12_43.1 [template = constants.%int_65535.2]
- // CHECK:STDOUT: %int.convert_checked.loc12_49: init %u32 = call %Int32ToUint32.ref.loc12(%.loc12_43.2) [template = constants.%int_65535.4]
- // CHECK:STDOUT: %.loc12_49.1: %u32 = value_of_initializer %int.convert_checked.loc12_49 [template = constants.%int_65535.4]
- // CHECK:STDOUT: %.loc12_49.2: %u32 = converted %int.convert_checked.loc12_49, %.loc12_49.1 [template = constants.%int_65535.4]
- // CHECK:STDOUT: %int.convert_checked.loc12_50: init %u16 = call %Uint32ToUint16.ref.loc12(%.loc12_49.2) [template = constants.%int_65535.3]
- // CHECK:STDOUT: %.loc12_51.1: %u16 = value_of_initializer %int.convert_checked.loc12_50 [template = constants.%int_65535.3]
- // CHECK:STDOUT: %.loc12_51.2: %u16 = converted %int.convert_checked.loc12_50, %.loc12_51.1 [template = constants.%int_65535.3]
- // CHECK:STDOUT: %f: %u16 = bind_name f, %.loc12_51.2
- // CHECK:STDOUT: %Uint32ToInt16.ref.loc14: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc14: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_0.loc14: Core.IntLiteral = int_value 0 [template = constants.%int_0.1]
- // CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc14: <bound method> = bound_method %int_0.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound.1]
- // CHECK:STDOUT: %Convert.specific_fn.loc14: <specific function> = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1]
- // CHECK:STDOUT: %int.convert_checked.loc14_42: init %i32 = call %Convert.specific_fn.loc14(%int_0.loc14) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc14_42.1: %i32 = value_of_initializer %int.convert_checked.loc14_42 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc14_42.2: %i32 = converted %int_0.loc14, %.loc14_42.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %int.convert_checked.loc14_43: init %u32 = call %Int32ToUint32.ref.loc14(%.loc14_42.2) [template = constants.%int_0.4]
- // CHECK:STDOUT: %.loc14_43.1: %u32 = value_of_initializer %int.convert_checked.loc14_43 [template = constants.%int_0.4]
- // CHECK:STDOUT: %.loc14_43.2: %u32 = converted %int.convert_checked.loc14_43, %.loc14_43.1 [template = constants.%int_0.4]
- // CHECK:STDOUT: %int.convert_checked.loc14_44: init %i16 = call %Uint32ToInt16.ref.loc14(%.loc14_43.2) [template = constants.%int_0.5]
- // CHECK:STDOUT: %.loc14_45.1: %i16 = value_of_initializer %int.convert_checked.loc14_44 [template = constants.%int_0.5]
- // CHECK:STDOUT: %.loc14_45.2: %i16 = converted %int.convert_checked.loc14_44, %.loc14_45.1 [template = constants.%int_0.5]
- // CHECK:STDOUT: %g: %i16 = bind_name g, %.loc14_45.2
- // CHECK:STDOUT: %Uint32ToInt16.ref.loc15: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc15: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_32767.loc15: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1]
- // CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc15: <bound method> = bound_method %int_32767.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound.3]
- // CHECK:STDOUT: %Convert.specific_fn.loc15: <specific function> = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3]
- // CHECK:STDOUT: %int.convert_checked.loc15_42: init %i32 = call %Convert.specific_fn.loc15(%int_32767.loc15) [template = constants.%int_32767.2]
- // CHECK:STDOUT: %.loc15_42.1: %i32 = value_of_initializer %int.convert_checked.loc15_42 [template = constants.%int_32767.2]
- // CHECK:STDOUT: %.loc15_42.2: %i32 = converted %int_32767.loc15, %.loc15_42.1 [template = constants.%int_32767.2]
- // CHECK:STDOUT: %int.convert_checked.loc15_48: init %u32 = call %Int32ToUint32.ref.loc15(%.loc15_42.2) [template = constants.%int_32767.4]
- // CHECK:STDOUT: %.loc15_48.1: %u32 = value_of_initializer %int.convert_checked.loc15_48 [template = constants.%int_32767.4]
- // CHECK:STDOUT: %.loc15_48.2: %u32 = converted %int.convert_checked.loc15_48, %.loc15_48.1 [template = constants.%int_32767.4]
- // CHECK:STDOUT: %int.convert_checked.loc15_49: init %i16 = call %Uint32ToInt16.ref.loc15(%.loc15_48.2) [template = constants.%int_32767.3]
- // CHECK:STDOUT: %.loc15_50.1: %i16 = value_of_initializer %int.convert_checked.loc15_49 [template = constants.%int_32767.3]
- // CHECK:STDOUT: %.loc15_50.2: %i16 = converted %int.convert_checked.loc15_49, %.loc15_50.1 [template = constants.%int_32767.3]
- // CHECK:STDOUT: %h: %i16 = bind_name h, %.loc15_50.2
- // CHECK:STDOUT: %IntLiteralToInt16.ref.loc17: %IntLiteralToInt16.type = name_ref IntLiteralToInt16, imports.%import_ref.14 [template = constants.%IntLiteralToInt16]
- // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc17: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral]
- // CHECK:STDOUT: %NegateI32.ref.loc17: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32]
- // CHECK:STDOUT: %int_32768.loc17: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1]
- // CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc17: <bound method> = bound_method %int_32768.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.4]
- // CHECK:STDOUT: %Convert.specific_fn.loc17: <specific function> = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4]
- // CHECK:STDOUT: %int.convert_checked.loc17_70: init %i32 = call %Convert.specific_fn.loc17(%int_32768.loc17) [template = constants.%int_32768.2]
- // CHECK:STDOUT: %.loc17_70.1: %i32 = value_of_initializer %int.convert_checked.loc17_70 [template = constants.%int_32768.2]
- // CHECK:STDOUT: %.loc17_70.2: %i32 = converted %int_32768.loc17, %.loc17_70.1 [template = constants.%int_32768.2]
- // CHECK:STDOUT: %int.snegate.loc17: init %i32 = call %NegateI32.ref.loc17(%.loc17_70.2) [template = constants.%int_-32768.1]
- // CHECK:STDOUT: %.loc17_76.1: %i32 = value_of_initializer %int.snegate.loc17 [template = constants.%int_-32768.1]
- // CHECK:STDOUT: %.loc17_76.2: %i32 = converted %int.snegate.loc17, %.loc17_76.1 [template = constants.%int_-32768.1]
- // CHECK:STDOUT: %int.convert_checked.loc17_77: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc17(%.loc17_76.2) [template = constants.%int_-32768.3]
- // CHECK:STDOUT: %.loc17_77.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc17_77 [template = constants.%int_-32768.3]
- // CHECK:STDOUT: %.loc17_77.2: Core.IntLiteral = converted %int.convert_checked.loc17_77, %.loc17_77.1 [template = constants.%int_-32768.3]
- // CHECK:STDOUT: %int.convert_checked.loc17_78: init %i16 = call %IntLiteralToInt16.ref.loc17(%.loc17_77.2) [template = constants.%int_-32768.2]
- // CHECK:STDOUT: %.loc17_79.1: %i16 = value_of_initializer %int.convert_checked.loc17_78 [template = constants.%int_-32768.2]
- // CHECK:STDOUT: %.loc17_79.2: %i16 = converted %int.convert_checked.loc17_78, %.loc17_79.1 [template = constants.%int_-32768.2]
- // CHECK:STDOUT: %lit_i16_min: %i16 = bind_name lit_i16_min, %.loc17_79.2
- // CHECK:STDOUT: %IntLiteralToInt16.ref.loc18: %IntLiteralToInt16.type = name_ref IntLiteralToInt16, imports.%import_ref.14 [template = constants.%IntLiteralToInt16]
- // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc18: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral]
- // CHECK:STDOUT: %int_32767.loc18: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1]
- // CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc18: <bound method> = bound_method %int_32767.loc18, %impl.elem0.loc18 [template = constants.%Convert.bound.3]
- // CHECK:STDOUT: %Convert.specific_fn.loc18: <specific function> = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3]
- // CHECK:STDOUT: %int.convert_checked.loc18_60: init %i32 = call %Convert.specific_fn.loc18(%int_32767.loc18) [template = constants.%int_32767.2]
- // CHECK:STDOUT: %.loc18_60.1: %i32 = value_of_initializer %int.convert_checked.loc18_60 [template = constants.%int_32767.2]
- // CHECK:STDOUT: %.loc18_60.2: %i32 = converted %int_32767.loc18, %.loc18_60.1 [template = constants.%int_32767.2]
- // CHECK:STDOUT: %int.convert_checked.loc18_66: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc18(%.loc18_60.2) [template = constants.%int_32767.1]
- // CHECK:STDOUT: %.loc18_66.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc18_66 [template = constants.%int_32767.1]
- // CHECK:STDOUT: %.loc18_66.2: Core.IntLiteral = converted %int.convert_checked.loc18_66, %.loc18_66.1 [template = constants.%int_32767.1]
- // CHECK:STDOUT: %int.convert_checked.loc18_67: init %i16 = call %IntLiteralToInt16.ref.loc18(%.loc18_66.2) [template = constants.%int_32767.3]
- // CHECK:STDOUT: %.loc18_68.1: %i16 = value_of_initializer %int.convert_checked.loc18_67 [template = constants.%int_32767.3]
- // CHECK:STDOUT: %.loc18_68.2: %i16 = converted %int.convert_checked.loc18_67, %.loc18_68.1 [template = constants.%int_32767.3]
- // CHECK:STDOUT: %lit_i16_max: %i16 = bind_name lit_i16_max, %.loc18_68.2
- // CHECK:STDOUT: %IntLiteralToUint16.ref.loc20: %IntLiteralToUint16.type = name_ref IntLiteralToUint16, imports.%import_ref.15 [template = constants.%IntLiteralToUint16]
- // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc20: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral]
- // CHECK:STDOUT: %int_0.loc20: Core.IntLiteral = int_value 0 [template = constants.%int_0.1]
- // CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc20: <bound method> = bound_method %int_0.loc20, %impl.elem0.loc20 [template = constants.%Convert.bound.1]
- // CHECK:STDOUT: %Convert.specific_fn.loc20: <specific function> = specific_function %Convert.bound.loc20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1]
- // CHECK:STDOUT: %int.convert_checked.loc20_61: init %i32 = call %Convert.specific_fn.loc20(%int_0.loc20) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc20_61.1: %i32 = value_of_initializer %int.convert_checked.loc20_61 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc20_61.2: %i32 = converted %int_0.loc20, %.loc20_61.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %int.convert_checked.loc20_62: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc20(%.loc20_61.2) [template = constants.%int_0.1]
- // CHECK:STDOUT: %.loc20_62.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc20_62 [template = constants.%int_0.1]
- // CHECK:STDOUT: %.loc20_62.2: Core.IntLiteral = converted %int.convert_checked.loc20_62, %.loc20_62.1 [template = constants.%int_0.1]
- // CHECK:STDOUT: %int.convert_checked.loc20_63: init %u16 = call %IntLiteralToUint16.ref.loc20(%.loc20_62.2) [template = constants.%int_0.3]
- // CHECK:STDOUT: %.loc20_64.1: %u16 = value_of_initializer %int.convert_checked.loc20_63 [template = constants.%int_0.3]
- // CHECK:STDOUT: %.loc20_64.2: %u16 = converted %int.convert_checked.loc20_63, %.loc20_64.1 [template = constants.%int_0.3]
- // CHECK:STDOUT: %lit_u16_min: %u16 = bind_name lit_u16_min, %.loc20_64.2
- // CHECK:STDOUT: %IntLiteralToUint16.ref.loc21: %IntLiteralToUint16.type = name_ref IntLiteralToUint16, imports.%import_ref.15 [template = constants.%IntLiteralToUint16]
- // CHECK:STDOUT: %Int32ToIntLiteral.ref.loc21: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral]
- // CHECK:STDOUT: %int_65535.loc21: Core.IntLiteral = int_value 65535 [template = constants.%int_65535.1]
- // CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc21: <bound method> = bound_method %int_65535.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc21: <specific function> = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc21_61: init %i32 = call %Convert.specific_fn.loc21(%int_65535.loc21) [template = constants.%int_65535.2]
- // CHECK:STDOUT: %.loc21_61.1: %i32 = value_of_initializer %int.convert_checked.loc21_61 [template = constants.%int_65535.2]
- // CHECK:STDOUT: %.loc21_61.2: %i32 = converted %int_65535.loc21, %.loc21_61.1 [template = constants.%int_65535.2]
- // CHECK:STDOUT: %int.convert_checked.loc21_67: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc21(%.loc21_61.2) [template = constants.%int_65535.1]
- // CHECK:STDOUT: %.loc21_67.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc21_67 [template = constants.%int_65535.1]
- // CHECK:STDOUT: %.loc21_67.2: Core.IntLiteral = converted %int.convert_checked.loc21_67, %.loc21_67.1 [template = constants.%int_65535.1]
- // CHECK:STDOUT: %int.convert_checked.loc21_68: init %u16 = call %IntLiteralToUint16.ref.loc21(%.loc21_67.2) [template = constants.%int_65535.3]
- // CHECK:STDOUT: %.loc21_69.1: %u16 = value_of_initializer %int.convert_checked.loc21_68 [template = constants.%int_65535.3]
- // CHECK:STDOUT: %.loc21_69.2: %u16 = converted %int.convert_checked.loc21_68, %.loc21_69.1 [template = constants.%int_65535.3]
- // CHECK:STDOUT: %lit_u16_max: %u16 = bind_name lit_u16_max, %.loc21_69.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- zero_extend.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template]
- // CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template]
- // CHECK:STDOUT: %Uint32ToUint64.type: type = fn_type @Uint32ToUint64 [template]
- // CHECK:STDOUT: %Uint32ToUint64: %Uint32ToUint64.type = struct_value () [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template]
- // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template]
- // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound.1: <bound method> = bound_method %int_0.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.1: <specific function> = specific_function %Convert.bound.1, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template]
- // CHECK:STDOUT: %int_0.3: %u32 = int_value 0 [template]
- // CHECK:STDOUT: %int_0.4: %u64 = int_value 0 [template]
- // CHECK:STDOUT: %AddU32.type: type = fn_type @AddU32 [template]
- // CHECK:STDOUT: %AddU32: %AddU32.type = struct_value () [template]
- // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template]
- // CHECK:STDOUT: %Convert.bound.2: <bound method> = bound_method %int_2147483647.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.2: <specific function> = specific_function %Convert.bound.2, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template]
- // CHECK:STDOUT: %int_2147483647.3: %u32 = int_value 2147483647 [template]
- // CHECK:STDOUT: %int_4294967294: %u32 = int_value 4294967294 [template]
- // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template]
- // CHECK:STDOUT: %Convert.bound.3: <bound method> = bound_method %int_1.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.3: <specific function> = specific_function %Convert.bound.3, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template]
- // CHECK:STDOUT: %int_1.3: %u32 = int_value 1 [template]
- // CHECK:STDOUT: %int_4294967295.1: %u32 = int_value 4294967295 [template]
- // CHECK:STDOUT: %int_4294967295.2: %u64 = int_value 4294967295 [template]
- // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template]
- // CHECK:STDOUT: %Uint32ToInt64.type: type = fn_type @Uint32ToInt64 [template]
- // CHECK:STDOUT: %Uint32ToInt64: %Uint32ToInt64.type = struct_value () [template]
- // CHECK:STDOUT: %int_0.5: %i64 = int_value 0 [template]
- // CHECK:STDOUT: %int_4294967295.3: %i64 = int_value 4294967295 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded
- // CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded
- // CHECK:STDOUT: %import_ref.3: %AddU32.type = import_ref Main//int_ops, AddU32, loaded [template = constants.%AddU32]
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18: %Uint32ToInt64.type = import_ref Main//int_ops, Uint32ToInt64, loaded [template = constants.%Uint32ToInt64]
- // CHECK:STDOUT: %import_ref.19: %Uint32ToUint64.type = import_ref Main//int_ops, Uint32ToUint64, loaded [template = constants.%Uint32ToUint64]
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .UInt = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.29
- // CHECK:STDOUT: .Int = %import_ref.217
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .a = @__global_init.%a
- // CHECK:STDOUT: .b = @__global_init.%b
- // CHECK:STDOUT: .c = @__global_init.%c
- // CHECK:STDOUT: .d = @__global_init.%d
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToUint64(%a.param_patt: %u32) -> %u64 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @AddU32(%a.param_patt: %u32, %b.param_patt: %u32) -> %u32 = "int.uadd" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToInt64(%a.param_patt: %u32) -> %i64 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Uint32ToUint64.ref.loc5: %Uint32ToUint64.type = name_ref Uint32ToUint64, imports.%import_ref.19 [template = constants.%Uint32ToUint64]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc5: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_0.loc5: Core.IntLiteral = int_value 0 [template = constants.%int_0.1]
- // CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc5: <bound method> = bound_method %int_0.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound.1]
- // CHECK:STDOUT: %Convert.specific_fn.loc5: <specific function> = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1]
- // CHECK:STDOUT: %int.convert_checked.loc5_43: init %i32 = call %Convert.specific_fn.loc5(%int_0.loc5) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc5_43.1: %i32 = value_of_initializer %int.convert_checked.loc5_43 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc5_43.2: %i32 = converted %int_0.loc5, %.loc5_43.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %int.convert_checked.loc5_44: init %u32 = call %Int32ToUint32.ref.loc5(%.loc5_43.2) [template = constants.%int_0.3]
- // CHECK:STDOUT: %.loc5_44.1: %u32 = value_of_initializer %int.convert_checked.loc5_44 [template = constants.%int_0.3]
- // CHECK:STDOUT: %.loc5_44.2: %u32 = converted %int.convert_checked.loc5_44, %.loc5_44.1 [template = constants.%int_0.3]
- // CHECK:STDOUT: %int.convert_checked.loc5_45: init %u64 = call %Uint32ToUint64.ref.loc5(%.loc5_44.2) [template = constants.%int_0.4]
- // CHECK:STDOUT: %.loc5_46.1: %u64 = value_of_initializer %int.convert_checked.loc5_45 [template = constants.%int_0.4]
- // CHECK:STDOUT: %.loc5_46.2: %u64 = converted %int.convert_checked.loc5_45, %.loc5_46.1 [template = constants.%int_0.4]
- // CHECK:STDOUT: %a: %u64 = bind_name a, %.loc5_46.2
- // CHECK:STDOUT: %Uint32ToUint64.ref.loc6: %Uint32ToUint64.type = name_ref Uint32ToUint64, imports.%import_ref.19 [template = constants.%Uint32ToUint64]
- // CHECK:STDOUT: %AddU32.ref.loc7: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32]
- // CHECK:STDOUT: %AddU32.ref.loc8: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc8_12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_2147483647.loc8_26: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1]
- // CHECK:STDOUT: %impl.elem0.loc8_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc8_26: <bound method> = bound_method %int_2147483647.loc8_26, %impl.elem0.loc8_26 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc8_26: <specific function> = specific_function %Convert.bound.loc8_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc8_26: init %i32 = call %Convert.specific_fn.loc8_26(%int_2147483647.loc8_26) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc8_26.1: %i32 = value_of_initializer %int.convert_checked.loc8_26 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc8_26.2: %i32 = converted %int_2147483647.loc8_26, %.loc8_26.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %int.convert_checked.loc8_37: init %u32 = call %Int32ToUint32.ref.loc8_12(%.loc8_26.2) [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc8_40: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_2147483647.loc8_54: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1]
- // CHECK:STDOUT: %impl.elem0.loc8_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc8_54: <bound method> = bound_method %int_2147483647.loc8_54, %impl.elem0.loc8_54 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc8_54: <specific function> = specific_function %Convert.bound.loc8_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc8_54: init %i32 = call %Convert.specific_fn.loc8_54(%int_2147483647.loc8_54) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc8_54.1: %i32 = value_of_initializer %int.convert_checked.loc8_54 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc8_54.2: %i32 = converted %int_2147483647.loc8_54, %.loc8_54.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %int.convert_checked.loc8_65: init %u32 = call %Int32ToUint32.ref.loc8_40(%.loc8_54.2) [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc8_37.1: %u32 = value_of_initializer %int.convert_checked.loc8_37 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc8_37.2: %u32 = converted %int.convert_checked.loc8_37, %.loc8_37.1 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc8_65.1: %u32 = value_of_initializer %int.convert_checked.loc8_65 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc8_65.2: %u32 = converted %int.convert_checked.loc8_65, %.loc8_65.1 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %int.uadd.loc8: init %u32 = call %AddU32.ref.loc8(%.loc8_37.2, %.loc8_65.2) [template = constants.%int_4294967294]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc9: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
- // CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc9: <bound method> = bound_method %int_1.loc9, %impl.elem0.loc9 [template = constants.%Convert.bound.3]
- // CHECK:STDOUT: %Convert.specific_fn.loc9: <specific function> = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3]
- // CHECK:STDOUT: %int.convert_checked.loc9_19: init %i32 = call %Convert.specific_fn.loc9(%int_1.loc9) [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc9_19.1: %i32 = value_of_initializer %int.convert_checked.loc9_19 [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc9_19.2: %i32 = converted %int_1.loc9, %.loc9_19.1 [template = constants.%int_1.2]
- // CHECK:STDOUT: %int.convert_checked.loc9_20: init %u32 = call %Int32ToUint32.ref.loc9(%.loc9_19.2) [template = constants.%int_1.3]
- // CHECK:STDOUT: %.loc8_66.1: %u32 = value_of_initializer %int.uadd.loc8 [template = constants.%int_4294967294]
- // CHECK:STDOUT: %.loc8_66.2: %u32 = converted %int.uadd.loc8, %.loc8_66.1 [template = constants.%int_4294967294]
- // CHECK:STDOUT: %.loc9_20.1: %u32 = value_of_initializer %int.convert_checked.loc9_20 [template = constants.%int_1.3]
- // CHECK:STDOUT: %.loc9_20.2: %u32 = converted %int.convert_checked.loc9_20, %.loc9_20.1 [template = constants.%int_1.3]
- // CHECK:STDOUT: %int.uadd.loc9: init %u32 = call %AddU32.ref.loc7(%.loc8_66.2, %.loc9_20.2) [template = constants.%int_4294967295.1]
- // CHECK:STDOUT: %.loc9_21.1: %u32 = value_of_initializer %int.uadd.loc9 [template = constants.%int_4294967295.1]
- // CHECK:STDOUT: %.loc9_21.2: %u32 = converted %int.uadd.loc9, %.loc9_21.1 [template = constants.%int_4294967295.1]
- // CHECK:STDOUT: %int.convert_checked.loc9_22: init %u64 = call %Uint32ToUint64.ref.loc6(%.loc9_21.2) [template = constants.%int_4294967295.2]
- // CHECK:STDOUT: %.loc9_23.1: %u64 = value_of_initializer %int.convert_checked.loc9_22 [template = constants.%int_4294967295.2]
- // CHECK:STDOUT: %.loc9_23.2: %u64 = converted %int.convert_checked.loc9_22, %.loc9_23.1 [template = constants.%int_4294967295.2]
- // CHECK:STDOUT: %b: %u64 = bind_name b, %.loc9_23.2
- // CHECK:STDOUT: %Uint32ToInt64.ref.loc11: %Uint32ToInt64.type = name_ref Uint32ToInt64, imports.%import_ref.18 [template = constants.%Uint32ToInt64]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1]
- // CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc11: <bound method> = bound_method %int_0.loc11, %impl.elem0.loc11 [template = constants.%Convert.bound.1]
- // CHECK:STDOUT: %Convert.specific_fn.loc11: <specific function> = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1]
- // CHECK:STDOUT: %int.convert_checked.loc11_42: init %i32 = call %Convert.specific_fn.loc11(%int_0.loc11) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc11_42.1: %i32 = value_of_initializer %int.convert_checked.loc11_42 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc11_42.2: %i32 = converted %int_0.loc11, %.loc11_42.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %int.convert_checked.loc11_43: init %u32 = call %Int32ToUint32.ref.loc11(%.loc11_42.2) [template = constants.%int_0.3]
- // CHECK:STDOUT: %.loc11_43.1: %u32 = value_of_initializer %int.convert_checked.loc11_43 [template = constants.%int_0.3]
- // CHECK:STDOUT: %.loc11_43.2: %u32 = converted %int.convert_checked.loc11_43, %.loc11_43.1 [template = constants.%int_0.3]
- // CHECK:STDOUT: %int.convert_checked.loc11_44: init %i64 = call %Uint32ToInt64.ref.loc11(%.loc11_43.2) [template = constants.%int_0.5]
- // CHECK:STDOUT: %.loc11_45.1: %i64 = value_of_initializer %int.convert_checked.loc11_44 [template = constants.%int_0.5]
- // CHECK:STDOUT: %.loc11_45.2: %i64 = converted %int.convert_checked.loc11_44, %.loc11_45.1 [template = constants.%int_0.5]
- // CHECK:STDOUT: %c: %i64 = bind_name c, %.loc11_45.2
- // CHECK:STDOUT: %Uint32ToInt64.ref.loc12: %Uint32ToInt64.type = name_ref Uint32ToInt64, imports.%import_ref.18 [template = constants.%Uint32ToInt64]
- // CHECK:STDOUT: %AddU32.ref.loc13: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32]
- // CHECK:STDOUT: %AddU32.ref.loc14: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc14_12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_2147483647.loc14_26: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1]
- // CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc14_26: <bound method> = bound_method %int_2147483647.loc14_26, %impl.elem0.loc14_26 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc14_26: <specific function> = specific_function %Convert.bound.loc14_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %Convert.specific_fn.loc14_26(%int_2147483647.loc14_26) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc14_26.1: %i32 = value_of_initializer %int.convert_checked.loc14_26 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc14_26.2: %i32 = converted %int_2147483647.loc14_26, %.loc14_26.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %int.convert_checked.loc14_37: init %u32 = call %Int32ToUint32.ref.loc14_12(%.loc14_26.2) [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc14_40: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_2147483647.loc14_54: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1]
- // CHECK:STDOUT: %impl.elem0.loc14_54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc14_54: <bound method> = bound_method %int_2147483647.loc14_54, %impl.elem0.loc14_54 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc14_54: <specific function> = specific_function %Convert.bound.loc14_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc14_54: init %i32 = call %Convert.specific_fn.loc14_54(%int_2147483647.loc14_54) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc14_54.1: %i32 = value_of_initializer %int.convert_checked.loc14_54 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc14_54.2: %i32 = converted %int_2147483647.loc14_54, %.loc14_54.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %int.convert_checked.loc14_65: init %u32 = call %Int32ToUint32.ref.loc14_40(%.loc14_54.2) [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc14_37.1: %u32 = value_of_initializer %int.convert_checked.loc14_37 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc14_37.2: %u32 = converted %int.convert_checked.loc14_37, %.loc14_37.1 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc14_65.1: %u32 = value_of_initializer %int.convert_checked.loc14_65 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc14_65.2: %u32 = converted %int.convert_checked.loc14_65, %.loc14_65.1 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %int.uadd.loc14: init %u32 = call %AddU32.ref.loc14(%.loc14_37.2, %.loc14_65.2) [template = constants.%int_4294967294]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc15: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
- // CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc15: <bound method> = bound_method %int_1.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound.3]
- // CHECK:STDOUT: %Convert.specific_fn.loc15: <specific function> = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3]
- // CHECK:STDOUT: %int.convert_checked.loc15_19: init %i32 = call %Convert.specific_fn.loc15(%int_1.loc15) [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc15_19.1: %i32 = value_of_initializer %int.convert_checked.loc15_19 [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc15_19.2: %i32 = converted %int_1.loc15, %.loc15_19.1 [template = constants.%int_1.2]
- // CHECK:STDOUT: %int.convert_checked.loc15_20: init %u32 = call %Int32ToUint32.ref.loc15(%.loc15_19.2) [template = constants.%int_1.3]
- // CHECK:STDOUT: %.loc14_66.1: %u32 = value_of_initializer %int.uadd.loc14 [template = constants.%int_4294967294]
- // CHECK:STDOUT: %.loc14_66.2: %u32 = converted %int.uadd.loc14, %.loc14_66.1 [template = constants.%int_4294967294]
- // CHECK:STDOUT: %.loc15_20.1: %u32 = value_of_initializer %int.convert_checked.loc15_20 [template = constants.%int_1.3]
- // CHECK:STDOUT: %.loc15_20.2: %u32 = converted %int.convert_checked.loc15_20, %.loc15_20.1 [template = constants.%int_1.3]
- // CHECK:STDOUT: %int.uadd.loc15: init %u32 = call %AddU32.ref.loc13(%.loc14_66.2, %.loc15_20.2) [template = constants.%int_4294967295.1]
- // CHECK:STDOUT: %.loc15_21.1: %u32 = value_of_initializer %int.uadd.loc15 [template = constants.%int_4294967295.1]
- // CHECK:STDOUT: %.loc15_21.2: %u32 = converted %int.uadd.loc15, %.loc15_21.1 [template = constants.%int_4294967295.1]
- // CHECK:STDOUT: %int.convert_checked.loc15_22: init %i64 = call %Uint32ToInt64.ref.loc12(%.loc15_21.2) [template = constants.%int_4294967295.3]
- // CHECK:STDOUT: %.loc15_23.1: %i64 = value_of_initializer %int.convert_checked.loc15_22 [template = constants.%int_4294967295.3]
- // CHECK:STDOUT: %.loc15_23.2: %i64 = converted %int.convert_checked.loc15_22, %.loc15_23.1 [template = constants.%int_4294967295.3]
- // CHECK:STDOUT: %d: %i64 = bind_name d, %.loc15_23.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- sign_extend.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template]
- // CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template]
- // CHECK:STDOUT: %Int32ToUint64.type: type = fn_type @Int32ToUint64 [template]
- // CHECK:STDOUT: %Int32ToUint64: %Int32ToUint64.type = struct_value () [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound.1: <bound method> = bound_method %int_0.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.1: <specific function> = specific_function %Convert.bound.1, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template]
- // CHECK:STDOUT: %int_0.3: %u64 = int_value 0 [template]
- // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template]
- // CHECK:STDOUT: %Convert.bound.2: <bound method> = bound_method %int_2147483647.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.2: <specific function> = specific_function %Convert.bound.2, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template]
- // CHECK:STDOUT: %int_2147483647.3: %u64 = int_value 2147483647 [template]
- // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template]
- // CHECK:STDOUT: %Int32ToInt64.type: type = fn_type @Int32ToInt64 [template]
- // CHECK:STDOUT: %Int32ToInt64: %Int32ToInt64.type = struct_value () [template]
- // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template]
- // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template]
- // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template]
- // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template]
- // CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template]
- // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template]
- // CHECK:STDOUT: %Convert.bound.3: <bound method> = bound_method %int_1.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.3: <specific function> = specific_function %Convert.bound.3, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template]
- // CHECK:STDOUT: %int_-2147483648.1: %i32 = int_value -2147483648 [template]
- // CHECK:STDOUT: %int_-2147483648.2: %i64 = int_value -2147483648 [template]
- // CHECK:STDOUT: %int_2147483647.4: %i64 = int_value 2147483647 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, NegateI32, loaded [template = constants.%NegateI32]
- // CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32]
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16: %Int32ToInt64.type = import_ref Main//int_ops, Int32ToInt64, loaded [template = constants.%Int32ToInt64]
- // CHECK:STDOUT: %import_ref.17: %Int32ToUint64.type = import_ref Main//int_ops, Int32ToUint64, loaded [template = constants.%Int32ToUint64]
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .UInt = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.29
- // CHECK:STDOUT: .Int = %import_ref.217
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .a = @__global_init.%a
- // CHECK:STDOUT: .b = @__global_init.%b
- // CHECK:STDOUT: .c = @__global_init.%c
- // CHECK:STDOUT: .d = @__global_init.%d
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToInt64(%a.param_patt: %i32) -> %i64 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Int32ToUint64.ref.loc5: %Int32ToUint64.type = name_ref Int32ToUint64, imports.%import_ref.17 [template = constants.%Int32ToUint64]
- // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1]
- // CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc5: <bound method> = bound_method %int_0, %impl.elem0.loc5 [template = constants.%Convert.bound.1]
- // CHECK:STDOUT: %Convert.specific_fn.loc5: <specific function> = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1]
- // CHECK:STDOUT: %int.convert_checked.loc5_28: init %i32 = call %Convert.specific_fn.loc5(%int_0) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc5_28.1: %i32 = value_of_initializer %int.convert_checked.loc5_28 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc5_28.2: %i32 = converted %int_0, %.loc5_28.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %int.convert_checked.loc5_29: init %u64 = call %Int32ToUint64.ref.loc5(%.loc5_28.2) [template = constants.%int_0.3]
- // CHECK:STDOUT: %.loc5_30.1: %u64 = value_of_initializer %int.convert_checked.loc5_29 [template = constants.%int_0.3]
- // CHECK:STDOUT: %.loc5_30.2: %u64 = converted %int.convert_checked.loc5_29, %.loc5_30.1 [template = constants.%int_0.3]
- // CHECK:STDOUT: %a: %u64 = bind_name a, %.loc5_30.2
- // CHECK:STDOUT: %Int32ToUint64.ref.loc6: %Int32ToUint64.type = name_ref Int32ToUint64, imports.%import_ref.17 [template = constants.%Int32ToUint64]
- // CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1]
- // CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc6: <bound method> = bound_method %int_2147483647.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc6: <specific function> = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6(%int_2147483647.loc6) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc6_28.1: %i32 = value_of_initializer %int.convert_checked.loc6_28 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc6_28.2: %i32 = converted %int_2147483647.loc6, %.loc6_28.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %int.convert_checked.loc6_39: init %u64 = call %Int32ToUint64.ref.loc6(%.loc6_28.2) [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc6_40.1: %u64 = value_of_initializer %int.convert_checked.loc6_39 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc6_40.2: %u64 = converted %int.convert_checked.loc6_39, %.loc6_40.1 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %b: %u64 = bind_name b, %.loc6_40.2
- // CHECK:STDOUT: %Int32ToInt64.ref.loc8: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%import_ref.16 [template = constants.%Int32ToInt64]
- // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32]
- // CHECK:STDOUT: %NegateI32.ref: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32]
- // CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1]
- // CHECK:STDOUT: %impl.elem0.loc8_44: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc8_44: <bound method> = bound_method %int_2147483647.loc8, %impl.elem0.loc8_44 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc8_44: <specific function> = specific_function %Convert.bound.loc8_44, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc8_44: init %i32 = call %Convert.specific_fn.loc8_44(%int_2147483647.loc8) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc8_44.1: %i32 = value_of_initializer %int.convert_checked.loc8_44 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc8_44.2: %i32 = converted %int_2147483647.loc8, %.loc8_44.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %int.snegate: init %i32 = call %NegateI32.ref(%.loc8_44.2) [template = constants.%int_-2147483647]
- // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
- // CHECK:STDOUT: %.loc8_55.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-2147483647]
- // CHECK:STDOUT: %.loc8_55.2: %i32 = converted %int.snegate, %.loc8_55.1 [template = constants.%int_-2147483647]
- // CHECK:STDOUT: %impl.elem0.loc8_58: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc8_58: <bound method> = bound_method %int_1, %impl.elem0.loc8_58 [template = constants.%Convert.bound.3]
- // CHECK:STDOUT: %Convert.specific_fn.loc8_58: <specific function> = specific_function %Convert.bound.loc8_58, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3]
- // CHECK:STDOUT: %int.convert_checked.loc8_58: init %i32 = call %Convert.specific_fn.loc8_58(%int_1) [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc8_58.1: %i32 = value_of_initializer %int.convert_checked.loc8_58 [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc8_58.2: %i32 = converted %int_1, %.loc8_58.1 [template = constants.%int_1.2]
- // CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc8_55.2, %.loc8_58.2) [template = constants.%int_-2147483648.1]
- // CHECK:STDOUT: %.loc8_59.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_-2147483648.1]
- // CHECK:STDOUT: %.loc8_59.2: %i32 = converted %int.ssub, %.loc8_59.1 [template = constants.%int_-2147483648.1]
- // CHECK:STDOUT: %int.convert_checked.loc8_60: init %i64 = call %Int32ToInt64.ref.loc8(%.loc8_59.2) [template = constants.%int_-2147483648.2]
- // CHECK:STDOUT: %.loc8_61.1: %i64 = value_of_initializer %int.convert_checked.loc8_60 [template = constants.%int_-2147483648.2]
- // CHECK:STDOUT: %.loc8_61.2: %i64 = converted %int.convert_checked.loc8_60, %.loc8_61.1 [template = constants.%int_-2147483648.2]
- // CHECK:STDOUT: %c: %i64 = bind_name c, %.loc8_61.2
- // CHECK:STDOUT: %Int32ToInt64.ref.loc9: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%import_ref.16 [template = constants.%Int32ToInt64]
- // CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1]
- // CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc9: <bound method> = bound_method %int_2147483647.loc9, %impl.elem0.loc9 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc9: <specific function> = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc9_27: init %i32 = call %Convert.specific_fn.loc9(%int_2147483647.loc9) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %int.convert_checked.loc9_27 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_2147483647.loc9, %.loc9_27.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %int.convert_checked.loc9_38: init %i64 = call %Int32ToInt64.ref.loc9(%.loc9_27.2) [template = constants.%int_2147483647.4]
- // CHECK:STDOUT: %.loc9_39.1: %i64 = value_of_initializer %int.convert_checked.loc9_38 [template = constants.%int_2147483647.4]
- // CHECK:STDOUT: %.loc9_39.2: %i64 = converted %int.convert_checked.loc9_38, %.loc9_39.1 [template = constants.%int_2147483647.4]
- // CHECK:STDOUT: %d: %i64 = bind_name d, %.loc9_39.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_too_large_u32_for_i32.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %Uint32ToInt32.type: type = fn_type @Uint32ToInt32 [template]
- // CHECK:STDOUT: %Uint32ToInt32: %Uint32ToInt32.type = struct_value () [template]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template]
- // CHECK:STDOUT: %AddU32.type: type = fn_type @AddU32 [template]
- // CHECK:STDOUT: %AddU32: %AddU32.type = struct_value () [template]
- // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template]
- // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template]
- // CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound.1: <bound method> = bound_method %int_2147483647.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.1: <specific function> = specific_function %Convert.bound.1, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template]
- // CHECK:STDOUT: %int_2147483647.3: %u32 = int_value 2147483647 [template]
- // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template]
- // CHECK:STDOUT: %Convert.bound.2: <bound method> = bound_method %int_1.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.2: <specific function> = specific_function %Convert.bound.2, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template]
- // CHECK:STDOUT: %int_1.3: %u32 = int_value 1 [template]
- // CHECK:STDOUT: %int_2147483648.1: %u32 = int_value 2147483648 [template]
- // CHECK:STDOUT: %int_2147483648.2: %i32 = int_value 2147483648 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded
- // CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded
- // CHECK:STDOUT: %import_ref.3: %AddU32.type = import_ref Main//int_ops, AddU32, loaded [template = constants.%AddU32]
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %import_ref.7: %Uint32ToInt32.type = import_ref Main//int_ops, Uint32ToInt32, loaded [template = constants.%Uint32ToInt32]
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .Int = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.29
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .max_plus_one = @__global_init.%max_plus_one
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %u32) -> %i32 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @AddU32(%a.param_patt: %u32, %b.param_patt: %u32) -> %u32 = "int.uadd" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Uint32ToInt32.ref: %Uint32ToInt32.type = name_ref Uint32ToInt32, imports.%import_ref.7 [template = constants.%Uint32ToInt32]
- // CHECK:STDOUT: %AddU32.ref: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1]
- // CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc11: <bound method> = bound_method %int_2147483647, %impl.elem0.loc11 [template = constants.%Convert.bound.1]
- // CHECK:STDOUT: %Convert.specific_fn.loc11: <specific function> = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1]
- // CHECK:STDOUT: %int.convert_checked.loc11_26: init %i32 = call %Convert.specific_fn.loc11(%int_2147483647) [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc11_26.1: %i32 = value_of_initializer %int.convert_checked.loc11_26 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %.loc11_26.2: %i32 = converted %int_2147483647, %.loc11_26.1 [template = constants.%int_2147483647.2]
- // CHECK:STDOUT: %int.convert_checked.loc11_37: init %u32 = call %Int32ToUint32.ref.loc11(%.loc11_26.2) [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %Int32ToUint32.ref.loc12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
- // CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc12: <bound method> = bound_method %int_1, %impl.elem0.loc12 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc12: <specific function> = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc12_26: init %i32 = call %Convert.specific_fn.loc12(%int_1) [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc12_26.1: %i32 = value_of_initializer %int.convert_checked.loc12_26 [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc12_26.2: %i32 = converted %int_1, %.loc12_26.1 [template = constants.%int_1.2]
- // CHECK:STDOUT: %int.convert_checked.loc12_27: init %u32 = call %Int32ToUint32.ref.loc12(%.loc12_26.2) [template = constants.%int_1.3]
- // CHECK:STDOUT: %.loc11_37.1: %u32 = value_of_initializer %int.convert_checked.loc11_37 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc11_37.2: %u32 = converted %int.convert_checked.loc11_37, %.loc11_37.1 [template = constants.%int_2147483647.3]
- // CHECK:STDOUT: %.loc12_27.1: %u32 = value_of_initializer %int.convert_checked.loc12_27 [template = constants.%int_1.3]
- // CHECK:STDOUT: %.loc12_27.2: %u32 = converted %int.convert_checked.loc12_27, %.loc12_27.1 [template = constants.%int_1.3]
- // CHECK:STDOUT: %int.uadd: init %u32 = call %AddU32.ref(%.loc11_37.2, %.loc12_27.2) [template = constants.%int_2147483648.1]
- // CHECK:STDOUT: %.loc12_28.1: %u32 = value_of_initializer %int.uadd [template = constants.%int_2147483648.1]
- // CHECK:STDOUT: %.loc12_28.2: %u32 = converted %int.uadd, %.loc12_28.1 [template = constants.%int_2147483648.1]
- // CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Uint32ToInt32.ref(%.loc12_28.2) [template = constants.%int_2147483648.2]
- // CHECK:STDOUT: %.loc12_30.1: %i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%int_2147483648.2]
- // CHECK:STDOUT: %.loc12_30.2: %i32 = converted %int.convert_checked.loc12_29, %.loc12_30.1 [template = constants.%int_2147483648.2]
- // CHECK:STDOUT: %max_plus_one: %i32 = bind_name max_plus_one, %.loc12_30.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_too_large_i32_for_i16.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template]
- // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template]
- // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template]
- // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %int_32768.1: Core.IntLiteral = int_value 32768 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_32768.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template]
- // CHECK:STDOUT: %int_32768.3: %i16 = int_value 32768 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded
- // CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [template = constants.%Int32ToInt16]
- // CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .Int = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.26
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .max_plus_one = @__global_init.%max_plus_one
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16]
- // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1]
- // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_32768, %impl.elem0 [template = constants.%Convert.bound]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
- // CHECK:STDOUT: %int.convert_checked.loc9_38: init %i32 = call %Convert.specific_fn(%int_32768) [template = constants.%int_32768.2]
- // CHECK:STDOUT: %.loc9_38.1: %i32 = value_of_initializer %int.convert_checked.loc9_38 [template = constants.%int_32768.2]
- // CHECK:STDOUT: %.loc9_38.2: %i32 = converted %int_32768, %.loc9_38.1 [template = constants.%int_32768.2]
- // CHECK:STDOUT: %int.convert_checked.loc9_44: init %i16 = call %Int32ToInt16.ref(%.loc9_38.2) [template = constants.%int_32768.3]
- // CHECK:STDOUT: %.loc9_45.1: %i16 = value_of_initializer %int.convert_checked.loc9_44 [template = constants.%int_32768.3]
- // CHECK:STDOUT: %.loc9_45.2: %i16 = converted %int.convert_checked.loc9_44, %.loc9_45.1 [template = constants.%int_32768.3]
- // CHECK:STDOUT: %max_plus_one: %i16 = bind_name max_plus_one, %.loc9_45.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_too_large_i32_for_u16.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template]
- // CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template]
- // CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template]
- // CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %int_65536.1: Core.IntLiteral = int_value 65536 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_65536.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_65536.2: %i32 = int_value 65536 [template]
- // CHECK:STDOUT: %int_65536.3: %u16 = int_value 65536 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded
- // CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, Int32ToUint16, loaded [template = constants.%Int32ToUint16]
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .UInt = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.29
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .max_plus_one = @__global_init.%max_plus_one
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Int32ToUint16.ref: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16]
- // CHECK:STDOUT: %int_65536: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1]
- // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_65536, %impl.elem0 [template = constants.%Convert.bound]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
- // CHECK:STDOUT: %int.convert_checked.loc9_39: init %i32 = call %Convert.specific_fn(%int_65536) [template = constants.%int_65536.2]
- // CHECK:STDOUT: %.loc9_39.1: %i32 = value_of_initializer %int.convert_checked.loc9_39 [template = constants.%int_65536.2]
- // CHECK:STDOUT: %.loc9_39.2: %i32 = converted %int_65536, %.loc9_39.1 [template = constants.%int_65536.2]
- // CHECK:STDOUT: %int.convert_checked.loc9_47: init %u16 = call %Int32ToUint16.ref(%.loc9_39.2) [template = constants.%int_65536.3]
- // CHECK:STDOUT: %.loc9_48.1: %u16 = value_of_initializer %int.convert_checked.loc9_47 [template = constants.%int_65536.3]
- // CHECK:STDOUT: %.loc9_48.2: %u16 = converted %int.convert_checked.loc9_47, %.loc9_48.1 [template = constants.%int_65536.3]
- // CHECK:STDOUT: %max_plus_one: %u16 = bind_name max_plus_one, %.loc9_48.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_too_large_u32_for_i16.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template]
- // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template]
- // CHECK:STDOUT: %Uint32ToInt16.type: type = fn_type @Uint32ToInt16 [template]
- // CHECK:STDOUT: %Uint32ToInt16: %Uint32ToInt16.type = struct_value () [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template]
- // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template]
- // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %int_32768.1: Core.IntLiteral = int_value 32768 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_32768.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template]
- // CHECK:STDOUT: %int_32768.3: %u32 = int_value 32768 [template]
- // CHECK:STDOUT: %int_32768.4: %i16 = int_value 32768 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded
- // CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.12: %Uint32ToInt16.type = import_ref Main//int_ops, Uint32ToInt16, loaded [template = constants.%Uint32ToInt16]
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .Int = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.29
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .max_plus_one = @__global_init.%max_plus_one
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %u32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Uint32ToInt16.ref: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16]
- // CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1]
- // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_32768, %impl.elem0 [template = constants.%Convert.bound]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
- // CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn(%int_32768) [template = constants.%int_32768.2]
- // CHECK:STDOUT: %.loc9_53.1: %i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%int_32768.2]
- // CHECK:STDOUT: %.loc9_53.2: %i32 = converted %int_32768, %.loc9_53.1 [template = constants.%int_32768.2]
- // CHECK:STDOUT: %int.convert_checked.loc9_59: init %u32 = call %Int32ToUint32.ref(%.loc9_53.2) [template = constants.%int_32768.3]
- // CHECK:STDOUT: %.loc9_59.1: %u32 = value_of_initializer %int.convert_checked.loc9_59 [template = constants.%int_32768.3]
- // CHECK:STDOUT: %.loc9_59.2: %u32 = converted %int.convert_checked.loc9_59, %.loc9_59.1 [template = constants.%int_32768.3]
- // CHECK:STDOUT: %int.convert_checked.loc9_60: init %i16 = call %Uint32ToInt16.ref(%.loc9_59.2) [template = constants.%int_32768.4]
- // CHECK:STDOUT: %.loc9_61.1: %i16 = value_of_initializer %int.convert_checked.loc9_60 [template = constants.%int_32768.4]
- // CHECK:STDOUT: %.loc9_61.2: %i16 = converted %int.convert_checked.loc9_60, %.loc9_61.1 [template = constants.%int_32768.4]
- // CHECK:STDOUT: %max_plus_one: %i16 = bind_name max_plus_one, %.loc9_61.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_too_large_u32_for_u16.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template]
- // CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template]
- // CHECK:STDOUT: %Uint32ToUint16.type: type = fn_type @Uint32ToUint16 [template]
- // CHECK:STDOUT: %Uint32ToUint16: %Uint32ToUint16.type = struct_value () [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template]
- // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template]
- // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %int_65536.1: Core.IntLiteral = int_value 65536 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_65536.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_65536.2: %i32 = int_value 65536 [template]
- // CHECK:STDOUT: %int_65536.3: %u32 = int_value 65536 [template]
- // CHECK:STDOUT: %int_65536.4: %u16 = int_value 65536 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded
- // CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13: %Uint32ToUint16.type = import_ref Main//int_ops, Uint32ToUint16, loaded [template = constants.%Uint32ToUint16]
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .UInt = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.29
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .max_plus_one = @__global_init.%max_plus_one
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %u32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Uint32ToUint16.ref: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16]
- // CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %int_65536: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1]
- // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_65536, %impl.elem0 [template = constants.%Convert.bound]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
- // CHECK:STDOUT: %int.convert_checked.loc9_54: init %i32 = call %Convert.specific_fn(%int_65536) [template = constants.%int_65536.2]
- // CHECK:STDOUT: %.loc9_54.1: %i32 = value_of_initializer %int.convert_checked.loc9_54 [template = constants.%int_65536.2]
- // CHECK:STDOUT: %.loc9_54.2: %i32 = converted %int_65536, %.loc9_54.1 [template = constants.%int_65536.2]
- // CHECK:STDOUT: %int.convert_checked.loc9_62: init %u32 = call %Int32ToUint32.ref(%.loc9_54.2) [template = constants.%int_65536.3]
- // CHECK:STDOUT: %.loc9_62.1: %u32 = value_of_initializer %int.convert_checked.loc9_62 [template = constants.%int_65536.3]
- // CHECK:STDOUT: %.loc9_62.2: %u32 = converted %int.convert_checked.loc9_62, %.loc9_62.1 [template = constants.%int_65536.3]
- // CHECK:STDOUT: %int.convert_checked.loc9_63: init %u16 = call %Uint32ToUint16.ref(%.loc9_62.2) [template = constants.%int_65536.4]
- // CHECK:STDOUT: %.loc9_64.1: %u16 = value_of_initializer %int.convert_checked.loc9_63 [template = constants.%int_65536.4]
- // CHECK:STDOUT: %.loc9_64.2: %u16 = converted %int.convert_checked.loc9_63, %.loc9_64.1 [template = constants.%int_65536.4]
- // CHECK:STDOUT: %max_plus_one: %u16 = bind_name max_plus_one, %.loc9_64.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_negative_i32_to_u16.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template]
- // CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template]
- // CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template]
- // CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template]
- // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template]
- // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template]
- // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound.1: <bound method> = bound_method %int_0.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.1: <specific function> = specific_function %Convert.bound.1, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template]
- // CHECK:STDOUT: %Convert.bound.2: <bound method> = bound_method %int_1.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.2: <specific function> = specific_function %Convert.bound.2, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template]
- // CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template]
- // CHECK:STDOUT: %int_-1.2: %u16 = int_value 18446744073709551615 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded
- // CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32]
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, Int32ToUint16, loaded [template = constants.%Int32ToUint16]
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .UInt = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.29
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .minus_one_to_u16 = @__global_init.%minus_one_to_u16
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Int32ToUint16.ref: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16]
- // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32]
- // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1]
- // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
- // CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc9_50: <bound method> = bound_method %int_0, %impl.elem0.loc9_50 [template = constants.%Convert.bound.1]
- // CHECK:STDOUT: %Convert.specific_fn.loc9_50: <specific function> = specific_function %Convert.bound.loc9_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1]
- // CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %Convert.specific_fn.loc9_50(%int_0) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_0, %.loc9_50.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc9_53: <bound method> = bound_method %int_1, %impl.elem0.loc9_53 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc9_53: <specific function> = specific_function %Convert.bound.loc9_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn.loc9_53(%int_1) [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc9_53.1: %i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc9_53.2: %i32 = converted %int_1, %.loc9_53.1 [template = constants.%int_1.2]
- // CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc9_50.2, %.loc9_53.2) [template = constants.%int_-1.1]
- // CHECK:STDOUT: %.loc9_54.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_-1.1]
- // CHECK:STDOUT: %.loc9_54.2: %i32 = converted %int.ssub, %.loc9_54.1 [template = constants.%int_-1.1]
- // CHECK:STDOUT: %int.convert_checked.loc9_55: init %u16 = call %Int32ToUint16.ref(%.loc9_54.2) [template = constants.%int_-1.2]
- // CHECK:STDOUT: %.loc9_56.1: %u16 = value_of_initializer %int.convert_checked.loc9_55 [template = constants.%int_-1.2]
- // CHECK:STDOUT: %.loc9_56.2: %u16 = converted %int.convert_checked.loc9_55, %.loc9_56.1 [template = constants.%int_-1.2]
- // CHECK:STDOUT: %minus_one_to_u16: %u16 = bind_name minus_one_to_u16, %.loc9_56.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_negative_i32_to_u32.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template]
- // CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template]
- // CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template]
- // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template]
- // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template]
- // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound.1: <bound method> = bound_method %int_0.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.1: <specific function> = specific_function %Convert.bound.1, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template]
- // CHECK:STDOUT: %Convert.bound.2: <bound method> = bound_method %int_1.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.2: <specific function> = specific_function %Convert.bound.2, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template]
- // CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template]
- // CHECK:STDOUT: %int_-1.2: %u32 = int_value 18446744073709551615 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded
- // CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32]
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .UInt = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.29
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .minus_one_to_u32 = @__global_init.%minus_one_to_u32
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32]
- // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32]
- // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1]
- // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
- // CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc9_50: <bound method> = bound_method %int_0, %impl.elem0.loc9_50 [template = constants.%Convert.bound.1]
- // CHECK:STDOUT: %Convert.specific_fn.loc9_50: <specific function> = specific_function %Convert.bound.loc9_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1]
- // CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %Convert.specific_fn.loc9_50(%int_0) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_0, %.loc9_50.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc9_53: <bound method> = bound_method %int_1, %impl.elem0.loc9_53 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc9_53: <specific function> = specific_function %Convert.bound.loc9_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn.loc9_53(%int_1) [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc9_53.1: %i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc9_53.2: %i32 = converted %int_1, %.loc9_53.1 [template = constants.%int_1.2]
- // CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc9_50.2, %.loc9_53.2) [template = constants.%int_-1.1]
- // CHECK:STDOUT: %.loc9_54.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_-1.1]
- // CHECK:STDOUT: %.loc9_54.2: %i32 = converted %int.ssub, %.loc9_54.1 [template = constants.%int_-1.1]
- // CHECK:STDOUT: %int.convert_checked.loc9_55: init %u32 = call %Int32ToUint32.ref(%.loc9_54.2) [template = constants.%int_-1.2]
- // CHECK:STDOUT: %.loc9_56.1: %u32 = value_of_initializer %int.convert_checked.loc9_55 [template = constants.%int_-1.2]
- // CHECK:STDOUT: %.loc9_56.2: %u32 = converted %int.convert_checked.loc9_55, %.loc9_56.1 [template = constants.%int_-1.2]
- // CHECK:STDOUT: %minus_one_to_u32: %u32 = bind_name minus_one_to_u32, %.loc9_56.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_negative_i32_to_u64.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template]
- // CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template]
- // CHECK:STDOUT: %Int32ToUint64.type: type = fn_type @Int32ToUint64 [template]
- // CHECK:STDOUT: %Int32ToUint64: %Int32ToUint64.type = struct_value () [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template]
- // CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template]
- // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template]
- // CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound.1: <bound method> = bound_method %int_0.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.1: <specific function> = specific_function %Convert.bound.1, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template]
- // CHECK:STDOUT: %Convert.bound.2: <bound method> = bound_method %int_1.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn.2: <specific function> = specific_function %Convert.bound.2, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template]
- // CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template]
- // CHECK:STDOUT: %int_-1.2: %u64 = int_value 18446744073709551615 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded
- // CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32]
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17: %Int32ToUint64.type = import_ref Main//int_ops, Int32ToUint64, loaded [template = constants.%Int32ToUint64]
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .UInt = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.29
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .minus_one_to_u64 = @__global_init.%minus_one_to_u64
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Int32ToUint64.ref: %Int32ToUint64.type = name_ref Int32ToUint64, imports.%import_ref.17 [template = constants.%Int32ToUint64]
- // CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32]
- // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1]
- // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
- // CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc9_50: <bound method> = bound_method %int_0, %impl.elem0.loc9_50 [template = constants.%Convert.bound.1]
- // CHECK:STDOUT: %Convert.specific_fn.loc9_50: <specific function> = specific_function %Convert.bound.loc9_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1]
- // CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %Convert.specific_fn.loc9_50(%int_0) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_0, %.loc9_50.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound.loc9_53: <bound method> = bound_method %int_1, %impl.elem0.loc9_53 [template = constants.%Convert.bound.2]
- // CHECK:STDOUT: %Convert.specific_fn.loc9_53: <specific function> = specific_function %Convert.bound.loc9_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2]
- // CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn.loc9_53(%int_1) [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc9_53.1: %i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%int_1.2]
- // CHECK:STDOUT: %.loc9_53.2: %i32 = converted %int_1, %.loc9_53.1 [template = constants.%int_1.2]
- // CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc9_50.2, %.loc9_53.2) [template = constants.%int_-1.1]
- // CHECK:STDOUT: %.loc9_54.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_-1.1]
- // CHECK:STDOUT: %.loc9_54.2: %i32 = converted %int.ssub, %.loc9_54.1 [template = constants.%int_-1.1]
- // CHECK:STDOUT: %int.convert_checked.loc9_55: init %u64 = call %Int32ToUint64.ref(%.loc9_54.2) [template = constants.%int_-1.2]
- // CHECK:STDOUT: %.loc9_56.1: %u64 = value_of_initializer %int.convert_checked.loc9_55 [template = constants.%int_-1.2]
- // CHECK:STDOUT: %.loc9_56.2: %u64 = converted %int.convert_checked.loc9_55, %.loc9_56.1 [template = constants.%int_-1.2]
- // CHECK:STDOUT: %minus_one_to_u64: %u64 = bind_name minus_one_to_u64, %.loc9_56.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_too_small_i32_for_i16.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template]
- // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template]
- // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template]
- // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template]
- // CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template]
- // CHECK:STDOUT: %int_32769.1: Core.IntLiteral = int_value 32769 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_32769.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_32769.2: %i32 = int_value 32769 [template]
- // CHECK:STDOUT: %int_-32769.1: %i32 = int_value -32769 [template]
- // CHECK:STDOUT: %int_-32769.2: %i16 = int_value -32769 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, NegateI32, loaded [template = constants.%NegateI32]
- // CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [template = constants.%Int32ToInt16]
- // CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .Int = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.26
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .min_minus_one = @__global_init.%min_minus_one
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16]
- // CHECK:STDOUT: %NegateI32.ref: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32]
- // CHECK:STDOUT: %int_32769: Core.IntLiteral = int_value 32769 [template = constants.%int_32769.1]
- // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_32769, %impl.elem0 [template = constants.%Convert.bound]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
- // CHECK:STDOUT: %int.convert_checked.loc9_49: init %i32 = call %Convert.specific_fn(%int_32769) [template = constants.%int_32769.2]
- // CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.convert_checked.loc9_49 [template = constants.%int_32769.2]
- // CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int_32769, %.loc9_49.1 [template = constants.%int_32769.2]
- // CHECK:STDOUT: %int.snegate: init %i32 = call %NegateI32.ref(%.loc9_49.2) [template = constants.%int_-32769.1]
- // CHECK:STDOUT: %.loc9_55.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-32769.1]
- // CHECK:STDOUT: %.loc9_55.2: %i32 = converted %int.snegate, %.loc9_55.1 [template = constants.%int_-32769.1]
- // CHECK:STDOUT: %int.convert_checked.loc9_56: init %i16 = call %Int32ToInt16.ref(%.loc9_55.2) [template = constants.%int_-32769.2]
- // CHECK:STDOUT: %.loc9_57.1: %i16 = value_of_initializer %int.convert_checked.loc9_56 [template = constants.%int_-32769.2]
- // CHECK:STDOUT: %.loc9_57.2: %i16 = converted %int.convert_checked.loc9_56, %.loc9_57.1 [template = constants.%int_-32769.2]
- // CHECK:STDOUT: %min_minus_one: %i16 = bind_name min_minus_one, %.loc9_57.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_not_constant.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template]
- // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
- // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
- // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
- // CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.1, %Convert.10 [template]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
- // CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template]
- // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template]
- // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template]
- // CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template]
- // CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template]
- // CHECK:STDOUT: %Int32ToInt32.type: type = fn_type @Int32ToInt32 [template]
- // CHECK:STDOUT: %Int32ToInt32: %Int32ToInt32.type = struct_value () [template]
- // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template]
- // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template]
- // CHECK:STDOUT: %Int32ToInt64.type: type = fn_type @Int32ToInt64 [template]
- // CHECK:STDOUT: %Int32ToInt64: %Int32ToInt64.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded
- // CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded
- // CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.5: %Int32ToInt32.type = import_ref Main//int_ops, Int32ToInt32, loaded [template = constants.%Int32ToInt32]
- // CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded
- // CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded
- // CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [template = constants.%Int32ToInt16]
- // CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded
- // CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded
- // CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded
- // CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded
- // CHECK:STDOUT: %import_ref.16: %Int32ToInt64.type = import_ref Main//int_ops, Int32ToInt64, loaded [template = constants.%Int32ToInt64]
- // CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded
- // CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded
- // CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded
- // CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .Int = %import_ref.22
- // CHECK:STDOUT: .ImplicitAs = %import_ref.26
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NegateI32 = imports.%import_ref.1
- // CHECK:STDOUT: .SubI32 = imports.%import_ref.2
- // CHECK:STDOUT: .AddU32 = imports.%import_ref.3
- // CHECK:STDOUT: .IntLiteral = imports.%import_ref.4
- // CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5
- // CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6
- // CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7
- // CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8
- // CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9
- // CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10
- // CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11
- // CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12
- // CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13
- // CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14
- // CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15
- // CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16
- // CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17
- // CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18
- // CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19
- // CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20
- // CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .not_constant = @__global_init.%not_constant
- // CHECK:STDOUT: .convert_not_constant_narrow = @__global_init.%convert_not_constant_narrow
- // CHECK:STDOUT: .convert_not_constant_same = @__global_init.%convert_not_constant_same
- // CHECK:STDOUT: .convert_not_constant_widen = @__global_init.%convert_not_constant_widen
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %default.import = import <invalid>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: %i32) -> %i32 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Int32ToInt64(%a.param_patt: %i32) -> %i64 = "int.convert_checked" [from "int_ops.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1]
- // CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
- // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound]
- // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
- // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc5_26.1: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%int_0.2]
- // CHECK:STDOUT: %.loc5_26.2: %i32 = converted %int_0, %.loc5_26.1 [template = constants.%int_0.2]
- // CHECK:STDOUT: %not_constant: %i32 = bind_name not_constant, %.loc5_26.2
- // CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16]
- // CHECK:STDOUT: %not_constant.ref.loc15: %i32 = name_ref not_constant, %not_constant
- // CHECK:STDOUT: %int.convert_checked.loc15: init %i16 = call %Int32ToInt16.ref(%not_constant.ref.loc15)
- // CHECK:STDOUT: %.loc15_66.1: %i16 = value_of_initializer %int.convert_checked.loc15
- // CHECK:STDOUT: %.loc15_66.2: %i16 = converted %int.convert_checked.loc15, %.loc15_66.1
- // CHECK:STDOUT: %convert_not_constant_narrow: %i16 = bind_name convert_not_constant_narrow, %.loc15_66.2
- // CHECK:STDOUT: %Int32ToInt32.ref: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32]
- // CHECK:STDOUT: %not_constant.ref.loc25: %i32 = name_ref not_constant, %not_constant
- // CHECK:STDOUT: %int.convert_checked.loc25: init %i32 = call %Int32ToInt32.ref(%not_constant.ref.loc25)
- // CHECK:STDOUT: %.loc25_64.1: %i32 = value_of_initializer %int.convert_checked.loc25
- // CHECK:STDOUT: %.loc25_64.2: %i32 = converted %int.convert_checked.loc25, %.loc25_64.1
- // CHECK:STDOUT: %convert_not_constant_same: %i32 = bind_name convert_not_constant_same, %.loc25_64.2
- // CHECK:STDOUT: %Int32ToInt64.ref: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%import_ref.16 [template = constants.%Int32ToInt64]
- // CHECK:STDOUT: %not_constant.ref.loc34: %i32 = name_ref not_constant, %not_constant
- // CHECK:STDOUT: %int.convert_checked.loc34: init %i64 = call %Int32ToInt64.ref(%not_constant.ref.loc34)
- // CHECK:STDOUT: %.loc34_65.1: %i64 = value_of_initializer %int.convert_checked.loc34
- // CHECK:STDOUT: %.loc34_65.2: %i64 = converted %int.convert_checked.loc34, %.loc34_65.1
- // CHECK:STDOUT: %convert_not_constant_widen: %i64 = bind_name convert_not_constant_widen, %.loc34_65.2
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|