mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 07:06:38 +00:00
[KeyInstr][Clang] Multiple assignment (x = y = z)
This commit is contained in:
parent
cdf3eef4a2
commit
b6f42ab8be
@ -4973,6 +4973,7 @@ llvm::Value *CodeGenFunction::EmitWithOriginalRHSBitfieldAssignment(
|
||||
}
|
||||
|
||||
Value *ScalarExprEmitter::VisitBinAssign(const BinaryOperator *E) {
|
||||
ApplyAtomGroup Grp(CGF.getDebugInfo());
|
||||
bool Ignore = TestAndClearIgnoreResultAssign();
|
||||
|
||||
Value *RHS;
|
||||
|
@ -2,8 +2,22 @@
|
||||
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
|
||||
|
||||
unsigned long long g;
|
||||
void fun() { g = 0; }
|
||||
|
||||
void fun() {
|
||||
// CHECK: store i64 0, ptr @g{{.*}}, !dbg [[G1R1:!.*]]
|
||||
g = 0;
|
||||
|
||||
// Treat the two assignments as two atoms.
|
||||
//
|
||||
// FIXME: Because of the atomGroup implementation the load can only be
|
||||
// associated with one of the two stores, despite being a good backup
|
||||
// loction for both.
|
||||
// CHECK-NEXT: %0 = load i64, ptr @g{{.*}}, !dbg [[G2R2:!.*]]
|
||||
// CHECK-NEXT: store i64 %0, ptr @g{{.*}}, !dbg [[G3R1:!.*]]
|
||||
// CHECK-NEXT: store i64 %0, ptr @g{{.*}}, !dbg [[G2R1:!.*]]
|
||||
g = g = g;
|
||||
}
|
||||
|
||||
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
|
||||
// CHECK: [[G2R2]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 2)
|
||||
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
|
||||
// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user