brintos

brintos / llvm-project-archived public Read only

0
0
Text · 106.3 KiB · 772e776 Raw
4022 lines · plain
1; RUN: llc -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck --check-prefix=LINUX-I386 %s2; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck --check-prefix=LINUX-X64 %s3; RUN: llc -code-model=kernel -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck --check-prefix=LINUX-KERNEL-X64 %s4; RUN: llc -code-model=kernel -mtriple=x86_64-unknown-freebsd < %s -o - | FileCheck --check-prefix=FREEBSD-KERNEL-X64 %s5; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | FileCheck --check-prefix=DARWIN-X64 %s6; RUN: llc -mtriple=amd64-pc-openbsd < %s -o - | FileCheck --check-prefix=OPENBSD-AMD64 %s7; RUN: llc -mtriple=i386-pc-windows-msvc < %s -o - | FileCheck -check-prefix=MSVC-I386 %s8; RUN: llc -mtriple=x86_64-w64-mingw32 < %s -o - | FileCheck --check-prefix=MINGW-X64 %s9; RUN: llc -mtriple=x86_64-pc-cygwin < %s -o - | FileCheck --check-prefix=MINGW-X64 %s10; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck --check-prefix=IGNORE_INTRIN %s11 12%struct.foo = type { [16 x i8] }13%struct.foo.0 = type { [4 x i8] }14%struct.pair = type { i32, i32 }15%struct.nest = type { %struct.pair, %struct.pair }16%struct.vec = type { <4 x i32> }17%class.A = type { [2 x i8] }18%struct.deep = type { %union.anon }19%union.anon = type { %struct.anon }20%struct.anon = type { %struct.anon.0 }21%struct.anon.0 = type { %union.anon.1 }22%union.anon.1 = type { [2 x i8] }23%struct.small = type { i8 }24%struct.small_char = type { i32, [5 x i8] }25 26@.str = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 127 28; test1a: array of [16 x i8] 29;         no ssp attribute30; Requires no protector.31define void @test1a(ptr %a) {32entry:33; LINUX-I386-LABEL: test1a:34; LINUX-I386-NOT: calll __stack_chk_fail35; LINUX-I386: .cfi_endproc36 37; LINUX-X64-LABEL: test1a:38; LINUX-X64-NOT: callq __stack_chk_fail39; LINUX-X64: .cfi_endproc40 41; LINUX-KERNEL-X64-LABEL: test1a:42; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail43; LINUX-KERNEL-X64: .cfi_endproc44 45; DARWIN-X64-LABEL: test1a:46; DARWIN-X64-NOT: callq ___stack_chk_fail47; DARWIN-X64: .cfi_endproc48 49; MSVC-I386-LABEL: test1a:50; MSVC-I386-NOT: calll  @__security_check_cookie@451; MSVC-I386: retl52 53; MINGW-X64-LABEL: test1a:54; MINGW-X64-NOT: callq __stack_chk_fail55; MINGW-X64: .seh_endproc56 57  %a.addr = alloca ptr, align 858  %buf = alloca [16 x i8], align 1659  store ptr %a, ptr %a.addr, align 860  %0 = load ptr, ptr %a.addr, align 861  %call = call ptr @strcpy(ptr %buf, ptr %0)62  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %buf)63  ret void64}65 66; test1b: array of [16 x i8] 67;         ssp attribute68; Requires protector.69; Function Attrs: ssp70define void @test1b(ptr %a) #0 {71entry:72; LINUX-I386-LABEL: test1b:73; LINUX-I386: mov{{l|q}} %gs:74; LINUX-I386: calll __stack_chk_fail75 76; LINUX-X64-LABEL: test1b:77; LINUX-X64: mov{{l|q}} %fs:78; LINUX-X64: callq __stack_chk_fail79 80; FREEBSD-KERNEL-X64-LABEL: test1b:81; FREEBSD-KERNEL-X64-NOT: mov{{l|q}} __stack_chk_guard@GOTPCREL82; FREEBSD-KERNEL-X64: callq __stack_chk_fail83 84; LINUX-KERNEL-X64-LABEL: test1b:85; LINUX-KERNEL-X64: mov{{l|q}} %gs:86; LINUX-KERNEL-X64: callq __stack_chk_fail87 88; DARWIN-X64-LABEL: test1b:89; DARWIN-X64: mov{{l|q}} ___stack_chk_guard90; DARWIN-X64: callq ___stack_chk_fail91 92; OPENBSD-AMD64-LABEL: test1b:93; OPENBSD-AMD64: movq __guard_local(%rip)94; OPENBSD-AMD64: callq __stack_smash_handler95 96; MSVC-I386-LABEL: test1b:97; MSVC-I386: movl ___security_cookie,98; MSVC-I386: calll @__security_check_cookie@499 100; MINGW-X64-LABEL: test1b:101; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard102; MINGW-X64: callq __stack_chk_fail103 104  %a.addr = alloca ptr, align 8105  %buf = alloca [16 x i8], align 16106  store ptr %a, ptr %a.addr, align 8107  %0 = load ptr, ptr %a.addr, align 8108  %call = call ptr @strcpy(ptr %buf, ptr %0)109  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %buf)110  ret void111}112 113; test1c: array of [16 x i8] 114;         sspstrong attribute115; Requires protector.116; Function Attrs: sspstrong 117define void @test1c(ptr %a) #1 {118entry:119; LINUX-I386-LABEL: test1c:120; LINUX-I386: mov{{l|q}} %gs:121; LINUX-I386: calll __stack_chk_fail122 123; LINUX-X64-LABEL: test1c:124; LINUX-X64: mov{{l|q}} %fs:125; LINUX-X64: callq __stack_chk_fail126 127; FREEBSD-KERNEL-X64-LABEL: test1c:128; FREEBSD-KERNEL-X64: mov{{l|q}} __stack_chk_guard(%rip)129; FREEBSD-KERNEL-X64: callq __stack_chk_fail130 131; LINUX-KERNEL-X64-LABEL: test1c:132; LINUX-KERNEL-X64: mov{{l|q}} %gs:133; LINUX-KERNEL-X64: callq __stack_chk_fail134 135; DARWIN-X64-LABEL: test1c:136; DARWIN-X64: mov{{l|q}} ___stack_chk_guard137; DARWIN-X64: callq ___stack_chk_fail138 139; MSVC-I386-LABEL: test1c:140; MSVC-I386: movl ___security_cookie,141; MSVC-I386: calll @__security_check_cookie@4142 143; MINGW-X64-LABEL: test1c:144; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard145; MINGW-X64: callq __stack_chk_fail146 147  %a.addr = alloca ptr, align 8148  %buf = alloca [16 x i8], align 16149  store ptr %a, ptr %a.addr, align 8150  %0 = load ptr, ptr %a.addr, align 8151  %call = call ptr @strcpy(ptr %buf, ptr %0)152  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %buf)153  ret void154}155 156; test1d: array of [16 x i8] 157;         sspreq attribute158; Requires protector.159; Function Attrs: sspreq 160define void @test1d(ptr %a) #2 {161entry:162; LINUX-I386-LABEL: test1d:163; LINUX-I386: mov{{l|q}} %gs:164; LINUX-I386: calll __stack_chk_fail165 166; LINUX-X64-LABEL: test1d:167; LINUX-X64: mov{{l|q}} %fs:168; LINUX-X64: callq __stack_chk_fail169 170; LINUX-KERNEL-X64-LABEL: test1d:171; LINUX-KERNEL-X64: mov{{l|q}} %gs:172; LINUX-KERNEL-X64: callq __stack_chk_fail173 174; DARWIN-X64-LABEL: test1d:175; DARWIN-X64: mov{{l|q}} ___stack_chk_guard176; DARWIN-X64: callq ___stack_chk_fail177 178; MSVC-I386-LABEL: test1d:179; MSVC-I386: movl ___security_cookie,180; MSVC-I386: calll @__security_check_cookie@4181 182; MINGW-X64-LABEL: test1d:183; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard184; MINGW-X64: callq __stack_chk_fail185 186  %a.addr = alloca ptr, align 8187  %buf = alloca [16 x i8], align 16188  store ptr %a, ptr %a.addr, align 8189  %0 = load ptr, ptr %a.addr, align 8190  %call = call ptr @strcpy(ptr %buf, ptr %0)191  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %buf)192  ret void193}194 195; test2a: struct { [16 x i8] }196;         no ssp attribute197; Requires no protector.198define void @test2a(ptr %a) {199entry:200; LINUX-I386-LABEL: test2a:201; LINUX-I386-NOT: calll __stack_chk_fail202; LINUX-I386: .cfi_endproc203 204; LINUX-X64-LABEL: test2a:205; LINUX-X64-NOT: callq __stack_chk_fail206; LINUX-X64: .cfi_endproc207 208; LINUX-KERNEL-X64-LABEL: test2a:209; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail210; LINUX-KERNEL-X64: .cfi_endproc211 212; DARWIN-X64-LABEL: test2a:213; DARWIN-X64-NOT: callq ___stack_chk_fail214; DARWIN-X64: .cfi_endproc215 216; MSVC-I386-LABEL: test2a:217; MSVC-I386-NOT: calll @__security_check_cookie@4218; MSVC-I386: retl219 220; MINGW-X64-LABEL: test2a:221; MINGW-X64-NOT: callq __stack_chk_fail222; MINGW-X64: .seh_endproc223 224  %a.addr = alloca ptr, align 8225  %b = alloca %struct.foo, align 1226  store ptr %a, ptr %a.addr, align 8227  %0 = load ptr, ptr %a.addr, align 8228  %call = call ptr @strcpy(ptr %b, ptr %0)229  %call3 = call i32 (ptr, ...) @printf(ptr @.str, ptr %b)230  ret void231}232 233; test2b: struct { [16 x i8] }234;          ssp attribute235; Requires protector.236; Function Attrs: ssp237define void @test2b(ptr %a) #0 {238entry:239; LINUX-I386-LABEL: test2b:240; LINUX-I386: mov{{l|q}} %gs:241; LINUX-I386: calll __stack_chk_fail242 243; LINUX-X64-LABEL: test2b:244; LINUX-X64: mov{{l|q}} %fs:245; LINUX-X64: callq __stack_chk_fail246 247; LINUX-KERNEL-X64-LABEL: test2b:248; LINUX-KERNEL-X64: mov{{l|q}} %gs:249; LINUX-KERNEL-X64: callq __stack_chk_fail250 251; DARWIN-X64-LABEL: test2b:252; DARWIN-X64: mov{{l|q}} ___stack_chk_guard253; DARWIN-X64: callq ___stack_chk_fail254 255; MINGW-X64-LABEL: test2b:256; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard257; MINGW-X64: callq __stack_chk_fail258 259  %a.addr = alloca ptr, align 8260  %b = alloca %struct.foo, align 1261  store ptr %a, ptr %a.addr, align 8262  %0 = load ptr, ptr %a.addr, align 8263  %call = call ptr @strcpy(ptr %b, ptr %0)264  %call3 = call i32 (ptr, ...) @printf(ptr @.str, ptr %b)265  ret void266}267 268; test2c: struct { [16 x i8] }269;          sspstrong attribute270; Requires protector.271; Function Attrs: sspstrong 272define void @test2c(ptr %a) #1 {273entry:274; LINUX-I386-LABEL: test2c:275; LINUX-I386: mov{{l|q}} %gs:276; LINUX-I386: calll __stack_chk_fail277 278; LINUX-X64-LABEL: test2c:279; LINUX-X64: mov{{l|q}} %fs:280; LINUX-X64: callq __stack_chk_fail281 282; LINUX-KERNEL-X64-LABEL: test2c:283; LINUX-KERNEL-X64: mov{{l|q}} %gs:284; LINUX-KERNEL-X64: callq __stack_chk_fail285 286; DARWIN-X64-LABEL: test2c:287; DARWIN-X64: mov{{l|q}} ___stack_chk_guard288; DARWIN-X64: callq ___stack_chk_fail289 290; MSVC-I386-LABEL: test2c:291; MSVC-I386: movl ___security_cookie,292; MSVC-I386: calll @__security_check_cookie@4293 294; MINGW-X64-LABEL: test2c:295; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard296; MINGW-X64: callq __stack_chk_fail297 298  %a.addr = alloca ptr, align 8299  %b = alloca %struct.foo, align 1300  store ptr %a, ptr %a.addr, align 8301  %0 = load ptr, ptr %a.addr, align 8302  %call = call ptr @strcpy(ptr %b, ptr %0)303  %call3 = call i32 (ptr, ...) @printf(ptr @.str, ptr %b)304  ret void305}306 307; test2d: struct { [16 x i8] }308;          sspreq attribute309; Requires protector.310; Function Attrs: sspreq 311define void @test2d(ptr %a) #2 {312entry:313; LINUX-I386-LABEL: test2d:314; LINUX-I386: mov{{l|q}} %gs:315; LINUX-I386: calll __stack_chk_fail316 317; LINUX-X64-LABEL: test2d:318; LINUX-X64: mov{{l|q}} %fs:319; LINUX-X64: callq __stack_chk_fail320 321; LINUX-KERNEL-X64-LABEL: test2d:322; LINUX-KERNEL-X64: mov{{l|q}} %gs:323; LINUX-KERNEL-X64: callq __stack_chk_fail324 325; DARWIN-X64-LABEL: test2d:326; DARWIN-X64: mov{{l|q}} ___stack_chk_guard327; DARWIN-X64: callq ___stack_chk_fail328 329; MSVC-I386-LABEL: test2d:330; MSVC-I386: movl ___security_cookie,331; MSVC-I386: calll @__security_check_cookie@4332 333; MINGW-X64-LABEL: test2d:334; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard335; MINGW-X64: callq __stack_chk_fail336 337  %a.addr = alloca ptr, align 8338  %b = alloca %struct.foo, align 1339  store ptr %a, ptr %a.addr, align 8340  %0 = load ptr, ptr %a.addr, align 8341  %call = call ptr @strcpy(ptr %b, ptr %0)342  %call3 = call i32 (ptr, ...) @printf(ptr @.str, ptr %b)343  ret void344}345 346; test3a:  array of [4 x i8]347;          no ssp attribute348; Requires no protector.349define void @test3a(ptr %a) {350entry:351; LINUX-I386-LABEL: test3a:352; LINUX-I386-NOT: calll __stack_chk_fail353; LINUX-I386: .cfi_endproc354 355; LINUX-X64-LABEL: test3a:356; LINUX-X64-NOT: callq __stack_chk_fail357; LINUX-X64: .cfi_endproc358 359; LINUX-KERNEL-X64-LABEL: test3a:360; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail361; LINUX-KERNEL-X64: .cfi_endproc362 363; DARWIN-X64-LABEL: test3a:364; DARWIN-X64-NOT: callq ___stack_chk_fail365; DARWIN-X64: .cfi_endproc366 367; MSVC-I386-LABEL: test3a:368; MSVC-I386-NOT: calll @__security_check_cookie@4369; MSVC-I386: retl370 371; MINGW-X64-LABEL: test3a:372; MINGW-X64-NOT: callq __stack_chk_fail373; MINGW-X64: .seh_endproc374 375  %a.addr = alloca ptr, align 8376  %buf = alloca [4 x i8], align 1377  store ptr %a, ptr %a.addr, align 8378  %0 = load ptr, ptr %a.addr, align 8379  %call = call ptr @strcpy(ptr %buf, ptr %0)380  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %buf)381  ret void382}383 384; test3b:  array [4 x i8]385;          ssp attribute386; Requires no protector.387; Function Attrs: ssp388define void @test3b(ptr %a) #0 {389entry:390; LINUX-I386-LABEL: test3b:391; LINUX-I386-NOT: calll __stack_chk_fail392; LINUX-I386: .cfi_endproc393 394; LINUX-X64-LABEL: test3b:395; LINUX-X64-NOT: callq __stack_chk_fail396; LINUX-X64: .cfi_endproc397 398; LINUX-KERNEL-X64-LABEL: test3b:399; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail400; LINUX-KERNEL-X64: .cfi_endproc401 402; DARWIN-X64-LABEL: test3b:403; DARWIN-X64-NOT: callq ___stack_chk_fail404; DARWIN-X64: .cfi_endproc405 406; MSVC-I386-LABEL: test3b:407; MSVC-I386-NOT: calll @__security_check_cookie@4408; MSVC-I386: retl409 410; MINGW-X64-LABEL: test3b:411; MINGW-X64-NOT: callq __stack_chk_fail412; MINGW-X64: .seh_endproc413 414  %a.addr = alloca ptr, align 8415  %buf = alloca [4 x i8], align 1416  store ptr %a, ptr %a.addr, align 8417  %0 = load ptr, ptr %a.addr, align 8418  %call = call ptr @strcpy(ptr %buf, ptr %0)419  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %buf)420  ret void421}422 423; test3c:  array of [4 x i8]424;          sspstrong attribute425; Requires protector.426; Function Attrs: sspstrong 427define void @test3c(ptr %a) #1 {428entry:429; LINUX-I386-LABEL: test3c:430; LINUX-I386: mov{{l|q}} %gs:431; LINUX-I386: calll __stack_chk_fail432 433; LINUX-X64-LABEL: test3c:434; LINUX-X64: mov{{l|q}} %fs:435; LINUX-X64: callq __stack_chk_fail436 437; LINUX-KERNEL-X64-LABEL: test3c:438; LINUX-KERNEL-X64: mov{{l|q}} %gs:439; LINUX-KERNEL-X64: callq __stack_chk_fail440 441; DARWIN-X64-LABEL: test3c:442; DARWIN-X64: mov{{l|q}} ___stack_chk_guard443; DARWIN-X64: callq ___stack_chk_fail444 445; MSVC-I386-LABEL: test3c:446; MSVC-I386: movl ___security_cookie,447; MSVC-I386: calll @__security_check_cookie@4448 449; MINGW-X64-LABEL: test3c:450; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard451; MINGW-X64: callq __stack_chk_fail452 453  %a.addr = alloca ptr, align 8454  %buf = alloca [4 x i8], align 1455  store ptr %a, ptr %a.addr, align 8456  %0 = load ptr, ptr %a.addr, align 8457  %call = call ptr @strcpy(ptr %buf, ptr %0)458  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %buf)459  ret void460}461 462; test3d:  array of [4 x i8]463;          sspreq attribute464; Requires protector.465; Function Attrs: sspreq 466define void @test3d(ptr %a) #2 {467entry:468; LINUX-I386-LABEL: test3d:469; LINUX-I386: mov{{l|q}} %gs:470; LINUX-I386: calll __stack_chk_fail471 472; LINUX-X64-LABEL: test3d:473; LINUX-X64: mov{{l|q}} %fs:474; LINUX-X64: callq __stack_chk_fail475 476; LINUX-KERNEL-X64-LABEL: test3d:477; LINUX-KERNEL-X64: mov{{l|q}} %gs:478; LINUX-KERNEL-X64: callq __stack_chk_fail479 480; DARWIN-X64-LABEL: test3d:481; DARWIN-X64: mov{{l|q}} ___stack_chk_guard482; DARWIN-X64: callq ___stack_chk_fail483 484; MSVC-I386-LABEL: test3d:485; MSVC-I386: movl ___security_cookie,486; MSVC-I386: calll @__security_check_cookie@4487 488; MINGW-X64-LABEL: test3d:489; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard490; MINGW-X64: callq __stack_chk_fail491 492  %a.addr = alloca ptr, align 8493  %buf = alloca [4 x i8], align 1494  store ptr %a, ptr %a.addr, align 8495  %0 = load ptr, ptr %a.addr, align 8496  %call = call ptr @strcpy(ptr %buf, ptr %0)497  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %buf)498  ret void499}500 501; test4a:  struct { [4 x i8] }502;          no ssp attribute503; Requires no protector.504define void @test4a(ptr %a) {505entry:506; LINUX-I386-LABEL: test4a:507; LINUX-I386-NOT: calll __stack_chk_fail508; LINUX-I386: .cfi_endproc509 510; LINUX-X64-LABEL: test4a:511; LINUX-X64-NOT: callq __stack_chk_fail512; LINUX-X64: .cfi_endproc513 514; LINUX-KERNEL-X64-LABEL: test4a:515; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail516; LINUX-KERNEL-X64: .cfi_endproc517 518; DARWIN-X64-LABEL: test4a:519; DARWIN-X64-NOT: callq ___stack_chk_fail520; DARWIN-X64: .cfi_endproc521 522; MSVC-I386-LABEL: test4a:523; MSVC-I386-NOT: calll @__security_check_cookie@4524; MSVC-I386: retl525 526; MINGW-X64-LABEL: test4a:527; MINGW-X64-NOT: callq __stack_chk_fail528; MINGW-X64: .seh_endproc529 530  %a.addr = alloca ptr, align 8531  %b = alloca %struct.foo.0, align 1532  store ptr %a, ptr %a.addr, align 8533  %0 = load ptr, ptr %a.addr, align 8534  %call = call ptr @strcpy(ptr %b, ptr %0)535  %call3 = call i32 (ptr, ...) @printf(ptr @.str, ptr %b)536  ret void537}538 539; test4b:  struct { [4 x i8] }540;          ssp attribute541; Requires no protector.542; Function Attrs: ssp543define void @test4b(ptr %a) #0 {544entry:545; LINUX-I386-LABEL: test4b:546; LINUX-I386-NOT: calll __stack_chk_fail547; LINUX-I386: .cfi_endproc548 549; LINUX-X64-LABEL: test4b:550; LINUX-X64-NOT: callq __stack_chk_fail551; LINUX-X64: .cfi_endproc552 553; LINUX-KERNEL-X64-LABEL: test4b:554; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail555; LINUX-KERNEL-X64: .cfi_endproc556 557; DARWIN-X64-LABEL: test4b:558; DARWIN-X64-NOT: callq ___stack_chk_fail559; DARWIN-X64: .cfi_endproc560 561; MSVC-I386-LABEL: test4b:562; MSVC-I386-NOT: calll @__security_check_cookie@4563; MSVC-I386: retl564 565; MINGW-X64-LABEL: test4b:566; MINGW-X64-NOT: callq __stack_chk_fail567; MINGW-X64: .seh_endproc568 569  %a.addr = alloca ptr, align 8570  %b = alloca %struct.foo.0, align 1571  store ptr %a, ptr %a.addr, align 8572  %0 = load ptr, ptr %a.addr, align 8573  %call = call ptr @strcpy(ptr %b, ptr %0)574  %call3 = call i32 (ptr, ...) @printf(ptr @.str, ptr %b)575  ret void576}577 578; test4c:  struct { [4 x i8] }579;          sspstrong attribute580; Requires protector.581; Function Attrs: sspstrong 582define void @test4c(ptr %a) #1 {583entry:584; LINUX-I386-LABEL: test4c:585; LINUX-I386: mov{{l|q}} %gs:586; LINUX-I386: calll __stack_chk_fail587 588; LINUX-X64-LABEL: test4c:589; LINUX-X64: mov{{l|q}} %fs:590; LINUX-X64: callq __stack_chk_fail591 592; LINUX-KERNEL-X64-LABEL: test4c:593; LINUX-KERNEL-X64: mov{{l|q}} %gs:594; LINUX-KERNEL-X64: callq __stack_chk_fail595 596; DARWIN-X64-LABEL: test4c:597; DARWIN-X64: mov{{l|q}} ___stack_chk_guard598; DARWIN-X64: callq ___stack_chk_fail599 600; MSVC-I386-LABEL: test4c:601; MSVC-I386: movl ___security_cookie,602; MSVC-I386: calll @__security_check_cookie@4603 604; MINGW-X64-LABEL: test4c:605; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard606; MINGW-X64: callq __stack_chk_fail607 608  %a.addr = alloca ptr, align 8609  %b = alloca %struct.foo.0, align 1610  store ptr %a, ptr %a.addr, align 8611  %0 = load ptr, ptr %a.addr, align 8612  %call = call ptr @strcpy(ptr %b, ptr %0)613  %call3 = call i32 (ptr, ...) @printf(ptr @.str, ptr %b)614  ret void615}616 617; test4d:  struct { [4 x i8] }618;          sspreq attribute619; Requires protector.620; Function Attrs: sspreq 621define void @test4d(ptr %a) #2 {622entry:623; LINUX-I386-LABEL: test4d:624; LINUX-I386: mov{{l|q}} %gs:625; LINUX-I386: calll __stack_chk_fail626 627; LINUX-X64-LABEL: test4d:628; LINUX-X64: mov{{l|q}} %fs:629; LINUX-X64: callq __stack_chk_fail630 631; LINUX-KERNEL-X64-LABEL: test4d:632; LINUX-KERNEL-X64: mov{{l|q}} %gs:633; LINUX-KERNEL-X64: callq __stack_chk_fail634 635; DARWIN-X64-LABEL: test4d:636; DARWIN-X64: mov{{l|q}} ___stack_chk_guard637; DARWIN-X64: callq ___stack_chk_fail638 639; MSVC-I386-LABEL: test4d:640; MSVC-I386: movl ___security_cookie,641; MSVC-I386: calll @__security_check_cookie@4642 643; MINGW-X64-LABEL: test4d:644; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard645; MINGW-X64: callq __stack_chk_fail646 647  %a.addr = alloca ptr, align 8648  %b = alloca %struct.foo.0, align 1649  store ptr %a, ptr %a.addr, align 8650  %0 = load ptr, ptr %a.addr, align 8651  %call = call ptr @strcpy(ptr %b, ptr %0)652  %call3 = call i32 (ptr, ...) @printf(ptr @.str, ptr %b)653  ret void654}655 656; test5a:  no arrays / no nested arrays657;          no ssp attribute658; Requires no protector.659define void @test5a(ptr %a) {660entry:661; LINUX-I386-LABEL: test5a:662; LINUX-I386-NOT: calll __stack_chk_fail663; LINUX-I386: .cfi_endproc664 665; LINUX-X64-LABEL: test5a:666; LINUX-X64-NOT: callq __stack_chk_fail667; LINUX-X64: .cfi_endproc668 669; LINUX-KERNEL-X64-LABEL: test5a:670; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail671; LINUX-KERNEL-X64: .cfi_endproc672 673; DARWIN-X64-LABEL: test5a:674; DARWIN-X64-NOT: callq ___stack_chk_fail675; DARWIN-X64: .cfi_endproc676 677; MSVC-I386-LABEL: test5a:678; MSVC-I386-NOT: calll @__security_check_cookie@4679; MSVC-I386: retl680 681; MINGW-X64-LABEL: test5a:682; MINGW-X64-NOT: callq __stack_chk_fail683; MINGW-X64: .seh_endproc684 685  %a.addr = alloca ptr, align 8686  store ptr %a, ptr %a.addr, align 8687  %0 = load ptr, ptr %a.addr, align 8688  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %0)689  ret void690}691 692; test5b:  no arrays / no nested arrays693;          ssp attribute694; Requires no protector.695; Function Attrs: ssp696define void @test5b(ptr %a) #0 {697entry:698; LINUX-I386-LABEL: test5b:699; LINUX-I386-NOT: calll __stack_chk_fail700; LINUX-I386: .cfi_endproc701 702; LINUX-X64-LABEL: test5b:703; LINUX-X64-NOT: callq __stack_chk_fail704; LINUX-X64: .cfi_endproc705 706; LINUX-KERNEL-X64-LABEL: test5b:707; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail708; LINUX-KERNEL-X64: .cfi_endproc709 710; DARWIN-X64-LABEL: test5b:711; DARWIN-X64-NOT: callq ___stack_chk_fail712; DARWIN-X64: .cfi_endproc713 714; MSVC-I386-LABEL: test5b:715; MSVC-I386-NOT: calll @__security_check_cookie@4716; MSVC-I386: retl717 718; MINGW-X64-LABEL: test5b:719; MINGW-X64-NOT: callq __stack_chk_fail720; MINGW-X64: .seh_endproc721 722  %a.addr = alloca ptr, align 8723  store ptr %a, ptr %a.addr, align 8724  %0 = load ptr, ptr %a.addr, align 8725  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %0)726  ret void727}728 729; test5c:  no arrays / no nested arrays730;          sspstrong attribute731; Requires no protector.732; Function Attrs: sspstrong 733define void @test5c(ptr %a) #1 {734entry:735; LINUX-I386-LABEL: test5c:736; LINUX-I386-NOT: calll __stack_chk_fail737; LINUX-I386: .cfi_endproc738 739; LINUX-X64-LABEL: test5c:740; LINUX-X64-NOT: callq __stack_chk_fail741; LINUX-X64: .cfi_endproc742 743; LINUX-KERNEL-X64-LABEL: test5c:744; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail745; LINUX-KERNEL-X64: .cfi_endproc746 747; DARWIN-X64-LABEL: test5c:748; DARWIN-X64-NOT: callq ___stack_chk_fail749; DARWIN-X64: .cfi_endproc750 751; MSVC-I386-LABEL: test5c:752; MSVC-I386-NOT: calll @__security_check_cookie@4753; MSVC-I386: retl754 755; MINGW-X64-LABEL: test5c:756; MINGW-X64-NOT: callq __stack_chk_fail757; MINGW-X64: .seh_endproc758 759  %a.addr = alloca ptr, align 8760  store ptr %a, ptr %a.addr, align 8761  %0 = load ptr, ptr %a.addr, align 8762  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %0)763  ret void764}765 766; test5d:  no arrays / no nested arrays767;          sspreq attribute768; Requires protector.769; Function Attrs: sspreq 770define void @test5d(ptr %a) #2 {771entry:772; LINUX-I386-LABEL: test5d:773; LINUX-I386: mov{{l|q}} %gs:774; LINUX-I386: calll __stack_chk_fail775 776; LINUX-X64-LABEL: test5d:777; LINUX-X64: mov{{l|q}} %fs:778; LINUX-X64: callq __stack_chk_fail779 780; LINUX-KERNEL-X64-LABEL: test5d:781; LINUX-KERNEL-X64: mov{{l|q}} %gs:782; LINUX-KERNEL-X64: callq __stack_chk_fail783 784; DARWIN-X64-LABEL: test5d:785; DARWIN-X64: mov{{l|q}} ___stack_chk_guard786; DARWIN-X64: callq ___stack_chk_fail787 788; MSVC-I386-LABEL: test5d:789; MSVC-I386: movl ___security_cookie,790; MSVC-I386: calll @__security_check_cookie@4791 792; MINGW-X64-LABEL: test5d:793; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard794; MINGW-X64: callq __stack_chk_fail795 796  %a.addr = alloca ptr, align 8797  store ptr %a, ptr %a.addr, align 8798  %0 = load ptr, ptr %a.addr, align 8799  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %0)800  ret void801}802 803; test6a:  Address-of local taken (j = &a)804;          no ssp attribute805; Requires no protector.806define void @test6a() {807entry:808; LINUX-I386-LABEL: test6a:809; LINUX-I386-NOT: calll __stack_chk_fail810; LINUX-I386: .cfi_endproc811 812; LINUX-X64-LABEL: test6a:813; LINUX-X64-NOT: callq __stack_chk_fail814; LINUX-X64: .cfi_endproc815 816; LINUX-KERNEL-X64-LABEL: test6a:817; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail818; LINUX-KERNEL-X64: .cfi_endproc819 820; DARWIN-X64-LABEL: test6a:821; DARWIN-X64-NOT: callq ___stack_chk_fail822; DARWIN-X64: .cfi_endproc823 824; MSVC-I386-LABEL: test6a:825; MSVC-I386-NOT: calll @__security_check_cookie@4826; MSVC-I386: retl827 828; MINGW-X64-LABEL: test6a:829; MINGW-X64-NOT: callq __stack_chk_fail830; MINGW-X64: .seh_endproc831 832  %retval = alloca i32, align 4833  %a = alloca i32, align 4834  %j = alloca ptr, align 8835  store i32 0, ptr %retval836  %0 = load i32, ptr %a, align 4837  %add = add nsw i32 %0, 1838  store i32 %add, ptr %a, align 4839  store ptr %a, ptr %j, align 8840  ret void841}842 843; test6b:  Address-of local taken (j = &a)844;          ssp attribute845; Requires no protector.846; Function Attrs: ssp847define void @test6b() #0 {848entry:849; LINUX-I386-LABEL: test6b:850; LINUX-I386-NOT: calll __stack_chk_fail851; LINUX-I386: .cfi_endproc852 853; LINUX-X64-LABEL: test6b:854; LINUX-X64-NOT: callq __stack_chk_fail855; LINUX-X64: .cfi_endproc856 857; LINUX-KERNEL-X64-LABEL: test6b:858; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail859; LINUX-KERNEL-X64: .cfi_endproc860 861; DARWIN-X64-LABEL: test6b:862; DARWIN-X64-NOT: callq ___stack_chk_fail863; DARWIN-X64: .cfi_endproc864 865; MSVC-I386-LABEL: test6b:866; MSVC-I386-NOT: calll @__security_check_cookie@4867; MSVC-I386: retl868 869; MINGW-X64-LABEL: test6b:870; MINGW-X64-NOT: callq __stack_chk_fail871; MINGW-X64: .seh_endproc872 873  %retval = alloca i32, align 4874  %a = alloca i32, align 4875  %j = alloca ptr, align 8876  store i32 0, ptr %retval877  %0 = load i32, ptr %a, align 4878  %add = add nsw i32 %0, 1879  store i32 %add, ptr %a, align 4880  store ptr %a, ptr %j, align 8881  ret void882}883 884; test6c:  Address-of local taken (j = &a)885;          sspstrong attribute886; Requires protector.887; Function Attrs: sspstrong 888define void @test6c() #1 {889entry:890; LINUX-I386-LABEL: test6c:891; LINUX-I386: mov{{l|q}} %gs:892; LINUX-I386: calll __stack_chk_fail893 894; LINUX-X64-LABEL: test6c:895; LINUX-X64: mov{{l|q}} %fs:896; LINUX-X64: callq __stack_chk_fail897 898; LINUX-KERNEL-X64-LABEL: test6c:899; LINUX-KERNEL-X64: mov{{l|q}} %gs:900; LINUX-KERNEL-X64: callq __stack_chk_fail901 902; DARWIN-X64-LABEL: test6c:903; DARWIN-X64: mov{{l|q}} ___stack_chk_guard904; DARWIN-X64: callq ___stack_chk_fail905 906; MSVC-I386-LABEL: test6c:907; MSVC-I386: movl ___security_cookie,908; MSVC-I386: calll @__security_check_cookie@4909 910; MINGW-X64-LABEL: test6c:911; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard912; MINGW-X64: callq __stack_chk_fail913 914  %retval = alloca i32, align 4915  %a = alloca i32, align 4916  %j = alloca ptr, align 8917  store i32 0, ptr %retval918  %0 = load i32, ptr %a, align 4919  %add = add nsw i32 %0, 1920  store i32 %add, ptr %a, align 4921  store ptr %a, ptr %j, align 8922  ret void923}924 925; test6d:  Address-of local taken (j = &a)926;          sspreq attribute927; Requires protector.928; Function Attrs: sspreq 929define void @test6d() #2 {930entry:931; LINUX-I386-LABEL: test6d:932; LINUX-I386: mov{{l|q}} %gs:933; LINUX-I386: calll __stack_chk_fail934 935; LINUX-X64-LABEL: test6d:936; LINUX-X64: mov{{l|q}} %fs:937; LINUX-X64: callq __stack_chk_fail938 939; LINUX-KERNEL-X64-LABEL: test6d:940; LINUX-KERNEL-X64: mov{{l|q}} %gs:941; LINUX-KERNEL-X64: callq __stack_chk_fail942 943; DARWIN-X64-LABEL: test6d:944; DARWIN-X64: mov{{l|q}} ___stack_chk_guard945; DARWIN-X64: callq ___stack_chk_fail946 947; MSVC-I386-LABEL: test6d:948; MSVC-I386: movl ___security_cookie,949; MSVC-I386: calll @__security_check_cookie@4950 951; MINGW-X64-LABEL: test6d:952; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard953; MINGW-X64: callq __stack_chk_fail954 955  %retval = alloca i32, align 4956  %a = alloca i32, align 4957  %j = alloca ptr, align 8958  store i32 0, ptr %retval959  %0 = load i32, ptr %a, align 4960  %add = add nsw i32 %0, 1961  store i32 %add, ptr %a, align 4962  store ptr %a, ptr %j, align 8963  ret void964}965 966; test7a:  PtrToInt Cast967;          no ssp attribute968; Requires no protector.969define void @test7a()  {970entry:971; LINUX-I386-LABEL: test7a:972; LINUX-I386-NOT: calll __stack_chk_fail973; LINUX-I386: .cfi_endproc974 975; LINUX-X64-LABEL: test7a:976; LINUX-X64-NOT: callq __stack_chk_fail977; LINUX-X64: .cfi_endproc978 979; LINUX-KERNEL-X64-LABEL: test7a:980; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail981; LINUX-KERNEL-X64: .cfi_endproc982 983; DARWIN-X64-LABEL: test7a:984; DARWIN-X64-NOT: callq ___stack_chk_fail985; DARWIN-X64: .cfi_endproc986 987; MSVC-I386-LABEL: test7a:988; MSVC-I386-NOT: calll @__security_check_cookie@4989; MSVC-I386: retl990 991; MINGW-X64-LABEL: test7a:992; MINGW-X64-NOT: callq __stack_chk_fail993; MINGW-X64: .seh_endproc994 995  %a = alloca i32, align 4996  %0 = ptrtoint ptr %a to i64997  %call = call i32 (ptr, ...) @printf(ptr @.str, i64 %0)998  ret void999}1000 1001; test7b:  PtrToInt Cast1002;          ssp attribute1003; Requires no protector.1004; Function Attrs: ssp 1005define void @test7b() #0 {1006entry:1007; LINUX-I386-LABEL: test7b:1008; LINUX-I386-NOT: calll __stack_chk_fail1009; LINUX-I386: .cfi_endproc1010 1011; LINUX-X64-LABEL: test7b:1012; LINUX-X64-NOT: callq __stack_chk_fail1013; LINUX-X64: .cfi_endproc1014 1015; LINUX-KERNEL-X64-LABEL: test7b:1016; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1017; LINUX-KERNEL-X64: .cfi_endproc1018 1019; DARWIN-X64-LABEL: test7b:1020; DARWIN-X64-NOT: callq ___stack_chk_fail1021; DARWIN-X64: .cfi_endproc1022 1023; MSVC-I386-LABEL: test7b:1024; MSVC-I386-NOT: calll @__security_check_cookie@41025; MSVC-I386: retl1026 1027; MINGW-X64-LABEL: test7b:1028; MINGW-X64-NOT: callq __stack_chk_fail1029; MINGW-X64: .seh_endproc1030 1031  %a = alloca i32, align 41032  %0 = ptrtoint ptr %a to i641033  %call = call i32 (ptr, ...) @printf(ptr @.str, i64 %0)1034  ret void1035}1036 1037; test7c:  PtrToInt Cast1038;          sspstrong attribute1039; Requires protector.1040; Function Attrs: sspstrong 1041define void @test7c() #1 {1042entry:1043; LINUX-I386-LABEL: test7c:1044; LINUX-I386: mov{{l|q}} %gs:1045; LINUX-I386: calll __stack_chk_fail1046 1047; LINUX-X64-LABEL: test7c:1048; LINUX-X64: mov{{l|q}} %fs:1049; LINUX-X64: callq __stack_chk_fail1050 1051; LINUX-KERNEL-X64-LABEL: test7c:1052; LINUX-KERNEL-X64: mov{{l|q}} %gs:1053; LINUX-KERNEL-X64: callq __stack_chk_fail1054 1055; DARWIN-X64-LABEL: test7c:1056; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1057; DARWIN-X64: callq ___stack_chk_fail1058 1059; MSVC-I386-LABEL: test7c:1060; MSVC-I386: movl ___security_cookie,1061; MSVC-I386: calll @__security_check_cookie@41062 1063; MINGW-X64-LABEL: test7c:1064; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard1065; MINGW-X64: .seh_endproc1066 1067  %a = alloca i32, align 41068  %0 = ptrtoint ptr %a to i641069  %call = call i32 (ptr, ...) @printf(ptr @.str, i64 %0)1070  ret void1071}1072 1073; test7d:  PtrToInt Cast1074;          sspreq attribute1075; Requires protector.1076; Function Attrs: sspreq 1077define void @test7d() #2 {1078entry:1079; LINUX-I386-LABEL: test7d:1080; LINUX-I386: mov{{l|q}} %gs:1081; LINUX-I386: calll __stack_chk_fail1082 1083; LINUX-X64-LABEL: test7d:1084; LINUX-X64: mov{{l|q}} %fs:1085; LINUX-X64: callq __stack_chk_fail1086 1087; LINUX-KERNEL-X64-LABEL: test7d:1088; LINUX-KERNEL-X64: mov{{l|q}} %gs:1089; LINUX-KERNEL-X64: callq __stack_chk_fail1090 1091; DARWIN-X64-LABEL: test7d:1092; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1093; DARWIN-X64: callq ___stack_chk_fail1094 1095; MSVC-I386-LABEL: test7d:1096; MSVC-I386: movl ___security_cookie,1097; MSVC-I386: calll @__security_check_cookie@41098 1099; MINGW-X64-LABEL: test7d:1100; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard1101; MINGW-X64: callq __stack_chk_fail1102 1103  %a = alloca i32, align 41104  %0 = ptrtoint ptr %a to i641105  %call = call i32 (ptr, ...) @printf(ptr @.str, i64 %0)1106  ret void1107}1108 1109; test8a:  Passing addr-of to function call1110;          no ssp attribute1111; Requires no protector.1112define void @test8a() {1113entry:1114; LINUX-I386-LABEL: test8a:1115; LINUX-I386-NOT: calll __stack_chk_fail1116; LINUX-I386: .cfi_endproc1117 1118; LINUX-X64-LABEL: test8a:1119; LINUX-X64-NOT: callq __stack_chk_fail1120; LINUX-X64: .cfi_endproc1121 1122; LINUX-KERNEL-X64-LABEL: test8a:1123; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1124; LINUX-KERNEL-X64: .cfi_endproc1125 1126; DARWIN-X64-LABEL: test8a:1127; DARWIN-X64-NOT: callq ___stack_chk_fail1128; DARWIN-X64: .cfi_endproc1129 1130; MSVC-I386-LABEL: test8a:1131; MSVC-I386-NOT: calll @__security_check_cookie@41132; MSVC-I386: retl1133 1134; MINGW-X64-LABEL: test8a:1135; MINGW-X64-NOT: callq __stack_chk_fail1136; MINGW-X64: .seh_endproc1137 1138  %b = alloca i32, align 41139  call void @funcall(ptr %b)1140  ret void1141}1142 1143; test8b:  Passing addr-of to function call1144;          ssp attribute1145; Requires no protector.1146; Function Attrs: ssp1147define void @test8b() #0 {1148entry:1149; LINUX-I386-LABEL: test8b:1150; LINUX-I386-NOT: calll __stack_chk_fail1151; LINUX-I386: .cfi_endproc1152 1153; LINUX-X64-LABEL: test8b:1154; LINUX-X64-NOT: callq __stack_chk_fail1155; LINUX-X64: .cfi_endproc1156 1157; LINUX-KERNEL-X64-LABEL: test8b:1158; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1159; LINUX-KERNEL-X64: .cfi_endproc1160 1161; DARWIN-X64-LABEL: test8b:1162; DARWIN-X64-NOT: callq ___stack_chk_fail1163; DARWIN-X64: .cfi_endproc1164 1165; MSVC-I386-LABEL: test8b:1166; MSVC-I386-NOT: calll @__security_check_cookie@41167; MSVC-I386: retl1168 1169; MINGW-X64-LABEL: test8b:1170; MINGW-X64-NOT: callq __stack_chk_fail1171; MINGW-X64: .seh_endproc1172 1173  %b = alloca i32, align 41174  call void @funcall(ptr %b)1175  ret void1176}1177 1178; test8c:  Passing addr-of to function call1179;          sspstrong attribute1180; Requires protector.1181; Function Attrs: sspstrong 1182define void @test8c() #1 {1183entry:1184; LINUX-I386-LABEL: test8c:1185; LINUX-I386: mov{{l|q}} %gs:1186; LINUX-I386: calll __stack_chk_fail1187 1188; LINUX-X64-LABEL: test8c:1189; LINUX-X64: mov{{l|q}} %fs:1190; LINUX-X64: callq __stack_chk_fail1191 1192; LINUX-KERNEL-X64-LABEL: test8c:1193; LINUX-KERNEL-X64: mov{{l|q}} %gs:1194; LINUX-KERNEL-X64: callq __stack_chk_fail1195 1196; DARWIN-X64-LABEL: test8c:1197; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1198; DARWIN-X64: callq ___stack_chk_fail1199 1200; MSVC-I386-LABEL: test8c:1201; MSVC-I386: movl ___security_cookie,1202; MSVC-I386: calll @__security_check_cookie@41203 1204; MINGW-X64-LABEL: test8c:1205; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard1206; MINGW-X64: callq __stack_chk_fail1207 1208  %b = alloca i32, align 41209  call void @funcall(ptr %b)1210  ret void1211}1212 1213; test8d:  Passing addr-of to function call1214;          sspreq attribute1215; Requires protector.1216; Function Attrs: sspreq 1217define void @test8d() #2 {1218entry:1219; LINUX-I386-LABEL: test8d:1220; LINUX-I386: mov{{l|q}} %gs:1221; LINUX-I386: calll __stack_chk_fail1222 1223; LINUX-X64-LABEL: test8d:1224; LINUX-X64: mov{{l|q}} %fs:1225; LINUX-X64: callq __stack_chk_fail1226 1227; LINUX-KERNEL-X64-LABEL: test8d:1228; LINUX-KERNEL-X64: mov{{l|q}} %gs:1229; LINUX-KERNEL-X64: callq __stack_chk_fail1230 1231; DARWIN-X64-LABEL: test8d:1232; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1233; DARWIN-X64: callq ___stack_chk_fail1234 1235; MSVC-I386-LABEL: test8d:1236; MSVC-I386: movl ___security_cookie,1237; MSVC-I386: calll @__security_check_cookie@41238 1239; MINGW-X64-LABEL: test8d:1240; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard1241; MINGW-X64: callq __stack_chk_fail1242 1243  %b = alloca i32, align 41244  call void @funcall(ptr %b)1245  ret void1246}1247 1248; test9a:  Addr-of in select instruction1249;          no ssp attribute1250; Requires no protector.1251define void @test9a() {1252entry:1253; LINUX-I386-LABEL: test9a:1254; LINUX-I386-NOT: calll __stack_chk_fail1255; LINUX-I386: .cfi_endproc1256 1257; LINUX-X64-LABEL: test9a:1258; LINUX-X64-NOT: callq __stack_chk_fail1259; LINUX-X64: .cfi_endproc1260 1261; LINUX-KERNEL-X64-LABEL: test9a:1262; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1263; LINUX-KERNEL-X64: .cfi_endproc1264 1265; DARWIN-X64-LABEL: test9a:1266; DARWIN-X64-NOT: callq ___stack_chk_fail1267; DARWIN-X64: .cfi_endproc1268 1269; MSVC-I386-LABEL: test9a:1270; MSVC-I386-NOT: calll @__security_check_cookie@41271; MSVC-I386: retl1272  %x = alloca double, align 81273  %call = call double @testi_aux()1274  store double %call, ptr %x, align 81275  %cmp2 = fcmp ogt double %call, 0.000000e+001276  %y.1 = select i1 %cmp2, ptr %x, ptr null1277  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %y.1)1278  ret void1279}1280 1281; test9b:  Addr-of in select instruction1282;          ssp attribute1283; Requires no protector.1284; Function Attrs: ssp1285define void @test9b() #0 {1286entry:1287; LINUX-I386-LABEL: test9b:1288; LINUX-I386-NOT: calll __stack_chk_fail1289; LINUX-I386: .cfi_endproc1290 1291; LINUX-X64-LABEL: test9b:1292; LINUX-X64-NOT: callq __stack_chk_fail1293; LINUX-X64: .cfi_endproc1294 1295; LINUX-KERNEL-X64-LABEL: test9b:1296; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1297; LINUX-KERNEL-X64: .cfi_endproc1298 1299; DARWIN-X64-LABEL: test9b:1300; DARWIN-X64-NOT: callq ___stack_chk_fail1301; DARWIN-X64: .cfi_endproc1302 1303; MSVC-I386-LABEL: test9b:1304; MSVC-I386-NOT: calll @__security_check_cookie@41305; MSVC-I386: retl1306  %x = alloca double, align 81307  %call = call double @testi_aux()1308  store double %call, ptr %x, align 81309  %cmp2 = fcmp ogt double %call, 0.000000e+001310  %y.1 = select i1 %cmp2, ptr %x, ptr null1311  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %y.1)1312  ret void1313}1314 1315; test9c:  Addr-of in select instruction1316;          sspstrong attribute1317; Requires protector.1318; Function Attrs: sspstrong 1319define void @test9c() #1 {1320entry:1321; LINUX-I386-LABEL: test9c:1322; LINUX-I386: mov{{l|q}} %gs:1323; LINUX-I386: calll __stack_chk_fail1324 1325; LINUX-X64-LABEL: test9c:1326; LINUX-X64: mov{{l|q}} %fs:1327; LINUX-X64: callq __stack_chk_fail1328 1329; LINUX-KERNEL-X64-LABEL: test9c:1330; LINUX-KERNEL-X64: mov{{l|q}} %gs:1331; LINUX-KERNEL-X64: callq __stack_chk_fail1332 1333; DARWIN-X64-LABEL: test9c:1334; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1335; DARWIN-X64: callq ___stack_chk_fail1336 1337; MSVC-I386-LABEL: test9c:1338; MSVC-I386: movl ___security_cookie,1339; MSVC-I386: calll @__security_check_cookie@41340  %x = alloca double, align 81341  %call = call double @testi_aux()1342  store double %call, ptr %x, align 81343  %cmp2 = fcmp ogt double %call, 0.000000e+001344  %y.1 = select i1 %cmp2, ptr %x, ptr null1345  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %y.1)1346  ret void1347}1348 1349; test9d:  Addr-of in select instruction1350;          sspreq attribute1351; Requires protector.1352; Function Attrs: sspreq 1353define void @test9d() #2 {1354entry:1355; LINUX-I386-LABEL: test9d:1356; LINUX-I386: mov{{l|q}} %gs:1357; LINUX-I386: calll __stack_chk_fail1358 1359; LINUX-X64-LABEL: test9d:1360; LINUX-X64: mov{{l|q}} %fs:1361; LINUX-X64: callq __stack_chk_fail1362 1363; LINUX-KERNEL-X64-LABEL: test9d:1364; LINUX-KERNEL-X64: mov{{l|q}} %gs:1365; LINUX-KERNEL-X64: callq __stack_chk_fail1366 1367; DARWIN-X64-LABEL: test9d:1368; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1369; DARWIN-X64: callq ___stack_chk_fail1370 1371; MSVC-I386-LABEL: test9d:1372; MSVC-I386: movl ___security_cookie,1373; MSVC-I386: calll @__security_check_cookie@41374  %x = alloca double, align 81375  %call = call double @testi_aux()1376  store double %call, ptr %x, align 81377  %cmp2 = fcmp ogt double %call, 0.000000e+001378  %y.1 = select i1 %cmp2, ptr %x, ptr null1379  %call2 = call i32 (ptr, ...) @printf(ptr @.str, ptr %y.1)1380  ret void1381}1382 1383; test10a: Addr-of in phi instruction1384;          no ssp attribute1385; Requires no protector.1386define void @test10a() {1387entry:1388; LINUX-I386-LABEL: test10a:1389; LINUX-I386-NOT: calll __stack_chk_fail1390; LINUX-I386: .cfi_endproc1391 1392; LINUX-X64-LABEL: test10a:1393; LINUX-X64-NOT: callq __stack_chk_fail1394; LINUX-X64: .cfi_endproc1395 1396; LINUX-KERNEL-X64-LABEL: test10a:1397; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1398; LINUX-KERNEL-X64: .cfi_endproc1399 1400; DARWIN-X64-LABEL: test10a:1401; DARWIN-X64-NOT: callq ___stack_chk_fail1402; DARWIN-X64: .cfi_endproc1403 1404; MSVC-I386-LABEL: test10a:1405; MSVC-I386-NOT: calll @__security_check_cookie@41406; MSVC-I386: retl1407  %x = alloca double, align 81408  %call = call double @testi_aux()1409  store double %call, ptr %x, align 81410  %cmp = fcmp ogt double %call, 3.140000e+001411  br i1 %cmp, label %if.then, label %if.else1412 1413if.then:                                          ; preds = %entry1414  %call1 = call double @testi_aux()1415  store double %call1, ptr %x, align 81416  br label %if.end41417 1418if.else:                                          ; preds = %entry1419  %cmp2 = fcmp ogt double %call, 1.000000e+001420  br i1 %cmp2, label %if.then3, label %if.end41421 1422if.then3:                                         ; preds = %if.else1423  br label %if.end41424 1425if.end4:                                          ; preds = %if.else, %if.then3, %if.then1426  %y.0 = phi ptr [ null, %if.then ], [ %x, %if.then3 ], [ null, %if.else ]1427  %call5 = call i32 (ptr, ...) @printf(ptr @.str, ptr %y.0)1428  ret void1429}1430 1431; test10b: Addr-of in phi instruction1432;          ssp attribute1433; Requires no protector.1434; Function Attrs: ssp1435define void @test10b() #0 {1436entry:1437; LINUX-I386-LABEL: test10b:1438; LINUX-I386-NOT: calll __stack_chk_fail1439; LINUX-I386: .cfi_endproc1440 1441; LINUX-X64-LABEL: test10b:1442; LINUX-X64-NOT: callq __stack_chk_fail1443; LINUX-X64: .cfi_endproc1444 1445; LINUX-KERNEL-X64-LABEL: test10b:1446; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1447; LINUX-KERNEL-X64: .cfi_endproc1448 1449; DARWIN-X64-LABEL: test10b:1450; DARWIN-X64-NOT: callq ___stack_chk_fail1451; DARWIN-X64: .cfi_endproc1452 1453; MSVC-I386-LABEL: test10b:1454; MSVC-I386-NOT: calll @__security_check_cookie@41455; MSVC-I386: retl1456  %x = alloca double, align 81457  %call = call double @testi_aux()1458  store double %call, ptr %x, align 81459  %cmp = fcmp ogt double %call, 3.140000e+001460  br i1 %cmp, label %if.then, label %if.else1461 1462if.then:                                          ; preds = %entry1463  %call1 = call double @testi_aux()1464  store double %call1, ptr %x, align 81465  br label %if.end41466 1467if.else:                                          ; preds = %entry1468  %cmp2 = fcmp ogt double %call, 1.000000e+001469  br i1 %cmp2, label %if.then3, label %if.end41470 1471if.then3:                                         ; preds = %if.else1472  br label %if.end41473 1474if.end4:                                          ; preds = %if.else, %if.then3, %if.then1475  %y.0 = phi ptr [ null, %if.then ], [ %x, %if.then3 ], [ null, %if.else ]1476  %call5 = call i32 (ptr, ...) @printf(ptr @.str, ptr %y.0)1477  ret void1478}1479 1480; test10c: Addr-of in phi instruction1481;          sspstrong attribute1482; Requires protector.1483; Function Attrs: sspstrong 1484define void @test10c() #1 {1485entry:1486; LINUX-I386-LABEL: test10c:1487; LINUX-I386: mov{{l|q}} %gs:1488; LINUX-I386: calll __stack_chk_fail1489 1490; LINUX-X64-LABEL: test10c:1491; LINUX-X64: mov{{l|q}} %fs:1492; LINUX-X64: callq __stack_chk_fail1493 1494; LINUX-KERNEL-X64-LABEL: test10c:1495; LINUX-KERNEL-X64: mov{{l|q}} %gs:1496; LINUX-KERNEL-X64: callq __stack_chk_fail1497 1498; DARWIN-X64-LABEL: test10c:1499; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1500; DARWIN-X64: callq ___stack_chk_fail1501 1502; MSVC-I386-LABEL: test10c:1503; MSVC-I386: movl ___security_cookie,1504; MSVC-I386: calll @__security_check_cookie@41505  %x = alloca double, align 81506  %call = call double @testi_aux()1507  store double %call, ptr %x, align 81508  %cmp = fcmp ogt double %call, 3.140000e+001509  br i1 %cmp, label %if.then, label %if.else1510 1511if.then:                                          ; preds = %entry1512  %call1 = call double @testi_aux()1513  store double %call1, ptr %x, align 81514  br label %if.end41515 1516if.else:                                          ; preds = %entry1517  %cmp2 = fcmp ogt double %call, 1.000000e+001518  br i1 %cmp2, label %if.then3, label %if.end41519 1520if.then3:                                         ; preds = %if.else1521  br label %if.end41522 1523if.end4:                                          ; preds = %if.else, %if.then3, %if.then1524  %y.0 = phi ptr [ null, %if.then ], [ %x, %if.then3 ], [ null, %if.else ]1525  %call5 = call i32 (ptr, ...) @printf(ptr @.str, ptr %y.0)1526  ret void1527}1528 1529; test10d: Addr-of in phi instruction1530;          sspreq attribute1531; Requires protector.1532; Function Attrs: sspreq 1533define void @test10d() #2 {1534entry:1535; LINUX-I386-LABEL: test10d:1536; LINUX-I386: mov{{l|q}} %gs:1537; LINUX-I386: calll __stack_chk_fail1538 1539; LINUX-X64-LABEL: test10d:1540; LINUX-X64: mov{{l|q}} %fs:1541; LINUX-X64: callq __stack_chk_fail1542 1543; LINUX-KERNEL-X64-LABEL: test10d:1544; LINUX-KERNEL-X64: mov{{l|q}} %gs:1545; LINUX-KERNEL-X64: callq __stack_chk_fail1546 1547; DARWIN-X64-LABEL: test10d:1548; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1549; DARWIN-X64: callq ___stack_chk_fail1550 1551; MSVC-I386-LABEL: test10d:1552; MSVC-I386: movl ___security_cookie,1553; MSVC-I386: calll @__security_check_cookie@41554  %x = alloca double, align 81555  %call = call double @testi_aux()1556  store double %call, ptr %x, align 81557  %cmp = fcmp ogt double %call, 3.140000e+001558  br i1 %cmp, label %if.then, label %if.else1559 1560if.then:                                          ; preds = %entry1561  %call1 = call double @testi_aux()1562  store double %call1, ptr %x, align 81563  br label %if.end41564 1565if.else:                                          ; preds = %entry1566  %cmp2 = fcmp ogt double %call, 1.000000e+001567  br i1 %cmp2, label %if.then3, label %if.end41568 1569if.then3:                                         ; preds = %if.else1570  br label %if.end41571 1572if.end4:                                          ; preds = %if.else, %if.then3, %if.then1573  %y.0 = phi ptr [ null, %if.then ], [ %x, %if.then3 ], [ null, %if.else ]1574  %call5 = call i32 (ptr, ...) @printf(ptr @.str, ptr %y.0)1575  ret void1576}1577 1578; test11a: Addr-of struct element. (GEP followed by store).1579;          no ssp attribute1580; Requires no protector.1581define void @test11a() {1582entry:1583; LINUX-I386-LABEL: test11a:1584; LINUX-I386-NOT: calll __stack_chk_fail1585; LINUX-I386: .cfi_endproc1586 1587; LINUX-X64-LABEL: test11a:1588; LINUX-X64-NOT: callq __stack_chk_fail1589; LINUX-X64: .cfi_endproc1590 1591; LINUX-KERNEL-X64-LABEL: test11a:1592; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1593; LINUX-KERNEL-X64: .cfi_endproc1594 1595; DARWIN-X64-LABEL: test11a:1596; DARWIN-X64-NOT: callq ___stack_chk_fail1597; DARWIN-X64: .cfi_endproc1598 1599; MSVC-I386-LABEL: test11a:1600; MSVC-I386-NOT: calll @__security_check_cookie@41601; MSVC-I386: retl1602  %c = alloca %struct.pair, align 41603  %b = alloca ptr, align 81604  %y = getelementptr inbounds %struct.pair, ptr %c, i32 0, i32 11605  store ptr %y, ptr %b, align 81606  %0 = load ptr, ptr %b, align 81607  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %0)1608  ret void1609}1610 1611; test11b: Addr-of struct element. (GEP followed by store).1612;          ssp attribute1613; Requires no protector.1614; Function Attrs: ssp1615define void @test11b() #0 {1616entry:1617; LINUX-I386-LABEL: test11b:1618; LINUX-I386-NOT: calll __stack_chk_fail1619; LINUX-I386: .cfi_endproc1620 1621; LINUX-X64-LABEL: test11b:1622; LINUX-X64-NOT: callq __stack_chk_fail1623; LINUX-X64: .cfi_endproc1624 1625; LINUX-KERNEL-X64-LABEL: test11b:1626; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1627; LINUX-KERNEL-X64: .cfi_endproc1628 1629; DARWIN-X64-LABEL: test11b:1630; DARWIN-X64-NOT: callq ___stack_chk_fail1631; DARWIN-X64: .cfi_endproc1632 1633; MSVC-I386-LABEL: test11b:1634; MSVC-I386-NOT: calll @__security_check_cookie@41635; MSVC-I386: retl1636  %c = alloca %struct.pair, align 41637  %b = alloca ptr, align 81638  %y = getelementptr inbounds %struct.pair, ptr %c, i32 0, i32 11639  store ptr %y, ptr %b, align 81640  %0 = load ptr, ptr %b, align 81641  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %0)1642  ret void1643}1644 1645; test11c: Addr-of struct element. (GEP followed by store).1646;          sspstrong attribute1647; Requires protector.1648; Function Attrs: sspstrong 1649define void @test11c() #1 {1650entry:1651; LINUX-I386-LABEL: test11c:1652; LINUX-I386: mov{{l|q}} %gs:1653; LINUX-I386: calll __stack_chk_fail1654 1655; LINUX-X64-LABEL: test11c:1656; LINUX-X64: mov{{l|q}} %fs:1657; LINUX-X64: callq __stack_chk_fail1658 1659; LINUX-KERNEL-X64-LABEL: test11c:1660; LINUX-KERNEL-X64: mov{{l|q}} %gs:1661; LINUX-KERNEL-X64: callq __stack_chk_fail1662 1663; DARWIN-X64-LABEL: test11c:1664; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1665; DARWIN-X64: callq ___stack_chk_fail1666 1667; MSVC-I386-LABEL: test11c:1668; MSVC-I386: movl ___security_cookie,1669; MSVC-I386: calll @__security_check_cookie@41670  %c = alloca %struct.pair, align 41671  %b = alloca ptr, align 81672  %y = getelementptr inbounds %struct.pair, ptr %c, i32 0, i32 11673  store ptr %y, ptr %b, align 81674  %0 = load ptr, ptr %b, align 81675  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %0)1676  ret void1677}1678 1679; test11d: Addr-of struct element. (GEP followed by store).1680;          sspreq attribute1681; Requires protector.1682; Function Attrs: sspreq 1683define void @test11d() #2 {1684entry:1685; LINUX-I386-LABEL: test11d:1686; LINUX-I386: mov{{l|q}} %gs:1687; LINUX-I386: calll __stack_chk_fail1688 1689; LINUX-X64-LABEL: test11d:1690; LINUX-X64: mov{{l|q}} %fs:1691; LINUX-X64: callq __stack_chk_fail1692 1693; LINUX-KERNEL-X64-LABEL: test11d:1694; LINUX-KERNEL-X64: mov{{l|q}} %gs:1695; LINUX-KERNEL-X64: callq __stack_chk_fail1696 1697; DARWIN-X64-LABEL: test11d:1698; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1699; DARWIN-X64: callq ___stack_chk_fail1700 1701; MSVC-I386-LABEL: test11d:1702; MSVC-I386: movl ___security_cookie,1703; MSVC-I386: calll @__security_check_cookie@41704  %c = alloca %struct.pair, align 41705  %b = alloca ptr, align 81706  %y = getelementptr inbounds %struct.pair, ptr %c, i32 0, i32 11707  store ptr %y, ptr %b, align 81708  %0 = load ptr, ptr %b, align 81709  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %0)1710  ret void1711}1712 1713; test12a: Addr-of struct element, GEP followed by ptrtoint.1714;          no ssp attribute1715; Requires no protector.1716define void @test12a() {1717entry:1718; LINUX-I386-LABEL: test12a:1719; LINUX-I386-NOT: calll __stack_chk_fail1720; LINUX-I386: .cfi_endproc1721 1722; LINUX-X64-LABEL: test12a:1723; LINUX-X64-NOT: callq __stack_chk_fail1724; LINUX-X64: .cfi_endproc1725 1726; LINUX-KERNEL-X64-LABEL: test12a:1727; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1728; LINUX-KERNEL-X64: .cfi_endproc1729 1730; DARWIN-X64-LABEL: test12a:1731; DARWIN-X64-NOT: callq ___stack_chk_fail1732; DARWIN-X64: .cfi_endproc1733 1734; MSVC-I386-LABEL: test12a:1735; MSVC-I386-NOT: calll @__security_check_cookie@41736; MSVC-I386: retl1737  %c = alloca %struct.pair, align 41738  %b = alloca ptr, align 81739  %y = getelementptr inbounds %struct.pair, ptr %c, i32 0, i32 11740  %0 = ptrtoint ptr %y to i641741  %call = call i32 (ptr, ...) @printf(ptr @.str, i64 %0)1742  ret void1743}1744 1745; test12b: Addr-of struct element, GEP followed by ptrtoint.1746;          ssp attribute1747; Requires no protector.1748; Function Attrs: ssp1749define void @test12b() #0 {1750entry:1751; LINUX-I386-LABEL: test12b:1752; LINUX-I386-NOT: calll __stack_chk_fail1753; LINUX-I386: .cfi_endproc1754 1755; LINUX-X64-LABEL: test12b:1756; LINUX-X64-NOT: callq __stack_chk_fail1757; LINUX-X64: .cfi_endproc1758 1759; LINUX-KERNEL-X64-LABEL: test12b:1760; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1761; LINUX-KERNEL-X64: .cfi_endproc1762 1763; DARWIN-X64-LABEL: test12b:1764; DARWIN-X64-NOT: callq ___stack_chk_fail1765; DARWIN-X64: .cfi_endproc1766 1767; MSVC-I386-LABEL: test12b:1768; MSVC-I386-NOT: calll @__security_check_cookie@41769; MSVC-I386: retl1770  %c = alloca %struct.pair, align 41771  %b = alloca ptr, align 81772  %y = getelementptr inbounds %struct.pair, ptr %c, i32 0, i32 11773  %0 = ptrtoint ptr %y to i641774  %call = call i32 (ptr, ...) @printf(ptr @.str, i64 %0)1775  ret void1776}1777 1778; test12c: Addr-of struct element, GEP followed by ptrtoint.1779;          sspstrong attribute1780; Function Attrs: sspstrong 1781define void @test12c() #1 {1782entry:1783; LINUX-I386-LABEL: test12c:1784; LINUX-I386: mov{{l|q}} %gs:1785; LINUX-I386: calll __stack_chk_fail1786 1787; LINUX-X64-LABEL: test12c:1788; LINUX-X64: mov{{l|q}} %fs:1789; LINUX-X64: callq __stack_chk_fail1790 1791; LINUX-KERNEL-X64-LABEL: test12c:1792; LINUX-KERNEL-X64: mov{{l|q}} %gs:1793; LINUX-KERNEL-X64: callq __stack_chk_fail1794 1795; DARWIN-X64-LABEL: test12c:1796; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1797; DARWIN-X64: callq ___stack_chk_fail1798 1799; MSVC-I386-LABEL: test12c:1800; MSVC-I386: movl ___security_cookie,1801; MSVC-I386: calll @__security_check_cookie@41802  %c = alloca %struct.pair, align 41803  %b = alloca ptr, align 81804  %y = getelementptr inbounds %struct.pair, ptr %c, i32 0, i32 11805  %0 = ptrtoint ptr %y to i641806  %call = call i32 (ptr, ...) @printf(ptr @.str, i64 %0)1807  ret void1808}1809 1810; test12d: Addr-of struct element, GEP followed by ptrtoint.1811;          sspreq attribute1812; Requires protector.1813; Function Attrs: sspreq 1814define void @test12d() #2 {1815entry:1816; LINUX-I386-LABEL: test12d:1817; LINUX-I386: mov{{l|q}} %gs:1818; LINUX-I386: calll __stack_chk_fail1819 1820; LINUX-X64-LABEL: test12d:1821; LINUX-X64: mov{{l|q}} %fs:1822; LINUX-X64: callq __stack_chk_fail1823 1824; LINUX-KERNEL-X64-LABEL: test12d:1825; LINUX-KERNEL-X64: mov{{l|q}} %gs:1826; LINUX-KERNEL-X64: callq __stack_chk_fail1827 1828; DARWIN-X64-LABEL: test12d:1829; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1830; DARWIN-X64: callq ___stack_chk_fail1831 1832; MSVC-I386-LABEL: test12d:1833; MSVC-I386: movl ___security_cookie,1834; MSVC-I386: calll @__security_check_cookie@41835  %c = alloca %struct.pair, align 41836  %b = alloca ptr, align 81837  %y = getelementptr inbounds %struct.pair, ptr %c, i32 0, i32 11838  %0 = ptrtoint ptr %y to i641839  %call = call i32 (ptr, ...) @printf(ptr @.str, i64 %0)1840  ret void1841}1842 1843; test13a: Addr-of struct element, GEP followed by callinst.1844;          no ssp attribute1845; Requires no protector.1846define void @test13a() {1847entry:1848; LINUX-I386-LABEL: test13a:1849; LINUX-I386-NOT: calll __stack_chk_fail1850; LINUX-I386: .cfi_endproc1851 1852; LINUX-X64-LABEL: test13a:1853; LINUX-X64-NOT: callq __stack_chk_fail1854; LINUX-X64: .cfi_endproc1855 1856; LINUX-KERNEL-X64-LABEL: test13a:1857; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1858; LINUX-KERNEL-X64: .cfi_endproc1859 1860; DARWIN-X64-LABEL: test13a:1861; DARWIN-X64-NOT: callq ___stack_chk_fail1862; DARWIN-X64: .cfi_endproc1863 1864; MSVC-I386-LABEL: test13a:1865; MSVC-I386-NOT: calll @__security_check_cookie@41866; MSVC-I386: retl1867  %c = alloca %struct.pair, align 41868  %y = getelementptr inbounds %struct.pair, ptr %c, i64 0, i32 11869  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %y)1870  ret void1871}1872 1873; test13b: Addr-of struct element, GEP followed by callinst.1874;          ssp attribute1875; Requires no protector.1876; Function Attrs: ssp1877define void @test13b() #0 {1878entry:1879; LINUX-I386-LABEL: test13b:1880; LINUX-I386-NOT: calll __stack_chk_fail1881; LINUX-I386: .cfi_endproc1882 1883; LINUX-X64-LABEL: test13b:1884; LINUX-X64-NOT: callq __stack_chk_fail1885; LINUX-X64: .cfi_endproc1886 1887; LINUX-KERNEL-X64-LABEL: test13b:1888; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1889; LINUX-KERNEL-X64: .cfi_endproc1890 1891; DARWIN-X64-LABEL: test13b:1892; DARWIN-X64-NOT: callq ___stack_chk_fail1893; DARWIN-X64: .cfi_endproc1894 1895; MSVC-I386-LABEL: test13b:1896; MSVC-I386-NOT: calll @__security_check_cookie@41897; MSVC-I386: retl1898  %c = alloca %struct.pair, align 41899  %y = getelementptr inbounds %struct.pair, ptr %c, i64 0, i32 11900  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %y)1901  ret void1902}1903 1904; test13c: Addr-of struct element, GEP followed by callinst.1905;          sspstrong attribute1906; Requires protector.1907; Function Attrs: sspstrong 1908define void @test13c() #1 {1909entry:1910; LINUX-I386-LABEL: test13c:1911; LINUX-I386: mov{{l|q}} %gs:1912; LINUX-I386: calll __stack_chk_fail1913 1914; LINUX-X64-LABEL: test13c:1915; LINUX-X64: mov{{l|q}} %fs:1916; LINUX-X64: callq __stack_chk_fail1917 1918; LINUX-KERNEL-X64-LABEL: test13c:1919; LINUX-KERNEL-X64: mov{{l|q}} %gs:1920; LINUX-KERNEL-X64: callq __stack_chk_fail1921 1922; DARWIN-X64-LABEL: test13c:1923; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1924; DARWIN-X64: callq ___stack_chk_fail1925 1926; MSVC-I386-LABEL: test13c:1927; MSVC-I386: movl ___security_cookie,1928; MSVC-I386: calll @__security_check_cookie@41929  %c = alloca %struct.pair, align 41930  %y = getelementptr inbounds %struct.pair, ptr %c, i64 0, i32 11931  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %y)1932  ret void1933}1934 1935; test13d: Addr-of struct element, GEP followed by callinst.1936;          sspreq attribute1937; Requires protector.1938; Function Attrs: sspreq 1939define void @test13d() #2 {1940entry:1941; LINUX-I386-LABEL: test13d:1942; LINUX-I386: mov{{l|q}} %gs:1943; LINUX-I386: calll __stack_chk_fail1944 1945; LINUX-X64-LABEL: test13d:1946; LINUX-X64: mov{{l|q}} %fs:1947; LINUX-X64: callq __stack_chk_fail1948 1949; LINUX-KERNEL-X64-LABEL: test13d:1950; LINUX-KERNEL-X64: mov{{l|q}} %gs:1951; LINUX-KERNEL-X64: callq __stack_chk_fail1952 1953; DARWIN-X64-LABEL: test13d:1954; DARWIN-X64: mov{{l|q}} ___stack_chk_guard1955; DARWIN-X64: callq ___stack_chk_fail1956 1957; MSVC-I386-LABEL: test13d:1958; MSVC-I386: movl ___security_cookie,1959; MSVC-I386: calll @__security_check_cookie@41960  %c = alloca %struct.pair, align 41961  %y = getelementptr inbounds %struct.pair, ptr %c, i64 0, i32 11962  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %y)1963  ret void1964}1965 1966; test14a: Addr-of a local, optimized into a GEP (e.g., &a - 12)1967;          no ssp attribute1968; Requires no protector.1969define void @test14a() {1970entry:1971; LINUX-I386-LABEL: test14a:1972; LINUX-I386-NOT: calll __stack_chk_fail1973; LINUX-I386: .cfi_endproc1974 1975; LINUX-X64-LABEL: test14a:1976; LINUX-X64-NOT: callq __stack_chk_fail1977; LINUX-X64: .cfi_endproc1978 1979; LINUX-KERNEL-X64-LABEL: test14a:1980; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail1981; LINUX-KERNEL-X64: .cfi_endproc1982 1983; DARWIN-X64-LABEL: test14a:1984; DARWIN-X64-NOT: callq ___stack_chk_fail1985; DARWIN-X64: .cfi_endproc1986 1987; MSVC-I386-LABEL: test14a:1988; MSVC-I386-NOT: calll @__security_check_cookie@41989; MSVC-I386: retl1990  %a = alloca i32, align 41991  %add.ptr5 = getelementptr inbounds i32, ptr %a, i64 -121992  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %add.ptr5)1993  ret void1994}1995 1996; test14b: Addr-of a local, optimized into a GEP (e.g., &a - 12)1997;          ssp attribute1998; Requires no protector.1999; Function Attrs: ssp2000define void @test14b() #0 {2001entry:2002; LINUX-I386-LABEL: test14b:2003; LINUX-I386-NOT: calll __stack_chk_fail2004; LINUX-I386: .cfi_endproc2005 2006; LINUX-X64-LABEL: test14b:2007; LINUX-X64-NOT: callq __stack_chk_fail2008; LINUX-X64: .cfi_endproc2009 2010; LINUX-KERNEL-X64-LABEL: test14b:2011; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2012; LINUX-KERNEL-X64: .cfi_endproc2013 2014; DARWIN-X64-LABEL: test14b:2015; DARWIN-X64-NOT: callq ___stack_chk_fail2016; DARWIN-X64: .cfi_endproc2017 2018; MSVC-I386-LABEL: test14b:2019; MSVC-I386-NOT: calll @__security_check_cookie@42020; MSVC-I386: retl2021  %a = alloca i32, align 42022  %add.ptr5 = getelementptr inbounds i32, ptr %a, i64 -122023  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %add.ptr5)2024  ret void2025}2026 2027; test14c: Addr-of a local, optimized into a GEP (e.g., &a - 12)2028;          sspstrong attribute2029; Requires protector.2030; Function Attrs: sspstrong 2031define void @test14c() #1 {2032entry:2033; LINUX-I386-LABEL: test14c:2034; LINUX-I386: mov{{l|q}} %gs:2035; LINUX-I386: calll __stack_chk_fail2036 2037; LINUX-X64-LABEL: test14c:2038; LINUX-X64: mov{{l|q}} %fs:2039; LINUX-X64: callq __stack_chk_fail2040 2041; LINUX-KERNEL-X64-LABEL: test14c:2042; LINUX-KERNEL-X64: mov{{l|q}} %gs:2043; LINUX-KERNEL-X64: callq __stack_chk_fail2044 2045; DARWIN-X64-LABEL: test14c:2046; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2047; DARWIN-X64: callq ___stack_chk_fail2048 2049; MSVC-I386-LABEL: test14c:2050; MSVC-I386: movl ___security_cookie,2051; MSVC-I386: calll @__security_check_cookie@42052  %a = alloca i32, align 42053  %add.ptr5 = getelementptr inbounds i32, ptr %a, i64 -122054  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %add.ptr5)2055  ret void2056}2057 2058; test14d: Addr-of a local, optimized into a GEP (e.g., &a - 12)2059;          sspreq  attribute2060; Requires protector.2061; Function Attrs: sspreq 2062define void @test14d() #2 {2063entry:2064; LINUX-I386-LABEL: test14d:2065; LINUX-I386: mov{{l|q}} %gs:2066; LINUX-I386: calll __stack_chk_fail2067 2068; LINUX-X64-LABEL: test14d:2069; LINUX-X64: mov{{l|q}} %fs:2070; LINUX-X64: callq __stack_chk_fail2071 2072; LINUX-KERNEL-X64-LABEL: test14d:2073; LINUX-KERNEL-X64: mov{{l|q}} %gs:2074; LINUX-KERNEL-X64: callq __stack_chk_fail2075 2076; DARWIN-X64-LABEL: test14d:2077; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2078; DARWIN-X64: callq ___stack_chk_fail2079 2080; MSVC-I386-LABEL: test14d:2081; MSVC-I386: movl ___security_cookie,2082; MSVC-I386: calll @__security_check_cookie@42083  %a = alloca i32, align 42084  %add.ptr5 = getelementptr inbounds i32, ptr %a, i64 -122085  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %add.ptr5)2086  ret void2087}2088 2089; test15a: Addr-of a local cast to a ptr of a different type2090;           (e.g., int a; ... ; ptr b = &a;)2091;          no ssp attribute2092; Requires no protector.2093define void @test15a() {2094entry:2095; LINUX-I386-LABEL: test15a:2096; LINUX-I386-NOT: calll __stack_chk_fail2097; LINUX-I386: .cfi_endproc2098 2099; LINUX-X64-LABEL: test15a:2100; LINUX-X64-NOT: callq __stack_chk_fail2101; LINUX-X64: .cfi_endproc2102 2103; LINUX-KERNEL-X64-LABEL: test15a:2104; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2105; LINUX-KERNEL-X64: .cfi_endproc2106 2107; DARWIN-X64-LABEL: test15a:2108; DARWIN-X64-NOT: callq ___stack_chk_fail2109; DARWIN-X64: .cfi_endproc2110 2111; MSVC-I386-LABEL: test15a:2112; MSVC-I386-NOT: calll @__security_check_cookie@42113; MSVC-I386: retl2114  %a = alloca i32, align 42115  %b = alloca ptr, align 82116  store i32 0, ptr %a, align 42117  store ptr %a, ptr %b, align 82118  %0 = load ptr, ptr %b, align 82119  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %0)2120  ret void2121}2122 2123; test15b: Addr-of a local cast to a ptr of a different type2124;           (e.g., int a; ... ; ptr b = &a;)2125;          ssp attribute2126; Requires no protector.2127; Function Attrs: ssp2128define void @test15b() #0 {2129entry:2130; LINUX-I386-LABEL: test15b:2131; LINUX-I386-NOT: calll __stack_chk_fail2132; LINUX-I386: .cfi_endproc2133 2134; LINUX-X64-LABEL: test15b:2135; LINUX-X64-NOT: callq __stack_chk_fail2136; LINUX-X64: .cfi_endproc2137 2138; LINUX-KERNEL-X64-LABEL: test15b:2139; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2140; LINUX-KERNEL-X64: .cfi_endproc2141 2142; DARWIN-X64-LABEL: test15b:2143; DARWIN-X64-NOT: callq ___stack_chk_fail2144; DARWIN-X64: .cfi_endproc2145 2146; MSVC-I386-LABEL: test15b:2147; MSVC-I386-NOT: calll @__security_check_cookie@42148; MSVC-I386: retl2149  %a = alloca i32, align 42150  %b = alloca ptr, align 82151  store i32 0, ptr %a, align 42152  store ptr %a, ptr %b, align 82153  %0 = load ptr, ptr %b, align 82154  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %0)2155  ret void2156}2157 2158; test15c: Addr-of a local cast to a ptr of a different type2159;           (e.g., int a; ... ; ptr b = &a;)2160;          sspstrong attribute2161; Requires protector.2162; Function Attrs: sspstrong 2163define void @test15c() #1 {2164entry:2165; LINUX-I386-LABEL: test15c:2166; LINUX-I386: mov{{l|q}} %gs:2167; LINUX-I386: calll __stack_chk_fail2168 2169; LINUX-X64-LABEL: test15c:2170; LINUX-X64: mov{{l|q}} %fs:2171; LINUX-X64: callq __stack_chk_fail2172 2173; LINUX-KERNEL-X64-LABEL: test15c:2174; LINUX-KERNEL-X64: mov{{l|q}} %gs:2175; LINUX-KERNEL-X64: callq __stack_chk_fail2176 2177; DARWIN-X64-LABEL: test15c:2178; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2179; DARWIN-X64: callq ___stack_chk_fail2180 2181; MSVC-I386-LABEL: test15c:2182; MSVC-I386: movl ___security_cookie,2183; MSVC-I386: calll @__security_check_cookie@42184  %a = alloca i32, align 42185  %b = alloca ptr, align 82186  store i32 0, ptr %a, align 42187  store ptr %a, ptr %b, align 82188  %0 = load ptr, ptr %b, align 82189  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %0)2190  ret void2191}2192 2193; test15d: Addr-of a local cast to a ptr of a different type2194;           (e.g., int a; ... ; ptr b = &a;)2195;          sspreq attribute2196; Requires protector.2197; Function Attrs: sspreq 2198define void @test15d() #2 {2199entry:2200; LINUX-I386-LABEL: test15d:2201; LINUX-I386: mov{{l|q}} %gs:2202; LINUX-I386: calll __stack_chk_fail2203 2204; LINUX-X64-LABEL: test15d:2205; LINUX-X64: mov{{l|q}} %fs:2206; LINUX-X64: callq __stack_chk_fail2207 2208; LINUX-KERNEL-X64-LABEL: test15d:2209; LINUX-KERNEL-X64: mov{{l|q}} %gs:2210; LINUX-KERNEL-X64: callq __stack_chk_fail2211 2212; DARWIN-X64-LABEL: test15d:2213; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2214; DARWIN-X64: callq ___stack_chk_fail2215 2216; MSVC-I386-LABEL: test15d:2217; MSVC-I386: movl ___security_cookie,2218; MSVC-I386: calll @__security_check_cookie@42219  %a = alloca i32, align 42220  %b = alloca ptr, align 82221  store i32 0, ptr %a, align 42222  store ptr %a, ptr %b, align 82223  %0 = load ptr, ptr %b, align 82224  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %0)2225  ret void2226}2227 2228; test16a: Addr-of a local cast to a ptr of a different type (optimized)2229;           (e.g., int a; ... ; ptr b = &a;)2230;          no ssp attribute2231; Requires no protector.2232define void @test16a() {2233entry:2234; LINUX-I386-LABEL: test16a:2235; LINUX-I386-NOT: calll __stack_chk_fail2236; LINUX-I386: .cfi_endproc2237 2238; LINUX-X64-LABEL: test16a:2239; LINUX-X64-NOT: callq __stack_chk_fail2240; LINUX-X64: .cfi_endproc2241 2242; LINUX-KERNEL-X64-LABEL: test16a:2243; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2244; LINUX-KERNEL-X64: .cfi_endproc2245 2246; DARWIN-X64-LABEL: test16a:2247; DARWIN-X64-NOT: callq ___stack_chk_fail2248; DARWIN-X64: .cfi_endproc2249 2250; MSVC-I386-LABEL: test16a:2251; MSVC-I386-NOT: calll @__security_check_cookie@42252; MSVC-I386: retl2253  %a = alloca i32, align 42254  store i32 0, ptr %a, align 42255  call void @funfloat(ptr %a)2256  ret void2257}2258 2259; test16b: Addr-of a local cast to a ptr of a different type (optimized)2260;           (e.g., int a; ... ; ptr b = &a;)2261;          ssp attribute2262; Requires no protector.2263; Function Attrs: ssp2264define void @test16b() #0 {2265entry:2266; LINUX-I386-LABEL: test16b:2267; LINUX-I386-NOT: calll __stack_chk_fail2268; LINUX-I386: .cfi_endproc2269 2270; LINUX-X64-LABEL: test16b:2271; LINUX-X64-NOT: callq __stack_chk_fail2272; LINUX-X64: .cfi_endproc2273 2274; LINUX-KERNEL-X64-LABEL: test16b:2275; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2276; LINUX-KERNEL-X64: .cfi_endproc2277 2278; DARWIN-X64-LABEL: test16b:2279; DARWIN-X64-NOT: callq ___stack_chk_fail2280; DARWIN-X64: .cfi_endproc2281 2282; MSVC-I386-LABEL: test16b:2283; MSVC-I386-NOT: calll @__security_check_cookie@42284; MSVC-I386: retl2285  %a = alloca i32, align 42286  store i32 0, ptr %a, align 42287  call void @funfloat(ptr %a)2288  ret void2289}2290 2291; test16c: Addr-of a local cast to a ptr of a different type (optimized)2292;           (e.g., int a; ... ; ptr b = &a;)2293;          sspstrong attribute2294; Requires protector.2295; Function Attrs: sspstrong 2296define void @test16c() #1 {2297entry:2298; LINUX-I386-LABEL: test16c:2299; LINUX-I386: mov{{l|q}} %gs:2300; LINUX-I386: calll __stack_chk_fail2301 2302; LINUX-X64-LABEL: test16c:2303; LINUX-X64: mov{{l|q}} %fs:2304; LINUX-X64: callq __stack_chk_fail2305 2306; LINUX-KERNEL-X64-LABEL: test16c:2307; LINUX-KERNEL-X64: mov{{l|q}} %gs:2308; LINUX-KERNEL-X64: callq __stack_chk_fail2309 2310; DARWIN-X64-LABEL: test16c:2311; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2312; DARWIN-X64: callq ___stack_chk_fail2313 2314; MSVC-I386-LABEL: test16c:2315; MSVC-I386: movl ___security_cookie,2316; MSVC-I386: calll @__security_check_cookie@42317  %a = alloca i32, align 42318  store i32 0, ptr %a, align 42319  call void @funfloat(ptr %a)2320  ret void2321}2322 2323; test16d: Addr-of a local cast to a ptr of a different type (optimized)2324;           (e.g., int a; ... ; ptr b = &a;)2325;          sspreq attribute2326; Requires protector.2327; Function Attrs: sspreq 2328define void @test16d() #2 {2329entry:2330; LINUX-I386-LABEL: test16d:2331; LINUX-I386: mov{{l|q}} %gs:2332; LINUX-I386: calll __stack_chk_fail2333 2334; LINUX-X64-LABEL: test16d:2335; LINUX-X64: mov{{l|q}} %fs:2336; LINUX-X64: callq __stack_chk_fail2337 2338; LINUX-KERNEL-X64-LABEL: test16d:2339; LINUX-KERNEL-X64: mov{{l|q}} %gs:2340; LINUX-KERNEL-X64: callq __stack_chk_fail2341 2342; DARWIN-X64-LABEL: test16d:2343; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2344; DARWIN-X64: callq ___stack_chk_fail2345 2346; MSVC-I386-LABEL: test16d:2347; MSVC-I386: movl ___security_cookie,2348; MSVC-I386: calll @__security_check_cookie@42349  %a = alloca i32, align 42350  store i32 0, ptr %a, align 42351  call void @funfloat(ptr %a)2352  ret void2353}2354 2355; test17a: Addr-of a vector nested in a struct2356;          no ssp attribute2357; Requires no protector.2358define void @test17a() {2359entry:2360; LINUX-I386-LABEL: test17a:2361; LINUX-I386-NOT: calll __stack_chk_fail2362; LINUX-I386: .cfi_endproc2363 2364; LINUX-X64-LABEL: test17a:2365; LINUX-X64-NOT: callq __stack_chk_fail2366; LINUX-X64: .cfi_endproc2367 2368; LINUX-KERNEL-X64-LABEL: test17a:2369; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2370; LINUX-KERNEL-X64: .cfi_endproc2371 2372; DARWIN-X64-LABEL: test17a:2373; DARWIN-X64-NOT: callq ___stack_chk_fail2374; DARWIN-X64: .cfi_endproc2375 2376; MSVC-I386-LABEL: test17a:2377; MSVC-I386-NOT: calll @__security_check_cookie@42378; MSVC-I386: retl2379  %c = alloca %struct.vec, align 162380  %add.ptr = getelementptr inbounds <4 x i32>, ptr %c, i64 -122381  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %add.ptr)2382  ret void2383}2384 2385; test17b: Addr-of a vector nested in a struct2386;          ssp attribute2387; Requires no protector.2388; Function Attrs: ssp2389define void @test17b() #0 {2390entry:2391; LINUX-I386-LABEL: test17b:2392; LINUX-I386-NOT: calll __stack_chk_fail2393; LINUX-I386: .cfi_endproc2394 2395; LINUX-X64-LABEL: test17b:2396; LINUX-X64-NOT: callq __stack_chk_fail2397; LINUX-X64: .cfi_endproc2398 2399; LINUX-KERNEL-X64-LABEL: test17b:2400; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2401; LINUX-KERNEL-X64: .cfi_endproc2402 2403; DARWIN-X64-LABEL: test17b:2404; DARWIN-X64-NOT: callq ___stack_chk_fail2405; DARWIN-X64: .cfi_endproc2406 2407; MSVC-I386-LABEL: test17b:2408; MSVC-I386-NOT: calll @__security_check_cookie@42409; MSVC-I386: retl2410  %c = alloca %struct.vec, align 162411  %add.ptr = getelementptr inbounds <4 x i32>, ptr %c, i64 -122412  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %add.ptr)2413  ret void2414}2415 2416; test17c: Addr-of a vector nested in a struct2417;          sspstrong attribute2418; Requires protector.2419; Function Attrs: sspstrong 2420define void @test17c() #1 {2421entry:2422; LINUX-I386-LABEL: test17c:2423; LINUX-I386: mov{{l|q}} %gs:2424; LINUX-I386: calll __stack_chk_fail2425 2426; LINUX-X64-LABEL: test17c:2427; LINUX-X64: mov{{l|q}} %fs:2428; LINUX-X64: callq __stack_chk_fail2429 2430; LINUX-KERNEL-X64-LABEL: test17c:2431; LINUX-KERNEL-X64: mov{{l|q}} %gs:2432; LINUX-KERNEL-X64: callq __stack_chk_fail2433 2434; DARWIN-X64-LABEL: test17c:2435; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2436; DARWIN-X64: callq ___stack_chk_fail2437 2438; MSVC-I386-LABEL: test17c:2439; MSVC-I386: movl ___security_cookie,2440; MSVC-I386: calll @__security_check_cookie@42441  %c = alloca %struct.vec, align 162442  %add.ptr = getelementptr inbounds <4 x i32>, ptr %c, i64 -122443  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %add.ptr)2444  ret void2445}2446 2447; test17d: Addr-of a vector nested in a struct2448;          sspreq attribute2449; Requires protector.2450; Function Attrs: sspreq 2451define void @test17d() #2 {2452entry:2453; LINUX-I386-LABEL: test17d:2454; LINUX-I386: mov{{l|q}} %gs:2455; LINUX-I386: calll __stack_chk_fail2456 2457; LINUX-X64-LABEL: test17d:2458; LINUX-X64: mov{{l|q}} %fs:2459; LINUX-X64: callq __stack_chk_fail2460 2461; LINUX-KERNEL-X64-LABEL: test17d:2462; LINUX-KERNEL-X64: mov{{l|q}} %gs:2463; LINUX-KERNEL-X64: callq __stack_chk_fail2464 2465; DARWIN-X64-LABEL: test17d:2466; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2467; DARWIN-X64: callq ___stack_chk_fail2468 2469; MSVC-I386-LABEL: test17d:2470; MSVC-I386: movl ___security_cookie,2471; MSVC-I386: calll @__security_check_cookie@42472  %c = alloca %struct.vec, align 162473  %add.ptr = getelementptr inbounds <4 x i32>, ptr %c, i64 -122474  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %add.ptr)2475  ret void2476}2477 2478; test18a: Addr-of a variable passed into an invoke instruction.2479;          no ssp attribute2480; Requires no protector.2481define i32 @test18a() personality ptr @__gxx_personality_v0 {2482entry:2483; LINUX-I386-LABEL: test18a:2484; LINUX-I386-NOT: calll __stack_chk_fail2485; LINUX-I386: .cfi_endproc2486 2487; LINUX-X64-LABEL: test18a:2488; LINUX-X64-NOT: callq __stack_chk_fail2489; LINUX-X64: .cfi_endproc2490 2491; LINUX-KERNEL-X64-LABEL: test18a:2492; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2493; LINUX-KERNEL-X64: .cfi_endproc2494 2495; DARWIN-X64-LABEL: test18a:2496; DARWIN-X64-NOT: callq ___stack_chk_fail2497; DARWIN-X64: .cfi_endproc2498 2499; MSVC-I386-LABEL: test18a:2500; MSVC-I386-NOT: calll @__security_check_cookie@42501; MSVC-I386: retl2502  %a = alloca i32, align 42503  %exn.slot = alloca ptr2504  %ehselector.slot = alloca i322505  store i32 0, ptr %a, align 42506  invoke void @_Z3exceptPi(ptr %a)2507          to label %invoke.cont unwind label %lpad2508 2509invoke.cont:2510  ret i32 02511 2512lpad:2513  %0 = landingpad { ptr, i32 }2514          catch ptr null2515  ret i32 02516}2517 2518; test18b: Addr-of a variable passed into an invoke instruction.2519;          ssp attribute2520; Requires no protector.2521; Function Attrs: ssp 2522define i32 @test18b() #0 personality ptr @__gxx_personality_v0 {2523entry:2524; LINUX-I386-LABEL: test18b:2525; LINUX-I386-NOT: calll __stack_chk_fail2526; LINUX-I386: .cfi_endproc2527 2528; LINUX-X64-LABEL: test18b:2529; LINUX-X64-NOT: callq __stack_chk_fail2530; LINUX-X64: .cfi_endproc2531 2532; LINUX-KERNEL-X64-LABEL: test18b:2533; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2534; LINUX-KERNEL-X64: .cfi_endproc2535 2536; DARWIN-X64-LABEL: test18b:2537; DARWIN-X64-NOT: callq ___stack_chk_fail2538; DARWIN-X64: .cfi_endproc2539 2540; MSVC-I386-LABEL: test18b:2541; MSVC-I386-NOT: calll @__security_check_cookie@42542; MSVC-I386: retl2543  %a = alloca i32, align 42544  %exn.slot = alloca ptr2545  %ehselector.slot = alloca i322546  store i32 0, ptr %a, align 42547  invoke void @_Z3exceptPi(ptr %a)2548          to label %invoke.cont unwind label %lpad2549 2550invoke.cont:2551  ret i32 02552 2553lpad:2554  %0 = landingpad { ptr, i32 }2555          catch ptr null2556  ret i32 02557}2558 2559; test18c: Addr-of a variable passed into an invoke instruction.2560;          sspstrong attribute2561; Requires protector.2562; Function Attrs: sspstrong 2563define i32 @test18c() #1 personality ptr @__gxx_personality_v0 {2564entry:2565; LINUX-I386-LABEL: test18c:2566; LINUX-I386: mov{{l|q}} %gs:2567; LINUX-I386: calll __stack_chk_fail2568 2569; LINUX-X64-LABEL: test18c:2570; LINUX-X64: mov{{l|q}} %fs:2571; LINUX-X64: callq __stack_chk_fail2572 2573; LINUX-KERNEL-X64-LABEL: test18c:2574; LINUX-KERNEL-X64: mov{{l|q}} %gs:2575; LINUX-KERNEL-X64: callq __stack_chk_fail2576 2577; DARWIN-X64-LABEL: test18c:2578; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2579; DARWIN-X64: callq ___stack_chk_fail2580 2581; MSVC-I386-LABEL: test18c:2582; MSVC-I386: movl ___security_cookie,2583; MSVC-I386: calll @__security_check_cookie@42584  %a = alloca i32, align 42585  %exn.slot = alloca ptr2586  %ehselector.slot = alloca i322587  store i32 0, ptr %a, align 42588  invoke void @_Z3exceptPi(ptr %a)2589          to label %invoke.cont unwind label %lpad2590 2591invoke.cont:2592  ret i32 02593 2594lpad:2595  %0 = landingpad { ptr, i32 }2596          catch ptr null2597  ret i32 02598}2599 2600; test18d: Addr-of a variable passed into an invoke instruction.2601;          sspreq attribute2602; Requires protector.2603; Function Attrs: sspreq 2604define i32 @test18d() #2 personality ptr @__gxx_personality_v0 {2605entry:2606; LINUX-I386-LABEL: test18d:2607; LINUX-I386: mov{{l|q}} %gs:2608; LINUX-I386: calll __stack_chk_fail2609 2610; LINUX-X64-LABEL: test18d:2611; LINUX-X64: mov{{l|q}} %fs:2612; LINUX-X64: callq __stack_chk_fail2613 2614; LINUX-KERNEL-X64-LABEL: test18d:2615; LINUX-KERNEL-X64: mov{{l|q}} %gs:2616; LINUX-KERNEL-X64: callq __stack_chk_fail2617 2618; DARWIN-X64-LABEL: test18d:2619; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2620; DARWIN-X64: callq ___stack_chk_fail2621 2622; MSVC-I386-LABEL: test18d:2623; MSVC-I386: movl ___security_cookie,2624; MSVC-I386: calll @__security_check_cookie@42625  %a = alloca i32, align 42626  %exn.slot = alloca ptr2627  %ehselector.slot = alloca i322628  store i32 0, ptr %a, align 42629  invoke void @_Z3exceptPi(ptr %a)2630          to label %invoke.cont unwind label %lpad2631 2632invoke.cont:2633  ret i32 02634 2635lpad:2636  %0 = landingpad { ptr, i32 }2637          catch ptr null2638  ret i32 02639}2640; test19a: Addr-of a struct element passed into an invoke instruction.2641;           (GEP followed by an invoke)2642;          no ssp attribute2643; Requires no protector.2644define i32 @test19a() personality ptr @__gxx_personality_v0 {2645entry:2646; LINUX-I386-LABEL: test19a:2647; LINUX-I386-NOT: calll __stack_chk_fail2648; LINUX-I386: .cfi_endproc2649 2650; LINUX-X64-LABEL: test19a:2651; LINUX-X64-NOT: callq __stack_chk_fail2652; LINUX-X64: .cfi_endproc2653 2654; LINUX-KERNEL-X64-LABEL: test19a:2655; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2656; LINUX-KERNEL-X64: .cfi_endproc2657 2658; DARWIN-X64-LABEL: test19a:2659; DARWIN-X64-NOT: callq ___stack_chk_fail2660; DARWIN-X64: .cfi_endproc2661 2662; MSVC-I386-LABEL: test19a:2663; MSVC-I386-NOT: calll @__security_check_cookie@42664; MSVC-I386: retl2665  %c = alloca %struct.pair, align 42666  %exn.slot = alloca ptr2667  %ehselector.slot = alloca i322668  store i32 0, ptr %c, align 42669  invoke void @_Z3exceptPi(ptr %c)2670          to label %invoke.cont unwind label %lpad2671 2672invoke.cont:2673  ret i32 02674 2675lpad:2676  %0 = landingpad { ptr, i32 }2677          catch ptr null2678  ret i32 02679}2680 2681; test19b: Addr-of a struct element passed into an invoke instruction.2682;           (GEP followed by an invoke)2683;          ssp attribute2684; Requires no protector.2685; Function Attrs: ssp 2686define i32 @test19b() #0 personality ptr @__gxx_personality_v0 {2687entry:2688; LINUX-I386-LABEL: test19b:2689; LINUX-I386-NOT: calll __stack_chk_fail2690; LINUX-I386: .cfi_endproc2691 2692; LINUX-X64-LABEL: test19b:2693; LINUX-X64-NOT: callq __stack_chk_fail2694; LINUX-X64: .cfi_endproc2695 2696; LINUX-KERNEL-X64-LABEL: test19b:2697; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2698; LINUX-KERNEL-X64: .cfi_endproc2699 2700; DARWIN-X64-LABEL: test19b:2701; DARWIN-X64-NOT: callq ___stack_chk_fail2702; DARWIN-X64: .cfi_endproc2703 2704; MSVC-I386-LABEL: test19b:2705; MSVC-I386-NOT: calll @__security_check_cookie@42706; MSVC-I386: retl2707  %c = alloca %struct.pair, align 42708  %exn.slot = alloca ptr2709  %ehselector.slot = alloca i322710  store i32 0, ptr %c, align 42711  invoke void @_Z3exceptPi(ptr %c)2712          to label %invoke.cont unwind label %lpad2713 2714invoke.cont:2715  ret i32 02716 2717lpad:2718  %0 = landingpad { ptr, i32 }2719          catch ptr null2720  ret i32 02721}2722 2723; test19c: Addr-of a struct element passed into an invoke instruction.2724;           (GEP followed by an invoke)2725;          sspstrong attribute2726; Requires protector.2727; Function Attrs: sspstrong 2728define i32 @test19c() #1 personality ptr @__gxx_personality_v0 {2729entry:2730; LINUX-I386-LABEL: test19c:2731; LINUX-I386: mov{{l|q}} %gs:2732; LINUX-I386: calll __stack_chk_fail2733 2734; LINUX-X64-LABEL: test19c:2735; LINUX-X64: mov{{l|q}} %fs:2736; LINUX-X64: callq __stack_chk_fail2737 2738; LINUX-KERNEL-X64-LABEL: test19c:2739; LINUX-KERNEL-X64: mov{{l|q}} %gs:2740; LINUX-KERNEL-X64: callq __stack_chk_fail2741 2742; DARWIN-X64-LABEL: test19c:2743; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2744; DARWIN-X64: callq ___stack_chk_fail2745 2746; MSVC-I386-LABEL: test19c:2747; MSVC-I386: movl ___security_cookie,2748; MSVC-I386: calll @__security_check_cookie@42749  %c = alloca %struct.pair, align 42750  %exn.slot = alloca ptr2751  %ehselector.slot = alloca i322752  store i32 0, ptr %c, align 42753  invoke void @_Z3exceptPi(ptr %c)2754          to label %invoke.cont unwind label %lpad2755 2756invoke.cont:2757  ret i32 02758 2759lpad:2760  %0 = landingpad { ptr, i32 }2761          catch ptr null2762  ret i32 02763}2764 2765; test19d: Addr-of a struct element passed into an invoke instruction.2766;           (GEP followed by an invoke)2767;          sspreq attribute2768; Requires protector.2769; Function Attrs: sspreq 2770define i32 @test19d() #2 personality ptr @__gxx_personality_v0 {2771entry:2772; LINUX-I386-LABEL: test19d:2773; LINUX-I386: mov{{l|q}} %gs:2774; LINUX-I386: calll __stack_chk_fail2775; LINUX-I386-NOT: calll __stack_chk_fail2776 2777; LINUX-X64-LABEL: test19d:2778; LINUX-X64: mov{{l|q}} %fs:2779; LINUX-X64: callq __stack_chk_fail2780; LINUX-X64-NOT: callq __stack_chk_fail2781 2782; LINUX-KERNEL-X64-LABEL: test19d:2783; LINUX-KERNEL-X64: mov{{l|q}} %gs:2784; LINUX-KERNEL-X64: callq __stack_chk_fail2785; LINUX-KERNEL-X64-NOT: callq ___stack_chk_fail2786 2787; DARWIN-X64-LABEL: test19d:2788; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2789; DARWIN-X64: callq ___stack_chk_fail2790; DARWIN-X64-NOT: callq ___stack_chk_fail2791 2792; MSVC-I386-LABEL: test19d:2793; MSVC-I386: movl ___security_cookie,2794; MSVC-I386: calll @__security_check_cookie@42795 2796; MINGW-X64-LABEL: test19d:2797; MINGW-X64: mov{{l|q}} .refptr.__stack_chk_guard2798; MINGW-X64: callq __stack_chk_fail2799 2800  %c = alloca %struct.pair, align 42801  %exn.slot = alloca ptr2802  %ehselector.slot = alloca i322803  store i32 0, ptr %c, align 42804  invoke void @_Z3exceptPi(ptr %c)2805          to label %invoke.cont unwind label %lpad2806 2807invoke.cont:2808  ret i32 02809 2810lpad:2811  %0 = landingpad { ptr, i32 }2812          catch ptr null2813  ret i32 02814}2815 2816; test20a: Addr-of a pointer2817;          no ssp attribute2818; Requires no protector.2819define void @test20a() {2820entry:2821; LINUX-I386-LABEL: test20a:2822; LINUX-I386-NOT: calll __stack_chk_fail2823; LINUX-I386: .cfi_endproc2824 2825; LINUX-X64-LABEL: test20a:2826; LINUX-X64-NOT: callq __stack_chk_fail2827; LINUX-X64: .cfi_endproc2828 2829; LINUX-KERNEL-X64-LABEL: test20a:2830; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2831; LINUX-KERNEL-X64: .cfi_endproc2832 2833; DARWIN-X64-LABEL: test20a:2834; DARWIN-X64-NOT: callq ___stack_chk_fail2835; DARWIN-X64: .cfi_endproc2836 2837; MSVC-I386-LABEL: test20a:2838; MSVC-I386-NOT: calll @__security_check_cookie@42839; MSVC-I386: retl2840  %a = alloca ptr, align 82841  %b = alloca ptr, align 82842  %call = call ptr @getp()2843  store ptr %call, ptr %a, align 82844  store ptr %a, ptr %b, align 82845  %0 = load ptr, ptr %b, align 82846  call void @funcall2(ptr %0)2847  ret void2848}2849 2850; test20b: Addr-of a pointer2851;          ssp attribute2852; Requires no protector.2853; Function Attrs: ssp2854define void @test20b() #0 {2855entry:2856; LINUX-I386-LABEL: test20b:2857; LINUX-I386-NOT: calll __stack_chk_fail2858; LINUX-I386: .cfi_endproc2859 2860; LINUX-X64-LABEL: test20b:2861; LINUX-X64-NOT: callq __stack_chk_fail2862; LINUX-X64: .cfi_endproc2863 2864; LINUX-KERNEL-X64-LABEL: test20b:2865; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2866; LINUX-KERNEL-X64: .cfi_endproc2867 2868; DARWIN-X64-LABEL: test20b:2869; DARWIN-X64-NOT: callq ___stack_chk_fail2870; DARWIN-X64: .cfi_endproc2871 2872; MSVC-I386-LABEL: test20b:2873; MSVC-I386-NOT: calll @__security_check_cookie@42874; MSVC-I386: retl2875  %a = alloca ptr, align 82876  %b = alloca ptr, align 82877  %call = call ptr @getp()2878  store ptr %call, ptr %a, align 82879  store ptr %a, ptr %b, align 82880  %0 = load ptr, ptr %b, align 82881  call void @funcall2(ptr %0)2882  ret void2883}2884 2885; test20c: Addr-of a pointer2886;          sspstrong attribute2887; Requires protector.2888; Function Attrs: sspstrong 2889define void @test20c() #1 {2890entry:2891; LINUX-I386-LABEL: test20c:2892; LINUX-I386: mov{{l|q}} %gs:2893; LINUX-I386: calll __stack_chk_fail2894 2895; LINUX-X64-LABEL: test20c:2896; LINUX-X64: mov{{l|q}} %fs:2897; LINUX-X64: callq __stack_chk_fail2898 2899; LINUX-KERNEL-X64-LABEL: test20c:2900; LINUX-KERNEL-X64: mov{{l|q}} %gs:2901; LINUX-KERNEL-X64: callq __stack_chk_fail2902 2903; DARWIN-X64-LABEL: test20c:2904; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2905; DARWIN-X64: callq ___stack_chk_fail2906 2907; MSVC-I386-LABEL: test20c:2908; MSVC-I386: movl ___security_cookie,2909; MSVC-I386: calll @__security_check_cookie@42910  %a = alloca ptr, align 82911  %b = alloca ptr, align 82912  %call = call ptr @getp()2913  store ptr %call, ptr %a, align 82914  store ptr %a, ptr %b, align 82915  %0 = load ptr, ptr %b, align 82916  call void @funcall2(ptr %0)2917  ret void2918}2919 2920; test20d: Addr-of a pointer2921;          sspreq attribute2922; Requires protector.2923; Function Attrs: sspreq 2924define void @test20d() #2 {2925entry:2926; LINUX-I386-LABEL: test20d:2927; LINUX-I386: mov{{l|q}} %gs:2928; LINUX-I386: calll __stack_chk_fail2929 2930; LINUX-X64-LABEL: test20d:2931; LINUX-X64: mov{{l|q}} %fs:2932; LINUX-X64: callq __stack_chk_fail2933 2934; LINUX-KERNEL-X64-LABEL: test20d:2935; LINUX-KERNEL-X64: mov{{l|q}} %gs:2936; LINUX-KERNEL-X64: callq __stack_chk_fail2937 2938; DARWIN-X64-LABEL: test20d:2939; DARWIN-X64: mov{{l|q}} ___stack_chk_guard2940; DARWIN-X64: callq ___stack_chk_fail2941 2942; MSVC-I386-LABEL: test20d:2943; MSVC-I386: movl ___security_cookie,2944; MSVC-I386: calll @__security_check_cookie@42945  %a = alloca ptr, align 82946  %b = alloca ptr, align 82947  %call = call ptr @getp()2948  store ptr %call, ptr %a, align 82949  store ptr %a, ptr %b, align 82950  %0 = load ptr, ptr %b, align 82951  call void @funcall2(ptr %0)2952  ret void2953}2954 2955; test21a: Addr-of a casted pointer2956;          no ssp attribute2957; Requires no protector.2958define void @test21a() {2959entry:2960; LINUX-I386-LABEL: test21a:2961; LINUX-I386-NOT: calll __stack_chk_fail2962; LINUX-I386: .cfi_endproc2963 2964; LINUX-X64-LABEL: test21a:2965; LINUX-X64-NOT: callq __stack_chk_fail2966; LINUX-X64: .cfi_endproc2967 2968; LINUX-KERNEL-X64-LABEL: test21a:2969; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail2970; LINUX-KERNEL-X64: .cfi_endproc2971 2972; DARWIN-X64-LABEL: test21a:2973; DARWIN-X64-NOT: callq ___stack_chk_fail2974; DARWIN-X64: .cfi_endproc2975 2976; MSVC-I386-LABEL: test21a:2977; MSVC-I386-NOT: calll @__security_check_cookie@42978; MSVC-I386: retl2979  %a = alloca ptr, align 82980  %b = alloca ptr, align 82981  %call = call ptr @getp()2982  store ptr %call, ptr %a, align 82983  store ptr %a, ptr %b, align 82984  %0 = load ptr, ptr %b, align 82985  call void @funfloat2(ptr %0)2986  ret void2987}2988 2989; test21b: Addr-of a casted pointer2990;          ssp attribute2991; Requires no protector.2992; Function Attrs: ssp2993define void @test21b() #0 {2994entry:2995; LINUX-I386-LABEL: test21b:2996; LINUX-I386-NOT: calll __stack_chk_fail2997; LINUX-I386: .cfi_endproc2998 2999; LINUX-X64-LABEL: test21b:3000; LINUX-X64-NOT: callq __stack_chk_fail3001; LINUX-X64: .cfi_endproc3002 3003; LINUX-KERNEL-X64-LABEL: test21b:3004; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3005; LINUX-KERNEL-X64: .cfi_endproc3006 3007; DARWIN-X64-LABEL: test21b:3008; DARWIN-X64-NOT: callq ___stack_chk_fail3009; DARWIN-X64: .cfi_endproc3010 3011; MSVC-I386-LABEL: test21b:3012; MSVC-I386-NOT: calll @__security_check_cookie@43013; MSVC-I386: retl3014  %a = alloca ptr, align 83015  %b = alloca ptr, align 83016  %call = call ptr @getp()3017  store ptr %call, ptr %a, align 83018  store ptr %a, ptr %b, align 83019  %0 = load ptr, ptr %b, align 83020  call void @funfloat2(ptr %0)3021  ret void3022}3023 3024; test21c: Addr-of a casted pointer3025;          sspstrong attribute3026; Requires protector.3027; Function Attrs: sspstrong 3028define void @test21c() #1 {3029entry:3030; LINUX-I386-LABEL: test21c:3031; LINUX-I386: mov{{l|q}} %gs:3032; LINUX-I386: calll __stack_chk_fail3033 3034; LINUX-X64-LABEL: test21c:3035; LINUX-X64: mov{{l|q}} %fs:3036; LINUX-X64: callq __stack_chk_fail3037 3038; LINUX-KERNEL-X64-LABEL: test21c:3039; LINUX-KERNEL-X64: mov{{l|q}} %gs:3040; LINUX-KERNEL-X64: callq __stack_chk_fail3041 3042; DARWIN-X64-LABEL: test21c:3043; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3044; DARWIN-X64: callq ___stack_chk_fail3045 3046; MSVC-I386-LABEL: test21c:3047; MSVC-I386: movl ___security_cookie,3048; MSVC-I386: calll @__security_check_cookie@43049  %a = alloca ptr, align 83050  %b = alloca ptr, align 83051  %call = call ptr @getp()3052  store ptr %call, ptr %a, align 83053  store ptr %a, ptr %b, align 83054  %0 = load ptr, ptr %b, align 83055  call void @funfloat2(ptr %0)3056  ret void3057}3058 3059; test21d: Addr-of a casted pointer3060;          sspreq attribute3061; Requires protector.3062; Function Attrs: sspreq 3063define void @test21d() #2 {3064entry:3065; LINUX-I386-LABEL: test21d:3066; LINUX-I386: mov{{l|q}} %gs:3067; LINUX-I386: calll __stack_chk_fail3068 3069; LINUX-X64-LABEL: test21d:3070; LINUX-X64: mov{{l|q}} %fs:3071; LINUX-X64: callq __stack_chk_fail3072 3073; LINUX-KERNEL-X64-LABEL: test21d:3074; LINUX-KERNEL-X64: mov{{l|q}} %gs:3075; LINUX-KERNEL-X64: callq __stack_chk_fail3076 3077; DARWIN-X64-LABEL: test21d:3078; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3079; DARWIN-X64: callq ___stack_chk_fail3080 3081; MSVC-I386-LABEL: test21d:3082; MSVC-I386: movl ___security_cookie,3083; MSVC-I386: calll @__security_check_cookie@43084  %a = alloca ptr, align 83085  %b = alloca ptr, align 83086  %call = call ptr @getp()3087  store ptr %call, ptr %a, align 83088  store ptr %a, ptr %b, align 83089  %0 = load ptr, ptr %b, align 83090  call void @funfloat2(ptr %0)3091  ret void3092}3093 3094; test22a: [2 x i8] in a class3095;          no ssp attribute3096; Requires no protector.3097define signext i8 @test22a() {3098entry:3099; LINUX-I386-LABEL: test22a:3100; LINUX-I386-NOT: calll __stack_chk_fail3101; LINUX-I386: .cfi_endproc3102 3103; LINUX-X64-LABEL: test22a:3104; LINUX-X64-NOT: callq __stack_chk_fail3105; LINUX-X64: .cfi_endproc3106 3107; LINUX-KERNEL-X64-LABEL: test22a:3108; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3109; LINUX-KERNEL-X64: .cfi_endproc3110 3111; DARWIN-X64-LABEL: test22a:3112; DARWIN-X64-NOT: callq ___stack_chk_fail3113; DARWIN-X64: .cfi_endproc3114 3115; MSVC-I386-LABEL: test22a:3116; MSVC-I386-NOT: calll @__security_check_cookie@43117; MSVC-I386: retl3118  %a = alloca %class.A, align 13119  %0 = load i8, ptr %a, align 13120  ret i8 %03121}3122 3123; test22b: [2 x i8] in a class3124;          ssp attribute3125; Requires no protector.3126; Function Attrs: ssp3127define signext i8 @test22b() #0 {3128entry:3129; LINUX-I386-LABEL: test22b:3130; LINUX-I386-NOT: calll __stack_chk_fail3131; LINUX-I386: .cfi_endproc3132 3133; LINUX-X64-LABEL: test22b:3134; LINUX-X64-NOT: callq __stack_chk_fail3135; LINUX-X64: .cfi_endproc3136 3137; LINUX-KERNEL-X64-LABEL: test22b:3138; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3139; LINUX-KERNEL-X64: .cfi_endproc3140 3141; DARWIN-X64-LABEL: test22b:3142; DARWIN-X64-NOT: callq ___stack_chk_fail3143; DARWIN-X64: .cfi_endproc3144 3145; MSVC-I386-LABEL: test22b:3146; MSVC-I386-NOT: calll @__security_check_cookie@43147; MSVC-I386: retl3148  %a = alloca %class.A, align 13149  %0 = load i8, ptr %a, align 13150  ret i8 %03151}3152 3153; test22c: [2 x i8] in a class3154;          sspstrong attribute3155; Requires protector.3156; Function Attrs: sspstrong 3157define signext i8 @test22c() #1 {3158entry:3159; LINUX-I386-LABEL: test22c:3160; LINUX-I386: mov{{l|q}} %gs:3161; LINUX-I386: calll __stack_chk_fail3162 3163; LINUX-X64-LABEL: test22c:3164; LINUX-X64: mov{{l|q}} %fs:3165; LINUX-X64: callq __stack_chk_fail3166 3167; LINUX-KERNEL-X64-LABEL: test22c:3168; LINUX-KERNEL-X64: mov{{l|q}} %gs:3169; LINUX-KERNEL-X64: callq __stack_chk_fail3170 3171; DARWIN-X64-LABEL: test22c:3172; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3173; DARWIN-X64: callq ___stack_chk_fail3174 3175; MSVC-I386-LABEL: test22c:3176; MSVC-I386: movl ___security_cookie,3177; MSVC-I386: calll @__security_check_cookie@43178  %a = alloca %class.A, align 13179  %0 = load i8, ptr %a, align 13180  ret i8 %03181}3182 3183; test22d: [2 x i8] in a class3184;          sspreq attribute3185; Requires protector.3186; Function Attrs: sspreq 3187define signext i8 @test22d() #2 {3188entry:3189; LINUX-I386-LABEL: test22d:3190; LINUX-I386: mov{{l|q}} %gs:3191; LINUX-I386: calll __stack_chk_fail3192 3193; LINUX-X64-LABEL: test22d:3194; LINUX-X64: mov{{l|q}} %fs:3195; LINUX-X64: callq __stack_chk_fail3196 3197; LINUX-KERNEL-X64-LABEL: test22d:3198; LINUX-KERNEL-X64: mov{{l|q}} %gs:3199; LINUX-KERNEL-X64: callq __stack_chk_fail3200 3201; DARWIN-X64-LABEL: test22d:3202; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3203; DARWIN-X64: callq ___stack_chk_fail3204 3205; MSVC-I386-LABEL: test22d:3206; MSVC-I386: movl ___security_cookie,3207; MSVC-I386: calll @__security_check_cookie@43208  %a = alloca %class.A, align 13209  %0 = load i8, ptr %a, align 13210  ret i8 %03211}3212 3213; test23a: [2 x i8] nested in several layers of structs and unions3214;          no ssp attribute3215; Requires no protector.3216define signext i8 @test23a() {3217entry:3218; LINUX-I386-LABEL: test23a:3219; LINUX-I386-NOT: calll __stack_chk_fail3220; LINUX-I386: .cfi_endproc3221 3222; LINUX-X64-LABEL: test23a:3223; LINUX-X64-NOT: callq __stack_chk_fail3224; LINUX-X64: .cfi_endproc3225 3226; LINUX-KERNEL-X64-LABEL: test23a:3227; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3228; LINUX-KERNEL-X64: .cfi_endproc3229 3230; DARWIN-X64-LABEL: test23a:3231; DARWIN-X64-NOT: callq ___stack_chk_fail3232; DARWIN-X64: .cfi_endproc3233 3234; MSVC-I386-LABEL: test23a:3235; MSVC-I386-NOT: calll @__security_check_cookie@43236; MSVC-I386: retl3237  %x = alloca %struct.deep, align 13238  %0 = load i8, ptr %x, align 13239  ret i8 %03240}3241 3242; test23b: [2 x i8] nested in several layers of structs and unions3243;          ssp attribute3244; Requires no protector.3245; Function Attrs: ssp3246define signext i8 @test23b() #0 {3247entry:3248; LINUX-I386-LABEL: test23b:3249; LINUX-I386-NOT: calll __stack_chk_fail3250; LINUX-I386: .cfi_endproc3251 3252; LINUX-X64-LABEL: test23b:3253; LINUX-X64-NOT: callq __stack_chk_fail3254; LINUX-X64: .cfi_endproc3255 3256; LINUX-KERNEL-X64-LABEL: test23b:3257; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3258; LINUX-KERNEL-X64: .cfi_endproc3259 3260; DARWIN-X64-LABEL: test23b:3261; DARWIN-X64-NOT: callq ___stack_chk_fail3262; DARWIN-X64: .cfi_endproc3263 3264; MSVC-I386-LABEL: test23b:3265; MSVC-I386-NOT: calll @__security_check_cookie@43266; MSVC-I386: retl3267  %x = alloca %struct.deep, align 13268  %0 = load i8, ptr %x, align 13269  ret i8 %03270}3271 3272; test23c: [2 x i8] nested in several layers of structs and unions3273;          sspstrong attribute3274; Requires protector.3275; Function Attrs: sspstrong 3276define signext i8 @test23c() #1 {3277entry:3278; LINUX-I386-LABEL: test23c:3279; LINUX-I386: mov{{l|q}} %gs:3280; LINUX-I386: calll __stack_chk_fail3281 3282; LINUX-X64-LABEL: test23c:3283; LINUX-X64: mov{{l|q}} %fs:3284; LINUX-X64: callq __stack_chk_fail3285 3286; LINUX-KERNEL-X64-LABEL: test23c:3287; LINUX-KERNEL-X64: mov{{l|q}} %gs:3288; LINUX-KERNEL-X64: callq __stack_chk_fail3289 3290; DARWIN-X64-LABEL: test23c:3291; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3292; DARWIN-X64: callq ___stack_chk_fail3293 3294; MSVC-I386-LABEL: test23c:3295; MSVC-I386: movl ___security_cookie,3296; MSVC-I386: calll @__security_check_cookie@43297  %x = alloca %struct.deep, align 13298  %0 = load i8, ptr %x, align 13299  ret i8 %03300}3301 3302; test23d: [2 x i8] nested in several layers of structs and unions3303;          sspreq attribute3304; Requires protector.3305; Function Attrs: sspreq 3306define signext i8 @test23d() #2 {3307entry:3308; LINUX-I386-LABEL: test23d:3309; LINUX-I386: mov{{l|q}} %gs:3310; LINUX-I386: calll __stack_chk_fail3311 3312; LINUX-X64-LABEL: test23d:3313; LINUX-X64: mov{{l|q}} %fs:3314; LINUX-X64: callq __stack_chk_fail3315 3316; LINUX-KERNEL-X64-LABEL: test23d:3317; LINUX-KERNEL-X64: mov{{l|q}} %gs:3318; LINUX-KERNEL-X64: callq __stack_chk_fail3319 3320; DARWIN-X64-LABEL: test23d:3321; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3322; DARWIN-X64: callq ___stack_chk_fail3323 3324; MSVC-I386-LABEL: test23d:3325; MSVC-I386: movl ___security_cookie,3326; MSVC-I386: calll @__security_check_cookie@43327  %x = alloca %struct.deep, align 13328  %0 = load i8, ptr %x, align 13329  ret i8 %03330}3331 3332; test24a: Variable sized alloca3333;          no ssp attribute3334; Requires no protector.3335define void @test24a(i32 %n) {3336entry:3337; LINUX-I386-LABEL: test24a:3338; LINUX-I386-NOT: calll __stack_chk_fail3339; LINUX-I386: .cfi_endproc3340 3341; LINUX-X64-LABEL: test24a:3342; LINUX-X64-NOT: callq __stack_chk_fail3343; LINUX-X64: .cfi_endproc3344 3345; LINUX-KERNEL-X64-LABEL: test24a:3346; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3347; LINUX-KERNEL-X64: .cfi_endproc3348 3349; DARWIN-X64-LABEL: test24a:3350; DARWIN-X64-NOT: callq ___stack_chk_fail3351; DARWIN-X64: .cfi_endproc3352 3353; MSVC-I386-LABEL: test24a:3354; MSVC-I386-NOT: calll @__security_check_cookie@43355; MSVC-I386: retl3356  %n.addr = alloca i32, align 43357  %a = alloca ptr, align 83358  store i32 %n, ptr %n.addr, align 43359  %0 = load i32, ptr %n.addr, align 43360  %conv = sext i32 %0 to i643361  %1 = alloca i8, i64 %conv3362  store ptr %1, ptr %a, align 83363  ret void3364}3365 3366; test24b: Variable sized alloca3367;          ssp attribute3368; Requires protector.3369; Function Attrs: ssp3370define void @test24b(i32 %n) #0 {3371entry:3372; LINUX-I386-LABEL: test24b:3373; LINUX-I386: mov{{l|q}} %gs:3374; LINUX-I386: calll __stack_chk_fail3375 3376; LINUX-X64-LABEL: test24b:3377; LINUX-X64: mov{{l|q}} %fs:3378; LINUX-X64: callq __stack_chk_fail3379 3380; LINUX-KERNEL-X64-LABEL: test24b:3381; LINUX-KERNEL-X64: mov{{l|q}} %gs:3382; LINUX-KERNEL-X64: callq __stack_chk_fail3383 3384; DARWIN-X64-LABEL: test24b:3385; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3386; DARWIN-X64: callq ___stack_chk_fail3387 3388; MSVC-I386-LABEL: test24b:3389; MSVC-I386: movl ___security_cookie,3390; MSVC-I386: calll @__security_check_cookie@43391  %n.addr = alloca i32, align 43392  %a = alloca ptr, align 83393  store i32 %n, ptr %n.addr, align 43394  %0 = load i32, ptr %n.addr, align 43395  %conv = sext i32 %0 to i643396  %1 = alloca i8, i64 %conv3397  store ptr %1, ptr %a, align 83398  ret void3399}3400 3401; test24c: Variable sized alloca3402;          sspstrong attribute3403; Requires protector.3404; Function Attrs: sspstrong 3405define void @test24c(i32 %n) #1 {3406entry:3407; LINUX-I386-LABEL: test24c:3408; LINUX-I386: mov{{l|q}} %gs:3409; LINUX-I386: calll __stack_chk_fail3410 3411; LINUX-X64-LABEL: test24c:3412; LINUX-X64: mov{{l|q}} %fs:3413; LINUX-X64: callq __stack_chk_fail3414 3415; LINUX-KERNEL-X64-LABEL: test24c:3416; LINUX-KERNEL-X64: mov{{l|q}} %gs:3417; LINUX-KERNEL-X64: callq __stack_chk_fail3418 3419; DARWIN-X64-LABEL: test24c:3420; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3421; DARWIN-X64: callq ___stack_chk_fail3422 3423; MSVC-I386-LABEL: test24c:3424; MSVC-I386: movl ___security_cookie,3425; MSVC-I386: calll @__security_check_cookie@43426  %n.addr = alloca i32, align 43427  %a = alloca ptr, align 83428  store i32 %n, ptr %n.addr, align 43429  %0 = load i32, ptr %n.addr, align 43430  %conv = sext i32 %0 to i643431  %1 = alloca i8, i64 %conv3432  store ptr %1, ptr %a, align 83433  ret void3434}3435 3436; test24d: Variable sized alloca3437;          sspreq attribute3438; Requires protector.3439; Function Attrs: sspreq 3440define void @test24d(i32 %n) #2 {3441entry:3442; LINUX-I386-LABEL: test24d:3443; LINUX-I386: mov{{l|q}} %gs:3444; LINUX-I386: calll __stack_chk_fail3445 3446; LINUX-X64-LABEL: test24d:3447; LINUX-X64: mov{{l|q}} %fs:3448; LINUX-X64: callq __stack_chk_fail3449 3450; LINUX-KERNEL-X64-LABEL: test24d:3451; LINUX-KERNEL-X64: mov{{l|q}} %gs:3452; LINUX-KERNEL-X64: callq __stack_chk_fail3453 3454; DARWIN-X64-LABEL: test24d:3455; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3456; DARWIN-X64: callq ___stack_chk_fail3457 3458; MSVC-I386-LABEL: test24d:3459; MSVC-I386: movl ___security_cookie,3460; MSVC-I386: calll @__security_check_cookie@43461  %n.addr = alloca i32, align 43462  %a = alloca ptr, align 83463  store i32 %n, ptr %n.addr, align 43464  %0 = load i32, ptr %n.addr, align 43465  %conv = sext i32 %0 to i643466  %1 = alloca i8, i64 %conv3467  store ptr %1, ptr %a, align 83468  ret void3469}3470 3471; test25a: array of [4 x i32]3472;          no ssp attribute3473; Requires no protector.3474define i32 @test25a() {3475entry:3476; LINUX-I386-LABEL: test25a:3477; LINUX-I386-NOT: calll __stack_chk_fail3478; LINUX-I386: .cfi_endproc3479 3480; LINUX-X64-LABEL: test25a:3481; LINUX-X64-NOT: callq __stack_chk_fail3482; LINUX-X64: .cfi_endproc3483 3484; LINUX-KERNEL-X64-LABEL: test25a:3485; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3486; LINUX-KERNEL-X64: .cfi_endproc3487 3488; DARWIN-X64-LABEL: test25a:3489; DARWIN-X64-NOT: callq ___stack_chk_fail3490; DARWIN-X64: .cfi_endproc3491 3492; MSVC-I386-LABEL: test25a:3493; MSVC-I386-NOT: calll @__security_check_cookie@43494; MSVC-I386: retl3495  %a = alloca [4 x i32], align 163496  %0 = load i32, ptr %a, align 43497  ret i32 %03498}3499 3500; test25b: array of [4 x i32]3501;          ssp attribute3502; Requires no protector, except for Darwin which _does_ require a protector.3503; Function Attrs: ssp3504define i32 @test25b() #0 {3505entry:3506; LINUX-I386-LABEL: test25b:3507; LINUX-I386-NOT: calll __stack_chk_fail3508; LINUX-I386: .cfi_endproc3509 3510; LINUX-X64-LABEL: test25b:3511; LINUX-X64-NOT: callq __stack_chk_fail3512; LINUX-X64: .cfi_endproc3513 3514; LINUX-KERNEL-X64-LABEL: test25b:3515; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3516; LINUX-KERNEL-X64: .cfi_endproc3517 3518; DARWIN-X64-LABEL: test25b:3519; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3520; DARWIN-X64: callq ___stack_chk_fail3521 3522; MSVC-I386-LABEL: test25b:3523; MSVC-I386-NOT: calll @__security_check_cookie@43524; MSVC-I386: retl3525 3526; MINGW-X64-LABEL: test25b:3527; MINGW-X64-NOT: callq __stack_chk_fail3528; MINGW-X64: .seh_endproc3529 3530  %a = alloca [4 x i32], align 163531  %0 = load i32, ptr %a, align 43532  ret i32 %03533}3534 3535; test25c: array of [4 x i32]3536;          sspstrong attribute3537; Requires protector.3538; Function Attrs: sspstrong 3539define i32 @test25c() #1 {3540entry:3541; LINUX-I386-LABEL: test25c:3542; LINUX-I386: mov{{l|q}} %gs:3543; LINUX-I386: calll __stack_chk_fail3544 3545; LINUX-X64-LABEL: test25c:3546; LINUX-X64: mov{{l|q}} %fs:3547; LINUX-X64: callq __stack_chk_fail3548 3549; LINUX-KERNEL-X64-LABEL: test25c:3550; LINUX-KERNEL-X64: mov{{l|q}} %gs:3551; LINUX-KERNEL-X64: callq __stack_chk_fail3552 3553; DARWIN-X64-LABEL: test25c:3554; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3555; DARWIN-X64: callq ___stack_chk_fail3556 3557; MSVC-I386-LABEL: test25c:3558; MSVC-I386: movl ___security_cookie,3559; MSVC-I386: calll @__security_check_cookie@43560  %a = alloca [4 x i32], align 163561  %0 = load i32, ptr %a, align 43562  ret i32 %03563}3564 3565; test25d: array of [4 x i32]3566;          sspreq attribute3567; Requires protector.3568; Function Attrs: sspreq 3569define i32 @test25d() #2 {3570entry:3571; LINUX-I386-LABEL: test25d:3572; LINUX-I386: mov{{l|q}} %gs:3573; LINUX-I386: calll __stack_chk_fail3574 3575; LINUX-X64-LABEL: test25d:3576; LINUX-X64: mov{{l|q}} %fs:3577; LINUX-X64: callq __stack_chk_fail3578 3579; LINUX-KERNEL-X64-LABEL: test25d:3580; LINUX-KERNEL-X64: mov{{l|q}} %gs:3581; LINUX-KERNEL-X64: callq __stack_chk_fail3582 3583; DARWIN-X64-LABEL: test25d:3584; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3585; DARWIN-X64: callq ___stack_chk_fail3586 3587; MSVC-I386-LABEL: test25d:3588; MSVC-I386: movl ___security_cookie,3589; MSVC-I386: calll @__security_check_cookie@43590  %a = alloca [4 x i32], align 163591  %0 = load i32, ptr %a, align 43592  ret i32 %03593}3594 3595; test26: Nested structure, no arrays, no address-of expressions.3596;         Verify that the resulting gep-of-gep does not incorrectly trigger3597;         a stack protector.3598;         ssptrong attribute3599; Requires no protector.3600; Function Attrs: sspstrong 3601define void @test26() #1 {3602entry:3603; LINUX-I386-LABEL: test26:3604; LINUX-I386-NOT: calll __stack_chk_fail3605; LINUX-I386: .cfi_endproc3606 3607; LINUX-X64-LABEL: test26:3608; LINUX-X64-NOT: callq __stack_chk_fail3609; LINUX-X64: .cfi_endproc3610 3611; LINUX-KERNEL-X64-LABEL: test26:3612; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3613; LINUX-KERNEL-X64: .cfi_endproc3614 3615; DARWIN-X64-LABEL: test26:3616; DARWIN-X64-NOT: callq ___stack_chk_fail3617; DARWIN-X64: .cfi_endproc3618 3619; MSVC-I386-LABEL: test26:3620; MSVC-I386-NOT: calll @__security_check_cookie@43621; MSVC-I386: retl3622  %c = alloca %struct.nest, align 43623  %b = getelementptr inbounds %struct.nest, ptr %c, i32 0, i32 13624  %0 = load i32, ptr %b, align 43625  %call = call i32 (ptr, ...) @printf(ptr @.str, i32 %0)3626  ret void3627}3628 3629; test27: Address-of a structure taken in a function with a loop where3630;         the alloca is an incoming value to a PHI node and a use of that PHI 3631;         node is also an incoming value.3632;         Verify that the address-of analysis does not get stuck in infinite3633;         recursion when chasing the alloca through the PHI nodes.3634; Requires protector.3635; Function Attrs: sspstrong 3636define i32 @test27(i32 %arg) #1 {3637bb:3638; LINUX-I386-LABEL: test27:3639; LINUX-I386: mov{{l|q}} %gs:3640; LINUX-I386: calll __stack_chk_fail3641 3642; LINUX-X64-LABEL: test27:3643; LINUX-X64: mov{{l|q}} %fs:3644; LINUX-X64: callq __stack_chk_fail3645 3646; LINUX-KERNEL-X64-LABEL: test27:3647; LINUX-KERNEL-X64: mov{{l|q}} %gs:3648; LINUX-KERNEL-X64: callq __stack_chk_fail3649 3650; DARWIN-X64-LABEL: test27:3651; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3652; DARWIN-X64: callq ___stack_chk_fail3653 3654; MSVC-I386-LABEL: test27:3655; MSVC-I386: movl ___security_cookie,3656; MSVC-I386: calll @__security_check_cookie@43657  %tmp = alloca ptr, align 83658  %tmp1 = call i32 (...) @dummy(ptr %tmp)3659  %tmp2 = load ptr, ptr %tmp, align 83660  %tmp3 = ptrtoint ptr %tmp2 to i643661  %tmp4 = trunc i64 %tmp3 to i323662  %tmp5 = icmp sgt i32 %tmp4, 03663  br i1 %tmp5, label %bb6, label %bb213664 3665bb6:                                              ; preds = %bb17, %bb3666  %tmp7 = phi ptr [ %tmp19, %bb17 ], [ %tmp2, %bb ]3667  %tmp8 = phi i64 [ %tmp20, %bb17 ], [ 1, %bb ]3668  %tmp9 = phi i32 [ %tmp14, %bb17 ], [ %tmp1, %bb ]3669  %tmp11 = load i8, ptr %tmp7, align 13670  %tmp12 = icmp eq i8 %tmp11, 13671  %tmp13 = add nsw i32 %tmp9, 83672  %tmp14 = select i1 %tmp12, i32 %tmp13, i32 %tmp93673  %tmp15 = trunc i64 %tmp8 to i323674  %tmp16 = icmp eq i32 %tmp15, %tmp43675  br i1 %tmp16, label %bb21, label %bb173676 3677bb17:                                             ; preds = %bb63678  %tmp18 = getelementptr inbounds ptr, ptr %tmp, i64 %tmp83679  %tmp19 = load ptr, ptr %tmp18, align 83680  %tmp20 = add i64 %tmp8, 13681  br label %bb63682 3683bb21:                                             ; preds = %bb6, %bb3684  %tmp22 = phi i32 [ %tmp1, %bb ], [ %tmp14, %bb6 ]3685  %tmp23 = call i32 (...) @dummy(i32 %tmp22)3686  ret i32 undef3687}3688 3689; test28a: An array of [32 x i8] and a requested ssp-buffer-size of 33.3690; Requires no protector.3691; Function Attrs: ssp stack-protector-buffer-size=333692define i32 @test28a() #3 {3693entry:3694; LINUX-I386-LABEL: test28a:3695; LINUX-I386-NOT: calll __stack_chk_fail3696; LINUX-I386: .cfi_endproc3697 3698; LINUX-X64-LABEL: test28a:3699; LINUX-X64-NOT: callq __stack_chk_fail3700; LINUX-X64: .cfi_endproc3701 3702; LINUX-KERNEL-X64-LABEL: test28a:3703; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3704; LINUX-KERNEL-X64: .cfi_endproc3705 3706; DARWIN-X64-LABEL: test28a:3707; DARWIN-X64-NOT: callq ___stack_chk_fail3708; DARWIN-X64: .cfi_endproc3709 3710; MSVC-I386-LABEL: test28a:3711; MSVC-I386-NOT: calll @__security_check_cookie@43712; MSVC-I386: retl3713  %test = alloca [32 x i8], align 163714  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %test)3715  ret i32 %call3716}3717 3718; test28b: An array of [33 x i8] and a requested ssp-buffer-size of 33.3719; Requires protector.3720; Function Attrs: ssp stack-protector-buffer-size=333721define i32 @test28b() #3 {3722entry:3723; LINUX-I386-LABEL: test28b:3724; LINUX-I386: mov{{l|q}} %gs:3725; LINUX-I386: calll __stack_chk_fail3726 3727; LINUX-X64-LABEL: test28b:3728; LINUX-X64: mov{{l|q}} %fs:3729; LINUX-X64: callq __stack_chk_fail3730 3731; LINUX-KERNEL-X64-LABEL: test28b:3732; LINUX-KERNEL-X64: mov{{l|q}} %gs:3733; LINUX-KERNEL-X64: callq __stack_chk_fail3734 3735; DARWIN-X64-LABEL: test28b:3736; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3737; DARWIN-X64: callq ___stack_chk_fail3738 3739; MSVC-I386-LABEL: test28b:3740; MSVC-I386: movl ___security_cookie,3741; MSVC-I386: calll @__security_check_cookie@43742  %test = alloca [33 x i8], align 163743  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %test)3744  ret i32 %call3745}3746 3747; test29a: An array of [4 x i8] and a requested ssp-buffer-size of 5.3748; Requires no protector.3749; Function Attrs: ssp stack-protector-buffer-size=53750define i32 @test29a() #4 {3751entry:3752; LINUX-I386-LABEL: test29a:3753; LINUX-I386-NOT: calll __stack_chk_fail3754; LINUX-I386: .cfi_endproc3755 3756; LINUX-X64-LABEL: test29a:3757; LINUX-X64-NOT: callq __stack_chk_fail3758; LINUX-X64: .cfi_endproc3759 3760; LINUX-KERNEL-X64-LABEL: test29a:3761; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3762; LINUX-KERNEL-X64: .cfi_endproc3763 3764; DARWIN-X64-LABEL: test29a:3765; DARWIN-X64-NOT: callq ___stack_chk_fail3766; DARWIN-X64: .cfi_endproc3767 3768; MSVC-I386-LABEL: test29a:3769; MSVC-I386-NOT: calll @__security_check_cookie@43770; MSVC-I386: retl3771  %test = alloca [4 x i8], align 13772  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %test)3773  ret i32 %call3774}3775 3776; test29b: An array of [5 x i8] and a requested ssp-buffer-size of 5.3777; Requires protector.3778; Function Attrs: ssp stack-protector-buffer-size=53779define i32 @test29b() #4 {3780entry:3781; LINUX-I386-LABEL: test29b:3782; LINUX-I386: mov{{l|q}} %gs:3783; LINUX-I386: calll __stack_chk_fail3784 3785; LINUX-X64-LABEL: test29b:3786; LINUX-X64: mov{{l|q}} %fs:3787; LINUX-X64: callq __stack_chk_fail3788 3789; LINUX-KERNEL-X64-LABEL: test29b:3790; LINUX-KERNEL-X64: mov{{l|q}} %gs:3791; LINUX-KERNEL-X64: callq __stack_chk_fail3792 3793; DARWIN-X64-LABEL: test29b:3794; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3795; DARWIN-X64: callq ___stack_chk_fail3796 3797; MSVC-I386-LABEL: test29b:3798; MSVC-I386: movl ___security_cookie,3799; MSVC-I386: calll @__security_check_cookie@43800  %test = alloca [5 x i8], align 13801  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %test)3802  ret i32 %call3803}3804 3805; test30a: An structure containing an i32 and an array of [5 x i8].3806;          Requested ssp-buffer-size of 6.3807; Requires no protector.3808; Function Attrs: ssp stack-protector-buffer-size=63809define i32 @test30a() #5 {3810entry:3811; LINUX-I386-LABEL: test30a:3812; LINUX-I386-NOT: calll __stack_chk_fail3813; LINUX-I386: .cfi_endproc3814 3815; LINUX-X64-LABEL: test30a:3816; LINUX-X64-NOT: callq __stack_chk_fail3817; LINUX-X64: .cfi_endproc3818 3819; LINUX-KERNEL-X64-LABEL: test30a:3820; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3821; LINUX-KERNEL-X64: .cfi_endproc3822 3823; DARWIN-X64-LABEL: test30a:3824; DARWIN-X64-NOT: callq ___stack_chk_fail3825; DARWIN-X64: .cfi_endproc3826 3827; MSVC-I386-LABEL: test30a:3828; MSVC-I386-NOT: calll @__security_check_cookie@43829; MSVC-I386: retl3830  %test = alloca %struct.small_char, align 43831  %test.coerce = alloca { i64, i8 }3832  call void @llvm.memcpy.p0.p0.i64(ptr %test.coerce, ptr %test, i64 12, i1 false)3833  %0 = getelementptr { i64, i8 }, ptr %test.coerce, i32 0, i32 03834  %1 = load i64, ptr %0, align 13835  %2 = getelementptr { i64, i8 }, ptr %test.coerce, i32 0, i32 13836  %3 = load i8, ptr %2, align 13837  %call = call i32 (ptr, ...) @printf(ptr @.str, i64 %1, i8 %3)3838  ret i32 %call3839}3840 3841; test30b: An structure containing an i32 and an array of [5 x i8].3842;          Requested ssp-buffer-size of 5.3843; Requires protector.3844; Function Attrs: ssp stack-protector-buffer-size=53845define i32 @test30b() #4 {3846entry:3847; LINUX-I386-LABEL: test30b:3848; LINUX-I386: mov{{l|q}} %gs:3849; LINUX-I386: calll __stack_chk_fail3850 3851; LINUX-X64-LABEL: test30b:3852; LINUX-X64: mov{{l|q}} %fs:3853; LINUX-X64: callq __stack_chk_fail3854 3855; LINUX-KERNEL-X64-LABEL: test30b:3856; LINUX-KERNEL-X64: mov{{l|q}} %gs:3857; LINUX-KERNEL-X64: callq __stack_chk_fail3858 3859; DARWIN-X64-LABEL: test30b:3860; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3861; DARWIN-X64: callq ___stack_chk_fail3862 3863; MSVC-I386-LABEL: test30b:3864; MSVC-I386: movl ___security_cookie,3865; MSVC-I386: calll @__security_check_cookie@43866  %test = alloca %struct.small_char, align 43867  %test.coerce = alloca { i64, i8 }3868  call void @llvm.memcpy.p0.p0.i64(ptr %test.coerce, ptr %test, i64 12, i1 false)3869  %0 = getelementptr { i64, i8 }, ptr %test.coerce, i32 0, i32 03870  %1 = load i64, ptr %0, align 13871  %2 = getelementptr { i64, i8 }, ptr %test.coerce, i32 0, i32 13872  %3 = load i8, ptr %2, align 13873  %call = call i32 (ptr, ...) @printf(ptr @.str, i64 %1, i8 %3)3874  ret i32 %call3875}3876 3877; test31a: An alloca of size 5.3878;          Requested ssp-buffer-size of 6.3879; Requires no protector.3880; Function Attrs: ssp stack-protector-buffer-size=63881define i32 @test31a() #5 {3882entry:3883; LINUX-I386-LABEL: test31a:3884; LINUX-I386-NOT: calll __stack_chk_fail3885; LINUX-I386: .cfi_endproc3886 3887; LINUX-X64-LABEL: test31a:3888; LINUX-X64-NOT: callq __stack_chk_fail3889; LINUX-X64: .cfi_endproc3890 3891; LINUX-KERNEL-X64-LABEL: test31a:3892; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail3893; LINUX-KERNEL-X64: .cfi_endproc3894 3895; DARWIN-X64-LABEL: test31a:3896; DARWIN-X64-NOT: callq ___stack_chk_fail3897; DARWIN-X64: .cfi_endproc3898 3899; MSVC-I386-LABEL: test31a:3900; MSVC-I386-NOT: calll @__security_check_cookie@43901; MSVC-I386: retl3902  %test = alloca ptr, align 83903  %0 = alloca i8, i64 43904  store ptr %0, ptr %test, align 83905  %1 = load ptr, ptr %test, align 83906  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %1)3907  ret i32 %call3908}3909 3910; test31b: An alloca of size 5.3911;          Requested ssp-buffer-size of 5.3912; Requires protector.3913define i32 @test31b() #4 {3914entry:3915; LINUX-I386-LABEL: test31b:3916; LINUX-I386: mov{{l|q}} %gs:3917; LINUX-I386: calll __stack_chk_fail3918 3919; LINUX-X64-LABEL: test31b:3920; LINUX-X64: mov{{l|q}} %fs:3921; LINUX-X64: callq __stack_chk_fail3922 3923; LINUX-KERNEL-X64-LABEL: test31b:3924; LINUX-KERNEL-X64: mov{{l|q}} %gs:3925; LINUX-KERNEL-X64: callq __stack_chk_fail3926 3927; DARWIN-X64-LABEL: test31b:3928; DARWIN-X64: mov{{l|q}} ___stack_chk_guard3929; DARWIN-X64: callq ___stack_chk_fail3930 3931; MSVC-I386-LABEL: test31b:3932; MSVC-I386: movl ___security_cookie,3933; MSVC-I386: calll @__security_check_cookie@43934  %test = alloca ptr, align 83935  %0 = alloca i8, i64 53936  store ptr %0, ptr %test, align 83937  %1 = load ptr, ptr %test, align 83938  %call = call i32 (ptr, ...) @printf(ptr @.str, ptr %1)3939  ret i32 %call3940}3941 3942define void @__stack_chk_fail() #1 !dbg !6 {3943entry:3944  ret void3945}3946 3947define void @test32() #1 !dbg !7 {3948entry:3949; LINUX-I386-LABEL: test32:3950; LINUX-I386:       .loc 1 4 2 prologue_end3951; LINUX-I386:       .loc 1 0 03952; LINUX-I386-NEXT:  calll __stack_chk_fail3953 3954; LINUX-X64-LABEL: test32:3955; LINUX-X64:       .loc 1 4 2 prologue_end3956; LINUX-X64:       .loc 1 0 03957; LINUX-X64-NEXT:  callq __stack_chk_fail3958 3959; LINUX-KERNEL-X64-LABEL: test32:3960; LINUX-KERNEL-X64:       .loc 1 4 2 prologue_end3961; LINUX-KERNEL-X64:       .loc 1 0 03962; LINUX-KERNEL-X64-NEXT:  callq __stack_chk_fail3963 3964; OPENBSD-AMD64-LABEL: test32:3965; OPENBSD-AMD64:       .loc 1 4 2 prologue_end3966; OPENBSD-AMD64:       .loc 1 0 03967; OPENBSD-AMD64-NEXT:  movl3968; OPENBSD-AMD64-NEXT:  callq __stack_smash_handler3969  %0 = alloca [5 x i8], align 13970  ret void, !dbg !93971}3972 3973define i32 @IgnoreIntrinsicTest() #1 {3974; IGNORE_INTRIN: IgnoreIntrinsicTest:3975  %1 = alloca i32, align 43976  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1)3977  store volatile i32 1, ptr %1, align 43978  %2 = load volatile i32, ptr %1, align 43979  %3 = mul nsw i32 %2, 423980  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1)3981  ret i32 %33982; IGNORE_INTRIN-NOT: callq __stack_chk_fail3983; IGNORE_INTRIN:     .cfi_endproc3984}3985 3986declare double @testi_aux()3987declare ptr @strcpy(ptr, ptr)3988declare i32 @printf(ptr, ...)3989declare void @funcall(ptr)3990declare void @funcall2(ptr)3991declare void @funfloat(ptr)3992declare void @funfloat2(ptr)3993declare void @_Z3exceptPi(ptr)3994declare i32 @__gxx_personality_v0(...)3995declare ptr @getp()3996declare i32 @dummy(...)3997declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture readonly, i64, i1)3998declare void @llvm.lifetime.start.p0(i64, ptr nocapture)3999declare void @llvm.lifetime.end.p0(i64, ptr nocapture)4000 4001attributes #0 = { ssp }4002attributes #1 = { sspstrong }4003attributes #2 = { sspreq }4004attributes #3 = { ssp "stack-protector-buffer-size"="33" }4005attributes #4 = { ssp "stack-protector-buffer-size"="5" }4006attributes #5 = { ssp "stack-protector-buffer-size"="6" }4007 4008!llvm.dbg.cu = !{!0}4009!llvm.module.flags = !{!3, !4}4010!llvm.ident = !{!5}4011 4012!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, emissionKind: FullDebug)4013!1 = !DIFile(filename: "test.c", directory: "/tmp")4014!2 = !{}4015!3 = !{i32 2, !"Dwarf Version", i32 4}4016!4 = !{i32 2, !"Debug Info Version", i32 3}4017!5 = !{!"clang version x.y.z"}4018!6 = distinct !DISubprogram(name: "__stack_chk_fail", scope: !1, type: !8, unit: !0)4019!7 = distinct !DISubprogram(name: "test32", scope: !1, type: !8, unit: !0)4020!8 = !DISubroutineType(types: !2)4021!9 = !DILocation(line: 4, column: 2, scope: !7)4022