David Blaikie | b0cdf530 | 2014-06-27 05:32:09 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -argpromotion -S | FileCheck %s |
Chandler Carruth | addcda4 | 2017-02-09 23:46:27 +0000 | [diff] [blame] | 2 | ; RUN: opt < %s -passes=argpromotion -S | FileCheck %s |
David Blaikie | f997c6f | 2014-07-23 21:30:59 +0000 | [diff] [blame] | 3 | |
| 4 | declare void @sink(i32) |
David Blaikie | ba405c2 | 2014-06-30 20:26:12 +0000 | [diff] [blame] | 5 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 6 | ; CHECK: define internal void @test({{.*}} !dbg [[SP:![0-9]+]] |
| 7 | define internal void @test(i32** %X) !dbg !2 { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 8 | %1 = load i32*, i32** %X, align 8 |
| 9 | %2 = load i32, i32* %1, align 8 |
David Blaikie | 8e9cfa5 | 2014-07-23 22:09:29 +0000 | [diff] [blame] | 10 | call void @sink(i32 %2) |
David Blaikie | b0cdf530 | 2014-06-27 05:32:09 +0000 | [diff] [blame] | 11 | ret void |
| 12 | } |
| 13 | |
David Blaikie | 8e9cfa5 | 2014-07-23 22:09:29 +0000 | [diff] [blame] | 14 | define void @caller(i32** %Y) { |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 15 | ; CHECK: call void @test(i32 % |
David Blaikie | 8e9cfa5 | 2014-07-23 22:09:29 +0000 | [diff] [blame] | 16 | call void @test(i32** %Y) |
David Blaikie | b0cdf530 | 2014-06-27 05:32:09 +0000 | [diff] [blame] | 17 | ret void |
| 18 | } |
| 19 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 20 | ; CHECK: [[SP]] = distinct !DISubprogram(name: "test", |
| 21 | |
David Blaikie | e844cd5 | 2014-07-01 21:13:37 +0000 | [diff] [blame] | 22 | !llvm.module.flags = !{!0} |
| 23 | !llvm.dbg.cu = !{!3} |
David Blaikie | b0cdf530 | 2014-06-27 05:32:09 +0000 | [diff] [blame] | 24 | |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 25 | !0 = !{i32 2, !"Debug Info Version", i32 3} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 26 | !1 = !DILocation(line: 8, scope: !2) |
Justin Bogner | efc3fbf | 2017-02-17 23:57:42 +0000 | [diff] [blame] | 27 | !2 = distinct !DISubprogram(name: "test", file: !5, line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !3, scopeLine: 3, scope: null) |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 28 | !3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: LineTablesOnly, file: !5) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 29 | !5 = !DIFile(filename: "test.c", directory: "") |