1; Bitcode compatibility test for llvm 3.9.0 2; 3; N.b: This is 3.9-compatible IR. The CHECK lines occasionally differ from 4; the IR used to generate the bitcode, and may need to be updated. 5 6; RUN: llvm-dis < %s.bc | FileCheck %s 7 8target datalayout = "E" 9; CHECK: target datalayout = "E" 10 11target triple = "x86_64-apple-macosx10.10.0" 12; CHECK: target triple = "x86_64-apple-macosx10.10.0" 13 14;; Module-level assembly 15module asm "beep boop" 16; CHECK: module asm "beep boop" 17 18;; Comdats 19$comdat.any = comdat any 20; CHECK: $comdat.any = comdat any 21$comdat.exactmatch = comdat exactmatch 22; CHECK: $comdat.exactmatch = comdat exactmatch 23$comdat.largest = comdat largest 24; CHECK: $comdat.largest = comdat largest 25$comdat.noduplicates = comdat noduplicates 26; CHECK: $comdat.noduplicates = comdat noduplicates 27$comdat.samesize = comdat samesize 28; CHECK: $comdat.samesize = comdat samesize 29 30;; Constants 31@const.true = constant i1 true 32; CHECK: @const.true = constant i1 true 33@const.false = constant i1 false 34; CHECK: @const.false = constant i1 false 35@const.int = constant i32 zeroinitializer 36; CHECK: @const.int = constant i32 0 37@const.float = constant double 0.0 38; CHECK: @const.float = constant double 0.0 39@const.null = constant i8* null 40; CHECK: @const.null = constant i8* null 41%const.struct.type = type { i32, i8 } 42%const.struct.type.packed = type <{ i32, i8 }> 43@const.struct = constant %const.struct.type { i32 -1, i8 undef } 44; CHECK: @const.struct = constant %const.struct.type { i32 -1, i8 undef } 45@const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }> 46; CHECK: @const.struct.packed = constant %const.struct.type.packed <{ i32 -1, i8 1 }> 47 48; CHECK: @constant.array.i8 = constant [3 x i8] c"\00\01\00" 49@constant.array.i8 = constant [3 x i8] [i8 -0, i8 1, i8 0] 50; CHECK: @constant.array.i16 = constant [3 x i16] [i16 0, i16 1, i16 0] 51@constant.array.i16 = constant [3 x i16] [i16 -0, i16 1, i16 0] 52; CHECK: @constant.array.i32 = constant [3 x i32] [i32 0, i32 1, i32 0] 53@constant.array.i32 = constant [3 x i32] [i32 -0, i32 1, i32 0] 54; CHECK: @constant.array.i64 = constant [3 x i64] [i64 0, i64 1, i64 0] 55@constant.array.i64 = constant [3 x i64] [i64 -0, i64 1, i64 0] 56; CHECK: @constant.array.f16 = constant [3 x half] [half 0xH8000, half 0xH3C00, half 0xH0000] 57@constant.array.f16 = constant [3 x half] [half -0.0, half 1.0, half 0.0] 58; CHECK: @constant.array.f32 = constant [3 x float] [float -0.000000e+00, float 1.000000e+00, float 0.000000e+00] 59@constant.array.f32 = constant [3 x float] [float -0.0, float 1.0, float 0.0] 60; CHECK: @constant.array.f64 = constant [3 x double] [double -0.000000e+00, double 1.000000e+00, double 0.000000e+00] 61@constant.array.f64 = constant [3 x double] [double -0.0, double 1.0, double 0.0] 62 63; CHECK: @constant.vector.i8 = constant <3 x i8> <i8 0, i8 1, i8 0> 64@constant.vector.i8 = constant <3 x i8> <i8 -0, i8 1, i8 0> 65; CHECK: @constant.vector.i16 = constant <3 x i16> <i16 0, i16 1, i16 0> 66@constant.vector.i16 = constant <3 x i16> <i16 -0, i16 1, i16 0> 67; CHECK: @constant.vector.i32 = constant <3 x i32> <i32 0, i32 1, i32 0> 68@constant.vector.i32 = constant <3 x i32> <i32 -0, i32 1, i32 0> 69; CHECK: @constant.vector.i64 = constant <3 x i64> <i64 0, i64 1, i64 0> 70@constant.vector.i64 = constant <3 x i64> <i64 -0, i64 1, i64 0> 71; CHECK: @constant.vector.f16 = constant <3 x half> <half 0xH8000, half 0xH3C00, half 0xH0000> 72@constant.vector.f16 = constant <3 x half> <half -0.0, half 1.0, half 0.0> 73; CHECK: @constant.vector.f32 = constant <3 x float> <float -0.000000e+00, float 1.000000e+00, float 0.000000e+00> 74@constant.vector.f32 = constant <3 x float> <float -0.0, float 1.0, float 0.0> 75; CHECK: @constant.vector.f64 = constant <3 x double> <double -0.000000e+00, double 1.000000e+00, double 0.000000e+00> 76@constant.vector.f64 = constant <3 x double> <double -0.0, double 1.0, double 0.0> 77 78;; Global Variables 79; Format: [@<GlobalVarName> =] [Linkage] [Visibility] [DLLStorageClass] 80; [ThreadLocal] [(unnamed_addr|local_unnamed_addr)] [AddrSpace] [ExternallyInitialized] 81; <global | constant> <Type> [<InitializerConstant>] 82; [, section "name"] [, comdat [($name)]] [, align <Alignment>] 83 84; Global Variables -- Simple 85@g1 = global i32 0 86; CHECK: @g1 = global i32 0 87@g2 = constant i32 0 88; CHECK: @g2 = constant i32 0 89 90; Global Variables -- Linkage 91@g.private = private global i32 0 92; CHECK: @g.private = private global i32 0 93@g.internal = internal global i32 0 94; CHECK: @g.internal = internal global i32 0 95@g.available_externally = available_externally global i32 0 96; CHECK: @g.available_externally = available_externally global i32 0 97@g.linkonce = linkonce global i32 0 98; CHECK: @g.linkonce = linkonce global i32 0 99@g.weak = weak global i32 0 100; CHECK: @g.weak = weak global i32 0 101@g.common = common global i32 0 102; CHECK: @g.common = common global i32 0 103@g.appending = appending global [4 x i8] c"test" 104; CHECK: @g.appending = appending global [4 x i8] c"test" 105@g.extern_weak = extern_weak global i32 106; CHECK: @g.extern_weak = extern_weak global i32 107@g.linkonce_odr = linkonce_odr global i32 0 108; CHECK: @g.linkonce_odr = linkonce_odr global i32 0 109@g.weak_odr = weak_odr global i32 0 110; CHECK: @g.weak_odr = weak_odr global i32 0 111@g.external = external global i32 112; CHECK: @g.external = external global i32 113 114; Global Variables -- Visibility 115@g.default = default global i32 0 116; CHECK: @g.default = global i32 0 117@g.hidden = hidden global i32 0 118; CHECK: @g.hidden = hidden global i32 0 119@g.protected = protected global i32 0 120; CHECK: @g.protected = protected global i32 0 121 122; Global Variables -- DLLStorageClass 123@g.dlldefault = default global i32 0 124; CHECK: @g.dlldefault = global i32 0 125@g.dllimport = external dllimport global i32 126; CHECK: @g.dllimport = external dllimport global i32 127@g.dllexport = dllexport global i32 0 128; CHECK: @g.dllexport = dllexport global i32 0 129 130; Global Variables -- ThreadLocal 131@g.notthreadlocal = global i32 0 132; CHECK: @g.notthreadlocal = global i32 0 133@g.generaldynamic = thread_local global i32 0 134; CHECK: @g.generaldynamic = thread_local global i32 0 135@g.localdynamic = thread_local(localdynamic) global i32 0 136; CHECK: @g.localdynamic = thread_local(localdynamic) global i32 0 137@g.initialexec = thread_local(initialexec) global i32 0 138; CHECK: @g.initialexec = thread_local(initialexec) global i32 0 139@g.localexec = thread_local(localexec) global i32 0 140; CHECK: @g.localexec = thread_local(localexec) global i32 0 141 142; Global Variables -- unnamed_addr and local_unnamed_addr 143@g.unnamed_addr = unnamed_addr global i32 0 144; CHECK: @g.unnamed_addr = unnamed_addr global i32 0 145@g.local_unnamed_addr = local_unnamed_addr global i32 0 146; CHECK: @g.local_unnamed_addr = local_unnamed_addr global i32 0 147 148; Global Variables -- AddrSpace 149@g.addrspace = addrspace(1) global i32 0 150; CHECK: @g.addrspace = addrspace(1) global i32 0 151 152; Global Variables -- ExternallyInitialized 153@g.externally_initialized = external externally_initialized global i32 154; CHECK: @g.externally_initialized = external externally_initialized global i32 155 156; Global Variables -- section 157@g.section = global i32 0, section "_DATA" 158; CHECK: @g.section = global i32 0, section "_DATA" 159 160; Global Variables -- comdat 161@comdat.any = global i32 0, comdat 162; CHECK: @comdat.any = global i32 0, comdat 163@comdat.exactmatch = global i32 0, comdat 164; CHECK: @comdat.exactmatch = global i32 0, comdat 165@comdat.largest = global i32 0, comdat 166; CHECK: @comdat.largest = global i32 0, comdat 167@comdat.noduplicates = global i32 0, comdat 168; CHECK: @comdat.noduplicates = global i32 0, comdat 169@comdat.samesize = global i32 0, comdat 170; CHECK: @comdat.samesize = global i32 0, comdat 171 172; Force two globals from different comdats into sections with the same name. 173$comdat1 = comdat any 174$comdat2 = comdat any 175@g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1) 176; CHECK: @g.comdat1 = global i32 0, section "SharedSection", comdat($comdat1) 177@g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2) 178; CHECK: @g.comdat2 = global i32 0, section "SharedSection", comdat($comdat2) 179 180; Global Variables -- align 181@g.align = global i32 0, align 4 182; CHECK: @g.align = global i32 0, align 4 183 184; Global Variables -- Intrinsics 185%pri.func.data = type { i32, void ()*, i8* } 186@g.used1 = global i32 0 187@g.used2 = global i32 0 188@g.used3 = global i8 0 189declare void @g.f1() 190@llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata" 191; CHECK: @llvm.used = appending global [1 x i32*] [i32* @g.used1], section "llvm.metadata" 192@llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata" 193; CHECK: @llvm.compiler.used = appending global [1 x i32*] [i32* @g.used2], section "llvm.metadata" 194@llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata" 195; CHECK: @llvm.global_ctors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata" 196@llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata" 197; CHECK: @llvm.global_dtors = appending global [1 x %pri.func.data] [%pri.func.data { i32 0, void ()* @g.f1, i8* @g.used3 }], section "llvm.metadata" 198 199;; Aliases 200; Format: @<Name> = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal] 201; [unnamed_addr] alias <AliaseeTy> @<Aliasee> 202 203; Aliases -- Linkage 204@a.private = private alias i32, i32* @g.private 205; CHECK: @a.private = private alias i32, i32* @g.private 206@a.internal = internal alias i32, i32* @g.internal 207; CHECK: @a.internal = internal alias i32, i32* @g.internal 208@a.linkonce = linkonce alias i32, i32* @g.linkonce 209; CHECK: @a.linkonce = linkonce alias i32, i32* @g.linkonce 210@a.weak = weak alias i32, i32* @g.weak 211; CHECK: @a.weak = weak alias i32, i32* @g.weak 212@a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr 213; CHECK: @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr 214@a.weak_odr = weak_odr alias i32, i32* @g.weak_odr 215; CHECK: @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr 216@a.external = external alias i32, i32* @g1 217; CHECK: @a.external = alias i32, i32* @g1 218 219; Aliases -- Visibility 220@a.default = default alias i32, i32* @g.default 221; CHECK: @a.default = alias i32, i32* @g.default 222@a.hidden = hidden alias i32, i32* @g.hidden 223; CHECK: @a.hidden = hidden alias i32, i32* @g.hidden 224@a.protected = protected alias i32, i32* @g.protected 225; CHECK: @a.protected = protected alias i32, i32* @g.protected 226 227; Aliases -- DLLStorageClass 228@a.dlldefault = default alias i32, i32* @g.dlldefault 229; CHECK: @a.dlldefault = alias i32, i32* @g.dlldefault 230@a.dllimport = dllimport alias i32, i32* @g1 231; CHECK: @a.dllimport = dllimport alias i32, i32* @g1 232@a.dllexport = dllexport alias i32, i32* @g.dllexport 233; CHECK: @a.dllexport = dllexport alias i32, i32* @g.dllexport 234 235; Aliases -- ThreadLocal 236@a.notthreadlocal = alias i32, i32* @g.notthreadlocal 237; CHECK: @a.notthreadlocal = alias i32, i32* @g.notthreadlocal 238@a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic 239; CHECK: @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic 240@a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic 241; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic 242@a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec 243; CHECK: @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec 244@a.localexec = thread_local(localexec) alias i32, i32* @g.localexec 245; CHECK: @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec 246 247; Aliases -- unnamed_addr and local_unnamed_addr 248@a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr 249; CHECK: @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr 250@a.local_unnamed_addr = local_unnamed_addr alias i32, i32* @g.local_unnamed_addr 251; CHECK: @a.local_unnamed_addr = local_unnamed_addr alias i32, i32* @g.local_unnamed_addr 252 253;; IFunc 254; Format @<Name> = [Linkage] [Visibility] ifunc <IFuncTy>, 255; <ResolverTy>* @<Resolver> 256 257; IFunc -- Linkage 258@ifunc.external = external ifunc void (), i8* ()* @ifunc_resolver 259; CHECK: @ifunc.external = ifunc void (), i8* ()* @ifunc_resolver 260@ifunc.private = private ifunc void (), i8* ()* @ifunc_resolver 261; CHECK: @ifunc.private = private ifunc void (), i8* ()* @ifunc_resolver 262@ifunc.internal = internal ifunc void (), i8* ()* @ifunc_resolver 263; CHECK: @ifunc.internal = internal ifunc void (), i8* ()* @ifunc_resolver 264 265; IFunc -- Visibility 266@ifunc.default = default ifunc void (), i8* ()* @ifunc_resolver 267; CHECK: @ifunc.default = ifunc void (), i8* ()* @ifunc_resolver 268@ifunc.hidden = hidden ifunc void (), i8* ()* @ifunc_resolver 269; CHECK: @ifunc.hidden = hidden ifunc void (), i8* ()* @ifunc_resolver 270@ifunc.protected = protected ifunc void (), i8* ()* @ifunc_resolver 271; CHECK: @ifunc.protected = protected ifunc void (), i8* ()* @ifunc_resolver 272 273define i8* @ifunc_resolver() { 274entry: 275 ret i8* null 276} 277 278;; Functions 279; Format: define [linkage] [visibility] [DLLStorageClass] 280; [cconv] [ret attrs] 281; <ResultType> @<FunctionName> ([argument list]) 282; [(unnamed_addr|local_unnamed_addr)] [fn Attrs] [section "name"] [comdat [($name)]] 283; [align N] [gc] [prefix Constant] [prologue Constant] 284; [personality Constant] { ... } 285 286; Functions -- Simple 287declare void @f1 () 288; CHECK: declare void @f1() 289 290define void @f2 () { 291; CHECK: define void @f2() 292entry: 293 ret void 294} 295 296; Functions -- linkage 297define private void @f.private() { 298; CHECK: define private void @f.private() 299entry: 300 ret void 301} 302define internal void @f.internal() { 303; CHECK: define internal void @f.internal() 304entry: 305 ret void 306} 307define available_externally void @f.available_externally() { 308; CHECK: define available_externally void @f.available_externally() 309entry: 310 ret void 311} 312define linkonce void @f.linkonce() { 313; CHECK: define linkonce void @f.linkonce() 314entry: 315 ret void 316} 317define weak void @f.weak() { 318; CHECK: define weak void @f.weak() 319entry: 320 ret void 321} 322define linkonce_odr void @f.linkonce_odr() { 323; CHECK: define linkonce_odr void @f.linkonce_odr() 324entry: 325 ret void 326} 327define weak_odr void @f.weak_odr() { 328; CHECK: define weak_odr void @f.weak_odr() 329entry: 330 ret void 331} 332declare external void @f.external() 333; CHECK: declare void @f.external() 334declare extern_weak void @f.extern_weak() 335; CHECK: declare extern_weak void @f.extern_weak() 336 337; Functions -- visibility 338declare default void @f.default() 339; CHECK: declare void @f.default() 340declare hidden void @f.hidden() 341; CHECK: declare hidden void @f.hidden() 342declare protected void @f.protected() 343; CHECK: declare protected void @f.protected() 344 345; Functions -- DLLStorageClass 346declare dllimport void @f.dllimport() 347; CHECK: declare dllimport void @f.dllimport() 348declare dllexport void @f.dllexport() 349; CHECK: declare dllexport void @f.dllexport() 350 351; Functions -- cconv (Calling conventions) 352declare ccc void @f.ccc() 353; CHECK: declare void @f.ccc() 354declare fastcc void @f.fastcc() 355; CHECK: declare fastcc void @f.fastcc() 356declare coldcc void @f.coldcc() 357; CHECK: declare coldcc void @f.coldcc() 358declare cc10 void @f.cc10() 359; CHECK: declare ghccc void @f.cc10() 360declare ghccc void @f.ghccc() 361; CHECK: declare ghccc void @f.ghccc() 362declare cc11 void @f.cc11() 363; CHECK: declare cc11 void @f.cc11() 364declare webkit_jscc void @f.webkit_jscc() 365; CHECK: declare webkit_jscc void @f.webkit_jscc() 366declare anyregcc void @f.anyregcc() 367; CHECK: declare anyregcc void @f.anyregcc() 368declare preserve_mostcc void @f.preserve_mostcc() 369; CHECK: declare preserve_mostcc void @f.preserve_mostcc() 370declare preserve_allcc void @f.preserve_allcc() 371; CHECK: declare preserve_allcc void @f.preserve_allcc() 372declare cc64 void @f.cc64() 373; CHECK: declare x86_stdcallcc void @f.cc64() 374declare x86_stdcallcc void @f.x86_stdcallcc() 375; CHECK: declare x86_stdcallcc void @f.x86_stdcallcc() 376declare cc65 void @f.cc65() 377; CHECK: declare x86_fastcallcc void @f.cc65() 378declare x86_fastcallcc void @f.x86_fastcallcc() 379; CHECK: declare x86_fastcallcc void @f.x86_fastcallcc() 380declare cc66 void @f.cc66() 381; CHECK: declare arm_apcscc void @f.cc66() 382declare arm_apcscc void @f.arm_apcscc() 383; CHECK: declare arm_apcscc void @f.arm_apcscc() 384declare cc67 void @f.cc67() 385; CHECK: declare arm_aapcscc void @f.cc67() 386declare arm_aapcscc void @f.arm_aapcscc() 387; CHECK: declare arm_aapcscc void @f.arm_aapcscc() 388declare cc68 void @f.cc68() 389; CHECK: declare arm_aapcs_vfpcc void @f.cc68() 390declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc() 391; CHECK: declare arm_aapcs_vfpcc void @f.arm_aapcs_vfpcc() 392declare cc69 void @f.cc69() 393; CHECK: declare msp430_intrcc void @f.cc69() 394declare msp430_intrcc void @f.msp430_intrcc() 395; CHECK: declare msp430_intrcc void @f.msp430_intrcc() 396declare cc70 void @f.cc70() 397; CHECK: declare x86_thiscallcc void @f.cc70() 398declare x86_thiscallcc void @f.x86_thiscallcc() 399; CHECK: declare x86_thiscallcc void @f.x86_thiscallcc() 400declare cc71 void @f.cc71() 401; CHECK: declare ptx_kernel void @f.cc71() 402declare ptx_kernel void @f.ptx_kernel() 403; CHECK: declare ptx_kernel void @f.ptx_kernel() 404declare cc72 void @f.cc72() 405; CHECK: declare ptx_device void @f.cc72() 406declare ptx_device void @f.ptx_device() 407; CHECK: declare ptx_device void @f.ptx_device() 408declare cc75 void @f.cc75() 409; CHECK: declare spir_func void @f.cc75() 410declare spir_func void @f.spir_func() 411; CHECK: declare spir_func void @f.spir_func() 412declare cc76 void @f.cc76() 413; CHECK: declare spir_kernel void @f.cc76() 414declare spir_kernel void @f.spir_kernel() 415; CHECK: declare spir_kernel void @f.spir_kernel() 416declare cc77 void @f.cc77() 417; CHECK: declare intel_ocl_bicc void @f.cc77() 418declare intel_ocl_bicc void @f.intel_ocl_bicc() 419; CHECK: declare intel_ocl_bicc void @f.intel_ocl_bicc() 420declare cc78 void @f.cc78() 421; CHECK: declare x86_64_sysvcc void @f.cc78() 422declare x86_64_sysvcc void @f.x86_64_sysvcc() 423; CHECK: declare x86_64_sysvcc void @f.x86_64_sysvcc() 424declare cc79 void @f.cc79() 425; CHECK: declare win64cc void @f.cc79() 426declare win64cc void @f.x86_64_win64cc() 427; CHECK: declare win64cc void @f.x86_64_win64cc() 428declare cc80 void @f.cc80() 429; CHECK: declare x86_vectorcallcc void @f.cc80() 430declare x86_vectorcallcc void @f.x86_vectorcallcc() 431; CHECK: declare x86_vectorcallcc void @f.x86_vectorcallcc() 432declare cc81 void @f.cc81() 433; CHECK: declare hhvmcc void @f.cc81() 434declare hhvmcc void @f.hhvmcc() 435; CHECK: declare hhvmcc void @f.hhvmcc() 436declare cc82 void @f.cc82() 437; CHECK: declare hhvm_ccc void @f.cc82() 438declare hhvm_ccc void @f.hhvm_ccc() 439; CHECK: declare hhvm_ccc void @f.hhvm_ccc() 440declare cc83 void @f.cc83() 441; CHECK: declare x86_intrcc void @f.cc83() 442declare x86_intrcc void @f.x86_intrcc() 443; CHECK: declare x86_intrcc void @f.x86_intrcc() 444declare cc84 void @f.cc84() 445; CHECK: declare avr_intrcc void @f.cc84() 446declare avr_intrcc void @f.avr_intrcc() 447; CHECK: declare avr_intrcc void @f.avr_intrcc() 448declare cc85 void @f.cc85() 449; CHECK: declare avr_signalcc void @f.cc85() 450declare avr_signalcc void @f.avr_signalcc() 451; CHECK: declare avr_signalcc void @f.avr_signalcc() 452declare cc87 void @f.cc87() 453; CHECK: declare amdgpu_vs void @f.cc87() 454declare amdgpu_vs void @f.amdgpu_vs() 455; CHECK: declare amdgpu_vs void @f.amdgpu_vs() 456declare cc88 void @f.cc88() 457; CHECK: declare amdgpu_gs void @f.cc88() 458declare amdgpu_gs void @f.amdgpu_gs() 459; CHECK: declare amdgpu_gs void @f.amdgpu_gs() 460declare cc89 void @f.cc89() 461; CHECK: declare amdgpu_ps void @f.cc89() 462declare amdgpu_ps void @f.amdgpu_ps() 463; CHECK: declare amdgpu_ps void @f.amdgpu_ps() 464declare cc90 void @f.cc90() 465; CHECK: declare amdgpu_cs void @f.cc90() 466declare amdgpu_cs void @f.amdgpu_cs() 467; CHECK: declare amdgpu_cs void @f.amdgpu_cs() 468declare cc91 void @f.cc91() 469; CHECK: declare amdgpu_kernel void @f.cc91() 470declare amdgpu_kernel void @f.amdgpu_kernel() 471; CHECK: declare amdgpu_kernel void @f.amdgpu_kernel() 472declare cc1023 void @f.cc1023() 473; CHECK: declare cc1023 void @f.cc1023() 474 475; Functions -- ret attrs (Return attributes) 476declare zeroext i64 @f.zeroext() 477; CHECK: declare zeroext i64 @f.zeroext() 478declare signext i64 @f.signext() 479; CHECK: declare signext i64 @f.signext() 480declare inreg i32* @f.inreg() 481; CHECK: declare inreg i32* @f.inreg() 482declare noalias i32* @f.noalias() 483; CHECK: declare noalias i32* @f.noalias() 484declare nonnull i32* @f.nonnull() 485; CHECK: declare nonnull i32* @f.nonnull() 486declare dereferenceable(4) i32* @f.dereferenceable4() 487; CHECK: declare dereferenceable(4) i32* @f.dereferenceable4() 488declare dereferenceable(8) i32* @f.dereferenceable8() 489; CHECK: declare dereferenceable(8) i32* @f.dereferenceable8() 490declare dereferenceable(16) i32* @f.dereferenceable16() 491; CHECK: declare dereferenceable(16) i32* @f.dereferenceable16() 492declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null() 493; CHECK: declare dereferenceable_or_null(4) i32* @f.dereferenceable4_or_null() 494declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null() 495; CHECK: declare dereferenceable_or_null(8) i32* @f.dereferenceable8_or_null() 496declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null() 497; CHECK: declare dereferenceable_or_null(16) i32* @f.dereferenceable16_or_null() 498 499; Functions -- Parameter attributes 500declare void @f.param.zeroext(i8 zeroext) 501; CHECK: declare void @f.param.zeroext(i8 zeroext) 502declare void @f.param.signext(i8 signext) 503; CHECK: declare void @f.param.signext(i8 signext) 504declare void @f.param.inreg(i8 inreg) 505; CHECK: declare void @f.param.inreg(i8 inreg) 506declare void @f.param.byval({ i8, i8 }* byval) 507; CHECK: declare void @f.param.byval({ i8, i8 }* byval) 508declare void @f.param.inalloca(i8* inalloca) 509; CHECK: declare void @f.param.inalloca(i8* inalloca) 510declare void @f.param.sret(i8* sret) 511; CHECK: declare void @f.param.sret(i8* sret) 512declare void @f.param.noalias(i8* noalias) 513; CHECK: declare void @f.param.noalias(i8* noalias) 514declare void @f.param.nocapture(i8* nocapture) 515; CHECK: declare void @f.param.nocapture(i8* nocapture) 516declare void @f.param.nest(i8* nest) 517; CHECK: declare void @f.param.nest(i8* nest) 518declare i8* @f.param.returned(i8* returned) 519; CHECK: declare i8* @f.param.returned(i8* returned) 520declare void @f.param.nonnull(i8* nonnull) 521; CHECK: declare void @f.param.nonnull(i8* nonnull) 522declare void @f.param.dereferenceable(i8* dereferenceable(4)) 523; CHECK: declare void @f.param.dereferenceable(i8* dereferenceable(4)) 524declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4)) 525; CHECK: declare void @f.param.dereferenceable_or_null(i8* dereferenceable_or_null(4)) 526 527; Functions -- unnamed_addr and local_unnamed_addr 528declare void @f.unnamed_addr() unnamed_addr 529; CHECK: declare void @f.unnamed_addr() unnamed_addr 530declare void @f.local_unnamed_addr() local_unnamed_addr 531; CHECK: declare void @f.local_unnamed_addr() local_unnamed_addr 532 533; Functions -- fn Attrs (Function attributes) 534declare void @f.alignstack4() alignstack(4) 535; CHECK: declare void @f.alignstack4() #0 536declare void @f.alignstack8() alignstack(8) 537; CHECK: declare void @f.alignstack8() #1 538declare void @f.alwaysinline() alwaysinline 539; CHECK: declare void @f.alwaysinline() #2 540declare void @f.cold() cold 541; CHECK: declare void @f.cold() #3 542declare void @f.convergent() convergent 543; CHECK: declare void @f.convergent() #4 544declare void @f.inlinehint() inlinehint 545; CHECK: declare void @f.inlinehint() #5 546declare void @f.jumptable() unnamed_addr jumptable 547; CHECK: declare void @f.jumptable() unnamed_addr #6 548declare void @f.minsize() minsize 549; CHECK: declare void @f.minsize() #7 550declare void @f.naked() naked 551; CHECK: declare void @f.naked() #8 552declare void @f.nobuiltin() nobuiltin 553; CHECK: declare void @f.nobuiltin() #9 554declare void @f.noduplicate() noduplicate 555; CHECK: declare void @f.noduplicate() #10 556declare void @f.noimplicitfloat() noimplicitfloat 557; CHECK: declare void @f.noimplicitfloat() #11 558declare void @f.noinline() noinline 559; CHECK: declare void @f.noinline() #12 560declare void @f.nonlazybind() nonlazybind 561; CHECK: declare void @f.nonlazybind() #13 562declare void @f.noredzone() noredzone 563; CHECK: declare void @f.noredzone() #14 564declare void @f.noreturn() noreturn 565; CHECK: declare void @f.noreturn() #15 566declare void @f.nounwind() nounwind 567; CHECK: declare void @f.nounwind() #16 568declare void @f.optnone() noinline optnone 569; CHECK: declare void @f.optnone() #17 570declare void @f.optsize() optsize 571; CHECK: declare void @f.optsize() #18 572declare void @f.readnone() readnone 573; CHECK: declare void @f.readnone() #19 574declare void @f.readonly() readonly 575; CHECK: declare void @f.readonly() #20 576declare void @f.returns_twice() returns_twice 577; CHECK: declare void @f.returns_twice() #21 578declare void @f.safestack() safestack 579; CHECK: declare void @f.safestack() #22 580declare void @f.sanitize_address() sanitize_address 581; CHECK: declare void @f.sanitize_address() #23 582declare void @f.sanitize_memory() sanitize_memory 583; CHECK: declare void @f.sanitize_memory() #24 584declare void @f.sanitize_thread() sanitize_thread 585; CHECK: declare void @f.sanitize_thread() #25 586declare void @f.ssp() ssp 587; CHECK: declare void @f.ssp() #26 588declare void @f.sspreq() sspreq 589; CHECK: declare void @f.sspreq() #27 590declare void @f.sspstrong() sspstrong 591; CHECK: declare void @f.sspstrong() #28 592declare void @f.thunk() "thunk" 593; CHECK: declare void @f.thunk() #29 594declare void @f.uwtable() uwtable 595; CHECK: declare void @f.uwtable() #30 596declare void @f.kvpair() "cpu"="cortex-a8" 597; CHECK:declare void @f.kvpair() #31 598declare void @f.norecurse() norecurse 599; CHECK: declare void @f.norecurse() #32 600declare void @f.inaccessiblememonly() inaccessiblememonly 601; CHECK: declare void @f.inaccessiblememonly() #33 602declare void @f.inaccessiblemem_or_argmemonly() inaccessiblemem_or_argmemonly 603; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #34 604 605; Functions -- section 606declare void @f.section() section "80" 607; CHECK: declare void @f.section() section "80" 608 609; Functions -- comdat 610define void @f.comdat_any() comdat($comdat.any) { 611; CHECK: define void @f.comdat_any() comdat($comdat.any) 612entry: 613 ret void 614} 615define void @f.comdat_exactmatch() comdat($comdat.exactmatch) { 616; CHECK: define void @f.comdat_exactmatch() comdat($comdat.exactmatch) 617entry: 618 ret void 619} 620define void @f.comdat_largest() comdat($comdat.largest) { 621; CHECK: define void @f.comdat_largest() comdat($comdat.largest) 622entry: 623 ret void 624} 625define void @f.comdat_noduplicates() comdat($comdat.noduplicates) { 626; CHECK: define void @f.comdat_noduplicates() comdat($comdat.noduplicates) 627entry: 628 ret void 629} 630define void @f.comdat_samesize() comdat($comdat.samesize) { 631; CHECK: define void @f.comdat_samesize() comdat($comdat.samesize) 632entry: 633 ret void 634} 635 636; Functions -- align 637declare void @f.align2() align 2 638; CHECK: declare void @f.align2() align 2 639declare void @f.align4() align 4 640; CHECK: declare void @f.align4() align 4 641declare void @f.align8() align 8 642; CHECK: declare void @f.align8() align 8 643 644; Functions -- GC 645declare void @f.gcshadow() gc "shadow-stack" 646; CHECK: declare void @f.gcshadow() gc "shadow-stack" 647 648; Functions -- Prefix data 649declare void @f.prefixi32() prefix i32 1684365668 650; CHECK: declare void @f.prefixi32() prefix i32 1684365668 651declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3] 652; CHECK: declare void @f.prefixarray() prefix [4 x i32] [i32 0, i32 1, i32 2, i32 3] 653 654; Functions -- Prologue data 655declare void @f.prologuei32() prologue i32 1684365669 656; CHECK: declare void @f.prologuei32() prologue i32 1684365669 657declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3] 658; CHECK: declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3] 659 660; Functions -- Personality constant 661declare void @llvm.donothing() nounwind readnone 662; CHECK: declare void @llvm.donothing() #35 663define void @f.no_personality() personality i8 3 { 664; CHECK: define void @f.no_personality() personality i8 3 665 invoke void @llvm.donothing() to label %normal unwind label %exception 666exception: 667 %cleanup = landingpad i8 cleanup 668 br label %normal 669normal: 670 ret void 671} 672 673declare i32 @f.personality_handler() 674; CHECK: declare i32 @f.personality_handler() 675define void @f.personality() personality i32 ()* @f.personality_handler { 676; CHECK: define void @f.personality() personality i32 ()* @f.personality_handler 677 invoke void @llvm.donothing() to label %normal unwind label %exception 678exception: 679 %cleanup = landingpad i32 cleanup 680 br label %normal 681normal: 682 ret void 683} 684 685;; Atomic Memory Ordering Constraints 686define void @atomics(i32* %word) { 687 %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic 688 ; CHECK: %cmpxchg.0 = cmpxchg i32* %word, i32 0, i32 4 monotonic monotonic 689 %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic 690 ; CHECK: %cmpxchg.1 = cmpxchg i32* %word, i32 0, i32 5 acq_rel monotonic 691 %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic 692 ; CHECK: %cmpxchg.2 = cmpxchg i32* %word, i32 0, i32 6 acquire monotonic 693 %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic 694 ; CHECK: %cmpxchg.3 = cmpxchg i32* %word, i32 0, i32 7 release monotonic 695 %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic 696 ; CHECK: %cmpxchg.4 = cmpxchg i32* %word, i32 0, i32 8 seq_cst monotonic 697 %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic 698 ; CHECK: %cmpxchg.5 = cmpxchg weak i32* %word, i32 0, i32 9 seq_cst monotonic 699 %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic 700 ; CHECK: %cmpxchg.6 = cmpxchg volatile i32* %word, i32 0, i32 10 seq_cst monotonic 701 %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic 702 ; CHECK: %cmpxchg.7 = cmpxchg weak volatile i32* %word, i32 0, i32 11 syncscope("singlethread") seq_cst monotonic 703 %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic 704 ; CHECK: %atomicrmw.xchg = atomicrmw xchg i32* %word, i32 12 monotonic 705 %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic 706 ; CHECK: %atomicrmw.add = atomicrmw add i32* %word, i32 13 monotonic 707 %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic 708 ; CHECK: %atomicrmw.sub = atomicrmw sub i32* %word, i32 14 monotonic 709 %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic 710 ; CHECK: %atomicrmw.and = atomicrmw and i32* %word, i32 15 monotonic 711 %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic 712 ; CHECK: %atomicrmw.nand = atomicrmw nand i32* %word, i32 16 monotonic 713 %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic 714 ; CHECK: %atomicrmw.or = atomicrmw or i32* %word, i32 17 monotonic 715 %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic 716 ; CHECK: %atomicrmw.xor = atomicrmw xor i32* %word, i32 18 monotonic 717 %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic 718 ; CHECK: %atomicrmw.max = atomicrmw max i32* %word, i32 19 monotonic 719 %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic 720 ; CHECK: %atomicrmw.min = atomicrmw volatile min i32* %word, i32 20 monotonic 721 %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic 722 ; CHECK: %atomicrmw.umax = atomicrmw umax i32* %word, i32 21 syncscope("singlethread") monotonic 723 %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic 724 ; CHECK: %atomicrmw.umin = atomicrmw volatile umin i32* %word, i32 22 syncscope("singlethread") monotonic 725 fence acquire 726 ; CHECK: fence acquire 727 fence release 728 ; CHECK: fence release 729 fence acq_rel 730 ; CHECK: fence acq_rel 731 fence syncscope("singlethread") seq_cst 732 ; CHECK: fence syncscope("singlethread") seq_cst 733 734 %ld.1 = load atomic i32, i32* %word monotonic, align 4 735 ; CHECK: %ld.1 = load atomic i32, i32* %word monotonic, align 4 736 %ld.2 = load atomic volatile i32, i32* %word acquire, align 8 737 ; CHECK: %ld.2 = load atomic volatile i32, i32* %word acquire, align 8 738 %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16 739 ; CHECK: %ld.3 = load atomic volatile i32, i32* %word syncscope("singlethread") seq_cst, align 16 740 741 store atomic i32 23, i32* %word monotonic, align 4 742 ; CHECK: store atomic i32 23, i32* %word monotonic, align 4 743 store atomic volatile i32 24, i32* %word monotonic, align 4 744 ; CHECK: store atomic volatile i32 24, i32* %word monotonic, align 4 745 store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4 746 ; CHECK: store atomic volatile i32 25, i32* %word syncscope("singlethread") monotonic, align 4 747 ret void 748} 749 750;; Fast Math Flags 751define void @fastmathflags(float %op1, float %op2) { 752 %f.nnan = fadd nnan float %op1, %op2 753 ; CHECK: %f.nnan = fadd nnan float %op1, %op2 754 %f.ninf = fadd ninf float %op1, %op2 755 ; CHECK: %f.ninf = fadd ninf float %op1, %op2 756 %f.nsz = fadd nsz float %op1, %op2 757 ; CHECK: %f.nsz = fadd nsz float %op1, %op2 758 %f.arcp = fadd arcp float %op1, %op2 759 ; CHECK: %f.arcp = fadd arcp float %op1, %op2 760 %f.fast = fadd fast float %op1, %op2 761 ; CHECK: %f.fast = fadd fast float %op1, %op2 762 ret void 763} 764 765; Check various fast math flags and floating-point types on calls. 766 767declare float @fmf1() 768declare double @fmf2() 769declare <4 x double> @fmf3() 770 771; CHECK-LABEL: fastMathFlagsForCalls( 772define void @fastMathFlagsForCalls(float %f, double %d1, <4 x double> %d2) { 773 %call.fast = call fast float @fmf1() 774 ; CHECK: %call.fast = call fast float @fmf1() 775 776 ; Throw in some other attributes to make sure those stay in the right places. 777 778 %call.nsz.arcp = notail call nsz arcp double @fmf2() 779 ; CHECK: %call.nsz.arcp = notail call nsz arcp double @fmf2() 780 781 %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3() 782 ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3() 783 784 ret void 785} 786 787;; Type System 788%opaquety = type opaque 789define void @typesystem() { 790 %p0 = bitcast i8* null to i32 (i32)* 791 ; CHECK: %p0 = bitcast i8* null to i32 (i32)* 792 %p1 = bitcast i8* null to void (i8*)* 793 ; CHECK: %p1 = bitcast i8* null to void (i8*)* 794 %p2 = bitcast i8* null to i32 (i8*, ...)* 795 ; CHECK: %p2 = bitcast i8* null to i32 (i8*, ...)* 796 %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)* 797 ; CHECK: %p3 = bitcast i8* null to { i32, i8 } (i8*, ...)* 798 %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)* 799 ; CHECK: %p4 = bitcast i8* null to <{ i32, i8 }> (i8*, ...)* 800 %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)* 801 ; CHECK: %p5 = bitcast i8* null to <{ i32, i8 }> (<{ i8*, i64 }>*, ...)* 802 803 %t0 = alloca i1942652 804 ; CHECK: %t0 = alloca i1942652 805 %t1 = alloca half 806 ; CHECK: %t1 = alloca half 807 %t2 = alloca float 808 ; CHECK: %t2 = alloca float 809 %t3 = alloca double 810 ; CHECK: %t3 = alloca double 811 %t4 = alloca fp128 812 ; CHECK: %t4 = alloca fp128 813 %t5 = alloca x86_fp80 814 ; CHECK: %t5 = alloca x86_fp80 815 %t6 = alloca ppc_fp128 816 ; CHECK: %t6 = alloca ppc_fp128 817 %t7 = alloca x86_mmx 818 ; CHECK: %t7 = alloca x86_mmx 819 %t8 = alloca %opaquety* 820 ; CHECK: %t8 = alloca %opaquety* 821 822 ret void 823} 824 825declare void @llvm.token(token) 826; CHECK: declare void @llvm.token(token) 827 828;; Inline Assembler Expressions 829define void @inlineasm(i32 %arg) { 830 call i32 asm "bswap $0", "=r,r"(i32 %arg) 831 ; CHECK: call i32 asm "bswap $0", "=r,r"(i32 %arg) 832 call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg) 833 ; CHECK: call i32 asm sideeffect "blt $1, $2, $3", "=r,r,rm"(i32 %arg, i32 %arg) 834 ret void 835} 836 837;; Instructions 838 839; Instructions -- Terminators 840define void @instructions.terminators(i8 %val) personality i32 -10 { 841 br i1 false, label %iftrue, label %iffalse 842 ; CHECK: br i1 false, label %iftrue, label %iffalse 843 br label %iftrue 844 ; CHECK: br label %iftrue 845iftrue: 846 ret void 847 ; CHECK: ret void 848iffalse: 849 850 switch i8 %val, label %defaultdest [ 851 ; CHECK: switch i8 %val, label %defaultdest [ 852 i8 0, label %defaultdest.0 853 ; CHECK: i8 0, label %defaultdest.0 854 i8 1, label %defaultdest.1 855 ; CHECK: i8 1, label %defaultdest.1 856 i8 2, label %defaultdest.2 857 ; CHECK: i8 2, label %defaultdest.2 858 ] 859 ; CHECK: ] 860defaultdest: 861 ret void 862defaultdest.0: 863 ret void 864defaultdest.1: 865 ret void 866defaultdest.2: 867 868 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2] 869 ; CHECK: indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2] 870 indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2] 871 ; CHECK: indirectbr i8* blockaddress(@instructions.terminators, %defaultdest.2), [label %defaultdest.2, label %defaultdest.2] 872 873 invoke fastcc void @f.fastcc() 874 ; CHECK: invoke fastcc void @f.fastcc() 875 to label %defaultdest unwind label %exc 876 ; CHECK: to label %defaultdest unwind label %exc 877exc: 878 %cleanup = landingpad i32 cleanup 879 880 resume i32 undef 881 ; CHECK: resume i32 undef 882 unreachable 883 ; CHECK: unreachable 884 885 ret void 886} 887 888define i32 @instructions.win_eh.1() personality i32 -3 { 889entry: 890 %arg1 = alloca i32 891 %arg2 = alloca i32 892 invoke void @f.ccc() to label %normal unwind label %catchswitch1 893 invoke void @f.ccc() to label %normal unwind label %catchswitch2 894 invoke void @f.ccc() to label %normal unwind label %catchswitch3 895 896catchswitch1: 897 %cs1 = catchswitch within none [label %catchpad1] unwind to caller 898 899catchpad1: 900 catchpad within %cs1 [] 901 br label %normal 902 ; CHECK: catchpad within %cs1 [] 903 ; CHECK-NEXT: br label %normal 904 905catchswitch2: 906 %cs2 = catchswitch within none [label %catchpad2] unwind to caller 907 908catchpad2: 909 catchpad within %cs2 [i32* %arg1] 910 br label %normal 911 ; CHECK: catchpad within %cs2 [i32* %arg1] 912 ; CHECK-NEXT: br label %normal 913 914catchswitch3: 915 %cs3 = catchswitch within none [label %catchpad3] unwind label %cleanuppad1 916 917catchpad3: 918 catchpad within %cs3 [i32* %arg1, i32* %arg2] 919 br label %normal 920 ; CHECK: catchpad within %cs3 [i32* %arg1, i32* %arg2] 921 ; CHECK-NEXT: br label %normal 922 923cleanuppad1: 924 %clean.1 = cleanuppad within none [] 925 unreachable 926 ; CHECK: %clean.1 = cleanuppad within none [] 927 ; CHECK-NEXT: unreachable 928 929normal: 930 ret i32 0 931} 932; 933define i32 @instructions.win_eh.2() personality i32 -4 { 934entry: 935 invoke void @f.ccc() to label %invoke.cont unwind label %catchswitch 936 937invoke.cont: 938 invoke void @f.ccc() to label %continue unwind label %cleanup 939 940cleanup: 941 %clean = cleanuppad within none [] 942 ; CHECK: %clean = cleanuppad within none [] 943 cleanupret from %clean unwind to caller 944 ; CHECK: cleanupret from %clean unwind to caller 945 946catchswitch: 947 %cs = catchswitch within none [label %catchpad] unwind label %terminate 948 949catchpad: 950 %catch = catchpad within %cs [] 951 br label %body 952 ; CHECK: %catch = catchpad within %cs [] 953 ; CHECK-NEXT: br label %body 954 955body: 956 invoke void @f.ccc() [ "funclet"(token %catch) ] 957 to label %continue unwind label %terminate.inner 958 catchret from %catch to label %return 959 ; CHECK: catchret from %catch to label %return 960 961return: 962 ret i32 0 963 964terminate.inner: 965 cleanuppad within %catch [] 966 unreachable 967 ; CHECK: cleanuppad within %catch [] 968 ; CHECK-NEXT: unreachable 969 970terminate: 971 cleanuppad within none [] 972 unreachable 973 ; CHECK: cleanuppad within none [] 974 ; CHECK-NEXT: unreachable 975 976continue: 977 ret i32 0 978} 979 980; Instructions -- Binary Operations 981define void @instructions.binops(i8 %op1, i8 %op2) { 982 ; nuw x nsw 983 add i8 %op1, %op2 984 ; CHECK: add i8 %op1, %op2 985 add nuw i8 %op1, %op2 986 ; CHECK: add nuw i8 %op1, %op2 987 add nsw i8 %op1, %op2 988 ; CHECK: add nsw i8 %op1, %op2 989 add nuw nsw i8 %op1, %op2 990 ; CHECK: add nuw nsw i8 %op1, %op2 991 sub i8 %op1, %op2 992 ; CHECK: sub i8 %op1, %op2 993 sub nuw i8 %op1, %op2 994 ; CHECK: sub nuw i8 %op1, %op2 995 sub nsw i8 %op1, %op2 996 ; CHECK: sub nsw i8 %op1, %op2 997 sub nuw nsw i8 %op1, %op2 998 ; CHECK: sub nuw nsw i8 %op1, %op2 999 mul i8 %op1, %op2 1000 ; CHECK: mul i8 %op1, %op2 1001 mul nuw i8 %op1, %op2 1002 ; CHECK: mul nuw i8 %op1, %op2 1003 mul nsw i8 %op1, %op2 1004 ; CHECK: mul nsw i8 %op1, %op2 1005 mul nuw nsw i8 %op1, %op2 1006 ; CHECK: mul nuw nsw i8 %op1, %op2 1007 1008 ; exact 1009 udiv i8 %op1, %op2 1010 ; CHECK: udiv i8 %op1, %op2 1011 udiv exact i8 %op1, %op2 1012 ; CHECK: udiv exact i8 %op1, %op2 1013 sdiv i8 %op1, %op2 1014 ; CHECK: sdiv i8 %op1, %op2 1015 sdiv exact i8 %op1, %op2 1016 ; CHECK: sdiv exact i8 %op1, %op2 1017 1018 ; none 1019 urem i8 %op1, %op2 1020 ; CHECK: urem i8 %op1, %op2 1021 srem i8 %op1, %op2 1022 ; CHECK: srem i8 %op1, %op2 1023 1024 ret void 1025} 1026 1027; Instructions -- Bitwise Binary Operations 1028define void @instructions.bitwise_binops(i8 %op1, i8 %op2) { 1029 ; nuw x nsw 1030 shl i8 %op1, %op2 1031 ; CHECK: shl i8 %op1, %op2 1032 shl nuw i8 %op1, %op2 1033 ; CHECK: shl nuw i8 %op1, %op2 1034 shl nsw i8 %op1, %op2 1035 ; CHECK: shl nsw i8 %op1, %op2 1036 shl nuw nsw i8 %op1, %op2 1037 ; CHECK: shl nuw nsw i8 %op1, %op2 1038 1039 ; exact 1040 lshr i8 %op1, %op2 1041 ; CHECK: lshr i8 %op1, %op2 1042 lshr exact i8 %op1, %op2 1043 ; CHECK: lshr exact i8 %op1, %op2 1044 ashr i8 %op1, %op2 1045 ; CHECK: ashr i8 %op1, %op2 1046 ashr exact i8 %op1, %op2 1047 ; CHECK: ashr exact i8 %op1, %op2 1048 1049 ; none 1050 and i8 %op1, %op2 1051 ; CHECK: and i8 %op1, %op2 1052 or i8 %op1, %op2 1053 ; CHECK: or i8 %op1, %op2 1054 xor i8 %op1, %op2 1055 ; CHECK: xor i8 %op1, %op2 1056 1057 ret void 1058} 1059 1060; Instructions -- Vector Operations 1061define void @instructions.vectorops(<4 x float> %vec, <4 x float> %vec2) { 1062 extractelement <4 x float> %vec, i8 0 1063 ; CHECK: extractelement <4 x float> %vec, i8 0 1064 insertelement <4 x float> %vec, float 3.500000e+00, i8 0 1065 ; CHECK: insertelement <4 x float> %vec, float 3.500000e+00, i8 0 1066 shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer 1067 ; CHECK: shufflevector <4 x float> %vec, <4 x float> %vec2, <2 x i32> zeroinitializer 1068 1069 ret void 1070} 1071 1072; Instructions -- Aggregate Operations 1073define void @instructions.aggregateops({ i8, i32 } %up, <{ i8, i32 }> %p, 1074 [3 x i8] %arr, { i8, { i32 }} %n, 1075 <2 x i8*> %pvec, <2 x i64> %offsets) { 1076 extractvalue { i8, i32 } %up, 0 1077 ; CHECK: extractvalue { i8, i32 } %up, 0 1078 extractvalue <{ i8, i32 }> %p, 1 1079 ; CHECK: extractvalue <{ i8, i32 }> %p, 1 1080 extractvalue [3 x i8] %arr, 2 1081 ; CHECK: extractvalue [3 x i8] %arr, 2 1082 extractvalue { i8, { i32 } } %n, 1, 0 1083 ; CHECK: extractvalue { i8, { i32 } } %n, 1, 0 1084 1085 insertvalue { i8, i32 } %up, i8 1, 0 1086 ; CHECK: insertvalue { i8, i32 } %up, i8 1, 0 1087 insertvalue <{ i8, i32 }> %p, i32 2, 1 1088 ; CHECK: insertvalue <{ i8, i32 }> %p, i32 2, 1 1089 insertvalue [3 x i8] %arr, i8 0, 0 1090 ; CHECK: insertvalue [3 x i8] %arr, i8 0, 0 1091 insertvalue { i8, { i32 } } %n, i32 0, 1, 0 1092 ; CHECK: insertvalue { i8, { i32 } } %n, i32 0, 1, 0 1093 1094 %up.ptr = alloca { i8, i32 } 1095 %p.ptr = alloca <{ i8, i32 }> 1096 %arr.ptr = alloca [3 x i8] 1097 %n.ptr = alloca { i8, { i32 } } 1098 1099 getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0 1100 ; CHECK: getelementptr { i8, i32 }, { i8, i32 }* %up.ptr, i8 0 1101 getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1 1102 ; CHECK: getelementptr <{ i8, i32 }>, <{ i8, i32 }>* %p.ptr, i8 1 1103 getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2 1104 ; CHECK: getelementptr [3 x i8], [3 x i8]* %arr.ptr, i8 2 1105 getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1 1106 ; CHECK: getelementptr { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 0, i32 1 1107 getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0 1108 ; CHECK: getelementptr inbounds { i8, { i32 } }, { i8, { i32 } }* %n.ptr, i32 1, i32 0 1109 getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets 1110 ; CHECK: getelementptr i8, <2 x i8*> %pvec, <2 x i64> %offsets 1111 1112 ret void 1113} 1114 1115; Instructions -- Memory Access and Addressing Operations 1116!7 = !{i32 1} 1117!8 = !{} 1118!9 = !{i64 4} 1119define void @instructions.memops(i32** %base) { 1120 alloca i32, i8 4, align 4 1121 ; CHECK: alloca i32, i8 4, align 4 1122 alloca inalloca i32, i8 4, align 4 1123 ; CHECK: alloca inalloca i32, i8 4, align 4 1124 1125 load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9 1126 ; CHECK: load i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9 1127 load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9 1128 ; CHECK: load volatile i32*, i32** %base, align 8, !invariant.load !7, !nontemporal !8, !nonnull !7, !dereferenceable !9, !dereferenceable_or_null !9 1129 1130 store i32* null, i32** %base, align 4, !nontemporal !8 1131 ; CHECK: store i32* null, i32** %base, align 4, !nontemporal !8 1132 store volatile i32* null, i32** %base, align 4, !nontemporal !8 1133 ; CHECK: store volatile i32* null, i32** %base, align 4, !nontemporal !8 1134 1135 ret void 1136} 1137 1138; Instructions -- Conversion Operations 1139define void @instructions.conversions() { 1140 trunc i32 -1 to i1 1141 ; CHECK: trunc i32 -1 to i1 1142 zext i32 -1 to i64 1143 ; CHECK: zext i32 -1 to i64 1144 sext i32 -1 to i64 1145 ; CHECK: sext i32 -1 to i64 1146 fptrunc float undef to half 1147 ; CHECK: fptrunc float undef to half 1148 fpext half undef to float 1149 ; CHECK: fpext half undef to float 1150 fptoui float undef to i32 1151 ; CHECK: fptoui float undef to i32 1152 fptosi float undef to i32 1153 ; CHECK: fptosi float undef to i32 1154 uitofp i32 1 to float 1155 ; CHECK: uitofp i32 1 to float 1156 sitofp i32 -1 to float 1157 ; CHECK: sitofp i32 -1 to float 1158 ptrtoint i8* null to i64 1159 ; CHECK: ptrtoint i8* null to i64 1160 inttoptr i64 0 to i8* 1161 ; CHECK: inttoptr i64 0 to i8* 1162 bitcast i32 0 to i32 1163 ; CHECK: bitcast i32 0 to i32 1164 addrspacecast i32* null to i32 addrspace(1)* 1165 ; CHECK: addrspacecast i32* null to i32 addrspace(1)* 1166 1167 ret void 1168} 1169 1170; Instructions -- Other Operations 1171define void @instructions.other(i32 %op1, i32 %op2, half %fop1, half %fop2) { 1172entry: 1173 icmp eq i32 %op1, %op2 1174 ; CHECK: icmp eq i32 %op1, %op2 1175 icmp ne i32 %op1, %op2 1176 ; CHECK: icmp ne i32 %op1, %op2 1177 icmp ugt i32 %op1, %op2 1178 ; CHECK: icmp ugt i32 %op1, %op2 1179 icmp uge i32 %op1, %op2 1180 ; CHECK: icmp uge i32 %op1, %op2 1181 icmp ult i32 %op1, %op2 1182 ; CHECK: icmp ult i32 %op1, %op2 1183 icmp ule i32 %op1, %op2 1184 ; CHECK: icmp ule i32 %op1, %op2 1185 icmp sgt i32 %op1, %op2 1186 ; CHECK: icmp sgt i32 %op1, %op2 1187 icmp sge i32 %op1, %op2 1188 ; CHECK: icmp sge i32 %op1, %op2 1189 icmp slt i32 %op1, %op2 1190 ; CHECK: icmp slt i32 %op1, %op2 1191 icmp sle i32 %op1, %op2 1192 ; CHECK: icmp sle i32 %op1, %op2 1193 1194 fcmp false half %fop1, %fop2 1195 ; CHECK: fcmp false half %fop1, %fop2 1196 fcmp oeq half %fop1, %fop2 1197 ; CHECK: fcmp oeq half %fop1, %fop2 1198 fcmp ogt half %fop1, %fop2 1199 ; CHECK: fcmp ogt half %fop1, %fop2 1200 fcmp oge half %fop1, %fop2 1201 ; CHECK: fcmp oge half %fop1, %fop2 1202 fcmp olt half %fop1, %fop2 1203 ; CHECK: fcmp olt half %fop1, %fop2 1204 fcmp ole half %fop1, %fop2 1205 ; CHECK: fcmp ole half %fop1, %fop2 1206 fcmp one half %fop1, %fop2 1207 ; CHECK: fcmp one half %fop1, %fop2 1208 fcmp ord half %fop1, %fop2 1209 ; CHECK: fcmp ord half %fop1, %fop2 1210 fcmp ueq half %fop1, %fop2 1211 ; CHECK: fcmp ueq half %fop1, %fop2 1212 fcmp ugt half %fop1, %fop2 1213 ; CHECK: fcmp ugt half %fop1, %fop2 1214 fcmp uge half %fop1, %fop2 1215 ; CHECK: fcmp uge half %fop1, %fop2 1216 fcmp ult half %fop1, %fop2 1217 ; CHECK: fcmp ult half %fop1, %fop2 1218 fcmp ule half %fop1, %fop2 1219 ; CHECK: fcmp ule half %fop1, %fop2 1220 fcmp une half %fop1, %fop2 1221 ; CHECK: fcmp une half %fop1, %fop2 1222 fcmp uno half %fop1, %fop2 1223 ; CHECK: fcmp uno half %fop1, %fop2 1224 fcmp true half %fop1, %fop2 1225 ; CHECK: fcmp true half %fop1, %fop2 1226 1227 br label %exit 1228L1: 1229 %v1 = add i32 %op1, %op2 1230 br label %exit 1231L2: 1232 %v2 = add i32 %op1, %op2 1233 br label %exit 1234exit: 1235 phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ] 1236 ; CHECK: phi i32 [ %v1, %L1 ], [ %v2, %L2 ], [ %op1, %entry ] 1237 1238 select i1 true, i32 0, i32 1 1239 ; CHECK: select i1 true, i32 0, i32 1 1240 select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2> 1241 ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2> 1242 1243 call void @f.nobuiltin() builtin 1244 ; CHECK: call void @f.nobuiltin() #41 1245 1246 call fastcc noalias i32* @f.noalias() noinline 1247 ; CHECK: call fastcc noalias i32* @f.noalias() #12 1248 tail call ghccc nonnull i32* @f.nonnull() minsize 1249 ; CHECK: tail call ghccc nonnull i32* @f.nonnull() #7 1250 1251 ret void 1252} 1253 1254define void @instructions.call_musttail(i8* inalloca %val) { 1255 musttail call void @f.param.inalloca(i8* inalloca %val) 1256 ; CHECK: musttail call void @f.param.inalloca(i8* inalloca %val) 1257 1258 ret void 1259} 1260 1261define void @instructions.call_notail() { 1262 notail call void @f1() 1263 ; CHECK: notail call void @f1() 1264 1265 ret void 1266} 1267 1268define void @instructions.landingpad() personality i32 -2 { 1269 invoke void @llvm.donothing() to label %proceed unwind label %catch1 1270 invoke void @llvm.donothing() to label %proceed unwind label %catch2 1271 invoke void @llvm.donothing() to label %proceed unwind label %catch3 1272 invoke void @llvm.donothing() to label %proceed unwind label %catch4 1273 1274catch1: 1275 landingpad i32 1276 ; CHECK: landingpad i32 1277 cleanup 1278 ; CHECK: cleanup 1279 br label %proceed 1280 1281catch2: 1282 landingpad i32 1283 ; CHECK: landingpad i32 1284 cleanup 1285 ; CHECK: cleanup 1286 catch i32* null 1287 ; CHECK: catch i32* null 1288 br label %proceed 1289 1290catch3: 1291 landingpad i32 1292 ; CHECK: landingpad i32 1293 cleanup 1294 ; CHECK: cleanup 1295 catch i32* null 1296 ; CHECK: catch i32* null 1297 catch i32* null 1298 ; CHECK: catch i32* null 1299 br label %proceed 1300 1301catch4: 1302 landingpad i32 1303 ; CHECK: landingpad i32 1304 filter [2 x i32] zeroinitializer 1305 ; CHECK: filter [2 x i32] zeroinitializer 1306 br label %proceed 1307 1308proceed: 1309 ret void 1310} 1311 1312;; Intrinsic Functions 1313 1314; Intrinsic Functions -- Variable Argument Handling 1315declare void @llvm.va_start(i8*) 1316declare void @llvm.va_copy(i8*, i8*) 1317declare void @llvm.va_end(i8*) 1318define void @instructions.va_arg(i8* %v, ...) { 1319 %ap = alloca i8* 1320 %ap2 = bitcast i8** %ap to i8* 1321 1322 call void @llvm.va_start(i8* %ap2) 1323 ; CHECK: call void @llvm.va_start(i8* %ap2) 1324 1325 va_arg i8* %ap2, i32 1326 ; CHECK: va_arg i8* %ap2, i32 1327 1328 call void @llvm.va_copy(i8* %v, i8* %ap2) 1329 ; CHECK: call void @llvm.va_copy(i8* %v, i8* %ap2) 1330 1331 call void @llvm.va_end(i8* %ap2) 1332 ; CHECK: call void @llvm.va_end(i8* %ap2) 1333 1334 ret void 1335} 1336 1337; Intrinsic Functions -- Accurate Garbage Collection 1338declare void @llvm.gcroot(i8**, i8*) 1339declare i8* @llvm.gcread(i8*, i8**) 1340declare void @llvm.gcwrite(i8*, i8*, i8**) 1341define void @intrinsics.gc() gc "shadow-stack" { 1342 %ptrloc = alloca i8* 1343 call void @llvm.gcroot(i8** %ptrloc, i8* null) 1344 ; CHECK: call void @llvm.gcroot(i8** %ptrloc, i8* null) 1345 1346 call i8* @llvm.gcread(i8* null, i8** %ptrloc) 1347 ; CHECK: call i8* @llvm.gcread(i8* null, i8** %ptrloc) 1348 1349 %ref = alloca i8 1350 call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc) 1351 ; CHECK: call void @llvm.gcwrite(i8* %ref, i8* null, i8** %ptrloc) 1352 1353 ret void 1354} 1355 1356; Intrinsic Functions -- Code Generation 1357declare i8* @llvm.returnaddress(i32) 1358declare i8* @llvm.frameaddress(i32) 1359declare i32 @llvm.read_register.i32(metadata) 1360declare i64 @llvm.read_register.i64(metadata) 1361declare void @llvm.write_register.i32(metadata, i32) 1362declare void @llvm.write_register.i64(metadata, i64) 1363declare i8* @llvm.stacksave() 1364declare void @llvm.stackrestore(i8*) 1365declare void @llvm.prefetch(i8*, i32, i32, i32) 1366declare void @llvm.pcmarker(i32) 1367declare i64 @llvm.readcyclecounter() 1368declare void @llvm.clear_cache(i8*, i8*) 1369declare void @llvm.instrprof_increment(i8*, i64, i32, i32) 1370 1371!10 = !{!"rax"} 1372define void @intrinsics.codegen() { 1373 call i8* @llvm.returnaddress(i32 1) 1374 ; CHECK: call i8* @llvm.returnaddress(i32 1) 1375 call i8* @llvm.frameaddress(i32 1) 1376 ; CHECK: call i8* @llvm.frameaddress(i32 1) 1377 1378 call i32 @llvm.read_register.i32(metadata !10) 1379 ; CHECK: call i32 @llvm.read_register.i32(metadata !10) 1380 call i64 @llvm.read_register.i64(metadata !10) 1381 ; CHECK: call i64 @llvm.read_register.i64(metadata !10) 1382 call void @llvm.write_register.i32(metadata !10, i32 0) 1383 ; CHECK: call void @llvm.write_register.i32(metadata !10, i32 0) 1384 call void @llvm.write_register.i64(metadata !10, i64 0) 1385 ; CHECK: call void @llvm.write_register.i64(metadata !10, i64 0) 1386 1387 %stack = call i8* @llvm.stacksave() 1388 ; CHECK: %stack = call i8* @llvm.stacksave() 1389 call void @llvm.stackrestore(i8* %stack) 1390 ; CHECK: call void @llvm.stackrestore(i8* %stack) 1391 1392 call void @llvm.prefetch(i8* %stack, i32 0, i32 3, i32 0) 1393 ; CHECK: call void @llvm.prefetch(i8* %stack, i32 0, i32 3, i32 0) 1394 1395 call void @llvm.pcmarker(i32 1) 1396 ; CHECK: call void @llvm.pcmarker(i32 1) 1397 1398 call i64 @llvm.readcyclecounter() 1399 ; CHECK: call i64 @llvm.readcyclecounter() 1400 1401 call void @llvm.clear_cache(i8* null, i8* null) 1402 ; CHECK: call void @llvm.clear_cache(i8* null, i8* null) 1403 1404 call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0) 1405 ; CHECK: call void @llvm.instrprof_increment(i8* null, i64 0, i32 0, i32 0) 1406 1407 ret void 1408} 1409 1410declare void @llvm.localescape(...) 1411declare i8* @llvm.localrecover(i8* %func, i8* %fp, i32 %idx) 1412define void @intrinsics.localescape() { 1413 %static.alloca = alloca i32 1414 call void (...) @llvm.localescape(i32* %static.alloca) 1415 ; CHECK: call void (...) @llvm.localescape(i32* %static.alloca) 1416 1417 call void @intrinsics.localrecover() 1418 1419 ret void 1420} 1421define void @intrinsics.localrecover() { 1422 %func = bitcast void ()* @intrinsics.localescape to i8* 1423 %fp = call i8* @llvm.frameaddress(i32 1) 1424 call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0) 1425 ; CHECK: call i8* @llvm.localrecover(i8* %func, i8* %fp, i32 0) 1426 1427 ret void 1428} 1429 1430; We need this function to provide `uses' for some metadata tests. 1431define void @misc.metadata() { 1432 call void @f1(), !srcloc !11 1433 call void @f1(), !srcloc !12 1434 call void @f1(), !srcloc !13 1435 call void @f1(), !srcloc !14 1436 ret void 1437} 1438 1439declare void @op_bundle_callee_0() 1440declare void @op_bundle_callee_1(i32,i32) 1441 1442define void @call_with_operand_bundle0(i32* %ptr) { 1443; CHECK-LABEL: call_with_operand_bundle0( 1444 entry: 1445 %l = load i32, i32* %ptr 1446 %x = add i32 42, 1 1447 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ] 1448; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ] 1449 ret void 1450} 1451 1452define void @call_with_operand_bundle1(i32* %ptr) { 1453; CHECK-LABEL: call_with_operand_bundle1( 1454 entry: 1455 %l = load i32, i32* %ptr 1456 %x = add i32 42, 1 1457 1458 call void @op_bundle_callee_0() 1459 call void @op_bundle_callee_0() [ "foo"() ] 1460 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ] 1461; CHECK: @op_bundle_callee_0(){{$}} 1462; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"() ] 1463; CHECK-NEXT: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ] 1464 ret void 1465} 1466 1467define void @call_with_operand_bundle2(i32* %ptr) { 1468; CHECK-LABEL: call_with_operand_bundle2( 1469 entry: 1470 call void @op_bundle_callee_0() [ "foo"() ] 1471; CHECK: call void @op_bundle_callee_0() [ "foo"() ] 1472 ret void 1473} 1474 1475define void @call_with_operand_bundle3(i32* %ptr) { 1476; CHECK-LABEL: call_with_operand_bundle3( 1477 entry: 1478 %l = load i32, i32* %ptr 1479 %x = add i32 42, 1 1480 call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] 1481; CHECK: call void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] 1482 ret void 1483} 1484 1485define void @call_with_operand_bundle4(i32* %ptr) { 1486; CHECK-LABEL: call_with_operand_bundle4( 1487 entry: 1488 %l = load i32, i32* %ptr 1489 %x = add i32 42, 1 1490 call void @op_bundle_callee_1(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] 1491; CHECK: call void @op_bundle_callee_1(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] 1492 ret void 1493} 1494 1495; Invoke versions of the above tests: 1496 1497 1498define void @invoke_with_operand_bundle0(i32* %ptr) personality i8 3 { 1499; CHECK-LABEL: @invoke_with_operand_bundle0( 1500 entry: 1501 %l = load i32, i32* %ptr 1502 %x = add i32 42, 1 1503 invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ] to label %normal unwind label %exception 1504; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ] 1505 1506exception: 1507 %cleanup = landingpad i8 cleanup 1508 br label %normal 1509normal: 1510 ret void 1511} 1512 1513define void @invoke_with_operand_bundle1(i32* %ptr) personality i8 3 { 1514; CHECK-LABEL: @invoke_with_operand_bundle1( 1515 entry: 1516 %l = load i32, i32* %ptr 1517 %x = add i32 42, 1 1518 1519 invoke void @op_bundle_callee_0() to label %normal unwind label %exception 1520; CHECK: invoke void @op_bundle_callee_0(){{$}} 1521 1522exception: 1523 %cleanup = landingpad i8 cleanup 1524 br label %normal 1525 1526normal: 1527 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal1 unwind label %exception1 1528; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ] 1529 1530exception1: 1531 %cleanup1 = landingpad i8 cleanup 1532 br label %normal1 1533 1534normal1: 1535 invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] to label %normal2 unwind label %exception2 1536; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] 1537 1538exception2: 1539 %cleanup2 = landingpad i8 cleanup 1540 br label %normal2 1541 1542normal2: 1543 ret void 1544} 1545 1546define void @invoke_with_operand_bundle2(i32* %ptr) personality i8 3 { 1547; CHECK-LABEL: @invoke_with_operand_bundle2( 1548 entry: 1549 invoke void @op_bundle_callee_0() [ "foo"() ] to label %normal unwind label %exception 1550; CHECK: invoke void @op_bundle_callee_0() [ "foo"() ] 1551 1552exception: 1553 %cleanup = landingpad i8 cleanup 1554 br label %normal 1555normal: 1556 ret void 1557} 1558 1559define void @invoke_with_operand_bundle3(i32* %ptr) personality i8 3 { 1560; CHECK-LABEL: @invoke_with_operand_bundle3( 1561 entry: 1562 %l = load i32, i32* %ptr 1563 %x = add i32 42, 1 1564 invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] to label %normal unwind label %exception 1565; CHECK: invoke void @op_bundle_callee_0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] 1566 1567exception: 1568 %cleanup = landingpad i8 cleanup 1569 br label %normal 1570normal: 1571 ret void 1572} 1573 1574define void @invoke_with_operand_bundle4(i32* %ptr) personality i8 3 { 1575; CHECK-LABEL: @invoke_with_operand_bundle4( 1576 entry: 1577 %l = load i32, i32* %ptr 1578 %x = add i32 42, 1 1579 invoke void @op_bundle_callee_1(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] 1580 to label %normal unwind label %exception 1581; CHECK: invoke void @op_bundle_callee_1(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] 1582 1583exception: 1584 %cleanup = landingpad i8 cleanup 1585 br label %normal 1586normal: 1587 ret void 1588} 1589 1590declare void @f.writeonly() writeonly 1591; CHECK: declare void @f.writeonly() #40 1592 1593; CHECK: attributes #0 = { alignstack=4 } 1594; CHECK: attributes #1 = { alignstack=8 } 1595; CHECK: attributes #2 = { alwaysinline } 1596; CHECK: attributes #3 = { cold } 1597; CHECK: attributes #4 = { convergent } 1598; CHECK: attributes #5 = { inlinehint } 1599; CHECK: attributes #6 = { jumptable } 1600; CHECK: attributes #7 = { minsize } 1601; CHECK: attributes #8 = { naked } 1602; CHECK: attributes #9 = { nobuiltin } 1603; CHECK: attributes #10 = { noduplicate } 1604; CHECK: attributes #11 = { noimplicitfloat } 1605; CHECK: attributes #12 = { noinline } 1606; CHECK: attributes #13 = { nonlazybind } 1607; CHECK: attributes #14 = { noredzone } 1608; CHECK: attributes #15 = { noreturn } 1609; CHECK: attributes #16 = { nounwind } 1610; CHECK: attributes #17 = { noinline optnone } 1611; CHECK: attributes #18 = { optsize } 1612; CHECK: attributes #19 = { readnone } 1613; CHECK: attributes #20 = { readonly } 1614; CHECK: attributes #21 = { returns_twice } 1615; CHECK: attributes #22 = { safestack } 1616; CHECK: attributes #23 = { sanitize_address } 1617; CHECK: attributes #24 = { sanitize_memory } 1618; CHECK: attributes #25 = { sanitize_thread } 1619; CHECK: attributes #26 = { ssp } 1620; CHECK: attributes #27 = { sspreq } 1621; CHECK: attributes #28 = { sspstrong } 1622; CHECK: attributes #29 = { "thunk" } 1623; CHECK: attributes #30 = { uwtable } 1624; CHECK: attributes #31 = { "cpu"="cortex-a8" } 1625; CHECK: attributes #32 = { norecurse } 1626; CHECK: attributes #33 = { inaccessiblememonly } 1627; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly } 1628; CHECK: attributes #35 = { nounwind readnone } 1629; CHECK: attributes #36 = { argmemonly nounwind readonly } 1630; CHECK: attributes #37 = { argmemonly nounwind } 1631; CHECK: attributes #38 = { nounwind readonly } 1632; CHECK: attributes #39 = { inaccessiblemem_or_argmemonly nounwind } 1633; CHECK: attributes #40 = { writeonly } 1634; CHECK: attributes #41 = { builtin } 1635 1636;; Metadata 1637 1638; Metadata -- Module flags 1639!llvm.module.flags = !{!0, !1, !2, !4, !5, !6} 1640; CHECK: !llvm.module.flags = !{!0, !1, !2, !4, !5, !6} 1641 1642!0 = !{i32 1, !"mod1", i32 0} 1643; CHECK: !0 = !{i32 1, !"mod1", i32 0} 1644!1 = !{i32 2, !"mod2", i32 0} 1645; CHECK: !1 = !{i32 2, !"mod2", i32 0} 1646!2 = !{i32 3, !"mod3", !3} 1647; CHECK: !2 = !{i32 3, !"mod3", !3} 1648!3 = !{!"mod6", !0} 1649; CHECK: !3 = !{!"mod6", !0} 1650!4 = !{i32 4, !"mod4", i32 0} 1651; CHECK: !4 = !{i32 4, !"mod4", i32 0} 1652!5 = !{i32 5, !"mod5", !0} 1653; CHECK: !5 = !{i32 5, !"mod5", !0} 1654!6 = !{i32 6, !"mod6", !0} 1655; CHECK: !6 = !{i32 6, !"mod6", !0} 1656 1657; Metadata -- Check `distinct' 1658!11 = distinct !{} 1659; CHECK: !11 = distinct !{} 1660!12 = distinct !{} 1661; CHECK: !12 = distinct !{} 1662!13 = !{!11} 1663; CHECK: !13 = !{!11} 1664!14 = !{!12} 1665; CHECK: !14 = !{!12} 1666