llvm-project/clang/test/Index/comment-c-decls.c
Aaron Ballman 0f1c1be196 [clang] Remove rdar links; NFC
We have a new policy in place making links to private resources
something we try to avoid in source and test files. Normally, we'd
organically switch to the new policy rather than make a sweeping change
across a project. However, Clang is in a somewhat special circumstance
currently: recently, I've had several new contributors run into rdar
links around test code which their patch was changing the behavior of.
This turns out to be a surprisingly bad experience, especially for
newer folks, for a handful of reasons: not understanding what the link
is and feeling intimidated by it, wondering whether their changes are
actually breaking something important to a downstream in some way,
having to hunt down strangers not involved with the patch to impose on
them for help, accidental pressure from asking for potentially private
IP to be made public, etc. Because folks run into these links entirely
by chance (through fixing bugs or working on new features), there's not
really a set of problematic links to focus on -- all of the links have
basically the same potential for causing these problems. As a result,
this is an omnibus patch to remove all such links.

This was not a mechanical change; it was done by manually searching for
rdar, radar, radr, and other variants to find all the various
problematic links. From there, I tried to retain or reword the
surrounding comments so that we would lose as little context as
possible. However, because most links were just a plain link with no
supporting context, the majority of the changes are simple removals.

Differential Review: https://reviews.llvm.org/D158071
2023-08-28 12:13:42 -04:00

104 lines
2.1 KiB
C

// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 %s > %t/out
// RUN: FileCheck %s < %t/out
// Ensure that XML we generate is not invalid.
// RUN: FileCheck %s -check-prefix=WRONG < %t/out
// WRONG-NOT: CommentXMLInvalid
/**
* \brief Aaa.
*/
int global_function();
// CHECK: <Declaration>int global_function()</Declaration>
/**
* \param x1 Aaa.
*/
extern void external_function(int x1);
// CHECK: <Declaration>extern void external_function(int x1)</Declaration>
/**
* \brief global variable;
*/
int global_variable;
// CHECK: <Declaration>int global_variable</Declaration>
/**
* \brief local variable;
*/
static int static_variable;
// CHECK: <Declaration>static int static_variable</Declaration>
/**
* \brief external variable
*/
extern int external_variable;
// CHECK: <Declaration>extern int external_variable</Declaration>
int global_function() {
/**
* \brief a local variable
*/
int local = 10;
return local;
}
// CHECK: <Declaration>int global_function()</Declaration>
// CHECK: <Declaration>int local = 10</Declaration>
/**
* \brief initialized decl.
*/
int initialized_global = 100;
// CHECK: <Declaration>int initialized_global = 100</Declaration>
/**
* \brief typedef example
*/
typedef int INT_T;
// CHECK: <Declaration>typedef int INT_T</Declaration>
/**
* \brief aggregate type example
*/
struct S {
/**
* \brief iS1;
*/
int iS1;
/**
* \brief dS1;
*/
double dS1;
};
// CHECK: <Declaration>struct S {}</Declaration>
// CHECK: <Declaration>int iS1</Declaration>
// CHECK: <Declaration>double dS1</Declaration>
/**
* \brief enum e;
*/
enum e {
One,
/**
* \brief Two;
*/
Two,
Three
};
// CHECK: <Declaration>enum e {}</Declaration>
// CHECK: <Declaration>Two</Declaration>
/**
*\brief block declaration
*/
int (^Block) (int i, int j);
// CHECK: <Declaration>int (^Block)(int, int)</Declaration>
/**
*\brief block declaration
*/
int (^Block1) (int i, int j) = ^(int i, int j) { return i + j; };
// CHECK: <Declaration>int (^Block1)(int, int) = ^(int i, int j) {\n}</Declaration>