Skip to content

Commit dd5949e

Browse files
committed
test g += ++h;
1 parent 7695d2f commit dd5949e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

clang/test/DebugInfo/KeyInstructions/assign-scalar.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %clang_cc1 -gkey-instructions -x c %s -debug-info-kind=line-tables-only -emit-llvm -o - \
55
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
66

7-
unsigned long long g;
7+
unsigned long long g, h;
88
void fun() {
99
// CHECK: store i64 0, ptr @g{{.*}}, !dbg [[G1R1:!.*]]
1010
g = 0;
@@ -34,6 +34,16 @@ void fun() {
3434
// CHECK: %dec = add i64 %3, -1, !dbg [[G6R2:!.*]]
3535
// CHECK: store i64 %dec, ptr @g{{.*}}, !dbg [[G6R1:!.*]]
3636
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;
3747
}
3848

3949
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
@@ -46,3 +56,9 @@ void fun() {
4656
// CHECK: [[G5R1]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 1)
4757
// CHECK: [[G6R2]] = !DILocation({{.*}}, atomGroup: 6, atomRank: 2)
4858
// 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

Comments
 (0)