Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2009-04-22 11:26:09 -0400
committerMike Kucera2009-04-22 11:26:09 -0400
commit6262b1fe81c053963220e980a42a83edc02e7f3d (patch)
treee8febb8e675eed8ee44bf134efb7f4f360c96425 /xlc/org.eclipse.cdt.core.lrparser.xlc.tests
parent91657617cbb6a860aae6a1180144463fdd411c90 (diff)
downloadorg.eclipse.cdt-6262b1fe81c053963220e980a42a83edc02e7f3d.tar.gz
org.eclipse.cdt-6262b1fe81c053963220e980a42a83edc02e7f3d.tar.xz
org.eclipse.cdt-6262b1fe81c053963220e980a42a83edc02e7f3d.zip
[273283] [XLC Parser] support _Complex and restrict keywords in C++
Diffstat (limited to 'xlc/org.eclipse.cdt.core.lrparser.xlc.tests')
-rw-r--r--xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/XLCExtensionsTest.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/XLCExtensionsTest.java b/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/XLCExtensionsTest.java
index 2a90e5d129..f84eefdb0c 100644
--- a/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/XLCExtensionsTest.java
+++ b/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/XLCExtensionsTest.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.cdt.core.parser.xlc.tests;
+import org.eclipse.cdt.core.lrparser.xlc.preferences.XlcLanguagePreferences;
+import org.eclipse.cdt.core.lrparser.xlc.preferences.XlcPref;
+
public class XLCExtensionsTest extends XLCTestBase {
@@ -218,11 +221,18 @@ public class XLCExtensionsTest extends XLCTestBase {
parse(code, getCLanguage(), true);
}
- public void testRestrictCPP() {
+
+ public void testRestrictCPPOn() {
+ String code =
+ "void foo(int n, int * restrict a, int * __restrict b, int * __restrict__ c) {} ";
+
+ parse(code, getCPPLanguage(), true);
+ }
+ public void testRestrictCPPOff() {
+ XlcLanguagePreferences.setWorkspacePreference(XlcPref.SUPPORT_RESTRICT_IN_CPP, String.valueOf(false));
String code =
"void restrict(); \n " +
- "void __restrict(); \n " +
- "void __restrict__(); \n ";
+ "void foo(int n, int * __restrict b, int * __restrict__ c) {} ";
parse(code, getCPPLanguage(), true);
}
@@ -244,7 +254,7 @@ public class XLCExtensionsTest extends XLCTestBase {
}
- public void testFloatingPoingTypes() {
+ public void testFloatingPointTypes() {
String code =
" _Decimal32 x = 22.2df; \n " +
" _Decimal64 y = 33.3dd; \n " +

Back to the top