Unnamed: 0
int64
0
0
repo_id
stringlengths
5
186
file_path
stringlengths
15
223
content
stringlengths
1
32.8M
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/unicode.c
// RUN: %clang_cc1 -fsyntax-only -verify %s // RUN: %clang_cc1 -E -DPP_ONLY=1 %s -o %t // RUN: FileCheck --strict-whitespace --input-file=%t %s // This file contains Unicode characters; please do not "fix" them! extern int x; // expected-warning {{treating Unicode character as whitespace}} extern int x; // expected-warning {{treating Unicode character as whitespace}} // CHECK: extern int {{x}} // CHECK: extern int {{x}} #pragma mark ¡Unicode! #define COPYRIGHT Copyright © 2012 #define XSTR(X) #X #define STR(X) XSTR(X) static const char *copyright = STR(COPYRIGHT); // no-warning // CHECK: static const char *copyright = "Copyright © {{2012}}"; #if PP_ONLY COPYRIGHT // CHECK: Copyright © {{2012}} CHECK: The preprocessor should not complain about Unicode characters like ©. #endif
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/token-concat.c
// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s IDENT.2 // CHECK: {{^}}IDENT.2{{$}} // PR4395 #define X .* X // CHECK: {{^}}.*{{$}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/counter.c
// __COUNTER__ support: rdar://4329310 // RUN: %clang -E %s | FileCheck %s #define PASTE2(x,y) x##y #define PASTE1(x,y) PASTE2(x,y) #define UNIQUE(x) PASTE1(x,__COUNTER__) A: __COUNTER__ B: UNIQUE(foo); C: UNIQUE(foo); D: __COUNTER__ // CHECK: A: 0 // CHECK: B: foo1; // CHECK: C: foo2; // CHECK: D: 3
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/builtin_redef.c
// RUN: %clang_cc1 %s -D__TIME__=1234 -U__DATE__ -E 2>&1 | FileCheck %s --check-prefix=CHECK-OUT // RUN: %clang_cc1 %s -D__TIME__=1234 -U__DATE__ -E 2>&1 | FileCheck %s --check-prefix=CHECK-WARN // RUN: not %clang_cc1 %s -D__TIME__=1234 -U__DATE__ -E 2>&1 -pedantic-errors | FileCheck %s --check-prefix=CHECK-ERR // CHECK-WARN: <command line>:{{.*}} warning: redefining builtin macro // CHECK-WARN: <command line>:{{.*}} warning: undefining builtin macro // CHECK-ERR: <command line>:{{.*}} error: redefining builtin macro // CHECK-ERR: <command line>:{{.*}} error: undefining builtin macro int n = __TIME__; __DATE__ #define __FILE__ "my file" // CHECK-WARN: :[[@LINE-1]]:9: warning: redefining builtin macro // CHECK-ERR: :[[@LINE-2]]:9: error: redefining builtin macro // CHECK-OUT: int n = 1234; // CHECK-OUT: __DATE__
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/11-27-2007-FloatLiterals.c
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s // CHECK: 0x3BFD83C940000000 // CHECK: 2.000000e+{{[0]*}}32 // CHECK: 0x3BFD83C940000000 // CHECK: 2.000000e+{{[0]*}}32 // CHECK: 0x7FF0000000000000 float F = 1e-19f; double D = 2e32; float F2 = 01e-19f; double D2 = 02e32; float F3 = 0xFp100000000000000000000F;
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/cxx0x_raw_string_unterminated.cpp
// RUN: not %clang_cc1 -std=c++11 -E %s 2>&1 | grep 'error: raw string missing terminating delimiter )foo"' const char *str = R"foo(abc def)bar";
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/hexfloat.cpp
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -pedantic %s float f = 0x1p+1; // expected-warning{{hexadecimal floating constants are a C99 feature}} double e = 0x.p0; //expected-error{{hexadecimal floating constants require a significand}} double d = 0x.2p2; // expected-warning{{hexadecimal floating constants are a C99 feature}} float g = 0x1.2p2; // expected-warning{{hexadecimal floating constants are a C99 feature}} double h = 0x1.p2; // expected-warning{{hexadecimal floating constants are a C99 feature}} // PR12717: In order to minimally diverge from the C++ standard, we do not lex // 'p[+-]' as part of a pp-number unless the token starts 0x and doesn't contain // an underscore. double i = 0p+3; // expected-error{{invalid suffix 'p' on integer constant}} #define PREFIX(x) foo ## x double foo0p = 1, j = PREFIX(0p+3); // ok double k = 0x42_amp+3; // expected-error-re{{{{invalid suffix '_amp' on integer constant|no matching literal operator for call to 'operator "" _amp'}}}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/pragma-message2.c
// RUN: %clang_cc1 -E -Werror -verify %s 2>&1 | FileCheck %s #pragma message "\\test" // expected-warning {{\test}} // CHECK: #pragma message("\134test") #pragma message("\\test") // expected-warning {{\test}} // CHECK: #pragma message("\134test") #pragma GCC warning "\"" "te" "st" "\"" // expected-warning {{"test"}} // CHECK: #pragma GCC warning "\042test\042" #pragma GCC warning("\"" "te" "st" "\"") // expected-warning {{"test"}} // CHECK: #pragma GCC warning "\042test\042" #pragma GCC error "" "[ ]" "" // expected-error {{[ ]}} // CHECK: #pragma GCC error "[\011]" #pragma GCC error("" "[ ]" "") // expected-error {{[ ]}} // CHECK: #pragma GCC error "[\011]"
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/utf8-char-literal.cpp
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -fsyntax-only -verify %s // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c11 -x c -fsyntax-only -verify %s // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++1z -fsyntax-only -verify %s int array0[u'ñ' == u'\xf1'? 1 : -1]; int array1['\xF1' != u'\xf1'? 1 : -1]; int array1['ñ' != u'\xf1'? 1 : -1]; // expected-error {{character too large for enclosing character literal type}} #if __cplusplus > 201402L char a = u8'ñ'; // expected-error {{character too large for enclosing character literal type}} char b = u8'\x80'; // ok char c = u8'\u0080'; // expected-error {{character too large for enclosing character literal type}} char d = u8'\u1234'; // expected-error {{character too large for enclosing character literal type}} char e = u8'ሴ'; // expected-error {{character too large for enclosing character literal type}} char f = u8'ab'; // expected-error {{Unicode character literals may not contain multiple characters}} #endif
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/bcpl-escaped-newline.c
// RUN: %clang_cc1 -Eonly -ftrigraphs %s // RUN: %clang_cc1 -Eonly -verify %s //\ #error bar //??/ #error qux // expected-error@-1 {{qux}} // Trailing whitespace! //\ #error quux // expected-warning@-2 {{backslash and newline separated by space}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/cxx0x_raw_string_delim_length.cpp
// RUN: %clang_cc1 -std=c++11 -verify %s const char *str1 = R"(abcdef)"; // ok const char *str2 = R"foo()foo"; // ok const char *str3 = R"()"; // ok // FIXME: recover better than this. const char *str4 = R"abcdefghijkmnopqrstuvwxyz(abcdef)abcdefghijkmnopqrstuvwxyz"; // expected-error {{raw string delimiter longer than 16 characters}} expected-error {{expected expression}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/char-escapes.c
// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s int test['\\' == 92 ? 1 : -1]; int test['\"' == 34 ? 1 : -1]; int test['\'' == 39 ? 1 : -1]; int test['\?' == 63 ? 1 : -1]; int test['\a' == 7 ? 1 : -1]; int test['\b' == 8 ? 1 : -1]; int test['\e' == 27 ? 1 : -1]; // expected-warning {{non-standard escape}} int test['\E' == 27 ? 1 : -1]; // expected-warning {{non-standard escape}} int test['\f' == 12 ? 1 : -1]; int test['\n' == 10 ? 1 : -1]; int test['\r' == 13 ? 1 : -1]; int test['\t' == 9 ? 1 : -1]; int test['\v' == 11 ? 1 : -1]; int test['\xa' == 10 ? 1 : -1]; int test['\1' == 1 ? 1 : -1]; int test['\(' == 40 ? 1 : -1]; // expected-warning {{non-standard escape}} int test['\{' == 123 ? 1 : -1]; // expected-warning {{non-standard escape}} int test['\[' == 91 ? 1 : -1]; // expected-warning {{non-standard escape}} int test['\%' == 37 ? 1 : -1]; // expected-warning {{non-standard escape}} const char *format = "abc \m def"; // expected-warning{{unknown escape sequence '\m'}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/wchar-signedness.c
// RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple x86_64-none-linux-gnu | FileCheck %s --check-prefix=CHECK-X86 // RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple armv7-none-eabi | FileCheck %s --check-prefix=CHECK-ARM // RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple thumbv7-none-eabi | FileCheck %s --check-prefix=CHECK-ARM // CHECK-X86-NOT: #define __WCHAR_UNSIGNED__ // CHECK-X86: #define __WINT_UNSIGNED__ 1 // CHECK-ARM: #define __WCHAR_UNSIGNED__ 1 // CHECK-ARM-NOT: #define __WINT_UNSIGNED__ 1
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/header.cpp
// RUN: %clang_cc1 -fsyntax-only -Wno-header-guard %s // RUN: %clang_cc1 -fsyntax-only -Wheader-guard %s 2>&1 | FileCheck %s #include "Inputs/good-header-guard.h" #include "Inputs/no-define.h" #include "Inputs/different-define.h" #include "Inputs/out-of-order-define.h" #include "Inputs/tokens-between-ifndef-and-define.h" #include "Inputs/unlikely-to-be-header-guard.h" #include "Inputs/bad-header-guard.h" // CHECK: In file included from {{.*}}header.cpp:{{[0-9]*}}: // CHECK: {{.*}}bad-header-guard.h:1:9: warning: 'bad_header_guard' is used as a header guard here, followed by #define of a different macro // CHECK: {{^}}#ifndef bad_header_guard // CHECK: {{^}} ^~~~~~~~~~~~~~~~ // CHECK: {{.*}}bad-header-guard.h:2:9: note: 'bad_guard' is defined here; did you mean 'bad_header_guard'? // CHECK: {{^}}#define bad_guard // CHECK: {{^}} ^~~~~~~~~ // CHECK: {{^}} bad_header_guard #include "Inputs/bad-header-guard-defined.h" // CHECK: In file included from {{.*}}header.cpp:{{[0-9]*}}: // CHECK: {{.*}}bad-header-guard-defined.h:1:2: warning: 'foo' is used as a header guard here, followed by #define of a different macro // CHECK: {{^}}#if !defined(foo) // CHECK: {{^}} ^~ // CHECK: {{.*}}bad-header-guard-defined.h:2:9: note: 'goo' is defined here; did you mean 'foo'? // CHECK: {{^}}#define goo // CHECK: {{^}} ^~~ // CHECK: {{^}} foo #include "Inputs/multiple.h" #include "Inputs/multiple.h" #include "Inputs/multiple.h" #include "Inputs/multiple.h" // CHECK: In file included from {{.*}}header.cpp:{{[0-9]*}}: // CHECK: {{.*}}multiple.h:1:9: warning: 'multiple' is used as a header guard here, followed by #define of a different macro // CHECK: {{^}}#ifndef multiple // CHECK: {{^}} ^~~~~~~~ // CHECK: {{.*}}multiple.h:2:9: note: 'multi' is defined here; did you mean 'multiple'? // CHECK: {{^}}#define multi // CHECK: {{^}} ^~~~~ // CHECK: {{^}} multiple // CHECK: 3 warnings generated.
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/rdr-6096838-2.c
/* RUN: %clang_cc1 -triple x86_64-unknown-unknown -pedantic -std=gnu89 -fsyntax-only -verify %s rdar://6096838 */ long double d = 0x0.0000003ffffffff00000p-16357L; /* expected-warning {{hexadecimal floating constants are a C99 feature}} */
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/block_cmt_end.c
/* RUN: %clang_cc1 -E -ftrigraphs %s | grep bar RUN: %clang_cc1 -E -ftrigraphs %s | grep foo RUN: %clang_cc1 -E -ftrigraphs %s | not grep qux RUN: %clang_cc1 -E -ftrigraphs %s | not grep xyz RUN: %clang_cc1 -fsyntax-only -ftrigraphs -verify %s */ // This is a simple comment, /*/ does not end a comment, the trailing */ does. int i = /*/ */ 1; /* qux next comment ends with normal escaped newline: */ /* expected-warning {{escaped newline}} expected-warning {{backslash and newline}} *\ / int bar /* expected-error {{expected ';' after top level declarator}} */ /* xyz next comment ends with a trigraph escaped newline: */ /* expected-warning {{escaped newline between}} expected-warning {{backslash and newline separated by space}} expected-warning {{trigraph ends block comment}} *??/ / foo // rdar://6060752 - We should not get warnings about trigraphs in comments: // '????' /* ???? */
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/long-long.cpp
/* RUN: %clang_cc1 -x c -std=c89 -fsyntax-only -verify -pedantic-errors -Wno-empty-translation-unit %s * RUN: %clang_cc1 -x c -std=c99 -fsyntax-only -verify -pedantic-errors -Wno-empty-translation-unit %s * RUN: %clang_cc1 -x c++ -std=c++98 -fsyntax-only -verify -pedantic-errors -Wno-empty-translation-unit %s * RUN: %clang_cc1 -x c++ -std=c++11 -fsyntax-only -verify -Wc++98-compat-pedantic -Wno-empty-translation-unit %s */ #if !defined(__cplusplus) # if __STDC_VERSION__ < 199901L /* expected-error@21 {{'long long' is an extension when C99 mode is not enabled}} */ # else /* expected-no-diagnostics */ # endif #else # if __cplusplus < 201103L /* expected-error@21 {{'long long' is a C++11 extension}} */ # else /* expected-warning@21 {{'long long' is incompatible with C++98}} */ # endif #endif #if 1 > 2LL # error should not happen #endif
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/conflict-marker.c
// RUN: %clang_cc1 %s -verify -fsyntax-only // Test that we recover gracefully from conflict markers left in input files. // PR5238 // diff3 style expected-error@+1 {{version control conflict marker in file}} <<<<<<< .mine int x = 4; ||||||| int x = 123; ======= float x = 17; >>>>>>> .r91107 // normal style expected-error@+1 {{version control conflict marker in file}} <<<<<<< .mine typedef int y; ======= typedef struct foo *y; >>>>>>> .r91107 // Perforce style expected-error@+1 {{version control conflict marker in file}} >>>> ORIGINAL conflict-marker.c#6 int z = 1; ==== THEIRS conflict-marker.c#7 int z = 0; ==== YOURS conflict-marker.c int z = 2; <<<< ; y b; int foo() { y a = x; return x + a - z; } <<<<<<<>>>>>>> // expected-error {{expected identifier}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/newline-eof.c
// RUN: %clang_cc1 -fsyntax-only -Wnewline-eof -verify %s // RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s // RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++03 -pedantic -verify %s // RUN: %clang_cc1 -fsyntax-only -Wnewline-eof %s 2>&1 | FileCheck %s // rdar://9133072 // In C++11 mode, this is allowed, so don't warn in pedantic mode. // RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++11 -Wnewline-eof -verify %s // RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++11 -Werror -pedantic %s // Make sure the diagnostic shows up properly at the end of the last line. // CHECK: newline-eof.c:[[@LINE+3]]:63 // The following line isn't terminated, don't fix it. void foo() {} // expected-warning{{no newline at end of file}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/string-literal-errors.cpp
// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s void foo() { (void)"\q \u123z \x \U \U123 \U12345 \u123 \xyzzy \777 \U" // CHECK: {{^ \(void\)"\\q \\u123z \\x \\U \\U123 \\U12345 \\u123 \\xyzzy \\777 \\U"$}} // // (void)"\q \u123z \x \U \U123 \U12345 \u123 \xyzzy \777 \U" // CHECK: {{^ \^~$}} // CHECK: {{^ \^~~~~$}} // CHECK: {{^ \^~$}} // CHECK: {{^ \^~$}} // CHECK: {{^ \^~~~~$}} // CHECK: {{^ \^~~~~~~$}} // CHECK: {{^ \^~~~~$}} // CHECK: {{^ \^~$}} // CHECK: {{^ \^~~~$}} // CHECK: {{^ \^~$}} "123 \x \z"; // CHECK: {{^ "123 \\x \\z";$}} // // "123 \x \z"; // CHECK: {{^ \^~$}} // CHECK: {{^ \^~$}} } #define foo() lots and lots of tokens, need at least 8 to fill up the smallvector buffer #BadThingsHappenNow
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/has_feature_address_sanitizer.cpp
// RUN: %clang_cc1 -E -fsanitize=address %s -o - | FileCheck --check-prefix=CHECK-ASAN %s // RUN: %clang_cc1 -E -fsanitize=kernel-address %s -o - | FileCheck --check-prefix=CHECK-ASAN %s // RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-ASAN %s #if __has_feature(address_sanitizer) int AddressSanitizerEnabled(); #else int AddressSanitizerDisabled(); #endif // CHECK-ASAN: AddressSanitizerEnabled // CHECK-NO-ASAN: AddressSanitizerDisabled
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/eof-file.c
// RUN: %clang_cc1 %s -verify -fsyntax-only // vim: set binary noeol: // This file intentionally ends without a \n on the last line. Make sure your // editor doesn't add one. // expected-error@+1{{expected expression}} expected-error@+1{{expected ';'}} char c = \
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/has_feature_memory_sanitizer.cpp
// RUN: %clang_cc1 -E -fsanitize=memory %s -o - | FileCheck --check-prefix=CHECK-MSAN %s // RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-MSAN %s #if __has_feature(memory_sanitizer) int MemorySanitizerEnabled(); #else int MemorySanitizerDisabled(); #endif // CHECK-MSAN: MemorySanitizerEnabled // CHECK-NO-MSAN: MemorySanitizerDisabled
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/preamble.c
// Preamble detection test: see below for comments and test commands. //* A BCPL comment that includes '/*' #include <blah> #ifndef FOO #else #ifdef BAR #elif WIBBLE #endif #pragma unknown #endif #ifdef WIBBLE #include "honk" #else int foo(); #endif // This test checks for detection of the preamble of a file, which // includes all of the starting comments and #includes. Note that any // changes to the preamble part of this file must be mirrored in // Inputs/preamble.txt, since we diff against it. // RUN: %clang_cc1 -print-preamble %s > %t // RUN: echo END. >> %t // RUN: FileCheck < %t %s // CHECK: // Preamble detection test: see below for comments and test commands. // CHECK-NEXT: //* A BCPL comment that includes '/*' // CHECK-NEXT: #include <blah> // CHECK-NEXT: #ifndef FOO // CHECK-NEXT: #else // CHECK-NEXT: #ifdef BAR // CHECK-NEXT: #elif WIBBLE // CHECK-NEXT: #endif // CHECK-NEXT: #pragma unknown // CHECK-NEXT: #endif // CHECK-NEXT: END.
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/rdar-8914293.c
// RUN: %clang_cc1 -fsyntax-only -verify %s // rdar://8914293 // We want be compatible with gcc and warn, not error. /* expected-warning {{missing terminating}} */ #define FOO "foo /* expected-warning {{missing terminating}} */ #define KOO 'k
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/badstring_in_if0.c
// RUN: %clang_cc1 -E -verify %s // expected-no-diagnostics #if 0 " ' #endif
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/has_feature_rtti.cpp
// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-RTTI %s // RUN: %clang_cc1 -E -fno-rtti %s -o - | FileCheck --check-prefix=CHECK-NO-RTTI %s #if __has_feature(cxx_rtti) int foo(); #else int bar(); #endif // CHECK-RTTI: foo // CHECK-NO-RTTI: bar
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/newline-eof-c++98-compat.cpp
// RUN: %clang_cc1 -fsyntax-only -Wc++98-compat-pedantic -std=c++11 -verify %s // RUN: %clang_cc1 -fsyntax-only -Wc++98-compat-pedantic -Wnewline-eof -std=c++11 -verify %s // The following line isn't terminated, don't fix it. void foo() {} // expected-warning{{C++98 requires newline at end of file}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/token-concat.cpp
// RUN: %clang_cc1 -E -std=c++11 -o - %s | FileCheck %s #define id(x) x id("s")_x // CHECK: "s" _x id(L"s")_x // CHECK: L"s" _x id(u8"s")_x // CHECK: u8"s" _x id(u"s")_x // CHECK: u"s" _x id(U"s")_x // CHECK: U"s" _x id('s')_x // CHECK: 's' _x id(L's')_x // CHECK: L's' _x id(u's')_x // CHECK: u's' _x id(U's')_x // CHECK: U's' _x id("s"_x)_y // CHECK: "s"_x _y id(1.0_)f // CHECK: 1.0_ f id(1.0)_f // CHECK: 1.0 _f id(0xface+)b_count // CHECK: 0xface+ b_count id("s")1 // CHECK: "s"1 id("s"_x)1 // CHECK: "s"_x 1 id(1)_2_x // CHECK: 1 _2_x
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/has_extension.c
// RUN: %clang_cc1 -std=c99 -E %s -o - | FileCheck --check-prefix=CHECK-PED-NONE %s // RUN: %clang_cc1 -std=c99 -pedantic-errors -E %s -o - | FileCheck --check-prefix=CHECK-PED-ERR %s // CHECK-PED-NONE: no_dummy_extension #if !__has_extension(dummy_extension) int no_dummy_extension(); #endif // Arbitrary feature to test that has_extension is a superset of has_feature // CHECK-PED-NONE: attribute_overloadable #if __has_extension(attribute_overloadable) int attribute_overloadable(); #endif // CHECK-PED-NONE: has_c_static_assert // CHECK-PED-ERR: no_c_static_assert #if __has_extension(c_static_assert) int has_c_static_assert(); #else int no_c_static_assert(); #endif // CHECK-PED-NONE: has_c_generic_selections // CHECK-PED-ERR: no_c_generic_selections #if __has_extension(c_generic_selections) int has_c_generic_selections(); #else int no_c_generic_selections(); #endif // CHECK-PED-NONE: has_c_alignas // CHECK-PED-ERR: no_c_alignas #if __has_extension(c_alignas) int has_c_alignas(); #else int no_c_alignas(); #endif // CHECK-PED-NONE: has_c_alignof // CHECK-PED-ERR: no_c_alignof #if __has_extension(c_alignof) int has_c_alignof(); #else int no_c_alignof(); #endif // Arbitrary feature to test that the extension name can be surrounded with // double underscores. // CHECK-PED-NONE: has_double_underscores #if __has_extension(__c_alignas__) int has_double_underscores(); #endif
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/constants.c
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -ftrigraphs %s int x = 000000080; // expected-error {{invalid digit}} int y = 0000\ 00080; // expected-error {{invalid digit}} float X = 1.17549435e-38F; float Y = 08.123456; // PR2252 #if -0x8000000000000000 // should not warn. #endif #if -01000000000000000000000 // should not warn. #endif #if 9223372036854775808 // expected-warning {{integer literal is too large to be represented in a signed integer type, interpreting as unsigned}} #endif #if 0x10000000000000000 // expected-error {{integer literal is too large to be represented in any integer type}} #endif int c[] = { 'df', // expected-warning {{multi-character character constant}} '\t', '\\ t', '??!', // expected-warning {{trigraph converted to '|' character}} 'abcd' // expected-warning {{multi-character character constant}} }; // PR4499 int m0 = '0'; int m1 = '\\\''; // expected-warning {{multi-character character constant}} int m2 = '\\\\'; // expected-warning {{multi-character character constant}} int m3 = '\\\ '; #pragma clang diagnostic ignored "-Wmultichar" int d = 'df'; // no warning. int e = 'abcd'; // still warn: expected-warning {{multi-character character constant}} #pragma clang diagnostic ignored "-Wfour-char-constants" int f = 'abcd'; // ignored. // rdar://problem/6974641 float t0[] = { 1.9e20f, 1.9e-20f, 1.9e50f, // expected-warning {{too large}} 1.9e-50f, // expected-warning {{too small}} -1.9e20f, -1.9e-20f, -1.9e50f, // expected-warning {{too large}} -1.9e-50f // expected-warning {{too small}} }; double t1[] = { 1.9e50, 1.9e-50, 1.9e500, // expected-warning {{too large}} 1.9e-500, // expected-warning {{too small}} -1.9e50, -1.9e-50, -1.9e500, // expected-warning {{too large}} -1.9e-500 // expected-warning {{too small}} }; // PR7888 double g = 1e100000000; // expected-warning {{too large}} char h = '\u1234'; // expected-error {{character too large for enclosing character literal type}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/keywords_test.cpp
// RUN: %clang_cc1 -std=c++03 -fsyntax-only %s // RUN: %clang_cc1 -std=c++11 -DCXX11 -fsyntax-only %s // RUN: %clang_cc1 -std=c++14 -fconcepts-ts -DCXX11 -DCONCEPTS -fsyntax-only %s #define IS_KEYWORD(NAME) _Static_assert(!__is_identifier(NAME), #NAME) #define NOT_KEYWORD(NAME) _Static_assert(__is_identifier(NAME), #NAME) #define IS_TYPE(NAME) void is_##NAME##_type() { int f(NAME); } #ifdef CONCEPTS #define CONCEPTS_KEYWORD(NAME) IS_KEYWORD(NAME) #else #define CONCEPTS_KEYWORD(NAME) NOT_KEYWORD(NAME) #endif #ifdef CXX11 #define CXX11_KEYWORD(NAME) IS_KEYWORD(NAME) #define CXX11_TYPE(NAME) IS_TYPE(NAME) #else #define CXX11_KEYWORD(NAME) NOT_KEYWORD(NAME) #define CXX11_TYPE(NAME) #endif // C++11 keywords CXX11_KEYWORD(nullptr); CXX11_KEYWORD(decltype); CXX11_KEYWORD(alignof); CXX11_KEYWORD(alignas); CXX11_KEYWORD(char16_t); CXX11_TYPE(char16_t); CXX11_KEYWORD(char32_t); CXX11_TYPE(char32_t); CXX11_KEYWORD(constexpr); CXX11_KEYWORD(noexcept); CXX11_KEYWORD(static_assert); CXX11_KEYWORD(thread_local); // Concepts TS keywords CONCEPTS_KEYWORD(concept); CONCEPTS_KEYWORD(requires); // Clang extension IS_KEYWORD(__char16_t); IS_TYPE(__char16_t); IS_KEYWORD(__char32_t); IS_TYPE(__char32_t);
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/escape_newline.c
// RUN: %clang_cc1 -E -ftrigraphs %s | grep -- ' ->' // RUN: %clang_cc1 -E -ftrigraphs %s 2>&1 | grep 'backslash and newline separated by space' // RUN: %clang_cc1 -E -ftrigraphs %s 2>&1 | grep 'trigraph converted' // RUN: %clang_cc1 -E -CC -ftrigraphs %s // This is an ugly way to spell a -> token. -??/ > // \
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/has_feature_type_traits.cpp
// RUN: %clang_cc1 -E %s -o - | FileCheck %s #if __has_feature(has_nothrow_assign) int has_nothrow_assign(); #endif // CHECK: int has_nothrow_assign(); #if __has_feature(has_nothrow_copy) int has_nothrow_copy(); #endif // CHECK: int has_nothrow_copy(); #if __has_feature(has_nothrow_constructor) int has_nothrow_constructor(); #endif // CHECK: int has_nothrow_constructor(); #if __has_feature(has_trivial_assign) int has_trivial_assign(); #endif // CHECK: int has_trivial_assign(); #if __has_feature(has_trivial_copy) int has_trivial_copy(); #endif // CHECK: int has_trivial_copy(); #if __has_feature(has_trivial_constructor) int has_trivial_constructor(); #endif // CHECK: int has_trivial_constructor(); #if __has_feature(has_trivial_destructor) int has_trivial_destructor(); #endif // CHECK: int has_trivial_destructor(); #if __has_feature(has_virtual_destructor) int has_virtual_destructor(); #endif // CHECK: int has_virtual_destructor(); #if __has_feature(is_abstract) int is_abstract(); #endif // CHECK: int is_abstract(); #if __has_feature(is_base_of) int is_base_of(); #endif // CHECK: int is_base_of(); #if __has_feature(is_class) int is_class(); #endif // CHECK: int is_class(); #if __has_feature(is_constructible) int is_constructible(); #endif // CHECK: int is_constructible(); #if __has_feature(is_convertible_to) int is_convertible_to(); #endif // CHECK: int is_convertible_to(); #if __has_feature(is_empty) int is_empty(); #endif // CHECK: int is_empty(); #if __has_feature(is_enum) int is_enum(); #endif // CHECK: int is_enum(); #if __has_feature(is_final) int is_final(); #endif // CHECK: int is_final(); #if __has_feature(is_pod) int is_pod(); #endif // CHECK: int is_pod(); #if __has_feature(is_polymorphic) int is_polymorphic(); #endif // CHECK: int is_polymorphic(); #if __has_feature(is_union) int is_union(); #endif // CHECK: int is_union(); #if __has_feature(is_literal) int is_literal(); #endif // CHECK: int is_literal(); #if __has_feature(is_standard_layout) int is_standard_layout(); #endif // CHECK: int is_standard_layout(); #if __has_feature(is_trivially_copyable) int is_trivially_copyable(); #endif // CHECK: int is_trivially_copyable(); #if __has_feature(underlying_type) int underlying_type(); #endif // CHECK: int underlying_type();
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/utf-16.c
// RUN: %clang_cc1 %s -fsyntax-only -verify // rdar://7876588 // This test verifies that clang gives a decent error for UTF-16 source files. #include "utf-16.c.txt" // expected-error {{UTF-16 (LE) byte order mark detected}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/cross-windows-on-linux.cpp
// RUN: not %clang_cc1 -fsyntax-only -triple i686-win32 %s 2>&1 | FileCheck %s #include "Inputs\success.h" // CHECK: error: 'Inputs\success.h' file not found // CHECK: #include "Inputs\success.h" // CHECK: ^ // expected to fail on windows as the inclusion would succeed and the // compilation will fail due to the '#error success'. // XFAIL: win32 // This test may or may not fail since 'Inputs\success.h' is passed // to Win32 APIs on Windows. // REQUIRES: disabled
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/has_feature_thread_sanitizer.cpp
// RUN: %clang_cc1 -E -fsanitize=thread %s -o - | FileCheck --check-prefix=CHECK-TSAN %s // RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-TSAN %s #if __has_feature(thread_sanitizer) int ThreadSanitizerEnabled(); #else int ThreadSanitizerDisabled(); #endif // CHECK-TSAN: ThreadSanitizerEnabled // CHECK-NO-TSAN: ThreadSanitizerDisabled
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/ms-extensions.cpp
// RUN: %clang_cc1 -fsyntax-only -verify -Wreserved-user-defined-literal -fms-extensions -fms-compatibility %s #define bar(x) #x const char * f() { return "foo"bar("bar")"baz"; /*expected-warning {{identifier after literal will be treated as a reserved user-defined literal suffix in C++11}} */ }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/unknown-char.c
// RUN: %clang_cc1 -E -verify %s // expected-no-diagnostics ` ` ` `
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/cxx0x_raw_string_directives.cpp
// RUN: %clang_cc1 -std=c++11 -fsyntax-only %s // RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify %s // expected-error@8 {{in c++98 only}} #if 0 R"( #else #error in c++98 only)" #endif
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/unicode-strings.c
// RUN: %clang_cc1 -x c -std=c11 -Werror %s // RUN: %clang_cc1 -x c++ -std=c++11 -Werror %s // RUN: %clang_cc1 -x c -std=c11 -Wc99-compat -verify %s // RUN: %clang_cc1 -x c++ -std=c++11 -Wc++98-compat -verify %s #ifndef __cplusplus typedef __CHAR16_TYPE__ char16_t; typedef __CHAR32_TYPE__ char32_t; #else // expected-warning@17 {{'char16_t' type specifier is incompatible with C++98}} // expected-warning@18 {{'char32_t' type specifier is incompatible with C++98}} // expected-warning@20 {{'char16_t' type specifier is incompatible with C++98}} // expected-warning@21 {{'char32_t' type specifier is incompatible with C++98}} #endif const char *a = u8"abcd"; // expected-warning {{unicode literals are incompatible with}} const char16_t *b = u"abcd"; // expected-warning {{unicode literals are incompatible with}} const char32_t *c = U"abcd"; // expected-warning {{unicode literals are incompatible with}} char16_t d = u'a'; // expected-warning {{unicode literals are incompatible with}} char32_t e = U'a'; // expected-warning {{unicode literals are incompatible with}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/cxx1y_binary_literal.cpp
// RUN: %clang_cc1 -std=c++1y %s -verify static_assert(0b1001 == 9, ""); using I = int; using I = decltype(0b101001); using ULL = unsigned long long; using ULL = decltype(0b10101001ULL); constexpr unsigned long long operator""_foo(unsigned long long n) { return n * 2; } static_assert(0b10001111_foo == 286, ""); int k1 = 0b1234; // expected-error {{invalid digit '2' in binary constant}} // FIXME: If we ever need to support a standard suffix starting with [a-f], // we'll need to rework our binary literal parsing rules. int k2 = 0b10010f; // expected-error {{invalid digit 'f' in binary constant}} int k3 = 0b10010g; // expected-error {{invalid suffix 'g' on integer constant}} int k4 = 0b; // expected-error {{invalid digit 'b' in octal constant}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/pragma-operators.cpp
// RUN: %clang_cc1 -fms-extensions -std=c++11 -E %s -fuse-line-directives | FileCheck %s // Test that we properly expand the C99 _Pragma and Microsoft __pragma // into #pragma directives, with newlines where needed. <rdar://problem/8412013> // CHECK: #line // CHECK: #pragma warning(push) // CHECK: extern "C" { // CHECK: #line // CHECK: #pragma warning(push) // CHECK: int foo() { return 0; } } // CHECK: #pragma warning(pop) #define A(X) extern "C" { __pragma(warning(push)) \ int X() { return 0; } \ } #define B(X) A(X) #pragma warning(push) B(foo) #pragma warning(pop) #define pragma_L _Pragma(L"GCC diagnostic push") #define pragma_u8 _Pragma(u8"system_header") #define pragma_u _Pragma(u"GCC diagnostic pop") #define pragma_U _Pragma(U"comment(lib, \"libfoo\")") #define pragma_R _Pragma(R"(clang diagnostic ignored "-Wunused")") #define pragma_UR _Pragma(UR"(clang diagnostic error "-Wunused")") #define pragma_hello _Pragma(u8R"x(message R"y("Hello", world!)y")x") // CHECK: int n = // CHECK: #pragma GCC diagnostic push // CHECK: #pragma system_header // CHECK: #pragma GCC diagnostic pop // CHECK: #pragma comment(lib, "libfoo") // CHECK: #pragma clang diagnostic ignored "-Wunused" // CHECK: #pragma clang diagnostic error "-Wunused" // CHECK: #pragma message("\042Hello\042, world!") // CHECK: 0; int n = pragma_L pragma_u8 pragma_u pragma_U pragma_R pragma_UR pragma_hello 0; #pragma warning(disable : 1 2L 3U ; error : 4 5 6 ; suppress : 7 8 9) // CHECK: #pragma warning(disable: 1 2 3) // CHECK: #line [[@LINE-2]] // CHECK: #pragma warning(error: 4 5 6) // CHECK: #line [[@LINE-4]] // CHECK: #pragma warning(suppress: 7 8 9) #pragma warning(push) #pragma warning(push, 1L) #pragma warning(push, 4U) #pragma warning(push, 0x1) #pragma warning(push, 03) #pragma warning(push, 0b10) #pragma warning(push, 1i8) // CHECK: #pragma warning(push) // CHECK: #pragma warning(push, 1) // CHECK: #pragma warning(push, 4) // CHECK: #pragma warning(push, 1) // CHECK: #pragma warning(push, 3) // CHECK: #pragma warning(push, 2) // CHECK: #pragma warning(push, 1)
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/wchar.c
// RUN: %clang_cc1 -fsyntax-only -fshort-wchar -verify %s void f() { (void)L"\U00010000"; // unicode escape produces UTF-16 sequence, so no warning (void)L'\U00010000'; // expected-error {{character too large for enclosing character literal type}} (void)L'ab'; // expected-warning {{extraneous characters in character constant ignored}} (void)L'a\u1000'; // expected-warning {{extraneous characters in character constant ignored}} }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/cxx1y_digit_separators.cpp
// RUN: %clang_cc1 -std=c++1y -verify %s int operator""ms(unsigned long long); // expected-warning {{reserved}} float operator""ms(long double); // expected-warning {{reserved}} int operator""_foo(unsigned long long); namespace integral { static_assert(1'2'3 == 12'3, ""); static_assert(1'000'000 == 0xf'4240, ""); static_assert(0'004'000'000 == 0x10'0000, ""); static_assert(0b0101'0100 == 0x54, ""); int a = 123'; //'; // expected-error {{expected ';'}} int b = 0'xff; // expected-error {{digit separator cannot appear at end of digit sequence}} expected-error {{suffix 'xff' on integer}} int c = 0x'ff; // expected-error {{suffix 'x'ff' on integer}} int d = 0'1234; // ok, octal int e = 0'b1010; // expected-error {{digit 'b' in octal constant}} int f = 0b'1010; // expected-error {{invalid digit 'b' in octal}} int g = 123'ms; // expected-error {{digit separator cannot appear at end of digit sequence}} int h = 0x1e+1; // expected-error {{invalid suffix '+1' on integer constant}} int i = 0x1'e+1; // ok, 'e+' is not recognized after a digit separator int z = 0'123'_foo; //'; // expected-error {{cannot appear at end of digit seq}} } namespace floating { static_assert(0'123.456'7 == 123.4567, ""); static_assert(1e1'0 == 10'000'000'000, ""); float a = 1'e1; // expected-error {{digit separator cannot appear at end of digit sequence}} float b = 1'0e1; float c = 1.'0e1; // expected-error {{digit separator cannot appear at start of digit sequence}} float d = 1.0'e1; // expected-error {{digit separator cannot appear at end of digit sequence}} float e = 1e'1; // expected-error {{digit separator cannot appear at start of digit sequence}} float f = 1e1'ms; // expected-error {{digit separator cannot appear at end of digit sequence}} float g = 0.'0; // expected-error {{digit separator cannot appear at start of digit sequence}} float h = .'0; // '; // expected-error {{expected expression}}, lexed as . followed by character literal float i = 0x.'0p0; // expected-error {{digit separator cannot appear at start of digit sequence}} float j = 0x'0.0p0; // expected-error {{invalid suffix 'x'0.0p0'}} float k = 0x0'.0p0; // '; // expected-error {{expected ';'}} float l = 0x0.'0p0; // expected-error {{digit separator cannot appear at start of digit sequence}} float m = 0x0.0'p0; // expected-error {{digit separator cannot appear at end of digit sequence}} float n = 0x0.0p'0; // expected-error {{digit separator cannot appear at start of digit sequence}} float o = 0x0.0p0'ms; // expected-error {{digit separator cannot appear at end of digit sequence}} float p = 0'e1; // expected-error {{digit separator cannot appear at end of digit sequence}} float q = 0'0e1; float r = 0.'0e1; // expected-error {{digit separator cannot appear at start of digit sequence}} float s = 0.0'e1; // expected-error {{digit separator cannot appear at end of digit sequence}} float t = 0.0e'1; // expected-error {{digit separator cannot appear at start of digit sequence}} } #line 123'456 static_assert(__LINE__ == 123456, ""); // x has value 0 in C++11 and 34 in C++1y. #define M(x, ...) __VA_ARGS__ constexpr int x = { M(1'2,3'4) }; static_assert(x == 34, ""); namespace UCNs { // UCNs can appear before digit separators but not after. int a = 0\u1234'5; // expected-error {{invalid suffix '\u1234'5' on integer constant}} int b = 0'\u12345; // '; // expected-error {{expected ';'}} constexpr int c {M(0\u1234'0,0'1)}; constexpr int d {M(00'\u1234,0'1)}; static_assert(c == 1, ""); static_assert(d == 0, ""); } namespace UTF8 { // extended characters can appear before digit separators but not after. int a = 0ሴ'5; // expected-error {{invalid suffix 'ሴ'5' on integer constant}} int b = 0'ሴ5; // '; // expected-error {{expected ';'}} constexpr int c {M(0ሴ'0,0'1)}; constexpr int d {M(00'ሴ,0'1)}; static_assert(c == 1, ""); static_assert(d == 0, ""); }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/cxx0x_keyword_as_cxx98.cpp
// RUN: %clang_cc1 %s -verify -fsyntax-only -Wc++11-compat #define constexpr const constexpr int x = 0; #undef constexpr namespace lib { struct nullptr_t; typedef nullptr_t nullptr; // expected-warning {{'nullptr' is a keyword in C++11}} } #define CONCAT(X,Y) CONCAT2(X,Y) #define CONCAT2(X,Y) X ## Y int CONCAT(constexpr,ession); #define ID(X) X extern int ID(decltype); // expected-warning {{'decltype' is a keyword in C++11}} extern int CONCAT(align,of); // expected-warning {{'alignof' is a keyword in C++11}} #define static_assert(b, s) int CONCAT(check, __LINE__)[(b) ? 1 : 0]; static_assert(1 > 0, "hello"); // ok #define IF_CXX11(CXX11, CXX03) CXX03 typedef IF_CXX11(char16_t, wchar_t) my_wide_char_t; // ok int alignas; // expected-warning {{'alignas' is a keyword in C++11}} int alignof; // already diagnosed in this TU int char16_t; // expected-warning {{'char16_t' is a keyword in C++11}} int char32_t; // expected-warning {{'char32_t' is a keyword in C++11}} int constexpr; // expected-warning {{'constexpr' is a keyword in C++11}} int decltype; // already diagnosed in this TU int noexcept; // expected-warning {{'noexcept' is a keyword in C++11}} int nullptr; // already diagnosed in this TU int static_assert; // expected-warning {{'static_assert' is a keyword in C++11}} int thread_local; // expected-warning {{'thread_local' is a keyword in C++11}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/msdos-cpm-eof.c
// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s // expected-no-diagnostics int x;  I am random garbage after ^Z
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/numeric-literal-trash.c
/* RUN: %clang_cc1 -fsyntax-only -verify %s * expected-no-diagnostics */ # define XRECORD(x, c_name) e##c (x, __LINE__) int ec(int, int); void x() { XRECORD (XRECORD (1, 1), 1); }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/ms-extensions.c
// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s // RUN: %clang_cc1 -fsyntax-only -verify -fms-compatibility %s // RUN: %clang_cc1 -fsyntax-only -verify -triple i386-pc-win32 -fms-compatibility %s __int8 x1 = 3i8; __int16 x2 = 4i16; __int32 x3 = 5i32; __int64 x5 = 0x42i64; __int64 x6 = 0x42I64; #ifndef __SIZEOF_INT128__ // expected-error@+2 {{__int128 is not supported on this target}} #endif __int64 x4 = 70000000i128; __int64 y = 0x42i64u; // expected-error {{invalid suffix}} __int64 w = 0x43ui64; __int64 z = 9Li64; // expected-error {{invalid suffix}} __int64 q = 10lli64; // expected-error {{invalid suffix}} __complex double c1 = 1i; __complex double c2 = 1.0i; __complex float c3 = 1.0if; // radar 7562363 #define ULLONG_MAX 0xffffffffffffffffui64 #define UINT 0xffffffffui32 #define USHORT 0xffffui16 #define UCHAR 0xffui8 void a() { unsigned long long m = ULLONG_MAX; unsigned int n = UINT; unsigned short s = USHORT; unsigned char c = UCHAR; } void pr_7968() { int var1 = 0x1111111e+1; int var2 = 0X1111111e+1; int var3 = 0xe+1; int var4 = 0XE+1; int var5= 0\ x1234e+1; int var6= /*expected-warning {{backslash and newline separated by space}} */ 0\ x1234e+1; }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/eof-char.c
// RUN: %clang_cc1 %s -verify -fsyntax-only // vim: set binary noeol: // This file intentionally ends without a \n on the last line. Make sure your // editor doesn't add one. // expected-warning@+1{{missing terminating ' character}} expected-error@+1{{expected expression}} expected-error@+1{{expected ';'}} char c = '\
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/eof-string.c
// RUN: %clang_cc1 %s -verify -fsyntax-only // vim: set binary noeol: // This file intentionally ends without a \n on the last line. Make sure your // editor doesn't add one. // expected-warning@+1{{missing terminating '"' character}} expected-error@+1{{expected expression}} expected-error@+1{{expected ';'}} char c = "\
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/cxx-features.cpp
// RUN: %clang_cc1 -std=c++98 -verify %s // RUN: %clang_cc1 -std=c++11 -verify %s // RUN: %clang_cc1 -std=c++1y -fsized-deallocation -verify %s // RUN: %clang_cc1 -std=c++1y -fsized-deallocation -fconcepts-ts -DCONCEPTS_TS=1 -verify %s // expected-no-diagnostics #if __cplusplus < 201103L #define check(macro, cxx98, cxx11, cxx1y) cxx98 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx98 #elif __cplusplus < 201304L #define check(macro, cxx98, cxx11, cxx1y) cxx11 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx11 #else #define check(macro, cxx98, cxx11, cxx1y) cxx1y == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx1y #endif #if check(binary_literals, 0, 0, 201304) #error "wrong value for __cpp_binary_literals" #endif #if check(digit_separators, 0, 0, 201309) #error "wrong value for __cpp_digit_separators" #endif #if check(init_captures, 0, 0, 201304) #error "wrong value for __cpp_init_captures" #endif #if check(generic_lambdas, 0, 0, 201304) #error "wrong value for __cpp_generic_lambdas" #endif #if check(sized_deallocation, 0, 0, 201309) #error "wrong value for __cpp_sized_deallocation" #endif #if check(constexpr, 0, 200704, 201304) #error "wrong value for __cpp_constexpr" #endif #if check(decltype_auto, 0, 0, 201304) #error "wrong value for __cpp_decltype_auto" #endif #if check(return_type_deduction, 0, 0, 201304) #error "wrong value for __cpp_return_type_deduction" #endif #if check(runtime_arrays, 0, 0, 0) #error "wrong value for __cpp_runtime_arrays" #endif #if check(aggregate_nsdmi, 0, 0, 201304) #error "wrong value for __cpp_aggregate_nsdmi" #endif #if check(variable_templates, 0, 0, 201304) #error "wrong value for __cpp_variable_templates" #endif #if check(unicode_characters, 0, 200704, 200704) #error "wrong value for __cpp_unicode_characters" #endif #if check(raw_strings, 0, 200710, 200710) #error "wrong value for __cpp_raw_strings" #endif #if check(unicode_literals, 0, 200710, 200710) #error "wrong value for __cpp_unicode_literals" #endif #if check(user_defined_literals, 0, 200809, 200809) #error "wrong value for __cpp_user_defined_literals" #endif #if check(lambdas, 0, 200907, 200907) #error "wrong value for __cpp_lambdas" #endif #if check(range_based_for, 0, 200907, 200907) #error "wrong value for __cpp_range_based_for" #endif #if check(static_assert, 0, 200410, 200410) #error "wrong value for __cpp_static_assert" #endif #if check(decltype, 0, 200707, 200707) #error "wrong value for __cpp_decltype" #endif #if check(attributes, 0, 200809, 200809) #error "wrong value for __cpp_attributes" #endif #if check(rvalue_references, 0, 200610, 200610) #error "wrong value for __cpp_rvalue_references" #endif #if check(variadic_templates, 0, 200704, 200704) #error "wrong value for __cpp_variadic_templates" #endif #if check(initializer_lists, 0, 200806, 200806) #error "wrong value for __cpp_initializer_lists" #endif #if check(delegating_constructors, 0, 200604, 200604) #error "wrong value for __cpp_delegating_constructors" #endif #if check(nsdmi, 0, 200809, 200809) #error "wrong value for __cpp_nsdmi" #endif #if check(inheriting_constructors, 0, 200802, 200802) #error "wrong value for __cpp_inheriting_constructors" #endif #if check(ref_qualifiers, 0, 200710, 200710) #error "wrong value for __cpp_ref_qualifiers" #endif #if check(alias_templates, 0, 200704, 200704) #error "wrong value for __cpp_alias_templates" #endif #if check(experimental_concepts, 0, 0, CONCEPTS_TS) #error "wrong value for __cpp_experimental_concepts" #endif
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/comment-escape.c
// RUN: %clang -fsyntax-only %s // rdar://6757323 // foo \ #define blork 32
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/keywords_test.c
// RUN: %clang_cc1 -std=c99 -E %s -o - | FileCheck --check-prefix=CHECK-NONE %s // RUN: %clang_cc1 -std=gnu89 -E %s -o - \ // RUN: | FileCheck --check-prefix=CHECK-GNU-KEYWORDS %s // RUN: %clang_cc1 -std=c99 -fgnu-keywords -E %s -o - \ // RUN: | FileCheck --check-prefix=CHECK-GNU-KEYWORDS %s // RUN: %clang_cc1 -std=gnu89 -fno-gnu-keywords -E %s -o - \ // RUN: | FileCheck --check-prefix=CHECK-NONE %s // RUN: %clang_cc1 -std=c99 -fms-extensions -E %s -o - \ // RUN: | FileCheck --check-prefix=CHECK-MS-KEYWORDS %s void f() { // CHECK-NONE: int asm // CHECK-GNU-KEYWORDS: asm ("ret" : :) #if __is_identifier(asm) int asm; #else asm ("ret" : :); #endif } // CHECK-NONE: no_ms_wchar // CHECK-MS-KEYWORDS: has_ms_wchar #if __is_identifier(__wchar_t) void no_ms_wchar(); #else void has_ms_wchar(); #endif
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/char-literal.cpp
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -Wfour-char-constants -fsyntax-only -verify %s // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c11 -x c -Wfour-char-constants -fsyntax-only -verify %s #ifndef __cplusplus typedef __WCHAR_TYPE__ wchar_t; typedef __CHAR16_TYPE__ char16_t; typedef __CHAR32_TYPE__ char32_t; #endif int a = 'ab'; // expected-warning {{multi-character character constant}} int b = '\xFF\xFF'; // expected-warning {{multi-character character constant}} int c = 'APPS'; // expected-warning {{multi-character character constant}} char d = '⌘'; // expected-error {{character too large for enclosing character literal type}} char e = '\u2318'; // expected-error {{character too large for enclosing character literal type}} #ifdef __cplusplus auto f = '\xE2\x8C\x98'; // expected-warning {{multi-character character constant}} #endif char16_t g = u'ab'; // expected-error {{Unicode character literals may not contain multiple characters}} char16_t h = u'\U0010FFFD'; // expected-error {{character too large for enclosing character literal type}} wchar_t i = L'ab'; // expected-warning {{extraneous characters in character constant ignored}} wchar_t j = L'\U0010FFFD'; char32_t k = U'\U0010FFFD'; char l = 'Ø'; // expected-error {{character too large for enclosing character literal type}} char m = '👿'; // expected-error {{character too large for enclosing character literal type}} char32_t n = U'ab'; // expected-error {{Unicode character literals may not contain multiple characters}} char16_t o = '👽'; // expected-error {{character too large for enclosing character literal type}} char16_t p[2] = u"\U0000FFFF"; char16_t q[2] = u"\U00010000"; #ifdef __cplusplus // expected-error@-2 {{too long}} #endif
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/cxx1z-trigraphs.cpp
// RUN: %clang_cc1 -std=c++1z %s -verify // RUN: %clang_cc1 -std=c++1z %s -ftrigraphs -fsyntax-only ??= define foo ; // expected-error {{}} expected-warning {{trigraph ignored}} static_assert("??="[0] == '#', ""); // expected-error {{failed}} expected-warning {{trigraph ignored}} // ??/ error here; // expected-error {{}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/gnu-flags.c
// RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE // RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wgnu // RUN: %clang_cc1 -fsyntax-only -verify %s -DALL \ // RUN: -Wgnu-zero-variadic-macro-arguments \ // RUN: -Wgnu-imaginary-constant -Wgnu-binary-literal -Wgnu-zero-line-directive // RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wgnu \ // RUN: -Wno-gnu-zero-variadic-macro-arguments \ // RUN: -Wno-gnu-imaginary-constant -Wno-gnu-binary-literal -Wno-gnu-zero-line-directive // Additional disabled tests: // %clang_cc1 -fsyntax-only -verify %s -DZEROARGS -Wgnu-zero-variadic-macro-arguments // %clang_cc1 -fsyntax-only -verify %s -DIMAGINARYCONST -Wgnu-imaginary-constant // %clang_cc1 -fsyntax-only -verify %s -DBINARYLITERAL -Wgnu-binary-literal // %clang_cc1 -fsyntax-only -verify %s -DLINE0 -Wgnu-zero-line-directive #if NONE // expected-no-diagnostics #endif #if ALL || ZEROARGS // expected-warning@+9 {{must specify at least one argument for '...' parameter of variadic macro}} // expected-note@+4 {{macro 'efoo' defined here}} // expected-warning@+3 {{token pasting of ',' and __VA_ARGS__ is a GNU extension}} #endif #define efoo(format, args...) foo(format , ##args) void foo( const char* c ) { efoo("6"); } #if ALL || IMAGINARYCONST // expected-warning@+3 {{imaginary constants are a GNU extension}} #endif float _Complex c = 1.if; #if ALL || BINARYLITERAL // expected-warning@+3 {{binary integer literals are a GNU extension}} #endif int b = 0b0101; // This case is handled differently because lit has a bug whereby #line 0 is reported to be on line 4294967295 // http://llvm.org/bugs/show_bug.cgi?id=16952 #if ALL || LINE0 #line 0 // expected-warning {{#line directive with zero argument is a GNU extension}} #else #line 0 #endif // WARNING: Do not add more tests after the #line 0 line! Add them before the LINE0 test
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/dollar-idents.c
// RUN: %clang_cc1 -dump-tokens %s 2>&1 | FileCheck %s // RUN: %clang_cc1 -dump-tokens -x assembler-with-cpp %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASM // PR3808 // CHECK: identifier '$A' // CHECK-ASM: identifier 'A' $A
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/cross-windows-on-linux-default.cpp
// RUN: not %clang_cc1 -fsyntax-only -fms-compatibility -triple i686-win32 %s 2>&1 \ // RUN: | FileCheck %s #include "Inputs\success.h" // CHECK: error: success
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/ms-compatibility.c
// RUN: %clang_cc1 -fsyntax-only -E -fms-compatibility %s | FileCheck --check-prefix=CHECK-MS-COMPAT %s // RUN: %clang_cc1 -fsyntax-only -E %s | FileCheck --check-prefix=CHECK-NO-MS-COMPAT %s #define FN(x) L#x #define F L "aaa" void *v1 = FN(aaa); void *v2 = F; // CHECK-MS-COMPAT: void *v1 = L"aaa"; // CHECK-MS-COMPAT: void *v2 = L "aaa"; // CHECK-NO-MS-COMPAT: void *v1 = L "aaa"; // CHECK-NO-MS-COMPAT: void *v2 = L "aaa";
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/has_feature_cxx0x.cpp
// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-11 %s // RUN: %clang_cc1 -E -triple armv7-apple-darwin -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-NO-TLS %s // RUN: %clang_cc1 -E -triple x86_64-linux-gnu %s -o - | FileCheck --check-prefix=CHECK-NO-11 %s // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++14 %s -o - | FileCheck --check-prefix=CHECK-14 %s // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++1z %s -o - | FileCheck --check-prefix=CHECK-1Z %s #if __has_feature(cxx_atomic) int has_atomic(); #else int no_atomic(); #endif // CHECK-1Z: has_atomic // CHECK-14: has_atomic // CHECK-11: has_atomic // CHECK-NO-11: no_atomic #if __has_feature(cxx_lambdas) int has_lambdas(); #else int no_lambdas(); #endif // CHECK-1Z: has_lambdas // CHECK-14: has_lambdas // CHECK-11: has_lambdas // CHECK-NO-11: no_lambdas #if __has_feature(cxx_nullptr) int has_nullptr(); #else int no_nullptr(); #endif // CHECK-1Z: has_nullptr // CHECK-14: has_nullptr // CHECK-11: has_nullptr // CHECK-NO-11: no_nullptr #if __has_feature(cxx_decltype) int has_decltype(); #else int no_decltype(); #endif // CHECK-1Z: has_decltype // CHECK-14: has_decltype // CHECK-11: has_decltype // CHECK-NO-11: no_decltype #if __has_feature(cxx_decltype_incomplete_return_types) int has_decltype_incomplete_return_types(); #else int no_decltype_incomplete_return_types(); #endif // CHECK-1Z: has_decltype_incomplete_return_types // CHECK-14: has_decltype_incomplete_return_types // CHECK-11: has_decltype_incomplete_return_types // CHECK-NO-11: no_decltype_incomplete_return_types #if __has_feature(cxx_auto_type) int has_auto_type(); #else int no_auto_type(); #endif // CHECK-1Z: has_auto_type // CHECK-14: has_auto_type // CHECK-11: has_auto_type // CHECK-NO-11: no_auto_type #if __has_feature(cxx_trailing_return) int has_trailing_return(); #else int no_trailing_return(); #endif // CHECK-1Z: has_trailing_return // CHECK-14: has_trailing_return // CHECK-11: has_trailing_return // CHECK-NO-11: no_trailing_return #if __has_feature(cxx_attributes) int has_attributes(); #else int no_attributes(); #endif // CHECK-1Z: has_attributes // CHECK-14: has_attributes // CHECK-11: has_attributes // CHECK-NO-11: no_attributes #if __has_feature(cxx_static_assert) int has_static_assert(); #else int no_static_assert(); #endif // CHECK-1Z: has_static_assert // CHECK-14: has_static_assert // CHECK-11: has_static_assert // CHECK-NO-11: no_static_assert #if __has_feature(cxx_deleted_functions) int has_deleted_functions(); #else int no_deleted_functions(); #endif // CHECK-1Z: has_deleted_functions // CHECK-14: has_deleted_functions // CHECK-11: has_deleted_functions // CHECK-NO-11: no_deleted_functions #if __has_feature(cxx_defaulted_functions) int has_defaulted_functions(); #else int no_defaulted_functions(); #endif // CHECK-1Z: has_defaulted_functions // CHECK-14: has_defaulted_functions // CHECK-11: has_defaulted_functions // CHECK-NO-11: no_defaulted_functions #if __has_feature(cxx_rvalue_references) int has_rvalue_references(); #else int no_rvalue_references(); #endif // CHECK-1Z: has_rvalue_references // CHECK-14: has_rvalue_references // CHECK-11: has_rvalue_references // CHECK-NO-11: no_rvalue_references #if __has_feature(cxx_variadic_templates) int has_variadic_templates(); #else int no_variadic_templates(); #endif // CHECK-1Z: has_variadic_templates // CHECK-14: has_variadic_templates // CHECK-11: has_variadic_templates // CHECK-NO-11: no_variadic_templates #if __has_feature(cxx_inline_namespaces) int has_inline_namespaces(); #else int no_inline_namespaces(); #endif // CHECK-1Z: has_inline_namespaces // CHECK-14: has_inline_namespaces // CHECK-11: has_inline_namespaces // CHECK-NO-11: no_inline_namespaces #if __has_feature(cxx_range_for) int has_range_for(); #else int no_range_for(); #endif // CHECK-1Z: has_range_for // CHECK-14: has_range_for // CHECK-11: has_range_for // CHECK-NO-11: no_range_for #if __has_feature(cxx_reference_qualified_functions) int has_reference_qualified_functions(); #else int no_reference_qualified_functions(); #endif // CHECK-1Z: has_reference_qualified_functions // CHECK-14: has_reference_qualified_functions // CHECK-11: has_reference_qualified_functions // CHECK-NO-11: no_reference_qualified_functions #if __has_feature(cxx_default_function_template_args) int has_default_function_template_args(); #else int no_default_function_template_args(); #endif // CHECK-1Z: has_default_function_template_args // CHECK-14: has_default_function_template_args // CHECK-11: has_default_function_template_args // CHECK-NO-11: no_default_function_template_args #if __has_feature(cxx_noexcept) int has_noexcept(); #else int no_noexcept(); #endif // CHECK-1Z: has_noexcept // CHECK-14: has_noexcept // CHECK-11: has_noexcept // CHECK-NO-11: no_noexcept #if __has_feature(cxx_override_control) int has_override_control(); #else int no_override_control(); #endif // CHECK-1Z: has_override_control // CHECK-14: has_override_control // CHECK-11: has_override_control // CHECK-NO-11: no_override_control #if __has_feature(cxx_alias_templates) int has_alias_templates(); #else int no_alias_templates(); #endif // CHECK-1Z: has_alias_templates // CHECK-14: has_alias_templates // CHECK-11: has_alias_templates // CHECK-NO-11: no_alias_templates #if __has_feature(cxx_implicit_moves) int has_implicit_moves(); #else int no_implicit_moves(); #endif // CHECK-1Z: has_implicit_moves // CHECK-14: has_implicit_moves // CHECK-11: has_implicit_moves // CHECK-NO-11: no_implicit_moves #if __has_feature(cxx_alignas) int has_alignas(); #else int no_alignas(); #endif // CHECK-1Z: has_alignas // CHECK-14: has_alignas // CHECK-11: has_alignas // CHECK-NO-11: no_alignas #if __has_feature(cxx_alignof) int has_alignof(); #else int no_alignof(); #endif // CHECK-1Z: has_alignof // CHECK-14: has_alignof // CHECK-11: has_alignof // CHECK-NO-11: no_alignof #if __has_feature(cxx_raw_string_literals) int has_raw_string_literals(); #else int no_raw_string_literals(); #endif // CHECK-1Z: has_raw_string_literals // CHECK-14: has_raw_string_literals // CHECK-11: has_raw_string_literals // CHECK-NO-11: no_raw_string_literals #if __has_feature(cxx_unicode_literals) int has_unicode_literals(); #else int no_unicode_literals(); #endif // CHECK-1Z: has_unicode_literals // CHECK-14: has_unicode_literals // CHECK-11: has_unicode_literals // CHECK-NO-11: no_unicode_literals #if __has_feature(cxx_constexpr) int has_constexpr(); #else int no_constexpr(); #endif // CHECK-1Z: has_constexpr // CHECK-14: has_constexpr // CHECK-11: has_constexpr // CHECK-NO-11: no_constexpr #if __has_feature(cxx_generalized_initializers) int has_generalized_initializers(); #else int no_generalized_initializers(); #endif // CHECK-1Z: has_generalized_initializers // CHECK-14: has_generalized_initializers // CHECK-11: has_generalized_initializers // CHECK-NO-11: no_generalized_initializers #if __has_feature(cxx_unrestricted_unions) int has_unrestricted_unions(); #else int no_unrestricted_unions(); #endif // CHECK-1Z: has_unrestricted_unions // CHECK-14: has_unrestricted_unions // CHECK-11: has_unrestricted_unions // CHECK-NO-11: no_unrestricted_unions #if __has_feature(cxx_user_literals) int has_user_literals(); #else int no_user_literals(); #endif // CHECK-1Z: has_user_literals // CHECK-14: has_user_literals // CHECK-11: has_user_literals // CHECK-NO-11: no_user_literals #if __has_feature(cxx_local_type_template_args) int has_local_type_template_args(); #else int no_local_type_template_args(); #endif // CHECK-1Z: has_local_type_template_args // CHECK-14: has_local_type_template_args // CHECK-11: has_local_type_template_args // CHECK-NO-11: no_local_type_template_args #if __has_feature(cxx_inheriting_constructors) int has_inheriting_constructors(); #else int no_inheriting_constructors(); #endif // CHECK-1Z: has_inheriting_constructors // CHECK-14: has_inheriting_constructors // CHECK-11: has_inheriting_constructors // CHECK-NO-11: no_inheriting_constructors #if __has_feature(cxx_thread_local) int has_thread_local(); #else int no_thread_local(); #endif // CHECK-1Z: has_thread_local // CHECK-14: has_thread_local // CHECK-11: has_thread_local // CHECK-NO-11: no_thread_local // CHECK-NO-TLS: no_thread_local // === C++14 features === #if __has_feature(cxx_binary_literals) int has_binary_literals(); #else int no_binary_literals(); #endif // CHECK-1Z: has_binary_literals // CHECK-14: has_binary_literals // CHECK-11: no_binary_literals // CHECK-NO-11: no_binary_literals #if __has_feature(cxx_aggregate_nsdmi) int has_aggregate_nsdmi(); #else int no_aggregate_nsdmi(); #endif // CHECK-1Z: has_aggregate_nsdmi // CHECK-14: has_aggregate_nsdmi // CHECK-11: no_aggregate_nsdmi // CHECK-NO-11: no_aggregate_nsdmi #if __has_feature(cxx_return_type_deduction) int has_return_type_deduction(); #else int no_return_type_deduction(); #endif // CHECK-1Z: has_return_type_deduction // CHECK-14: has_return_type_deduction // CHECK-11: no_return_type_deduction // CHECK-NO-11: no_return_type_deduction #if __has_feature(cxx_contextual_conversions) int has_contextual_conversions(); #else int no_contextual_conversions(); #endif // CHECK-1Z: has_contextual_conversions // CHECK-14: has_contextual_conversions // CHECK-11: no_contextual_conversions // CHECK-NO-11: no_contextual_conversions #if __has_feature(cxx_relaxed_constexpr) int has_relaxed_constexpr(); #else int no_relaxed_constexpr(); #endif // CHECK-1Z: has_relaxed_constexpr // CHECK-14: has_relaxed_constexpr // CHECK-11: no_relaxed_constexpr // CHECK-NO-11: no_relaxed_constexpr #if __has_feature(cxx_variable_templates) int has_variable_templates(); #else int no_variable_templates(); #endif // CHECK-1Z: has_variable_templates // CHECK-14: has_variable_templates // CHECK-11: no_variable_templates // CHECK-NO-11: no_variable_templates #if __has_feature(cxx_init_captures) int has_init_captures(); #else int no_init_captures(); #endif // CHECK-1Z: has_init_captures // CHECK-14: has_init_captures // CHECK-11: no_init_captures // CHECK-NO-11: no_init_captures #if __has_feature(cxx_decltype_auto) int has_decltype_auto(); #else int no_decltype_auto(); #endif // CHECK-1Z: has_decltype_auto // CHECK-14: has_decltype_auto // CHECK-11: no_decltype_auto // CHECK-NO-11: no_decltype_auto #if __has_feature(cxx_generic_lambdas) int has_generic_lambdas(); #else int no_generic_lambdas(); #endif // CHECK-1Z: has_generic_lambdas // CHECK-14: has_generic_lambdas // CHECK-11: no_generic_lambdas // CHECK-NO-11: no_generic_lambdas
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/digraph.c
// RUN: %clang_cc1 -fsyntax-only -verify -ffreestanding %s // expected-no-diagnostics %:include <stdint.h> %:ifndef BUFSIZE %:define BUFSIZE 512 %:endif void copy(char d<::>, const char s<::>, int len) <% while (len-- >= 0) <% d<:len:> = s<:len:>; %> %>
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Lexer/has_extension_cxx.cpp
// RUN: %clang_cc1 -std=c++98 -E %s -o - | FileCheck %s // RUN: %clang_cc1 -std=c++11 -E %s -o - | FileCheck %s --check-prefix=CHECK11 // CHECK: c_static_assert #if __has_extension(c_static_assert) int c_static_assert(); #endif // CHECK: c_generic_selections #if __has_extension(c_generic_selections) int c_generic_selections(); #endif // CHECK: has_deleted_functions #if __has_extension(cxx_deleted_functions) int has_deleted_functions(); #endif // CHECK: has_inline_namespaces #if __has_extension(cxx_inline_namespaces) int has_inline_namespaces(); #endif // CHECK: has_override_control #if __has_extension(cxx_override_control) int has_override_control(); #endif // CHECK: has_range_for #if __has_extension(cxx_range_for) int has_range_for(); #endif // CHECK: has_reference_qualified_functions #if __has_extension(cxx_reference_qualified_functions) int has_reference_qualified_functions(); #endif // CHECK: has_rvalue_references #if __has_extension(cxx_rvalue_references) int has_rvalue_references(); #endif // CHECK: has_variadic_templates #if __has_extension(cxx_variadic_templates) int has_variadic_templates(); #endif // CHECK: has_local_type_template_args #if __has_extension(cxx_local_type_template_args) int has_local_type_template_args(); #endif // CHECK: has_binary_literals #if __has_extension(cxx_binary_literals) int has_binary_literals(); #endif // CHECK: has_variable_templates #if __has_extension(cxx_variable_templates) int has_variable_templates(); #endif // CHECK-NOT: has_init_captures // CHECK11: has_init_captures #if __has_extension(cxx_init_captures) int has_init_captures(); #endif
0
repos/DirectXShaderCompiler/tools/clang/test/Lexer
repos/DirectXShaderCompiler/tools/clang/test/Lexer/Inputs/different-define.h
#ifndef different_define #define FOO 5 #endif
0
repos/DirectXShaderCompiler/tools/clang/test/Lexer
repos/DirectXShaderCompiler/tools/clang/test/Lexer/Inputs/bad-header-guard.h
#ifndef bad_header_guard #define bad_guard #endif
0
repos/DirectXShaderCompiler/tools/clang/test/Lexer
repos/DirectXShaderCompiler/tools/clang/test/Lexer/Inputs/multiple.h
#ifndef multiple #define multi #endif
0
repos/DirectXShaderCompiler/tools/clang/test/Lexer
repos/DirectXShaderCompiler/tools/clang/test/Lexer/Inputs/success.h
#error success
0
repos/DirectXShaderCompiler/tools/clang/test/Lexer
repos/DirectXShaderCompiler/tools/clang/test/Lexer/Inputs/unlikely-to-be-header-guard.h
#ifndef data_rep_h #define use_alternate_data_rep /* #include "data_rep.h" */ #endif
0
repos/DirectXShaderCompiler/tools/clang/test/Lexer
repos/DirectXShaderCompiler/tools/clang/test/Lexer/Inputs/out-of-order-define.h
#ifndef out_of_order #define something_else #define out_of_order #endif
0
repos/DirectXShaderCompiler/tools/clang/test/Lexer
repos/DirectXShaderCompiler/tools/clang/test/Lexer/Inputs/good-header-guard.h
#ifndef good_header_guard #define good_header_guard #endif
0
repos/DirectXShaderCompiler/tools/clang/test/Lexer
repos/DirectXShaderCompiler/tools/clang/test/Lexer/Inputs/bad-header-guard-defined.h
#if !defined(foo) #define goo int n; #endif
0
repos/DirectXShaderCompiler/tools/clang/test/Lexer
repos/DirectXShaderCompiler/tools/clang/test/Lexer/Inputs/tokens-between-ifndef-and-define.h
#ifndef tokens_between const int pi = 3; #define pi_is_bad #endif
0
repos/DirectXShaderCompiler/tools/clang/test/Lexer
repos/DirectXShaderCompiler/tools/clang/test/Lexer/Inputs/no-define.h
#ifndef no_define #endif
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/stdin.c
enum X { x }; enum Y { y }; enum // RUN: %clang_cc1 -fsyntax-only -code-completion-at=-:4:6 < %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: X // CHECK-CC1: Y
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/enum-switch-case-qualified.cpp
namespace M { namespace N { struct C { enum Color { Red, Orange, Yellow, Green, Blue, Indigo, Violet }; }; } } namespace M { void test(enum N::C::Color color) { switch (color) { case // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:23:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: Blue : [#M::N::C::Color#]N::C::Blue // CHECK-CC1-NEXT: Green : [#M::N::C::Color#]N::C::Green // CHECK-CC1-NEXT: Indigo : [#M::N::C::Color#]N::C::Indigo // CHECK-CC1-NEXT: Orange : [#M::N::C::Color#]N::C::Orange // CHECK-CC1-NEXT: Red : [#M::N::C::Color#]N::C::Red // CHECK-CC1-NEXT: Violet : [#M::N::C::Color#]N::C::Violet // CHECK-CC1: Yellow : [#M::N::C::Color#]N::C::Yellow
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/ordinary-name.c
#include <reserved.h> struct X { int x; }; typedef struct t TYPEDEF; typedef struct t _TYPEDEF; void foo() { int y; // RUN: %clang_cc1 -isystem %S/Inputs -fsyntax-only -code-completion-at=%s:6:9 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: _Imaginary // CHECK-CC1-NOT: _INTEGER_TYPE; // CHECK-CC1: _TYPEDEF // CHECK-CC1: FLOATING_TYPE // CHECK-CC1: foo // CHECK-CC1: TYPEDEF // CHECK-CC1: y // PR8744 // RUN: %clang_cc1 -isystem %S/Inputs -fsyntax-only -code-completion-at=%s:1:11 %s
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/using.cpp
namespace N4 { namespace N3 { } } class N3; namespace N2 { namespace I1 { } namespace I4 = I1; namespace I5 { } namespace I1 { } void foo() { int N3; using // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:16:10 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: I1 // CHECK-CC1: I4 // CHECK-CC1: I5 // CHECK-CC1: N2 // CHECK-CC1: N3 // CHECK-CC1-NEXT: N4
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/member-access.c
struct Point { float x; float y; float z; }; void test(struct Point *p) { p-> // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:8:6 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: x // CHECK-CC1: y // CHECK-CC1: z
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/namespace-alias.cpp
namespace N4 { namespace N3 { } } class N3; namespace N2 { namespace I1 { } namespace I4 = I1; namespace I5 { } namespace I1 { } namespace New = // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:13:18 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: I1 // CHECK-CC1: I4 // CHECK-CC1: I5 // CHECK-CC1: N2 // CHECK-CC1-NEXT: N4
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/tag.c
enum X { x }; enum Y { y }; struct Z { }; void X(); void test() { enum X { x }; enum // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:9:7 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: X // CHECK-CC1: Y
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/member-access.cpp
struct Base1 { int member1; float member2; }; struct Base2 { int member1; double member3; void memfun1(int); }; struct Base3 : Base1, Base2 { void memfun1(float); void memfun1(double) const; void memfun2(int); }; struct Derived : Base3 { int member4; int memfun3(int); }; class Proxy { public: Derived *operator->() const; }; void test(const Proxy &p) { p-> // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:29:6 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: Base1 : Base1:: // CHECK-CC1: member1 : [#int#][#Base1::#]member1 // CHECK-CC1: member1 : [#int#][#Base2::#]member1 // CHECK-CC1: member2 : [#float#][#Base1::#]member2 // CHECK-CC1: member3 // CHECK-CC1: member4 // CHECK-CC1: memfun1 : [#void#][#Base3::#]memfun1(<#float#>) // CHECK-CC1: memfun1 : [#void#][#Base3::#]memfun1(<#double#>)[# const#] // CHECK-CC1: memfun1 (Hidden) : [#void#]Base2::memfun1(<#int#>) // CHECK-CC1: memfun2 : [#void#][#Base3::#]memfun2(<#int#>) // CHECK-CC1: memfun3 : [#int#]memfun3(<#int#>)
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/documentation.cpp
// Note: the run lines follow their respective tests, since line/column // matter in this test. /// Aaa. void T1(float x, float y); /// Bbb. class T2 { public: /// Ccc. void T3(); int T4; ///< Ddd. }; /// Eee. namespace T5 { } void test() { T2 t2; t2. } // RUN: %clang_cc1 -fsyntax-only -code-completion-brief-comments -code-completion-at=%s:21:1 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: COMPLETION: T1 : [#void#]T1(<#float x#>, <#float y#>) : Aaa. // CHECK-CC1: COMPLETION: T2 : T2 : Bbb. // CHECK-CC1: COMPLETION: T5 : T5:: : Eee. // RUN: %clang_cc1 -fsyntax-only -code-completion-brief-comments -code-completion-at=%s:23:6 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s // CHECK-CC2: COMPLETION: T3 : [#void#]T3() : Ccc. // CHECK-CC2: COMPLETION: T4 : [#int#]T4 : Ddd.
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/ordinary-name.cpp
struct X { int x; }; void z(int); typedef struct t TYPEDEF; void foo() { int y = 17; // RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -code-completion-patterns -code-completion-at=%s:6:14 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: COMPLETION: bool // CHECK-CC1-NEXT: COMPLETION: char // CHECK-CC1-NEXT: COMPLETION: class // CHECK-CC1-NEXT: COMPLETION: const // CHECK-CC1-NEXT: COMPLETION: Pattern : const_cast<<#type#>>(<#expression#>) // CHECK-CC1: COMPLETION: Pattern : [#void#]delete <#expression#> // CHECK-CC1-NEXT: COMPLETION: Pattern : [#void#]delete [] <#expression#> // CHECK-CC1-NEXT: COMPLETION: Pattern : do{<#statements#> // CHECK-CC1: COMPLETION: double // CHECK-CC1-NEXT: COMPLETION: Pattern : dynamic_cast<<#type#>>(<#expression#>) // CHECK-CC1-NEXT: COMPLETION: enum // CHECK-CC1-NEXT: COMPLETION: extern // CHECK-CC1-NEXT: COMPLETION: Pattern : [#bool#]false // CHECK-CC1-NEXT: COMPLETION: float // CHECK-CC1-NEXT: COMPLETION: foo : [#void#]foo() // CHECK-CC1-NEXT: COMPLETION: Pattern : for(<#init-statement#>;<#condition#>;<#inc-expression#>){ // CHECK-CC1: COMPLETION: Pattern : goto <#label#> // CHECK-CC1-NEXT: COMPLETION: Pattern : if(<#condition#>){<#statements#> // CHECK-CC1: COMPLETION: int // CHECK-CC1-NEXT: COMPLETION: long // CHECK-CC1-NEXT: COMPLETION: Pattern : new <#type#>(<#expressions#>) // CHECK-CC1-NEXT: COMPLETION: Pattern : new <#type#>[<#size#>](<#expressions#>) // CHECK-CC1-NEXT: COMPLETION: operator // CHECK-CC1-NEXT: COMPLETION: Pattern : reinterpret_cast<<#type#>>(<#expression#>) // CHECK-CC1-NEXT: COMPLETION: Pattern : return // CHECK-CC1-NEXT: COMPLETION: short // CHECK-CC1-NEXT: COMPLETION: signed // CHECK-CC1-NEXT: COMPLETION: Pattern : [#size_t#]sizeof(<#expression-or-type#>) // CHECK-CC1-NEXT: COMPLETION: static // CHECK-CC1-NEXT: COMPLETION: Pattern : static_cast<<#type#>>(<#expression#>) // CHECK-CC1-NEXT: COMPLETION: struct // CHECK-CC1-NEXT: COMPLETION: Pattern : switch(<#condition#>){ // CHECK-CC1: COMPLETION: t : t // CHECK-CC1-NEXT: COMPLETION: Pattern : [#void#]throw <#expression#> // CHECK-CC1-NEXT: COMPLETION: Pattern : [#bool#]true // CHECK-CC1-NEXT: COMPLETION: Pattern : try{<#statements#> // CHECK-CC1: COMPLETION: TYPEDEF : TYPEDEF // CHECK-CC1-NEXT: COMPLETION: Pattern : typedef <#type#> <#name#> // CHECK-CC1-NEXT: COMPLETION: Pattern : [#std::type_info#]typeid(<#expression-or-type#>) // CHECK-CC1-NEXT: COMPLETION: Pattern : typename <#qualifier#>::<#name#> // CHECK-CC1-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-CC1-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-CC1-NEXT: COMPLETION: union // CHECK-CC1-NEXT: COMPLETION: unsigned // CHECK-CC1-NEXT: COMPLETION: Pattern : using namespace <#identifier#> // CHECK-CC1-NEXT: COMPLETION: void // CHECK-CC1-NEXT: COMPLETION: volatile // CHECK-CC1-NEXT: COMPLETION: wchar_t // CHECK-CC1-NEXT: COMPLETION: Pattern : while(<#condition#>){<#statements#> // CHECK-CC1: COMPLETION: X : X // CHECK-CC1-NEXT: COMPLETION: y : [#int#]y // CHECK-CC1-NEXT: COMPLETION: z : [#void#]z(<#int#>) // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:4:1 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s // CHECK-CC2: COMPLETION: Pattern : asm(<#string-literal#>) // CHECK-CC2-NEXT: COMPLETION: bool // CHECK-CC2-NEXT: COMPLETION: char // CHECK-CC2-NEXT: COMPLETION: class // CHECK-CC2-NEXT: COMPLETION: const // CHECK-CC2-NEXT: COMPLETION: double // CHECK-CC2-NEXT: COMPLETION: enum // CHECK-CC2-NEXT: COMPLETION: extern // CHECK-CC2-NEXT: COMPLETION: float // CHECK-CC2-NEXT: COMPLETION: inline // CHECK-CC2-NEXT: COMPLETION: int // CHECK-CC2-NEXT: COMPLETION: long // CHECK-CC2-NEXT: COMPLETION: Pattern : namespace <#identifier#>{<#declarations#> // CHECK-CC2: COMPLETION: Pattern : namespace <#name#> = <#namespace#> // CHECK-CC2-NEXT: COMPLETION: operator // CHECK-CC2-NEXT: COMPLETION: short // CHECK-CC2-NEXT: COMPLETION: signed // CHECK-CC2-NEXT: COMPLETION: static // CHECK-CC2-NEXT: COMPLETION: struct // CHECK-CC2-NEXT: COMPLETION: t : t // CHECK-CC2-NEXT: COMPLETION: Pattern : template <#declaration#> // CHECK-CC2-NEXT: COMPLETION: Pattern : template<<#parameters#>> // CHECK-CC2-NEXT: COMPLETION: TYPEDEF : TYPEDEF // CHECK-CC2-NEXT: COMPLETION: Pattern : typedef <#type#> <#name#> // CHECK-CC2-NEXT: COMPLETION: Pattern : typename <#qualifier#>::<#name#> // CHECK-CC2-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-CC2-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-CC2-NEXT: COMPLETION: union // CHECK-CC2-NEXT: COMPLETION: unsigned // CHECK-CC2-NEXT: COMPLETION: Pattern : using namespace <#identifier#> // CHECK-CC2-NEXT: COMPLETION: Pattern : using <#qualifier#>::<#name#> // CHECK-CC2-NEXT: COMPLETION: void // CHECK-CC2-NEXT: COMPLETION: volatile // CHECK-CC2-NEXT: COMPLETION: wchar_t // CHECK-CC2-NEXT: COMPLETION: X : X // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:1:19 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s // CHECK-CC3: COMPLETION: bool // CHECK-CC3-NEXT: COMPLETION: char // CHECK-CC3-NEXT: COMPLETION: class // CHECK-CC3-NEXT: COMPLETION: const // CHECK-CC3-NEXT: COMPLETION: double // CHECK-CC3-NEXT: COMPLETION: enum // CHECK-CC3-NEXT: COMPLETION: explicit // CHECK-CC3-NEXT: COMPLETION: extern // CHECK-CC3-NEXT: COMPLETION: float // CHECK-CC3-NEXT: COMPLETION: friend // CHECK-CC3-NEXT: COMPLETION: inline // CHECK-CC3-NEXT: COMPLETION: int // CHECK-CC3-NEXT: COMPLETION: long // CHECK-CC3-NEXT: COMPLETION: mutable // CHECK-CC3-NEXT: COMPLETION: operator // CHECK-CC3-NEXT: COMPLETION: Pattern : private: // CHECK-CC3-NEXT: COMPLETION: Pattern : protected: // CHECK-CC3-NEXT: COMPLETION: Pattern : public: // CHECK-CC3-NEXT: COMPLETION: short // CHECK-CC3-NEXT: COMPLETION: signed // CHECK-CC3-NEXT: COMPLETION: static // CHECK-CC3-NEXT: COMPLETION: struct // CHECK-CC3-NEXT: COMPLETION: Pattern : template<<#parameters#>> // CHECK-CC3-NEXT: COMPLETION: Pattern : typedef <#type#> <#name#> // CHECK-CC3-NEXT: COMPLETION: Pattern : typename <#qualifier#>::<#name#> // CHECK-CC3-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-CC3-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-CC3-NEXT: COMPLETION: union // CHECK-CC3-NEXT: COMPLETION: unsigned // CHECK-CC3-NEXT: COMPLETION: Pattern : using <#qualifier#>::<#name#> // CHECK-CC3-NEXT: COMPLETION: virtual // CHECK-CC3-NEXT: COMPLETION: void // CHECK-CC3-NEXT: COMPLETION: volatile // CHECK-CC3-NEXT: COMPLETION: wchar_t // CHECK-CC3-NEXT: COMPLETION: X : X // RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -code-completion-patterns -code-completion-at=%s:6:11 %s -o - | FileCheck -check-prefix=CHECK-CC4 %s // CHECK-CC4: COMPLETION: bool // CHECK-CC4-NEXT: COMPLETION: char // CHECK-CC4-NEXT: COMPLETION: class // CHECK-CC4-NEXT: COMPLETION: const // CHECK-CC4-NEXT: COMPLETION: Pattern : const_cast<<#type#>>(<#expression#>) // CHECK-CC4-NEXT: COMPLETION: Pattern : [#void#]delete <#expression#> // CHECK-CC4-NEXT: COMPLETION: Pattern : [#void#]delete [] <#expression#> // CHECK-CC4-NEXT: COMPLETION: double // CHECK-CC4-NEXT: COMPLETION: Pattern : dynamic_cast<<#type#>>(<#expression#>) // CHECK-CC4-NEXT: COMPLETION: enum // CHECK-CC4-NEXT: COMPLETION: Pattern : [#bool#]false // CHECK-CC4-NEXT: COMPLETION: float // CHECK-CC4-NEXT: COMPLETION: foo : [#void#]foo() // CHECK-CC4-NEXT: COMPLETION: int // CHECK-CC4-NEXT: COMPLETION: long // CHECK-CC4-NEXT: COMPLETION: Pattern : new <#type#>(<#expressions#>) // CHECK-CC4-NEXT: COMPLETION: Pattern : new <#type#>[<#size#>](<#expressions#>) // CHECK-CC4-NEXT: COMPLETION: operator // CHECK-CC4-NEXT: COMPLETION: Pattern : reinterpret_cast<<#type#>>(<#expression#>) // CHECK-CC4-NEXT: COMPLETION: short // CHECK-CC4-NEXT: COMPLETION: signed // CHECK-CC4-NEXT: COMPLETION: Pattern : [#size_t#]sizeof(<#expression-or-type#>) // CHECK-CC4-NEXT: COMPLETION: Pattern : static_cast<<#type#>>(<#expression#>) // CHECK-CC4-NEXT: COMPLETION: struct // CHECK-CC4-NEXT: COMPLETION: t : t // CHECK-CC4-NEXT: COMPLETION: Pattern : [#void#]throw <#expression#> // CHECK-CC4-NEXT: COMPLETION: Pattern : [#bool#]true // CHECK-CC4-NEXT: COMPLETION: TYPEDEF : TYPEDEF // CHECK-CC4-NEXT: COMPLETION: Pattern : [#std::type_info#]typeid(<#expression-or-type#>) // CHECK-CC4-NEXT: COMPLETION: Pattern : typename <#qualifier#>::<#name#> // CHECK-CC4-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-CC4-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-CC4-NEXT: COMPLETION: union // CHECK-CC4-NEXT: COMPLETION: unsigned // CHECK-CC4-NEXT: COMPLETION: void // CHECK-CC4-NEXT: COMPLETION: volatile // CHECK-CC4-NEXT: COMPLETION: wchar_t // CHECK-CC4-NEXT: COMPLETION: X : X // CHECK-CC4-NEXT: COMPLETION: y : [#int#]y // CHECK-CC4-NEXT: COMPLETION: z : [#void#]z(<#int#>) // RUN: %clang_cc1 -fsyntax-only -fno-rtti -code-completion-patterns -code-completion-at=%s:6:14 %s -o - | FileCheck -check-prefix=CHECK-NO-RTTI %s // CHECK-NO-RTTI: COMPLETION: bool // CHECK-NO-RTTI-NEXT: COMPLETION: char // CHECK-NO-RTTI-NEXT: COMPLETION: class // CHECK-NO-RTTI-NEXT: COMPLETION: const // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : const_cast<<#type#>>(<#expression#>) // CHECK-NO-RTTI: COMPLETION: Pattern : [#void#]delete <#expression#> // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : [#void#]delete [] <#expression#> // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : do{<#statements#> // CHECK-NO-RTTI: COMPLETION: double // CHECK-NO-RTTI-NOT: dynamic_cast // CHECK-NO-RTTI: COMPLETION: enum // CHECK-NO-RTTI-NEXT: COMPLETION: extern // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : [#bool#]false // CHECK-NO-RTTI-NEXT: COMPLETION: float // CHECK-NO-RTTI-NEXT: COMPLETION: foo : [#void#]foo() // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : for(<#init-statement#>;<#condition#>;<#inc-expression#>){ // CHECK-NO-RTTI: COMPLETION: Pattern : goto <#label#> // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : if(<#condition#>){<#statements#> // CHECK-NO-RTTI: COMPLETION: int // CHECK-NO-RTTI-NEXT: COMPLETION: long // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : new <#type#>(<#expressions#>) // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : new <#type#>[<#size#>](<#expressions#>) // CHECK-NO-RTTI-NEXT: COMPLETION: operator // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : reinterpret_cast<<#type#>>(<#expression#>) // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : return // CHECK-NO-RTTI-NEXT: COMPLETION: short // CHECK-NO-RTTI-NEXT: COMPLETION: signed // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : [#size_t#]sizeof(<#expression-or-type#>) // CHECK-NO-RTTI-NEXT: COMPLETION: static // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : static_cast<<#type#>>(<#expression#>) // CHECK-NO-RTTI-NEXT: COMPLETION: struct // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : switch(<#condition#>){ // CHECK-NO-RTTI: COMPLETION: t : t // CHECK-NO-RTTI-NOT: throw // CHECK-NO-RTTI: COMPLETION: Pattern : [#bool#]true // CHECK-NO-RTTI-NOT: try // CHECK-NO-RTTI: COMPLETION: TYPEDEF : TYPEDEF // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : typedef <#type#> <#name#> // CHECK-NO-RTTI-NOT: typeid // CHECK-NO-RTTI: COMPLETION: Pattern : typename <#qualifier#>::<#name#> // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-NO-RTTI-NEXT: COMPLETION: union // CHECK-NO-RTTI-NEXT: COMPLETION: unsigned // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : using namespace <#identifier#> // CHECK-NO-RTTI-NEXT: COMPLETION: void // CHECK-NO-RTTI-NEXT: COMPLETION: volatile // CHECK-NO-RTTI-NEXT: COMPLETION: wchar_t // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : while(<#condition#>){<#statements#> // CHECK-NO-RTTI: COMPLETION: X : X // CHECK-NO-RTTI-NEXT: COMPLETION: y : [#int#]y // CHECK-NO-RTTI-NEXT: COMPLETION: z : [#void#]z(<#int#>)
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/macros-in-modules.c
// RUN: rm -rf %t && mkdir %t // RUN: echo 'module Foo { header "foo.h" }' > %t/module.modulemap // RUN: echo '#define FOO_MACRO 42' > %t/foo.h // RUN: c-index-test -code-completion-at=%s:9:1 -I %t %s | FileCheck %s // RUN: c-index-test -code-completion-at=%s:9:1 -I %t -fmodules %s | FileCheck %s #include "foo.h" int x = /*here*/1; // CHECK: FOO_MACRO
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/truncation.c.h
struct X { }; struct Y { }; struct Xa { };
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/call.cpp
// Note: the run lines follow their respective tests, since line/column // matter in this test. void f(float x, float y); void f(int i, int j, int k); struct X { }; void f(X); namespace N { struct Y { Y(int = 0); operator int() const; }; void f(Y y, int ZZ); } typedef N::Y Y; void f(); void test() { f(Y(), 0, 0); // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: COMPLETION: Pattern : dynamic_cast<<#type#>>(<#expression#>) // CHECK-CC1: f(N::Y y, <#int ZZ#>) // CHECK-CC1-NEXT: f(int i, <#int j#>, int k) // CHECK-CC1-NEXT: f(float x, <#float y#>) // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:13 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s // CHECK-CC2-NOT: f(N::Y y, int ZZ) // CHECK-CC2: f(int i, int j, <#int k#>) }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/constexpr.cpp
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -code-completion-at=%s:12:9 %s -o - | FileCheck %s // PR14381: need constexpr function bodies always, even if code-completing. template<int> struct S; template<> struct S<1> { typedef int type; }; constexpr int f() { return 1; } S<f()>:: // CHECK: COMPLETION: type : type
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/truncation.c
#include "truncation.c.h" /* foo */ struct // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s.h:4:8 -o - %s | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: X // CHECK-CC1-NEXT: Y // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:5:8 -o - %s | FileCheck -check-prefix=CHECK-CC2 %s // CHECK-CC2: X // CHECK-CC2: Xa // CHECK-CC2: Y // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:3:3 -o - %s
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/nested-name-specifier.cpp
namespace N { struct A { }; namespace M { struct C { }; }; } namespace N { struct B { }; } N:: // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:12:4 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: A // CHECK-CC1: B // CHECK-CC1: M
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/function-templates.cpp
namespace std { template<typename RandomAccessIterator> void sort(RandomAccessIterator first, RandomAccessIterator last); template<class X, class Y> X* dyn_cast(Y *Val); } class Foo { public: template<typename T> T &getAs(); }; void f() { std::sort(1, 2); Foo().getAs<int>(); // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:15:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: dyn_cast<<#class X#>>(<#Y *Val#>) // CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#> // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:16:9 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s // CHECK-CC2: getAs<<#typename T#>>() )
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/call.c
// Note: the run lines follow their respective tests, since line/column // matter in this test. void f0(float x, float y); void f1(); void test() { f0(0, 0); g0(0, 0); f1(0, 0); // RUN: %clang_cc1 -std=c89 -fsyntax-only -code-completion-at=%s:6:6 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: f0(<#float x#>, float y) // RUN: %clang_cc1 -std=c89 -fsyntax-only -code-completion-at=%s:6:9 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s // CHECK-CC2: f0(float x, <#float y#>) // RUN: %clang_cc1 -std=c89 -fsyntax-only -code-completion-at=%s:8:6 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s // CHECK-CC3: f1() }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/preamble.c
#include "some_struct.h" void foo() { struct X x; x. // RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:4:5 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: FieldDecl:{ResultType int}{TypedText m} (35)
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/functions.cpp
void f(int i, int j = 2, int k = 5); void f(float x, float y...); void test() { :: // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:5:5 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: f(<#int i#>{#, <#int j#>{#, <#int k#>#}#}) // CHECK-CC1: f(<#float x#>, <#float y, ...#>)
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/macros.c
enum Color { Red, Green, Blue }; struct Point { float x, y, z; enum Color color; }; void test(struct Point *p) { // RUN: %clang_cc1 -include %S/Inputs/macros.h -fsyntax-only -code-completion-macros -code-completion-at=%s:12:14 %s -o - | FileCheck -check-prefix=CC1 %s switch (p->IDENTITY(color)) { // RUN: %clang_cc1 -include %S/Inputs/macros.h -fsyntax-only -code-completion-macros -code-completion-at=%s:14:9 %s -o - | FileCheck -check-prefix=CC2 %s case } // RUN: %clang_cc1 -include %S/Inputs/macros.h -fsyntax-only -code-completion-macros -code-completion-at=%s:17:7 %s -o - | FileCheck -check-prefix=CC3 %s #ifdef Q #endif // Run the same tests, this time with macros loaded from the PCH file. // RUN: %clang_cc1 -emit-pch -o %t %S/Inputs/macros.h // RUN: %clang_cc1 -include-pch %t -fsyntax-only -code-completion-macros -code-completion-at=%s:12:14 %s -o - | FileCheck -check-prefix=CC1 %s // RUN: %clang_cc1 -include-pch %t -fsyntax-only -code-completion-macros -code-completion-at=%s:14:9 %s -o - | FileCheck -check-prefix=CC2 %s // RUN: %clang_cc1 -include-pch %t -fsyntax-only -code-completion-macros -code-completion-at=%s:17:7 %s -o - | FileCheck -check-prefix=CC3 %s // CC1: color // CC1: x // CC1: y // CC1: z // CC2: BAR(<#X#>, <#Y#>) // CC2: Blue // CC2: FOO // CC2: Green // CC2: IDENTITY(<#X#>) // CC2: MACRO_WITH_HISTORY(<#X#>, <#Y#>) // CC2: Red // CC2: WIBBLE // CC3: BAR // CC3: DEAD_MACRO // CC3: FOO // CC3: IDENTITY // CC3: MACRO_WITH_HISTORY // CC3: WIBBLE }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/operator.cpp
class T { }; typedef int Integer; namespace N { } void f() { typedef float Float; operator // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:11 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: + // CHECK-CC1: Float // CHECK-CC1: Integer // CHECK-CC1: N // CHECK-CC1: short // CHECK-CC1: T
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/PR9728.cpp
namespace N { struct SFoo; } struct brokenfile_t { brokenfile_t (N:: // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:6:20 %s -o - | FileCheck %s // CHECK: SFoo
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/tag.cpp
class X { }; struct Y { }; namespace N { template<typename> class Z; } namespace M { class A; } using M::A; namespace N { class Y; void test() { class // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:17:10 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // FIXME: the redundant Y is really annoying... it needs qualification to // actually be useful. Here, it just looks redundant :( // CHECK-CC1: A // CHECK-CC1: M : M:: // CHECK-CC1: N : N:: // CHECK-CC1: X // CHECK-CC1: Y // CHECK-CC1: Y // CHECK-CC1: Z
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/enum-switch-case.cpp
namespace N { enum Color { Red, Orange, Yellow, Green, Blue, Indigo, Violet }; } void test(enum N::Color color) { switch (color) { case N::Red: break; case N::Yellow: break; case // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:21:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: Blue : [#N::Color#]N::Blue // CHECK-CC1-NEXT: Green : [#N::Color#]N::Green // CHECK-CC1-NEXT: Indigo : [#N::Color#]N::Indigo // CHECK-CC1-NEXT: Orange : [#N::Color#]N::Orange // CHECK-CC1-NEXT: Violet : [#N::Color#]N::Violet
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/using-namespace.cpp
namespace N4 { namespace N3 { } } class N3; namespace N2 { namespace I1 { } namespace I4 = I1; namespace I5 { } namespace I1 { } void foo() { using namespace // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:14:20 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: I1 // CHECK-CC1: I4 // CHECK-CC1: I5 // CHECK-CC1: N2 // CHECK-CC1-NEXT: N4
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/CodeCompletion/namespace.cpp
namespace N3 { } namespace N2 { namespace I1 { } namespace I4 = I1; namespace I5 { } namespace I1 { } namespace // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:12 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: I1 // CHECK-CC1-NEXT: I5