aboutsummaryrefslogtreecommitdiff
path: root/tests/compiler/sloc-counter/testscript
blob: 802d406d6c85d30cab2a0b8bd028d2b5c8911818 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# file      : tests/compiler/sloc-counter/testscript
# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
# license   : MIT; see accompanying LICENSE file

: c++-program-sloc
:
text = '// C++ comment
  // C++ comment

/* C comment */

/* Multiline
   C
   Comment


*/

#include <iostream>

char str[] = "multi\
line\
string\
literal";

using namespace std;


int main(
  int argc /*count*/,
  char* argv[] /*array*/)
{
  /* comment start */ int x = 0;
  char* s =
  /* comment start */"foo";
  int y = 2
  /* tricky stuff *//
  2;
  cerr << "Hello, \"world!" << '"'\\''"' << endl;
}';
cat <"$text" >>>file;
$* file >>EOO
$text

18
EOO