MaskRay created this revision.
MaskRay added a reviewer: dblaikie.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
MaskRay requested review of this revision.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90874

Files:
  clang/test/Modules/diagnose-missing-import.m
  clang/test/Sema/implicit-decl.c
  clang/test/Sema/vecshift.c

Index: clang/test/Sema/vecshift.c
===================================================================
--- clang/test/Sema/vecshift.c
+++ clang/test/Sema/vecshift.c
@@ -1,5 +1,7 @@
-// RUN: %clang_cc1 -fsyntax-only -DERR -verify %s
-// RUN: %clang_cc1 -fsyntax-only -DEXT -DERR -verify %s
+// RUN: %clang_cc1 -fsyntax-only -DERR -verify=expected,vecelemsize %s
+// RUN: %clang_cc1 -fsyntax-only -DEXT -DERR -verify=expected,vecelemsize %s
+// RUN: %clang_cc1 -fsyntax-only -DERR -verify %s -Wno-vec-elem-size
+// RUN: %clang_cc1 -fsyntax-only -DEXT -DERR -verify %s -Wno-vec-elem-size
 
 #ifdef EXT
 typedef __attribute__((__ext_vector_type__(8))) char vector_char8;
@@ -65,28 +67,28 @@
 
   vc8 = vc8 << vc8;
 #ifdef ERR
-  vi8 = vi8 << vuc8; // expected-error {{vector operands do not have the same elements sizes}}
-  vuc8 = vuc8 << vi8; // expected-error {{vector operands do not have the same elements sizes}}
-  vus8 = vus8 << vui8; // expected-error {{vector operands do not have the same elements sizes}}
-  vui8 = vui8 << vs8; // expected-error {{vector operands do not have the same elements sizes}}
+  vi8 = vi8 << vuc8; // vecelemsize-error {{vector operands do not have the same elements sizes}}
+  vuc8 = vuc8 << vi8; // vecelemsize-error {{vector operands do not have the same elements sizes}}
+  vus8 = vus8 << vui8; // vecelemsize-error {{vector operands do not have the same elements sizes}}
+  vui8 = vui8 << vs8; // vecelemsize-error {{vector operands do not have the same elements sizes}}
 #else
-  vi8 = vi8 << vuc8; // expected-warning {{vector operands do not have the same elements sizes}}
-  vuc8 = vuc8 << vi8; // expected-warning {{vector operands do not have the same elements sizes}}
-  vus8 = vus8 << vui8; // expected-warning {{vector operands do not have the same elements sizes}}
-  vui8 = vui8 << vs8; // expected-warning {{vector operands do not have the same elements sizes}}
+  vi8 = vi8 << vuc8; // vecelemsize-warning {{vector operands do not have the same elements sizes}}
+  vuc8 = vuc8 << vi8; // vecelemsize-warning {{vector operands do not have the same elements sizes}}
+  vus8 = vus8 << vui8; // vecelemsize-warning {{vector operands do not have the same elements sizes}}
+  vui8 = vui8 << vs8; // vecelemsize-warning {{vector operands do not have the same elements sizes}}
 #endif
 
   vc8 <<= vc8;
 #ifdef ERR
-  vi8 <<= vuc8; // expected-error {{vector operands do not have the same elements sizes}}
-  vuc8 <<= vi8; // expected-error {{vector operands do not have the same elements sizes}}
-  vus8 <<= vui8; // expected-error {{vector operands do not have the same elements sizes}}
-  vui8 <<= vs8; // expected-error {{vector operands do not have the same elements sizes}}
+  vi8 <<= vuc8; // vecelemsize-error {{vector operands do not have the same elements sizes}}
+  vuc8 <<= vi8; // vecelemsize-error {{vector operands do not have the same elements sizes}}
+  vus8 <<= vui8; // vecelemsize-error {{vector operands do not have the same elements sizes}}
+  vui8 <<= vs8; // vecelemsize-error {{vector operands do not have the same elements sizes}}
 #else
-  vi8 <<= vuc8; // expected-warning {{vector operands do not have the same elements sizes}}
-  vuc8 <<= vi8; // expected-warning {{vector operands do not have the same elements sizes}}
-  vus8 <<= vui8; // expected-warning {{vector operands do not have the same elements sizes}}
-  vui8 <<= vs8; // expected-warning {{vector operands do not have the same elements sizes}}
+  vi8 <<= vuc8; // vecelemsize-warning {{vector operands do not have the same elements sizes}}
+  vuc8 <<= vi8; // vecelemsize-warning {{vector operands do not have the same elements sizes}}
+  vus8 <<= vui8; // vecelemsize-warning {{vector operands do not have the same elements sizes}}
+  vui8 <<= vs8; // vecelemsize-warning {{vector operands do not have the same elements sizes}}
 #endif
 
   c <<= vc8; // expected-error {{assigning to 'char' from incompatible type}}
Index: clang/test/Sema/implicit-decl.c
===================================================================
--- clang/test/Sema/implicit-decl.c
+++ clang/test/Sema/implicit-decl.c
@@ -1,21 +1,25 @@
-// RUN: %clang_cc1 %s -verify -fsyntax-only -Werror
+// RUN: %clang_cc1 %s -verify=expected,implicit -fsyntax-only -Werror=implicit-function-declaration
+// RUN: %clang_cc1 %s -verify -fsyntax-only -Wno-implicit-function-declaration
+
+/// -Werror-implicit-function-declaration is a deprecated alias used by many projects.
+// RUN: %clang_cc1 %s -verify=expected,implicit -fsyntax-only -Werror-implicit-function-declaration
 
 typedef int int32_t;
 typedef unsigned char Boolean;
 
-extern int printf(__const char *__restrict __format, ...); // expected-note{{'printf' declared here}}
+extern int printf(__const char *__restrict __format, ...); // implicit-note{{'printf' declared here}}
 
 void func() {
    int32_t *vector[16];
    const char compDesc[16 + 1];
    int32_t compCount = 0;
-   if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-error {{implicit declaration of function '_CFCalendarDecomposeAbsoluteTimeV' is invalid in C99}} expected-note {{previous implicit declaration}}
+   if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // implicit-error {{implicit declaration of function '_CFCalendarDecomposeAbsoluteTimeV' is invalid in C99}} expected-note {{previous implicit declaration}}
    }
 
-   printg("Hello, World!\n"); // expected-error{{implicit declaration of function 'printg' is invalid in C99}} \
-                              // expected-note{{did you mean 'printf'?}}
+   printg("Hello, World!\n"); // implicit-error{{implicit declaration of function 'printg' is invalid in C99}} \
+                              // implicit-note{{did you mean 'printf'?}}
 
-  __builtin_is_les(1, 3); // expected-error{{use of unknown builtin '__builtin_is_les'}}
+  __builtin_is_les(1, 3); // implicit-error{{use of unknown builtin '__builtin_is_les'}}
 }
 Boolean _CFCalendarDecomposeAbsoluteTimeV(const char *componentDesc, int32_t **vector, int32_t count) { // expected-error {{conflicting types}}
  return 0;
@@ -23,9 +27,9 @@
 
 
 // Test the typo-correction callback in Sema::ImplicitlyDefineFunction
-extern int sformatf(char *str, __const char *__restrict __format, ...); // expected-note{{'sformatf' declared here}}
+extern int sformatf(char *str, __const char *__restrict __format, ...); // implicit-note{{'sformatf' declared here}}
 void test_implicit() {
   int formats = 0;
-  formatd("Hello, World!\n"); // expected-error{{implicit declaration of function 'formatd' is invalid in C99}} \
-                              // expected-note{{did you mean 'sformatf'?}}
+  formatd("Hello, World!\n"); // implicit-error{{implicit declaration of function 'formatd' is invalid in C99}} \
+                              // implicit-note{{did you mean 'sformatf'?}}
 }
Index: clang/test/Modules/diagnose-missing-import.m
===================================================================
--- clang/test/Modules/diagnose-missing-import.m
+++ clang/test/Modules/diagnose-missing-import.m
@@ -2,9 +2,6 @@
 // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/diagnose-missing-import \
 // RUN:   -Werror=implicit-function-declaration -fsyntax-only \
 // RUN:   -fimplicit-module-maps -verify %s
-// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/diagnose-missing-import \
-// RUN:   -Werror-implicit-function-declaration -fsyntax-only \
-// RUN:   -fimplicit-module-maps -verify %s
 @import NCI;
 
 void foo() {
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to