Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2012-04-10 18:14:09 -0400
committerSergey Prigogin2012-04-13 14:49:12 -0400
commit20ea7546f85ed277b38116bc7a99334c57e317f8 (patch)
tree3a579378ccafea85c5c7e7ba06c940dbf7306fd7 /core/org.eclipse.cdt.core.tests
parent33374d0a517f3c40e03352b63ec4edc8885fb633 (diff)
downloadorg.eclipse.cdt-20ea7546f85ed277b38116bc7a99334c57e317f8.tar.gz
org.eclipse.cdt-20ea7546f85ed277b38116bc7a99334c57e317f8.tar.xz
org.eclipse.cdt-20ea7546f85ed277b38116bc7a99334c57e317f8.zip
Bug 316076. Added IFunction.isNoReturn() method.
Change-Id: Idfa2aa067e9c956b9a990980797a41277a84cc58 Reviewed-on: https://git.eclipse.org/r/5584 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Diffstat (limited to 'core/org.eclipse.cdt.core.tests')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CFunctionTests.java9
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CPPFunctionTests.java14
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/pdomtests/functionTests/modifiers.c1
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/pdomtests/functionTests/modifiers.cpp1
4 files changed, 20 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CFunctionTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CFunctionTests.java
index fdc381a323..d868d66ef6 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CFunctionTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CFunctionTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation.
+ * Copyright (c) 2006, 2012 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.pdom.tests;
@@ -74,6 +75,12 @@ public class CFunctionTests extends PDOMTestBase {
assertTrue(((IFunction) bindings[0]).takesVarArgs());
}
+ public void testNoReturnCFunction() throws Exception {
+ IBinding[] bindings = findQualifiedName(pdom, "noReturnCFunction");
+ assertEquals(1, bindings.length);
+ assertTrue(((IFunction) bindings[0]).isNoReturn());
+ }
+
public void testKnRStyleFunctionWithProblemParameters() throws Exception {
IBinding[] bindings = findQualifiedName(pdom, "KnRfunctionWithProblemParameters");
assertEquals(1, bindings.length);
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CPPFunctionTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CPPFunctionTests.java
index b834b1b654..b01af4b814 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CPPFunctionTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CPPFunctionTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation.
+ * Copyright (c) 2006, 2012 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Markus Schorn (Wind River Systems)
+ * Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.pdom.tests;
@@ -38,7 +39,6 @@ import org.eclipse.core.runtime.CoreException;
*/
public class CPPFunctionTests extends PDOMTestBase {
protected ICProject project;
-
protected PDOM pdom;
public static Test suite() {
@@ -137,13 +137,19 @@ public class CPPFunctionTests extends PDOMTestBase {
assertEquals(1, bindings.length);
assertTrue(((ICPPFunction) bindings[0]).isInline());
}
-
+
public void testVarArgsCPPFunction() throws Exception {
IBinding[] bindings = findQualifiedName(pdom, "varArgsCPPFunction");
assertEquals(1, bindings.length);
assertTrue(((ICPPFunction) bindings[0]).takesVarArgs());
}
-
+
+ public void testNoReturnCPPFunction() throws Exception {
+ IBinding[] bindings = findQualifiedName(pdom, "noReturnCPPFunction");
+ assertEquals(1, bindings.length);
+ assertTrue(((ICPPFunction) bindings[0]).isNoReturn());
+ }
+
public void testForwardDeclarationType() throws Exception {
assertType(pdom, "forwardDeclaration", ICPPFunction.class);
}
diff --git a/core/org.eclipse.cdt.core.tests/resources/pdomtests/functionTests/modifiers.c b/core/org.eclipse.cdt.core.tests/resources/pdomtests/functionTests/modifiers.c
index 8ee78772dd..763cd95e91 100644
--- a/core/org.eclipse.cdt.core.tests/resources/pdomtests/functionTests/modifiers.c
+++ b/core/org.eclipse.cdt.core.tests/resources/pdomtests/functionTests/modifiers.c
@@ -6,6 +6,7 @@ void varArgsCFunction(int p1, ...);
const void constCFunction();
volatile void volatileCFunction();
void storageClassCFunction(register int p1, int p2);
+void noReturnCFunction() __attribute__((noreturn));
void voidCFunction();
int intCFunction();
diff --git a/core/org.eclipse.cdt.core.tests/resources/pdomtests/functionTests/modifiers.cpp b/core/org.eclipse.cdt.core.tests/resources/pdomtests/functionTests/modifiers.cpp
index bd5ef3c900..3f9d5b9137 100644
--- a/core/org.eclipse.cdt.core.tests/resources/pdomtests/functionTests/modifiers.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/pdomtests/functionTests/modifiers.cpp
@@ -4,6 +4,7 @@ static int staticCPPFunction(double p1);
extern float externCPPFunction(int p1);
inline void inlineCPPFunction(long p1);
void varArgsCPPFunction(int p1, ...);
+void noReturnCPPFunction() __attribute__((noreturn));
void voidCPPFunction();
int intCPPFunction();

Back to the top