|
| 1 | + |
| 2 | +// RUN: %clang -gkey-instructions -x c++ %s -gmlt -gcolumn-info -S -emit-llvm -o - -Wno-unused-variable \ |
| 3 | +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank |
| 4 | + |
| 5 | +// RUN: %clang -gkey-instructions -x c %s -gmlt -gcolumn-info -S -emit-llvm -o - -Wno-unused-variable \ |
| 6 | +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank |
| 7 | + |
| 8 | +_Complex float ci; |
| 9 | +void test() { |
| 10 | +// CHECK: %ci.real = load float, ptr @ci{{.*}}, !dbg [[G1R2:!.*]] |
| 11 | +// CHECK: %ci.imag = load float, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1){{.*}}, !dbg [[G1R2]] |
| 12 | +// CHECK: store float %ci.real, ptr %lc.realp{{.*}}, !dbg [[G1R1:!.*]] |
| 13 | +// CHECK: store float %ci.imag, ptr %lc.imagp{{.*}}, !dbg [[G1R1]] |
| 14 | + _Complex float lc = ci; |
| 15 | + |
| 16 | +// CHECK: %ci.real1 = load float, ptr @ci{{.*}}, !dbg [[G2R2:!.*]] |
| 17 | +// CHECK: %ci.imag2 = load float, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1){{.*}}, !dbg [[G2R2]] |
| 18 | +// CHECK: store float %ci.real1, ptr @ci{{.*}}, !dbg [[G2R1:!.*]] |
| 19 | +// CHECK: store float %ci.imag2, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1){{.*}}, !dbg [[G2R1]] |
| 20 | + ci = ci; |
| 21 | + |
| 22 | +// CHECK: %add.r = fadd float %ci.real5, %ci.real3, !dbg [[G3R2:!.*]] |
| 23 | +// CHECK: %add.i = fadd float %ci.imag6, %ci.imag4, !dbg [[G3R2]] |
| 24 | +// CHECK: store float %add.r, ptr @ci{{.*}}, !dbg [[G3R1:!.*]] |
| 25 | +// CHECK: store float %add.i, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1){{.*}}, !dbg [[G3R1]] |
| 26 | + ci += ci; |
| 27 | + |
| 28 | +// CHECK: %add = fadd float %0, %1, !dbg [[G4R2:!.*]] |
| 29 | +// CHECK: store float %add, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1){{.*}}, !dbg [[G4R1:!.*]] |
| 30 | + __imag ci = __imag ci + __imag ci; |
| 31 | +} |
| 32 | + |
| 33 | +// CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2) |
| 34 | +// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1) |
| 35 | +// CHECK: [[G2R2]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 2) |
| 36 | +// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1) |
| 37 | +// CHECK: [[G3R2]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 2) |
| 38 | +// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1) |
| 39 | +// CHECK: [[G4R2]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 2) |
| 40 | +// CHECK: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1) |
0 commit comments