Further reduce testcase

llvm-svn: 297176
This commit is contained in:
Adrian Prantl 2017-03-07 18:26:36 +00:00
parent 124472ce6f
commit d4ac2a2b43
1 changed files with 34 additions and 46 deletions

View File

@ -1,71 +1,59 @@
; RUN: llvm-as < %s -o %t ; RUN: llvm-as < %s -o %t
; RUN: llvm-dis < %t -o - | FileCheck %s ; RUN: llvm-dis < %t -o - | FileCheck %s
; Testcase from PR32042. ; Created at -O1 from:
; Created at -02 from: ; int sink(int);
; bool alpha(int); ; __attribute__((always_inline)) int f(int i) { return sink(i); }
; bool bravo(int charlie) { return (alpha(charlie)); } ; __attribute__((always_inline)) int g(int j) { return sink(j); }
; static int delta(int charlie) { return charlie + 1; } ; __attribute__((nodebug)) int nodebug(int k) { return f(k)+g(k); }
; __attribute__((nodebug)) bool echo(int foxtrot) {
; return bravo(delta(foxtrot));
; }
source_filename = "t.c" source_filename = "t.c"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0" target triple = "x86_64-apple-macosx10.12.0"
define zeroext i1 @_Z5bravoi(i32 %charlie) local_unnamed_addr #0 !dbg !7 { declare i32 @sink(i32) local_unnamed_addr
entry:
tail call void @llvm.dbg.value(metadata i32 %charlie, i64 0, metadata !13, metadata !14), !dbg !15
%call = tail call zeroext i1 @_Z5alphai(i32 %charlie), !dbg !16
ret i1 %call, !dbg !17
}
declare zeroext i1 @_Z5alphai(i32) local_unnamed_addr define i32 @nodebug(i32 %k) local_unnamed_addr #2 {
define zeroext i1 @_Z4echoi(i32 %foxtrot) local_unnamed_addr #0 {
entry: entry:
; This should not set off the FnArg Verifier. The two variables are in differrent scopes. ; This should not set off the FnArg Verifier. The two variables are in differrent scopes.
tail call void @llvm.dbg.value(metadata i32 %foxtrot, i64 0, metadata !18, metadata !14), !dbg !23 tail call void @llvm.dbg.value(metadata i32 %k, i64 0, metadata !12, metadata !13) #4, !dbg !14
%add.i = add nsw i32 %foxtrot, 1, !dbg !24 %call.k = tail call i32 @sink(i32 %k) #4, !dbg !15
tail call void @llvm.dbg.value(metadata i32 %add.i, i64 0, metadata !13, metadata !14), !dbg !15 tail call void @llvm.dbg.value(metadata i32 %k, i64 0, metadata !19, metadata !13) #4, !dbg !20
%call.i = tail call zeroext i1 @_Z5alphai(i32 %add.i), !dbg !16 %call.k3 = tail call i32 @sink(i32 %k) #4, !dbg !21
ret i1 %call.i %add = add nsw i32 %call.k3, %call.k
ret i32 %add
} }
; Function Attrs: nounwind readnone ; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #3
attributes #0 = { ssp uwtable } attributes #2 = { nounwind ssp uwtable }
attributes #2 = { nounwind readnone } attributes #3 = { nounwind readnone }
!llvm.dbg.cu = !{!0} !llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5} !llvm.module.flags = !{!3, !4, !5}
!llvm.ident = !{!6} !llvm.ident = !{!6}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 297153) (llvm/trunk 297155)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 5.0.0 (trunk 297153) (llvm/trunk 297155)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.c", directory: "/tmp") !1 = !DIFile(filename: "t.c", directory: "/tmp")
!2 = !{} !2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4} !3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3} !4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"PIC Level", i32 2} !5 = !{i32 1, !"PIC Level", i32 2}
!6 = !{!"clang version 5.0.0 (trunk 297153) (llvm/trunk 297155)"} !6 = !{!"clang version 5.0.0 (trunk 297153) (llvm/trunk 297155)"}
!7 = distinct !DISubprogram(name: "bravo", linkageName: "_Z5bravoi", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !12) !7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !11)
!8 = !DISubroutineType(types: !9) !8 = !DISubroutineType(types: !9)
!9 = !{!10, !11} !9 = !{!10, !10}
!10 = !DIBasicType(name: "bool", size: 8, encoding: DW_ATE_boolean) !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) !11 = !{!12}
!12 = !{!13} ; CHECK: !DILocalVariable(name: "i", arg: 1
; CHECK: !DILocalVariable(name: "charlie", arg: 1 !12 = !DILocalVariable(name: "i", arg: 1, scope: !7, file: !1, line: 2, type: !10)
!13 = !DILocalVariable(name: "charlie", arg: 1, scope: !7, file: !1, line: 2, type: !11) !13 = !DIExpression()
!14 = !DIExpression() !14 = !DILocation(line: 2, column: 42, scope: !7)
!15 = !DILocation(line: 2, column: 16, scope: !7) !15 = !DILocation(line: 2, column: 54, scope: !7)
!16 = !DILocation(line: 2, column: 35, scope: !7) !16 = !DILocation(line: 2, column: 47, scope: !7)
!17 = !DILocation(line: 2, column: 27, scope: !7) !17 = distinct !DISubprogram(name: "g", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !18)
; CHECK: !DILocalVariable(name: "charlie", arg: 1 !18 = !{!19}
!18 = !DILocalVariable(name: "charlie", arg: 1, scope: !19, file: !1, line: 3, type: !11) ; CHECK: !DILocalVariable(name: "j", arg: 1
!19 = distinct !DISubprogram(name: "delta", linkageName: "_ZL5deltai", scope: !1, file: !1, line: 3, type: !20, isLocal: true, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !22) !19 = !DILocalVariable(name: "j", arg: 1, scope: !17, file: !1, line: 3, type: !10)
!20 = !DISubroutineType(types: !21) !20 = !DILocation(line: 3, column: 42, scope: !17)
!21 = !{!11, !11} !21 = !DILocation(line: 3, column: 54, scope: !17)
!22 = !{!18} !22 = !DILocation(line: 3, column: 47, scope: !17)
!23 = !DILocation(line: 3, column: 22, scope: !19)
!24 = !DILocation(line: 3, column: 48, scope: !19)