summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/utils/count
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/utils/count')
-rw-r--r--contrib/llvm/utils/count/CMakeLists.txt3
-rw-r--r--contrib/llvm/utils/count/Makefile20
-rw-r--r--contrib/llvm/utils/count/count.c50
3 files changed, 0 insertions, 73 deletions
diff --git a/contrib/llvm/utils/count/CMakeLists.txt b/contrib/llvm/utils/count/CMakeLists.txt
deleted file mode 100644
index e124f61..0000000
--- a/contrib/llvm/utils/count/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-add_executable(count
- count.c
- )
diff --git a/contrib/llvm/utils/count/Makefile b/contrib/llvm/utils/count/Makefile
deleted file mode 100644
index 8de076a..0000000
--- a/contrib/llvm/utils/count/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- utils/count/Makefile --------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../..
-TOOLNAME = count
-USEDLIBS =
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-# Don't install this utility
-NO_INSTALL = 1
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/utils/count/count.c b/contrib/llvm/utils/count/count.c
deleted file mode 100644
index ae96791..0000000
--- a/contrib/llvm/utils/count/count.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*===- count.c - The 'count' testing tool ---------------------------------===*\
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
-\*===----------------------------------------------------------------------===*/
-
-#include <stdlib.h>
-#include <stdio.h>
-
-int main(int argc, char **argv) {
- unsigned Count, NumLines, NumRead;
- char Buffer[4096], *End;
-
- if (argc != 2) {
- fprintf(stderr, "usage: %s <expected line count>\n", argv[0]);
- return 2;
- }
-
- Count = strtol(argv[1], &End, 10);
- if (*End != '\0' && End != argv[1]) {
- fprintf(stderr, "%s: invalid count argument '%s'\n", argv[0], argv[1]);
- return 2;
- }
-
- NumLines = 0;
- do {
- unsigned i;
-
- NumRead = fread(Buffer, 1, sizeof(Buffer), stdin);
-
- for (i = 0; i != NumRead; ++i)
- if (Buffer[i] == '\n')
- ++NumLines;
- } while (NumRead == sizeof(Buffer));
-
- if (!feof(stdin)) {
- fprintf(stderr, "%s: error reading stdin\n", argv[0]);
- return 3;
- }
-
- if (Count != NumLines) {
- fprintf(stderr, "Expected %d lines, got %d.\n", Count, NumLines);
- return 1;
- }
-
- return 0;
-}
OpenPOWER on IntegriCloud