1; RUN: llc < %s -filetype=obj | llvm-readobj --codeview - | FileCheck %s 2 3; Generated by clang++ -S -c -std=c++11 -emit-llvm -g from the following C++11 source: 4;class foo { 5;public: 6;[[noreturn]] void foo_member(){throw 1;} 7;}; 8; 9;[[ noreturn ]] void f() { 10; throw 1; 11;} 12; 13;void func(){ 14; foo object{}; 15; object.foo_member(); 16;} 17 18; CHECK-LABEL: FunctionType: f (0x1002) 19; CHECK-NEXT: CodeOffset: ?f@@YAXXZ+0x0 20; CHECK-NEXT: Segment: 0x0 21; CHECK-NEXT: Flags [ (0xC8) 22; CHECK-NEXT: HasOptimizedDebugInfo (0x80) 23; CHECK-NEXT: IsNoInline (0x40) 24; CHECK-NEXT: IsNoReturn (0x8) 25; CHECK-NEXT: ] 26; CHECK-NEXT: DisplayName: f 27; CHECK-NEXT: LinkageName: ?f@@YAXXZ 28; CHECK-LABEL: FunctionType: foo_member (0x100B) 29; CHECK-NEXT: CodeOffset: ?foo_member@foo@@QEAAXXZ+0x0 30; CHECK-NEXT: Segment: 0x0 31; CHECK-NEXT: Flags [ (0xC8) 32; CHECK-NEXT: HasOptimizedDebugInfo (0x80) 33; CHECK-NEXT: IsNoInline (0x40) 34; CHECK-NEXT: IsNoReturn (0x8) 35; CHECK-NEXT: ] 36; CHECK-NEXT: DisplayName: foo::foo_member 37; CHECK-NEXT: LinkageName: ?foo_member@foo@@QEAAXXZ 38 39 40; ModuleID = 'noreturn.cpp' 41source_filename = "noreturn.cpp" 42target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 43target triple = "x86_64-pc-windows-msvc19.35.32216" 44 45%rtti.TypeDescriptor2 = type { ptr, ptr, [3 x i8] } 46%eh.CatchableType = type { i32, i32, i32, i32, i32, i32, i32 } 47%eh.CatchableTypeArray.1 = type { i32, [1 x i32] } 48%eh.ThrowInfo = type { i32, i32, i32, i32 } 49%class.foo = type { i8 } 50 51$"?foo_member@foo@@QEAAXXZ" = comdat any 52 53$"??_R0H@8" = comdat any 54 55$"_CT??_R0H@84" = comdat any 56 57$_CTA1H = comdat any 58 59$_TI1H = comdat any 60 61@"??_7type_info@@6B@" = external constant ptr 62@"??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { ptr @"??_7type_info@@6B@", ptr null, [3 x i8] c".H\00" }, comdat 63@__ImageBase = external dso_local constant i8 64@"_CT??_R0H@84" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R0H@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32), i32 0, i32 -1, i32 0, i32 4, i32 0 }, section ".xdata", comdat 65@_CTA1H = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.1 { i32 1, [1 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"_CT??_R0H@84" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32)] }, section ".xdata", comdat 66@_TI1H = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @_CTA1H to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32) }, section ".xdata", comdat 67@"__const.?func@@YAXXZ.object" = private unnamed_addr constant %class.foo undef, align 1 68 69; Function Attrs: mustprogress noinline noreturn optnone uwtable 70define dso_local void @"?f@@YAXXZ"() #0 !dbg !8 { 71 %1 = alloca i32, align 4 72 store i32 1, ptr %1, align 4, !dbg !13 73 call void @_CxxThrowException(ptr %1, ptr @_TI1H) #4, !dbg !13 74 unreachable, !dbg !13 75} 76 77declare dso_local void @_CxxThrowException(ptr, ptr) 78 79; Function Attrs: mustprogress noinline optnone uwtable 80define dso_local void @"?func@@YAXXZ"() #1 !dbg !14 { 81 %1 = alloca %class.foo, align 1 82 call void @llvm.dbg.declare(metadata ptr %1, metadata !15, metadata !DIExpression()), !dbg !22 83 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %1, ptr align 1 @"__const.?func@@YAXXZ.object", i64 1, i1 false), !dbg !22 84 call void @"?foo_member@foo@@QEAAXXZ"(ptr noundef nonnull align 1 dereferenceable(1) %1) #4, !dbg !23 85 unreachable, !dbg !23 86} 87 88; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn 89declare void @llvm.dbg.declare(metadata, metadata, metadata) #2 90 91; Function Attrs: argmemonly nocallback nofree nounwind willreturn 92declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3 93 94; Function Attrs: mustprogress noinline noreturn optnone uwtable 95define linkonce_odr dso_local void @"?foo_member@foo@@QEAAXXZ"(ptr noundef nonnull align 1 dereferenceable(1) %0) #0 comdat align 2 !dbg !24 { 96 %2 = alloca ptr, align 8 97 %3 = alloca i32, align 4 98 store ptr %0, ptr %2, align 8 99 call void @llvm.dbg.declare(metadata ptr %2, metadata !25, metadata !DIExpression()), !dbg !27 100 %4 = load ptr, ptr %2, align 8 101 store i32 1, ptr %3, align 4, !dbg !28 102 call void @_CxxThrowException(ptr %3, ptr @_TI1H) #4, !dbg !28 103 unreachable, !dbg !28 104} 105 106attributes #0 = { mustprogress noinline noreturn optnone uwtable "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } 107attributes #1 = { mustprogress noinline optnone uwtable "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } 108attributes #2 = { nocallback nofree nosync nounwind readnone speculatable willreturn } 109attributes #3 = { argmemonly nocallback nofree nounwind willreturn } 110attributes #4 = { noreturn } 111 112!llvm.dbg.cu = !{!0} 113!llvm.module.flags = !{!2, !3, !4, !5, !6} 114!llvm.ident = !{!7} 115 116!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_11, file: !1, producer: "clang version 15.0.1", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) 117!1 = !DIFile(filename: "noreturn.cpp", directory: "C:\\llvm", checksumkind: CSK_MD5, checksum: "4431274b41f9156c1861249cc2d5fbc6") 118!2 = !{i32 2, !"CodeView", i32 1} 119!3 = !{i32 2, !"Debug Info Version", i32 3} 120!4 = !{i32 1, !"wchar_size", i32 2} 121!5 = !{i32 7, !"PIC Level", i32 2} 122!6 = !{i32 7, !"uwtable", i32 2} 123!7 = !{!"clang version 15.0.1"} 124!8 = distinct !DISubprogram(name: "f", linkageName: "?f@@YAXXZ", scope: !9, file: !9, line: 6, type: !10, scopeLine: 6, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !12) 125!9 = !DIFile(filename: "noreturn.cpp", directory: "", checksumkind: CSK_MD5, checksum: "4431274b41f9156c1861249cc2d5fbc6") 126!10 = !DISubroutineType(types: !11) 127!11 = !{null} 128!12 = !{} 129!13 = !DILocation(line: 7, scope: !8) 130!14 = distinct !DISubprogram(name: "func", linkageName: "?func@@YAXXZ", scope: !9, file: !9, line: 10, type: !10, scopeLine: 10, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !12) 131!15 = !DILocalVariable(name: "object", scope: !14, file: !9, line: 11, type: !16) 132!16 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "foo", file: !9, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !17, identifier: ".?AVfoo@@") 133!17 = !{!18} 134!18 = !DISubprogram(name: "foo_member", linkageName: "?foo_member@foo@@QEAAXXZ", scope: !16, file: !9, line: 3, type: !19, scopeLine: 3, flags: DIFlagPublic | DIFlagPrototyped | DIFlagNoReturn, spFlags: 0) 135!19 = !DISubroutineType(types: !20) 136!20 = !{null, !21} 137!21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer) 138!22 = !DILocation(line: 11, scope: !14) 139!23 = !DILocation(line: 12, scope: !14) 140!24 = distinct !DISubprogram(name: "foo_member", linkageName: "?foo_member@foo@@QEAAXXZ", scope: !16, file: !9, line: 3, type: !19, scopeLine: 3, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: DISPFlagDefinition, unit: !0, declaration: !18, retainedNodes: !12) 141!25 = !DILocalVariable(name: "this", arg: 1, scope: !24, type: !26, flags: DIFlagArtificial | DIFlagObjectPointer) 142!26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 64) 143!27 = !DILocation(line: 0, scope: !24) 144!28 = !DILocation(line: 3, scope: !24) 145