Skip to content

Commit f559891

Browse files
committed
expand test
1 parent 449f30e commit f559891

File tree

1 file changed

+32
-2
lines changed
  • clang/test/DebugInfo/KeyInstructions

1 file changed

+32
-2
lines changed

clang/test/DebugInfo/KeyInstructions/complex.c

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
66

77
_Complex float ci;
8+
float f;
89
void test() {
910
// CHECK: %ci.real = load float, ptr @ci{{.*}}, !dbg [[G1R2:!.*]]
1011
// CHECK: %ci.imag = load float, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1){{.*}}, !dbg [[G1R2]]
@@ -24,8 +25,31 @@ void test() {
2425
// CHECK: store float %add.i, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1){{.*}}, !dbg [[G3R1]]
2526
ci += ci;
2627

27-
// CHECK: %add = fadd float %0, %1, !dbg [[G4R2:!.*]]
28-
// CHECK: store float %add, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1){{.*}}, !dbg [[G4R1:!.*]]
28+
// CHECK: %sub.r = fsub float %ci.real9, %ci.real7, !dbg [[G4R2:!.*]]
29+
// CHECK: %sub.i = fsub float %ci.imag10, %ci.imag8, !dbg [[G4R2]]
30+
// CHECK: store float %sub.r, ptr @ci, align 4, !dbg [[G4R1:!.*]]
31+
// CHECK: store float %sub.i, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1){{.*}}, !dbg [[G4R1]]
32+
ci -= ci;
33+
34+
// There's control flow introduced here to skip around nan and lib calls
35+
// (which is ignored in the test as none of those insts need be key). This does
36+
// make PHIs "backup" instructions, which is... odd. FIXME: Do we want to make
37+
// the instructions producing the values in the PHI backups instead/too?
38+
// CHECK: %real_mul_phi = phi float [ %mul_r, %entry ], [ %mul_r, %complex_mul_imag_nan ], [ %coerce.real, %complex_mul_libcall ], !dbg [[G5R2:!.*]]
39+
// CHECK: %imag_mul_phi = phi float [ %mul_i, %entry ], [ %mul_i, %complex_mul_imag_nan ], [ %coerce.imag, %complex_mul_libcall ], !dbg [[G5R2]]
40+
// CHECK: store float %real_mul_phi, ptr @ci, align 4, !dbg [[G5R1:!.*]]
41+
// CHECK: store float %imag_mul_phi, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1), align 4, !dbg [[G5R1]]
42+
ci *= ci;
43+
44+
// div goes straight to lib call, which gets saved into a temp.
45+
// CHECK: %coerce21.real = load float, ptr %coerce21.realp, align 4, !dbg [[G6R2:!.*]]
46+
// CHECK: %coerce21.imag = load float, ptr %coerce21.imagp, align 4, !dbg [[G6R2]]
47+
// CHECK: store float %coerce21.real, ptr @ci, align 4, !dbg [[G6R1:!.*]]
48+
// CHECK: store float %coerce21.imag, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1), align 4, !dbg [[G6R1]]
49+
ci /= ci;
50+
51+
// CHECK: %add = fadd float %0, %1, !dbg [[G7R2:!.*]]
52+
// CHECK: store float %add, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1){{.*}}, !dbg [[G7R1:!.*]]
2953
__imag ci = __imag ci + __imag ci;
3054
}
3155

@@ -37,3 +61,9 @@ void test() {
3761
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
3862
// CHECK: [[G4R2]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 2)
3963
// CHECK: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1)
64+
// CHECK: [[G5R2]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 2)
65+
// CHECK: [[G5R1]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 1)
66+
// CHECK: [[G6R2]] = !DILocation({{.*}}, atomGroup: 6, atomRank: 2)
67+
// CHECK: [[G6R1]] = !DILocation({{.*}}, atomGroup: 6, atomRank: 1)
68+
// CHECK: [[G7R2]] = !DILocation({{.*}}, atomGroup: 7, atomRank: 2)
69+
// CHECK: [[G7R1]] = !DILocation({{.*}}, atomGroup: 7, atomRank: 1)

0 commit comments

Comments
 (0)