diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2013-12-10 12:53:20 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@digia.com> | 2013-12-10 12:53:20 +0100 |
commit | 9f831dde07cb2411808534e76669b28a1b76e21d (patch) | |
tree | ed6252d64c9a3ab27aa93786272cda1b6008f3c7 /tests/auto/cplusplus | |
parent | cdac81f896ef4b052d76f96485a08e6ec13696b8 (diff) | |
parent | ea1a92484ac99057b06130a012164bf9788650e9 (diff) | |
download | qt-creator-wip/clang.tar.gz |
Merge remote-tracking branch 'origin/master' into wip/clangwip/clang
Change-Id: I8a2c8068a3f2b15034fb1bf6304c9a0f3f0e3c8f
Diffstat (limited to 'tests/auto/cplusplus')
-rw-r--r-- | tests/auto/cplusplus/ast/tst_ast.cpp | 11 | ||||
-rw-r--r-- | tests/auto/cplusplus/cxx11/data/threadLocal.1.cpp | 1 | ||||
-rw-r--r-- | tests/auto/cplusplus/cxx11/tst_cxx11.cpp | 1 | ||||
-rw-r--r-- | tests/auto/cplusplus/lexer/tst_lexer.cpp | 7 |
4 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/cplusplus/ast/tst_ast.cpp b/tests/auto/cplusplus/ast/tst_ast.cpp index 449c8db6e5..b7474ae874 100644 --- a/tests/auto/cplusplus/ast/tst_ast.cpp +++ b/tests/auto/cplusplus/ast/tst_ast.cpp @@ -107,6 +107,7 @@ private slots: void gcc_attributes_2(); void gcc_attributes_3(); void crash_test_1(); + void thread_local_1(); // expressions void simple_name_1(); @@ -246,6 +247,16 @@ void tst_AST::crash_test_1() QVERIFY(ast); } +void tst_AST::thread_local_1() +{ + QSharedPointer<TranslationUnit> unit(parseStatement("__thread int i;\n")); + AST *ast = unit->ast(); + QVERIFY(ast); + QCOMPARE(diag.errorCount, 0); + QCOMPARE(Token::name(T_THREAD_LOCAL), "thread_local"); + QCOMPARE(Token::name(T___THREAD), "__thread"); +} + void tst_AST::simple_declaration_1() { QSharedPointer<TranslationUnit> unit(parseStatement("\n" diff --git a/tests/auto/cplusplus/cxx11/data/threadLocal.1.cpp b/tests/auto/cplusplus/cxx11/data/threadLocal.1.cpp new file mode 100644 index 0000000000..b286b0bcee --- /dev/null +++ b/tests/auto/cplusplus/cxx11/data/threadLocal.1.cpp @@ -0,0 +1 @@ +thread_local int i; diff --git a/tests/auto/cplusplus/cxx11/tst_cxx11.cpp b/tests/auto/cplusplus/cxx11/tst_cxx11.cpp index 8ac002e376..9320ab24e3 100644 --- a/tests/auto/cplusplus/cxx11/tst_cxx11.cpp +++ b/tests/auto/cplusplus/cxx11/tst_cxx11.cpp @@ -151,6 +151,7 @@ void tst_cxx11::parse_data() QTest::newRow("templateGreaterGreater.1") << "templateGreaterGreater.1.cpp" << ""; QTest::newRow("packExpansion.1") << "packExpansion.1.cpp" << ""; QTest::newRow("declType.1") << "declType.1.cpp" << ""; + QTest::newRow("threadLocal.1") << "threadLocal.1.cpp" << ""; } void tst_cxx11::parse() diff --git a/tests/auto/cplusplus/lexer/tst_lexer.cpp b/tests/auto/cplusplus/lexer/tst_lexer.cpp index 1dc7383d72..5b49045488 100644 --- a/tests/auto/cplusplus/lexer/tst_lexer.cpp +++ b/tests/auto/cplusplus/lexer/tst_lexer.cpp @@ -165,6 +165,13 @@ void tst_SimpleLexer::doxygen_comments_data() << T_INT << T_IDENTIFIER << T_SEMICOLON << T_CPP_DOXY_COMMENT << T_INT << T_IDENTIFIER << T_SEMICOLON << T_CPP_DOXY_COMMENT << T_CPP_DOXY_COMMENT; QTest::newRow(source) << source << expectedTokenKindList; + + source = "?" "?(?" "?)?" "?<?" "?>a?b:c"; + expectedTokenKindList = QList<unsigned>() + << T_LBRACKET << T_RBRACKET << T_LBRACE << T_RBRACE + << T_IDENTIFIER << T_QUESTION << T_IDENTIFIER << T_COLON << T_IDENTIFIER; + QTest::newRow(source) << source << expectedTokenKindList; + } QTEST_APPLESS_MAIN(tst_SimpleLexer) |