1; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc | FileCheck %s 2 3; Check how constant function pointer casts are handled. 4 5declare void @unprototyped(...) 6 7define i32 @call_unprototyped() { 8 call void bitcast (void (...)* @unprototyped to void ()*)() 9 ret i32 0 10} 11 12; CHECK-LABEL: call_unprototyped: 13; CHECK: callq unprototyped 14; CHECK: xorl %eax, %eax 15; CHECK: retq 16 17declare void @escaped_cast() 18 19define i32 @escape_it_with_cast(i8** %p) { 20 store i8* bitcast (void ()* @escaped_cast to i8*), i8** %p 21 ret i32 0 22} 23 24declare void @dead_constant() 25 26!llvm.module.flags = !{!0} 27!0 = !{i32 2, !"cfguard", i32 1} 28 29!dead_constant_root = !{!1} 30!1 = !DITemplateValueParameter(name: "dead_constant", value: i8* bitcast (void ()* @dead_constant to i8*)) 31 32; CHECK-LABEL: .section .gfids$y,"dr" 33; CHECK-NEXT: .symidx escaped_cast 34; CHECK-NOT: .symidx 35 36