Add .gitattributes and .gitignore files and normalize line endings in the repository (#10)

This commit is contained in:
Colin Finck 2017-10-04 20:37:32 +02:00 committed by GitHub
parent c609406c2f
commit 9ebf43567d
309 changed files with 66975 additions and 66873 deletions

View file

@ -1,6 +1,6 @@
# -*- makefile -*- Time-stamp: <04/10/17 21:16:38 ptr>
PRGNAME = compiler_test
SRC_CPP = ttei1.cpp ttei2.cpp ttei3.cpp ttei4.cpp ttei5.cpp ttei6.cpp ttei7.cpp \
partial_spec.cpp movable.cpp
SRC_CC = eh.cc
# -*- makefile -*- Time-stamp: <04/10/17 21:16:38 ptr>
PRGNAME = compiler_test
SRC_CPP = ttei1.cpp ttei2.cpp ttei3.cpp ttei4.cpp ttei5.cpp ttei6.cpp ttei7.cpp \
partial_spec.cpp movable.cpp
SRC_CC = eh.cc

View file

@ -1,29 +1,29 @@
1. About this tests
This is tests to check whether compiler understand or not some language
construction. It is NOT tests for language support libraries, only tests for
compiler!
The main purposes of this tests is to help for developers to find correct
workarounds, if compiler don't understand some (correct) language constructions.
--------------------------------------------------------
2. Compilation
Compilation with GNU Make utility and gcc compiler:
make -f gcc.mak -k
--------------------------------------------------------
Notes about tests.
ttei1.cpp, ttei2.cpp, ttei3.cpp, ttei4.cpp, ttei5.cpp:
tests for template-in-the-template explicit specialization.
Indeed ttei3.cpp, ttei4.cpp, ttei5.cpp suggest syntax not approved by standard
(14.7.3, paragraphs 16--18), but ttei3.cpp, ttei4.cpp accepted (recheck!) by VC6,
while ttei5.cpp accepted by gcc before 3.4.0.
1. About this tests
This is tests to check whether compiler understand or not some language
construction. It is NOT tests for language support libraries, only tests for
compiler!
The main purposes of this tests is to help for developers to find correct
workarounds, if compiler don't understand some (correct) language constructions.
--------------------------------------------------------
2. Compilation
Compilation with GNU Make utility and gcc compiler:
make -f gcc.mak -k
--------------------------------------------------------
Notes about tests.
ttei1.cpp, ttei2.cpp, ttei3.cpp, ttei4.cpp, ttei5.cpp:
tests for template-in-the-template explicit specialization.
Indeed ttei3.cpp, ttei4.cpp, ttei5.cpp suggest syntax not approved by standard
(14.7.3, paragraphs 16--18), but ttei3.cpp, ttei4.cpp accepted (recheck!) by VC6,
while ttei5.cpp accepted by gcc before 3.4.0.

View file

@ -1,12 +1,12 @@
# -*- Makefile -*- Time-stamp: <03/07/09 18:08:47 ptr>
SRCROOT := ../../../build
COMPILER_NAME := gcc
# WITHOUT_STLPORT = 1
# STLPORT_DIR := ../../..
include Makefile.inc
include ${SRCROOT}/Makefiles/top.mak
#CXXFLAGS += -fuse-cxa-atexit
LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR}
# -*- Makefile -*- Time-stamp: <03/07/09 18:08:47 ptr>
SRCROOT := ../../../build
COMPILER_NAME := gcc
# WITHOUT_STLPORT = 1
# STLPORT_DIR := ../../..
include Makefile.inc
include ${SRCROOT}/Makefiles/top.mak
#CXXFLAGS += -fuse-cxa-atexit
LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR}

View file

@ -1,4 +1,4 @@
# -*- makefile -*- Time-stamp: <02/07/14 14:03:13 ptr>
PRGNAME = stterm-test
SRC_CC = stterm-test.cc
# -*- makefile -*- Time-stamp: <02/07/14 14:03:13 ptr>
PRGNAME = stterm-test
SRC_CC = stterm-test.cc

View file

@ -1,117 +1,117 @@
/*
* The conversation with Matti Rintala on STLport forum 2005-08-24:
*
* Do you mean ISO/IEC 14882 3.6.3 [basic.start.term]?
*
* Yes. "Destructors (12.4) for initialized objects of static storage duration
* (declared at block scope or at namespace scope) are called as a result
* of returning from main and as a result of calling exit (18.3). These objects
* are destroyed in the reverse order of the completion of their constructor
* or of the completion of their dynamic initialization."
*
* I found a confirmation on the web that gcc may not strictly conform
* to this behaviour in certains cases unless -fuse-cxa-atexit is used.
*
* Test below give (without -fuse-cxa-atexit)
Init::Init()
Init::use_it
It ctor done <-- 0
Init::use_it done
Init ctor done <-- 1
Init2 ctor done <-- 2
It dtor done <-- 0
Init2 dtor done <-- 2
Init dtor done <-- 1
* but should:
Init::Init()
Init::use_it
It ctor done <-- 0
Init::use_it done
Init ctor done <-- 1
Init2 ctor done <-- 2
Init2 dtor done <-- 2
Init dtor done <-- 1
It dtor done <-- 0
*/
#include <stdio.h>
using namespace std;
class Init
{
public:
Init();
~Init();
static void use_it();
};
class Init2
{
public:
Init2();
~Init2();
};
static Init init;
static Init2 init2;
class It
{
public:
It();
~It();
};
Init::Init()
{
printf( "Init::Init()\n" );
use_it();
printf( "Init ctor done\n" );
}
Init::~Init()
{
printf( "Init dtor done\n" );
}
void Init::use_it()
{
printf( "Init::use_it\n" );
static It it;
printf( "Init::use_it done\n" );
}
Init2::Init2()
{
printf( "Init2 ctor done\n" );
}
Init2::~Init2()
{
printf( "Init2 dtor done\n" );
}
It::It()
{
printf( "It ctor done\n" );
}
It::~It()
{
printf( "It dtor done\n" );
}
int main()
{
return 0;
}
/*
* The conversation with Matti Rintala on STLport forum 2005-08-24:
*
* Do you mean ISO/IEC 14882 3.6.3 [basic.start.term]?
*
* Yes. "Destructors (12.4) for initialized objects of static storage duration
* (declared at block scope or at namespace scope) are called as a result
* of returning from main and as a result of calling exit (18.3). These objects
* are destroyed in the reverse order of the completion of their constructor
* or of the completion of their dynamic initialization."
*
* I found a confirmation on the web that gcc may not strictly conform
* to this behaviour in certains cases unless -fuse-cxa-atexit is used.
*
* Test below give (without -fuse-cxa-atexit)
Init::Init()
Init::use_it
It ctor done <-- 0
Init::use_it done
Init ctor done <-- 1
Init2 ctor done <-- 2
It dtor done <-- 0
Init2 dtor done <-- 2
Init dtor done <-- 1
* but should:
Init::Init()
Init::use_it
It ctor done <-- 0
Init::use_it done
Init ctor done <-- 1
Init2 ctor done <-- 2
Init2 dtor done <-- 2
Init dtor done <-- 1
It dtor done <-- 0
*/
#include <stdio.h>
using namespace std;
class Init
{
public:
Init();
~Init();
static void use_it();
};
class Init2
{
public:
Init2();
~Init2();
};
static Init init;
static Init2 init2;
class It
{
public:
It();
~It();
};
Init::Init()
{
printf( "Init::Init()\n" );
use_it();
printf( "Init ctor done\n" );
}
Init::~Init()
{
printf( "Init dtor done\n" );
}
void Init::use_it()
{
printf( "Init::use_it\n" );
static It it;
printf( "Init::use_it done\n" );
}
Init2::Init2()
{
printf( "Init2 ctor done\n" );
}
Init2::~Init2()
{
printf( "Init2 dtor done\n" );
}
It::It()
{
printf( "It ctor done\n" );
}
It::~It()
{
printf( "It dtor done\n" );
}
int main()
{
return 0;
}

View file

@ -1,60 +1,60 @@
#include <list> /* required, to expose allocator */
#include <stdexcept>
#include <stdio.h>
using namespace std;
struct BigStruct
{
char _data[4096];
};
void bad_alloc_test()
{
typedef allocator<BigStruct> BigStructAllocType;
BigStructAllocType bigStructAlloc;
try {
//Lets try to allocate almost 4096 Go (on most of the platforms) of memory:
BigStructAllocType::pointer pbigStruct = bigStructAlloc.allocate(1024 * 1024 * 1024);
// CPPUNIT_ASSERT( pbigStruct != 0 && "Allocation failed but no exception thrown" );
}
catch (bad_alloc const&) {
printf( "Ok\n" );
}
catch (...) {
//We shouldn't be there:
// CPPUNIT_ASSERT( false && "Not bad_alloc exception thrown." );
}
}
void bad_alloc_test1()
{
try {
allocator<BigStruct> all;
BigStruct *bs = all.allocate(1024*1024*1024);
// throw bad_alloc();
}
catch ( bad_alloc const & ) {
printf( "I am here\n" );
}
catch ( ... ) {
}
}
int main()
{
bad_alloc_test();
#if 0
try {
throw bad_alloc();
}
catch ( bad_alloc& ) {
}
catch ( ... ) {
}
#endif
return 0;
}
#include <list> /* required, to expose allocator */
#include <stdexcept>
#include <stdio.h>
using namespace std;
struct BigStruct
{
char _data[4096];
};
void bad_alloc_test()
{
typedef allocator<BigStruct> BigStructAllocType;
BigStructAllocType bigStructAlloc;
try {
//Lets try to allocate almost 4096 Go (on most of the platforms) of memory:
BigStructAllocType::pointer pbigStruct = bigStructAlloc.allocate(1024 * 1024 * 1024);
// CPPUNIT_ASSERT( pbigStruct != 0 && "Allocation failed but no exception thrown" );
}
catch (bad_alloc const&) {
printf( "Ok\n" );
}
catch (...) {
//We shouldn't be there:
// CPPUNIT_ASSERT( false && "Not bad_alloc exception thrown." );
}
}
void bad_alloc_test1()
{
try {
allocator<BigStruct> all;
BigStruct *bs = all.allocate(1024*1024*1024);
// throw bad_alloc();
}
catch ( bad_alloc const & ) {
printf( "I am here\n" );
}
catch ( ... ) {
}
}
int main()
{
bad_alloc_test();
#if 0
try {
throw bad_alloc();
}
catch ( bad_alloc& ) {
}
catch ( ... ) {
}
#endif
return 0;
}