blob: dbdccacf42ba7f364670f9958f1b96331e149d99 [file] [log] [blame]
David Blaikieb0cdf5302014-06-27 05:32:09 +00001; RUN: opt < %s -argpromotion -S | FileCheck %s
David Blaikief997c6f2014-07-23 21:30:59 +00002
3declare void @sink(i32)
David Blaikieba405c22014-06-30 20:26:12 +00004
Peter Collingbourned4bff302015-11-05 22:03:56 +00005; CHECK: define internal void @test({{.*}} !dbg [[SP:![0-9]+]]
6define internal void @test(i32** %X) !dbg !2 {
David Blaikiea79ac142015-02-27 21:17:42 +00007 %1 = load i32*, i32** %X, align 8
8 %2 = load i32, i32* %1, align 8
David Blaikie8e9cfa52014-07-23 22:09:29 +00009 call void @sink(i32 %2)
David Blaikieb0cdf5302014-06-27 05:32:09 +000010 ret void
11}
12
David Blaikie8e9cfa52014-07-23 22:09:29 +000013define void @caller(i32** %Y) {
Peter Collingbourned4bff302015-11-05 22:03:56 +000014; CHECK: call void @test(i32 %
David Blaikie8e9cfa52014-07-23 22:09:29 +000015 call void @test(i32** %Y)
David Blaikieb0cdf5302014-06-27 05:32:09 +000016 ret void
17}
18
Peter Collingbourned4bff302015-11-05 22:03:56 +000019; CHECK: [[SP]] = distinct !DISubprogram(name: "test",
20
David Blaikiee844cd52014-07-01 21:13:37 +000021!llvm.module.flags = !{!0}
22!llvm.dbg.cu = !{!3}
David Blaikieb0cdf5302014-06-27 05:32:09 +000023
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000024!0 = !{i32 2, !"Debug Info Version", i32 3}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000025!1 = !DILocation(line: 8, scope: !2)
Peter Collingbourned4bff302015-11-05 22:03:56 +000026!2 = distinct !DISubprogram(name: "test", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, scope: null)
Duncan P. N. Exon Smith55ca9642015-08-03 17:26:41 +000027!3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 2, file: !5, subprograms: !4)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000028!4 = !{!2}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000029!5 = !DIFile(filename: "test.c", directory: "")