| David Blaikie | b0cdf530 | 2014-06-27 05:32:09 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -argpromotion -S | FileCheck %s |
| David Blaikie | f997c6f | 2014-07-23 21:30:59 +0000 | [diff] [blame] | 2 | |
| 3 | declare void @sink(i32) |
| David Blaikie | ba405c2 | 2014-06-30 20:26:12 +0000 | [diff] [blame] | 4 | |
| Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 5 | ; CHECK: define internal void @test({{.*}} !dbg [[SP:![0-9]+]] |
| 6 | define internal void @test(i32** %X) !dbg !2 { |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 7 | %1 = load i32*, i32** %X, align 8 |
| 8 | %2 = load i32, i32* %1, align 8 |
| David Blaikie | 8e9cfa5 | 2014-07-23 22:09:29 +0000 | [diff] [blame] | 9 | call void @sink(i32 %2) |
| David Blaikie | b0cdf530 | 2014-06-27 05:32:09 +0000 | [diff] [blame] | 10 | ret void |
| 11 | } |
| 12 | |
| David Blaikie | 8e9cfa5 | 2014-07-23 22:09:29 +0000 | [diff] [blame] | 13 | define void @caller(i32** %Y) { |
| Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 14 | ; CHECK: call void @test(i32 % |
| David Blaikie | 8e9cfa5 | 2014-07-23 22:09:29 +0000 | [diff] [blame] | 15 | call void @test(i32** %Y) |
| David Blaikie | b0cdf530 | 2014-06-27 05:32:09 +0000 | [diff] [blame] | 16 | ret void |
| 17 | } |
| 18 | |
| Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 19 | ; CHECK: [[SP]] = distinct !DISubprogram(name: "test", |
| 20 | |
| David Blaikie | e844cd5 | 2014-07-01 21:13:37 +0000 | [diff] [blame] | 21 | !llvm.module.flags = !{!0} |
| 22 | !llvm.dbg.cu = !{!3} |
| David Blaikie | b0cdf530 | 2014-06-27 05:32:09 +0000 | [diff] [blame] | 23 | |
| Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 24 | !0 = !{i32 2, !"Debug Info Version", i32 3} |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 25 | !1 = !DILocation(line: 8, scope: !2) |
| Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 26 | !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 Smith | 55ca964 | 2015-08-03 17:26:41 +0000 | [diff] [blame] | 27 | !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 Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 28 | !4 = !{!2} |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 29 | !5 = !DIFile(filename: "test.c", directory: "") |