blob: 00d626155b0298a121cb6f1d229279aed9b67696 [file] [log] [blame]
David Blaikie0b7fad62014-12-08 21:48:57 +00001// RUN: %clang_cc1 -g -std=c++11 -S -emit-llvm %s -o - | FileCheck %s
2
David Blaikie73ca5692014-12-09 00:32:22 +00003int &src(); int* sink();
David Blaikie0b7fad62014-12-08 21:48:57 +00004
5void 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 Blaikie73ca5692014-12-09 00:32:22 +00009 sink() = src();
10 // CHECK: store {{.*}}, !dbg [[DBG_F1:!.*]]
David Blaikie0b7fad62014-12-08 21:48:57 +000011}
12
David Blaikie73ca5692014-12-09 00:32:22 +000013struct foo {
14 int i;
15 int &j;
16 foo();
17};
18
19foo::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,