1
/*******************************************************************************
2
* Copyright (c) 2002, 2007 IBM Corporation and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* IBM Rational Software - Initial API and implementation
10
*******************************************************************************/
11
package org.eclipse.cdt.core.parser.tests.ast2;
13
import java.io.StringWriter;
14
import java.io.Writer;
16
import org.eclipse.cdt.core.dom.ast.IASTNode;
22
public class DOMGCCSelectionParseExtensionsTest extends DOMSelectionParseBaseTest {
24
public DOMGCCSelectionParseExtensionsTest() {
27
public DOMGCCSelectionParseExtensionsTest(String name, Class className) {
28
super(name, className);
31
public DOMGCCSelectionParseExtensionsTest(String name) {
32
super(name, DOMGCCSelectionParseExtensionsTest.class);
35
public void testBug43021() throws Exception
37
Writer writer = new StringWriter();
38
writer.write( "extern int johnc(__const char *__restrict __format, ...);\n" ); //$NON-NLS-1$
39
writer.write( "void m() {johnc(\"HI\");}" ); //$NON-NLS-1$
40
String code = writer.toString();
41
int startIndex = code.indexOf( "{johnc") + 1; //$NON-NLS-1$
42
IASTNode node = parse( code, startIndex, startIndex + 5 );
43
assertNotNull( node );