4
4
// RUN: %clang_cc1 -gkey-instructions -x c %s -debug-info-kind=line-tables-only -emit-llvm -o - \
5
5
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
6
6
7
- unsigned long long g ;
7
+ unsigned long long g , h ;
8
8
void fun () {
9
9
// CHECK: store i64 0, ptr @g{{.*}}, !dbg [[G1R1:!.*]]
10
10
g = 0 ;
@@ -34,6 +34,16 @@ void fun() {
34
34
// CHECK: %dec = add i64 %3, -1, !dbg [[G6R2:!.*]]
35
35
// CHECK: store i64 %dec, ptr @g{{.*}}, !dbg [[G6R1:!.*]]
36
36
g -- ;
37
+
38
+ // Compound assignment with assignment on RHS, the assignments should have
39
+ // their own separate atom groups.
40
+ // CHECK: %4 = load i64, ptr @h{{.*}}, !dbg [[load_h_loc:!.*]]
41
+ // CHECK: %inc1 = add i64 %4, 1, !dbg [[G8R2:!.*]]
42
+ // CHECK: store i64 %inc1, ptr @h{{.*}}, !dbg [[G8R1:!.*]]
43
+ // CHECK: %5 = load i64, ptr @g{{.*}}, !dbg [[load_g_loc:!.*]]
44
+ // CHECK: %add2 = add i64 %5, %inc1, !dbg [[G7R2:!.*]]
45
+ // CHECK: store i64 %add2, ptr @g{{.*}}, !dbg [[G7R1:!.*]]
46
+ g += ++ h ;
37
47
}
38
48
39
49
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
@@ -46,3 +56,9 @@ void fun() {
46
56
// CHECK: [[G5R1]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 1)
47
57
// CHECK: [[G6R2]] = !DILocation({{.*}}, atomGroup: 6, atomRank: 2)
48
58
// CHECK: [[G6R1]] = !DILocation({{.*}}, atomGroup: 6, atomRank: 1)
59
+ // CHECK: [[load_h_loc]] = !DILocation(line: [[#]], column: [[#]], scope: ![[#]])
60
+ // CHECK: [[G8R2]] = !DILocation({{.*}}, atomGroup: 8, atomRank: 2)
61
+ // CHECK: [[G8R1]] = !DILocation({{.*}}, atomGroup: 8, atomRank: 1)
62
+ // CHECK: [[load_g_loc]] = !DILocation(line: [[#]], column: [[#]], scope: ![[#]])
63
+ // CHECK: [[G7R2]] = !DILocation({{.*}}, atomGroup: 7, atomRank: 2)
64
+ // CHECK: [[G7R1]] = !DILocation({{.*}}, atomGroup: 7, atomRank: 1)
0 commit comments