================
@@ -169,41 +169,35 @@ void TestLabelsAndGoto(void) {
 
 void TestSwitch(int i) {
   switch (i) {
-  // CHECK: SwitchStmt 0x{{[^ ]*}} <line:[[@LINE-1]]:3, line:[[@LINE+37]]:3>
+  // CHECK: SwitchStmt 0x{{[^ ]*}} <line:[[@LINE-1]]:3, line:[[@LINE+31]]:3>
   // CHECK-NEXT: ImplicitCastExpr
   // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:11> 'int' lvalue ParmVar 0x{{[^ 
]*}} 'i' 'int'
-  // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:14, line:[[@LINE+34]]:3>
+  // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:14, line:[[@LINE+28]]:3>
   case 0:
     break;
   // CHECK-NEXT: CaseStmt 0x{{[^ ]*}} <line:[[@LINE-2]]:3, line:[[@LINE-1]]:5>
-  // CHECK-NEXT: ConstantExpr
-  // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:8> 'int' 0
-  // CHECK-NEXT: BreakStmt 0x{{[^ ]*}} <line:[[@LINE-4]]:5>
+  // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <line:[[@LINE-3]]:8> 'int' 0
+  // CHECK-NEXT: BreakStmt 0x{{[^ ]*}} <line:[[@LINE-3]]:5>
   case 1:
   case 2:
     break;
   // CHECK-NEXT: CaseStmt 0x{{[^ ]*}} <line:[[@LINE-3]]:3, line:[[@LINE-1]]:5>
-  // CHECK-NEXT: ConstantExpr
-  // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:8> 'int' 1
-  // CHECK-NEXT: CaseStmt 0x{{[^ ]*}} <line:[[@LINE-5]]:3, line:[[@LINE-4]]:5>
-  // CHECK-NEXT: ConstantExpr
-  // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:8> 'int' 2
-  // CHECK-NEXT: BreakStmt 0x{{[^ ]*}} <line:[[@LINE-7]]:5>
+  // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <line:[[@LINE-4]]:8> 'int' 1
+  // CHECK-NEXT: CaseStmt 0x{{[^ ]*}} <line:[[@LINE-4]]:3, line:[[@LINE-3]]:5>
+  // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <line:[[@LINE-5]]:8> 'int' 2
+  // CHECK-NEXT: BreakStmt 0x{{[^ ]*}} <line:[[@LINE-5]]:5>
----------------
tbaederr wrote:

The change here only shows that the ConstantExpr is gone. We never add a value 
to it in C (according to `-ast-dump` at least). In C++, the ConstantExpr 
created for case statements get a value.

https://github.com/llvm/llvm-project/pull/229761
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to