[clang] 75ef955 - [clang][bytecode][NFC] Move test to verify=expected,both style

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 23 22:19:07 PDT 2024


Author: Timm Bäder
Date: 2024-08-24T07:18:36+02:00
New Revision: 75ef95584d8867d0039a43bad0bd8e53f3293f67

URL: https://github.com/llvm/llvm-project/commit/75ef95584d8867d0039a43bad0bd8e53f3293f67
DIFF: https://github.com/llvm/llvm-project/commit/75ef95584d8867d0039a43bad0bd8e53f3293f67.diff

LOG: [clang][bytecode][NFC] Move test to verify=expected,both style

Added: 
    

Modified: 
    clang/test/AST/ByteCode/invalid.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/AST/ByteCode/invalid.cpp b/clang/test/AST/ByteCode/invalid.cpp
index 3c142481f78119..13ba84bcad1040 100644
--- a/clang/test/AST/ByteCode/invalid.cpp
+++ b/clang/test/AST/ByteCode/invalid.cpp
@@ -5,65 +5,49 @@ namespace Throw {
 
   constexpr int ConditionalThrow(bool t) {
     if (t)
-      throw 4; // expected-note {{subexpression not valid in a constant expression}} \
-               // ref-note {{subexpression not valid in a constant expression}}
+      throw 4; // both-note {{subexpression not valid in a constant expression}}
 
     return 0;
   }
 
   static_assert(ConditionalThrow(false) == 0, "");
-  static_assert(ConditionalThrow(true) == 0, ""); // expected-error {{not an integral constant expression}} \
-                                                  // expected-note {{in call to 'ConditionalThrow(true)'}} \
-                                                  // ref-error {{not an integral constant expression}} \
-                                                  // ref-note {{in call to 'ConditionalThrow(true)'}}
+  static_assert(ConditionalThrow(true) == 0, ""); // both-error {{not an integral constant expression}} \
+                                                  // both-note {{in call to 'ConditionalThrow(true)'}}
 
-  constexpr int Throw() { // expected-error {{never produces a constant expression}} \
-                          // ref-error {{never produces a constant expression}}
-    throw 5; // expected-note {{subexpression not valid in a constant expression}} \
-             // ref-note {{subexpression not valid in a constant expression}}
+  constexpr int Throw() { // both-error {{never produces a constant expression}}
+    throw 5; // both-note {{subexpression not valid in a constant expression}}
     return 0;
   }
 
-  constexpr int NoSubExpr() { // ref-error {{never produces a constant expression}} \
-                              // expected-error {{never produces a constant expression}}
-    throw; // ref-note 2{{subexpression not valid}} \
-           // expected-note 2{{subexpression not valid}}
+  constexpr int NoSubExpr() { // both-error {{never produces a constant expression}}
+    throw; // both-note 2{{subexpression not valid}}
     return 0;
   }
-  static_assert(NoSubExpr() == 0, ""); // ref-error {{not an integral constant expression}} \
-                                       // ref-note {{in call to}} \
-                                       // expected-error {{not an integral constant expression}} \
-                                       // expected-note {{in call to}}
+  static_assert(NoSubExpr() == 0, ""); // both-error {{not an integral constant expression}} \
+                                       // both-note {{in call to}}
 }
 
 namespace Asm {
   constexpr int ConditionalAsm(bool t) {
     if (t)
-      asm(""); // expected-note {{subexpression not valid in a constant expression}} \
-               // ref-note {{subexpression not valid in a constant expression}}
+      asm(""); // both-note {{subexpression not valid in a constant expression}}
 
     return 0;
   }
   static_assert(ConditionalAsm(false) == 0, "");
-  static_assert(ConditionalAsm(true) == 0, ""); // expected-error {{not an integral constant expression}} \
-                                                // expected-note {{in call to 'ConditionalAsm(true)'}} \
-                                                // ref-error {{not an integral constant expression}} \
-                                                // ref-note {{in call to 'ConditionalAsm(true)'}}
+  static_assert(ConditionalAsm(true) == 0, ""); // both-error {{not an integral constant expression}} \
+                                                // both-note {{in call to 'ConditionalAsm(true)'}}
 
 
-  constexpr int Asm() { // expected-error {{never produces a constant expression}} \
-                        // ref-error {{never produces a constant expression}}
-    __asm volatile(""); // expected-note {{subexpression not valid in a constant expression}} \
-                        // ref-note {{subexpression not valid in a constant expression}}
+  constexpr int Asm() { // both-error {{never produces a constant expression}}
+    __asm volatile(""); // both-note {{subexpression not valid in a constant expression}}
     return 0;
   }
 }
 
 namespace Casts {
-  constexpr int a = reinterpret_cast<int>(12); // expected-error {{must be initialized by a constant expression}} \
-                                               // expected-note {{reinterpret_cast is not allowed}} \
-                                               // ref-error {{must be initialized by a constant expression}} \
-                                               // ref-note {{reinterpret_cast is not allowed}}
+  constexpr int a = reinterpret_cast<int>(12); // both-error {{must be initialized by a constant expression}} \
+                                               // both-note {{reinterpret_cast is not allowed}}
 
   void func() {
     struct B {};


        


More information about the cfe-commits mailing list