[llvm-commits] [test-suite] r106426 - /test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/bison/mybison.reference_output

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Jun 21 09:23:58 PDT 2010


Author: stoklund
Date: Mon Jun 21 11:23:58 2010
New Revision: 106426

URL: http://llvm.org/viewvc/llvm-project?rev=106426&view=rev
Log:
Fix seemingly mangled reference output for bison test

Modified:
    test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/bison/mybison.reference_output

Modified: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/bison/mybison.reference_output
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/bison/mybison.reference_output?rev=106426&r1=106425&r2=106426&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/bison/mybison.reference_output (original)
+++ test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/bison/mybison.reference_output Mon Jun 21 11:23:58 2010
@@ -1,48 +1,24 @@
-.endnum = -1; };
+#include <stdio.h>
 
-%%
+#ifndef __STDC__
+#define const
+#endif
 
-void
-yyerror(char* s) {
-    fprintf(stderr,"%s\n",s);
-    }
 
-int
-main() {
-    printf("1\t");
-    yyparse();
-    return 1;
-    }
-#line 751 "parse.y.in"
 
+#define	YYFINAL		152
+#define	YYFLAG		-32768
+#define	YYNTBASE	48
 
-void
-yyerror(char* s) {
-    fprintf(stderr,"%s\n",s);
-    }
-
-int
-main() {
-    printf("1\t");
-    yyparse();
-    return 1;
-    }
-            {   };
+#define YYTRANSLATE(x) ((unsigned)(x) <= 291 ? yytranslate[x] : 84)
 
-writestmt: WRITELN '(' exp ')'
-        { if ((  ')'
-         { ID
-        {   /* Same as above up until where 'stype' is */
-	   symTabEntry find;
-	   if (lookup(mt;
-
-procdcls : procdcls procdcl | /* empty */ ;
-
-procdcl : PROC ID 
-        {  
-	   symTabEntry find;
-
-	   if (lookup(  2,     2,     2,     2,     2,     2,    42,    41,     2,
+static const char yytranslate[] = {     0,
+     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+     2,     2,     2,     2,     2,     2,     2,     2,     2,    43,
+    44,    38,    35,    45,    36,     2,     2,     2,     2,     2,
+     2,     2,     2,     2,     2,     2,     2,    42,    41,     2,
     29,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -211,56 +187,56 @@
 };
 #define YYPURE 1
 
-%{
-#include <malloc.h>
-#include <string.h>
-#include "attr.h"
-int yylex();
-void yyerror(char* s);
-#include "symtab.h"
-/* Global variables */
-scopeEntry current = NULL;  /* Points to current scope */
-scopeEntry temp = NULL;     /* Used temporarily for adding and/or
-			       removing scopes */
-%}
-
-%union { int number;
-	 tokentype token;
-	 BaseType basetype;
-	 typeinfo totaltype;
-	 namelist names;
-	 expnode exps;
-	 explist elist;}
-
-%token PROG PERIOD PROC FUNC VAR ARRAY RANGE OF
-%token INT CHAR BOOL WRITELN THEN ELSE IF DO WHILE
-%token BEG END ASG NOT TRUE_TOK FALSE_TOK
-%token <token> ID CCONST ICONST
-
-%type <basetype> stype
-%type <totaltype> type exp constant lhs var
-%type <names> idlist vardcl vardcls parmlist parms parm variables
-%type <elist> explist optexplist
-
-%start program
-%nonassoc '=' NEQ LT LEQ GEQ GT
-%left '+' '-' OR
-%left '*' AND DIV
-%right NOT
-
-%%
-program : PROG ID
-        { enterblock(); }
-        ';' block PERIOD 
-        {leaveblock();};
-
-block : variables
-      {
-      /* Seen all the variables so declare them in the current scope */
-	 symTabEntry s;
-         namenode tmpnode;
+#line 751 "parse.y.in"
+
+
+void
+yyerror(char* s) {
+    fprintf(stderr,"%s\n",s);
+    }
 
-	 tmpnode = 
+int
+main() {
+    printf("1\t");
+    yyparse();
+    return 1;
+    }
+ck the parameters */
+		 int check;
+		 check = checkparams( s -> formals , yyp->yyvsp[0].elist );
+	      }
+	   }
+        ;
+    break;}
+case 44:
+#line 302 "parse.y.in"
+{  /* only booleans */
+	   if (yyp->yyvsp[0].totaltype.basetype != BOOLTYPE)
+	      printf("\n***Error: exp in if stmt must be boolean\n");
+	;
+    break;}
+case 46:
+#line 310 "parse.y.in"
+{  /* only booleans */
+	   if (yyp->yyvsp[0].totaltype.basetype != BOOLTYPE)
+	      printf("\n***Error: exp in while stmt must be boolean\n");
+	;
+    break;}
+case 48:
+#line 318 "parse.y.in"
+{  /* Make sure the assignment types match */
+           if (!(match(yyp->yyvsp[-1].totaltype,yyp->yyvsp[0].totaltype)))
+	      printf("\n***Error: assignment types do not match\n");
+        ;
+    break;}
+case 49:
+#line 324 "parse.y.in"
+{ yyval.totaltype = yyp->yyvsp[-1].totaltype; ;
+    break;}
+case 50:
+#line 327 "parse.y.in"
+{ yyval.elist.firstexp = NULL;   /* No optexplist = NULL list */
+	  yyval.elist.lastexp = NULL; ;
     break;}
 case 51:
 #line 330 "parse.y.in"





More information about the llvm-commits mailing list