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/Parser/cxx-ambig-decl-expr-xfail.cpp
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
// XFAIL: *
// FIXME: This is PR7655
struct X {
template<typename T> X(T);
X(int, int);
X operator()(int, int) const;
};
template<typename T, typename U> struct Y { };
X *x;
void f() {
int y = 0;
X (*x)(int(y), int(y)) = Y<int, float>(), ++y;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/char-literal-printing.c
|
// RUN: %clang_cc1 -ast-print %s
// RUN: %clang_cc1 -x c++ -ast-print %s
// RUN: %clang_cc1 -x c++ -std=c++11 -ast-print %s
#include <stddef.h>
char test1(void) { return '\\'; }
wchar_t test2(void) { return L'\\'; }
char test3(void) { return '\''; }
wchar_t test4(void) { return L'\''; }
char test5(void) { return '\a'; }
wchar_t test6(void) { return L'\a'; }
char test7(void) { return '\b'; }
wchar_t test8(void) { return L'\b'; }
char test9(void) { return '\e'; }
wchar_t test10(void) { return L'\e'; }
char test11(void) { return '\f'; }
wchar_t test12(void) { return L'\f'; }
char test13(void) { return '\n'; }
wchar_t test14(void) { return L'\n'; }
char test15(void) { return '\r'; }
wchar_t test16(void) { return L'\r'; }
char test17(void) { return '\t'; }
wchar_t test18(void) { return L'\t'; }
char test19(void) { return '\v'; }
wchar_t test20(void) { return L'\v'; }
char test21(void) { return 'c'; }
wchar_t test22(void) { return L'c'; }
char test23(void) { return '\x3'; }
wchar_t test24(void) { return L'\x3'; }
wchar_t test25(void) { return L'\x333'; }
#if __cplusplus >= 201103L
char16_t test26(void) { return u'\\'; }
char16_t test27(void) { return u'\''; }
char16_t test28(void) { return u'\a'; }
char16_t test29(void) { return u'\b'; }
char16_t test30(void) { return u'\e'; }
char16_t test31(void) { return u'\f'; }
char16_t test32(void) { return u'\n'; }
char16_t test33(void) { return u'\r'; }
char16_t test34(void) { return u'\t'; }
char16_t test35(void) { return u'\v'; }
char16_t test36(void) { return u'c'; }
char16_t test37(void) { return u'\x3'; }
char16_t test38(void) { return u'\x333'; }
char32_t test39(void) { return U'\\'; }
char32_t test40(void) { return U'\''; }
char32_t test41(void) { return U'\a'; }
char32_t test42(void) { return U'\b'; }
char32_t test43(void) { return U'\e'; }
char32_t test44(void) { return U'\f'; }
char32_t test45(void) { return U'\n'; }
char32_t test46(void) { return U'\r'; }
char32_t test47(void) { return U'\t'; }
char32_t test48(void) { return U'\v'; }
char32_t test49(void) { return U'c'; }
char32_t test50(void) { return U'\x3'; }
char32_t test51(void) { return U'\x333'; }
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx0x-lambda-expressions.cpp
|
// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++11 %s
enum E { e };
constexpr int id(int n) { return n; }
class C {
int f() {
int foo, bar;
[]; // expected-error {{expected body of lambda expression}}
[+] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
[foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}}
[foo,&this] {}; // expected-error {{'this' cannot be captured by reference}}
[&this] {}; // expected-error {{'this' cannot be captured by reference}}
[&,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
[=,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
[] {};
[=] (int i) {};
[&] (int) mutable -> void {};
[foo,bar] () { return 3; };
[=,&foo] () {};
[&,foo] () {};
[this] () {};
[] () -> class C { return C(); };
[] () -> enum E { return e; };
[] -> int { return 0; }; // expected-error{{lambda requires '()' before return type}}
[] mutable -> int { return 0; }; // expected-error{{lambda requires '()' before 'mutable'}}
[](int) -> {}; // PR13652 expected-error {{expected a type}}
return 1;
}
void designator_or_lambda() {
typedef int T;
const int b = 0;
const int c = 1;
int d;
int a1[1] = {[b] (T()) {}}; // expected-error{{no viable conversion from '(lambda}}
int a2[1] = {[b] = 1 };
int a3[1] = {[b,c] = 1 }; // expected-error{{expected ']'}} expected-note {{to match}}
int a4[1] = {[&b] = 1 }; // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'const int *'}}
int a5[3] = { []{return 0;}() };
int a6[1] = {[this] = 1 }; // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'C *'}}
int a7[1] = {[d(0)] { return d; } ()}; // expected-warning{{extension}}
int a8[1] = {[d = 0] { return d; } ()}; // expected-warning{{extension}}
int a9[1] = {[d = 0] = 1}; // expected-error{{is not an integral constant expression}}
int a10[1] = {[id(0)] { return id; } ()}; // expected-warning{{extension}}
int a11[1] = {[id(0)] = 1};
}
void delete_lambda(int *p) {
delete [] p;
delete [] (int*) { new int }; // ok, compound-literal, not lambda
delete [] { return new int; } (); // expected-error{{expected expression}}
delete [&] { return new int; } (); // ok, lambda
}
// We support init-captures in C++11 as an extension.
int z;
void init_capture() {
[n(0)] () mutable -> int { return ++n; }; // expected-warning{{extension}}
[n{0}] { return; }; // expected-error {{<initializer_list>}} expected-warning{{extension}} expected-warning{{will change meaning in a future version}}
[n = 0] { return ++n; }; // expected-error {{captured by copy in a non-mutable}} expected-warning{{extension}}
[n = {0}] { return; }; // expected-error {{<initializer_list>}} expected-warning{{extension}}
[a([&b = z]{})](){}; // expected-warning 2{{extension}}
int x = 4;
auto y = [&r = x, x = x + 1]() -> int { // expected-warning 2{{extension}}
r += 2;
return x + 2;
} ();
}
void attributes() {
[] [[]] {}; // expected-error {{lambda requires '()' before attribute specifier}}
[] __attribute__((noreturn)) {}; // expected-error {{lambda requires '()' before attribute specifier}}
[]() [[]]
mutable {}; // expected-error {{expected body of lambda expression}}
[]() [[]] {};
[]() [[]] -> void {};
[]() mutable [[]] -> void {};
[]() mutable noexcept [[]] -> void {};
// Testing GNU-style attributes on lambdas -- the attribute is specified
// before the mutable specifier instead of after (unlike C++11).
[]() __attribute__((noreturn)) mutable { while(1); };
[]() mutable
__attribute__((noreturn)) { while(1); }; // expected-error {{expected body of lambda expression}}
}
};
template <typename>
void PR22122() {
[](int) -> {}; // expected-error {{expected a type}}
}
template void PR22122<int>();
struct S {
template <typename T>
void m (T x =[0); // expected-error{{expected variable name or 'this' in lambda capture list}}
} s;
struct U {
template <typename T>
void m_fn1(T x = 0[0); // expected-error{{expected ']'}} expected-note{{to match this '['}}
} *U;
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/ms-inline-asm.c
|
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -verify -fasm-blocks
// Disabling gnu inline assembly should have no effect on this testcase
// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -verify -fasm-blocks -fno-gnu-inline-asm
#define M __asm int 0x2c
#define M2 int
void t1(void) { M }
void t2(void) { __asm int 0x2c }
void t3(void) { __asm M2 0x2c }
void t4(void) { __asm mov eax, fs:[0x10] }
void t5() {
__asm {
int 0x2c ; } asm comments are fun! }{
}
__asm {}
}
int t6() {
__asm int 3 ; } comments for single-line asm
__asm {}
__asm int 4
return 10;
}
void t7() {
__asm {
push ebx
mov ebx, 0x07
pop ebx
}
}
void t8() {
__asm nop __asm nop __asm nop
}
void t9() {
__asm nop __asm nop ; __asm nop
}
void t10() {
__asm {
mov eax, 0
__asm {
mov eax, 1
{
mov eax, 2
}
}
}
}
void t11() {
do { __asm mov eax, 0 __asm { __asm mov edx, 1 } } while(0);
}
void t12() {
__asm jmp label // expected-error {{use of undeclared label 'label'}}
}
int t_fail() { // expected-note {{to match this}}
__asm
__asm { // expected-error 2 {{expected}} expected-note {{to match this}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/c11-noreturn.c
|
// RUN: %clang_cc1 -std=c11 -fsyntax-only -verify %s
// RUN: not %clang_cc1 -std=c99 -pedantic -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXT %s
_Noreturn int f();
int _Noreturn f(); // expected-note {{previous}}
int f _Noreturn(); // expected-error {{expected ';'}} expected-error 2{{}}
int f() _Noreturn; // expected-error {{'_Noreturn' keyword must precede function declarator}}
_Noreturn char c1; // expected-error {{'_Noreturn' can only appear on functions}}
char _Noreturn c2; // expected-error {{'_Noreturn' can only appear on functions}}
typedef _Noreturn int g(); // expected-error {{'_Noreturn' can only appear on functions}}
_Noreturn int; // expected-error {{'_Noreturn' can only appear on functions}} expected-warning {{does not declare anything}}
_Noreturn struct S; // expected-error {{'_Noreturn' can only appear on functions}}
_Noreturn enum E { e }; // expected-error {{'_Noreturn' can only appear on functions}}
// CHECK-EXT: _Noreturn functions are a C11-specific feature
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/pragma-visibility2.c
|
// RUN: %clang_cc1 -emit-llvm -triple i386-linux-gnu -o %t %s
// RUN: FileCheck --input-file=%t %s
// PR10392
#define push(foo) push(default)
#pragma GCC visibility push(hidden)
int v1;
// CHECK: @v1 = common hidden global i32 0, align 4
#pragma GCC visibility pop
int v2;
// CHECK: @v2 = common global i32 0, align 4
_Pragma("GCC visibility push(hidden)");
int v3;
// CHECK: @v3 = common hidden global i32 0, align 4
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx-member-init-missing-paren-crash.cpp
|
// RUN: not %clang_cc1 -fsyntax-only %s
// Note: The important part here is that we don't crash, not any specific errors
class Test {
public:
Test() : ab_(false {};
bool ab() {
return ab_;
}
private:
bool ab_;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx-typeof.cpp
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
static void test() {
int *pi;
int x;
typeof pi[x] y;
}
// Part of rdar://problem/8347416; from the gcc test suite.
struct S {
int i;
__typeof(S::i) foo(); // expected-error {{invalid use of non-static data member 'i'}}
};
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx0x-decl.cpp
|
// RUN: %clang_cc1 -verify -fsyntax-only -std=c++11 -pedantic-errors -triple x86_64-linux-gnu %s
// Make sure we know these are legitimate commas and not typos for ';'.
namespace Commas {
int a,
b [[ ]],
c alignas(double);
}
struct S {};
enum E { e, };
auto f() -> struct S {
return S();
}
auto g() -> enum E {
return E();
}
class ExtraSemiAfterMemFn {
// Due to a peculiarity in the C++11 grammar, a deleted or defaulted function
// is permitted to be followed by either one or two semicolons.
void f() = delete // expected-error {{expected ';' after delete}}
void g() = delete; // ok
void h() = delete;; // ok
void i() = delete;;; // expected-error {{extra ';' after member function definition}}
};
int *const const p = 0; // expected-error {{duplicate 'const' declaration specifier}}
const const int *q = 0; // expected-error {{duplicate 'const' declaration specifier}}
struct MultiCV {
void f() const const; // expected-error {{duplicate 'const' declaration specifier}}
};
static_assert(something, ""); // expected-error {{undeclared identifier}}
// PR9903
struct SS {
typedef void d() = default; // expected-error {{function definition declared 'typedef'}} expected-error {{only special member functions may be defaulted}}
};
using PR14855 = int S::; // expected-error {{expected ';' after alias declaration}}
// Ensure that 'this' has a const-qualified type in a trailing return type for
// a constexpr function.
struct ConstexprTrailingReturn {
int n;
constexpr auto f() const -> decltype((n));
};
constexpr const int &ConstexprTrailingReturn::f() const { return n; }
namespace TestIsValidAfterTypeSpecifier {
struct s {} v;
struct s
thread_local tl;
struct s
&r0 = v;
struct s
&&r1 = s();
struct s
bitand r2 = v;
struct s
and r3 = s();
enum E {};
enum E
[[]] e;
}
namespace PR5066 {
using T = int (*f)(); // expected-error {{type-id cannot have a name}}
template<typename T> using U = int (*f)(); // expected-error {{type-id cannot have a name}}
auto f() -> int (*f)(); // expected-error {{type-id cannot have a name}}
auto g = []() -> int (*f)() {}; // expected-error {{type-id cannot have a name}}
}
namespace FinalOverride {
struct Base {
virtual void *f();
virtual void *g();
virtual void *h();
virtual void *i();
};
struct Derived : Base {
virtual auto f() -> void *final;
virtual auto g() -> void *override;
virtual auto h() -> void *final override;
virtual auto i() -> void *override final;
};
}
namespace UsingDeclAttrs {
using T __attribute__((aligned(1))) = int;
using T [[gnu::aligned(1)]] = int;
static_assert(alignof(T) == 1, "");
using [[gnu::aligned(1)]] T = int; // expected-error {{an attribute list cannot appear here}}
using T = int [[gnu::aligned(1)]]; // expected-error {{'aligned' attribute cannot be applied to types}}
}
namespace DuplicateSpecifier {
constexpr constexpr int f(); // expected-warning {{duplicate 'constexpr' declaration specifier}}
constexpr int constexpr a = 0; // expected-warning {{duplicate 'constexpr' declaration specifier}}
struct A {
friend constexpr int constexpr friend f(); // expected-warning {{duplicate 'friend' declaration specifier}} \
// expected-warning {{duplicate 'constexpr' declaration specifier}}
friend struct A friend; // expected-warning {{duplicate 'friend'}} expected-error {{'friend' must appear first}}
};
}
namespace ColonColonDecltype {
struct S { struct T {}; };
::decltype(S())::T invalid; // expected-error {{expected unqualified-id}}
}
struct Base { virtual void f() = 0; virtual void g() = 0; virtual void h() = 0; };
struct MemberComponentOrder : Base {
void f() override __asm__("foobar") __attribute__(( )) {}
void g() __attribute__(( )) override;
void h() __attribute__(( )) override {}
};
void NoMissingSemicolonHere(struct S
[3]);
template<int ...N> void NoMissingSemicolonHereEither(struct S
... [N]);
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/attributes.c
|
// RUN: %clang_cc1 -fsyntax-only -verify %s -pedantic -std=c99
int __attribute__(()) x;
__inline void __attribute__((__always_inline__, __nodebug__))
foo(void) {
}
__attribute__(()) y; // expected-warning {{defaults to 'int'}}
// PR2796
int (__attribute__(()) *z)(long y);
void f1(__attribute__(()) int x);
int f2(y, __attribute__(()) x); // expected-error {{expected identifier}}
// This is parsed as a normal argument list (with two args that are implicit
// int) because the __attribute__ is a declspec.
void f3(__attribute__(()) x, // expected-warning {{defaults to 'int'}}
y); // expected-warning {{defaults to 'int'}}
void f4(__attribute__(())); // expected-error {{expected parameter declarator}}
// This is ok, the __attribute__ applies to the pointer.
int baz(int (__attribute__(()) *x)(long y));
void g1(void (*f1)(__attribute__(()) int x));
void g2(int (*f2)(y, __attribute__(()) x)); // expected-error {{expected identifier}}
void g3(void (*f3)(__attribute__(()) x, int y)); // expected-warning {{defaults to 'int'}}
void g4(void (*f4)(__attribute__(()))); // expected-error {{expected parameter declarator}}
void (*h1)(void (*f1)(__attribute__(()) int x));
void (*h2)(int (*f2)(y, __attribute__(()) x)); // expected-error {{expected identifier}}
void (*h3)(void (*f3)(__attribute__(()) x)); // expected-warning {{defaults to 'int'}}
void (*h4)(void (*f4)(__attribute__(()))); // expected-error {{expected parameter declarator}}
// rdar://6131260
int foo42(void) {
int x, __attribute__((unused)) y, z;
return 0;
}
// rdar://6096491
void __attribute__((noreturn)) d0(void), __attribute__((noreturn)) d1(void);
void d2(void) __attribute__((noreturn)), d3(void) __attribute__((noreturn));
// PR6287
void __attribute__((returns_twice)) returns_twice_test();
int aligned(int);
int __attribute__((vec_type_hint(char, aligned(16) )) missing_rparen_1; // expected-error 2{{expected ')'}} expected-note {{to match}} expected-warning {{does not declare anything}}
int __attribute__((mode(x aligned(16) )) missing_rparen_2; // expected-error {{expected ')'}}
int __attribute__((format(printf, 0 aligned(16) )) missing_rparen_3; // expected-error {{expected ')'}}
int testFundef1(int *a) __attribute__((nonnull(1))) { // \
// expected-warning {{GCC does not allow 'nonnull' attribute in this position on a function definition}}
return *a;
}
// noreturn is lifted to type qualifier
void testFundef2() __attribute__((noreturn)) { // \
// expected-warning {{GCC does not allow 'noreturn' attribute in this position on a function definition}}
testFundef2();
}
int testFundef3(int *a) __attribute__((nonnull(1), // \
// expected-warning {{GCC does not allow 'nonnull' attribute in this position on a function definition}}
pure)) { // \
// expected-warning {{GCC does not allow 'pure' attribute in this position on a function definition}}
return *a;
}
int testFundef4(int *a) __attribute__((nonnull(1))) // \
// expected-warning {{GCC does not allow 'nonnull' attribute in this position on a function definition}}
__attribute((pure)) { // \
// expected-warning {{GCC does not allow 'pure' attribute in this position on a function definition}}
return *a;
}
// GCC allows these
void testFundef5() __attribute__(()) { }
__attribute__((pure)) int testFundef6(int a) { return a; }
void deprecatedTestFun(void) __attribute__((deprecated()));
struct s {
int a;
};
// This test ensure compatibility with parsing GNU-style attributes
// where the attribute is on a separate line from the elaborated type
// specifier.
struct s
__attribute__((used)) bar;
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/asm.cpp
|
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
int foo1 asm ("bar1");
int foo2 asm (L"bar2"); // expected-error {{cannot use wide string literal in 'asm'}}
int foo3 asm (u8"bar3"); // expected-error {{cannot use unicode string literal in 'asm'}}
int foo4 asm (u"bar4"); // expected-error {{cannot use unicode string literal in 'asm'}}
int foo5 asm (U"bar5"); // expected-error {{cannot use unicode string literal in 'asm'}}
int foo6 asm ("bar6"_x); // expected-error {{string literal with user-defined suffix cannot be used here}}
int foo6 asm ("" L"bar7"); // expected-error {{cannot use wide string literal in 'asm'}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx-in-c.c
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR9137
void f0(int x) : {}; // expected-error{{expected function body after function declarator}}
void f1(int x) try {}; // expected-error{{expected function body after function declarator}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx-ext-delete-default.cpp
|
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
struct A {
A(const A&) = delete; // expected-warning {{C++11 extension}}
A& operator=(const A&) = delete; // expected-warning {{C++11 extension}}
A() = default; // expected-warning {{C++11 extension}}
~A();
};
void f() = delete; // expected-warning {{C++11 extension}}
A::~A() = default; //expected-warning {{C++11 extension}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/warn-dangling-else.cpp
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wdangling-else %s
void f(int a, int b, int c, int d, int e) {
// should warn
{ if (a) if (b) d++; else e++; } // expected-warning {{add explicit braces to avoid dangling else}}
{ if (a) while (b) if (c) d++; else e++; } // expected-warning {{add explicit braces to avoid dangling else}}
{ if (a) switch (b) if (c) d++; else e++; } // expected-warning {{add explicit braces to avoid dangling else}}
{ if (a) for (;;) if (c) d++; else e++; } // expected-warning {{add explicit braces to avoid dangling else}}
{ if (a) if (b) if (d) d++; else e++; else d--; } // expected-warning {{add explicit braces to avoid dangling else}}
if (a)
if (b) {
d++;
} else e++; // expected-warning {{add explicit braces to avoid dangling else}}
// shouldn't
{ if (a) if (b) d++; }
{ if (a) if (b) if (c) d++; }
{ if (a) if (b) d++; else e++; else d--; }
{ if (a) if (b) if (d) d++; else e++; else d--; else e--; }
{ if (a) do if (b) d++; else e++; while (c); }
if (a) {
if (b) d++;
else e++;
}
if (a) {
if (b) d++;
} else e++;
}
// Somewhat more elaborate case that shouldn't warn.
class A {
public:
void operator<<(const char* s) {}
};
void HandleDisabledThing() {}
A GetThing() { return A(); }
#define FOO(X) \
switch (0) default: \
if (!(X)) \
HandleDisabledThing(); \
else \
GetThing()
void f(bool cond) {
int x = 0;
if (cond)
FOO(x) << "hello"; // no warning
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx-bool.cpp
|
// RUN: %clang_cc1 -fsyntax-only %s
bool a = true;
bool b = false;
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/promote_types_in_proto.c
|
// RUN: %clang_cc1 %s
void functionPromotion(void f(char *const []));
void arrayPromotion(char * const argv[]);
int whatever(int argc, char *argv[])
{
arrayPromotion(argv);
functionPromotion(arrayPromotion);
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx-typeid.cpp
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
// FIXME: This should really include <typeinfo>, but we don't have that yet.
namespace std {
class type_info;
}
void f()
{
(void)typeid(int);
(void)typeid(0);
(void)typeid 1; // expected-error {{expected '(' after 'typeid'}}
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx-ambig-paren-expr.cpp
|
// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
void f() {
typedef int T;
int x, *px;
// Type id.
(T())x; // expected-error {{cast from 'int' to 'T ()'}}
(T())+x; // expected-error {{cast from 'int' to 'T ()'}}
(T())*px; // expected-error {{cast from 'int' to 'T ()'}}
// Expression.
x = (T());
x = (T())/x;
typedef int *PT;
// Make sure stuff inside the parens are parsed only once (only one warning).
x = (PT()[(int){1}]); // expected-warning {{compound literals}}
// Special case: empty parens is a call, not an expression
struct S{int operator()();};
(S())();
// FIXME: Special case: "++" is postfix here, not prefix
// (S())++;
}
// Make sure we do tentative parsing correctly in conditions.
typedef int type;
struct rec { rec(int); };
namespace ns {
typedef int type;
struct rec { rec(int); };
}
struct cls {
typedef int type;
struct rec { rec(int); };
};
struct result {
template <class T> result(T);
bool check();
};
void test(int i) {
if (result((cls::type) i).check())
return;
if (result((ns::type) i).check())
return;
if (result((::type) i).check())
return;
if (result((cls::rec) i).check())
return;
if (result((ns::rec) i).check())
return;
if (result((::rec) i).check())
return;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx-template-argument.cpp
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify %s -fdelayed-template-parsing
template<typename T> struct A {};
// Check for template argument lists followed by junk
// FIXME: The diagnostics here aren't great...
A<int+> int x; // expected-error {{expected '>'}} expected-error {{expected unqualified-id}}
A<int x; // expected-error {{type-id cannot have a name}} expected-error {{expected '>'}}
// PR8912
template <bool> struct S {};
S<bool(2 > 1)> s;
// Test behavior when a template-id is ended by a token which starts with '>'.
namespace greatergreater {
template<typename T> struct S { S(); S(T); };
void f(S<int>=0); // expected-error {{a space is required between a right angle bracket and an equals sign (use '> =')}}
void f(S<S<int>>=S<int>()); // expected-error {{use '> >'}} expected-error {{use '> ='}}
template<typename T> void t();
void g() {
void (*p)() = &t<int>;
(void)(&t<int>==p); // expected-error {{use '> ='}}
(void)(&t<int>>=p); // expected-error {{use '> >'}}
(void)(&t<S<int>>>=p); // expected-error {{use '> >'}}
(void)(&t<S<int>>==p); // expected-error {{use '> >'}} expected-error {{use '> ='}}
}
}
namespace PR5925 {
template <typename x>
class foo { // expected-note {{here}}
};
void bar(foo *X) { // expected-error {{requires template arguments}}
}
}
namespace PR13210 {
template <class T>
class C {}; // expected-note {{here}}
void f() {
new C(); // expected-error {{requires template arguments}}
}
}
// Don't emit spurious messages
namespace pr16225add {
template<class T1, typename T2> struct Known { }; // expected-note 3 {{template is declared here}}
template<class T1, typename T2> struct X;
template<class T1, typename T2> struct ABC; // expected-note {{template is declared here}}
template<int N1, int N2> struct ABC2 {};
template<class T1, typename T2> struct foo :
UnknownBase<T1,T2> // expected-error {{unknown template name 'UnknownBase'}}
{ };
template<class T1, typename T2> struct foo2 :
UnknownBase<T1,T2>, // expected-error {{unknown template name 'UnknownBase'}}
Known<T1> // expected-error {{too few template arguments for class template 'Known'}}
{ };
template<class T1, typename T2> struct foo3 :
UnknownBase<T1,T2,ABC<T2,T1> > // expected-error {{unknown template name 'UnknownBase'}}
{ };
template<class T1, typename T2> struct foo4 :
UnknownBase<T1,ABC<T2> >, // expected-error {{unknown template name 'UnknownBase'}} \
// expected-error {{too few template arguments for class template 'ABC'}}
Known<T1> // expected-error {{too few template arguments for class template 'Known'}}
{ };
template<class T1, typename T2> struct foo5 :
UnknownBase<T1,T2,ABC<T2,T1>> // expected-error {{unknown template name 'UnknownBase'}} \
// expected-error {{use '> >'}}
{ };
template<class T1, typename T2> struct foo6 :
UnknownBase<T1,ABC<T2,T1>>, // expected-error {{unknown template name 'UnknownBase'}} \
// expected-error {{use '> >'}}
Known<T1> // expected-error {{too few template arguments for class template 'Known'}}
{ };
template<class T1, typename T2, int N> struct foo7 :
UnknownBase<T1,T2,(N>1)> // expected-error {{unknown template name 'UnknownBase'}}
{ };
template<class T1, typename T2> struct foo8 :
UnknownBase<X<int,int>,X<int,int>> // expected-error {{unknown template name 'UnknownBase'}} \
// expected-error {{use '> >'}}
{ };
template<class T1, typename T2> struct foo9 :
UnknownBase<Known<int,int>,X<int,int>> // expected-error {{unknown template name 'UnknownBase'}} \
// expected-error {{use '> >'}}
{ };
template<class T1, typename T2> struct foo10 :
UnknownBase<Known<int,int>,X<int,X<int,int>>> // expected-error {{unknown template name 'UnknownBase'}} \
// expected-error {{use '> >'}}
{ };
template<int N1, int N2> struct foo11 :
UnknownBase<2<N1,N2<4> // expected-error {{unknown template name 'UnknownBase'}}
{ };
}
namespace PR18793 {
template<typename T, T> struct S {};
template<typename T> int g(S<T, (T())> *);
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/ms-if-exists.cpp
|
// RUN: %clang_cc1 %s -std=c++11 -fsyntax-only -Wmicrosoft -verify -fms-extensions
class MayExist {
private:
typedef int Type;
};
void test_if_exists_stmts() {
int b = 0;
__if_exists(MayExist::Type) {
b++;
b++;
}
__if_exists(MayExist::Type_not) {
this will not compile.
}
__if_not_exists(MayExist::Type) {
this will not compile.
}
__if_not_exists(MayExist::Type_not) {
b++;
b++;
}
}
int if_exists_creates_no_scope() {
__if_exists(MayExist::Type) {
int x; // 'x' is declared in the parent scope.
}
__if_not_exists(MayExist::Type_not) {
x++;
}
return x;
}
__if_exists(MayExist::Type) {
int var23;
}
__if_exists(MayExist::Type_not) {
this will not compile.
}
__if_not_exists(MayExist::Type) {
this will not compile.
}
__if_not_exists(MayExist::Type_not) {
int var244;
}
void test_if_exists_init_list() {
int array1[] = {
0,
__if_exists(MayExist::Type) {2, }
3
};
int array2[] = {
0,
__if_exists(MayExist::Type_not) { this will not compile }
3
};
int array3[] = {
0,
__if_not_exists(MayExist::Type_not) {2, }
3
};
int array4[] = {
0,
__if_not_exists(MayExist::Type) { this will not compile }
3
};
}
class IfExistsClassScope {
__if_exists(MayExist::Type) {
// __if_exists, __if_not_exists can nest
__if_not_exists(MayExist::Type_not) {
int var123;
}
int var23;
}
__if_exists(MayExist::Type_not) {
this will not compile.
}
__if_not_exists(MayExist::Type) {
this will not compile.
}
__if_not_exists(MayExist::Type_not) {
int var244;
}
};
void test_nested_if_exists() {
__if_exists(MayExist::Type) {
int x = 42;
__if_not_exists(MayExist::Type_not) {
x++;
}
}
}
void test_attribute_on_if_exists() {
[[clang::fallthrough]] // expected-error {{an attribute list cannot appear here}}
__if_exists(MayExist::Type) {
int x;
}
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/pragma-fp-contract.c
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
void f1(void) {
int x = 0;
/* expected-error@+1 {{'#pragma fp_contract' can only appear at file scope or at the start of a compound statement}} */
#pragma STDC FP_CONTRACT ON
}
void f2(void) {
#pragma STDC FP_CONTRACT OFF
#pragma STDC FP_CONTRACT ON
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/c1x-alignas.c
|
// RUN: %clang_cc1 -std=c11 -fsyntax-only -verify %s
// RUN: not %clang_cc1 -std=c99 -pedantic -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXT %s
_Alignas(4) char c1;
unsigned _Alignas(long) char c2;
char _Alignas(16) c3;
char c4 _Alignas(32); // expected-error {{expected ';' after top level declarator}} expected-warning {{declaration does not declare anything}}
char _Alignas(_Alignof(int)) c5;
// CHECK-EXT: _Alignas is a C11-specific feature
// CHECK-EXT: _Alignof is a C11-specific feature
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/pointer-arithmetic.c
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
int *test1(int *a) { return a + 1; }
int *test2(int *a) { return 1 + a; }
int *test3(int *a) { return a - 1; }
int test4(int *a, int *b) { return a - b; }
int test5(int *a, int *b) { return a + b; } /* expected-error {{invalid operands}} */
int *test6(int *a) { return 1 - a; } /* expected-error {{invalid operands}} */
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/pragma-pack.c
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
// Note that this puts the expected lines before the directives to work around
// limitations in the -verify mode.
/* expected-warning {{missing '(' after '#pragma pack'}}*/ #pragma pack 10
#pragma pack()
#pragma pack(8)
/*expected-warning {{unknown action for '#pragma pack'}}*/ #pragma pack(hello)
#pragma pack(push)
#pragma pack(pop)
/* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ #pragma pack(push,)
/* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ #pragma pack(push,)
/* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ #pragma pack(pop,)
#pragma pack(push,i)
/* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ #pragma pack(push,i,
/* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ #pragma pack(push,i,)
/* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ #pragma pack(push,i,help)
#pragma pack(push,8)
/* expected-warning {{missing ')' after '#pragma pack'}}*/ #pragma pack(push,8,
/* expected-warning {{missing ')' after '#pragma pack'}}*/ #pragma pack(push,8,)
/* expected-warning {{missing ')' after '#pragma pack'}}*/ #pragma pack(push,i,8
#pragma pack(push,i,8)
/* expected-warning {{missing ')' after '#pragma pack'}}*/ #pragma pack(push
_Pragma("pack(push)")
/* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ _Pragma("pack(push,)")
// PR13580
struct S
{
char a[3];
#pragma pack(1)
struct T
{
char b;
int c;
} d;
#pragma pack()
int e;
};
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/top-level-semi-cxx0x.cpp
|
// RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++11 -verify %s
// expected-no-diagnostics
void foo();
void bar() { };
void wibble();
;
namespace Blah {
void f() { };
void g();
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx-ambig-init-templ.cpp
|
// RUN: %clang_cc1 -Wno-uninitialized -std=c++11 -verify %s
template<int> struct c { c(int) = delete; typedef void val; operator int() const; };
int val;
int foobar;
struct S {
int k1 = a < b < c, d > ::val, e1;
int k2 = a < b, c < d > ::val, e2;
int k3 = b < a < c, d > ::val, e3;
int k4 = b < c, x, y = d > ::val, e4;
int k5 = T1 < b, &S::operator=(int); // expected-error {{extra qualification}}
int k6 = T2 < b, &S::operator= >::val;
int k7 = T1 < b, &S::operator>(int); // expected-error {{extra qualification}}
int k8 = T2 < b, &S::operator> >::val;
int k9 = T3 < a < b, c >> (d), e5 = 1 > (e4);
int k10 = 0 < T3 < a < b, c >> (d
) // expected-error {{expected ';' at end of declaration}}
, a > (e4);
int k11 = 0 < 1, c<3>::*ptr;
int k12 = e < 0, int a<b<c>::* >(), e11;
void f1(
int k1 = a < b < c, d > ::val,
int k2 = b < a < c, d > ::val,
int k3 = b < c, int x = 0 > ::val,
int k4 = a < b, T3 < int > >(), // expected-error {{must be an expression}}
int k5 = a < b, c < d > ::val,
int k6 = a < b, c < d > (n) // expected-error {{undeclared identifier 'n'}}
);
void f2a(
// T3<int> here is a parameter type, so must be declared before it is used.
int k1 = c < b, T3 < int > x = 0 // expected-error {{unexpected end of default argument expression}}
);
template<typename, int=0> struct T3 { T3(int); operator int(); };
void f2b(
int k1 = c < b, T3 < int > x = 0 // ok
);
// This is a one-parameter function. Ensure we don't typo-correct it to
// int = a < b, c < foobar > ()
// ... which would be a function with two parameters.
int f3(int = a < b, c < goobar > ());
static constexpr int (S::*f3_test)(int) = &S::f3;
void f4(
int k1 = a<1,2>::val,
int missing_default // expected-error {{missing default argument on parameter}}
);
void f5(
int k1 = b < c,
int missing_default // expected-error {{missing default argument on parameter}}
);
void f6(
int k = b < c,
unsigned int (missing_default) // expected-error {{missing default argument on parameter}}
);
template<int, int=0> struct a { static const int val = 0; operator int(); }; // expected-note {{here}}
static const int b = 0, c = 1, d = 2, goobar = 3;
template<int, typename> struct e { operator int(); };
int mp1 = 0 < 1,
a<b<c,b<c>::*mp2,
mp3 = 0 > a<b<c>::val,
a<b<c,b<c>::*mp4 = 0,
a<b<c,b<c>::*mp5 {0},
a<b<c,b<c>::*mp6;
int np1 = e<0, int a<b<c,b<c>::*>();
static const int T1 = 4;
template<int, int &(S::*)(int)> struct T2 { static const int val = 0; };
};
namespace NoAnnotationTokens {
template<bool> struct Bool { Bool(int); };
static const bool in_class = false;
struct Test {
// Check we don't keep around a Bool<false> annotation token here.
int f(Bool<true> = X<Y, Bool<in_class> >(0));
// But it's OK if we do here.
int g(Bool<true> = Z<Y, Bool<in_class> = Bool<false>(0));
static const bool in_class = true;
template<int, typename U> using X = U;
static const int Y = 0, Z = 0;
};
}
namespace ImplicitInstantiation {
template<typename T> struct HasError { typename T::error error; }; // expected-error {{has no members}}
struct S {
// This triggers the instantiation of the outer HasError<int> during
// disambiguation, even though it uses the inner HasError<int>.
void f(int a = X<Y, HasError<int>::Z >()); // expected-note {{in instantiation of}}
template<typename, typename> struct X { operator int(); };
typedef int Y;
template<typename> struct HasError { typedef int Z; };
};
HasError<int> hei;
}
namespace CWG325 {
template <int A, typename B> struct T { static int i; operator int(); };
class C {
int Foo (int i = T<1, int>::i);
};
class D {
int Foo (int i = T<1, int>::i);
template <int A, typename B> struct T {static int i;};
};
const int a = 0;
typedef int b;
T<a,b> c;
struct E {
int n = T<a,b>(c);
};
}
namespace Operators {
struct Y {};
constexpr int operator,(const Y&, const Y&) { return 8; }
constexpr int operator>(const Y&, const Y&) { return 8; }
constexpr int operator<(const Y&, const Y&) { return 8; }
constexpr int operator>>(const Y&, const Y&) { return 8; }
struct X {
typedef int (*Fn)(const Y&, const Y&);
Fn a = operator,, b = operator<, c = operator>;
void f(Fn a = operator,, Fn b = operator<, Fn c = operator>);
int k1 = T1<0, operator<, operator>, operator<>::val, l1;
int k2 = T1<0, operator>, operator,, operator,>::val, l2;
int k3 = T2<0, operator,(Y{}, Y{}), operator<(Y{}, Y{})>::val, l3;
int k4 = T2<0, operator>(Y{}, Y{}), operator,(Y{}, Y{})>::val, l4;
int k5 = T3<0, operator>>>::val, l5;
int k6 = T4<0, T3<0, operator>>>>::val, l6;
template<int, Fn, Fn, Fn> struct T1 { enum { val }; };
template<int, int, int> struct T2 { enum { val }; };
template<int, Fn> struct T3 { enum { val }; };
template<int, typename T> struct T4 : T {};
};
}
namespace ElaboratedTypeSpecifiers {
struct S {
int f(int x = T<a, struct S>());
int h(int x = T<a, union __attribute__(()) U>());
int i(int x = T<a, enum E>());
int j(int x = T<a, struct S::template T<0, enum E>>());
template <int, typename> struct T { operator int(); };
static const int a = 0;
enum E {};
};
}
namespace PR20459 {
template <typename EncTraits> struct A {
void foo(int = EncTraits::template TypeEnc<int, int>::val); // ok
};
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx-class-template-specialization.cpp
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
struct A {
template<typename T>
void f();
};
class A::f<int>;
// expected-error@-1 {{identifier followed by '<' indicates a class template specialization but 'f' refers to a function template}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/nullability.c
|
// RUN: %clang_cc1 -fsyntax-only -std=c99 -Wno-nullability-declspec -pedantic %s -verify
_Nonnull int *ptr; // expected-warning{{type nullability specifier '_Nonnull' is a Clang extension}}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-extension"
_Nonnull int *ptr2; // no-warning
#pragma clang diagnostic pop
#if !__has_feature(nullability)
# error Nullability should always be supported
#endif
#if !__has_extension(nullability)
# error Nullability should always be supported as an extension
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/attr-availability.c
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
#if !__has_feature(attribute_availability)
# error 'availability' attribute is not available
#endif
void f0() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));
void f1() __attribute__((availability(macosx,deprecated=10.4,introduced=10.2,obsoleted=10.6)));
void f2() __attribute__((availability(ios,deprecated=10.4.7,introduced=10,obsoleted=10.6)));
void f3() __attribute__((availability(ios,deprecated=10.4.7,introduced=10,obsoleted=10.6,introduced=10.2))); // expected-error{{redundant 'introduced' availability change; only the last specified change will be used}}
void f4() __attribute__((availability(macosx,introduced=10.5), availability(ios,unavailable)));
void f5() __attribute__((availability(macosx,introduced=10.5), availability(ios,unavailable, unavailable))); // expected-error{{redundant 'unavailable' availability change; only the last specified change will be used}}
void f6() __attribute__((availability(macosx,unavailable,introduced=10.5))); // expected-warning{{'unavailable' availability overrides all other availability information}}
void f7() __attribute__((availability(macosx,message=L"wide"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
void f8() __attribute__((availability(macosx,message="a" L"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
// rdar://10095131
enum E{
gorf __attribute__((availability(macosx,introduced=8.5, message = 10.0))), // expected-error {{expected string literal for optional message in 'availability' attribute}}
garf __attribute__((availability(macosx,introduced=8.5, message))), // expected-error {{expected '=' after 'message'}}
foo __attribute__((availability(macosx,introduced=8.5,deprecated=9.0, message="Use CTFontCopyPostScriptName()", deprecated=10.0))) // expected-error {{expected ')'}} \
// expected-note {{to match this '('}}
};
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/ms-inline-asm-nested-braces.c
|
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -verify -fasm-blocks
int t_fail() { // expected-note {{to match this}}
__asm
{ // expected-note {{to match this}}
{ // expected-note {{to match this}}
{
} // expected-error 3 {{expected}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx11-user-defined-literals.cpp
|
// RUN: %clang_cc1 -std=c++11 -verify %s -fms-extensions -triple x86_64-apple-darwin9.0.0
// A ud-suffix cannot be used on string literals in a whole bunch of contexts:
#include "foo"_bar // expected-error {{expected "FILENAME" or <FILENAME>}}
#line 1 "foo"_bar // expected-error {{user-defined suffix cannot be used here}}
# 1 "foo"_bar 1 // expected-error {{user-defined suffix cannot be used here}}
#ident "foo"_bar // expected-error {{user-defined suffix cannot be used here}}
_Pragma("foo"_bar) // expected-error {{user-defined suffix cannot be used here}}
#pragma comment(lib, "foo"_bar) // expected-error {{user-defined suffix cannot be used here}}
_Pragma("comment(lib, \"foo\"_bar)") // expected-error {{user-defined suffix cannot be used here}}
#pragma message "hi"_there // expected-error {{user-defined suffix cannot be used here}} expected-warning {{hi}}
#pragma push_macro("foo"_bar) // expected-error {{user-defined suffix cannot be used here}}
#if __has_warning("-Wan-island-to-discover"_bar) // expected-error {{user-defined suffix cannot be used here}}
#elif __has_include("foo"_bar) // expected-error {{expected "FILENAME" or <FILENAME>}}
#endif
extern "C++"_x {} // expected-error {{user-defined suffix cannot be used here}}
int f() {
asm("mov %eax, %rdx"_foo); // expected-error {{user-defined suffix cannot be used here}}
}
static_assert(true, "foo"_bar); // expected-error {{user-defined suffix cannot be used here}}
int cake() __attribute__((availability(macosx, unavailable, message = "is a lie"_x))); // expected-error {{user-defined suffix cannot be used here}}
// A ud-suffix cannot be used on character literals in preprocessor constant
// expressions:
#if 'x'_y - u'x'_z // expected-error 2{{character literal with user-defined suffix cannot be used in preprocessor constant expression}}
#error error
#endif
// A ud-suffix cannot be used on integer literals in preprocessor constant
// expressions:
#if 0_foo // expected-error {{integer literal with user-defined suffix cannot be used in preprocessor constant expression}}
#error error
#endif
// But they can appear in expressions.
constexpr char operator"" _id(char c) { return c; }
constexpr wchar_t operator"" _id(wchar_t c) { return c; }
constexpr char16_t operator"" _id(char16_t c) { return c; }
constexpr char32_t operator"" _id(char32_t c) { return c; }
using size_t = decltype(sizeof(int));
constexpr const char operator"" _id(const char *p, size_t n) { return *p; }
constexpr const wchar_t operator"" _id(const wchar_t *p, size_t n) { return *p; }
constexpr const char16_t operator"" _id(const char16_t *p, size_t n) { return *p; }
constexpr const char32_t operator"" _id(const char32_t *p, size_t n) { return *p; }
constexpr unsigned long long operator"" _id(unsigned long long n) { return n; }
constexpr long double operator"" _id(long double d) { return d; }
template<int n> struct S {};
S<"a"_id> sa;
S<L"b"_id> sb;
S<u8"c"_id> sc;
S<u"d"_id> sd;
S<U"e"_id> se;
S<'w'_id> sw;
S<L'x'_id> sx;
S<u'y'_id> sy;
S<U'z'_id> sz;
S<100_id> sn;
S<(int)1.3_id> sf;
void h() {
(void)"test"_id "test" L"test";
}
// Test source location for suffix is known
const char *p =
"foo\nbar" R"x(
erk
flux
)x" "eep\x1f"\
_no_such_suffix // expected-error {{'operator "" _no_such_suffix'}}
"and a bit more"
"and another suffix"_no_such_suffix;
char c =
'\x14'\
_no_such_suffix; // expected-error {{'operator "" _no_such_suffix'}}
int &r =
1234567\
_no_such_suffix; // expected-error {{'operator "" _no_such_suffix'}}
int k =
1234567.89\
_no_such_suffix; // expected-error {{'operator "" _no_such_suffix'}}
// Make sure we handle more interesting ways of writing a string literal which
// is "" in translation phase 7.
void operator "\
" _foo(unsigned long long); // ok
void operator R"xyzzy()xyzzy" _foo(long double); // ok
void operator"" "" R"()" "" _foo(const char *); // ok
void operator ""_no_space(const char *); // ok
// Ensure we diagnose the bad cases.
void operator "\0" _non_empty(const char *); // expected-error {{must be '""'}}
void operator L"" _not_char(const char *); // expected-error {{cannot have an encoding prefix}}
void operator "" ""
U"" // expected-error {{cannot have an encoding prefix}}
"" _also_not_char(const char *);
void operator "" u8"" "\u0123" "hello"_all_of_the_things ""(const char*); // expected-error {{must be '""'}}
// Make sure we treat UCNs and UTF-8 as equivalent.
int operator""_µs(unsigned long long) {} // expected-note {{previous}}
int hundred_µs = 50_µs + 50_\u00b5s;
int operator""_\u00b5s(unsigned long long) {} // expected-error {{redefinition of 'operator "" _µs'}}
int operator""_\U0000212B(long double) {} // expected-note {{previous}}
int hundred_Å = 50.0_Å + 50._\U0000212B;
int operator""_Å(long double) {} // expected-error {{redefinition of 'operator "" _Å'}}
int operator""_𐀀(char) {} // expected-note {{previous}}
int 𐀀 = '4'_𐀀 + '2'_\U00010000;
int operator""_\U00010000(char) {} // expected-error {{redefinition of 'operator "" _𐀀'}}
// These all declare the same function.
int operator""_℮""_\u212e""_\U0000212e""(const char*, size_t);
int operator""_\u212e""_\U0000212e""_℮""(const char*, size_t);
int operator""_\U0000212e""_℮""_\u212e""(const char*, size_t);
int mix_ucn_utf8 = ""_℮""_\u212e""_\U0000212e"";
void operator""_℮""_ℯ(unsigned long long) {} // expected-error {{differing user-defined suffixes ('_℮' and '_ℯ') in string literal concatenation}}
void operator""_℮""_\u212f(unsigned long long) {} // expected-error {{differing user-defined suffixes ('_℮' and '_ℯ') in string literal concatenation}}
void operator""_\u212e""_ℯ(unsigned long long) {} // expected-error {{differing user-defined suffixes ('_℮' and '_ℯ') in string literal concatenation}}
void operator""_\u212e""_\u212f(unsigned long long) {} // expected-error {{differing user-defined suffixes ('_℮' and '_ℯ') in string literal concatenation}}
void operator""_℮""_℮(unsigned long long) {} // expected-note {{previous}}
void operator""_\u212e""_\u212e(unsigned long long) {} // expected-error {{redefinition}}
#define ¢ *0.01 // expected-error {{macro name must be an identifier}}
constexpr int operator""_¢(long double d) { return d * 100; } // expected-error {{non-ASCII}}
constexpr int operator""_¢(unsigned long long n) { return n; } // expected-error {{non-ASCII}}
static_assert(0.02_¢ == 2_¢, ""); // expected-error 2{{non-ASCII}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/argument_redef.c
|
/* RUN: %clang_cc1 -fsyntax-only -verify %s
*/
void foo(int A) { /* expected-note {{previous definition is here}} */
int A; /* expected-error {{redefinition of 'A'}} */
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx-reference.cpp
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
extern char *bork;
char *& bar = bork;
int val;
void foo(int &a) {
}
typedef int & A;
void g(const A aref) { // expected-warning {{'const' qualifier on reference type 'A' (aka 'int &') has no effect}}
}
int & const X = val; // expected-error {{'const' qualifier may not be applied to a reference}}
int & volatile Y = val; // expected-error {{'volatile' qualifier may not be applied to a reference}}
int & const volatile Z = val; /* expected-error {{'const' qualifier may not be applied}} \
expected-error {{'volatile' qualifier may not be applied}} */
typedef int && RV; // expected-warning {{rvalue references are a C++11 extension}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/access-spec-attrs.cpp
|
// RUN: %clang_cc1 %s -fsyntax-only -verify
struct X {
public __attribute__((unavailable)): // expected-error {{access specifier can only have annotation attributes}}
void foo();
private __attribute__((annotate("foobar"))):
void bar();
private __attribute__((annotate())): // expected-error {{'annotate' attribute takes one argument}}
};
void f(X x) {
x.foo();
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/cxx11-brace-initializers.cpp
|
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
// expected-no-diagnostics
struct S {
S(int, int) {}
};
void f(int, S const&, int) {}
void test1()
{
S X1{1, 1,};
S X2 = {1, 1,};
f(0, {1, 1}, 0);
}
namespace PR14948 {
template<typename T> struct Q { static T x; };
struct X {};
template<> X Q<X>::x {};
template<> int Q<int[]>::x[] { 1, 2, 3 };
template<> int Q<int>::x { 1 };
template<typename T> T Q<T>::x {};
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/crash-report.c
|
// RUN: not --crash %clang_cc1 %s 2>&1 | FileCheck %s
// REQUIRES: crash-recovery
// FIXME: CHECKs might be incompatible to win32.
// Stack traces also require back traces.
// REQUIRES: shell, backtrace
#prag\
ma clang __debug crash
// CHECK: prag\
// CHECK-NEXT: ma
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/c-namespace.c
|
// RUN: %clang_cc1 -fsyntax-only %s
void bla1() {
struct XXX;
int XXX;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/vsx.c
|
// RUN: %clang_cc1 -triple=powerpc64-unknown-linux-gnu -faltivec -target-feature +vsx -fsyntax-only -verify %s
// RUN: %clang_cc1 -triple=powerpc64le-unknown-linux-gnu -faltivec -target-feature +vsx -fsyntax-only -verify %s
// Legitimate for VSX.
__vector double vv_d1;
vector double v_d2;
// These should have errors.
__vector long double vv_ld3; // expected-error {{cannot use 'long double' with '__vector'}}
vector long double v_ld4; // expected-error {{cannot use 'long double' with '__vector'}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/extra-semi.cpp
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: cp %s %t.cpp
// RUN: not %clang_cc1 -fsyntax-only %t.cpp -fixit
// RUN: %clang_cc1 -fsyntax-only %t.cpp
void test1(int a;) { // expected-error{{unexpected ';' before ')'}}
while (a > 5;) {} // expected-error{{unexpected ';' before ')'}}
if (int b = 10;) {} // expected-error{{unexpected ';' before ')'}}
for (int c = 0; c < 21; ++c;) {} // expected-error{{unexpected ';' before ')'}}
int d = int(3 + 4;); // expected-error{{unexpected ';' before ')'}}
int e[5;]; // expected-error{{unexpected ';' before ']'}}
e[a+1;] = 4; // expected-error{{unexpected ';' before ']'}}
int f[] = {1,2,3;}; // expected-error{{unexpected ';' before '}'}}
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Parser/extension.c
|
/* RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify -std=c89
*/
/* Top level extension marker. */
__extension__ typedef struct
{
long long int quot;
long long int rem;
} lldiv_t;
/* Decl/expr __extension__ marker. */
void bar() {
__extension__ int i;
int j;
__extension__ (j = 10LL);
__extension__ j = 10LL; /* expected-warning {{'long long' is an extension}} */
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/taef/lit.site.cfg.in
|
import sys
## Autogenerated by LLVM/Clang configuration.
# Do not edit!
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.te = "@TAEF_EXECUTABLE@"
config.taef_arch = "@TAEF_ARCH@"
config.verbose = True
# Support substitution of the tools_dir, libs_dirs, and build_mode with user
# parameters. This is used when we can't determine the tool dir at
# configuration time.
try:
config.llvm_build_mode = config.llvm_build_mode % lit_config.params
except KeyError:
e = sys.exc_info()[1]
key, = e.args
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
# Let the main config do the real work.
lit_config.load_config(config, "@CLANG_SOURCE_DIR@/test/taef/lit.cfg")
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/HLSLDisabled/Readme.md
|
This folder contains tests which are disabled due to known crashes that we don't want to run as part of every test run.
The individual tests in this folder must have an associated Github issue id for tracking. Once an issue is fixed,
the correspnding test should be moved to an appropriate location inside HLSLFileCheck folder.
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/cxx-linkage.cpp
|
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -emit-llvm -main-file-name cxx-linkage.cpp %s -o - -fprofile-instr-generate | FileCheck %s
// CHECK: @__llvm_profile_name__Z3foov = private constant [7 x i8] c"_Z3foov"
// CHECK: @__llvm_profile_name__Z8foo_weakv = weak hidden constant [12 x i8] c"_Z8foo_weakv"
// CHECK: @__llvm_profile_name_main = private constant [4 x i8] c"main"
// CHECK: @__llvm_profile_name__Z10foo_inlinev = linkonce_odr hidden constant [15 x i8] c"_Z10foo_inlinev"
void foo(void) { }
void foo_weak(void) __attribute__((weak));
void foo_weak(void) { if (0){} if (0){} if (0){} if (0){} }
inline void foo_inline(void);
int main(void) {
foo();
foo_inline();
foo_weak();
return 0;
}
inline void foo_inline(void) { if (0){} if (0){} if (0){} if (0){} if (0){} if (0){}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/profile-does-not-exist.c
|
// RUN: not %clang_cc1 -emit-llvm %s -o - -fprofile-instr-use=%t.nonexistent.profdata 2>&1 | FileCheck %s
// CHECK: error: Could not read profile {{.*}}.nonexistent.profdata:
// CHECK-NOT: Assertion failed
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/c-generate.c
|
// Check that the -fprofile-instr-generate= form works.
// RUN: %clang_cc1 -main-file-name c-generate.c %s -o - -emit-llvm -fprofile-instr-generate=c-generate-test.profraw | FileCheck %s
// CHECK: private constant [24 x i8] c"c-generate-test.profraw\00"
// CHECK: call void @__llvm_profile_override_default_filename(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @0, i32 0, i32 0))
// CHECK: declare void @__llvm_profile_override_default_filename(i8*)
int main(void) {
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/c-counter-overflows.c
|
// Test that big branch weights get scaled down to 32-bits, rather than just
// truncated.
// RUN: llvm-profdata merge %S/Inputs/c-counter-overflows.proftext -o %t.profdata
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-counter-overflows.c %s -o - -emit-llvm -fprofile-instr-use=%t.profdata | FileCheck %s
typedef unsigned long long uint64_t;
int main(int argc, const char *argv[]) {
// Need counts higher than 32-bits.
// CHECK: br {{.*}} !prof ![[FOR:[0-9]+]]
// max = 0xffffffff0
// scale = 0xffffffff0 / 0xffffffff + 1 = 17
// loop-body: 0xffffffff0 / 17 + 1 = 0xf0f0f0f0 + 1 = 4042322161 => -252645135
// loop-exit: 0x000000001 / 17 + 1 = 0x00000000 + 1 = 1 => 1
for (uint64_t I = 0; I < 0xffffffff0; ++I) {
// max = 0xffffffff * 15 = 0xefffffff1
// scale = 0xefffffff1 / 0xffffffff + 1 = 16
// CHECK: br {{.*}} !prof ![[IF:[0-9]+]]
if (I & 0xf) {
// 0xefffffff1 / 16 + 1 = 0xefffffff + 1 = 4026531840 => -268435456
} else {
// 0x0ffffffff / 16 + 1 = 0x0fffffff + 1 = 268435456 => 268435456
}
// max = 0xffffffff * 5 = 0x4fffffffb
// scale = 0x4fffffffb / 0xffffffff + 1 = 6
// CHECK: ], !prof ![[SWITCH:[0-9]+]]
switch ((I & 0xf) / 5) {
case 0:
// 0x4fffffffb / 6 = 0xd5555554 + 1 = 3579139413 => -715827883
break;
case 1:
// 0x4fffffffb / 6 = 0xd5555554 + 1 = 3579139413 => -715827883
break;
case 2:
// 0x4fffffffb / 6 = 0xd5555554 + 1 = 3579139413 => -715827883
break;
default:
// 0x0ffffffff / 6 = 0x2aaaaaaa + 1 = 715827883 => 715827883
break;
}
}
return 0;
}
// CHECK-DAG: ![[FOR]] = !{!"branch_weights", i32 -252645135, i32 1}
// CHECK-DAG: ![[IF]] = !{!"branch_weights", i32 -268435456, i32 268435456}
// CHECK-DAG: ![[SWITCH]] = !{!"branch_weights", i32 715827883, i32 -715827883, i32 -715827883, i32 -715827883}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/func-entry.c
|
// Test that function entry counts are set correctly.
// RUN: llvm-profdata merge %S/Inputs/func-entry.proftext -o %t.profdata
// RUN: %clang %s -o - -mllvm -disable-llvm-optzns -emit-llvm -S -fprofile-instr-use=%t.profdata | FileCheck %s
void foo(void);
// CHECK: @foo() #0 !prof [[FOO:![0-9]+]]
void foo() { return; }
// CHECK: @main() #1 !prof [[MAIN:![0-9]+]]
int main() {
int i;
for (i = 0; i < 10000; i++) foo();
return 0;
}
// CHECK: [[FOO]] = !{!"function_entry_count", i64 1000}
// CHECK: [[MAIN]] = !{!"function_entry_count", i64 1}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/c-linkage-available_externally.c
|
// Make sure instrementation data from available_externally functions doesn't
// get thrown out.
// RUN: %clang_cc1 -O2 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage-available_externally.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck %s
// CHECK: @__llvm_profile_name_foo = linkonce_odr hidden constant [3 x i8] c"foo", section "__DATA,__llvm_prf_names", align 1
// CHECK: @__llvm_profile_counters_foo = linkonce_odr hidden global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8
// CHECK: @__llvm_profile_data_foo = linkonce_odr hidden constant { i32, i32, i64, i8*, i64* } { i32 3, i32 1, i64 {{[0-9]+}}, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__llvm_profile_name_foo, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__llvm_profile_counters_foo, i32 0, i32 0) }, section "__DATA,__llvm_prf_data", align 8
inline int foo(void) { return 1; }
int main(void) {
return foo();
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/cxx-templates.cpp
|
// Tests for instrumentation of templated code. Each instantiation of a template
// should be instrumented separately.
// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-templates.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-generate > %tgen
// RUN: FileCheck --input-file=%tgen -check-prefix=T0GEN -check-prefix=ALL %s
// RUN: FileCheck --input-file=%tgen -check-prefix=T100GEN -check-prefix=ALL %s
// RUN: llvm-profdata merge %S/Inputs/cxx-templates.proftext -o %t.profdata
// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-templates.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-use=%t.profdata > %tuse
// RUN: FileCheck --input-file=%tuse -check-prefix=T0USE -check-prefix=ALL %s
// RUN: FileCheck --input-file=%tuse -check-prefix=T100USE -check-prefix=ALL %s
// T0GEN: @[[T0C:__llvm_profile_counters__Z4loopILj0EEvv]] = linkonce_odr hidden global [2 x i64] zeroinitializer
// T100GEN: @[[T100C:__llvm_profile_counters__Z4loopILj100EEvv]] = linkonce_odr hidden global [2 x i64] zeroinitializer
// T0GEN-LABEL: define linkonce_odr {{.*}}void @_Z4loopILj0EEvv()
// T0USE-LABEL: define linkonce_odr {{.*}}void @_Z4loopILj0EEvv()
// T100GEN-LABEL: define linkonce_odr {{.*}}void @_Z4loopILj100EEvv()
// T100USE-LABEL: define linkonce_odr {{.*}}void @_Z4loopILj100EEvv()
template <unsigned N> void loop() {
// ALL-NOT: ret
// T0GEN: store {{.*}} @[[T0C]], i64 0, i64 0
// T100GEN: store {{.*}} @[[T100C]], i64 0, i64 0
// ALL-NOT: ret
// T0GEN: store {{.*}} @[[T0C]], i64 0, i64 1
// T0USE: br {{.*}} !prof ![[T01:[0-9]+]]
// T100GEN: store {{.*}} @[[T100C]], i64 0, i64 1
// T100USE: br {{.*}} !prof ![[T1001:[0-9]+]]
for (unsigned I = 0; I < N; ++I) {}
// ALL: ret
}
// T0USE-DAG: ![[T01]] = !{!"branch_weights", i32 1, i32 2}
// T100USE-DAG: ![[T1001]] = !{!"branch_weights", i32 101, i32 2}
int main(int argc, const char *argv[]) {
loop<0>();
loop<100>();
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/cxx-lambda.cpp
|
// Tests for instrumentation of C++11 lambdas
// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-lambda.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-generate > %tgen
// RUN: FileCheck --input-file=%tgen -check-prefix=PGOGEN %s
// RUN: FileCheck --input-file=%tgen -check-prefix=LMBGEN %s
// RUN: llvm-profdata merge %S/Inputs/cxx-lambda.proftext -o %t.profdata
// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-lambda.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-use=%t.profdata > %tuse
// RUN: FileCheck --input-file=%tuse -check-prefix=PGOUSE %s
// RUN: FileCheck --input-file=%tuse -check-prefix=LMBUSE %s
// PGOGEN: @[[LWC:__llvm_profile_counters__Z7lambdasv]] = private global [4 x i64] zeroinitializer
// PGOGEN: @[[MAC:__llvm_profile_counters_main]] = private global [1 x i64] zeroinitializer
// LMBGEN: @[[LFC:"__llvm_profile_counters_cxx-lambda.cpp:_ZZ7lambdasvENK3\$_0clEi"]] = private global [3 x i64] zeroinitializer
// PGOGEN-LABEL: define {{.*}}void @_Z7lambdasv()
// PGOUSE-LABEL: define {{.*}}void @_Z7lambdasv()
// PGOGEN: store {{.*}} @[[LWC]], i64 0, i64 0
void lambdas() {
int i = 1;
// LMBGEN-LABEL: define internal{{( [0-9_a-z]*cc)?( zeroext)?}} i1 @"_ZZ7lambdasvENK3$_0clEi"(
// LMBUSE-LABEL: define internal{{( [0-9_a-z]*cc)?( zeroext)?}} i1 @"_ZZ7lambdasvENK3$_0clEi"(
// LMBGEN: store {{.*}} @[[LFC]], i64 0, i64 0
auto f = [&i](int k) {
// LMBGEN: store {{.*}} @[[LFC]], i64 0, i64 1
// LMBUSE: br {{.*}} !prof ![[LF1:[0-9]+]]
if (i > 0) {}
// LMBGEN: store {{.*}} @[[LFC]], i64 0, i64 2
// LMBUSE: br {{.*}} !prof ![[LF2:[0-9]+]]
return k && i;
};
// PGOGEN: store {{.*}} @[[LWC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[LW1:[0-9]+]]
if (i) {}
// PGOGEN: store {{.*}} @[[LWC]], i64 0, i64 2
// PGOUSE: br {{.*}} !prof ![[LW2:[0-9]+]]
for (i = 0; i < 10; ++i)
f(9 - i);
// PGOGEN: store {{.*}} @[[LWC]], i64 0, i64 3
// PGOUSE: br {{.*}} !prof ![[LW3:[0-9]+]]
if (i) {}
}
// PGOUSE-DAG: ![[LW1]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[LW2]] = !{!"branch_weights", i32 11, i32 2}
// PGOUSE-DAG: ![[LW3]] = !{!"branch_weights", i32 2, i32 1}
// LMBUSE-DAG: ![[LF1]] = !{!"branch_weights", i32 10, i32 2}
// LMBUSE-DAG: ![[LF2]] = !{!"branch_weights", i32 10, i32 2}
int main(int argc, const char *argv[]) {
lambdas();
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/cxx-virtual-destructor-calls.cpp
|
// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -main-file-name cxx-virtual-destructor-calls.cpp %s -o - -fprofile-instr-generate | FileCheck %s
struct Member {
~Member();
};
struct A {
virtual ~A();
};
struct B : A {
Member m;
virtual ~B();
};
// Complete dtor
// CHECK: @__llvm_profile_name__ZN1BD1Ev = private constant [9 x i8] c"_ZN1BD1Ev"
// Deleting dtor
// CHECK: @__llvm_profile_name__ZN1BD0Ev = private constant [9 x i8] c"_ZN1BD0Ev"
// Complete dtor counters and profile data
// CHECK: @__llvm_profile_counters__ZN1BD1Ev = private global [1 x i64] zeroinitializer
// CHECK: @__llvm_profile_data__ZN1BD1Ev =
// Deleting dtor counters and profile data
// CHECK: @__llvm_profile_counters__ZN1BD0Ev = private global [1 x i64] zeroinitializer
// CHECK: @__llvm_profile_data__ZN1BD0Ev =
B::~B() { }
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/c-general.c
|
// Test instrumentation of general constructs in C.
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-general.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck -check-prefix=PGOGEN %s
// RUN: llvm-profdata merge %S/Inputs/c-general.proftext -o %t.profdata
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-general.c %s -o - -emit-llvm -fprofile-instr-use=%t.profdata | FileCheck -check-prefix=PGOUSE %s
// Also check compatibility with older profiles.
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-general.c %s -o - -emit-llvm -fprofile-instr-use=%S/Inputs/c-general.profdata.v1 | FileCheck -check-prefix=PGOUSE %s
// PGOGEN: @[[SLC:__llvm_profile_counters_simple_loops]] = private global [4 x i64] zeroinitializer
// PGOGEN: @[[IFC:__llvm_profile_counters_conditionals]] = private global [11 x i64] zeroinitializer
// PGOGEN: @[[EEC:__llvm_profile_counters_early_exits]] = private global [9 x i64] zeroinitializer
// PGOGEN: @[[JMC:__llvm_profile_counters_jumps]] = private global [22 x i64] zeroinitializer
// PGOGEN: @[[SWC:__llvm_profile_counters_switches]] = private global [19 x i64] zeroinitializer
// PGOGEN: @[[BSC:__llvm_profile_counters_big_switch]] = private global [17 x i64] zeroinitializer
// PGOGEN: @[[BOC:__llvm_profile_counters_boolean_operators]] = private global [8 x i64] zeroinitializer
// PGOGEN: @[[BLC:__llvm_profile_counters_boolop_loops]] = private global [9 x i64] zeroinitializer
// PGOGEN: @[[COC:__llvm_profile_counters_conditional_operator]] = private global [3 x i64] zeroinitializer
// PGOGEN: @[[DFC:__llvm_profile_counters_do_fallthrough]] = private global [4 x i64] zeroinitializer
// PGOGEN: @[[MAC:__llvm_profile_counters_main]] = private global [1 x i64] zeroinitializer
// PGOGEN: @[[STC:"__llvm_profile_counters_c-general.c:static_func"]] = private global [2 x i64] zeroinitializer
// PGOGEN-LABEL: @simple_loops()
// PGOUSE-LABEL: @simple_loops()
// PGOGEN: store {{.*}} @[[SLC]], i64 0, i64 0
void simple_loops() {
int i;
// PGOGEN: store {{.*}} @[[SLC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[SL1:[0-9]+]]
for (i = 0; i < 100; ++i) {
}
// PGOGEN: store {{.*}} @[[SLC]], i64 0, i64 2
// PGOUSE: br {{.*}} !prof ![[SL2:[0-9]+]]
while (i > 0)
i--;
// PGOGEN: store {{.*}} @[[SLC]], i64 0, i64 3
// PGOUSE: br {{.*}} !prof ![[SL3:[0-9]+]]
do {} while (i++ < 75);
// PGOGEN-NOT: store {{.*}} @[[SLC]],
// PGOUSE-NOT: br {{.*}} !prof ![0-9]+
}
// PGOGEN-LABEL: @conditionals()
// PGOUSE-LABEL: @conditionals()
// PGOGEN: store {{.*}} @[[IFC]], i64 0, i64 0
void conditionals() {
// PGOGEN: store {{.*}} @[[IFC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[IF1:[0-9]+]]
for (int i = 0; i < 100; ++i) {
// PGOGEN: store {{.*}} @[[IFC]], i64 0, i64 2
// PGOUSE: br {{.*}} !prof ![[IF2:[0-9]+]]
if (i % 2) {
// PGOGEN: store {{.*}} @[[IFC]], i64 0, i64 3
// PGOUSE: br {{.*}} !prof ![[IF3:[0-9]+]]
if (i) {}
// PGOGEN: store {{.*}} @[[IFC]], i64 0, i64 4
// PGOUSE: br {{.*}} !prof ![[IF4:[0-9]+]]
} else if (i % 3) {
// PGOGEN: store {{.*}} @[[IFC]], i64 0, i64 5
// PGOUSE: br {{.*}} !prof ![[IF5:[0-9]+]]
if (i) {}
} else {
// PGOGEN: store {{.*}} @[[IFC]], i64 0, i64 6
// PGOUSE: br {{.*}} !prof ![[IF6:[0-9]+]]
if (i) {}
}
// PGOGEN: store {{.*}} @[[IFC]], i64 0, i64 8
// PGOGEN: store {{.*}} @[[IFC]], i64 0, i64 7
// PGOUSE: br {{.*}} !prof ![[IF7:[0-9]+]]
if (1 && i) {}
// PGOGEN: store {{.*}} @[[IFC]], i64 0, i64 10
// PGOGEN: store {{.*}} @[[IFC]], i64 0, i64 9
// PGOUSE: br {{.*}} !prof ![[IF8:[0-9]+]]
if (0 || i) {}
}
// PGOGEN-NOT: store {{.*}} @[[IFC]],
// PGOUSE-NOT: br {{.*}} !prof ![0-9]+
}
// PGOGEN-LABEL: @early_exits()
// PGOUSE-LABEL: @early_exits()
// PGOGEN: store {{.*}} @[[EEC]], i64 0, i64 0
void early_exits() {
int i = 0;
// PGOGEN: store {{.*}} @[[EEC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[EE1:[0-9]+]]
if (i) {}
// PGOGEN: store {{.*}} @[[EEC]], i64 0, i64 2
// PGOUSE: br {{.*}} !prof ![[EE2:[0-9]+]]
while (i < 100) {
i++;
// PGOGEN: store {{.*}} @[[EEC]], i64 0, i64 3
// PGOUSE: br {{.*}} !prof ![[EE3:[0-9]+]]
if (i > 50)
break;
// PGOGEN: store {{.*}} @[[EEC]], i64 0, i64 4
// PGOUSE: br {{.*}} !prof ![[EE4:[0-9]+]]
if (i % 2)
continue;
}
// PGOGEN: store {{.*}} @[[EEC]], i64 0, i64 5
// PGOUSE: br {{.*}} !prof ![[EE5:[0-9]+]]
if (i) {}
// PGOGEN: store {{.*}} @[[EEC]], i64 0, i64 6
do {
// PGOGEN: store {{.*}} @[[EEC]], i64 0, i64 7
// PGOUSE: br {{.*}} !prof ![[EE6:[0-9]+]]
if (i > 75)
return;
else
i++;
// PGOUSE: br {{.*}} !prof ![[EE7:[0-9]+]]
} while (i < 100);
// PGOGEN: store {{.*}} @[[EEC]], i64 0, i64 8
// Never reached -> no weights
if (i) {}
// PGOGEN-NOT: store {{.*}} @[[EEC]],
// PGOUSE-NOT: br {{.*}} !prof ![0-9]+
}
// PGOGEN-LABEL: @jumps()
// PGOUSE-LABEL: @jumps()
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 0
void jumps() {
int i;
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[JM1:[0-9]+]]
for (i = 0; i < 2; ++i) {
goto outofloop;
// Never reached -> no weights
if (i) {}
}
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 3
outofloop:
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 4
// PGOUSE: br {{.*}} !prof ![[JM2:[0-9]+]]
if (i) {}
goto loop1;
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 5
// PGOUSE: br {{.*}} !prof ![[JM3:[0-9]+]]
while (i) {
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 6
loop1:
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 7
// PGOUSE: br {{.*}} !prof ![[JM4:[0-9]+]]
if (i) {}
}
goto loop2;
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 8
first:
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 9
second:
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 10
third:
i++;
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 11
// PGOUSE: br {{.*}} !prof ![[JM5:[0-9]+]]
if (i < 3)
goto loop2;
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 12
// PGOUSE: br {{.*}} !prof ![[JM6:[0-9]+]]
while (i < 3) {
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 13
loop2:
// PGOUSE: switch {{.*}} [
// PGOUSE: ], !prof ![[JM7:[0-9]+]]
switch (i) {
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 15
case 0:
goto first;
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 16
case 1:
goto second;
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 17
case 2:
goto third;
}
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 14
}
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 18
// PGOUSE: br {{.*}} !prof ![[JM8:[0-9]+]]
for (i = 0; i < 10; ++i) {
goto withinloop;
// never reached -> no weights
if (i) {}
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 20
withinloop:
// PGOGEN: store {{.*}} @[[JMC]], i64 0, i64 21
// PGOUSE: br {{.*}} !prof ![[JM9:[0-9]+]]
if (i) {}
}
// PGOGEN-NOT: store {{.*}} @[[JMC]],
// PGOUSE-NOT: br {{.*}} !prof ![0-9]+
}
// PGOGEN-LABEL: @switches()
// PGOUSE-LABEL: @switches()
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 0
void switches() {
static int weights[] = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5};
// No cases -> no weights
switch (weights[0]) {
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 2
default:
break;
}
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 1
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 3
// PGOUSE: br {{.*}} !prof ![[SW1:[0-9]+]]
for (int i = 0, len = sizeof(weights) / sizeof(weights[0]); i < len; ++i) {
// PGOUSE: switch {{.*}} [
// PGOUSE: ], !prof ![[SW2:[0-9]+]]
switch (i[weights]) {
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 5
case 1:
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 6
// PGOUSE: br {{.*}} !prof ![[SW3:[0-9]+]]
if (i) {}
// fallthrough
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 7
case 2:
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 8
// PGOUSE: br {{.*}} !prof ![[SW4:[0-9]+]]
if (i) {}
break;
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 9
case 3:
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 10
// PGOUSE: br {{.*}} !prof ![[SW5:[0-9]+]]
if (i) {}
continue;
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 11
case 4:
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 12
// PGOUSE: br {{.*}} !prof ![[SW6:[0-9]+]]
if (i) {}
// PGOUSE: switch {{.*}} [
// PGOUSE: ], !prof ![[SW7:[0-9]+]]
switch (i) {
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 14
case 6 ... 9:
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 15
// PGOUSE: br {{.*}} !prof ![[SW8:[0-9]+]]
if (i) {}
continue;
}
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 13
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 16
default:
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 17
// PGOUSE: br {{.*}} !prof ![[SW9:[0-9]+]]
if (i == len - 1)
return;
}
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 4
}
// PGOGEN: store {{.*}} @[[SWC]], i64 0, i64 18
// Never reached -> no weights
if (weights[0]) {}
// PGOGEN-NOT: store {{.*}} @[[SWC]],
// PGOUSE-NOT: br {{.*}} !prof ![0-9]+
}
// PGOGEN-LABEL: @big_switch()
// PGOUSE-LABEL: @big_switch()
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 0
void big_switch() {
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[BS1:[0-9]+]]
for (int i = 0; i < 32; ++i) {
// PGOUSE: switch {{.*}} [
// PGOUSE: ], !prof ![[BS2:[0-9]+]]
switch (1 << i) {
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 3
case (1 << 0):
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 4
// PGOUSE: br {{.*}} !prof ![[BS3:[0-9]+]]
if (i) {}
// fallthrough
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 5
case (1 << 1):
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 6
// PGOUSE: br {{.*}} !prof ![[BS4:[0-9]+]]
if (i) {}
break;
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 7
case (1 << 2) ... (1 << 12):
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 8
// PGOUSE: br {{.*}} !prof ![[BS5:[0-9]+]]
if (i) {}
break;
// The branch for the large case range above appears after the case body
// PGOUSE: br {{.*}} !prof ![[BS6:[0-9]+]]
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 9
case (1 << 13):
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 10
// PGOUSE: br {{.*}} !prof ![[BS7:[0-9]+]]
if (i) {}
break;
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 11
case (1 << 14) ... (1 << 28):
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 12
// PGOUSE: br {{.*}} !prof ![[BS8:[0-9]+]]
if (i) {}
break;
// The branch for the large case range above appears after the case body
// PGOUSE: br {{.*}} !prof ![[BS9:[0-9]+]]
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 13
case (1 << 29) ... ((1 << 29) + 1):
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 14
// PGOUSE: br {{.*}} !prof ![[BS10:[0-9]+]]
if (i) {}
break;
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 15
default:
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 16
// PGOUSE: br {{.*}} !prof ![[BS11:[0-9]+]]
if (i) {}
break;
}
// PGOGEN: store {{.*}} @[[BSC]], i64 0, i64 2
}
// PGOGEN-NOT: store {{.*}} @[[BSC]],
// PGOUSE-NOT: br {{.*}} !prof ![0-9]+
// PGOUSE: ret void
}
// PGOGEN-LABEL: @boolean_operators()
// PGOUSE-LABEL: @boolean_operators()
// PGOGEN: store {{.*}} @[[BOC]], i64 0, i64 0
void boolean_operators() {
int v;
// PGOGEN: store {{.*}} @[[BOC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[BO1:[0-9]+]]
for (int i = 0; i < 100; ++i) {
// PGOGEN: store {{.*}} @[[BOC]], i64 0, i64 2
// PGOUSE: br {{.*}} !prof ![[BO2:[0-9]+]]
v = i % 3 || i;
// PGOGEN: store {{.*}} @[[BOC]], i64 0, i64 3
// PGOUSE: br {{.*}} !prof ![[BO3:[0-9]+]]
v = i % 3 && i;
// PGOGEN: store {{.*}} @[[BOC]], i64 0, i64 5
// PGOGEN: store {{.*}} @[[BOC]], i64 0, i64 4
// PGOUSE: br {{.*}} !prof ![[BO4:[0-9]+]]
// PGOUSE: br {{.*}} !prof ![[BO5:[0-9]+]]
v = i % 3 || i % 2 || i;
// PGOGEN: store {{.*}} @[[BOC]], i64 0, i64 7
// PGOGEN: store {{.*}} @[[BOC]], i64 0, i64 6
// PGOUSE: br {{.*}} !prof ![[BO6:[0-9]+]]
// PGOUSE: br {{.*}} !prof ![[BO7:[0-9]+]]
v = i % 2 && i % 3 && i;
}
// PGOGEN-NOT: store {{.*}} @[[BOC]],
// PGOUSE-NOT: br {{.*}} !prof ![0-9]+
}
// PGOGEN-LABEL: @boolop_loops()
// PGOUSE-LABEL: @boolop_loops()
// PGOGEN: store {{.*}} @[[BLC]], i64 0, i64 0
void boolop_loops() {
int i = 100;
// PGOGEN: store {{.*}} @[[BLC]], i64 0, i64 2
// PGOGEN: store {{.*}} @[[BLC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[BL1:[0-9]+]]
// PGOUSE: br {{.*}} !prof ![[BL2:[0-9]+]]
while (i && i > 50)
i--;
// PGOGEN: store {{.*}} @[[BLC]], i64 0, i64 4
// PGOGEN: store {{.*}} @[[BLC]], i64 0, i64 3
// PGOUSE: br {{.*}} !prof ![[BL3:[0-9]+]]
// PGOUSE: br {{.*}} !prof ![[BL4:[0-9]+]]
while ((i % 2) || (i > 0))
i--;
// PGOGEN: store {{.*}} @[[BLC]], i64 0, i64 6
// PGOGEN: store {{.*}} @[[BLC]], i64 0, i64 5
// PGOUSE: br {{.*}} !prof ![[BL5:[0-9]+]]
// PGOUSE: br {{.*}} !prof ![[BL6:[0-9]+]]
for (i = 100; i && i > 50; --i);
// PGOGEN: store {{.*}} @[[BLC]], i64 0, i64 8
// PGOGEN: store {{.*}} @[[BLC]], i64 0, i64 7
// PGOUSE: br {{.*}} !prof ![[BL7:[0-9]+]]
// PGOUSE: br {{.*}} !prof ![[BL8:[0-9]+]]
for (; (i % 2) || (i > 0); --i);
// PGOGEN-NOT: store {{.*}} @[[BLC]],
// PGOUSE-NOT: br {{.*}} !prof ![0-9]+
}
// PGOGEN-LABEL: @conditional_operator()
// PGOUSE-LABEL: @conditional_operator()
// PGOGEN: store {{.*}} @[[COC]], i64 0, i64 0
void conditional_operator() {
int i = 100;
// PGOGEN: store {{.*}} @[[COC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[CO1:[0-9]+]]
int j = i < 50 ? i : 1;
// PGOGEN: store {{.*}} @[[COC]], i64 0, i64 2
// PGOUSE: br {{.*}} !prof ![[CO2:[0-9]+]]
int k = i ?: 0;
// PGOGEN-NOT: store {{.*}} @[[COC]],
// PGOUSE-NOT: br {{.*}} !prof ![0-9]+
}
// PGOGEN-LABEL: @do_fallthrough()
// PGOUSE-LABEL: @do_fallthrough()
// PGOGEN: store {{.*}} @[[DFC]], i64 0, i64 0
void do_fallthrough() {
// PGOGEN: store {{.*}} @[[DFC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[DF1:[0-9]+]]
for (int i = 0; i < 10; ++i) {
int j = 0;
// PGOGEN: store {{.*}} @[[DFC]], i64 0, i64 2
do {
// The number of exits out of this do-loop via the break statement
// exceeds the counter value for the loop (which does not include the
// fallthrough count). Make sure that does not violate any assertions.
// PGOGEN: store {{.*}} @[[DFC]], i64 0, i64 3
// PGOUSE: br {{.*}} !prof ![[DF3:[0-9]+]]
if (i < 8) break;
j++;
// PGOUSE: br {{.*}} !prof ![[DF2:[0-9]+]]
} while (j < 2);
}
}
// PGOGEN-LABEL: @static_func()
// PGOUSE-LABEL: @static_func()
// PGOGEN: store {{.*}} @[[STC]], i64 0, i64 0
static void static_func() {
// PGOGEN: store {{.*}} @[[STC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[ST1:[0-9]+]]
for (int i = 0; i < 10; ++i) {
}
}
// PGOUSE-DAG: ![[SL1]] = !{!"branch_weights", i32 101, i32 2}
// PGOUSE-DAG: ![[SL2]] = !{!"branch_weights", i32 101, i32 2}
// PGOUSE-DAG: ![[SL3]] = !{!"branch_weights", i32 76, i32 2}
// PGOUSE-DAG: ![[EE1]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[EE2]] = !{!"branch_weights", i32 52, i32 1}
// PGOUSE-DAG: ![[EE3]] = !{!"branch_weights", i32 2, i32 51}
// PGOUSE-DAG: ![[EE4]] = !{!"branch_weights", i32 26, i32 26}
// PGOUSE-DAG: ![[EE5]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[EE6]] = !{!"branch_weights", i32 2, i32 26}
// PGOUSE-DAG: ![[EE7]] = !{!"branch_weights", i32 26, i32 1}
// PGOUSE-DAG: ![[IF1]] = !{!"branch_weights", i32 101, i32 2}
// PGOUSE-DAG: ![[IF2]] = !{!"branch_weights", i32 51, i32 51}
// PGOUSE-DAG: ![[IF3]] = !{!"branch_weights", i32 51, i32 1}
// PGOUSE-DAG: ![[IF4]] = !{!"branch_weights", i32 34, i32 18}
// PGOUSE-DAG: ![[IF5]] = !{!"branch_weights", i32 34, i32 1}
// PGOUSE-DAG: ![[IF6]] = !{!"branch_weights", i32 17, i32 2}
// PGOUSE-DAG: ![[IF7]] = !{!"branch_weights", i32 100, i32 2}
// PGOUSE-DAG: ![[IF8]] = !{!"branch_weights", i32 100, i32 2}
// PGOUSE-DAG: ![[JM1]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[JM2]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[JM3]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[JM4]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[JM5]] = !{!"branch_weights", i32 3, i32 2}
// PGOUSE-DAG: ![[JM6]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[JM7]] = !{!"branch_weights", i32 1, i32 2, i32 2, i32 2}
// PGOUSE-DAG: ![[JM8]] = !{!"branch_weights", i32 11, i32 2}
// PGOUSE-DAG: ![[JM9]] = !{!"branch_weights", i32 10, i32 2}
// PGOUSE-DAG: ![[SW1]] = !{!"branch_weights", i32 16, i32 1}
// PGOUSE-DAG: ![[SW2]] = !{!"branch_weights", i32 6, i32 2, i32 3, i32 4, i32 5}
// PGOUSE-DAG: ![[SW3]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[SW4]] = !{!"branch_weights", i32 3, i32 2}
// PGOUSE-DAG: ![[SW5]] = !{!"branch_weights", i32 4, i32 1}
// PGOUSE-DAG: ![[SW6]] = !{!"branch_weights", i32 5, i32 1}
// PGOUSE-DAG: ![[SW7]] = !{!"branch_weights", i32 1, i32 2, i32 2, i32 2, i32 2}
// PGOUSE-DAG: ![[SW8]] = !{!"branch_weights", i32 5, i32 1}
// PGOUSE-DAG: ![[SW9]] = !{!"branch_weights", i32 2, i32 5}
// PGOUSE-DAG: ![[BS1]] = !{!"branch_weights", i32 33, i32 2}
// PGOUSE-DAG: ![[BS2]] = !{!"branch_weights", i32 29, i32 2, i32 2, i32 2, i32 2, i32 1}
// PGOUSE-DAG: ![[BS3]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[BS4]] = !{!"branch_weights", i32 2, i32 2}
// PGOUSE-DAG: ![[BS5]] = !{!"branch_weights", i32 12, i32 1}
// PGOUSE-DAG: ![[BS6]] = !{!"branch_weights", i32 12, i32 3}
// PGOUSE-DAG: ![[BS7]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[BS8]] = !{!"branch_weights", i32 16, i32 1}
// PGOUSE-DAG: ![[BS9]] = !{!"branch_weights", i32 16, i32 14}
// PGOUSE-DAG: ![[BS10]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[BS11]] = !{!"branch_weights", i32 3, i32 1}
// PGOUSE-DAG: ![[BO1]] = !{!"branch_weights", i32 101, i32 2}
// PGOUSE-DAG: ![[BO2]] = !{!"branch_weights", i32 67, i32 35}
// PGOUSE-DAG: ![[BO3]] = !{!"branch_weights", i32 67, i32 35}
// PGOUSE-DAG: ![[BO4]] = !{!"branch_weights", i32 67, i32 35}
// PGOUSE-DAG: ![[BO5]] = !{!"branch_weights", i32 18, i32 18}
// PGOUSE-DAG: ![[BO6]] = !{!"branch_weights", i32 51, i32 51}
// PGOUSE-DAG: ![[BO7]] = !{!"branch_weights", i32 34, i32 18}
// PGOUSE-DAG: ![[BL1]] = !{!"branch_weights", i32 52, i32 1}
// PGOUSE-DAG: ![[BL2]] = !{!"branch_weights", i32 51, i32 2}
// PGOUSE-DAG: ![[BL3]] = !{!"branch_weights", i32 26, i32 27}
// PGOUSE-DAG: ![[BL4]] = !{!"branch_weights", i32 51, i32 2}
// PGOUSE-DAG: ![[BL5]] = !{!"branch_weights", i32 52, i32 1}
// PGOUSE-DAG: ![[BL6]] = !{!"branch_weights", i32 51, i32 2}
// PGOUSE-DAG: ![[BL7]] = !{!"branch_weights", i32 26, i32 27}
// PGOUSE-DAG: ![[BL8]] = !{!"branch_weights", i32 51, i32 2}
// PGOUSE-DAG: ![[CO1]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[CO2]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[DF1]] = !{!"branch_weights", i32 11, i32 2}
// PGOUSE-DAG: ![[DF2]] = !{!"branch_weights", i32 3, i32 3}
// PGOUSE-DAG: ![[DF3]] = !{!"branch_weights", i32 9, i32 5}
// PGOUSE-DAG: ![[ST1]] = !{!"branch_weights", i32 11, i32 2}
int main(int argc, const char *argv[]) {
simple_loops();
conditionals();
early_exits();
jumps();
switches();
big_switch();
boolean_operators();
boolop_loops();
conditional_operator();
do_fallthrough();
static_func();
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/c-attributes.c
|
// Test that instrumentation based profiling sets function attributes correctly.
// RUN: llvm-profdata merge %S/Inputs/c-attributes.proftext -o %t.profdata
// RUN: %clang %s -o - -mllvm -disable-llvm-optzns -emit-llvm -S -fprofile-instr-use=%t.profdata | FileCheck %s
extern int atoi(const char *);
// CHECK: hot_100_percent(i32{{.*}}%i) [[HOT:#[0-9]+]]
void hot_100_percent(int i) {
while (i > 0)
i--;
}
// CHECK: hot_40_percent(i32{{.*}}%i) [[HOT]]
void hot_40_percent(int i) {
while (i > 0)
i--;
}
// CHECK: normal_func(i32{{.*}}%i) [[NORMAL:#[0-9]+]]
void normal_func(int i) {
while (i > 0)
i--;
}
// CHECK: cold_func(i32{{.*}}%i) [[COLD:#[0-9]+]]
void cold_func(int i) {
while (i > 0)
i--;
}
// CHECK: attributes [[HOT]] = { inlinehint nounwind {{.*}} }
// CHECK: attributes [[NORMAL]] = { nounwind {{.*}} }
// CHECK: attributes [[COLD]] = { cold nounwind {{.*}} }
int main(int argc, const char *argv[]) {
int max = atoi(argv[1]);
int i;
for (i = 0; i < max; i++)
hot_100_percent(i);
for (i = 0; i < max * 4 / 10; i++)
hot_40_percent(i);
for (i = 0; i < max * 2 / 10; i++)
normal_func(i);
for (i = 0; i < max / 200; i++)
cold_func(i);
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/c-unreachable-after-switch.c
|
// RUN: %clang_cc1 -O3 -triple x86_64-apple-macosx10.10 -main-file-name c-unreachable-after-switch.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck %s
// CHECK: @[[C:__llvm_profile_counters_foo]] = private global [3 x i64] zeroinitializer
// CHECK-LABEL: @foo()
// CHECK: store {{.*}} @[[C]], i64 0, i64 0
void foo() {
// CHECK: store {{.*}} @[[C]], i64 0, i64 2
switch (0) {
default:
return;
}
// We shouldn't emit the unreachable counter. This used to crash in GlobalDCE.
// CHECK-NOT: store {{.*}} @[[SWC]], i64 0, i64 1}
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/c-unprofiled.c
|
// Test that unprofiled files are recognized. Here, we have two functions in the
// profile, main() and function_in_header, but we use the profile on a file that
// has the profile-less some_unprofiled_function so that the only profiled code
// in #included in a header.
// FIXME: It would be nice to use -verify here instead of FileCheck, but -verify
// doesn't play well with warnings that have no line number.
// RUN: llvm-profdata merge %S/Inputs/c-unprofiled.proftext -o %t.profdata
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-unprofiled.c -I %S/Inputs/ %s -o /dev/null -emit-llvm -fprofile-instr-use=%t.profdata -Wprofile-instr-unprofiled 2>&1 | FileCheck %s
// CHECK: warning: no profile data available for file "c-unprofiled.c"
#include "profiled_header.h"
#ifdef GENERATE_OUTDATED_DATA
int main(int argc, const char *argv[]) {
function_in_header(0);
return 0;
}
#else
void some_unprofiled_function(int i) {
if (i)
function_in_header(i);
}
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/c-unprofiled-blocks.c
|
// Blocks that we have no profile data for (ie, it was never reached in training
// runs) shouldn't have any branch weight metadata added.
// RUN: llvm-profdata merge %S/Inputs/c-unprofiled-blocks.proftext -o %t.profdata
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-unprofiled-blocks.c %s -o - -emit-llvm -fprofile-instr-use=%t.profdata | FileCheck -check-prefix=PGOUSE %s
// PGOUSE-LABEL: @never_called(i32 %i)
int never_called(int i) {
// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
if (i) {}
// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
for (i = 0; i < 100; ++i) {
}
// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
while (--i) {}
// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
do {} while (i++ < 75);
// PGOUSE: switch {{.*}} [
// PGOUSE-NEXT: i32 12
// PGOUSE-NEXT: i32 82
// PGOUSE-NEXT: ]{{$}}
switch (i) {
case 12: return 3;
case 82: return 0;
default: return 89;
}
}
// PGOUSE-LABEL: @dead_code(i32 %i)
int dead_code(int i) {
// PGOUSE: br {{.*}}, !prof !{{[0-9]+}}
if (i) {
// This branch is never reached.
// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
if (!i) {}
// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
for (i = 0; i < 100; ++i) {
}
// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
while (--i) {}
// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
do {} while (i++ < 75);
// PGOUSE: switch {{.*}} [
// PGOUSE-NEXT: i32 12
// PGOUSE-NEXT: i32 82
// PGOUSE-NEXT: ]{{$}}
switch (i) {
case 12: return 3;
case 82: return 0;
default: return 89;
}
}
return 2;
}
// PGOUSE-LABEL: @main(i32 %argc, i8** %argv)
int main(int argc, const char *argv[]) {
dead_code(0);
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/c-linkage.c
|
// Check that the profiling names we create have the linkage we expect
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck %s
// CHECK: @__llvm_profile_name_foo = private constant [3 x i8] c"foo"
// CHECK: @__llvm_profile_name_foo_weak = weak hidden constant [8 x i8] c"foo_weak"
// CHECK: @__llvm_profile_name_main = private constant [4 x i8] c"main"
// CHECK: @"__llvm_profile_name_c-linkage.c:foo_internal" = private constant [24 x i8] c"c-linkage.c:foo_internal"
void foo(void) { }
void foo_weak(void) __attribute__((weak));
void foo_weak(void) { if (0){} if (0){} if (0){} if (0){} }
static void foo_internal(void);
int main(void) {
foo();
foo_internal();
foo_weak();
return 0;
}
static void foo_internal(void) { if (0){} if (0){} }
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/cxx-class.cpp
|
// Tests for instrumentation of C++ methods, constructors, and destructors.
// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-generate -fno-exceptions -target %itanium_abi_triple > %tgen
// RUN: FileCheck --input-file=%tgen -check-prefix=CTRGEN %s
// RUN: FileCheck --input-file=%tgen -check-prefix=DTRGEN %s
// RUN: FileCheck --input-file=%tgen -check-prefix=MTHGEN %s
// RUN: FileCheck --input-file=%tgen -check-prefix=WRPGEN %s
// RUN: llvm-profdata merge %S/Inputs/cxx-class.proftext -o %t.profdata
// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%t.profdata -fno-exceptions -target %itanium_abi_triple > %tuse
// RUN: FileCheck --input-file=%tuse -check-prefix=CTRUSE %s
// RUN: FileCheck --input-file=%tuse -check-prefix=DTRUSE %s
// RUN: FileCheck --input-file=%tuse -check-prefix=MTHUSE %s
// RUN: FileCheck --input-file=%tuse -check-prefix=WRPUSE %s
class Simple {
int Member;
public:
// CTRGEN-LABEL: define {{.*}} @_ZN6SimpleC2Ei(
// CTRUSE-LABEL: define {{.*}} @_ZN6SimpleC2Ei(
// CTRGEN: store {{.*}} @[[SCC:__llvm_profile_counters__ZN6SimpleC2Ei]], i64 0, i64 0
explicit Simple(int Member) : Member(Member) {
// CTRGEN: store {{.*}} @[[SCC]], i64 0, i64 1
// CTRUSE: br {{.*}} !prof ![[SC1:[0-9]+]]
if (Member) {}
// CTRGEN-NOT: store {{.*}} @[[SCC]],
// CTRUSE-NOT: br {{.*}} !prof ![0-9]+
// CTRUSE: ret
}
// CTRUSE: ![[SC1]] = !{!"branch_weights", i32 100, i32 2}
// DTRGEN-LABEL: define {{.*}} @_ZN6SimpleD2Ev(
// DTRUSE-LABEL: define {{.*}} @_ZN6SimpleD2Ev(
// DTRGEN: store {{.*}} @[[SDC:__llvm_profile_counters__ZN6SimpleD2Ev]], i64 0, i64 0
~Simple() {
// DTRGEN: store {{.*}} @[[SDC]], i64 0, i64 1
// DTRUSE: br {{.*}} !prof ![[SD1:[0-9]+]]
if (Member) {}
// DTRGEN-NOT: store {{.*}} @[[SDC]],
// DTRUSE-NOT: br {{.*}} !prof ![0-9]+
// DTRUSE: ret
}
// DTRUSE: ![[SD1]] = !{!"branch_weights", i32 100, i32 2}
// MTHGEN-LABEL: define {{.*}} @_ZN6Simple6methodEv(
// MTHUSE-LABEL: define {{.*}} @_ZN6Simple6methodEv(
// MTHGEN: store {{.*}} @[[SMC:__llvm_profile_counters__ZN6Simple6methodEv]], i64 0, i64 0
void method() {
// MTHGEN: store {{.*}} @[[SMC]], i64 0, i64 1
// MTHUSE: br {{.*}} !prof ![[SM1:[0-9]+]]
if (Member) {}
// MTHGEN-NOT: store {{.*}} @[[SMC]],
// MTHUSE-NOT: br {{.*}} !prof ![0-9]+
// MTHUSE: ret
}
// MTHUSE: ![[SM1]] = !{!"branch_weights", i32 100, i32 2}
};
// WRPGEN-LABEL: define {{.*}} @_Z14simple_wrapperv(
// WRPUSE-LABEL: define {{.*}} @_Z14simple_wrapperv(
// WRPGEN: store {{.*}} @[[SWC:__llvm_profile_counters__Z14simple_wrapperv]], i64 0, i64 0
void simple_wrapper() {
// WRPGEN: store {{.*}} @[[SWC]], i64 0, i64 1
// WRPUSE: br {{.*}} !prof ![[SW1:[0-9]+]]
for (int I = 0; I < 100; ++I) {
Simple S(I);
S.method();
}
// WRPGEN-NOT: store {{.*}} @[[SWC]],
// WRPUSE-NOT: br {{.*}} !prof ![0-9]+
// WRPUSE: ret
}
// WRPUSE: ![[SW1]] = !{!"branch_weights", i32 101, i32 2}
int main(int argc, const char *argv[]) {
simple_wrapper();
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/gcc-flag-compatibility.c
|
// Tests for -fprofile-generate and -fprofile-use flag compatibility. These two
// flags behave similarly to their GCC counterparts:
//
// -fprofile-generate Generates the profile file ./default.profraw
// -fprofile-generate=<dir> Generates the profile file <dir>/default.profraw
// -fprofile-use Uses the profile file ./default.profdata
// -fprofile-use=<dir> Uses the profile file <dir>/default.profdata
// -fprofile-use=<dir>/file Uses the profile file <dir>/file
// Check that -fprofile-generate uses the runtime default profile file.
// RUN: %clang %s -c -S -o - -emit-llvm -fprofile-generate | FileCheck -check-prefix=PROFILE-GEN %s
// PROFILE-GEN: @__llvm_profile_runtime = external global i32
// PROFILE-GEN-NOT: call void @__llvm_profile_override_default_filename
// PROFILE-GEN-NOT: declare void @__llvm_profile_override_default_filename(i8*)
// Check that -fprofile-generate=/path/to generates /path/to/default.profraw
// RUN: %clang %s -c -S -o - -emit-llvm -fprofile-generate=/path/to | FileCheck -check-prefix=PROFILE-GEN-EQ %s
// PROFILE-GEN-EQ: private constant [25 x i8] c"/path/to{{/|\\5C}}default.profraw\00"
// PROFILE-GEN-EQ: call void @__llvm_profile_override_default_filename(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @0, i32 0, i32 0))
// PROFILE-GEN-EQ: declare void @__llvm_profile_override_default_filename(i8*)
// Check that -fprofile-use=some/path reads some/path/default.profdata
// RUN: rm -rf %t.dir
// RUN: mkdir -p %t.dir/some/path
// RUN: llvm-profdata merge %S/Inputs/gcc-flag-compatibility.proftext -o %t.dir/some/path/default.profdata
// RUN: %clang %s -o - -mllvm -disable-llvm-optzns -emit-llvm -S -fprofile-use=%t.dir/some/path | FileCheck -check-prefix=PROFILE-USE-2 %s
// PROFILE-USE-2: = !{!"branch_weights", i32 101, i32 2}
// Check that -fprofile-use=some/path/file.prof reads some/path/file.prof
// RUN: rm -rf %t.dir
// RUN: mkdir -p %t.dir/some/path
// RUN: llvm-profdata merge %S/Inputs/gcc-flag-compatibility.proftext -o %t.dir/some/path/file.prof
// RUN: %clang %s -o - -mllvm -disable-llvm-optzns -emit-llvm -S -fprofile-use=%t.dir/some/path/file.prof | FileCheck -check-prefix=PROFILE-USE-3 %s
// PROFILE-USE-3: = !{!"branch_weights", i32 101, i32 2}
int X = 0;
int main() {
int i;
for (i = 0; i < 100; i++)
X += i;
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/cxx-rangefor.cpp
|
// Tests for instrumentation of C++11 range-for
// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-rangefor.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-generate > %tgen
// RUN: FileCheck --input-file=%tgen -check-prefix=CHECK -check-prefix=PGOGEN %s
// RUN: llvm-profdata merge %S/Inputs/cxx-rangefor.proftext -o %t.profdata
// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-rangefor.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-use=%t.profdata > %tuse
// RUN: FileCheck --input-file=%tuse -check-prefix=CHECK -check-prefix=PGOUSE %s
// PGOGEN: @[[RFC:__llvm_profile_counters__Z9range_forv]] = private global [5 x i64] zeroinitializer
// CHECK-LABEL: define {{.*}}void @_Z9range_forv()
// PGOGEN: store {{.*}} @[[RFC]], i64 0, i64 0
void range_for() {
int arr[] = {1, 2, 3, 4, 5};
int sum = 0;
// PGOGEN: store {{.*}} @[[RFC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[RF1:[0-9]+]]
for (auto i : arr) {
// PGOGEN: store {{.*}} @[[RFC]], i64 0, i64 2
// PGOUSE: br {{.*}} !prof ![[RF2:[0-9]+]]
if (i == 3)
continue;
sum += i;
// PGOGEN: store {{.*}} @[[RFC]], i64 0, i64 3
// PGOUSE: br {{.*}} !prof ![[RF3:[0-9]+]]
if (sum >= 7)
break;
}
// PGOGEN: store {{.*}} @[[RFC]], i64 0, i64 4
// PGOUSE: br {{.*}} !prof ![[RF4:[0-9]+]]
if (sum) {}
}
// PGOUSE-DAG: ![[RF1]] = !{!"branch_weights", i32 5, i32 1}
// PGOUSE-DAG: ![[RF2]] = !{!"branch_weights", i32 2, i32 4}
// PGOUSE-DAG: ![[RF3]] = !{!"branch_weights", i32 2, i32 3}
// PGOUSE-DAG: ![[RF4]] = !{!"branch_weights", i32 2, i32 1}
int main(int argc, const char *argv[]) {
range_for();
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/c-captured.c
|
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-captured.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck -check-prefix=PGOGEN -check-prefix=PGOALL %s
// RUN: llvm-profdata merge %S/Inputs/c-captured.proftext -o %t.profdata
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-captured.c %s -o - -emit-llvm -fprofile-instr-use=%t.profdata | FileCheck -check-prefix=PGOUSE -check-prefix=PGOALL %s
// PGOGEN: @[[DCC:__llvm_profile_counters_debug_captured]] = private global [3 x i64] zeroinitializer
// PGOGEN: @[[CSC:"__llvm_profile_counters_c-captured.c:__captured_stmt"]] = private global [2 x i64] zeroinitializer
// PGOGEN: @[[C1C:"__llvm_profile_counters_c-captured.c:__captured_stmt.1"]] = private global [3 x i64] zeroinitializer
// PGOALL-LABEL: define void @debug_captured()
// PGOGEN: store {{.*}} @[[DCC]], i64 0, i64 0
void debug_captured() {
int x = 10;
// Check both debug_captured counters, so we can do this all in one pass
// PGOGEN: store {{.*}} @[[DCC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[DC1:[0-9]+]]
// PGOGEN: store {{.*}} @[[DCC]], i64 0, i64 2
// PGOUSE: br {{.*}} !prof ![[DC2:[0-9]+]]
// PGOALL: ret
// PGOALL-LABEL: define internal void @__captured_stmt(
// PGOGEN: store {{.*}} @[[CSC]], i64 0, i64 0
#pragma clang __debug captured
{
// PGOGEN: store {{.*}} @[[CSC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[CS1:[0-9]+]]
if (x) {}
// PGOALL: ret
}
if (x) {} // This is DC1. Checked above.
// PGOALL-LABEL: define internal void @__captured_stmt.1(
// PGOGEN: store {{.*}} @[[C1C]], i64 0, i64 0
#pragma clang __debug captured
{
// PGOGEN: store {{.*}} @[[C1C]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[C11:[0-9]+]]
for (int i = 0; i < x; ++i) {}
// PGOGEN: store {{.*}} @[[C1C]], i64 0, i64 2
// PGOUSE: br {{.*}} !prof ![[C12:[0-9]+]]
if (x) {}
// PGOALL: ret
}
if (x) {} // This is DC2. Checked above.
}
// PGOUSE-DAG: ![[DC1]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[DC2]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[CS1]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[C11]] = !{!"branch_weights", i32 11, i32 2}
// PGOUSE-DAG: ![[C12]] = !{!"branch_weights", i32 2, i32 1}
int main(int argc, const char *argv[]) {
debug_captured();
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/cxx-throws.cpp
|
// Test instrumentation of C++ exception handling constructs.
// FIXME: Don't seek bb labels, like "if.else"
// REQUIRES: asserts
// RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -fexceptions -target %itanium_abi_triple | FileCheck -check-prefix=PGOGEN %s
// RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -fexceptions -target %itanium_abi_triple | FileCheck -check-prefix=PGOGEN-EXC %s
// RUN: llvm-profdata merge %S/Inputs/cxx-throws.proftext -o %t.profdata
// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%t.profdata -fcxx-exceptions -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE %s
// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%t.profdata -fcxx-exceptions -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE-EXC %s
// PGOGEN: @[[THC:__llvm_profile_counters__Z6throwsv]] = private global [9 x i64] zeroinitializer
// PGOGEN-EXC: @[[THC:__llvm_profile_counters__Z6throwsv]] = private global [9 x i64] zeroinitializer
// PGOGEN: @[[UNC:__llvm_profile_counters__Z11unreachablei]] = private global [3 x i64] zeroinitializer
// PGOGEN-LABEL: @_Z6throwsv()
// PGOUSE-LABEL: @_Z6throwsv()
// PGOGEN: store {{.*}} @[[THC]], i64 0, i64 0
void throws() {
// PGOGEN: store {{.*}} @[[THC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[TH1:[0-9]+]]
for (int i = 0; i < 100; ++i) {
try {
// PGOGEN: store {{.*}} @[[THC]], i64 0, i64 3
// PGOUSE: br {{.*}} !prof ![[TH2:[0-9]+]]
if (i % 3) {
// PGOGEN: store {{.*}} @[[THC]], i64 0, i64 4
// PGOUSE: br {{.*}} !prof ![[TH3:[0-9]+]]
if (i < 50)
throw 1;
} else {
// The catch block may be emitted after the throw above, we can skip it
// by looking for an else block, but this will break if anyone puts an
// else in the catch
// PGOUSE: if.else{{.*}}:
// PGOGEN: if.else{{.*}}:
// PGOGEN: store {{.*}} @[[THC]], i64 0, i64 5
// PGOUSE: br {{.*}} !prof ![[TH4:[0-9]+]]
if (i >= 50)
throw 0;
}
} catch (int e) {
// PGOUSE-EXC: catch{{.*}}:
// PGOGEN-EXC: catch{{.*}}:
// PGOGEN-EXC: store {{.*}} @[[THC]], i64 0, i64 6
// PGOGEN-EXC: store {{.*}} @[[THC]], i64 0, i64 7
// PGOUSE-EXC: br {{.*}} !prof ![[TH5:[0-9]+]]
if (e) {}
}
// PGOGEN: store {{.*}} @[[THC]], i64 0, i64 2
// PGOGEN: store {{.*}} @[[THC]], i64 0, i64 8
// PGOUSE: br {{.*}} !prof ![[TH6:[0-9]+]]
if (i < 100) {}
}
// PGOUSE-NOT: br {{.*}} !prof ![0-9]+
// PGOUSE: ret void
}
// PGOGEN-LABEL: @_Z11unreachablei(i32
// PGOUSE-LABEL: @_Z11unreachablei(i32
// PGOGEN: store {{.*}} @[[UNC]], i64 0, i64 0
void unreachable(int i) {
// PGOGEN: store {{.*}} @[[UNC]], i64 0, i64 1
// PGOUSE: br {{.*}} !prof ![[UN1:[0-9]+]]
if (i)
throw i;
// PGOGEN: store {{.*}} @[[UNC]], i64 0, i64 2
// Since we never reach here, the weights should all be zero (and skipped)
// PGOUSE-NOT: br {{.*}} !prof !{{.*}}
if (i) {}
}
// PGOUSE-DAG: ![[TH1]] = !{!"branch_weights", i32 101, i32 2}
// PGOUSE-DAG: ![[TH2]] = !{!"branch_weights", i32 67, i32 35}
// PGOUSE-DAG: ![[TH3]] = !{!"branch_weights", i32 34, i32 34}
// PGOUSE-DAG: ![[TH4]] = !{!"branch_weights", i32 18, i32 18}
// PGOUSE-EXC: ![[TH5]] = !{!"branch_weights", i32 34, i32 18}
// PGOUSE-DAG: ![[TH6]] = !{!"branch_weights", i32 101, i32 1}
// PGOUSE-DAG: ![[UN1]] = !{!"branch_weights", i32 2, i32 1}
int main(int argc, const char *argv[]) {
throws();
try {
unreachable(1);
} catch (int) {}
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/c-outdated-data.c
|
// Test that outdated data is ignored.
// FIXME: It would be nice to use -verify here instead of FileCheck, but -verify
// doesn't play well with warnings that have no line number.
// RUN: llvm-profdata merge %S/Inputs/c-outdated-data.proftext -o %t.profdata
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-outdated-data.c %s -o /dev/null -emit-llvm -fprofile-instr-use=%t.profdata -Wprofile-instr-dropped 2>&1 | FileCheck %s
// CHECK: warning: profile data may be out of date: of 3 functions, 1 has no data and 1 has mismatched data that will be ignored
void no_usable_data() {
int i = 0;
if (i) {}
#ifdef GENERATE_OUTDATED_DATA
if (i) {}
#endif
}
#ifndef GENERATE_OUTDATED_DATA
void no_data() {
}
#endif
int main(int argc, const char *argv[]) {
no_usable_data();
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/cxx-implicit.cpp
|
// Ensure that implicit methods aren't instrumented.
// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-implicit.cpp -o - -emit-llvm -fprofile-instr-generate | FileCheck %s
// An implicit constructor is generated for Base. We should not emit counters
// for it.
// CHECK-NOT: @__llvm_profile_counters__ZN4BaseC2Ev =
struct Base {
virtual void foo();
};
struct Derived : public Base {
Derived();
};
Derived::Derived() {}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Profile
|
repos/DirectXShaderCompiler/tools/clang/test/Profile/Inputs/profiled_header.h
|
void function_in_header(int i) {
if (i) {}
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Coverage/c-language-features.inc
|
//-*- C -*-
/* This is a
multiline comment */
// Intended to exercise all syntactic parts of the C language.
int g0;
int g1, g2;
struct s0;
struct s0 {
int x;
};
int g3 = 10;
__asm("");
typedef int td0;
td0 g4;
enum e0 {
ec0
};
static void f0(int x) {
}
inline void f0_0(int x) {
;
}
extern void f0_1(int x) {
}
void f1(int, ...);
// Statements.
void f2() {
for (;;) {
break;
continue;
}
while (0) {
}
do {
} while (0);
void *label = &&theif;
goto *label;
goto theif;
theif:
if (0) {
;
} else if (0) {
} else {
}
switch(0) {
case 0:
case 1 ... 2:
break;
default:
break;
}
asm ("nop");
return;
}
// Expressions.
#include <stdarg.h>
typedef struct ipair {
int first, second;
} ipair;
void f4(int a0, int a1, int a2, va_list ap) {
int t0 = a0 ? a1 : a2;
float t1 = (float) a0;
ipair t2 = {1, 2};
ipair t2a = { .second = 2 };
int t3 = sizeof(ipair);
ipair t4;
t4 = (ipair) {1, 2};
extern int g(int);
int t5 = g(a0);
int t6 = t4.first;
int t7[10];
int t8 = t7[a0];
t8++;
const char *t9 = __FUNCTION__;
char t10 = 'x';
int t11 = __builtin_offsetof(ipair, first);
int t12 = __builtin_types_compatible_p(ipair, int);
int t12_0 = __builtin_classify_type(t0);
int t12_1 = __builtin_classify_type(t1);
int t12_2 = __builtin_classify_type(t2);
// FIXME: Add _Complex and aggregate cases.
int t13 = va_arg(ap, int);
va_list t13_0;
va_copy(t13_0, ap);
int t14 = __extension__(t13);
int t15 = +t13;
unsigned t16 = t14 ^ t15;
int t17 = t14 % t15;
int t17_0 = t16 % t16;
float t18;
int t19 = t18 ? 0 : 1;
char *t20; ++t20; --t20;
float t21; ++t21; --t21;
double t22; ++t22; --t22;
long double t23; ++t23; --t23;
int t24 = !t19;
int t25 = __real t24;
int t26 = __imag t24;
const char *t27 = t9;
t27 += (unsigned char) 0xFF;
t27 += (signed char) 0xFF;
struct { char f0[10]; } *t28;
int t29 = t28 - t28;
char *t30 = &t28->f0[1];
struct s1 { int f0; };
struct s1 t31_a, t31_b;
int t31_cond;
int t31 = (t31_cond ? t31_a : t31_b).f0;
_Complex float t32_a, t32_b;
int t32_cond;
int t32 = __real (t32_cond ? t32_a : t32_b);
struct { int x, y; } t33, *t34, t35[12], t36(int, float);
float t37, *t38, t39[9], t40(double);
}
// Extended vectors
typedef __attribute__((ext_vector_type(2))) float float2;
typedef __attribute__((ext_vector_type(4))) float float4;
void f5() {
float4 t0 = (float4) { 0, 1, 2, 3 };
float4 t1 = t0;
t0.lo.even = t1.hi.x;
// irgen doesn't support this yet.
#if 0
int t2_cond;
float2 t2 = (t2_cond ? t0 : t1).lo;
#endif
}
void f6() {
const char *s0 = __func__;
const char *s1 = __FUNCTION__;
const char *s2 = __PRETTY_FUNCTION__;
}
// Arg mismatch with passed type.
void f7(x)
float x;
{
}
void f8(x)
short x;
{
}
// Function which inputs an array
void f9(int x[]) { }
// Object literals.
void f10() {
struct f10_s0 {
char iv0[10];
} x;
x = (struct f10_s0) { .iv0 = "name" };
}
// Nested structures.
struct s11 {
struct s11_2 {
int f0;
} f0;
int f1;
};
// Unnamed structures.
struct s12 {
struct {
unsigned char aa;
unsigned char bb;
};
};
void f11() {
struct s12 var = { .aa = 33 };
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Coverage/html-print.c
|
// RUN: %clang_cc1 -emit-html -o %t %s
#include "c-language-features.inc"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Coverage/ast-printing.c
|
// RUN: %clang_cc1 -fsyntax-only %s
// RUN: %clang_cc1 -ast-print %s
// RUN: %clang_cc1 -ast-dump %s
// RUN: %clang_cc1 -print-decl-contexts %s
#include "c-language-features.inc"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Coverage/html-diagnostics.c
|
// RUN: rm -rf %t
// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t %s
// RUN: find %t -name "*.html" -exec cat "{}" ";" | FileCheck %s
// REQUIRES: staticanalyzer
// CHECK: <h3>Annotated Source Code</h3>
// Without tweaking expr, the expr would hit to the line below
// emitted to the output as comment.
// CHECK: {{[D]ereference of null pointer}}
void f0(int x) {
int *p = &x;
if (x > 10) {
if (x == 22)
p = 0;
}
*p = 10;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Coverage/ast-printing.cpp
|
// RUN: %clang_cc1 -fsyntax-only %s
// RUN: %clang_cc1 -ast-print %s
// RUN: %clang_cc1 -ast-dump %s
// RUN: %clang_cc1 -print-decl-contexts %s
// RUN: %clang_cc1 -fdump-record-layouts %s
#include "cxx-language-features.inc"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Coverage/targets.c
|
// RUN: %clang_cc1 -g -triple armv6-apple-darwin9 -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple armv6-unknown-unknown -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple i686-apple-darwin9 -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple i686-pc-linux-gnu -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple i686-unknown-dragonfly -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple i686-unknown-unknown -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple i686-unknown-win32 -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple powerpc-apple-darwin9 -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple powerpc-unknown-unknown -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple powerpc64-apple-darwin9 -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple powerpc64-unknown-unknown -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple sparc-unknown-solaris -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple sparc-unknown-unknown -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple x86_64-apple-darwin9 -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple x86_64-pc-linux-gnu -emit-llvm -o %t %s
// RUN: %clang_cc1 -g -triple x86_64-unknown-unknown -emit-llvm -o %t %s
// <rdar://problem/7181838> clang 1.0 fails to compile Python 2.6
// RUN: %clang -target x86_64-apple-darwin9 -### -S %s -mmacosx-version-min=10.4
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Coverage/verbose.c
|
// RUN: %clang_cc1 -fsyntax-only -v %s
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Coverage/cxx-language-features.inc
|
//-*- C++ -*-
// Intended to exercise all syntactic parts of the C++ language that
// aren't part of C.
namespace std {
namespace debug {
}
}
using namespace std::debug;
using namespace std;
namespace safestl = ::std::debug;
class Base1 {
};
class Base2 { };
class Derived1 : Base1, virtual public Base2 { };
/* Template classes, template functions */
enum E1 { EC1 };
template <E1 v> class C1 {};
template <E1 v> C1<v> f1() { return C1<v>(); }
void f2() { f1<EC1>(); }
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Coverage/codegen.c
|
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o %t %s
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm-bc -o %t %s
// RUN: %clang_cc1 -triple i386-unknown-unknown -g -emit-llvm-bc -o %t %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm-bc -o %t %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -g -emit-llvm-bc -o %t %s
#include "c-language-features.inc"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Coverage/objc-language-features.inc
|
//-*- ObjC -*-
@protocol P0;
@protocol P1
-(void) fm0;
@end
@class B;
@interface Root
@property(readonly) int p0;
@end
@interface A : Root <P1> {
int iv0;
B *iv1;
B<P1> *iv2;
}
@property(readonly) int p0;
@property(assign,nonatomic,readwrite) int p1;
@property(copy) id p2;
@property(retain) id p3;
@property(assign, getter=getme, setter=setme:) id p4;
@property(assign, readwrite) id p5;
@end
@implementation A
@dynamic p0;
@synthesize p1 = iv0;
// Property type can differ from ivar type.
@synthesize p5 = iv2;
+(void) fm0 {
[super fm0];
}
-(void) im0 {
const char *s0 = __func__;
const char *s1 = __FUNCTION__;
const char *s2 = __PRETTY_FUNCTION__;
[super im0];
int x = super.p0;
}
-(void) im1: (int) x, ... {
}
@end
@implementation C : A
@end
@interface A (Cat)
@end
@implementation A (Cat)
@end
@interface B
@end
int f0(id x) {
@synchronized(x) {
}
@try {
@throw x;
} @catch(A *e) {
@throw;
// @catch param doesn't require name.
} @catch(B *) {
} @finally {
;
}
for (id y in x) {
break;
}
}
#ifndef __OBJC2__
struct s0 {
@defs(A);
};
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/parse-all-comments.c
|
// Run lines are sensitive to line numbers and come below the code.
#ifndef HEADER
#define HEADER
// Not a Doxygen comment. notdoxy1 NOT_DOXYGEN
void notdoxy1(void);
/* Not a Doxygen comment. notdoxy2 NOT_DOXYGEN */
void notdoxy2(void);
/*/ Not a Doxygen comment. notdoxy3 NOT_DOXYGEN */
void notdoxy3(void);
/** Doxygen comment. isdoxy4 IS_DOXYGEN_SINGLE */
void isdoxy4(void);
/*! Doxygen comment. isdoxy5 IS_DOXYGEN_SINGLE */
void isdoxy5(void);
/// Doxygen comment. isdoxy6 IS_DOXYGEN_SINGLE
void isdoxy6(void);
/* BLOCK_ORDINARY_COMMENT */
// ORDINARY COMMENT
/// This is a BCPL comment. IS_DOXYGEN_START
/// It has only two lines.
/** But there are other blocks that are part of the comment, too. IS_DOXYGEN_END */
void multi_line_comment_plus_ordinary(int);
// MULTILINE COMMENT
//
// WITH EMPTY LINE
void multi_line_comment_empty_line(int);
#endif
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: %clang_cc1 -fparse-all-comments -x c++ -std=c++11 -emit-pch -o %t/out.pch %s
// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -std=c++11 -fparse-all-comments > %t/out.c-index-direct
// RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch
// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct
// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch
// Ensure that XML is not invalid
// WRONG-NOT: CommentXMLInvalid
// RUN: FileCheck %s < %t/out.c-index-direct
// RUN: FileCheck %s < %t/out.c-index-pch
// CHECK: parse-all-comments.c:7:6: FunctionDecl=notdoxy1:{{.*}} notdoxy1 NOT_DOXYGEN
// CHECK: parse-all-comments.c:10:6: FunctionDecl=notdoxy2:{{.*}} notdoxy2 NOT_DOXYGEN
// CHECK: parse-all-comments.c:13:6: FunctionDecl=notdoxy3:{{.*}} notdoxy3 NOT_DOXYGEN
// CHECK: parse-all-comments.c:16:6: FunctionDecl=isdoxy4:{{.*}} isdoxy4 IS_DOXYGEN_SINGLE
// CHECK: parse-all-comments.c:19:6: FunctionDecl=isdoxy5:{{.*}} isdoxy5 IS_DOXYGEN_SINGLE
// CHECK: parse-all-comments.c:22:6: FunctionDecl=isdoxy6:{{.*}} isdoxy6 IS_DOXYGEN_SINGLE
// CHECK: parse-all-comments.c:29:6: FunctionDecl=multi_line_comment_plus_ordinary:{{.*}} BLOCK_ORDINARY_COMMENT {{.*}} ORDINARY COMMENT {{.*}} IS_DOXYGEN_START {{.*}} IS_DOXYGEN_END
// CHECK: parse-all-comments.c:34:6: FunctionDecl=multi_line_comment_empty_line:{{.*}} MULTILINE COMMENT{{.*}}\n{{.*}}\n{{.*}} WITH EMPTY LINE
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/print-display-names.cpp
|
template<typename T, typename>
class ClassTmpl { };
typedef int Integer;
template class ClassTmpl<Integer, Integer>;
void f(ClassTmpl<float, Integer> p);
template<typename T>
void g(ClassTmpl<T, T>);
template<> void g<int>(ClassTmpl<int, int>);
// RUN: c-index-test -test-load-source all-display %s | FileCheck %s
// CHECK: print-display-names.cpp:2:7: ClassTemplate=ClassTmpl<T, typename>:2:7
// CHECK: print-display-names.cpp:6:16: ClassDecl=ClassTmpl<Integer, Integer>:6:16 (Definition)
// CHECK: print-display-names.cpp:8:6: FunctionDecl=f(ClassTmpl<float, Integer>):8:6
// CHECK: print-display-names.cpp:11:6: FunctionTemplate=g(ClassTmpl<T, T>):11:6
// CHECK: print-display-names.cpp:13:17: FunctionDecl=g<>(ClassTmpl<int, int>):13:17 [Specialization of g:11:6]
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/cursor-ref-names.cpp
|
template <typename T>
struct Base {
void func();
int operator[](T);
};
struct Sub: public Base<int> {
void func();
};
template <typename T>
inline T myMax(T a, T b)
{ return (a > b) ? a : b; }
int main()
{
Sub inst;
inst.func();
inst[1];
inst.operator[](1);
inst.Base<int>::operator[](1);
myMax<int>(1, 2);
return 0;
}
// RUN: c-index-test -test-load-source all %s | FileCheck %s
// CHECK: cursor-ref-names.cpp:17:5: DeclStmt= Extent=[17:5 - 17:14]
// CHECK: cursor-ref-names.cpp:17:9: VarDecl=inst:17:9 (Definition) Extent=[17:5 - 17:13]
// CHECK: cursor-ref-names.cpp:17:5: TypeRef=struct Sub:7:8 Extent=[17:5 - 17:8]
// CHECK: cursor-ref-names.cpp:17:9: CallExpr=Sub:7:8 Extent=[17:9 - 17:13]
// CHECK: cursor-ref-names.cpp:18:5: CallExpr=func:8:10 Extent=[18:5 - 18:16]
// CHECK: cursor-ref-names.cpp:18:10: MemberRefExpr=func:8:10 SingleRefName=[18:10 - 18:14] RefName=[18:10 - 18:14] Extent=[18:5 - 18:14]
// CHECK: cursor-ref-names.cpp:18:5: DeclRefExpr=inst:17:9 Extent=[18:5 - 18:9]
// CHECK: cursor-ref-names.cpp:19:5: CallExpr=operator[]:4:9 SingleRefName=[19:9 - 19:12] RefName=[19:9 - 19:10] RefName=[19:11 - 19:12] Extent=[19:5 - 19:12]
// CHECK: cursor-ref-names.cpp:19:5: DeclRefExpr=inst:17:9 Extent=[19:5 - 19:9]
// CHECK: cursor-ref-names.cpp:19:9: DeclRefExpr=operator[]:4:9 RefName=[19:9 - 19:10] RefName=[19:11 - 19:12] Extent=[19:9 - 19:12]
// CHECK: cursor-ref-names.cpp:20:5: CallExpr=operator[]:4:9 Extent=[20:5 - 20:23]
// CHECK: cursor-ref-names.cpp:20:10: MemberRefExpr=operator[]:4:9 SingleRefName=[20:10 - 20:20] RefName=[20:10 - 20:18] RefName=[20:18 - 20:19] RefName=[20:19 - 20:20] Extent=[20:5 - 20:20]
// CHECK: cursor-ref-names.cpp:20:5: DeclRefExpr=inst:17:9 Extent=[20:5 - 20:9]
// CHECK: cursor-ref-names.cpp:22:5: CallExpr=operator[]:4:9 Extent=[22:5 - 22:34]
// CHECK: cursor-ref-names.cpp:22:21: MemberRefExpr=operator[]:4:9 SingleRefName=[22:10 - 22:31] RefName=[22:10 - 22:21] RefName=[22:21 - 22:29] RefName=[22:29 - 22:30] RefName=[22:30 - 22:31] Extent=[22:5 - 22:31]
// CHECK: cursor-ref-names.cpp:22:5: DeclRefExpr=inst:17:9 Extent=[22:5 - 22:9]
// CHECK: cursor-ref-names.cpp:22:10: TemplateRef=Base:2:8 Extent=[22:10 - 22:14]
// CHECK: cursor-ref-names.cpp:23:5: CallExpr=myMax:12:10 Extent=[23:5 - 23:21]
// CHECK: cursor-ref-names.cpp:23:5: DeclRefExpr=myMax:12:10 RefName=[23:5 - 23:10] RefName=[23:10 - 23:15] Extent=[23:5 - 23:15]
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/get-cursor-includes.c
|
#include "get-cursor-includes-2.h"
#include "get-cursor-includes-2.h"
// RUN: c-index-test -write-pch %t.h.pch -I%S/Inputs -Xclang -detailed-preprocessing-record %S/Inputs/get-cursor-includes-2.h
// RUN: c-index-test -cursor-at=%S/Inputs/get-cursor-includes-2.h:1:5 -I%S/Inputs -include %t.h %s | FileCheck %s
// CHECK: inclusion directive=get-cursor-includes-1.h
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/remap-cursor-at.c
|
// RUN: c-index-test -cursor-at=%s:1:15 -cursor-at=%s:2:21 -remap-file="%s,%S/Inputs/remap-load-to.c" %s | FileCheck %s
// CHECK: ParmDecl=parm1:1:13 (Definition)
// CHECK: DeclRefExpr=parm2:1:26
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/complete-enums.cpp
|
// Note: the run lines follow their respective tests, since line/column
// matter in this test.
struct X { X(); ~X(); };
enum class Color {
Red = 17,
Green,
Blue
};
int Greeby();
void f(Color color) {
switch (color) {
case Color::Green: { X x; }
case Color::Red;
}
}
// RUN: c-index-test -code-completion-at=%s:12:8 -std=c++11 %s | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Blue} (7)
// CHECK-CC1: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Green} (7)
// CHECK-CC1: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Red} (7)
// RUN: c-index-test -code-completion-at=%s:13:8 -std=c++11 %s | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Blue} (7)
// CHECK-CC2-NOT: Green
// CHECK-CC2: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Red} (7)
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/error-on-deserialized.c
|
#include "targeted-top.h"
// This tests that we will correctly error out on the deserialized decl.
// RUN: c-index-test -write-pch %t.h.pch %S/targeted-top.h
// RUN: env CINDEXTEST_FAILONERROR=1 not c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \
// RUN: -Xclang -error-on-deserialized-decl=NestedVar1
// RUN: env CINDEXTEST_FAILONERROR=1 not c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \
// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 2>&1 \
// RUN: | FileCheck %s
// CHECK: error: NestedVar1 was deserialized
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/annotate-comments.cpp
|
// Run lines are sensitive to line numbers and come below the code.
#ifndef HEADER
#define HEADER
// Not a Doxygen comment. NOT_DOXYGEN
void notdoxy1(void);
/* Not a Doxygen comment. NOT_DOXYGEN */
void notdoxy2(void);
/*/ Not a Doxygen comment. NOT_DOXYGEN */
void notdoxy3(void);
/** Doxygen comment. isdoxy4 IS_DOXYGEN_SINGLE */
void isdoxy4(void);
/**
* Doxygen comment. isdoxy5 IS_DOXYGEN_SINGLE */
void isdoxy5(void);
/**
* Doxygen comment.
* isdoxy6 IS_DOXYGEN_SINGLE */
void isdoxy6(void);
/**
* Doxygen comment.
* isdoxy7 IS_DOXYGEN_SINGLE
*/
void isdoxy7(void);
/*! Doxygen comment. isdoxy8 IS_DOXYGEN_SINGLE */
void isdoxy8(void);
/// Doxygen comment. isdoxy9 IS_DOXYGEN_SINGLE
void isdoxy9(void);
// Not a Doxygen comment. NOT_DOXYGEN
/// Doxygen comment. isdoxy10 IS_DOXYGEN_SINGLE
void isdoxy10(void);
/// Doxygen comment. isdoxy11 IS_DOXYGEN_SINGLE
// Not a Doxygen comment. NOT_DOXYGEN
void isdoxy11(void);
/** Doxygen comment. isdoxy12 IS_DOXYGEN_SINGLE */
/* Not a Doxygen comment. NOT_DOXYGEN */
void isdoxy12(void);
/// Doxygen comment. isdoxy13 IS_DOXYGEN_START
/// Doxygen comment. IS_DOXYGEN_END
void isdoxy13(void);
/// Doxygen comment. isdoxy14 IS_DOXYGEN_START
/// Blah-blah-blah.
/// Doxygen comment. IS_DOXYGEN_END
void isdoxy14(void);
/// Doxygen comment. isdoxy15 IS_DOXYGEN_START
/** Blah-blah-blah */
/// Doxygen comment. IS_DOXYGEN_END
void isdoxy15(void);
/** Blah-blah-blah. isdoxy16 IS_DOXYGEN_START *//** Blah */
/// Doxygen comment. IS_DOXYGEN_END
void isdoxy16(void);
/// NOT_DOXYGEN
// NOT_DOXYGEN
/// isdoxy17 IS_DOXYGEN_START IS_DOXYGEN_END
void isdoxy17(void);
unsigned
// NOT_DOXYGEN
/// NOT_DOXYGEN
// NOT_DOXYGEN
/// isdoxy18 IS_DOXYGEN_START IS_DOXYGEN_END
// NOT_DOXYGEN
int isdoxy18(void);
//! It all starts here. isdoxy19 IS_DOXYGEN_START
/*! It's a little odd to continue line this,
*
* but we need more multi-line comments. */
/// This comment comes before my other comments
/** This is a block comment that is associated with the function f. It
* runs for three lines. IS_DOXYGEN_END
*/
void isdoxy19(int, int);
// NOT IN THE COMMENT NOT_DOXYGEN
/// This is a BCPL comment. isdoxy20 IS_DOXYGEN_START
/// It has only two lines.
/** But there are other blocks that are part of the comment, too. IS_DOXYGEN_END */
void isdoxy20(int);
void notdoxy21(int); ///< This is a member comment. isdoxy21 IS_DOXYGEN_NOT_ATTACHED
void notdoxy22(int); /*!< This is a member comment. isdoxy22 IS_DOXYGEN_NOT_ATTACHED */
void notdoxy23(int); /**< This is a member comment. isdoxy23 IS_DOXYGEN_NOT_ATTACHED */
void notdoxy24(int); // NOT_DOXYGEN
/// IS_DOXYGEN_SINGLE
struct isdoxy25 {
};
struct test26 {
/// IS_DOXYGEN_SINGLE
int isdoxy26;
};
struct test27 {
int isdoxy27; ///< IS_DOXYGEN_SINGLE
};
struct notdoxy28 {
}; ///< IS_DOXYGEN_NOT_ATTACHED
/// IS_DOXYGEN_SINGLE
enum isdoxy29 {
};
enum notdoxy30 {
}; ///< IS_DOXYGEN_NOT_ATTACHED
/// IS_DOXYGEN_SINGLE
namespace isdoxy31 {
};
namespace notdoxy32 {
}; ///< IS_DOXYGEN_NOT_ATTACHED
class test33 {
///< IS_DOXYGEN_NOT_ATTACHED
int isdoxy33; ///< isdoxy33 IS_DOXYGEN_SINGLE
int isdoxy34; ///< isdoxy34 IS_DOXYGEN_SINGLE
///< IS_DOXYGEN_NOT_ATTACHED
int isdoxy35, ///< isdoxy35 IS_DOXYGEN_SINGLE
isdoxy36; ///< isdoxy36 IS_DOXYGEN_SINGLE
///< IS_DOXYGEN_NOT_ATTACHED
int isdoxy37 ///< isdoxy37 IS_DOXYGEN_SINGLE
, isdoxy38 ///< isdoxy38 IS_DOXYGEN_SINGLE
, isdoxy39; ///< isdoxy39 IS_DOXYGEN_SINGLE
};
// Verified that Doxygen attaches these.
/// isdoxy40 IS_DOXYGEN_SINGLE
// NOT_DOXYGEN
void isdoxy40(int);
unsigned
/// isdoxy41 IS_DOXYGEN_SINGLE
// NOT_DOXYGEN
int isdoxy41(int);
class test42 {
int isdoxy42; /* NOT_DOXYGEN */ ///< isdoxy42 IS_DOXYGEN_SINGLE
};
/// IS_DOXYGEN_START
/// It is fine to have a command at the end of comment.
///\brief
///
/// Some malformed command.
/** \*/
/**
* \brief Aaa aaaaaaa aaaa.
* IS_DOXYGEN_END
*/
void isdoxy43(void);
/// IS_DOXYGEN_START Aaa bbb
/// ccc.
///
/// Ddd eee.
/// Fff.
///
/// Ggg. IS_DOXYGEN_END
void isdoxy44(void);
/// IS_DOXYGEN_START Aaa bbb
/// ccc.
///
/// \brief
/// Ddd eee.
/// Fff.
///
/// Ggg. IS_DOXYGEN_END
void isdoxy45(void);
/// IS_DOXYGEN_START Aaa bbb
/// ccc.
///
/// \short
/// Ddd eee.
/// Fff.
///
/// Ggg. IS_DOXYGEN_END
void isdoxy46(void);
/// IS_DOXYGEN_NOT_ATTACHED
#define FOO
void notdoxy47(void);
/// IS_DOXYGEN_START Aaa bbb
/// \param ccc
/// \returns ddd IS_DOXYGEN_END
void isdoxy48(int);
/// \brief IS_DOXYGEN_START Aaa
/// \returns bbb IS_DOXYGEN_END
void isdoxy49(void);
/// \param ccc IS_DOXYGEN_START
/// \returns ddd IS_DOXYGEN_END
void isdoxy50(int);
// One of the following lines has trailing whitespace. It is intended, don't
// fix it.
/**
* Aaa. IS_DOXYGEN_START
*
* Bbb. IS_DOXYGEN_END
*/
void isdoxy51(int);
// One of the following lines has trailing whitespace. It is intended, don't
// fix it.
/**
* Aaa. IS_DOXYGEN_START
* Bbb.
*
* Ccc. IS_DOXYGEN_END
*/
void isdoxy52(int);
/**
* \fn isdoxy53
*
* Aaa. IS_DOXYGEN_START IS_DOXYGEN_END
*/
void isdoxy53(int);
#define MYMAC(x,y)
/**
* Aaa. IS_DOXYGEN_START IS_DOXYGEN_END
*/
MYMAC(0,0)
void isdoxy54(int);
#endif
// RUN: rm -rf %t
// RUN: mkdir %t
// Check that we serialize comment source locations properly.
// RUN: %clang_cc1 -x c++ -std=c++11 -emit-pch -o %t/out.pch %s
// RUN: %clang_cc1 -x c++ -std=c++11 -include-pch %t/out.pch -fsyntax-only %s
// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -std=c++11 > %t/out.c-index-direct
// RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch
// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct
// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch
// Declarations without Doxygen comments should not pick up some Doxygen comments.
// WRONG-NOT: notdoxy{{.*}}Comment=
// WRONG-NOT: test{{.*}}Comment=
// Non-Doxygen comments should not be attached to anything.
// WRONG-NOT: NOT_DOXYGEN
// Some Doxygen comments are not attached to anything.
// WRONG-NOT: IS_DOXYGEN_NOT_ATTACHED
// Ensure we don't pick up extra comments.
// WRONG-NOT: IS_DOXYGEN_START{{.*}}IS_DOXYGEN_START{{.*}}BriefComment=
// WRONG-NOT: IS_DOXYGEN_END{{.*}}IS_DOXYGEN_END{{.*}}BriefComment=
//
// Ensure that XML is not invalid
// WRONG-NOT: CommentXMLInvalid
// RUN: FileCheck %s < %t/out.c-index-direct
// RUN: FileCheck %s < %t/out.c-index-pch
// These CHECK lines are not located near the code on purpose. This test
// checks that documentation comments are attached to declarations correctly.
// Adding a non-documentation comment with CHECK line between every two
// documentation comments will only test a single code path.
//
// CHECK: annotate-comments.cpp:16:6: FunctionDecl=isdoxy4:{{.*}} isdoxy4 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:20:6: FunctionDecl=isdoxy5:{{.*}} isdoxy5 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:25:6: FunctionDecl=isdoxy6:{{.*}} isdoxy6 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:31:6: FunctionDecl=isdoxy7:{{.*}} isdoxy7 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:34:6: FunctionDecl=isdoxy8:{{.*}} isdoxy8 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:37:6: FunctionDecl=isdoxy9:{{.*}} isdoxy9 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:41:6: FunctionDecl=isdoxy10:{{.*}} isdoxy10 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:53:6: FunctionDecl=isdoxy13:{{.*}} isdoxy13 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END
// CHECK: annotate-comments.cpp:58:6: FunctionDecl=isdoxy14:{{.*}} isdoxy14 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END
// CHECK: annotate-comments.cpp:63:6: FunctionDecl=isdoxy15:{{.*}} isdoxy15 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END
// CHECK: annotate-comments.cpp:67:6: FunctionDecl=isdoxy16:{{.*}} isdoxy16 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END
// CHECK: annotate-comments.cpp:72:6: FunctionDecl=isdoxy17:{{.*}} isdoxy17 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END
// CHECK: annotate-comments.cpp:80:5: FunctionDecl=isdoxy18:{{.*}} isdoxy18 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END
// CHECK: annotate-comments.cpp:90:6: FunctionDecl=isdoxy19:{{.*}} isdoxy19 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END
// CHECK: annotate-comments.cpp:96:6: FunctionDecl=isdoxy20:{{.*}} isdoxy20 IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END
// CHECK: annotate-comments.cpp:107:8: StructDecl=isdoxy25:{{.*}} IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:112:7: FieldDecl=isdoxy26:{{.*}} IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:116:7: FieldDecl=isdoxy27:{{.*}} IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:123:6: EnumDecl=isdoxy29:{{.*}} IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:130:11: Namespace=isdoxy31:{{.*}} IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:138:7: FieldDecl=isdoxy33:{{.*}} isdoxy33 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:139:7: FieldDecl=isdoxy34:{{.*}} isdoxy34 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:142:7: FieldDecl=isdoxy35:{{.*}} isdoxy35 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:143:7: FieldDecl=isdoxy36:{{.*}} isdoxy36 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:146:7: FieldDecl=isdoxy37:{{.*}} isdoxy37 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:147:7: FieldDecl=isdoxy38:{{.*}} isdoxy38 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:148:7: FieldDecl=isdoxy39:{{.*}} isdoxy39 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:155:6: FunctionDecl=isdoxy40:{{.*}} isdoxy40 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:160:5: FunctionDecl=isdoxy41:{{.*}} isdoxy41 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:163:7: FieldDecl=isdoxy42:{{.*}} isdoxy42 IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:176:6: FunctionDecl=isdoxy43:{{.*}} IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END
// CHECK: annotate-comments.cpp:185:6: FunctionDecl=isdoxy44:{{.*}} BriefComment=[IS_DOXYGEN_START Aaa bbb ccc.]
// CHECK: annotate-comments.cpp:195:6: FunctionDecl=isdoxy45:{{.*}} BriefComment=[Ddd eee. Fff.]
// CHECK: annotate-comments.cpp:205:6: FunctionDecl=isdoxy46:{{.*}} BriefComment=[Ddd eee. Fff.]
// CHECK: annotate-comments.cpp:214:6: FunctionDecl=isdoxy48:{{.*}} BriefComment=[IS_DOXYGEN_START Aaa bbb]
// CHECK: annotate-comments.cpp:218:6: FunctionDecl=isdoxy49:{{.*}} BriefComment=[IS_DOXYGEN_START Aaa]
// CHECK: annotate-comments.cpp:222:6: FunctionDecl=isdoxy50:{{.*}} BriefComment=[Returns ddd IS_DOXYGEN_END]
// CHECK: annotate-comments.cpp:231:6: FunctionDecl=isdoxy51:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START]
// CHECK: annotate-comments.cpp:241:6: FunctionDecl=isdoxy52:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START Bbb.]
// CHECK: annotate-comments.cpp:248:6: FunctionDecl=isdoxy53:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START IS_DOXYGEN_END]
// CHECK: annotate-comments.cpp:255:6: FunctionDecl=isdoxy54:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START IS_DOXYGEN_END]
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/complete-ctor-inits.cpp
|
// The run lines are below, because this test is line- and
// column-number sensitive.
template<typename T>
struct X {
X(T);
};
struct Virt { };
struct Y : virtual Virt { };
struct Z : public X<int>, public Y {
Z();
int a, b, c;
};
Z::Z() : ::X<int>(0), Virt(), b(), c() { }
struct PR23948 {
template<class size> PR23948()
:
{}
template<class size> void invalid()
:
{}
int a;
};
// RUN: c-index-test -code-completion-at=%s:18:10 %s | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: MemberRef:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (35)
// CHECK-CC1: MemberRef:{TypedText b}{LeftParen (}{Placeholder args}{RightParen )} (35)
// CHECK-CC1: MemberRef:{TypedText c}{LeftParen (}{Placeholder args}{RightParen )} (35)
// CHECK-CC1: NotImplemented:{TypedText Virt}{LeftParen (}{Placeholder args}{RightParen )} (35)
// CHECK-CC1: NotImplemented:{TypedText X<int>}{LeftParen (}{Placeholder args}{RightParen )} (7)
// CHECK-CC1: NotImplemented:{TypedText Y}{LeftParen (}{Placeholder args}{RightParen )} (35)
// RUN: c-index-test -code-completion-at=%s:18:23 %s | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: MemberRef:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (35)
// CHECK-CC2: MemberRef:{TypedText b}{LeftParen (}{Placeholder args}{RightParen )} (35)
// CHECK-CC2: MemberRef:{TypedText c}{LeftParen (}{Placeholder args}{RightParen )} (35)
// CHECK-CC2: NotImplemented:{TypedText Virt}{LeftParen (}{Placeholder args}{RightParen )} (35)
// CHECK-CC2: NotImplemented:{TypedText Y}{LeftParen (}{Placeholder args}{RightParen )} (7)
// RUN: c-index-test -code-completion-at=%s:18:36 %s | FileCheck -check-prefix=CHECK-CC3 %s
// CHECK-CC3: MemberRef:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (35)
// CHECK-CC3-NOT: MemberRef:{TypedText b}{LeftParen (}{Placeholder args}{RightParen )}
// CHECK-CC3: MemberRef:{TypedText c}{LeftParen (}{Placeholder args}{RightParen )} (7)
// CHECK-CC3-NOT: NotImplemented:{TypedText Virt}{LeftParen (}{Placeholder args}{RightParen )}
// CHECK-CC3: NotImplemented:{TypedText Y}{LeftParen (}{Placeholder args}{RightParen )} (35)
// RUN: c-index-test -code-completion-at=%s:22:10 -target i386-apple-darwin %s | FileCheck -check-prefix=CHECK-CC4 %s
// CHECK-CC4: MemberRef:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (7)
// RUN: c-index-test -code-completion-at=%s:26:10 %s
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/preamble-reparse-cmd-define.c.h
|
extern int x;
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/file-refs.c
|
enum {
VALUE = 3
};
extern int glob_x;
int f(int x) {
return x+glob_x+VALUE;
}
typedef struct {
int x;
int y;
} Vector;
int vector_get_x(Vector v) {
int x = v.x;
return x;
}
int f(int);
int f(int);
// RUN: c-index-test \
// RUN: -file-refs-at=%s:2:5 \
// CHECK: EnumConstantDecl=VALUE:2:3 (Definition)
// CHECK-NEXT: EnumConstantDecl=VALUE:2:3 (Definition) =[2:3 - 2:8]
// CHECK-NEXT: DeclRefExpr=VALUE:2:3 =[8:19 - 8:24]
// RUN: -file-refs-at=%s:8:15 \
// CHECK-NEXT: DeclRefExpr=glob_x:5:12
// CHECK-NEXT: VarDecl=glob_x:5:12 =[5:12 - 5:18]
// CHECK-NEXT: DeclRefExpr=glob_x:5:12 =[8:12 - 8:18]
// RUN: -file-refs-at=%s:8:10 \
// CHECK-NEXT: DeclRefExpr=x:7:11
// CHECK-NEXT: ParmDecl=x:7:11 (Definition) =[7:11 - 7:12]
// CHECK-NEXT: DeclRefExpr=x:7:11 =[8:10 - 8:11]
// RUN: -file-refs-at=%s:12:7 \
// CHECK-NEXT: FieldDecl=x:12:7 (Definition)
// CHECK-NEXT: FieldDecl=x:12:7 (Definition) =[12:7 - 12:8]
// CHECK-NEXT: MemberRefExpr=x:12:7 {{.*}} =[17:13 - 17:14]
// RUN: -file-refs-at=%s:16:21 \
// CHECK-NEXT: TypeRef=Vector:14:3
// CHECK-NEXT: TypedefDecl=Vector:14:3 (Definition) =[14:3 - 14:9]
// CHECK-NEXT: TypeRef=Vector:14:3 =[16:18 - 16:24]
// RUN: -file-refs-at=%s:21:5 \
// CHECK-NEXT: FunctionDecl=f:21:5
// CHECK-NEXT: FunctionDecl=f:7:5 (Definition) =[7:5 - 7:6]
// CHECK-NEXT: FunctionDecl=f:21:5 =[21:5 - 21:6]
// CHECK-NEXT: FunctionDecl=f:22:5 =[22:5 - 22:6]
// RUN: %s | FileCheck %s
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/preamble-reparse-import.m-3.h
|
#import "preamble-reparse-import.m-2.h"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/get-cursor-macro-args.h
|
@interface MyClass
+(void)meth;
@end
#define MACRO2(x) (x)
#define MACRO(x) MACRO2((x))
void test() {
MACRO([MyClass meth]);
}
#define INVOKE(METHOD, CLASS) [CLASS METHOD]
void test2() {
INVOKE(meth, MyClass);
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/comment-xml-schema.c
|
// REQUIRES: xmllint
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-other-01.xml
//
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-function-01.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-function-02.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-function-03.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-function-04.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-function-05.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-function-06.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-function-07.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-function-08.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-function-09.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-function-10.xml
//
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-availability-attr-01.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-availability-attr-02.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-deprecated-attr.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-unavailable-attr.xml
//
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-class-01.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-class-02.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-class-03.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-class-04.xml
//
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-variable-01.xml
//
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-namespace-01.xml
//
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-typedef-01.xml
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-typedef-02.xml
//
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-enum-01.xml
//
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-para-kind-01.xml
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-01.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-02.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-03.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-04.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-05.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-06.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-07.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-08.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-09.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-10.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-11.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-12.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-13.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
//
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-para-kind-01.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-para-kind-02.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// CHECK-INVALID: fails to validate
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/complete-documentation-templates.cpp
|
// Note: the run lines follow their respective tests, since line/column numbers
// matter in this test.
/// This is T1.
template<typename T>
void T1(T t) { }
/// This is T2.
template<typename T>
void T2(T t) { }
/// This is T2<int>.
template<>
void T2(int t) { }
void test_CC1() {
}
// Check that implicit instantiations of class templates and members pick up
// comments from class templates and specializations.
/// This is T3.
template<typename T>
class T3 {
public:
/// This is T4.
static void T4();
/// This is T5.
static int T5;
/// This is T6.
void T6();
/// This is T7.
int T7;
/// This is T8.
class T8 {};
/// This is T9.
enum T9 {
/// This is T10.
T10
};
/// This is T11.
template<typename U>
void T11(U t) {}
typedef T3<double> T12;
};
void test_CC2_CC3_CC4() {
T3<int>::T4();
T3<int> t3;
t3.T6();
T3<int>::T8 t8;
}
/// This is T100.
template<typename T, typename U>
class T100 {
};
/// This is T100<int, T>.
template<typename T>
class T100<int, T> {
public:
/// This is T101.
static void T101();
/// This is T102.
static int T102;
/// This is T103.
void T103();
/// This is T104.
int T104;
/// This is T105.
class T105 {};
/// This is T106.
enum T106 {
/// This is T107.
T107
};
/// This is T108.
template<typename U>
void T108(U t) {}
typedef T100<double, T> T109;
typedef T100<double, double> T110;
};
void test_CC5_CC6_CC7() {
T100<int, long>::T101();
T100<int, long> t100;
t100.T103();
T100<int, long>::T105 t105;
}
// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:17:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: FunctionTemplate:{ResultType void}{TypedText T1}{{.*}}(brief comment: This is T1.)
// CHECK-CC1: FunctionTemplate:{ResultType void}{TypedText T2}{{.*}}(brief comment: This is T2.)
// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:56:12 %s | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: CXXMethod:{ResultType void}{TypedText T4}{{.*}}(brief comment: This is T4.)
// CHECK-CC2: VarDecl:{ResultType int}{TypedText T5}{{.*}}(brief comment: This is T5.)
// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:58:6 %s | FileCheck -check-prefix=CHECK-CC3 %s
// CHECK-CC3: FunctionTemplate:{ResultType void}{TypedText T11}{{.*}}(brief comment: This is T11.)
// CHECK-CC3: CXXMethod:{ResultType void}{TypedText T6}{{.*}}(brief comment: This is T6.)
// CHECK-CC3: FieldDecl:{ResultType int}{TypedText T7}{{.*}}(brief comment: This is T7.)
// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:59:12 %s | FileCheck -check-prefix=CHECK-CC4 %s
// CHECK-CC4: EnumConstantDecl:{ResultType T3<int>::T9}{TypedText T10}{{.*}}(brief comment: This is T10.)
// FIXME: after we implement propagating comments through typedefs, this
// typedef for implicit instantiation should pick up the documentation
// comment from class template.
// CHECK-CC4: TypedefDecl:{TypedText T12}
// CHECK-CC4-SHOULD-BE: TypedefDecl:{TypedText T12}{{.*}}(brief comment: This is T3.)
// CHECK-CC4: ClassDecl:{TypedText T8}{{.*}}(brief comment: This is T8.)
// CHECK-CC4: EnumDecl:{TypedText T9}{{.*}}(brief comment: This is T9.)
// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:102:20 %s | FileCheck -check-prefix=CHECK-CC5 %s
// CHECK-CC5: CXXMethod:{ResultType void}{TypedText T101}{{.*}}(brief comment: This is T101.)
// CHECK-CC5: VarDecl:{ResultType int}{TypedText T102}{{.*}}(brief comment: This is T102.)
// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:104:8 %s | FileCheck -check-prefix=CHECK-CC6 %s
// CHECK-CC6: CXXMethod:{ResultType void}{TypedText T103}{{.*}}(brief comment: This is T103.)
// CHECK-CC6: FieldDecl:{ResultType int}{TypedText T104}{{.*}}(brief comment: This is T104.)
// CHECK-CC6: FunctionTemplate:{ResultType void}{TypedText T108}{{.*}}(brief comment: This is T108.)
// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:105:20 %s | FileCheck -check-prefix=CHECK-CC7 %s
// CHECK-CC7: ClassDecl:{TypedText T105}{{.*}}(brief comment: This is T105.)
// CHECK-CC7: EnumDecl:{TypedText T106}{{.*}}(brief comment: This is T106.)
// CHECK-CC7: EnumConstantDecl:{ResultType T100<int, long>::T106}{TypedText T107}{{.*}}(brief comment: This is T107.)
// FIXME: after we implement propagating comments through typedefs, these two
// typedefs for implicit instantiations should pick up the documentation
// comment from class template.
// CHECK-CC7: TypedefDecl:{TypedText T109}
// CHECK-CC7: TypedefDecl:{TypedText T110}
// CHECK-CC7-SHOULD-BE: TypedefDecl:{TypedText T109}{{.*}}(brief comment: This is T100.)
// CHECK-CC7-SHOULD-BE: TypedefDecl:{TypedText T110}{{.*}}(brief comment: This is T100.)
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/index-kernel-invocation.cpp
|
// RUN: c-index-test -index-file -arch i386 -mkernel %s | FileCheck %s
// CHECK: [indexDeclaration]: kind: function | name: foobar
void foobar(void);
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/annotate-comments-unterminated.c
|
// RUN: c-index-test -test-load-source all %s | FileCheck %s
// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-ERR %s
// CHECK: annotate-comments-unterminated.c:9:5: VarDecl=x:{{.*}} RawComment=[/** Aaa. */]{{.*}} BriefComment=[Aaa.]
// CHECK: annotate-comments-unterminated.c:11:5: VarDecl=y:{{.*}} RawComment=[/**< Bbb. */]{{.*}} BriefComment=[Bbb.]
// CHECK-ERR: error: unterminated
/** Aaa. */
int x;
int y; /**< Bbb. */
/**< Ccc.
* Ddd.
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/get-cursor.c
|
struct _MyS {
int foo;
} MyS;
struct _MyS ww;
int x, y;
typedef union {
struct {
int field : 16;
};
} r_t;
void test() {
r_t reg;
reg.field = 1;
}
// RUN: c-index-test -cursor-at=%s:1:9 \
// RUN: -cursor-at=%s:2:9 \
// RUN: -cursor-at=%s:5:9 \
// RUN: -cursor-at=%s:7:5 \
// RUN: -cursor-at=%s:7:8 \
// RUN: -cursor-at=%s:17:8 \
// RUN: %s | FileCheck %s
// CHECK: StructDecl=_MyS:1:8 (Definition)
// CHECK: FieldDecl=foo:2:7 (Definition)
// CHECK: TypeRef=struct _MyS:1:8
// CHECK: VarDecl=x:7:5
// CHECK: VarDecl=y:7:8
// CHECK: 17:7 MemberRefExpr=field:11:9
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/usrs.cpp
|
namespace foo {
int x;
void bar(int z);
}
namespace bar {
typedef int QType;
void bar(QType z);
}
class ClsA {
public:
int a, b;
ClsA(int A, int B) : a(A), b(B) {}
};
namespace foo {
class ClsB : public ClsA {
public:
ClsB() : ClsA(1, 2) {}
int result() const;
};
}
int foo::ClsB::result() const {
return a + b;
}
namespace {
class ClsC : public foo::ClsB {};
int w;
}
int z;
namespace foo { namespace taz {
int x;
static inline int add(int a, int b) { return a + b; }
void sub(int a, int b);
}
}
namespace foo { namespace taz {
class ClsD : public foo::ClsB {
public:
ClsD& operator=(int x) { a = x; return *this; }
ClsD& operator=(double x) { a = (int) x; return *this; }
ClsD& operator=(const ClsD &x) { a = x.a; return *this; }
static int qux();
static int uz(int z, ...);
bool operator==(const ClsD &x) const { return a == x.a; }
};
}}
extern "C" {
void rez(int a, int b);
}
namespace foo_alias = foo;
using namespace foo;
namespace foo_alias2 = foo;
using foo::ClsB;
namespace foo_alias3 = foo;
namespace {
class RDar9371763_Foo {
public:
void bar();
};
}
void RDar9371763_Foo::bar() {}
void rdar9371763() {
RDar9371763_Foo foo;
foo.bar();
}
template <class T> typename T::A someTemplFn() {}
template <class T> typename T::B someTemplFn() {}
template <class T> int someTemplFn() {}
void funWithChar(char c) {}
void funWithChar(unsigned char c) {}
void funWithChar(signed char c) {}
struct { int x; } embedS1;
struct { int x; } embedS2;
template <typename T>
class TC1 {
void meth(TC1);
};
// RUN: c-index-test -test-load-source-usrs all -fno-delayed-template-parsing %s | FileCheck %s
// CHECK: usrs.cpp c:@N@foo Extent=[1:1 - 4:2]
// CHECK: usrs.cpp c:@N@foo@x Extent=[2:3 - 2:8]
// CHECK: usrs.cpp c:@N@foo@F@bar#I# Extent=[3:3 - 3:18]
// CHECK: usrs.cpp c:usrs.cpp@36@N@foo@F@bar#I#@z Extent=[3:12 - 3:17]
// CHECK: usrs.cpp c:@N@bar Extent=[5:1 - 8:2]
// CHECK: usrs.cpp c:usrs.cpp@N@bar@T@QType Extent=[6:3 - 6:20]
// CHECK: usrs.cpp c:@N@bar@F@bar#I# Extent=[7:3 - 7:20]
// CHECK: usrs.cpp c:usrs.cpp@94@N@bar@F@bar#I#@z Extent=[7:12 - 7:19]
// CHECK: usrs.cpp c:@S@ClsA Extent=[10:1 - 14:2]
// CHECK: usrs.cpp c: Extent=[11:1 - 11:8]
// CHECK: usrs.cpp c:@S@ClsA@FI@a Extent=[12:3 - 12:8]
// CHECK: usrs.cpp c:@S@ClsA@FI@b Extent=[12:3 - 12:11]
// CHECK: usrs.cpp c:@S@ClsA@F@ClsA#I#I# Extent=[13:3 - 13:37]
// CHECK: usrs.cpp c:usrs.cpp@147@S@ClsA@F@ClsA#I#I#@A Extent=[13:8 - 13:13]
// CHECK: usrs.cpp c:usrs.cpp@154@S@ClsA@F@ClsA#I#I#@B Extent=[13:15 - 13:20]
// CHECK: usrs.cpp c:@N@foo Extent=[16:1 - 22:2]
// CHECK: usrs.cpp c:@N@foo@S@ClsB Extent=[17:3 - 21:4]
// CHECK: usrs.cpp c: Extent=[18:3 - 18:10]
// CHECK: usrs.cpp c:@N@foo@S@ClsB@F@ClsB# Extent=[19:5 - 19:27]
// CHECK: usrs.cpp c:@N@foo@S@ClsB@F@result#1 Extent=[20:5 - 20:23]
// CHECK: usrs.cpp c:@N@foo@S@ClsB@F@result#1 Extent=[24:1 - 26:2]
// CHECK: usrs.cpp c:usrs.cpp@aN@S@ClsC Extent=[29:3 - 29:35]
// CHECK: usrs.cpp c:usrs.cpp@aN@w Extent=[30:3 - 30:8]
// CHECK: usrs.cpp c:@z Extent=[33:1 - 33:6]
// CHECK: usrs.cpp c:@N@foo Extent=[35:1 - 40:2]
// CHECK: usrs.cpp c:@N@foo@N@taz Extent=[35:17 - 39:2]
// CHECK: usrs.cpp c:@N@foo@N@taz@x Extent=[36:3 - 36:8]
// CHECK: usrs.cpp c:usrs.cpp@N@foo@N@taz@F@add#I#I# Extent=[37:3 - 37:56]
// CHECK: usrs.cpp c:usrs.cpp@479@N@foo@N@taz@F@add#I#I#@a Extent=[37:25 - 37:30]
// CHECK: usrs.cpp c:usrs.cpp@486@N@foo@N@taz@F@add#I#I#@b Extent=[37:32 - 37:37]
// CHECK: usrs.cpp c:@N@foo@N@taz@F@sub#I#I# Extent=[38:3 - 38:25]
// CHECK: usrs.cpp c:usrs.cpp@522@N@foo@N@taz@F@sub#I#I#@a Extent=[38:12 - 38:17]
// CHECK: usrs.cpp c:usrs.cpp@529@N@foo@N@taz@F@sub#I#I#@b Extent=[38:19 - 38:24]
// CHECK: usrs.cpp c:@N@foo Extent=[42:1 - 52:3]
// CHECK: usrs.cpp c:@N@foo@N@taz Extent=[42:17 - 52:2]
// CHECK: usrs.cpp c:@N@foo@N@taz@S@ClsD Extent=[43:3 - 51:4]
// CHECK: usrs.cpp c: Extent=[44:3 - 44:10]
// CHECK: usrs.cpp c:@N@foo@N@taz@S@ClsD@F@operator=#I# Extent=[45:5 - 45:52]
// CHECK: usrs.cpp c:usrs.cpp@638@N@foo@N@taz@S@ClsD@F@operator=#I#@x Extent=[45:21 - 45:26]
// CHECK: usrs.cpp c:@N@foo@N@taz@S@ClsD@F@operator=#d# Extent=[46:5 - 46:61]
// CHECK: usrs.cpp c:usrs.cpp@690@N@foo@N@taz@S@ClsD@F@operator=#d#@x Extent=[46:21 - 46:29]
// CHECK: usrs.cpp c:@N@foo@N@taz@S@ClsD@F@operator=#&1$@N@foo@N@taz@S@ClsD# Extent=[47:5 - 47:62]
// CHECK: usrs.cpp c:usrs.cpp@751@N@foo@N@taz@S@ClsD@F@operator=#&1$@N@foo@N@taz@S@ClsD#@x Extent=[47:21 - 47:34]
// CHECK: usrs.cpp c:@N@foo@N@taz@S@ClsD@F@qux#S Extent=[48:5 - 48:21]
// CHECK: usrs.cpp c:@N@foo@N@taz@S@ClsD@F@uz#I.#S Extent=[49:5 - 49:30]
// CHECK: usrs.cpp c:usrs.cpp@833@N@foo@N@taz@S@ClsD@F@uz#I.#S@z Extent=[49:19 - 49:24]
// CHECK: usrs.cpp c:@N@foo@N@taz@S@ClsD@F@operator==#&1$@N@foo@N@taz@S@ClsD#1 Extent=[50:5 - 50:62]
// CHECK: usrs.cpp c:usrs.cpp@866@N@foo@N@taz@S@ClsD@F@operator==#&1$@N@foo@N@taz@S@ClsD#1@x Extent=[50:21 - 50:34]
// CHECK: usrs.cpp c:@F@rez Extent=[55:3 - 55:25]
// CHECK: usrs.cpp c:usrs.cpp@941@F@rez@a Extent=[55:12 - 55:17]
// CHECK: usrs.cpp c:usrs.cpp@948@F@rez@b Extent=[55:19 - 55:24]
// CHECK: usrs.cpp c:@NA@foo_alias
// CHECK-NOT: foo
// CHECK: usrs.cpp c:@NA@foo_alias2
// CHECK-NOT: ClsB
// CHECK: usrs.cpp c:@NA@foo_alias3
// CHECK: usrs.cpp c:@aN Extent=[68:1 - 73:2]
// CHECK: usrs.cpp c:usrs.cpp@aN@S@RDar9371763_Foo Extent=[69:1 - 72:2]
// CHECK: usrs.cpp c: Extent=[70:1 - 70:8]
// CHECK: usrs.cpp c:usrs.cpp@aN@S@RDar9371763_Foo@F@bar# Extent=[71:3 - 71:13]
// CHECK: usrs.cpp c:usrs.cpp@aN@S@RDar9371763_Foo@F@bar# Extent=[75:1 - 75:31]
// CHECK: usrs.cpp c:@F@rdar9371763# Extent=[77:1 - 80:2]
// CHECK: usrs.cpp c:usrs.cpp@1204@F@rdar9371763#@foo Extent=[78:3 - 78:22]
// CHECK: usrs.cpp c:@FT@>1#TsomeTemplFn#^type-parameter-0-0:::A# Extent=[82:1 - 82:50]
// CHECK: usrs.cpp c:@FT@>1#TsomeTemplFn#^type-parameter-0-0:::B# Extent=[83:1 - 83:50]
// CHECK: usrs.cpp c:@FT@>1#TsomeTemplFn#I# Extent=[84:1 - 84:40]
// CHECK: usrs.cpp c:@F@funWithChar#C# Extent=[86:1 - 86:28]
// CHECK: usrs.cpp c:@F@funWithChar#c# Extent=[87:1 - 87:37]
// CHECK: usrs.cpp c:@F@funWithChar#r# Extent=[88:1 - 88:35]
// CHECK: usrs.cpp c:usrs.cpp@[email protected]@1483@FI@x Extent=[90:10 - 90:15]
// CHECK: usrs.cpp c:usrs.cpp@[email protected]@1510@FI@x Extent=[91:10 - 91:15]
// CHECK: usrs.cpp c:@ST>1#T@TC1@F@meth#>@ST>1#[email protected]# Extent=[95:3 - 95:17]
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/complete-exprs.c
|
// Note: the run lines follow their respective tests, since line/column
// matter in this test.
int f(int) __attribute__((unavailable));
int test(int i, int j, int k, int l) {
return i | j | k & l;
}
struct X __attribute__((deprecated)) f1 = { 17 };
void f2() { f1(17); }
const char *str = "Hello, \nWorld";
void f3(const char*, ...) __attribute__((sentinel(0)));
#define NULL __null
void f4(const char* str) {
f3(str, NULL);
}
typedef int type;
void f5(float f) {
(type)f;
}
// RUN: c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: NotImplemented:{TypedText __PRETTY_FUNCTION__} (65)
// CHECK-CC1: macro definition:{TypedText __VERSION__} (70)
// CHECK-CC1: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (12) (unavailable)
// CHECK-CC1-NOT: NotImplemented:{TypedText float} (65)
// CHECK-CC1: ParmDecl:{ResultType int}{TypedText j} (8)
// CHECK-CC1: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40)
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
// RUN: c-index-test -code-completion-at=%s:7:14 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:14 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s
// CHECK-CC3: macro definition:{TypedText __VERSION__} (70)
// CHECK-CC3: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
// CHECK-CC3-NOT: NotImplemented:{TypedText float}
// CHECK-CC3: ParmDecl:{ResultType int}{TypedText j} (34)
// CHECK-CC3: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expressio
// RUN: c-index-test -code-completion-at=%s:7:18 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s
// RUN: c-index-test -code-completion-at=%s:7:22 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s
// RUN: c-index-test -code-completion-at=%s:7:2 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: macro definition:{TypedText __VERSION__} (70)
// CHECK-CC2: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
// CHECK-CC2: NotImplemented:{TypedText float} (50)
// CHECK-CC2: ParmDecl:{ResultType int}{TypedText j} (34)
// CHECK-CC2: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40)
// RUN: c-index-test -code-completion-at=%s:11:16 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s
// CHECK-CC4: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
// CHECK-CC4: VarDecl:{ResultType struct X}{TypedText f1} (50) (deprecated)
// RUN: c-index-test -code-completion-at=%s:19:3 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC6 %s
// CHECK-CC6: FunctionDecl:{ResultType void}{TypedText f3}{LeftParen (}{Placeholder const char *, ...}{Text , NULL}{RightParen )} (50)
// CHECK-CC6: NotImplemented:{TypedText void} (50)
// CHECK-CC6: NotImplemented:{TypedText volatile} (50)
// RUN: c-index-test -code-completion-at=%s:24:4 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC7 %s
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:24:4 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC7 %s
// CHECK-CC7: ParmDecl:{ResultType float}{TypedText f} (34)
// CHECK-CC7: VarDecl:{ResultType struct X}{TypedText f1} (50) (deprecated)
// CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f2}{LeftParen (}{RightParen )} (50)
// CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f3}{LeftParen (}{Placeholder const char *, ...}{Text , NULL}{RightParen )} (50)
// CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f4}{LeftParen (}{Placeholder const char *str}{RightParen )} (50)
// CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f5}{LeftParen (}{Placeholder float f}{RightParen )} (50)
// CHECK-CC7: TypedefDecl:{TypedText type} (50)
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/preamble-reparse-chained.c
|
// RUN: c-index-test -write-pch %t.h.pch -x c-header %S/Inputs/a.h
// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 all -I%S/Inputs -include %t.h %s | FileCheck %s
#include "a.h"
#include "b.h"
A a;
B b;
// CHECK: a.h:3:13: TypedefDecl=A:3:13 (Definition) Extent=[3:1 - 3:14]
// CHECK: b.h:1:15: TypedefDecl=B:1:15 (Definition) Extent=[1:1 - 1:16]
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/annotate-attribute.cpp
|
// RUN: c-index-test -test-load-source all %s | FileCheck %s
class Test {
public:
__attribute__((annotate("spiffy_method"))) void aMethod();
public __attribute__((annotate("works"))):
void anotherMethod(); // annotation attribute should be propagated.
private __attribute__((annotate("investigations"))):
//propagated annotation should have changed from "works" to "investigations"
void inlineMethod() {}
protected:
// attribute propagation should have stopped here
void methodWithoutAttribute();
};
// CHECK: ClassDecl=Test:3:7 (Definition) Extent=[3:1 - 17:2]
// CHECK-NEXT: CXXAccessSpecifier=:4:1 (Definition) Extent=[4:1 - 4:8]
// CHECK-NEXT: CXXMethod=aMethod:5:51 Extent=[5:3 - 5:60]
// CHECK-NEXT: attribute(annotate)=spiffy_method Extent=[5:18 - 5:43]
// CHECK-NEXT: CXXAccessSpecifier=:7:1 (Definition) Extent=[7:1 - 7:43]
// CHECK-NEXT: attribute(annotate)=works Extent=[7:23 - 7:40]
// CHECK-NEXT: CXXMethod=anotherMethod:8:8 Extent=[8:3 - 8:23]
// CHECK-NEXT: attribute(annotate)=works Extent=[7:23 - 7:40]
// CHECK-NEXT: CXXAccessSpecifier=:10:1 (Definition) Extent=[10:1 - 10:53]
// CHECK-NEXT: attribute(annotate)=investigations Extent=[10:24 - 10:50]
// CHECK-NEXT: CXXMethod=inlineMethod:12:8 (Definition) Extent=[12:3 - 12:25]
// CHECK-NEXT: attribute(annotate)=investigations Extent=[10:24 - 10:50]
// CHECK-NEXT: CompoundStmt= Extent=[12:23 - 12:25]
// CHECK-NEXT: CXXAccessSpecifier=:14:1 (Definition) Extent=[14:1 - 14:11]
// CHECK-NEXT: CXXMethod=methodWithoutAttribute:16:8 Extent=[16:3 - 16:32]
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/c-index-getCursor-pp.c
|
#define OBSCURE(X) X
#define DECORATION
#define FNM(X) OBSCURE(X)
typedef int T;
void OBSCURE(func)(int x) {
OBSCURE(T) DECORATION value;
}
#include "a.h"
#define A(X) X
#define B(X) A(X)
B(int x);
const char *fname = __FILE__;
#include <a.h>
#ifdef OBSCURE
#endif
#if defined(OBSCURE)
#endif
#define C(A) A
// RUN: c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s
// CHECK-1: macro definition=OBSCURE
// RUN: c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s
// CHECK-2: macro definition=DECORATION
// RUN: c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s
// CHECK-3: macro expansion=OBSCURE:1:9
// RUN: c-index-test -cursor-at=%s:6:6 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-4 %s
// CHECK-4: macro expansion=OBSCURE:1:9
// RUN: c-index-test -cursor-at=%s:6:19 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-5 %s
// CHECK-5: macro expansion=DECORATION:2:9
// RUN: c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s
// CHECK-6: inclusion directive=a.h
// RUN: c-index-test -cursor-at=%s:14:1 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-7 %s
// CHECK-7: macro expansion=B:12:9
// RUN: c-index-test -cursor-at=%s:16:25 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-8 %s
// CHECK-8: macro expansion=__FILE__
// RUN: c-index-test -cursor-at=%s:18:12 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-9 %s
// CHECK-9: inclusion directive=a.h
// RUN: c-index-test -cursor-at=%s:20:10 -cursor-at=%s:23:15 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-10 %s
// CHECK-10: 20:8 macro expansion=OBSCURE
// CHECK-10: 23:13 macro expansion=OBSCURE
// RUN: c-index-test -cursor-at=%s:3:20 -cursor-at=%s:12:14 \
// RUN: -cursor-at=%s:26:11 -cursor-at=%s:26:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-IN-MACRODEF %s
// CHECK-IN-MACRODEF: 3:16 macro expansion=OBSCURE
// CHECK-IN-MACRODEF: 12:14 macro expansion=A
// CHECK-IN-MACRODEF: 26:9 macro definition=C
// CHECK-IN-MACRODEF: 26:9 macro definition=C
// Same tests, but with "editing" optimizations
// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s
// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s
// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s
// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s
// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:3:20 -cursor-at=%s:12:14 \
// RUN: -cursor-at=%s:26:11 -cursor-at=%s:26:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-IN-MACRODEF %s
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/redeclarations.cpp
|
#include "redeclarations.h"
class A
{
};
// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 2 all -I%S/Inputs -fno-delayed-template-parsing -fno-ms-compatibility -fno-ms-extensions %s | FileCheck %s
// CHECK: redeclarations.h:1:7: ClassDecl=X:1:7 (Definition) Extent=[1:1 - 4:2]
// CHECK: redeclarations.h:8:7: ClassTemplate=B:8:7 (Definition) Extent=[7:1 - 10:2]
// CHECK: redeclarations.h:7:20: TemplateTypeParameter=T1:7:20 (Definition) Extent=[7:11 - 7:22]
// CHECK: redeclarations.h:7:33: TemplateTypeParameter=T2:7:33 (Definition) Extent=[7:24 - 7:35]
// CHECK: redeclarations.h:13:8: ClassTemplate=C:13:8 (Definition) Extent=[12:1 - 15:2]
// CHECK: redeclarations.h:12:17: TemplateTypeParameter=T:12:17 (Definition) Extent=[12:11 - 12:18]
// CHECK: redeclarations.h:17:7: ClassDecl=D:17:7 (Definition) Extent=[17:1 - 21:2]
// CHECK: redeclarations.h:19:16: ClassDecl=A:19:16 Extent=[19:10 - 19:17]
// CHECK: redeclarations.h:19:19: FieldDecl=x:19:19 (Definition) Extent=[19:5 - 19:20]
// CHECK: redeclarations.h:19:5: TemplateRef=B:8:7 Extent=[19:5 - 19:6]
// CHECK: redeclarations.h:19:7: TypeRef=class D:17:7 Extent=[19:7 - 19:8]
// CHECK: redeclarations.h:19:16: TypeRef=class A:3:7 Extent=[19:16 - 19:17]
// CHECK: redeclarations.cpp:3:7: ClassDecl=A:3:7 (Definition) Extent=[3:1 - 5:2]
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Index/targeted-cursor.m.h
|
@interface I
-(void)mm:(void (^)(I*))block;
-(void)mm2:(I*)i;
@end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.