Tests for C++0x Confusion

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Tests for C++0x Confusion

Michael Price - Dev
I'm a bit confused about the organization of the C++0x tests.  Under the clang/test directory I see the following seemingly C++0x related directories:

Lexer/
SemaCXX/
CodeGenCXX/
Fixit/
Lexer/
PCH/
Parser/
Preprocessor/
SemaTemplate/
(this is the one that confuses me the most, are thing organized by compiler arch, or by language/version?) CXX/

Am I in the dark on how these thing are organized?

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Tests for C++0x Confusion

Sebastian Redl
On 19.12.2010 20:15, Michael Price wrote:

> I'm a bit confused about the organization of the C++0x tests.  Under
> the clang/test directory I see the following seemingly C++0x related
> directories:
>
> Lexer/
> SemaCXX/
> CodeGenCXX/
> Fixit/
> Lexer/
> PCH/
> Parser/
> Preprocessor/
> SemaTemplate/
> (this is the one that confuses me the most, are thing organized by
> compiler arch, or by language/version?) CXX/
>
> Am I in the dark on how these thing are organized?
>
You're mostly looking at a historical artifact.

When Clang started as a C/Obj-C compiler (C++ was meant to be in there,
but wasn't really planned for), it had some test directories:
Preprocessor, Lexer, Parser, Sema, and CodeGen. This made sense, because
in C those components are pretty much completely distinct. We had the
MinimalAction, which just provided enough semantic analysis to make C
parsing work, so you could run the C parser without Sema. When ObjC
became a reality, only Sema and CodeGen received a significant number of
new tests, so SemaObjC and CodeGenObjC were added.
When C++ support came into being, SemaCXX and CodeGenCXX were added
along the same lines of reasoning. Templates were so complex and
demanded so many tests that SemaTemplate was split out of SemaCXX.
However, the organization as it is makes a lot less sense for C++ than
for C. For C++, there's no real minimal analysis that you can use for
parsing. Correctly parsing C++ already means understanding namespaces
and templates. So MinimalAction fell into disuse and bitrot, and
eventually the entire Action interface was removed. Sema became the only
action. Anyway, because separating parser and sema tests for C++ doesn't
make much sense, and to better get a feeling for test coverage, the CXX
directory was introduced, which contains tests organized by where the
feature they describe appears in the standard. (This happened long
before removing Action, by the way.)

Nowadays, if you add a test for C++, it's best to add it to CXX.
Occasionally we still add them to other directories, though: to PCH if
it only tests PCH functionality, and to SemaCXX or CodeGenCXX if the
test is not easily associated with a specific section of the standard.
(Some features are all over the place.)

Hope that helps.

Sebastian
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Tests for C++0x Confusion

Michael Price - Dev
That absolutely helps. Thanks!

Sent from my iPhone

On Dec 20, 2010, at 3:15 AM, Sebastian Redl <[hidden email]
 > wrote:

> On 19.12.2010 20:15, Michael Price wrote:
>> I'm a bit confused about the organization of the C++0x tests.  Under
>> the clang/test directory I see the following seemingly C++0x related
>> directories:
>>
>> Lexer/
>> SemaCXX/
>> CodeGenCXX/
>> Fixit/
>> Lexer/
>> PCH/
>> Parser/
>> Preprocessor/
>> SemaTemplate/
>> (this is the one that confuses me the most, are thing organized by
>> compiler arch, or by language/version?) CXX/
>>
>> Am I in the dark on how these thing are organized?
>>
> You're mostly looking at a historical artifact.
>
> When Clang started as a C/Obj-C compiler (C++ was meant to be in  
> there,
> but wasn't really planned for), it had some test directories:
> Preprocessor, Lexer, Parser, Sema, and CodeGen. This made sense,  
> because
> in C those components are pretty much completely distinct. We had the
> MinimalAction, which just provided enough semantic analysis to make C
> parsing work, so you could run the C parser without Sema. When ObjC
> became a reality, only Sema and CodeGen received a significant  
> number of
> new tests, so SemaObjC and CodeGenObjC were added.
> When C++ support came into being, SemaCXX and CodeGenCXX were added
> along the same lines of reasoning. Templates were so complex and
> demanded so many tests that SemaTemplate was split out of SemaCXX.
> However, the organization as it is makes a lot less sense for C++ than
> for C. For C++, there's no real minimal analysis that you can use for
> parsing. Correctly parsing C++ already means understanding namespaces
> and templates. So MinimalAction fell into disuse and bitrot, and
> eventually the entire Action interface was removed. Sema became the  
> only
> action. Anyway, because separating parser and sema tests for C++  
> doesn't
> make much sense, and to better get a feeling for test coverage, the  
> CXX
> directory was introduced, which contains tests organized by where the
> feature they describe appears in the standard. (This happened long
> before removing Action, by the way.)
>
> Nowadays, if you add a test for C++, it's best to add it to CXX.
> Occasionally we still add them to other directories, though: to PCH if
> it only tests PCH functionality, and to SemaCXX or CodeGenCXX if the
> test is not easily associated with a specific section of the standard.
> (Some features are all over the place.)
>
> Hope that helps.
>
> Sebastian
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Tests for C++0x Confusion

Michael Price - Dev
In reply to this post by Sebastian Redl

On Dec 20, 2010, at 3:15 AM, Sebastian Redl <[hidden email]
 > wrote:

> On 19.12.2010 20:15, Michael Price wrote:
>> I'm a bit confused about the organization of the C++0x tests.  Under
>> the clang/test directory I see the following seemingly C++0x related
>> directories:
>>
>> Lexer/
>> SemaCXX/
>> CodeGenCXX/
>> Fixit/
>> Lexer/
>> PCH/
>> Parser/
>> Preprocessor/
>> SemaTemplate/
>> (this is the one that confuses me the most, are thing organized by
>> compiler arch, or by language/version?) CXX/
>>
>> Am I in the dark on how these thing are organized?
>>
> You're mostly looking at a historical artifact.
>
> When Clang started as a C/Obj-C compiler (C++ was meant to be in  
> there,
> but wasn't really planned for), it had some test directories:
> Preprocessor, Lexer, Parser, Sema, and CodeGen. This made sense,  
> because
> in C those components are pretty much completely distinct. We had the
> MinimalAction, which just provided enough semantic analysis to make C
> parsing work, so you could run the C parser without Sema. When ObjC
> became a reality, only Sema and CodeGen received a significant  
> number of
> new tests, so SemaObjC and CodeGenObjC were added.
> When C++ support came into being, SemaCXX and CodeGenCXX were added
> along the same lines of reasoning. Templates were so complex and
> demanded so many tests that SemaTemplate was split out of SemaCXX.
> However, the organization as it is makes a lot less sense for C++ than
> for C. For C++, there's no real minimal analysis that you can use for
> parsing. Correctly parsing C++ already means understanding namespaces
> and templates. So MinimalAction fell into disuse and bitrot, and
> eventually the entire Action interface was removed. Sema became the  
> only
> action. Anyway, because separating parser and sema tests for C++  
> doesn't
> make much sense, and to better get a feeling for test coverage, the  
> CXX
> directory was introduced, which contains tests organized by where the
> feature they describe appears in the standard. (This happened long
> before removing Action, by the way.)

Might I propose then that a separate directory be created for the next  
C++ standard, as the layout of the current final draft proposal has  
significant differences with the C++03 standard.

> Nowadays, if you add a test for C++, it's best to add it to CXX.
> Occasionally we still add them to other directories, though: to PCH if
> it only tests PCH functionality, and to SemaCXX or CodeGenCXX if the
> test is not easily associated with a specific section of the standard.
> (Some features are all over the place.)
>
> Hope that helps.
>
> Sebastian
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Tests for C++0x Confusion

Sebastian Redl
On 20.12.2010 12:58, Michael Price - Dev wrote:
>
> Might I propose then that a separate directory be created for the next
> C++ standard, as the layout of the current final draft proposal has
> significant differences with the C++03 standard.
We're trying to follow the draft.

Sebastian
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Tests for C++0x Confusion

John McCall

On Dec 20, 2010, at 4:31 AM, Sebastian Redl wrote:

> On 20.12.2010 12:58, Michael Price - Dev wrote:
>>
>> Might I propose then that a separate directory be created for the next
>> C++ standard, as the layout of the current final draft proposal has
>> significant differences with the C++03 standard.
> We're trying to follow the draft.

To elaborate, while the standards still keep the same section names (I think?), we should probably converge on using the '0x paragraph numbers.  If you see something under the wrong paragraph, it is acceptable to move it.

John.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev