diff options
author | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
commit | 056abd2059c65a3e908193aeae16fad98017437c (patch) | |
tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/Misc | |
parent | cc73504950eb7b5dff2dded9bedd67bc36d64641 (diff) | |
download | FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.zip FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.tar.gz |
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974
Diffstat (limited to 'test/Misc')
-rw-r--r-- | test/Misc/ast-dump-stmt.c | 35 | ||||
-rw-r--r-- | test/Misc/ast-dump-stmt.m | 36 | ||||
-rw-r--r-- | test/Misc/caret-diags-macros.c | 79 | ||||
-rw-r--r-- | test/Misc/diag-template-diffing-color.cpp | 53 | ||||
-rw-r--r-- | test/Misc/diag-template-diffing.cpp | 366 | ||||
-rw-r--r-- | test/Misc/predefines.c | 1 | ||||
-rw-r--r-- | test/Misc/unnecessary-elipses.cpp | 15 | ||||
-rw-r--r-- | test/Misc/unprintable.c | 41 | ||||
-rw-r--r-- | test/Misc/warning-flags-enabled.c | 16 | ||||
-rw-r--r-- | test/Misc/warning-flags.c | 15 | ||||
-rw-r--r-- | test/Misc/wrong-encoding.c | 33 | ||||
-rw-r--r-- | test/Misc/wrong-encoding2.c | 8 |
12 files changed, 654 insertions, 44 deletions
diff --git a/test/Misc/ast-dump-stmt.c b/test/Misc/ast-dump-stmt.c new file mode 100644 index 0000000..d7fdce8 --- /dev/null +++ b/test/Misc/ast-dump-stmt.c @@ -0,0 +1,35 @@ +// RUN: %clang_cc1 -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s + +int TestLocation = 0; +// CHECK: Dumping TestLocation +// CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <{{.*}}:3:20> 'int' 0 + +int TestIndent = 1 + (1); +// CHECK: Dumping TestIndent +// CHECK-NEXT: {{\(BinaryOperator[^()]*$}} +// CHECK-NEXT: {{^ \(IntegerLiteral.*0[^()]*\)$}} +// CHECK-NEXT: {{^ \(ParenExpr.*0[^()]*$}} +// CHECK-NEXT: {{^ \(IntegerLiteral.*0[^()]*\)\)\)$}} + +void TestDeclStmt() { + int x = 0; + int y, z; +} +// CHECK: Dumping TestDeclStmt +// CHECK-NEXT: CompoundStmt +// CHECK-NEXT: DeclStmt +// CHECK-NEXT: int x = +// CHECK-NEXT: IntegerLiteral +// CHECK-NEXT: DeclStmt +// CHECK-NEXT: int y +// CHECK-NEXT: int z + +int TestOpaqueValueExpr = 0 ?: 1; +// CHECK: Dumping TestOpaqueValueExpr +// CHECK-NEXT: BinaryConditionalOperator +// CHECK-NEXT: IntegerLiteral +// CHECK-NEXT: OpaqueValueExpr +// CHECK-NEXT: IntegerLiteral +// CHECK-NEXT: OpaqueValueExpr +// CHECK-NEXT: IntegerLiteral +// CHECK-NEXT: IntegerLiteral diff --git a/test/Misc/ast-dump-stmt.m b/test/Misc/ast-dump-stmt.m new file mode 100644 index 0000000..8dfee74 --- /dev/null +++ b/test/Misc/ast-dump-stmt.m @@ -0,0 +1,36 @@ +// RUN: %clang_cc1 -Wno-unused -fblocks -fobjc-exceptions -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s + +void TestBlockExpr(int x) { + ^{ x; }; +} +// CHECK: Dumping TestBlockExpr +// CHECK: BlockExpr{{.*}} decl= +// CHECK-NEXT: capture ParmVar +// CHECK-NEXT: CompoundStmt + +void TestExprWithCleanup(int x) { + ^{ x; }; +} +// CHECK: Dumping TestExprWithCleanup +// CHECK: ExprWithCleanups +// CHECK-NEXT: cleanup Block +// CHECK-NEXT: BlockExpr + +@interface A +@end + +void TestObjCAtCatchStmt() { + @try { + } @catch(A *a) { + } @catch(...) { + } @finally { + } +} +// CHECK: Dumping TestObjCAtCatchStmt +// CHECK: ObjCAtTryStmt +// CHECK-NEXT: CompoundStmt +// CHECK-NEXT: ObjCAtCatchStmt{{.*}} catch parm = "A *a" +// CHECK-NEXT: CompoundStmt +// CHECK-NEXT: ObjCAtCatchStmt{{.*}} catch all +// CHECK-NEXT: CompoundStmt +// CHECK-NEXT: ObjCAtFinallyStmt diff --git a/test/Misc/caret-diags-macros.c b/test/Misc/caret-diags-macros.c index de1ee76..5faddb6 100644 --- a/test/Misc/caret-diags-macros.c +++ b/test/Misc/caret-diags-macros.c @@ -1,13 +1,13 @@ -// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s -strict-whitespace #define M1(x) x #define M2 1; void foo() { M1( M2); - // CHECK: :7:{{[0-9]+}}: warning: expression result unused - // CHECK: :4:{{[0-9]+}}: note: expanded from macro 'M2' - // CHECK: :3:{{[0-9]+}}: note: expanded from macro 'M1' + // CHECK: {{.*}}:7:{{[0-9]+}}: warning: expression result unused + // CHECK: {{.*}}:4:{{[0-9]+}}: note: expanded from macro 'M2' + // CHECK: {{.*}}:3:{{[0-9]+}}: note: expanded from macro 'M1' } #define A 1 @@ -15,10 +15,10 @@ void foo() { #define C B void bar() { C; - // CHECK: :17:3: warning: expression result unused - // CHECK: :15:11: note: expanded from macro 'C' - // CHECK: :14:11: note: expanded from macro 'B' - // CHECK: :13:11: note: expanded from macro 'A' + // CHECK: {{.*}}:17:3: warning: expression result unused + // CHECK: {{.*}}:15:11: note: expanded from macro 'C' + // CHECK: {{.*}}:14:11: note: expanded from macro 'B' + // CHECK: {{.*}}:13:11: note: expanded from macro 'A' } // rdar://7597492 @@ -40,12 +40,12 @@ void baz(char *Msg) { #define macro_many_args3(x, y, z) macro_many_args2(x, y, z) void test() { - macro_args3(1); + macro_args3(11); // CHECK: {{.*}}:43:15: warning: expression result unused // Also check that the 'caret' printing agrees with the location here where // its easy to FileCheck. - // CHECK-NEXT: macro_args3(1); - // CHECK-NEXT: ~~~~~~~~~~~~^~ + // CHECK-NEXT: macro_args3(11); + // CHECK-NEXT: {{^ \^~}} // CHECK: {{.*}}:36:36: note: expanded from macro 'macro_args3' // CHECK: {{.*}}:35:36: note: expanded from macro 'macro_args2' // CHECK: {{.*}}:34:24: note: expanded from macro 'macro_args1' @@ -71,13 +71,13 @@ void test() { macro_many_args3( 1, - macro_args2(2), + macro_args2(22), 3); // CHECK: {{.*}}:74:17: warning: expression result unused // This caret location needs to be printed *inside* a different macro's // arguments. - // CHECK-NEXT: macro_args2(2), - // CHECK-NEXT: ~~~~~~~~~~~~^~~ + // CHECK-NEXT: macro_args2(22), + // CHECK-NEXT: {{^ \^~}} // CHECK: {{.*}}:35:36: note: expanded from macro 'macro_args2' // CHECK: {{.*}}:34:24: note: expanded from macro 'macro_args1' // CHECK: {{.*}}:40:55: note: expanded from macro 'macro_many_args3' @@ -90,10 +90,10 @@ void test() { #define variadic_args3(x, y, ...) variadic_args2(x, y, __VA_ARGS__) void test2() { - variadic_args3(1, 2, 3, 4); + variadic_args3(1, 22, 3, 4); // CHECK: {{.*}}:93:21: warning: expression result unused - // CHECK-NEXT: variadic_args3(1, 2, 3, 4); - // CHECK-NEXT: ~~~~~~~~~~~~~~~~~~^~~~~~~~ + // CHECK-NEXT: variadic_args3(1, 22, 3, 4); + // CHECK-NEXT: {{^ \^~}} // CHECK: {{.*}}:90:53: note: expanded from macro 'variadic_args3' // CHECK: {{.*}}:89:50: note: expanded from macro 'variadic_args2' // CHECK: {{.*}}:88:35: note: expanded from macro 'variadic_args1' @@ -118,3 +118,48 @@ void test3() { // CHECK: {{.*}}:104:70: note: expanded from macro 'variadic_pasting_args2a' // CHECK: {{.*}}:102:41: note: expanded from macro 'variadic_pasting_args1' } + +#define BAD_CONDITIONAL_OPERATOR (2<3)?2:3 +int test4 = BAD_CONDITIONAL_OPERATOR+BAD_CONDITIONAL_OPERATOR; +// CHECK: {{.*}}:122:39: note: expanded from macro 'BAD_CONDITIONAL_OPERATOR' +// CHECK-NEXT: #define BAD_CONDITIONAL_OPERATOR (2<3)?2:3 +// CHECK-NEXT: {{^ \^}} +// CHECK: {{.*}}:122:39: note: expanded from macro 'BAD_CONDITIONAL_OPERATOR' +// CHECK-NEXT: #define BAD_CONDITIONAL_OPERATOR (2<3)?2:3 +// CHECK-NEXT: {{^ \^}} +// CHECK: {{.*}}:122:39: note: expanded from macro 'BAD_CONDITIONAL_OPERATOR' +// CHECK-NEXT: #define BAD_CONDITIONAL_OPERATOR (2<3)?2:3 +// CHECK-NEXT: {{^ ~~~~~\^~~~}} + +#define QMARK ? +#define TWOL (2< +#define X 1+TWOL 3) QMARK 4:5 +int x = X; +// CHECK: {{.*}}:137:9: note: place parentheses around the '+' expression to silence this warning +// CHECK-NEXT: int x = X; +// CHECK-NEXT: {{^ \^}} +// CHECK-NEXT: {{.*}}:136:21: note: expanded from macro 'X' +// CHECK-NEXT: #define X 1+TWOL 3) QMARK 4:5 +// CHECK-NEXT: {{^ ~~~~~~~~~ \^}} +// CHECK-NEXT: {{.*}}:134:15: note: expanded from macro 'QMARK' +// CHECK-NEXT: #define QMARK ? +// CHECK-NEXT: {{^ \^}} +// CHECK-NEXT: {{.*}}:137:9: note: place parentheses around the '?:' expression to evaluate it first +// CHECK-NEXT: int x = X; +// CHECK-NEXT: {{^ \^}} +// CHECK-NEXT: {{.*}}:136:21: note: expanded from macro 'X' +// CHECK-NEXT: #define X 1+TWOL 3) QMARK 4:5 +// CHECK-NEXT: {{^ ~~~~~~~~\^~~~~~~~~}} + +#define ONEPLUS 1+ +#define Y ONEPLUS (2<3) QMARK 4:5 +int y = Y; +// CHECK: {{.*}}:156:9: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first +// CHECK-NEXT: int y = Y; +// CHECK-NEXT: {{^ \^}} +// CHECK-NEXT: {{.*}}:155:25: note: expanded from macro 'Y' +// CHECK-NEXT: #define Y ONEPLUS (2<3) QMARK 4:5 +// CHECK-NEXT: {{^ ~~~~~~~~~~~~~ \^}} +// CHECK-NEXT: {{.*}}:134:15: note: expanded from macro 'QMARK' +// CHECK-NEXT: #define QMARK ? +// CHECK-NEXT: {{^ \^}} diff --git a/test/Misc/diag-template-diffing-color.cpp b/test/Misc/diag-template-diffing-color.cpp index 6903e84..cfa1a68 100644 --- a/test/Misc/diag-template-diffing-color.cpp +++ b/test/Misc/diag-template-diffing-color.cpp @@ -17,3 +17,56 @@ foo<double> &B = A; // TREE: non-const lvalue reference cannot bind to a value of unrelated type // TREE: foo< // TREE: [{{.}}[0;1;36mdouble{{.}}[0m{{.}}[1m != {{.}}[0;1;36mint{{.}}[0m{{.}}[1m]>{{.}}[0m + +template<typename> class vector {}; + +void set15(vector<const vector<int> >) {} +void test15() { + set15(vector<const vector<const int> >()); +} +// CHECK: {{.*}}candidate function not viable: no known conversion from 'vector<const vector<{{.}}[0;1;36mconst{{ ?.}}[0m{{ ?}}int>>' to 'vector<const vector<int>>' for 1st argument +// TREE: {{.*}}candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// TREE: vector< +// TREE: const vector< +// TREE: [{{.}}[0;1;36mconst{{ ?.}}[0m{{ ?}}!= {{.}}[0;1;36m(no qualifiers){{.}}[0m] int>> + +void set16(vector<vector<int> >) {} +void test16() { + set16(vector<const vector<int> >()); +} +// CHECK: {{.*}}candidate function not viable: no known conversion from 'vector<{{.}}[0;1;36mconst{{ ?.}}[0m{{ ?}}vector<[...]>>' to 'vector<vector<[...]>>' for 1st argument +// TREE: {{.*}}candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// TREE: vector< +// TREE: [{{.}}[0;1;36mconst{{ ?.}}[0m{{ ?}}!= {{.}}[0;1;36m(no qualifiers){{ ?.}}[0m]{{ ?}}vector< +// TREE: [...]>> + +void set17(vector<const vector<int> >) {} +void test17() { + set17(vector<vector<int> >()); +} +// CHECK: candidate function not viable: no known conversion from 'vector<vector<[...]>>' to 'vector<{{.}}[0;1;36mconst{{ ?.}}[0m{{ ?}}vector<[...]>>' for 1st argument +// TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// TREE: vector< +// TREE: [{{.}}[0;1;36m(no qualifiers){{ ?.}}[0m{{ ?}}!= {{.}}[0;1;36mconst{{.}}[0m] vector< +// TREE: [...]>> + +void set18(vector<volatile vector<int> >) {} +void test18() { + set18(vector<const vector<int> >()); +} +// CHECK: candidate function not viable: no known conversion from 'vector<{{.}}[0;1;36mconst{{ ?.}}[0m{{ ?}}vector<[...]>>' to 'vector<{{.}}[0;1;36mvolatile{{ ?.}}[0m{{ ?}}vector<[...]>>' for 1st argument +// TREE: no matching function for call to 'set18' +// TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// TREE: vector< +// TREE: [{{.}}[0;1;36mconst{{ ?.}}[0m{{ ?}}!= {{.}}[0;1;36mvolatile{{.}}[0m] vector< +// TREE: [...]>> + +void set19(vector<const volatile vector<int> >) {} +void test19() { + set19(vector<const vector<int> >()); +} +// CHECK: candidate function not viable: no known conversion from 'vector<const vector<[...]>>' to 'vector<const {{.}}[0;1;36mvolatile{{ ?.}}[0m{{ ?}}vector<[...]>>' for 1st argument +// TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// TREE: vector< +// TREE: [const != const {{.}}[0;1;36mvolatile{{.}}[0m] vector< +// TREE: [...]>> diff --git a/test/Misc/diag-template-diffing.cpp b/test/Misc/diag-template-diffing.cpp index 9addcc5..2c044f8 100644 --- a/test/Misc/diag-template-diffing.cpp +++ b/test/Misc/diag-template-diffing.cpp @@ -426,6 +426,372 @@ void test13() { // CHECK-NOELIDE-TREE: &b13, // CHECK-NOELIDE-TREE: [&d13 != (no argument)]> +template<typename T> struct s14 {}; +template<typename T> using a14 = s14<T>; +typedef a14<int> b14; +template<typename T> using c14 = b14; +int f14(c14<int>); +int k14 = f14(a14<char>()); +// CHECK-ELIDE-NOTREE: no matching function for call to 'f14' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'a14<char>' to 'a14<int>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'f14' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'a14<char>' to 'a14<int>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'f14' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: a14< +// CHECK-ELIDE-TREE: [char != int]> +// CHECK-NOELIDE-TREE: no matching function for call to 'f14' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: a14< +// CHECK-NOELIDE-TREE: [char != int]> + +void set15(vector<vector<int>>) {} +void test15() { + set15(vector<vector<int>>()); +} +// CHECK-ELIDE-NOTREE-NOT: set15 +// CHECK-NOELIDE-NOTREE-NOT: set15 +// CHECK-ELIDE-TREE-NOT: set15 +// CHECK-NOELIDE-TREE-NOT: set15 +// no error here + +void set16(vector<const vector<int>>) {} +void test16() { + set16(vector<const vector<const int>>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set16' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<const int>>' to 'vector<const vector<int>>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set16' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<const int>>' to 'vector<const vector<int>>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set16' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: vector< +// CHECK-ELIDE-TREE: const vector< +// CHECK-ELIDE-TREE: [const != (no qualifiers)] int>> +// CHECK-NOELIDE-TREE: no matching function for call to 'set16' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: vector< +// CHECK-NOELIDE-TREE: const vector< +// CHECK-NOELIDE-TREE: [const != (no qualifiers)] int>> + +void set17(vector<vector<int>>) {} +void test17() { + set17(vector<const vector<int>>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set17' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<[...]>>' to 'vector<vector<[...]>>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set17' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<int>>' to 'vector<vector<int>>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set17' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: vector< +// CHECK-ELIDE-TREE: [const != (no qualifiers)] vector< +// CHECK-ELIDE-TREE: [...]>> +// CHECK-NOELIDE-TREE: no matching function for call to 'set17' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: vector< +// CHECK-NOELIDE-TREE: [const != (no qualifiers)] vector< +// CHECK-NOELIDE-TREE: int>> + +void set18(vector<const vector<int>>) {} +void test18() { + set18(vector<vector<int>>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set18' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<vector<[...]>>' to 'vector<const vector<[...]>>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set18' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<vector<int>>' to 'vector<const vector<int>>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set18' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: vector< +// CHECK-ELIDE-TREE: [(no qualifiers) != const] vector< +// CHECK-ELIDE-TREE: [...]>> +// CHECK-NOELIDE-TREE: no matching function for call to 'set18' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: vector< +// CHECK-NOELIDE-TREE: [(no qualifiers) != const] vector< +// CHECK-NOELIDE-TREE: int>> + +void set19(vector<volatile vector<int>>) {} +void test19() { + set19(vector<const vector<int>>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set19' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<[...]>>' to 'vector<volatile vector<[...]>>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set19' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<int>>' to 'vector<volatile vector<int>>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set19' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: vector< +// CHECK-ELIDE-TREE: [const != volatile] vector< +// CHECK-ELIDE-TREE: [...]>> +// CHECK-NOELIDE-TREE: no matching function for call to 'set19' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: vector< +// CHECK-NOELIDE-TREE: [const != volatile] vector< +// CHECK-NOELIDE-TREE: int>> + +void set20(vector<const volatile vector<int>>) {} +void test20() { + set20(vector<const vector<int>>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set20' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<[...]>>' to 'vector<const volatile vector<[...]>>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set20' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<int>>' to 'vector<const volatile vector<int>>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set20' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: vector< +// CHECK-ELIDE-TREE: [const != const volatile] vector< +// CHECK-ELIDE-TREE: [...]>> +// CHECK-NOELIDE-TREE: no matching function for call to 'set20' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: vector< +// CHECK-NOELIDE-TREE: [const != const volatile] vector< +// CHECK-NOELIDE-TREE: int>> + + +// Checks that volatile does not show up in diagnostics. +template<typename T> struct S21 {}; +template<typename T> using U21 = volatile S21<T>; +int f21(vector<const U21<int>>); +int k21 = f21(vector<U21<int>>()); +// CHECK-ELIDE-NOTREE: no matching function for call to 'f21' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<U21<[...]>>' to 'vector<const U21<[...]>>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'f21' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<U21<int>>' to 'vector<const U21<int>>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'f21' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: vector< +// CHECK-ELIDE-TREE: [(no qualifiers) != const] U21< +// CHECK-ELIDE-TREE: [...]>> +// CHECK-NOELIDE-TREE: no matching function for call to 'f21' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: vector< +// CHECK-NOELIDE-TREE: [(no qualifiers) != const] U21< +// CHECK-NOELIDE-TREE: int>> + +// Checks that volatile does not show up in diagnostics. +template<typename T> struct S22 {}; +template<typename T> using U22 = volatile S22<T>; +int f22(vector<volatile const U22<int>>); +int k22 = f22(vector<volatile U22<int>>()); +// CHECK-ELIDE-NOTREE: no matching function for call to 'f22' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<U22<[...]>>' to 'vector<const U22<[...]>>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'f22' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<U22<int>>' to 'vector<const U22<int>>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'f22' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: vector< +// CHECK-ELIDE-TREE: [(no qualifiers) != const] U22< +// CHECK-ELIDE-TREE: [...]>> +// CHECK-NOELIDE-TREE: no matching function for call to 'f22' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: vector< +// CHECK-NOELIDE-TREE: [(no qualifiers) != const] U22< +// CHECK-NOELIDE-TREE: int>> + +// Testing qualifiers and typedefs. +template <class T> struct D23{}; +template <class T> using C23 = D23<T>; +typedef const C23<int> B23; +template<class ...T> using A23 = B23; + +void foo23(D23<A23<>> b) {} +void test23() { + foo23(D23<D23<char>>()); + foo23(C23<char>()); +} + +// CHECK-ELIDE-NOTREE: no matching function for call to 'foo23' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'D23<D23<char>>' to 'D23<const D23<int>>' for 1st argument +// CHECK-ELIDE-NOTREE: no matching function for call to 'foo23' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'D23<char>' to 'D23<A23<>>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'foo23' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'D23<D23<char>>' to 'D23<const D23<int>>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'foo23' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'D23<char>' to 'D23<A23<>>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'foo23' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: D23< +// CHECK-ELIDE-TREE: [(no qualifiers) != const] D23< +// CHECK-ELIDE-TREE: [char != int]>> +// CHECK-ELIDE-TREE: no matching function for call to 'foo23' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: D23< +// CHECK-ELIDE-TREE: [char != A23<>]> +// CHECK-NOELIDE-TREE: no matching function for call to 'foo23' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: D23< +// CHECK-NOELIDE-TREE: [(no qualifiers) != const] D23< +// CHECK-NOELIDE-TREE: [char != int]>> +// CHECK-NOELIDE-TREE: no matching function for call to 'foo23' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: D23< +// CHECK-NOELIDE-TREE: [char != A23<>]> + +namespace PR14015 { +template <unsigned N> class Foo1 {}; +template <unsigned N = 2> class Foo2 {}; +template <unsigned ...N> class Foo3 {}; + +void Play1() { + Foo1<1> F1; + Foo1<2> F2, F3; + F2 = F1; + F1 = F2; + F2 = F3; + F3 = F2; +} + +// CHECK-ELIDE-NOTREE: no viable overloaded '=' +// CHECK-ELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo1<1>' to 'Foo1<2>' for 1st argument +// CHECK-ELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo1<1>' to 'Foo1<2>' for 1st argument +// CHECK-ELIDE-NOTREE: no viable overloaded '=' +// CHECK-ELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo1<2>' to 'Foo1<1>' for 1st argument +// CHECK-ELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo1<2>' to 'Foo1<1>' for 1st argument +// CHECK-NOELIDE-NOTREE: no viable overloaded '=' +// CHECK-NOELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo1<1>' to 'Foo1<2>' for 1st argument +// CHECK-NOELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo1<1>' to 'Foo1<2>' for 1st argument +// CHECK-NOELIDE-NOTREE: no viable overloaded '=' +// CHECK-NOELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo1<2>' to 'Foo1<1>' for 1st argument +// CHECK-NOELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo1<2>' to 'Foo1<1>' for 1st argument +// CHECK-ELIDE-TREE: no viable overloaded '=' +// CHECK-ELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Foo1< +// CHECK-ELIDE-TREE: [1 != 2]> +// CHECK-ELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Foo1< +// CHECK-ELIDE-TREE: [1 != 2]> +// CHECK-ELIDE-TREE: no viable overloaded '=' +// CHECK-ELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Foo1< +// CHECK-ELIDE-TREE: [2 != 1]> +// CHECK-ELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Foo1< +// CHECK-ELIDE-TREE: [2 != 1]> +// CHECK-NOELIDE-TREE: no viable overloaded '=' +// CHECK-NOELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Foo1< +// CHECK-NOELIDE-TREE: [1 != 2]> +// CHECK-NOELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Foo1< +// CHECK-NOELIDE-TREE: [1 != 2]> +// CHECK-NOELIDE-TREE: no viable overloaded '=' +// CHECK-NOELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Foo1< +// CHECK-NOELIDE-TREE: [2 != 1]> +// CHECK-NOELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Foo1< +// CHECK-NOELIDE-TREE: [2 != 1]> + +void Play2() { + Foo2<1> F1; + Foo2<> F2, F3; + F2 = F1; + F1 = F2; + F2 = F3; + F3 = F2; +} +// CHECK-ELIDE-NOTREE: no viable overloaded '=' +// CHECK-ELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo2<1>' to 'Foo2<2>' for 1st argument +// CHECK-ELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo2<1>' to 'Foo2<2>' for 1st argument +// CHECK-ELIDE-NOTREE: no viable overloaded '=' +// CHECK-ELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo2<(default) 2>' to 'Foo2<1>' for 1st argument +// CHECK-ELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo2<(default) 2>' to 'Foo2<1>' for 1st argument +// CHECK-NOELIDE-NOTREE: no viable overloaded '=' +// CHECK-NOELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo2<1>' to 'Foo2<2>' for 1st argument +// CHECK-NOELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo2<1>' to 'Foo2<2>' for 1st argument +// CHECK-NOELIDE-NOTREE: no viable overloaded '=' +// CHECK-NOELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo2<(default) 2>' to 'Foo2<1>' for 1st argument +// CHECK-NOELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo2<(default) 2>' to 'Foo2<1>' for 1st argument +// CHECK-ELIDE-TREE: no viable overloaded '=' +// CHECK-ELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Foo2< +// CHECK-ELIDE-TREE: [1 != 2]> +// CHECK-ELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Foo2< +// CHECK-ELIDE-TREE: [1 != 2]> +// CHECK-ELIDE-TREE: no viable overloaded '=' +// CHECK-ELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Foo2< +// CHECK-ELIDE-TREE: [(default) 2 != 1]> +// CHECK-ELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Foo2< +// CHECK-ELIDE-TREE: [(default) 2 != 1]> +// CHECK-NOELIDE-TREE: no viable overloaded '=' +// CHECK-NOELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Foo2< +// CHECK-NOELIDE-TREE: [1 != 2]> +// CHECK-NOELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Foo2< +// CHECK-NOELIDE-TREE: [1 != 2]> +// CHECK-NOELIDE-TREE: no viable overloaded '=' +// CHECK-NOELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Foo2< +// CHECK-NOELIDE-TREE: [(default) 2 != 1]> +// CHECK-NOELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Foo2< +// CHECK-NOELIDE-TREE: [(default) 2 != 1]> + +void Play3() { + Foo3<1> F1; + Foo3<2, 1> F2, F3; + F2 = F1; + F1 = F2; + F2 = F3; + F3 = F2; +} +// CHECK-ELIDE-NOTREE: no viable overloaded '=' +// CHECK-ELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo3<1, (no argument)>' to 'Foo3<2, 1>' for 1st argument +// CHECK-ELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo3<1, (no argument)>' to 'Foo3<2, 1>' for 1st argument +// CHECK-ELIDE-NOTREE: no viable overloaded '=' +// CHECK-ELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo3<2, 1>' to 'Foo3<1, (no argument)>' for 1st argument +// CHECK-ELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo3<2, 1>' to 'Foo3<1, (no argument)>' for 1st argument +// CHECK-NOELIDE-NOTREE: no viable overloaded '=' +// CHECK-NOELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo3<1, (no argument)>' to 'Foo3<2, 1>' for 1st argument +// CHECK-NOELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo3<1, (no argument)>' to 'Foo3<2, 1>' for 1st argument +// CHECK-NOELIDE-NOTREE: no viable overloaded '=' +// CHECK-NOELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo3<2, 1>' to 'Foo3<1, (no argument)>' for 1st argument +// CHECK-NOELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo3<2, 1>' to 'Foo3<1, (no argument)>' for 1st argument +// CHECK-ELIDE-TREE: no viable overloaded '=' +// CHECK-ELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Foo3< +// CHECK-ELIDE-TREE: [1 != 2], +// CHECK-ELIDE-TREE: [(no argument) != 1]> +// CHECK-ELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Foo3< +// CHECK-ELIDE-TREE: [1 != 2], +// CHECK-ELIDE-TREE: [(no argument) != 1]> +// CHECK-ELIDE-TREE: no viable overloaded '=' +// CHECK-ELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Foo3< +// CHECK-ELIDE-TREE: [2 != 1], +// CHECK-ELIDE-TREE: [1 != (no argument)]> +// CHECK-ELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Foo3< +// CHECK-ELIDE-TREE: [2 != 1], +// CHECK-ELIDE-TREE: [1 != (no argument)]> +// CHECK-NOELIDE-TREE: no viable overloaded '=' +// CHECK-NOELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Foo3< +// CHECK-NOELIDE-TREE: [1 != 2], +// CHECK-NOELIDE-TREE: [(no argument) != 1]> +// CHECK-NOELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Foo3< +// CHECK-NOELIDE-TREE: [1 != 2], +// CHECK-NOELIDE-TREE: [(no argument) != 1]> +// CHECK-NOELIDE-TREE: no viable overloaded '=' +// CHECK-NOELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Foo3< +// CHECK-NOELIDE-TREE: [2 != 1], +// CHECK-NOELIDE-TREE: [1 != (no argument)]> +// CHECK-NOELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Foo3< +// CHECK-NOELIDE-TREE: [2 != 1], +// CHECK-NOELIDE-TREE: [1 != (no argument)]> +} + // CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated. // CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated. diff --git a/test/Misc/predefines.c b/test/Misc/predefines.c index 87f676e..63944b0 100644 --- a/test/Misc/predefines.c +++ b/test/Misc/predefines.c @@ -1,4 +1,5 @@ /* RUN: %clang_cc1 -fsyntax-only -verify -std=c89 -ffreestanding -pedantic-errors %s + * expected-no-diagnostics * rdar://6814950 */ #include <stdint.h> diff --git a/test/Misc/unnecessary-elipses.cpp b/test/Misc/unnecessary-elipses.cpp new file mode 100644 index 0000000..2ee7258 --- /dev/null +++ b/test/Misc/unnecessary-elipses.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -fsyntax-only -fmessage-length 80 %s 2>&1 | FileCheck -strict-whitespace %s + +int main() { + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +// CHECK: {{^ "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";}} + + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +// CHECK: {{^ ..."xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";}} + +"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ; +// CHECK: {{^"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"...}} + + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ; +// CHECK: {{^ ..."xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"...}} +}
\ No newline at end of file diff --git a/test/Misc/unprintable.c b/test/Misc/unprintable.c index 860503e..cd97131 100644 --- a/test/Misc/unprintable.c +++ b/test/Misc/unprintable.c @@ -1,16 +1,39 @@ -// RUN: %clang_cc1 %s 2>&1 | FileCheck -strict-whitespace %s +// RUN: %clang_cc1 %s -fmessage-length 40 2>&1 | FileCheck -strict-whitespace %s int main() { int i; - if((i==/*👿*/1)); + if((i==/*￾*/1)); -// CHECK: {{^ if\(\(i==/\*<U\+1F47F>\*/1\)\);}} +// CHECK: {{^ if\(\(i==/\*<U\+FFFE>\*/1\)\);}} -// CHECK: {{^ ~\^~~~~~~~~~~~~~~~}} -// CHECK: {{^ ~ \^ ~}} +// CHECK: {{^ ~\^~~~~~~~~~~~~~~}} +// CHECK: {{^ ~ \^ ~}} - /* 👿 */ "👿berhund"; + (void)"Ê￾ô"; -// CHECK: {{^ /\* <U\+1F47F> \*/ "<U\+1F47F>berhund";}} -// CHECK: {{^ \^~~~~~~~~~~~~~~~~~}} -}
\ No newline at end of file +// CHECK: {{^ \(void\)"<CA><U\+FFFE><F4>";}} +// CHECK: {{^ \^~~~}} + + int n = 0; + +// CHECK: {{ int n = 0;}} +// CHECK: {{^\^}} + + "￾ \z"; + +// CHECK: {{^ \.\.\.\\z";}} +// CHECK: {{^ \^~}} + + + /* ￾ */ "￾berhund"; + +// CHECK: {{^ /\* <U\+FFFE> \*/ "<U\+FFFE>berhund";}} +// CHECK: {{^ \^~~~~~~~~~~~~~~~~}} + + +// PR14292 + "x°xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +// CHECK: {{^ "x<B0>}} +// CHECK: {{^ \^}} + +} diff --git a/test/Misc/warning-flags-enabled.c b/test/Misc/warning-flags-enabled.c index 7ef5c94..ba29e7ac 100644 --- a/test/Misc/warning-flags-enabled.c +++ b/test/Misc/warning-flags-enabled.c @@ -25,3 +25,19 @@ // CHECK-NO-LEVELS-NOT: E // CHECK-NO-LEVELS-NOT: F // CHECK-NO-LEVELS: warn_objc_root_class_missing [-Wobjc-root-class] + +// Test if EnumConversion is a subgroup of -Wconversion. +// RUN: diagtool show-enabled --no-levels -Wno-conversion -Wenum-conversion %s | FileCheck --check-prefix CHECK-ENUM-CONVERSION %s +// RUN: diagtool show-enabled --no-levels %s | FileCheck --check-prefix CHECK-ENUM-CONVERSION %s +// RUN: diagtool show-enabled --no-levels -Wno-conversion %s | FileCheck --check-prefix CHECK-NO-ENUM-CONVERSION %s +// +// CHECK-ENUM-CONVERSION: -Wenum-conversion +// CHECK-NO-ENUM-CONVERSION-NOT: -Wenum-conversion + +// Test if -Wshift-op-parentheses is a subgroup of -Wparentheses +// RUN: diagtool show-enabled --no-levels -Wno-parentheses -Wshift-op-parentheses %s | FileCheck --check-prefix CHECK-SHIFT-OP-PARENTHESES %s +// RUN: diagtool show-enabled --no-levels %s | FileCheck --check-prefix CHECK-SHIFT-OP-PARENTHESES %s +// RUN: diagtool show-enabled --no-levels -Wno-parentheses %s | FileCheck --check-prefix CHECK-NO-SHIFT-OP-PARENTHESES %s +// +// CHECK-SHIFT-OP-PARENTHESES: -Wshift-op-parentheses +// CHECK-NO-SHIFT-OP-PARENTHESES-NOT: -Wshift-op-parentheses diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c index 06c70eb..c3f14bc 100644 --- a/test/Misc/warning-flags.c +++ b/test/Misc/warning-flags.c @@ -18,7 +18,7 @@ This test serves two purposes: The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (159): +CHECK: Warnings without flags (148): CHECK-NEXT: ext_delete_void_ptr_operand CHECK-NEXT: ext_enum_friend CHECK-NEXT: ext_expected_semi_decl_list @@ -30,8 +30,6 @@ CHECK-NEXT: ext_new_paren_array_nonconst CHECK-NEXT: ext_plain_complex CHECK-NEXT: ext_pp_macro_redef CHECK-NEXT: ext_template_arg_extra_parens -CHECK-NEXT: ext_typecheck_comparison_of_distinct_pointers -CHECK-NEXT: ext_typecheck_comparison_of_distinct_pointers_nonstandard CHECK-NEXT: ext_typecheck_comparison_of_pointer_integer CHECK-NEXT: ext_typecheck_cond_incompatible_operands CHECK-NEXT: ext_typecheck_cond_incompatible_operands_nonstandard @@ -59,10 +57,7 @@ CHECK-NEXT: warn_call_to_pure_virtual_member_function_from_ctor_dtor CHECK-NEXT: warn_call_wrong_number_of_arguments CHECK-NEXT: warn_case_empty_range CHECK-NEXT: warn_char_constant_too_large -CHECK-NEXT: warn_cmdline_missing_macro_defs CHECK-NEXT: warn_collection_expr_type -CHECK-NEXT: warn_conflicting_param_types -CHECK-NEXT: warn_conflicting_ret_types CHECK-NEXT: warn_conflicting_variadic CHECK-NEXT: warn_conv_to_base_not_used CHECK-NEXT: warn_conv_to_self_not_used @@ -71,9 +66,6 @@ CHECK-NEXT: warn_delete_array_type CHECK-NEXT: warn_double_const_requires_fp64 CHECK-NEXT: warn_drv_assuming_mfloat_abi_is CHECK-NEXT: warn_drv_clang_unsupported -CHECK-NEXT: warn_drv_not_using_clang_arch -CHECK-NEXT: warn_drv_not_using_clang_cpp -CHECK-NEXT: warn_drv_not_using_clang_cxx CHECK-NEXT: warn_drv_objc_gc_unsupported CHECK-NEXT: warn_drv_pch_not_first_include CHECK-NEXT: warn_dup_category_def @@ -101,7 +93,6 @@ CHECK-NEXT: warn_integer_too_large_for_signed CHECK-NEXT: warn_invalid_asm_cast_lvalue CHECK-NEXT: warn_many_braces_around_scalar_init CHECK-NEXT: warn_maynot_respond -CHECK-NEXT: warn_member_extra_qualification CHECK-NEXT: warn_method_param_redefinition CHECK-NEXT: warn_mismatched_exception_spec CHECK-NEXT: warn_missing_case_for_condition @@ -134,7 +125,6 @@ CHECK-NEXT: warn_pragma_expected_rparen CHECK-NEXT: warn_pragma_extra_tokens_at_eol CHECK-NEXT: warn_pragma_ms_struct CHECK-NEXT: warn_pragma_options_align_reset_failed -CHECK-NEXT: warn_pragma_options_align_unsupported_option CHECK-NEXT: warn_pragma_options_expected_align CHECK-NEXT: warn_pragma_pack_invalid_action CHECK-NEXT: warn_pragma_pack_invalid_alignment @@ -149,7 +139,6 @@ CHECK-NEXT: warn_pragma_unused_expected_var CHECK-NEXT: warn_pragma_unused_expected_var_arg CHECK-NEXT: warn_pragma_unused_undeclared_var CHECK-NEXT: warn_previous_alias_decl -CHECK-NEXT: warn_printf_asterisk_missing_arg CHECK-NEXT: warn_property_attr_mismatch CHECK-NEXT: warn_property_attribute CHECK-NEXT: warn_property_getter_owning_mismatch @@ -181,4 +170,4 @@ CHECK-NEXT: warn_weak_import The list of warnings in -Wpedantic should NEVER grow. -CHECK: Number in -Wpedantic (not covered by other -W flags): 39 +CHECK: Number in -Wpedantic (not covered by other -W flags): 29 diff --git a/test/Misc/wrong-encoding.c b/test/Misc/wrong-encoding.c index bd1cf3d..c48402d 100644 --- a/test/Misc/wrong-encoding.c +++ b/test/Misc/wrong-encoding.c @@ -1,16 +1,39 @@ -// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s +// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value %s 2>&1 | FileCheck -strict-whitespace %s +// REQUIRES: asserts void foo() { "§Ã"; // ø // CHECK: {{^ "<A7><C3>"; // <F8>}} -// CHECK: {{^ \^}} +// CHECK: {{^ \^~~~~~~}} /* þ« */ const char *d = "¥"; // CHECK: {{^ /\* <FE><AB> \*/ const char \*d = "<A5>";}} -// CHECK: {{^ \^}} +// CHECK: {{^ \^~~~}} -// CHECK: {{^ "<A7><C3>"; // <F8>}} -// CHECK: {{^ \^~~~~~~~~~}} + "xxé¿¿¿d"; +// CHECK: {{^ "xx<U\+9FFF><BF>d";}} +// CHECK: {{^ \^~~~}} + + "xxé¿bcd"; +// CHECK: {{^ "xx<E9><BF>bcd";}} +// CHECK: {{^ \^~~~~~~~}} + + "xxéabcd"; +// CHECK: {{^ "xx<E9>abcd";}} +// CHECK: {{^ \^~~~}} + + "xxé¿é¿d"; +// CHECK: {{^ "xx<E9><BF><E9><BF>d";}} +// CHECK: {{^ \^~~~~~~~~~~~~~~}} + + "xxé¿xxxxxxxxxxxxxxxxxxxxxé¿xx"; +// CHECK: {{^ "xx<E9><BF>xxxxxxxxxxxxxxxxxxxxx<E9><BF>xx";}} +// CHECK: {{^ \^~~~~~~~ ~~~~~~~~}} + + "?kÍ›S¥ÇØg7†, 2,Díu„†*É,pûäÚ&”‰(K§:Ñ'1á‹ÎjOÅ°<:"; + + "xé¿xé¿xé¿xé¿xé¿xé¿xé¿xé¿xé¿xé¿xé¿xé¿x"; } +// CHECK-NOT:Assertion diff --git a/test/Misc/wrong-encoding2.c b/test/Misc/wrong-encoding2.c new file mode 100644 index 0000000..43a0f4e --- /dev/null +++ b/test/Misc/wrong-encoding2.c @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -fsyntax-only -fmessage-length 100 %s 2>&1 | FileCheck -strict-whitespace %s +// REQUIRES: asserts + +int main() { + "É#x#p)6Ò)ѽŠ$ûž>U êhÑüÃö|Ÿ থϻgŸY|`?ò;;Æ¿VjÇ\\ù€‡ûݪW9úТ:ÌŠO EøÛy?SKªy¦¹‡Øài&n"; +} + +// CHECK-NOT:Assertion |