forked from GPUOpen-Drivers/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged master:cd5ab56bc406 into amd-gfx:12107ad063b9
Local branch amd-gfx 12107ad Merged master:f22ac1d15b1b into amd-gfx:e715bf7d18b5 Remote branch master cd5ab56 Change the default target CPU for OpenBSD/i386 to i586
- Loading branch information
Showing
9 changed files
with
285 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
|
||
// RUN: %clang_cc1 -x c -fsyntax-only -verify %s | ||
// RUN: %clang_cc1 -x c++ -fsyntax-only -verify %s | ||
|
||
const char *missing_comma[] = { | ||
"basic_filebuf", | ||
"basic_ios", | ||
"future", | ||
"optional", | ||
"packaged_task" // expected-note{{place parentheses around the string literal to silence warning}} | ||
"promise", // expected-warning{{suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?}} | ||
"shared_future" | ||
}; | ||
|
||
#ifndef __cplusplus | ||
typedef __WCHAR_TYPE__ wchar_t; | ||
#endif | ||
|
||
const wchar_t *missing_comma_wchar[] = { | ||
L"basic_filebuf", | ||
L"packaged_task" // expected-note{{place parentheses around the string literal to silence warning}} | ||
L"promise" // expected-warning{{suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?}} | ||
}; | ||
|
||
#if __cplusplus >= 201103L | ||
const char *missing_comma_u8[] = { | ||
u8"basic_filebuf", | ||
u8"packaged_task" // expected-note{{place parentheses around the string literal to silence warning}} | ||
u8"promise" // expected-warning{{suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?}} | ||
}; | ||
#endif | ||
|
||
const char *missing_two_commas[] = {"basic_filebuf", | ||
"basic_ios" // expected-note{{place parentheses around the string literal to silence warning}} | ||
"future" // expected-warning{{suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?}} | ||
"optional", | ||
"packaged_task"}; | ||
|
||
const char *missing_comma_same_line[] = {"basic_filebuf", "basic_ios", | ||
"future" "optional", // expected-note{{place parentheses around the string literal to silence warning}} | ||
"packaged_task", "promise"}; // expected-warning@-1{{suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?}} | ||
|
||
const char *missing_comma_different_lines[] = {"basic_filebuf", "basic_ios" // expected-note{{place parentheses around the string literal to silence warning}} | ||
"future", "optional", // expected-warning{{suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?}} | ||
"packaged_task", "promise"}; | ||
|
||
const char *missing_comma_same_line_all_literals[] = {"basic_filebuf", "future" "optional", "packaged_task"}; // expected-note{{place parentheses around the string literal to silence warning}} | ||
// expected-warning@-1{{suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?}} | ||
|
||
char missing_comma_inner[][4] = { | ||
"a", | ||
"b" // expected-note{{place parentheses around the string literal to silence warning}} | ||
"c" // expected-warning{{suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?}} | ||
}; | ||
|
||
|
||
#define ONE(x) x | ||
#define TWO "foo" | ||
const char *macro_test[] = { ONE("foo") "bar", | ||
TWO "bar", | ||
"foo" TWO // expected-note{{place parentheses around the string literal to silence warning}} | ||
}; // expected-warning@-1{{suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?}} | ||
|
||
// Do not warn for macros. | ||
|
||
#define BASIC_IOS "basic_ios" | ||
#define FUTURE "future" | ||
const char *macro_test2[] = {"basic_filebuf", BASIC_IOS | ||
FUTURE, "optional", | ||
"packaged_task", "promise"}; | ||
|
||
#define FOO(xx) xx "_normal", \ | ||
xx "_movable", | ||
|
||
const char *macro_test3[] = {"basic_filebuf", | ||
"basic_ios", | ||
FOO("future") | ||
"optional", | ||
"packaged_task"}; | ||
|
||
#define BAR(name) #name "_normal" | ||
|
||
const char *macro_test4[] = {"basic_filebuf", | ||
"basic_ios", | ||
BAR(future), | ||
"optional", | ||
"packaged_task"}; | ||
|
||
#define SUPPRESS(x) x | ||
const char *macro_test5[] = { SUPPRESS("foo" "bar"), "baz" }; | ||
|
||
// Do not warn when all the elements in the initializer are concatenated together. | ||
const char *all_elems_in_init_concatenated[] = {"a" "b" "c"}; | ||
|
||
// Warning can be supressed also by extra parentheses. | ||
const char *extra_parens_to_suppress_warning[] = { | ||
"basic_filebuf", | ||
"basic_ios", | ||
"future", | ||
"optional", | ||
("packaged_task" | ||
"promise"), | ||
"shared_future" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.