diff options
Diffstat (limited to 'llvm/test/Transforms/SafeStack/debug-loc.ll')
-rw-r--r-- | llvm/test/Transforms/SafeStack/debug-loc.ll | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/llvm/test/Transforms/SafeStack/debug-loc.ll b/llvm/test/Transforms/SafeStack/debug-loc.ll index 57d565f8cfd..e72d0e9d2ff 100644 --- a/llvm/test/Transforms/SafeStack/debug-loc.ll +++ b/llvm/test/Transforms/SafeStack/debug-loc.ll @@ -1,83 +1,83 @@ ; RUN: opt -safe-stack -S -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck %s ; Test debug location for the local variables moved onto the unsafe stack. -; CHECK: define void @f -; CHECK: %[[USP:.*]] = load i8*, i8** @__safestack_unsafe_stack_ptr -; dbg.declare for %buf is gone; replaced with dbg.declare based off the unsafe stack pointer -; CHECK-NOT: @llvm.dbg.declare.*%buf -; CHECK: call void @llvm.dbg.declare(metadata i8* %[[USP]], metadata ![[VAR:.*]], metadata ![[EXPR:.*]]) +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" -; dbg.declare appears before the first use of %buf -; CHECK: getelementptr{{.*}}%buf -; CHECK: call{{.*}}@Capture -; CHECK: ret void +%struct.S = type { [100 x i8] } -; dbg.declare describes "buf"... -; CHECK: ![[VAR]] = !DILocalVariable(name: "buf" +; Function Attrs: safestack uwtable +define void @f(%struct.S* byval align 8 %zzz) #0 !dbg !12 { +; CHECK: define void @f -; ... as an offset from the unsafe stack pointer -; CHECK: ![[EXPR]] = !DIExpression(DW_OP_deref, DW_OP_minus, 400) +entry: +; CHECK: %[[USP:.*]] = load i8*, i8** @__safestack_unsafe_stack_ptr + %xxx = alloca %struct.S, align 1 + call void @llvm.dbg.declare(metadata %struct.S* %zzz, metadata !18, metadata !19), !dbg !20 + call void @llvm.dbg.declare(metadata %struct.S* %xxx, metadata !21, metadata !19), !dbg !22 -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +; dbg.declare for %zzz and %xxx are gone; replaced with dbg.declare based off the unsafe stack pointer +; CHECK-NOT: call void @llvm.dbg.declare +; CHECK: call void @llvm.dbg.declare(metadata i8* %[[USP]], metadata ![[VAR_ARG:.*]], metadata ![[EXPR_ARG:.*]]) +; CHECK-NOT: call void @llvm.dbg.declare +; CHECK: call void @llvm.dbg.declare(metadata i8* %[[USP]], metadata ![[VAR_LOCAL:.*]], metadata ![[EXPR_LOCAL:.*]]) +; CHECK-NOT: call void @llvm.dbg.declare -; Function Attrs: safestack uwtable -define void @f() #0 !dbg !4 { -entry: - %buf = alloca [100 x i32], align 16 - %0 = bitcast [100 x i32]* %buf to i8*, !dbg !16 - call void @llvm.lifetime.start(i64 400, i8* %0) #4, !dbg !16 - tail call void @llvm.dbg.declare(metadata [100 x i32]* %buf, metadata !8, metadata !17), !dbg !18 + call void @Capture(%struct.S* %zzz), !dbg !23 + call void @Capture(%struct.S* %xxx), !dbg !24 +; dbg.declare appears before the first use +; CHECK: call void @Capture +; CHECK: call void @Capture - %arraydecay = getelementptr inbounds [100 x i32], [100 x i32]* %buf, i64 0, i64 0, !dbg !19 - call void @Capture(i32* %arraydecay), !dbg !20 - call void @llvm.lifetime.end(i64 400, i8* %0) #4, !dbg !21 - ret void, !dbg !21 + ret void, !dbg !25 } -; Function Attrs: nounwind argmemonly -declare void @llvm.lifetime.start(i64, i8* nocapture) #1 +; CHECK-DAG: ![[VAR_ARG]] = !DILocalVariable(name: "zzz" +; 100 aligned up to 8 +; CHECK-DAG: ![[EXPR_ARG]] = !DIExpression(DW_OP_deref, DW_OP_minus, 104 -; Function Attrs: nounwind readnone -declare void @llvm.dbg.declare(metadata, metadata, metadata) #2 +; CHECK-DAG: ![[VAR_LOCAL]] = !DILocalVariable(name: "xxx" +; CHECK-DAG: ![[EXPR_LOCAL]] = !DIExpression(DW_OP_deref, DW_OP_minus, 208 -declare void @Capture(i32*) #3 +; Function Attrs: nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 -; Function Attrs: nounwind argmemonly -declare void @llvm.lifetime.end(i64, i8* nocapture) #1 +declare void @Capture(%struct.S*) #2 -attributes #0 = { safestack uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #1 = { nounwind argmemonly } -attributes #2 = { nounwind readnone } -attributes #3 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #4 = { nounwind } +attributes #0 = { safestack uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { nounwind readnone } +attributes #2 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!13, !14} -!llvm.ident = !{!15} +!llvm.module.flags = !{!15, !16} +!llvm.ident = !{!17} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 248518) (llvm/trunk 248512)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) -!1 = !DIFile(filename: "1.cc", directory: "/tmp") +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 254019) (llvm/trunk 254036)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !11) +!1 = !DIFile(filename: "../llvm/2.cc", directory: "/code/build-llvm") !2 = !{} !3 = !{!4} -!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, variables: !7) -!5 = !DISubroutineType(types: !6) -!6 = !{null} -!7 = !{!8} -!8 = !DILocalVariable(name: "buf", scope: !4, file: !1, line: 5, type: !9) -!9 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, size: 3200, align: 32, elements: !11) -!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !1, line: 4, size: 800, align: 8, elements: !5, identifier: "_ZTS1S") +!5 = !{!6} +!6 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !"_ZTS1S", file: !1, line: 5, baseType: !7, size: 800, align: 8) +!7 = !DICompositeType(tag: DW_TAG_array_type, baseType: !8, size: 800, align: 8, elements: !9) +!8 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) +!9 = !{!10} +!10 = !DISubrange(count: 100) !11 = !{!12} -!12 = !DISubrange(count: 100) -!13 = !{i32 2, !"Dwarf Version", i32 4} -!14 = !{i32 2, !"Debug Info Version", i32 3} -!15 = !{!"clang version 3.8.0 (trunk 248518) (llvm/trunk 248512)"} -!16 = !DILocation(line: 5, column: 3, scope: !4) -!17 = !DIExpression() -!18 = !DILocation(line: 5, column: 7, scope: !4) -!19 = !DILocation(line: 6, column: 11, scope: !4) -!20 = !DILocation(line: 6, column: 3, scope: !4) -!21 = !DILocation(line: 7, column: 1, scope: !4) +!12 = distinct !DISubprogram(name: "f", linkageName: "_Z1f1S", scope: !1, file: !1, line: 10, type: !13, isLocal: false, isDefinition: true, scopeLine: 10, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!13 = !DISubroutineType(types: !14) +!14 = !{null, !"_ZTS1S"} +!15 = !{i32 2, !"Dwarf Version", i32 4} +!16 = !{i32 2, !"Debug Info Version", i32 3} +!17 = !{!"clang version 3.8.0 (trunk 254019) (llvm/trunk 254036)"} +!18 = !DILocalVariable(name: "zzz", arg: 1, scope: !12, file: !1, line: 10, type: !"_ZTS1S") +!19 = !DIExpression() +!20 = !DILocation(line: 10, column: 10, scope: !12) +!21 = !DILocalVariable(name: "xxx", scope: !12, file: !1, line: 11, type: !"_ZTS1S") +!22 = !DILocation(line: 11, column: 5, scope: !12) +!23 = !DILocation(line: 12, column: 3, scope: !12) +!24 = !DILocation(line: 13, column: 3, scope: !12) +!25 = !DILocation(line: 14, column: 1, scope: !12) |