Changes in / [08e8851:2ff78aae]
- Files:
-
- 25 added
- 32 deleted
- 81 edited
-
doc/papers/concurrency/Paper.tex (modified) (6 diffs)
-
doc/refrat/refrat.tex (modified) (3 diffs)
-
doc/theses/andrew_beach_MMath/glossaries.tex (deleted)
-
doc/theses/andrew_beach_MMath/thesis.tex (modified) (1 diff)
-
doc/theses/thierry_delisle_PhD/code/Makefile (added)
-
doc/theses/thierry_delisle_PhD/code/assert.hpp (added)
-
doc/theses/thierry_delisle_PhD/code/bitbench/select.cpp (added)
-
doc/theses/thierry_delisle_PhD/code/bts.cpp (added)
-
doc/theses/thierry_delisle_PhD/code/bts_test.cpp (added)
-
doc/theses/thierry_delisle_PhD/code/links.hpp (added)
-
doc/theses/thierry_delisle_PhD/code/prefetch.cpp (added)
-
doc/theses/thierry_delisle_PhD/code/process.sh (added)
-
doc/theses/thierry_delisle_PhD/code/processor.hpp (added)
-
doc/theses/thierry_delisle_PhD/code/processor_list.hpp (added)
-
doc/theses/thierry_delisle_PhD/code/processor_list_fast.cpp (added)
-
doc/theses/thierry_delisle_PhD/code/processor_list_good.cpp (added)
-
doc/theses/thierry_delisle_PhD/code/randbit.cpp (added)
-
doc/theses/thierry_delisle_PhD/code/readQ_example/proto-gui/main.cpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readQ_example/thrdlib/thread.h (deleted)
-
doc/theses/thierry_delisle_PhD/code/readQ_example/thrdlib/thread_pthread.h (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/Makefile (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/assert.hpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/bitbench/select.cpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/bts.cpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/bts_test.cpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/links.hpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/prefetch.cpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/process.sh (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/processor.hpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/processor_list.hpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/processor_list_fast.cpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/processor_list_good.cpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/randbit.cpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/relaxed_list.cpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/relaxed_list.hpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/relaxed_list_layout.cpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/runperf.sh (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/scale.sh (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/snzi-packed.hpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/snzi.hpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/snzm.hpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/utils.hpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/readyQ_proto/work_stealing.hpp (deleted)
-
doc/theses/thierry_delisle_PhD/code/relaxed_list.cpp (added)
-
doc/theses/thierry_delisle_PhD/code/relaxed_list.hpp (added)
-
doc/theses/thierry_delisle_PhD/code/relaxed_list_layout.cpp (added)
-
doc/theses/thierry_delisle_PhD/code/runperf.sh (added)
-
doc/theses/thierry_delisle_PhD/code/scale.sh (added)
-
doc/theses/thierry_delisle_PhD/code/snzi-packed.hpp (added)
-
doc/theses/thierry_delisle_PhD/code/snzi.hpp (added)
-
doc/theses/thierry_delisle_PhD/code/snzm.hpp (added)
-
doc/theses/thierry_delisle_PhD/code/utils.hpp (added)
-
doc/theses/thierry_delisle_PhD/code/work_stealing.hpp (added)
-
doc/user/user.tex (modified) (17 diffs)
-
libcfa/src/Makefile.am (modified) (2 diffs)
-
libcfa/src/concurrency/clib/cfathread.cfa (deleted)
-
libcfa/src/concurrency/clib/cfathread.h (deleted)
-
libcfa/src/concurrency/io/setup.cfa (modified) (1 diff)
-
libcfa/src/concurrency/kernel.cfa (modified) (6 diffs)
-
libcfa/src/concurrency/kernel.hfa (modified) (1 diff)
-
libcfa/src/concurrency/kernel/startup.cfa (modified) (1 diff)
-
libcfa/src/concurrency/preemption.cfa (modified) (1 diff)
-
libcfa/src/parseargs.cfa (modified) (1 diff)
-
tests/.expect/array.txt (modified) (1 diff)
-
tests/.expect/cast.txt (modified) (1 diff)
-
tests/.expect/enum.txt (modified) (1 diff)
-
tests/.expect/expression.txt (modified) (1 diff)
-
tests/.expect/forall.txt (modified) (1 diff)
-
tests/.expect/heap.txt (modified) (1 diff)
-
tests/.expect/identFuncDeclarator.txt (modified) (1 diff)
-
tests/.expect/identParamDeclarator.txt (modified) (1 diff)
-
tests/.expect/labelledExit.txt (modified) (1 diff)
-
tests/.expect/limits.txt (modified) (1 diff)
-
tests/.expect/maybe.txt (modified) (1 diff)
-
tests/.expect/nested-types.txt (modified) (1 diff)
-
tests/.expect/numericConstants.txt (modified) (1 diff)
-
tests/.expect/operators.txt (modified) (1 diff)
-
tests/.expect/result.txt (modified) (1 diff)
-
tests/.expect/stdincludes.txt (modified) (1 diff)
-
tests/.expect/switch.txt (modified) (1 diff)
-
tests/.expect/typedefRedef-ERR1.txt (modified) (1 diff)
-
tests/.expect/typedefRedef.txt (modified) (1 diff)
-
tests/.expect/typeof.txt (modified) (1 diff)
-
tests/.expect/variableDeclarator.txt (modified) (1 diff)
-
tests/.expect/voidPtr.txt (modified) (1 diff)
-
tests/Makefile.am (modified) (4 diffs)
-
tests/array.cfa (modified) (2 diffs)
-
tests/bugs/196.cfa (deleted)
-
tests/builtins/.expect/sync.txt (modified) (1 diff)
-
tests/builtins/sync.cfa (modified) (2 diffs)
-
tests/cast.cfa (modified) (1 diff)
-
tests/concurrent/.expect/clib.txt (deleted)
-
tests/concurrent/.expect/cluster.txt (modified) (1 diff)
-
tests/concurrent/clib.c (deleted)
-
tests/concurrent/cluster.cfa (modified) (1 diff)
-
tests/concurrent/examples/.expect/datingService.txt (modified) (1 diff)
-
tests/concurrent/examples/datingService.cfa (modified) (2 diffs)
-
tests/concurrent/futures/.expect/basic.txt (modified) (1 diff)
-
tests/concurrent/futures/basic.cfa (modified) (1 diff)
-
tests/concurrent/park/.expect/force_preempt.txt (modified) (1 diff)
-
tests/concurrent/park/.expect/start_parked.txt (modified) (1 diff)
-
tests/concurrent/park/force_preempt.cfa (modified) (1 diff)
-
tests/concurrent/park/start_parked.cfa (modified) (1 diff)
-
tests/enum.cfa (modified) (1 diff)
-
tests/exceptions/.expect/virtual-cast.txt (modified) (1 diff)
-
tests/exceptions/.expect/virtual-poly.txt (modified) (1 diff)
-
tests/exceptions/virtual-cast.cfa (modified) (1 diff)
-
tests/exceptions/virtual-poly.cfa (modified) (1 diff)
-
tests/expression.cfa (modified) (1 diff)
-
tests/forall.cfa (modified) (3 diffs)
-
tests/heap.cfa (modified) (2 diffs)
-
tests/identFuncDeclarator.cfa (modified) (2 diffs)
-
tests/identParamDeclarator.cfa (modified) (2 diffs)
-
tests/labelledExit.cfa (modified) (2 diffs)
-
tests/limits.cfa (modified) (2 diffs)
-
tests/linking/.expect/linkerror.txt (added)
-
tests/linking/linkerror.cfa (added)
-
tests/maybe.cfa (modified) (2 diffs)
-
tests/nested-types.cfa (modified) (2 diffs)
-
tests/numericConstants.cfa (modified) (2 diffs)
-
tests/operators.cfa (modified) (1 diff)
-
tests/pybin/tools.py (modified) (1 diff)
-
tests/raii/.expect/ctor-autogen.txt (modified) (1 diff)
-
tests/raii/.expect/init_once.txt (modified) (1 diff)
-
tests/raii/ctor-autogen.cfa (modified) (1 diff)
-
tests/raii/init_once.cfa (modified) (2 diffs)
-
tests/result.cfa (modified) (2 diffs)
-
tests/stdincludes.cfa (modified) (2 diffs)
-
tests/switch.cfa (modified) (2 diffs)
-
tests/test.py (modified) (3 diffs)
-
tests/typedefRedef.cfa (modified) (2 diffs)
-
tests/typeof.cfa (modified) (1 diff)
-
tests/variableDeclarator.cfa (modified) (8 diffs)
-
tests/voidPtr.cfa (modified) (1 diff)
-
tests/warnings/.expect/self-assignment.txt (modified) (1 diff)
-
tests/warnings/self-assignment.cfa (modified) (2 diffs)
-
tests/zombies/structMember.cfa (modified) (2 diffs)
-
tools/gdb/utils-gdb.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/concurrency/Paper.tex
r08e8851 r2ff78aae 450 450 \hline 451 451 stateful & thread & \multicolumn{1}{c|}{No} & \multicolumn{1}{c}{Yes} \\ 452 \hline 453 \hline 452 \hline 453 \hline 454 454 No & No & \textbf{1}\ \ \ @struct@ & \textbf{2}\ \ \ @mutex@ @struct@ \\ 455 \hline 455 \hline 456 456 Yes (stackless) & No & \textbf{3}\ \ \ @generator@ & \textbf{4}\ \ \ @mutex@ @generator@ \\ 457 \hline 457 \hline 458 458 Yes (stackful) & No & \textbf{5}\ \ \ @coroutine@ & \textbf{6}\ \ \ @mutex@ @coroutine@ \\ 459 \hline 459 \hline 460 460 No & Yes & \textbf{7}\ \ \ {\color{red}rejected} & \textbf{8}\ \ \ {\color{red}rejected} \\ 461 \hline 461 \hline 462 462 Yes (stackless) & Yes & \textbf{9}\ \ \ {\color{red}rejected} & \textbf{10}\ \ \ {\color{red}rejected} \\ 463 \hline 463 \hline 464 464 Yes (stackful) & Yes & \textbf{11}\ \ \ @thread@ & \textbf{12}\ \ @mutex@ @thread@ \\ 465 465 \end{tabular} … … 3042 3042 Rust tokio thread & 1860.0 & 1881.1 & 37.6 \\ 3043 3043 Rust thread & 53801.0 & 53896.8 & 274.9 \\ 3044 Java thread ( 10 000) & 119256.0 & 119679.2 & 2244.0 \\ 3045 Java thread (1 000 000) & 123100.0 & 123052.5 & 751.6 \\ 3044 Java thread & 120274.0 & 120722.9 & 2356.7 \\ 3046 3045 Pthreads thread & 31465.5 & 31419.5 & 140.4 3047 3046 \end{tabular} … … 3098 3097 \uC @signal@ monitor & 328.3 & 327.4 & 2.4 \\ 3099 3098 Rust cond. variable & 7514.0 & 7437.4 & 397.2 \\ 3100 Java @notify@ monitor ( 1 000 000) & 8717.0 & 8774.1 & 471.8 \\ 3101 Java @notify@ monitor (100 000 000) & 8634.0 & 8683.5 & 330.5 \\ 3099 Java @notify@ monitor & 9623.0 & 9654.6 & 236.2 \\ 3102 3100 Pthreads cond. variable & 5553.7 & 5576.1 & 345.6 3103 3101 \end{tabular} … … 3183 3181 Goroutine mutex lock & 34.0 & 34.0 & 0.0 \\ 3184 3182 Rust mutex lock & 33.0 & 33.2 & 0.8 \\ 3185 Java synchronized method ( 100 000 000) & 31.0 & 30.9 & 0.5 \\ 3186 Java synchronized method (10 000 000 000) & 31.0 & 30.2 & 0.9 \\ 3183 Java synchronized method & 31.0 & 31.0 & 0.0 \\ 3187 3184 Pthreads mutex Lock & 31.0 & 31.1 & 0.4 3188 3185 \end{tabular} … … 3204 3201 % To: "Peter A. Buhr" <pabuhr@plg2.cs.uwaterloo.ca> 3205 3202 % Date: Fri, 24 Jan 2020 13:49:18 -0500 3206 % 3203 % 3207 3204 % I can also verify that the previous version, which just tied a bunch of promises together, *does not* go back to the 3208 3205 % event loop at all in the current version of Node. Presumably they're taking advantage of the fact that the ordering of … … 3251 3248 Rust tokio thread & 143.0 & 143.0 & 1.7 \\ 3252 3249 Rust thread & 332.0 & 331.4 & 2.4 \\ 3253 Java thread ( 100 000) & 405.0 & 415.0 & 17.6 \\ 3254 Java thread ( 100 000 000) & 413.0 & 414.2 & 6.2 \\ 3255 Java thread (5 000 000 000) & 415.0 & 415.2 & 6.1 \\ 3250 Java thread & 405.0 & 415.0 & 17.6 \\ 3256 3251 Pthreads thread & 334.3 & 335.2 & 3.9 3257 3252 \end{tabular} -
doc/refrat/refrat.tex
r08e8851 r2ff78aae 11 11 %% Created On : Wed Apr 6 14:52:25 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Thu Sep 24 16:34:51 202014 %% Update Count : 10 913 %% Last Modified On : Wed Jan 31 17:30:23 2018 14 %% Update Count : 108 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 30 30 \usepackage{upquote} % switch curled `'" to straight 31 31 \usepackage{calc} 32 \usepackage{xspace} 32 33 \usepackage{varioref} % extended references 34 \usepackage{listings} % format program code 33 35 \usepackage[flushmargin]{footmisc} % support label/reference in footnote 34 36 \usepackage{latexsym} % \Box glyph 35 37 \usepackage{mathptmx} % better math font with "times" 36 38 \usepackage[usenames]{color} 37 \newcommand{\CFALatin}{} 39 \input{common} % common CFA document macros 40 \usepackage[dvips,plainpages=false,pdfpagelabels,pdfpagemode=UseNone,colorlinks=true,pagebackref=true,linkcolor=blue,citecolor=blue,urlcolor=blue,pagebackref=true,breaklinks=true]{hyperref} 41 \usepackage{breakurl} 42 \renewcommand{\UrlFont}{\small\sf} 43 44 \usepackage[pagewise]{lineno} 45 \renewcommand{\linenumberfont}{\scriptsize\sffamily} 46 \usepackage[firstpage]{draftwatermark} 47 \SetWatermarkLightness{0.9} 48 49 % Default underscore is too low and wide. Cannot use lstlisting "literate" as replacing underscore 50 % removes it as a variable-name character so keywords in variables are highlighted. MUST APPEAR 51 % AFTER HYPERREF. 52 \renewcommand{\textunderscore}{\leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.075ex}}} 53 54 \setlength{\topmargin}{-0.45in} % move running title into header 55 \setlength{\headsep}{0.25in} 56 57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 58 59 \CFAStyle % use default CFA format-style 60 \lstnewenvironment{C++}[1][] % use C++ style 61 {\lstset{language=C++,moredelim=**[is][\protect\color{red}]{®}{®}#1}} 62 {} 63 38 64 % inline code ©...© (copyright symbol) emacs: C-q M-) 39 65 % red highlighting ®...® (registered trademark symbol) emacs: C-q M-. … … 43 69 % keyword escape ¶...¶ (pilcrow symbol) emacs: C-q M-^ 44 70 % math escape $...$ (dollar symbol) 45 \input{common} % common CFA document macros46 \usepackage[dvips,plainpages=false,pdfpagelabels,pdfpagemode=UseNone,colorlinks=true,pagebackref=true,linkcolor=blue,citecolor=blue,urlcolor=blue,pagebackref=true,breaklinks=true]{hyperref}47 \usepackage{breakurl}48 \renewcommand{\UrlFont}{\small\sf}49 50 \usepackage[pagewise]{lineno}51 \renewcommand{\linenumberfont}{\scriptsize\sffamily}52 \usepackage[firstpage]{draftwatermark}53 \SetWatermarkLightness{0.9}54 55 % Default underscore is too low and wide. Cannot use lstlisting "literate" as replacing underscore56 % removes it as a variable-name character so keywords in variables are highlighted. MUST APPEAR57 % AFTER HYPERREF.58 \renewcommand{\textunderscore}{\leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.075ex}}}59 60 \setlength{\topmargin}{-0.45in} % move running title into header61 \setlength{\headsep}{0.25in}62 71 63 72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 64 73 65 \CFADefaults % use default CFA format-style66 \lstnewenvironment{C++}[1][] % use C++ style67 {\lstset{language=C++,moredelim=**[is][\protect\color{red}]{®}{®},#1}}68 {}69 70 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%71 72 74 % Names used in the document. 73 \newcommand{\Version}{\input{ build/version}}75 \newcommand{\Version}{\input{../../version}} 74 76 \newcommand{\Textbf}[2][red]{{\color{#1}{\textbf{#2}}}} 75 77 \newcommand{\Emph}[2][red]{{\color{#1}\textbf{\emph{#2}}}} -
doc/theses/andrew_beach_MMath/thesis.tex
r08e8851 r2ff78aae 34 34 \usepackage[toc,abbreviations]{glossaries-extra} 35 35 36 % Define all the glossaries. 37 \input{glossaries} 36 % Main glossary entries -- definitions of relevant terminology 37 \newglossaryentry{computer} 38 { 39 name=computer, 40 description={A programmable machine that receives input data, 41 stores and manipulates the data, and provides 42 formatted output} 43 } 44 45 % Nomenclature glossary entries -- New definitions, or unusual terminology 46 \newglossary*{nomenclature}{Nomenclature} 47 \newglossaryentry{dingledorf} 48 { 49 type=nomenclature, 50 name=dingledorf, 51 description={A person of supposed average intelligence who makes incredibly 52 brainless misjudgments} 53 } 54 55 % List of Abbreviations (abbreviations are from the glossaries-extra package) 56 \newabbreviation{aaaaz}{AAAAZ}{American Association of Amature Astronomers 57 and Zoologists} 58 59 % List of Symbols 60 \newglossary*{symbols}{List of Symbols} 61 \newglossaryentry{rvec} 62 { 63 name={$\mathbf{v}$}, 64 sort={label}, 65 type=symbols, 66 description={Random vector: a location in n-dimensional Cartesian space, where 67 each dimensional component is determined by a random process} 68 } 38 69 39 70 % Generate the glossaries defined above. -
doc/user/user.tex
r08e8851 r2ff78aae 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Thu Sep 24 16:34:52 202014 %% Update Count : 39 9713 %% Last Modified On : Fri Mar 6 13:34:52 2020 14 %% Update Count : 3924 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 30 30 \usepackage{upquote} % switch curled `'" to straight 31 31 \usepackage{calc} 32 \usepackage{xspace} 32 33 \usepackage{varioref} % extended references 33 \usepackage[labelformat=simple,aboveskip=0pt,farskip=0pt]{subfig} 34 \renewcommand{\thesubfigure}{\alph{subfigure})} 34 \usepackage{listings} % format program code 35 35 \usepackage[flushmargin]{footmisc} % support label/reference in footnote 36 36 \usepackage{latexsym} % \Box glyph 37 37 \usepackage{mathptmx} % better math font with "times" 38 38 \usepackage[usenames]{color} 39 \newcommand{\CFALatin}{} 39 \input{common} % common CFA document macros 40 \usepackage[dvips,plainpages=false,pdfpagelabels,pdfpagemode=UseNone,colorlinks=true,pagebackref=true,linkcolor=blue,citecolor=blue,urlcolor=blue,pagebackref=true,breaklinks=true]{hyperref} 41 \usepackage{breakurl} 42 43 \usepackage[pagewise]{lineno} 44 \renewcommand{\linenumberfont}{\scriptsize\sffamily} 45 \usepackage[firstpage]{draftwatermark} 46 \SetWatermarkLightness{0.9} 47 48 % Default underscore is too low and wide. Cannot use lstlisting "literate" as replacing underscore 49 % removes it as a variable-name character so keywords in variables are highlighted. MUST APPEAR 50 % AFTER HYPERREF. 51 \renewcommand{\textunderscore}{\leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.075ex}}} 52 53 \setlength{\topmargin}{-0.45in} % move running title into header 54 \setlength{\headsep}{0.25in} 55 56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 57 58 \CFAStyle % use default CFA format-style 59 \lstnewenvironment{C++}[1][] % use C++ style 60 {\lstset{language=C++,moredelim=**[is][\protect\color{red}]{®}{®},#1}} 61 {} 62 40 63 % inline code ©...© (copyright symbol) emacs: C-q M-) 41 64 % red highlighting ®...® (registered trademark symbol) emacs: C-q M-. … … 45 68 % keyword escape ¶...¶ (pilcrow symbol) emacs: C-q M-^ 46 69 % math escape $...$ (dollar symbol) 47 \input{common} % common CFA document macros48 \usepackage[dvips,plainpages=false,pdfpagelabels,pdfpagemode=UseNone,colorlinks=true,pagebackref=true,linkcolor=blue,citecolor=blue,urlcolor=blue,pagebackref=true,breaklinks=true]{hyperref}49 \usepackage{breakurl}50 51 \renewcommand\footnoterule{\kern -3pt\rule{0.3\linewidth}{0.15pt}\kern 2pt}52 53 \usepackage[pagewise]{lineno}54 \renewcommand{\linenumberfont}{\scriptsize\sffamily}55 \usepackage[firstpage]{draftwatermark}56 \SetWatermarkLightness{0.9}57 58 % Default underscore is too low and wide. Cannot use lstlisting "literate" as replacing underscore59 % removes it as a variable-name character so keywords in variables are highlighted. MUST APPEAR60 % AFTER HYPERREF.61 \renewcommand{\textunderscore}{\leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.075ex}}}62 63 \setlength{\topmargin}{-0.45in} % move running title into header64 \setlength{\headsep}{0.25in}65 66 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%67 68 \CFADefaults % use default CFA format-style69 \lstnewenvironment{C++}[1][] % use C++ style70 {\lstset{language=C++,moredelim=**[is][\protect\color{red}]{®}{®},#1}}71 {}72 73 \newsavebox{\myboxA}74 \newsavebox{\myboxB}75 70 76 71 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 84 79 \newcommand{\G}[1]{{\Textbf[OliveGreen]{#1}}} 85 80 \newcommand{\KWC}{K-W C\xspace} 81 82 \newsavebox{\LstBox} 86 83 87 84 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 256 253 257 254 The signature feature of \CFA is \emph{\Index{overload}able} \Index{parametric-polymorphic} functions~\cite{forceone:impl,Cormack90,Duggan96} with functions generalized using a ©forall© clause (giving the language its name): 258 \begin{ cfa}255 \begin{lstlisting} 259 256 ®forall( otype T )® T identity( T val ) { return val; } 260 257 int forty_two = identity( 42 ); §\C{// T is bound to int, forty\_two == 42}§ 261 \end{ cfa}258 \end{lstlisting} 262 259 % extending the C type system with parametric polymorphism and overloading, as opposed to the \Index*[C++]{\CC{}} approach of object-oriented extensions. 263 260 \CFA{}\hspace{1pt}'s polymorphism was originally formalized by \Index*{Glen Ditchfield}\index{Ditchfield, Glen}~\cite{Ditchfield92}, and first implemented by \Index*{Richard Bilson}\index{Bilson, Richard}~\cite{Bilson03}. … … 278 275 \begin{comment} 279 276 A simple example is leveraging the existing type-unsafe (©void *©) C ©bsearch© to binary search a sorted floating array: 280 \begin{ cfa}277 \begin{lstlisting} 281 278 void * bsearch( const void * key, const void * base, size_t dim, size_t size, 282 279 int (* compar)( const void *, const void * )); … … 287 284 double key = 5.0, vals[10] = { /* 10 sorted floating values */ }; 288 285 double * val = (double *)bsearch( &key, vals, 10, sizeof(vals[0]), comp ); §\C{// search sorted array}§ 289 \end{ cfa}286 \end{lstlisting} 290 287 which can be augmented simply with a polymorphic, type-safe, \CFA-overloaded wrappers: 291 \begin{ cfa}288 \begin{lstlisting} 292 289 forall( otype T | { int ?<?( T, T ); } ) T * bsearch( T key, const T * arr, size_t size ) { 293 290 int comp( const void * t1, const void * t2 ) { /* as above with double changed to T */ } … … 300 297 double * val = bsearch( 5.0, vals, 10 ); §\C{// selection based on return type}§ 301 298 int posn = bsearch( 5.0, vals, 10 ); 302 \end{ cfa}299 \end{lstlisting} 303 300 The nested function ©comp© provides the hidden interface from typed \CFA to untyped (©void *©) C, plus the cast of the result. 304 301 Providing a hidden ©comp© function in \CC is awkward as lambdas do not use C calling-conventions and template declarations cannot appear at block scope. … … 308 305 \CFA has replacement libraries condensing hundreds of existing C functions into tens of \CFA overloaded functions, all without rewriting the actual computations. 309 306 For example, it is possible to write a type-safe \CFA wrapper ©malloc© based on the C ©malloc©: 310 \begin{ cfa}307 \begin{lstlisting} 311 308 forall( dtype T | sized(T) ) T * malloc( void ) { return (T *)malloc( sizeof(T) ); } 312 309 int * ip = malloc(); §\C{// select type and size from left-hand side}§ 313 310 double * dp = malloc(); 314 311 struct S {...} * sp = malloc(); 315 \end{ cfa}312 \end{lstlisting} 316 313 where the return type supplies the type/size of the allocation, which is impossible in most type systems. 317 314 \end{comment} … … 946 943 the same level as a ©case© clause; the target label may be case ©default©, but only associated 947 944 with the current ©switch©/©choose© statement. 945 946 947 \subsection{Loop Control} 948 949 The ©for©/©while©/©do-while© loop-control allows empty or simplified ranges (see Figure~\ref{f:LoopControlExamples}). 950 \begin{itemize} 951 \item 952 The loop index is polymorphic in the type of the comparison value N (when the start value is implicit) or the start value M. 953 \item 954 An empty conditional implies comparison value of ©1© (true). 955 \item 956 A comparison N is implicit up-to exclusive range [0,N©®)®©. 957 \item 958 A comparison ©=© N is implicit up-to inclusive range [0,N©®]®©. 959 \item 960 The up-to range M ©~©\index{~@©~©} N means exclusive range [M,N©®)®©. 961 \item 962 The up-to range M ©~=©\index{~=@©~=©} N means inclusive range [M,N©®]®©. 963 \item 964 The down-to range M ©-~©\index{-~@©-~©} N means exclusive range [N,M©®)®©. 965 \item 966 The down-to range M ©-~=©\index{-~=@©-~=©} N means inclusive range [N,M©®]®©. 967 \item 968 ©0© is the implicit start value; 969 \item 970 ©1© is the implicit increment value. 971 \item 972 The up-to range uses operator ©+=© for increment; 973 \item 974 The down-to range uses operator ©-=© for decrement. 975 \item 976 ©@© means put nothing in this field. 977 \item 978 ©:© means start another index. 979 \end{itemize} 948 980 949 981 \begin{figure} … … 1054 1086 1055 1087 1056 \subsection{Loop Control}1057 1058 The ©for©/©while©/©do-while© loop-control allows empty or simplified ranges (see Figure~\ref{f:LoopControlExamples}).1059 \begin{itemize}1060 \item1061 The loop index is polymorphic in the type of the comparison value N (when the start value is implicit) or the start value M.1062 \item1063 An empty conditional implies comparison value of ©1© (true).1064 \item1065 A comparison N is implicit up-to exclusive range [0,N©®)®©.1066 \item1067 A comparison ©=© N is implicit up-to inclusive range [0,N©®]®©.1068 \item1069 The up-to range M ©~©\index{~@©~©} N means exclusive range [M,N©®)®©.1070 \item1071 The up-to range M ©~=©\index{~=@©~=©} N means inclusive range [M,N©®]®©.1072 \item1073 The down-to range M ©-~©\index{-~@©-~©} N means exclusive range [N,M©®)®©.1074 \item1075 The down-to range M ©-~=©\index{-~=@©-~=©} N means inclusive range [N,M©®]®©.1076 \item1077 ©0© is the implicit start value;1078 \item1079 ©1© is the implicit increment value.1080 \item1081 The up-to range uses operator ©+=© for increment;1082 \item1083 The down-to range uses operator ©-=© for decrement.1084 \item1085 ©@© means put nothing in this field.1086 \item1087 ©:© means start another index.1088 \end{itemize}1089 1090 1091 1088 %\subsection{\texorpdfstring{Labelled \protect\lstinline@continue@ / \protect\lstinline@break@}{Labelled continue / break}} 1092 1089 \subsection{\texorpdfstring{Labelled \LstKeywordStyle{continue} / \LstKeywordStyle{break} Statement}{Labelled continue / break Statement}} … … 1098 1095 for ©break©, the target label can also be associated with a ©switch©, ©if© or compound (©{}©) statement. 1099 1096 \VRef[Figure]{f:MultiLevelExit} shows ©continue© and ©break© indicating the specific control structure, and the corresponding C program using only ©goto© and labels. 1100 The innermost loop has 8exit points, which cause continuation or termination of one or more of the 7 \Index{nested control-structure}s.1097 The innermost loop has 7 exit points, which cause continuation or termination of one or more of the 7 \Index{nested control-structure}s. 1101 1098 1102 1099 \begin{figure} 1103 \centering 1104 \begin{lrbox}{\myboxA} 1105 \begin{cfa}[tabsize=3] 1106 ®Compound:® { 1107 ®Try:® try { 1108 ®For:® for ( ... ) { 1109 ®While:® while ( ... ) { 1110 ®Do:® do { 1111 ®If:® if ( ... ) { 1112 ®Switch:® switch ( ... ) { 1113 case 3: 1114 ®break Compound®; 1115 ®break Try®; 1116 ®break For®; /* or */ ®continue For®; 1117 ®break While®; /* or */ ®continue While®; 1118 ®break Do®; /* or */ ®continue Do®; 1119 ®break If®; 1120 ®break Switch®; 1121 } // switch 1122 } else { 1123 ... ®break If®; ... // terminate if 1124 } // if 1125 } while ( ... ); // do 1126 } // while 1127 } // for 1128 } ®finally® { // always executed 1129 } // try 1100 \begin{tabular}{@{\hspace{\parindentlnth}}l@{\hspace{\parindentlnth}}l@{\hspace{\parindentlnth}}l@{}} 1101 \multicolumn{1}{@{\hspace{\parindentlnth}}c@{\hspace{\parindentlnth}}}{\textbf{\CFA}} & \multicolumn{1}{@{\hspace{\parindentlnth}}c}{\textbf{C}} \\ 1102 \begin{cfa} 1103 ®LC:® { 1104 ... §declarations§ ... 1105 ®LS:® switch ( ... ) { 1106 case 3: 1107 ®LIF:® if ( ... ) { 1108 ®LF:® for ( ... ) { 1109 ®LW:® while ( ... ) { 1110 ... break ®LC®; ... 1111 ... break ®LS®; ... 1112 ... break ®LIF®; ... 1113 ... continue ®LF;® ... 1114 ... break ®LF®; ... 1115 ... continue ®LW®; ... 1116 ... break ®LW®; ... 1117 } // while 1118 } // for 1119 } else { 1120 ... break ®LIF®; ... 1121 } // if 1122 } // switch 1130 1123 } // compound 1131 1124 \end{cfa} 1132 \end{lrbox} 1133 1134 \begin{lrbox}{\myboxB} 1135 \begin{cfa}[tabsize=3] 1125 & 1126 \begin{cfa} 1136 1127 { 1137 1138 ®ForC:® for ( ... ) { 1139 ®WhileC:® while ( ... ) { 1140 ®DoC:® do { 1141 if ( ... ) { 1142 switch ( ... ) { 1143 case 3: 1144 ®goto Compound®; 1145 ®goto Try®; 1146 ®goto ForB®; /* or */ ®goto ForC®; 1147 ®goto WhileB®; /* or */ ®goto WhileC®; 1148 ®goto DoB®; /* or */ ®goto DoC®; 1149 ®goto If®; 1150 ®goto Switch®; 1151 } ®Switch:® ; 1152 } else { 1153 ... ®goto If®; ... // terminate if 1154 } ®If:®; 1155 } while ( ... ); ®DoB:® ; 1156 } ®WhileB:® ; 1157 } ®ForB:® ; 1158 1159 1160 } ®Compound:® ; 1161 \end{cfa} 1162 \end{lrbox} 1163 1164 \subfloat[\CFA]{\label{f:CFibonacci}\usebox\myboxA} 1165 \hspace{2pt} 1166 \vrule 1167 \hspace{2pt} 1168 \subfloat[C]{\label{f:CFAFibonacciGen}\usebox\myboxB} 1128 ... §declarations§ ... 1129 switch ( ... ) { 1130 case 3: 1131 if ( ... ) { 1132 for ( ... ) { 1133 while ( ... ) { 1134 ... goto ®LC®; ... 1135 ... goto ®LS®; ... 1136 ... goto ®LIF®; ... 1137 ... goto ®LFC®; ... 1138 ... goto ®LFB®; ... 1139 ... goto ®LWC®; ... 1140 ... goto ®LWB®; ... 1141 ®LWC®: ; } ®LWB:® ; 1142 ®LFC:® ; } ®LFB:® ; 1143 } else { 1144 ... goto ®LIF®; ... 1145 } ®L3:® ; 1146 } ®LS:® ; 1147 } ®LC:® ; 1148 \end{cfa} 1149 & 1150 \begin{cfa} 1151 1152 1153 1154 1155 1156 1157 1158 // terminate compound 1159 // terminate switch 1160 // terminate if 1161 // continue loop 1162 // terminate loop 1163 // continue loop 1164 // terminate loop 1165 1166 1167 1168 // terminate if 1169 1170 1171 1172 \end{cfa} 1173 \end{tabular} 1169 1174 \caption{Multi-level Exit} 1170 1175 \label{f:MultiLevelExit} … … 1421 1426 try { 1422 1427 f(...); 1423 } catch( E e ; §boolean-predicate§ ) { §\C {// termination handler}§1428 } catch( E e ; §boolean-predicate§ ) { §\C[8cm]{// termination handler}§ 1424 1429 // recover and continue 1425 } catchResume( E e ; §boolean-predicate§ ) { §\C{// resumption handler} §1430 } catchResume( E e ; §boolean-predicate§ ) { §\C{// resumption handler}\CRT§ 1426 1431 // repair and return 1427 1432 } finally { … … 3486 3491 For implicit formatted input, the common case is reading a sequence of values separated by whitespace, where the type of an input constant must match with the type of the input variable. 3487 3492 \begin{cquote} 3488 \begin{lrbox}{\ myboxA}3493 \begin{lrbox}{\LstBox} 3489 3494 \begin{cfa}[aboveskip=0pt,belowskip=0pt] 3490 3495 int x; double y char z; … … 3492 3497 \end{lrbox} 3493 3498 \begin{tabular}{@{}l@{\hspace{3em}}l@{\hspace{3em}}l@{}} 3494 \multicolumn{1}{@{}l@{}}{\usebox\ myboxA} \\3499 \multicolumn{1}{@{}l@{}}{\usebox\LstBox} \\ 3495 3500 \multicolumn{1}{c@{\hspace{2em}}}{\textbf{\CFA}} & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{\CC}} & \multicolumn{1}{c}{\textbf{Python}} \\ 3496 3501 \begin{cfa}[aboveskip=0pt,belowskip=0pt] … … 6667 6672 For example, an initial alignment and fill capability are preserved during a resize copy so the copy has the same alignment and extended storage is filled. 6668 6673 Without sticky properties it is dangerous to use ©realloc©, resulting in an idiom of manually performing the reallocation to maintain correctness. 6669 \begin{cfa}6670 6671 \end{cfa}6672 6674 6673 6675 \CFA memory management extends allocation to support constructors for initialization of allocated storage, \eg in … … 6719 6721 6720 6722 // §\CFA§ safe general allocation, fill, resize, alignment, array 6721 T * alloc( void );§\indexc{alloc}§ §\C[3.5in]{// variable, T size}§ 6722 T * alloc( size_t dim ); §\C{// array[dim], T size elements}§ 6723 T * alloc( T ptr[], size_t dim ); §\C{// realloc array[dim], T size elements}§ 6724 6725 T * alloc_set( char fill );§\indexc{alloc_set}§ §\C{// variable, T size, fill bytes with value}§ 6726 T * alloc_set( T fill ); §\C{// variable, T size, fill with value}§ 6727 T * alloc_set( size_t dim, char fill ); §\C{// array[dim], T size elements, fill bytes with value}§ 6728 T * alloc_set( size_t dim, T fill ); §\C{// array[dim], T size elements, fill elements with value}§ 6729 T * alloc_set( size_t dim, const T fill[] ); §\C{// array[dim], T size elements, fill elements with array}§ 6730 T * alloc_set( T ptr[], size_t dim, char fill ); §\C{// realloc array[dim], T size elements, fill bytes with value}§ 6731 6732 T * alloc_align( size_t align ); §\C{// aligned variable, T size}§ 6733 T * alloc_align( size_t align, size_t dim ); §\C{// aligned array[dim], T size elements}§ 6734 T * alloc_align( T ptr[], size_t align ); §\C{// realloc new aligned array}§ 6735 T * alloc_align( T ptr[], size_t align, size_t dim ); §\C{// realloc new aligned array[dim]}§ 6736 6737 T * alloc_align_set( size_t align, char fill ); §\C{// aligned variable, T size, fill bytes with value}§ 6738 T * alloc_align_set( size_t align, T fill ); §\C{// aligned variable, T size, fill with value}§ 6739 T * alloc_align_set( size_t align, size_t dim, char fill ); §\C{// aligned array[dim], T size elements, fill bytes with value}§ 6740 T * alloc_align_set( size_t align, size_t dim, T fill ); §\C{// aligned array[dim], T size elements, fill elements with value}§ 6741 T * alloc_align_set( size_t align, size_t dim, const T fill[] ); §\C{// aligned array[dim], T size elements, fill elements with array}§ 6742 T * alloc_align_set( T ptr[], size_t align, size_t dim, char fill ); §\C{// realloc new aligned array[dim], fill new bytes with value}§ 6723 T * alloc( void );§\indexc{alloc}§ 6724 T * alloc( size_t dim ); 6725 T * alloc( T ptr[], size_t dim ); 6726 T * alloc_set( char fill );§\indexc{alloc_set}§ 6727 T * alloc_set( T fill ); 6728 T * alloc_set( size_t dim, char fill ); 6729 T * alloc_set( size_t dim, T fill ); 6730 T * alloc_set( size_t dim, const T fill[] ); 6731 T * alloc_set( T ptr[], size_t dim, char fill ); 6732 6733 T * alloc_align( size_t align ); 6734 T * alloc_align( size_t align, size_t dim ); 6735 T * alloc_align( T ptr[], size_t align ); // aligned realloc array 6736 T * alloc_align( T ptr[], size_t align, size_t dim ); // aligned realloc array 6737 T * alloc_align_set( size_t align, char fill ); 6738 T * alloc_align_set( size_t align, T fill ); 6739 T * alloc_align_set( size_t align, size_t dim, char fill ); 6740 T * alloc_align_set( size_t align, size_t dim, T fill ); 6741 T * alloc_align_set( size_t align, size_t dim, const T fill[] ); 6742 T * alloc_align_set( T ptr[], size_t align, size_t dim, char fill ); 6743 6743 6744 6744 // §\CFA§ safe initialization/copy, i.e., implicit size specification -
libcfa/src/Makefile.am
r08e8851 r2ff78aae 88 88 inst_thread_headers_nosrc = \ 89 89 bits/random.hfa \ 90 concurrency/clib/cfathread.h \91 90 concurrency/invoke.h \ 92 91 concurrency/kernel/fwd.hfa … … 104 103 concurrency/alarm.cfa \ 105 104 concurrency/alarm.hfa \ 106 concurrency/clib/cfathread.cfa \107 105 concurrency/CtxSwitch-@ARCHITECTURE@.S \ 108 106 concurrency/invoke.c \ -
libcfa/src/concurrency/io/setup.cfa
r08e8851 r2ff78aae 147 147 static void * iopoll_loop( __attribute__((unused)) void * args ) { 148 148 __processor_id_t id; 149 id.full_proc = false;150 149 id.id = doregister(&id); 151 150 __cfaabi_dbg_print_safe( "Kernel : IO poller thread starting\n" ); -
libcfa/src/concurrency/kernel.cfa
r08e8851 r2ff78aae 237 237 $coroutine * proc_cor = get_coroutine(this->runner); 238 238 239 // Update global state 240 kernelTLS.this_thread = thrd_dst; 241 239 242 // set state of processor coroutine to inactive 240 243 verify(proc_cor->state == Active); … … 250 253 thrd_dst->unpark_stale = true; 251 254 ) 252 // Update global state253 kernelTLS.this_thread = thrd_dst;254 255 255 256 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); … … 258 259 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) > ((uintptr_t)__get_stack(thrd_dst->curr_cor)->limit) || thrd_dst->curr_cor == proc_cor, "ERROR : Destination $thread %p has been corrupted.\n StackPointer too large.\n", thrd_dst ); // add escape condition if we are setting up the processor 259 260 260 261 261 // set context switch to the thread that the processor is executing 262 262 verify( thrd_dst->context.SP ); … … 269 269 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 270 270 271 // Reset global state272 kernelTLS.this_thread = 0p;273 271 274 272 // We just finished running a thread, there are a few things that could have happened. … … 315 313 // Just before returning to the processor, set the processor coroutine to active 316 314 proc_cor->state = Active; 315 kernelTLS.this_thread = 0p; 317 316 318 317 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); … … 522 521 disable_interrupts(); 523 522 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 524 post( this->idle );523 bool ret = post( this->idle ); 525 524 enable_interrupts( __cfaabi_dbg_ctx ); 526 525 } -
libcfa/src/concurrency/kernel.hfa
r08e8851 r2ff78aae 48 48 // Processor id, required for scheduling threads 49 49 struct __processor_id_t { 50 unsigned id:24; 51 bool full_proc:1; 50 unsigned id; 52 51 53 52 #if !defined(__CFA_NO_STATISTICS__) -
libcfa/src/concurrency/kernel/startup.cfa
r08e8851 r2ff78aae 470 470 this.name = name; 471 471 this.cltr = &_cltr; 472 full_proc = true;472 id = -1u; 473 473 destroyer = 0p; 474 474 do_terminate = false; -
libcfa/src/concurrency/preemption.cfa
r08e8851 r2ff78aae 411 411 static void * alarm_loop( __attribute__((unused)) void * args ) { 412 412 __processor_id_t id; 413 id.full_proc = false;414 413 id.id = doregister(&id); 415 414 -
libcfa/src/parseargs.cfa
r08e8851 r2ff78aae 25 25 #include "limits.hfa" 26 26 27 extern int cfa_args_argc __attribute__((weak));28 extern char ** cfa_args_argv __attribute__((weak));29 extern char ** cfa_args_envp __attribute__((weak));27 extern int cfa_args_argc; 28 extern char ** cfa_args_argv; 29 extern char ** cfa_args_envp; 30 30 31 31 static void usage(char * cmd, cfa_option options[], size_t opt_count, const char * usage, FILE * out) __attribute__ ((noreturn)); 32 32 33 33 void parse_args( cfa_option options[], size_t opt_count, const char * usage, char ** & left ) { 34 if( 0p != &cfa_args_argc ) { 35 parse_args(cfa_args_argc, cfa_args_argv, options, opt_count, usage, left ); 36 } 37 else { 38 char * temp = ""; 39 parse_args(0, &temp, options, opt_count, usage, left ); 40 } 34 parse_args(cfa_args_argc, cfa_args_argv, options, opt_count, usage, left ); 41 35 } 42 36 -
tests/.expect/array.txt
r08e8851 r2ff78aae 1 array.cfa: In function '_X4mainFi___1':2 array.cfa:54:9: note: #pragma message: Compiled -
tests/.expect/cast.txt
r08e8851 r2ff78aae 1 cast.cfa: In function '_X4mainFi_iPPKc__1':2 cast.cfa:18:9: note: #pragma message: Compiled -
tests/.expect/enum.txt
r08e8851 r2ff78aae 1 done -
tests/.expect/expression.txt
r08e8851 r2ff78aae 1 expression.cfa: In function '_X4mainFi___1':2 expression.cfa:88:9: note: #pragma message: Compiled -
tests/.expect/forall.txt
r08e8851 r2ff78aae 1 forall.cfa: In function '_X4mainFi___1':2 forall.cfa:218:9: note: #pragma message: Compiled -
tests/.expect/heap.txt
r08e8851 r2ff78aae 1 done -
tests/.expect/identFuncDeclarator.txt
r08e8851 r2ff78aae 1 identFuncDeclarator.cfa: In function '_X4mainFi___1':2 identFuncDeclarator.cfa:116:9: note: #pragma message: Compiled -
tests/.expect/identParamDeclarator.txt
r08e8851 r2ff78aae 1 done -
tests/.expect/labelledExit.txt
r08e8851 r2ff78aae 1 labelledExit.cfa: In function '_X4mainFi_iPPKc__1':2 labelledExit.cfa:183:9: note: #pragma message: Compiled -
tests/.expect/limits.txt
r08e8851 r2ff78aae 1 limits.cfa: In function '_X4mainFi_iPPKc__1':2 limits.cfa:151:9: note: #pragma message: Compiled -
tests/.expect/maybe.txt
r08e8851 r2ff78aae 1 done -
tests/.expect/nested-types.txt
r08e8851 r2ff78aae 1 nested-types.cfa: In function '_X4mainFi___1':2 nested-types.cfa:102:9: note: #pragma message: Compiled -
tests/.expect/numericConstants.txt
r08e8851 r2ff78aae 1 numericConstants.cfa: In function '_X4mainFi___1':2 numericConstants.cfa:68:9: note: #pragma message: Compiled -
tests/.expect/operators.txt
r08e8851 r2ff78aae 1 done -
tests/.expect/result.txt
r08e8851 r2ff78aae 1 done -
tests/.expect/stdincludes.txt
r08e8851 r2ff78aae 1 stdincludes.cfa: In function '_X4mainFi___1':2 stdincludes.cfa:52:9: note: #pragma message: Compiled -
tests/.expect/switch.txt
r08e8851 r2ff78aae 1 switch.cfa: In function '_X4mainFi___1':2 switch.cfa:105:9: note: #pragma message: Compiled -
tests/.expect/typedefRedef-ERR1.txt
r08e8851 r2ff78aae 1 1 typedefRedef.cfa:4:1 error: Cannot redefine typedef: Foo 2 typedefRedef.cfa: 59:1 error: Cannot redefine typedef: ARR2 typedefRedef.cfa:60:1 error: Cannot redefine typedef: ARR -
tests/.expect/typedefRedef.txt
r08e8851 r2ff78aae 1 typedefRedef.cfa: In function '_X4mainFi___1':2 typedefRedef.cfa:71:9: note: #pragma message: Compiled -
tests/.expect/typeof.txt
r08e8851 r2ff78aae 1 done -
tests/.expect/variableDeclarator.txt
r08e8851 r2ff78aae 1 variableDeclarator.cfa: In function '_X4mainFi_iPPKc__1':2 variableDeclarator.cfa:182:9: note: #pragma message: Compiled -
tests/.expect/voidPtr.txt
r08e8851 r2ff78aae 1 done -
tests/Makefile.am
r08e8851 r2ff78aae 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Sun Sep 27 19:01:41 202014 ## Update Count : 8413 ## Last Modified On : Tue Nov 20 11:18:51 2018 14 ## Update Count : 68 15 15 ############################################################################### 16 16 … … 40 40 -fdebug-prefix-map=$(abspath ${abs_srcdir})= \ 41 41 -fdebug-prefix-map=/tmp= \ 42 -fno-diagnostics-show-caret \43 42 -g \ 44 43 -Wall \ … … 53 52 54 53 # adjust CC to current flags 55 CC = LC_ALL=C$(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})54 CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS}) 56 55 CFACC = $(CC) 57 56 … … 134 133 $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@}) 135 134 135 # Use for tests where the make command is expected to succeed but the expected.txt should be compared to stderr 136 EXPECT_STDERR = builtins/sync warnings/self-assignment 137 $(EXPECT_STDERR): % : %.cfa $(CFACCBIN) 138 $(CFACOMPILETEST) -c -fsyntax-only 2> $(abspath ${@}) 139 136 140 #------------------------------------------------------------------------------ 137 141 # CUSTOM TARGET 138 142 #------------------------------------------------------------------------------ 139 # tests that just validate syntax and compiler output should be compared to stderr 140 CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath ${@}) 141 142 SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator forall \ 143 limits nested-types stdincludes cast labelledExit array builtins/sync warnings/self-assignment 144 $(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN) 145 $(CFACOMPILE_SYNTAX) 146 $(if $(test), cp $(test) $(abspath ${@}), ) 143 # tests that just validate syntax 144 expression : expression.cfa $(CFACCBIN) 145 $(CFACOMPILETEST) -c -fsyntax-only 2> $(abspath ${@}) 147 146 148 147 # expected failures 149 # use custom target since they require a custom define *and* have a name that doesn't match the file148 # use custom target since they require a custom define and custom dependencies 150 149 alloc-ERROR : alloc.cfa $(CFACCBIN) 151 $(CFACOMPILE_SYNTAX) -DERR1 152 -cp $(test) $(abspath ${@}) 150 $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@}) 153 151 154 152 typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN) 155 $(CFACOMPILE_SYNTAX) -DERR1 156 -cp $(test) $(abspath ${@}) 153 $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@}) 157 154 158 155 nested-types-ERR1 : nested-types.cfa $(CFACCBIN) 159 $(CFACOMPILE_SYNTAX) -DERR1 160 -cp $(test) $(abspath ${@}) 156 $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@}) 161 157 162 158 nested-types-ERR2 : nested-types.cfa $(CFACCBIN) 163 $(CFACOMPILE_SYNTAX) -DERR2 164 -cp $(test) $(abspath ${@}) 159 $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@}) 165 160 166 161 raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN) 167 $(CFACOMPILE_SYNTAX) -DERR1 168 -cp $(test) $(abspath ${@}) 162 $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@}) 169 163 170 164 raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN) 171 $(CFACOMPILE_SYNTAX) -DERR1 172 -cp $(test) $(abspath ${@}) 165 $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@}) 173 166 174 167 raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN) 175 $(CFACOMPILE_SYNTAX) -DERR1 176 -cp $(test) $(abspath ${@}) 168 $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@}) 177 169 178 170 raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN) 179 $(CFACOMPILE_SYNTAX) -DERR2 180 -cp $(test) $(abspath ${@}) 171 $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@}) 181 172 182 173 # Exception Tests -
tests/array.cfa
r08e8851 r2ff78aae 11 11 // Created On : Tue Feb 19 21:18:06 2019 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Sun Sep 27 09:05:40 202014 // Update Count : 413 // Last Modified On : Tue Feb 19 21:18:46 2019 14 // Update Count : 1 15 15 // 16 16 17 int a1[ 0];17 int a1[]; 18 18 //int a2[*]; 19 19 //double a4[3.0]; 20 20 21 int m1[ 0][3];21 int m1[][3]; 22 22 //int m2[*][*]; 23 23 int m4[3][3]; … … 49 49 } 50 50 51 int main() { 52 #pragma message( "Compiled" ) // force non-empty .expect file 53 } 51 int main() {} 54 52 55 53 // Local Variables: // -
tests/builtins/.expect/sync.txt
r08e8851 r2ff78aae 1 builtins/sync.cfa: In function '_X4mainFi___1':2 builtins/sync.cfa:358:9: note: #pragma message: Compiled -
tests/builtins/sync.cfa
r08e8851 r2ff78aae 66 66 #if defined(__SIZEOF_INT128__) 67 67 { __int128 ret; ret = __sync_fetch_and_nand(vplll, vlll); } 68 { __int128 ret; ret = __sync_fetch_and_nand_16(vplll, vlll); } 68 69 #endif 69 70 … … 354 355 355 356 int main() { 356 #pragma message( "Compiled" ) // force non-empty .expect file357 return 0; 357 358 } -
tests/cast.cfa
r08e8851 r2ff78aae 13 13 14 14 //Dummy main 15 int main( int argc, char const * argv[] ) { 16 #pragma message( "Compiled" ) // force non-empty .expect file 15 int main(int argc, char const *argv[]) 16 { 17 return 0; 17 18 } -
tests/concurrent/.expect/cluster.txt
r08e8851 r2ff78aae 1 done -
tests/concurrent/cluster.cfa
r08e8851 r2ff78aae 32 32 } 33 33 } 34 printf( "done\n" ); // non-empty .expect file34 return 0; 35 35 } -
tests/concurrent/examples/.expect/datingService.txt
r08e8851 r2ff78aae 1 done -
tests/concurrent/examples/datingService.cfa
r08e8851 r2ff78aae 10 10 // Created On : Mon Oct 30 12:56:20 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 27 15:42:25 202013 // Update Count : 4012 // Last Modified On : Fri Jun 21 11:32:34 2019 13 // Update Count : 38 14 14 // 15 15 … … 108 108 if ( girlck[ boyck[i] ] != boyck[ girlck[i] ] ) abort(); 109 109 } // for 110 111 printf( "done\n" ); // non-empty .expect file112 110 } // main 113 111 -
tests/concurrent/futures/.expect/basic.txt
r08e8851 r2ff78aae 1 done -
tests/concurrent/futures/basic.cfa
r08e8851 r2ff78aae 91 91 } 92 92 } 93 printf( "done\n" ); // non-empty .expect file94 95 93 } -
tests/concurrent/park/.expect/force_preempt.txt
r08e8851 r2ff78aae 1 done -
tests/concurrent/park/.expect/start_parked.txt
r08e8851 r2ff78aae 1 done -
tests/concurrent/park/force_preempt.cfa
r08e8851 r2ff78aae 57 57 Waiter waiters[5]; 58 58 } 59 printf( "done\n" ); // non-empty .expect file60 59 } -
tests/concurrent/park/start_parked.cfa
r08e8851 r2ff78aae 3 3 thread Parker {}; 4 4 void main( Parker & ) { 5 park( __cfaabi_dbg_ctx );5 park( __cfaabi_dbg_ctx ); 6 6 } 7 7 8 8 int main() { 9 for(1000) { 10 Parker parker; 11 unpark( parker __cfaabi_dbg_ctx2 ); 12 } 13 printf( "done\n" ); // non-empty .expect file 9 for(1000) { 10 Parker parker; 11 unpark( parker __cfaabi_dbg_ctx2 ); 12 } 14 13 } -
tests/enum.cfa
r08e8851 r2ff78aae 26 26 //Dummy main 27 27 int main(int argc, char const *argv[]) { 28 printf( "done\n" ); // non-empty .expect file29 28 } -
tests/exceptions/.expect/virtual-cast.txt
r08e8851 r2ff78aae 1 done -
tests/exceptions/.expect/virtual-poly.txt
r08e8851 r2ff78aae 1 done -
tests/exceptions/virtual-cast.cfa
r08e8851 r2ff78aae 74 74 free(tri); 75 75 free(top); 76 printf( "done\n" ); // non-empty .expect file77 76 } -
tests/exceptions/virtual-poly.cfa
r08e8851 r2ff78aae 77 77 mono_poly_test(); 78 78 poly_poly_test(); 79 printf( "done\n" ); // non-empty .expect file80 79 } -
tests/expression.cfa
r08e8851 r2ff78aae 8 8 9 9 int main() { 10 int a[3] = { 0, 0, 0 };11 S s = { 3 }, * ps = &s;12 [int] t = { 3 };13 * [int] pt = &t;14 int i = 1, j = 2;10 int a[3] = { 0, 0, 0 }; 11 S s = { 3 }, * ps = &s; 12 [int] t = { 3 }; 13 * [int] pt = &t; 14 int i = 1, j = 2; 15 15 16 // operators16 // operators 17 17 18 !i;19 ~i;20 +i;21 -i;22 *ps;23 ++ps;24 --ps;25 ps++;26 ps--;18 !i; 19 ~i; 20 +i; 21 -i; 22 *ps; 23 ++ps; 24 --ps; 25 ps++; 26 ps--; 27 27 28 i + j;29 i - j;30 i * j;28 i + j; 29 i - j; 30 i * j; 31 31 32 i / j;33 i % j;34 i ^ j;35 i & j;36 i | j;37 i < j;38 i > j;39 i = j;32 i / j; 33 i % j; 34 i ^ j; 35 i & j; 36 i | j; 37 i < j; 38 i > j; 39 i = j; 40 40 41 i == j;42 i != j;43 i << j;44 i >> j;45 i <= j;46 i >= j;47 i && j;48 i || j;49 ps->i;41 i == j; 42 i != j; 43 i << j; 44 i >> j; 45 i <= j; 46 i >= j; 47 i && j; 48 i || j; 49 ps->i; 50 50 51 i *= j;52 i /= j;53 i %= j;54 i += j;55 i -= j;56 i &= j;57 i |= j;58 i ^= j;59 i <<= j;60 i >>= j;51 i *= j; 52 i /= j; 53 i %= j; 54 i += j; 55 i -= j; 56 i &= j; 57 i |= j; 58 i ^= j; 59 i <<= j; 60 i >>= j; 61 61 62 i ? i : j;62 i ? i : j; 63 63 64 // postfix function call64 // postfix function call 65 65 66 (3 + 4)`mary; 67 ({3 + 4;})`mary; 68 [3, 4]`mary; 69 3`mary; 70 a[0]`mary; 71 a[0]`mary`mary; 72 s{0}`mary; 73 a[3]`jane++; 74 jack(3)`mary; 75 s.i`mary; 76 t.0`mary; 77 s.[i]`mary; 78 ps->i`mary; 79 pt->0`mary; 80 ps->[i]`mary; 81 i++`mary; 82 i--`mary; 83 (S){2}`mary; 84 (S)@{2}`mary; 85 86 #pragma message( "Compiled" ) // force non-empty .expect file 66 (3 + 4)`mary; 67 ({3 + 4;})`mary; 68 [3, 4]`mary; 69 3`mary; 70 a[0]`mary; 71 a[0]`mary`mary; 72 s{0}`mary; 73 a[3]`jane++; 74 jack(3)`mary; 75 s.i`mary; 76 t.0`mary; 77 s.[i]`mary; 78 ps->i`mary; 79 pt->0`mary; 80 ps->[i]`mary; 81 i++`mary; 82 i--`mary; 83 (S){2}`mary; 84 (S)@{2}`mary; 87 85 } // main -
tests/forall.cfa
r08e8851 r2ff78aae 10 10 // Created On : Wed May 9 08:48:15 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 27 08:43:20 202013 // Update Count : 3 512 // Last Modified On : Tue Mar 19 08:29:38 2019 13 // Update Count : 32 14 14 // 15 15 … … 158 158 } 159 159 forall( otype T ) inline static { 160 int RT9( T ) { T t; return 3;}160 int RT9( T ) { T t; } 161 161 } 162 162 … … 213 213 // w3 g3; 214 214 215 int main( void ) { 216 #pragma message( "Compiled" ) // force non-empty .expect file 217 } 215 int main( void ) {} 218 216 219 217 // Local Variables: // -
tests/heap.cfa
r08e8851 r2ff78aae 10 10 // Created On : Tue Nov 6 17:54:56 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 25 15:21:52202013 // Update Count : 7 312 // Last Modified On : Mon Sep 7 18:37:41 2020 13 // Update Count : 72 14 14 // 15 15 … … 485 485 // checkFreeOn(); 486 486 // malloc_stats(); 487 printf( "done\n" ); // non-empty .expect file488 487 } 489 488 -
tests/identFuncDeclarator.cfa
r08e8851 r2ff78aae 10 10 // Created On : Wed Aug 17 08:36:34 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 27 08:20:46 202013 // Update Count : 512 // Last Modified On : Tue Nov 6 17:56:33 2018 13 // Update Count : 3 14 14 // 15 15 … … 111 111 int (* (* const f80)(int))(); 112 112 int (* const(* const f81)(int))(); 113 114 #pragma message( "Compiled" ) // force non-empty .expect file115 113 } 116 114 -
tests/identParamDeclarator.cfa
r08e8851 r2ff78aae 10 10 // Created On : Wed Aug 17 08:37:56 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 25 14:31:08 202013 // Update Count : 412 // Last Modified On : Tue Nov 6 17:56:44 2018 13 // Update Count : 3 14 14 // 15 15 … … 158 158 159 159 int main( int argc, char const *argv[] ) { // dummy main 160 printf( "done\n" ); // non-empty .expect file160 return 0; 161 161 } 162 162 -
tests/labelledExit.cfa
r08e8851 r2ff78aae 10 10 // Created On : Wed Aug 10 07:29:39 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 27 09:01:34202013 // Update Count : 1212 // Last Modified On : Wed Feb 5 16:49:48 2020 13 // Update Count : 9 14 14 // 15 15 … … 179 179 180 180 int main( int argc, char const *argv[] ) { 181 #pragma message( "Compiled" ) // force non-empty .expect file181 /* code */ 182 182 } 183 183 -
tests/limits.cfa
r08e8851 r2ff78aae 10 10 // Created On : Tue May 10 20:44:20 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 27 08:45:43 202013 // Update Count : 1012 // Last Modified On : Tue Nov 6 17:57:55 2018 13 // Update Count : 8 14 14 // 15 15 … … 147 147 148 148 int main(int argc, char const *argv[]) { 149 #pragma message( "Compiled" ) // force non-empty .expect file 149 //DUMMY 150 return 0; 150 151 } 151 152 -
tests/maybe.cfa
r08e8851 r2ff78aae 10 10 // Created On : Thr May 25 16:02:00 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 25 15:13:28 202013 // Update Count : 212 // Last Modified On : Thu Jul 20 15:24:07 2017 13 // Update Count : 1 14 14 // 15 15 … … 65 65 //checkNamedConstructors(); 66 66 checkSetters(); 67 printf( "done\n" ); // non-empty .expect file68 67 } -
tests/nested-types.cfa
r08e8851 r2ff78aae 10 10 // Created On : Mon Jul 9 10:20:03 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 27 08:48:59202013 // Update Count : 612 // Last Modified On : Wed Feb 12 18:21:15 2020 13 // Update Count : 3 14 14 // 15 15 16 16 typedef int N; 17 17 struct A { 18 forall(otype T)19 struct N {20 T x;21 };18 forall(otype T) 19 struct N { 20 T x; 21 }; 22 22 }; 23 23 24 24 struct S { 25 struct T {26 int i;27 typedef int Bar;28 };29 T x;25 struct T { 26 int i; 27 typedef int Bar; 28 }; 29 T x; 30 30 31 // struct U;32 typedef T Bar;33 typedef int Baz;31 // struct U; 32 typedef T Bar; 33 typedef int Baz; 34 34 }; 35 35 … … 65 65 66 66 int main() { 67 // access nested struct68 S.T x;67 // access nested struct 68 S.T x; 69 69 70 {71 struct S {72 int i;73 struct Z {74 double d;75 };76 };70 { 71 struct S { 72 int i; 73 struct Z { 74 double d; 75 }; 76 }; 77 77 78 S.Z z;// gets local S79 .S.T y;// lookup at global scope only78 S.Z z; // gets local S 79 .S.T y; // lookup at global scope only 80 80 81 const volatile .S.T q;81 const volatile .S.T q; 82 82 #if ERR1 83 T err1;// error: no T in scope83 T err1; // error: no T in scope 84 84 #endif 85 85 #if ERR2 86 .Z err2;// error: no Z in global scope87 .S.Baz.Bar err3;// error: .S.Baz => int, int is not aggregate and should not appear left of the dot88 .S.Z err4;// error: no Z in global S86 .Z err2; // error: no Z in global scope 87 .S.Baz.Bar err3; // error: .S.Baz => int, int is not aggregate and should not appear left of the dot 88 .S.Z err4; // error: no Z in global S 89 89 #endif 90 }90 } 91 91 92 // U.S un;92 // U.S un; 93 93 94 S.Bar y;95 S.Baz x;96 S.T.Bar z;94 S.Bar y; 95 S.Baz x; 96 S.T.Bar z; 97 97 98 // A.N(int) x; // xxx - should not be an error, but currently is. 99 100 #pragma message( "Compiled" ) // force non-empty .expect file 98 // A.N(int) x; // xxx - should not be an error, but currently is. 101 99 } 102 100 -
tests/numericConstants.cfa
r08e8851 r2ff78aae 10 10 // Created On : Wed May 24 22:10:36 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 27 07:55:22 202013 // Update Count : 712 // Last Modified On : Tue Feb 5 08:58:16 2019 13 // Update Count : 5 14 14 // 15 15 … … 63 63 0x_ff.ffp0; // hex real 64 64 0x_1.ffff_ffff_p_128_l; 65 66 #pragma message( "Compiled" ) // force non-empty .expect file67 65 } // main 68 66 -
tests/operators.cfa
r08e8851 r2ff78aae 31 31 int main(int argc, char const *argv[]) { 32 32 /* code */ 33 printf( "done\n" ); // non-empty .expect file33 return 0; 34 34 } 35 35 -
tests/pybin/tools.py
r08e8851 r2ff78aae 88 88 raise 89 89 90 def is_empty(fname):91 if not os.path.isfile(fname):92 return True93 94 if os.stat(fname).st_size == 0:95 return True96 97 return False98 99 90 def is_ascii(fname): 100 91 if settings.dry_run: 101 92 print("is_ascii: %s" % fname) 102 return (True, "")93 return True 103 94 104 95 if not os.path.isfile(fname): 105 return (False, "No file")106 107 code, out = sh("file ",fname, output_file=subprocess.PIPE)96 return False 97 98 code, out = sh("file %s" % fname, output_file=subprocess.PIPE) 108 99 if code != 0: 109 return (False, "'file EXPECT' failed with code {}".format(code))100 return False 110 101 111 102 match = re.search(".*: (.*)", out) 112 103 113 104 if not match: 114 return (False, "Unreadable file type: '{}'".format(out)) 115 116 if "ASCII text" in match.group(1): 117 return (True, "") 118 119 return (False, "File type should be 'ASCII text', was '{}'".format(match.group(1))) 105 return False 106 107 return match.group(1).startswith("ASCII text") 120 108 121 109 def is_exe(fname): -
tests/raii/.expect/ctor-autogen.txt
r08e8851 r2ff78aae 1 done -
tests/raii/.expect/init_once.txt
r08e8851 r2ff78aae 1 done -
tests/raii/ctor-autogen.cfa
r08e8851 r2ff78aae 151 151 identity(gcs); 152 152 identity(gcu); 153 printf( "done\n" ); // non-empty .expect file154 153 } -
tests/raii/init_once.cfa
r08e8851 r2ff78aae 10 10 // Created On : Tue Jun 14 15:43:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 25 15:36:39 202013 // Update Count : 512 // Last Modified On : Fri Mar 22 13:41:26 2019 13 // Update Count : 4 14 14 // 15 15 … … 188 188 static_variable(); 189 189 } 190 printf( "done\n" ); // non-empty .expect file191 190 } 192 191 -
tests/result.cfa
r08e8851 r2ff78aae 10 10 // Created On : Thr May 25 16:50:00 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 25 15:22:59 202013 // Update Count : 212 // Last Modified On : Thu Jul 20 15:24:12 2017 13 // Update Count : 1 14 14 // 15 15 … … 66 66 checkGetters(); 67 67 checkSetters(); 68 printf( "done\n" ); // non-empty .expect file69 68 } -
tests/stdincludes.cfa
r08e8851 r2ff78aae 10 10 // Created On : Tue Aug 29 08:26:14 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 27 08:51:38 202013 // Update Count : 812 // Last Modified On : Tue Nov 6 18:00:53 2018 13 // Update Count : 6 14 14 // 15 15 … … 47 47 #include <wctype.h> 48 48 49 int main() { 50 #pragma message( "Compiled" ) // force non-empty .expect file 51 } 49 int main() {} 52 50 53 51 // Local Variables: // -
tests/switch.cfa
r08e8851 r2ff78aae 10 10 // Created On : Tue Jul 12 06:50:22 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 27 08:35:02 202013 // Update Count : 4312 // Last Modified On : Tue Nov 6 18:01:34 2018 13 // Update Count : 37 14 14 // 15 15 … … 100 100 j = 5; 101 101 } // choose 102 103 #pragma message( "Compiled" ) // force non-empty .expect file104 102 } // main 105 103 -
tests/test.py
r08e8851 r2ff78aae 173 173 test.prepare() 174 174 175 # ----------176 # MAKE177 # ----------178 175 # build, skipping to next test on error 179 176 with Timed() as comp_dur: 180 177 make_ret, _ = make( test.target(), output_file=subprocess.DEVNULL, error=out_file, error_file = err_file ) 181 178 182 # ---------- 183 # RUN 184 # ---------- 179 run_dur = None 185 180 # run everything in a temp directory to make sure core file are handled properly 186 run_dur = None187 181 with tempdir(): 188 182 # if the make command succeeds continue otherwise skip to diff … … 262 256 make('clean', output_file=subprocess.DEVNULL, error=subprocess.DEVNULL) 263 257 264 # create the executor for our jobs 265 pool = multiprocessing.Pool(jobs) 258 # since python prints stacks by default on a interrupt, redo the interrupt handling to be silent 259 def worker_init(): 260 def sig_int(signal_num, frame): 261 pass 262 263 signal.signal(signal.SIGINT, sig_int) 264 265 # create the executor for our jobs and handle the signal properly 266 pool = multiprocessing.Pool(jobs, worker_init) 266 267 267 268 failed = False 269 270 def stop(x, y): 271 print("Tests interrupted by user", file=sys.stderr) 272 sys.exit(1) 273 signal.signal(signal.SIGINT, stop) 268 274 269 275 # for each test to run … … 354 360 failed = 0 355 361 356 # check if the expected files aren't empty357 if not options.regenerate_expected:358 for t in tests:359 if is_empty(t.expect()):360 print('WARNING: test "{}" has empty .expect file'.format(t.target()), file=sys.stderr)361 362 362 # for each build configurations, run the test 363 363 with Timed() as total_dur: -
tests/typedefRedef.cfa
r08e8851 r2ff78aae 27 27 typedef int ARR[]; 28 28 typedef int ARR[]; 29 #ifdef ERR1 30 // if a typedef has an array dimension, it can only be redefined to the same dimension 29 // #ifdef ERR1 30 // if a typedef has an array dimension, 31 // it can only be redefined to the same dimension 31 32 typedef int ARR[2]; 32 #endif33 // #endif 33 34 34 35 typedef int X; … … 53 54 54 55 int main() { 55 typedef int ARR[sz];56 typedef int ARR[sz]; 56 57 57 // can't redefine typedef which is VLA58 // can't redefine typedef which is VLA 58 59 #if ERR1 59 typedef int ARR[sz];60 typedef int ARR[sz]; 60 61 #endif 61 62 62 Foo *x;63 Foo *x; 63 64 64 typedef struct Bar Foo;65 Foo *y;65 typedef struct Bar Foo; 66 Foo *y; 66 67 67 typedef int *** pt; 68 69 #pragma message( "Compiled" ) // force non-empty .expect file 68 typedef int *** pt; 70 69 } -
tests/typeof.cfa
r08e8851 r2ff78aae 1 1 int main() { 2 int *v1; 3 typeof(v1) v2; 4 typeof(*v1) v3[4]; 5 char *v4[4]; 6 typeof(typeof(char *)[4]) v5; 7 typeof (int *) v6; 8 typeof( int ( int, int p ) ) *v7; 9 typeof( [int] ( int, int p ) ) *v8; 10 (typeof(v1)) v2; // cast with typeof 11 printf( "done\n" ); // non-empty .expect file 2 int *v1; 3 typeof(v1) v2; 4 typeof(*v1) v3[4]; 5 char *v4[4]; 6 typeof(typeof(char *)[4]) v5; 7 typeof (int *) v6; 8 typeof( int ( int, int p ) ) *v7; 9 typeof( [int] ( int, int p ) ) *v8; 10 (typeof(v1)) v2; // cast with typeof 12 11 } -
tests/variableDeclarator.cfa
r08e8851 r2ff78aae 10 10 // Created On : Wed Aug 17 08:41:42 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 27 07:46:17 202013 // Update Count : 1312 // Last Modified On : Tue Nov 6 18:02:16 2018 13 // Update Count : 2 14 14 // 15 15 … … 18 18 int (f2); 19 19 20 int * f3;21 int ** f4;22 int * const * f5;20 int *f3; 21 int **f4; 22 int * const *f5; 23 23 int * const * const f6; 24 24 25 int * (f7);26 int ** (f8);27 int * const * (f9);25 int *(f7); 26 int **(f8); 27 int * const *(f9); 28 28 int * const * const (f10); 29 29 30 int (* f11);31 int (** f12);32 int (* const * f13);30 int (*f11); 31 int (**f12); 32 int (* const *f13); 33 33 int (* const * const f14); 34 34 35 int f15[ 0];35 int f15[]; 36 36 int f16[10]; 37 int (f17[ 0]);37 int (f17[]); 38 38 int (f18[10]); 39 39 40 int * f19[0];41 int * f20[10];42 int ** f21[0];43 int ** f22[10];44 int * const * f23[0];45 int * const * f24[10];46 int * const * const f25[ 0];40 int *f19[]; 41 int *f20[10]; 42 int **f21[]; 43 int **f22[10]; 44 int * const *f23[]; 45 int * const *f24[10]; 46 int * const * const f25[]; 47 47 int * const * const f26[10]; 48 48 49 int *(f27[ 0]);49 int *(f27[]); 50 50 int *(f28[10]); 51 int **(f29[ 0]);51 int **(f29[]); 52 52 int **(f30[10]); 53 int * const *(f31[ 0]);53 int * const *(f31[]); 54 54 int * const *(f32[10]); 55 int * const * const (f33[ 0]);55 int * const * const (f33[]); 56 56 int * const * const (f34[10]); 57 57 58 int (* f35)[];59 int (* f36)[10];60 int (** f37)[];61 int (** f38)[10];62 int (* const * f39)[];63 int (* const * f40)[10];58 int (*f35)[]; 59 int (*f36)[10]; 60 int (**f37)[]; 61 int (**f38)[10]; 62 int (* const *f39)[]; 63 int (* const *f40)[10]; 64 64 int (* const * const f41)[]; 65 65 int (* const * const f42)[10]; 66 66 67 int f43[ 0][3];67 int f43[][3]; 68 68 int f44[3][3]; 69 int (f45[ 0])[3];69 int (f45[])[3]; 70 70 int (f46[3])[3]; 71 int ((f47[ 0]))[3];71 int ((f47[]))[3]; 72 72 int ((f48[3]))[3]; 73 73 74 int * f49[0][3];75 int * f50[3][3];76 int ** f51[0][3];77 int ** f52[3][3];78 int * const * f53[0][3];79 int * const * f54[3][3];80 int * const * const f55[ 0][3];74 int *f49[][3]; 75 int *f50[3][3]; 76 int **f51[][3]; 77 int **f52[3][3]; 78 int * const *f53[][3]; 79 int * const *f54[3][3]; 80 int * const * const f55[][3]; 81 81 int * const * const f56[3][3]; 82 82 83 int (* f57[0][3]);84 int (* f58[3][3]);85 int (** f59[0][3]);86 int (** f60[3][3]);87 int (* const * f61[0][3]);88 int (* const * f62[3][3]);89 int (* const * const f63[ 0][3]);83 int (*f57[][3]); 84 int (*f58[3][3]); 85 int (**f59[][3]); 86 int (**f60[3][3]); 87 int (* const *f61[][3]); 88 int (* const *f62[3][3]); 89 int (* const * const f63[][3]); 90 90 int (* const * const f64[3][3]); 91 91 … … 93 93 int (f66)(int); 94 94 95 int * f67(int);96 int ** f68(int);97 int * const * f69(int);95 int *f67(int); 96 int **f68(int); 97 int * const *f69(int); 98 98 int * const * const f70(int); 99 99 … … 104 104 int * const * const (f74)(int); 105 105 106 int (* f75)(int);107 int (** f76)(int);108 int (* const * f77)(int);106 int (*f75)(int); 107 int (**f76)(int); 108 int (* const *f77)(int); 109 109 int (* const * const f78)(int); 110 110 111 int (*(* f79)(int))();111 int (*(*f79)(int))(); 112 112 int (*(* const f80)(int))(); 113 113 int (* const(* const f81)(int))(); … … 119 119 //int fe2()[]; // returning an array 120 120 //int fe3()(); // returning a function 121 //int (* fe4)()(); // returning a function122 //int ((* fe5())())[]; // returning an array121 //int (*fe4)()(); // returning a function 122 //int ((*fe5())())[]; // returning an array 123 123 124 #ifdef __CFA__125 124 // Cforall extensions 126 125 … … 130 129 const * const * int cf6; 131 130 132 [ 0] int cf15;131 [] int cf15; 133 132 [10] int cf16; 134 133 135 [ 0] * int cf19;134 [] * int cf19; 136 135 [10] * int cf20; 137 int ** cf21[0];136 int **cf21[]; 138 137 [10] * * int cf22; 139 [ 0] * const * int cf23;138 [] * const * int cf23; 140 139 [10] * const * int cf24; 141 [ 0] const * const * int cf25;140 [] const * const * int cf25; 142 141 [10] const * const * int cf26; 143 142 … … 151 150 const * const * [10] int cf42; 152 151 153 [ 0][3] int cf43;152 [][3] int cf43; 154 153 [3][3] int cf44; 155 154 156 [ 0][3] * int cf49;155 [][3] * int cf49; 157 156 [3][3] * int cf50; 158 [ 0][3] * * int cf51;157 [][3] * * int cf51; 159 158 [3][3] * * int cf52; 160 [ 0][3] const * int cf53;159 [][3] const * int cf53; 161 160 [3][3] * const * int cf54; 162 [ 0][3] const * const * int cf55;161 [][3] const * const * int cf55; 163 162 [3][3] const * const * int cf56; 164 163 … … 174 173 175 174 *[]*[]* [ *[]*[] int ]( *[]*[] int, *[]*[] int ) v3; 176 #endif // __CFA__177 175 178 176 //Dummy main 179 int main( int argc, char const * argv[] ) { 180 #pragma message( "Compiled" ) // force non-empty .expect file 177 int main(int argc, char const *argv[]) 178 { 179 return 0; 181 180 } 182 181 -
tests/voidPtr.cfa
r08e8851 r2ff78aae 13 13 if ( ! a ) { 14 14 abort(); 15 } 16 printf( "done\n" ); // non-empty .expect file 15 } 17 16 } 18 17 -
tests/warnings/.expect/self-assignment.txt
r08e8851 r2ff78aae 24 24 ... to: 25 25 reference to signed int 26 warnings/self-assignment.cfa: In function '_X4mainFi___1':27 warnings/self-assignment.cfa:36:9: note: #pragma message: Compiled -
tests/warnings/self-assignment.cfa
r08e8851 r2ff78aae 10 10 // Created On : Thu Mar 1 13:53:57 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 27 09:24:34 202013 // Update Count : 612 // Last Modified On : Wed Feb 20 07:56:17 2019 13 // Update Count : 3 14 14 // 15 15 … … 31 31 s.i = s.i; 32 32 t.s.i = t.s.i; 33 34 #pragma message( "Compiled" ) // force non-empty .expect file35 33 } 36 34 37 35 // Local Variables: // 38 36 // tab-width: 4 // 39 // compile-command: "cfa self-assignment.cfa" //37 // compile-command: "cfa dtor-early-exit" // 40 38 // End: // -
tests/zombies/structMember.cfa
r08e8851 r2ff78aae 53 53 // C useless declarations 54 54 55 #ifdef ERROR56 55 int; 57 56 TD; … … 71 70 W(int); 72 71 W(int).X; 73 #endif // ERROR74 72 }; 75 73 -
tools/gdb/utils-gdb.py
r08e8851 r2ff78aae 44 44 STACK = [] 45 45 46 # A global variable to keep all system task name 47 SysTask_Name = ["uLocalDebuggerReader", "uLocalDebugger", "uProcessorTask", "uBootTask", "uSystemTask", 48 "uProcessorTask", "uPthread", "uProfiler"] 49 46 50 not_supported_error_msg = "Not a supported command for this language" 47 51 … … 97 101 return cluster_root 98 102 99 def get_sched_lock():100 """101 Return: gdb.Value of __scheduler_lock102 """103 lock = gdb.parse_and_eval('_X16__scheduler_lockPS20__scheduler_RWLock_t_1')104 if lock.address == 0x0:105 print('No scheduler lock, program terminated')106 return lock107 108 def all_clusters():109 if not is_cforall():110 return None111 112 cluster_root = get_cluster_root()113 if cluster_root.address == 0x0:114 return115 116 curr = cluster_root117 ret = [curr]118 119 while True:120 curr = curr['_X4nodeS26__cluster____dbg_node_cltr_1']['_X4nextPS7cluster_1']121 if curr == cluster_root:122 break123 124 ret.append(curr)125 126 return ret127 128 def all_processors():129 if not is_cforall():130 return None131 132 cfa_t = get_cfa_types()133 134 # get processors from registration to the RWlock135 lock = get_sched_lock()136 137 #get number of elements138 count = lock['_X5readyVj_1']139 140 #find all the procs141 raw_procs = [lock['_X4dataPS21__scheduler_lock_id_t_1'][i]['_X6handleVPS16__processor_id_t_1'] for i in range(count)]142 143 # pre cast full procs144 procs = [p.cast(cfa_t.processor_ptr) for p in raw_procs if p['_X9full_procb_1']]145 146 # sort procs by clusters147 return sorted(procs, key=lambda p: p['_X4cltrPS7cluster_1'])148 149 def tls_for_pthread(pthrd):150 prev = gdb.selected_thread()151 inf = gdb.selected_inferior()152 153 thrd = inf.thread_from_thread_handle( pthrd )154 thrd.switch()155 tls = gdb.parse_and_eval('&_X9kernelTLSS16KernelThreadData_1')156 157 prev.switch()158 return tls159 160 def tls_for_proc(proc):161 return tls_for_pthread(proc['_X13kernel_threadm_1'])162 163 def thread_for_pthread(pthrd):164 return tls_for_pthread(pthrd)['_X11this_threadVPS7$thread_1']165 166 def thread_for_proc(proc):167 return tls_for_proc(proc)['_X11this_threadVPS7$thread_1']168 169 170 171 103 def find_curr_thread(): 172 104 # btstr = gdb.execute('bt', to_string = True).splitlines() … … 176 108 # return btstr[0].split('this=',1)[1].split(',')[0].split(')')[0] 177 109 return None 110 111 def all_clusters(): 112 if not is_cforall(): 113 return None 114 115 cluster_root = get_cluster_root() 116 if cluster_root.address == 0x0: 117 return 118 119 curr = cluster_root 120 ret = [curr] 121 122 while True: 123 curr = curr['_X4nodeS26__cluster____dbg_node_cltr_1']['_X4nextPS7cluster_1'] 124 if curr == cluster_root: 125 break 126 127 ret.append(curr) 128 129 return ret 130 178 131 179 132 def lookup_cluster(name = None): … … 286 239 """Cforall: Display currently known processors 287 240 Usage: 288 info processors : print out all the processors 241 info processors : print out all the processors in the Main Cluster 242 info processors all : print out all processors in all clusters 289 243 info processors <cluster_name> : print out all processors in a given cluster 290 244 """ … … 293 247 super(Processors, self).__init__('info processors', gdb.COMMAND_USER) 294 248 295 def print_processor(self, processor): 296 should_stop = processor['_X12do_terminateVb_1'] 297 if not should_stop: 298 midle = processor['_X6$linksS7$dlinks_S9processor__1']['_X4nextS9$mgd_link_Y13__tE_generic___1']['_X4elemPY13__tE_generic__1'] != 0x0 299 end = processor['_X6$linksS7$dlinks_S9processor__1']['_X4nextS9$mgd_link_Y13__tE_generic___1']['_X10terminatorPv_1'] != 0x0 300 301 status = 'Idle' if midle or end else 'Active' 302 else: 249 def print_processor(self, name, status, pending, address): 250 print('{:>20} {:>11} {:>13} {:>20}'.format(name, status, pending, address)) 251 252 def iterate_procs(self, root, active): 253 if root == 0x0: 254 return 255 256 cfa_t = get_cfa_types() 257 curr = root 258 259 while True: 260 processor = curr 261 should_stop = processor['_X12do_terminateVb_1'] 303 262 stop_count = processor['_X10terminatedS9semaphore_1']['_X5counti_1'] 304 status_str = 'Last Thread' if stop_count >= 0 else 'Terminating' 305 status = '{}({},{})'.format(status_str, should_stop, stop_count) 306 307 print('{:>20} {:>11} {:<7} {:<}'.format( 308 processor['_X4namePKc_1'].string(), 309 status, 310 str(processor['_X18pending_preemptionb_1']), 311 str(processor) 312 )) 313 tls = tls_for_proc( processor ) 314 thrd = tls['_X11this_threadVPS7$thread_1'] 315 if thrd != 0x0: 316 tname = '{} {}'.format(thrd['self_cor']['name'].string(), str(thrd)) 317 else: 318 tname = None 319 320 print('{:>20} {}'.format('Thread', tname)) 321 print('{:>20} {}'.format('TLS', tls)) 263 if not should_stop: 264 status = 'Active' if active else 'Idle' 265 else: 266 status_str = 'Last Thread' if stop_count >= 0 else 'Terminating' 267 status = '{}({},{})'.format(status_str, should_stop, stop_count) 268 269 self.print_processor(processor['_X4namePKc_1'].string(), 270 status, str(processor['_X18pending_preemptionb_1']), str(processor) 271 ) 272 273 curr = curr['_X4nodeS28__processor____dbg_node_proc_1']['_X4nextPS9processor_1'] 274 275 if curr == root or curr == 0x0: 276 break 322 277 323 278 #entry point from gdb … … 327 282 328 283 if not arg: 284 clusters = [lookup_cluster(None)] 285 elif arg == "all": 329 286 clusters = all_clusters() 330 287 else: … … 335 292 return 336 293 337 procs = all_processors() 338 339 print('{:>20} {:>11} {:<7} {}'.format('Processor', '', 'Pending', 'Object')) 340 print('{:>20} {:>11} {:<7} {}'.format('Name', 'Status', 'Yield', 'Address')) 341 cl = None 342 for p in procs: 343 # if this is a different cluster print it 344 if cl != p['_X4cltrPS7cluster_1']: 345 if cl: 346 print() 347 cl = p['_X4cltrPS7cluster_1'] 348 print('Cluster {}'.format(cl['_X4namePKc_1'].string())) 349 350 # print the processor information 351 self.print_processor(p) 294 cfa_t = get_cfa_types() 295 for cluster in clusters: 296 print('Cluster: "{}"({})'.format(cluster['_X4namePKc_1'].string(), cluster.cast(cfa_t.cluster_ptr))) 297 298 active_root = cluster.cast(cfa_t.cluster_ptr) \ 299 ['_X5procsS8__dllist_S9processor__1'] \ 300 ['_X4headPY15__TYPE_generic__1'] \ 301 .cast(cfa_t.processor_ptr) 302 303 idle_root = cluster.cast(cfa_t.cluster_ptr) \ 304 ['_X5idlesS8__dllist_S9processor__1'] \ 305 ['_X4headPY15__TYPE_generic__1'] \ 306 .cast(cfa_t.processor_ptr) 307 308 if idle_root != 0x0 or active_root != 0x0: 309 self.print_processor('Name', 'Status', 'Pending Yield', 'Address') 310 self.iterate_procs(active_root, True) 311 self.iterate_procs(idle_root, False) 312 else: 313 print("No processors on cluster") 352 314 353 315 print()
Note:
See TracChangeset
for help on using the changeset viewer.