[llvm-branch-commits] [clang] a2d561f - [SVE] Add a couple of extra sizeless type tests

Richard Sandiford via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Nov 27 02:38:47 PST 2020


Author: Richard Sandiford
Date: 2020-11-27T10:33:47Z
New Revision: a2d561f1a33694a44451b5e0fe2d534522a4ee1d

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

LOG: [SVE] Add a couple of extra sizeless type tests

This patch adds tests for things that happened to be fixed by previous
patches, but that should continue working if we do decide to treat
sizeless types as incomplete types.

Differential Revision: https://reviews.llvm.org/D79584

Added: 
    

Modified: 
    clang/test/Sema/sizeless-1.c
    clang/test/SemaCXX/sizeless-1.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/Sema/sizeless-1.c b/clang/test/Sema/sizeless-1.c
index dd6492c44b62..e1d926544894 100644
--- a/clang/test/Sema/sizeless-1.c
+++ b/clang/test/Sema/sizeless-1.c
@@ -290,4 +290,10 @@ void test_generic(void) {
   int a3[_Generic(0, svint8_t : 1, svint16_t : 2, default : 3) == 3 ? 1 : -1];
   (void)_Generic(0, svint8_t : 1, svint8_t : 2, default : 3); // expected-error {{type 'svint8_t' (aka '__SVInt8_t') in generic association compatible with previously specified type 'svint8_t'}} expected-note {{compatible type}}
 }
+
+void test_compound_literal(void) {
+  svint8_t local_int8;
+
+  (void)(svint8_t){local_int8};
+}
 #endif

diff  --git a/clang/test/SemaCXX/sizeless-1.cpp b/clang/test/SemaCXX/sizeless-1.cpp
index 46a183f7ad0c..96a3ce7542a7 100644
--- a/clang/test/SemaCXX/sizeless-1.cpp
+++ b/clang/test/SemaCXX/sizeless-1.cpp
@@ -379,6 +379,8 @@ extern array_alias<int> *array_alias_int_ptr;
 extern array_alias<svint8_t> *array_alias_int8_ptr; // expected-note {{in instantiation of template type alias 'array_alias' requested here}}
 #endif
 
+extern "C" svint8_t c_return_int8();
+
 void cxx_only(int sel) {
   svint8_t local_int8;
   svint16_t local_int16;


        


More information about the llvm-branch-commits mailing list