[compiler-rt] r212487 - [MSan] Make one more test standalone
Alexey Samsonov
vonosmas at gmail.com
Mon Jul 7 13:59:10 PDT 2014
Author: samsonov
Date: Mon Jul 7 15:59:10 2014
New Revision: 212487
URL: http://llvm.org/viewvc/llvm-project?rev=212487&view=rev
Log:
[MSan] Make one more test standalone
Removed:
compiler-rt/trunk/test/msan/getline_test_data
Modified:
compiler-rt/trunk/test/msan/getline.cc
Modified: compiler-rt/trunk/test/msan/getline.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/getline.cc?rev=212487&r1=212486&r2=212487&view=diff
==============================================================================
--- compiler-rt/trunk/test/msan/getline.cc (original)
+++ compiler-rt/trunk/test/msan/getline.cc Mon Jul 7 15:59:10 2014
@@ -1,9 +1,11 @@
-// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p
-// RUN: %clangxx_msan -O2 %s -o %t && %run %t %p
-// RUN: %clang_msan -O0 -xc %s -o %t && %run %t %p
-// RUN: %clang_msan -O2 -xc %s -o %t && %run %t %p
-// RUN: %clang_msan -O0 -xc -D_GNU_SOURCE=1 %s -o %t && %run %t %p
-// RUN: %clang_msan -O2 -xc -D_GNU_SOURCE=1 %s -o %t && %run %t %p
+// RUN: echo "abcde" > %t-testdata
+// RUN: echo "12345" >> %t-testdata
+// RUN: %clangxx_msan -O0 %s -o %t && %run %t %t-testdata
+// RUN: %clangxx_msan -O2 %s -o %t && %run %t %t-testdata
+// RUN: %clang_msan -O0 -xc %s -o %t && %run %t %t-testdata
+// RUN: %clang_msan -O2 -xc %s -o %t && %run %t %t-testdata
+// RUN: %clang_msan -O0 -xc -D_GNU_SOURCE=1 %s -o %t && %run %t %t-testdata
+// RUN: %clang_msan -O2 -xc -D_GNU_SOURCE=1 %s -o %t && %run %t %t-testdata
#include <assert.h>
#include <stdio.h>
@@ -12,10 +14,9 @@
int main(int argc, char **argv) {
assert(argc == 2);
- char buf[1024];
- snprintf(buf, sizeof(buf), "%s/%s", argv[1], "getline_test_data");
+ printf("%s\n", argv[1]);
- FILE *fp = fopen(buf, "r");
+ FILE *fp = fopen(argv[1], "r");
assert(fp);
char *line = 0;
@@ -27,7 +28,7 @@ int main(int argc, char **argv) {
n = getline(&line, &len, fp);
assert(n == 6);
assert(strcmp(line, "12345\n") == 0);
-
+
free(line);
fclose(fp);
Removed: compiler-rt/trunk/test/msan/getline_test_data
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/getline_test_data?rev=212486&view=auto
==============================================================================
--- compiler-rt/trunk/test/msan/getline_test_data (original)
+++ compiler-rt/trunk/test/msan/getline_test_data (removed)
@@ -1,2 +0,0 @@
-abcde
-12345
More information about the llvm-commits
mailing list