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 , h ;
7
+ unsigned long long g , h , i ;
8
8
void fun () {
9
9
// CHECK: store i64 0, ptr @g{{.*}}, !dbg [[G1R1:!.*]]
10
10
g = 0 ;
@@ -37,13 +37,27 @@ void fun() {
37
37
38
38
// Compound assignment with assignment on RHS, the assignments should have
39
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:!.*]]
40
+ // CHECK-NEXT : %4 = load i64, ptr @h{{.*}}, !dbg [[load_h_loc:!.*]]
41
+ // CHECK-NEXT : %inc1 = add i64 %4, 1, !dbg [[G8R2:!.*]]
42
+ // CHECK-NEXT : store i64 %inc1, ptr @h{{.*}}, !dbg [[G8R1:!.*]]
43
+ // CHECK-NEXT : %5 = load i64, ptr @g{{.*}}, !dbg [[load_g_loc:!.*]]
44
+ // CHECK-NEXT : %add2 = add i64 %5, %inc1, !dbg [[G7R2:!.*]]
45
+ // CHECK-NEXT : store i64 %add2, ptr @g{{.*}}, !dbg [[G7R1:!.*]]
46
46
g += ++ h ;
47
+
48
+ // Double check the comma operator doesn't disturb atom groupings. There
49
+ // are three assignments, so we should get three groups.
50
+ // FIXME: Same situation as earlier in the test - because of the atomGroup
51
+ // implementation the load (from h) can only be associated with one of the two
52
+ // stores (to h and g) despite being a good backup location for both.
53
+ // CHECK-NEXT: %6 = load i64, ptr @h{{.*}}, !dbg [[load_h_loc2:!.*]]
54
+ // CHECK-NEXT: %inc3 = add i64 %6, 1, !dbg [[G9R2:!.*]]
55
+ // CHECK-NEXT: store i64 %inc3, ptr @h{{.*}}, !dbg [[G10R1:!.*]]
56
+ // CHECK-NEXT: store i64 %inc3, ptr @g{{.*}}, !dbg [[G9R1:!.*]]
57
+ // CHECK-NEXT: %7 = load i64, ptr @i{{.*}}, !dbg [[load_i_loc:!.*]]
58
+ // CHECK-NEXT: %inc4 = add i64 %7, 1, !dbg [[G11R2:!.*]]
59
+ // CHECK-NEXT: store i64 %inc4, ptr @i{{.*}}, !dbg [[G11R1:!.*]]
60
+ g = ++ h , ++ i ;
47
61
}
48
62
49
63
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
@@ -62,3 +76,10 @@ void fun() {
62
76
// CHECK: [[load_g_loc]] = !DILocation(line: [[#]], column: [[#]], scope: ![[#]])
63
77
// CHECK: [[G7R2]] = !DILocation({{.*}}, atomGroup: 7, atomRank: 2)
64
78
// CHECK: [[G7R1]] = !DILocation({{.*}}, atomGroup: 7, atomRank: 1)
79
+ // CHECK: [[load_h_loc2]] = !DILocation(line: [[#]], column: [[#]], scope: ![[#]])
80
+ // CHECK: [[G9R2]] = !DILocation({{.*}}, atomGroup: 9, atomRank: 2)
81
+ // CHECK: [[G10R1]] = !DILocation({{.*}}, atomGroup: 10, atomRank: 1)
82
+ // CHECK: [[G9R1]] = !DILocation({{.*}}, atomGroup: 9, atomRank: 1)
83
+ // CHECK: [[load_i_loc]] = !DILocation(line: [[#]], column: [[#]], scope: ![[#]])
84
+ // CHECK: [[G11R2]] = !DILocation({{.*}}, atomGroup: 11, atomRank: 2)
85
+ // CHECK: [[G11R1]] = !DILocation({{.*}}, atomGroup: 11, atomRank: 1)
0 commit comments