David Blaikie | 0b7fad6 | 2014-12-08 21:48:57 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -g -std=c++11 -S -emit-llvm %s -o - | FileCheck %s |
| 2 | |
David Blaikie | 73ca569 | 2014-12-09 00:32:22 +0000 | [diff] [blame] | 3 | int &src(); int* sink(); |
David Blaikie | 0b7fad6 | 2014-12-08 21:48:57 +0000 | [diff] [blame] | 4 | |
| 5 | void f1() { |
| 6 | #line 100 |
| 7 | * // The store for the assignment should be attributed to the start of the |
| 8 | // assignment expression here, regardless of the location of subexpressions. |
David Blaikie | 73ca569 | 2014-12-09 00:32:22 +0000 | [diff] [blame] | 9 | sink() = src(); |
| 10 | // CHECK: store {{.*}}, !dbg [[DBG_F1:!.*]] |
David Blaikie | 0b7fad6 | 2014-12-08 21:48:57 +0000 | [diff] [blame] | 11 | } |
| 12 | |
David Blaikie | 73ca569 | 2014-12-09 00:32:22 +0000 | [diff] [blame] | 13 | struct foo { |
| 14 | int i; |
| 15 | int &j; |
| 16 | foo(); |
| 17 | }; |
| 18 | |
| 19 | foo::foo() |
| 20 | : |
| 21 | #line 200 |
| 22 | i |
| 23 | (src()), |
| 24 | j |
| 25 | (src()) |
| 26 | // CHECK: store i32 {{.*}} !dbg [[DBG_FOO_VALUE:!.*]] |
| 27 | // CHECK: store i32* {{.*}} !dbg [[DBG_FOO_REF:!.*]] |
| 28 | { |
| 29 | } |
| 30 | |
| 31 | // CHECK: [[DBG_F1]] = metadata !{i32 100, |
| 32 | // CHECK: [[DBG_FOO_VALUE]] = metadata !{i32 200, |
| 33 | // CHECK: [[DBG_FOO_REF]] = metadata !{i32 202, |