[compiler-rt] r190783 - [msan] Check return value of main: compiler-rt tests.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Mon Sep 16 06:25:27 PDT 2013


Author: eugenis
Date: Mon Sep 16 08:25:26 2013
New Revision: 190783

URL: http://llvm.org/viewvc/llvm-project?rev=190783&view=rev
Log:
[msan] Check return value of main: compiler-rt tests.

Modified:
    compiler-rt/trunk/lib/msan/lit_tests/heap-origin.cc
    compiler-rt/trunk/lib/msan/lit_tests/stack-origin.cc

Modified: compiler-rt/trunk/lib/msan/lit_tests/heap-origin.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/lit_tests/heap-origin.cc?rev=190783&r1=190782&r2=190783&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/lit_tests/heap-origin.cc (original)
+++ compiler-rt/trunk/lib/msan/lit_tests/heap-origin.cc Mon Sep 16 08:25:26 2013
@@ -19,15 +19,13 @@
 #include <stdlib.h>
 int main(int argc, char **argv) {
   char *volatile x = (char*)malloc(5 * sizeof(char));
-  if (*x)
-    exit(0);
+  return *x;
   // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
-  // CHECK: {{#0 0x.* in main .*heap-origin.cc:}}[[@LINE-3]]
+  // CHECK: {{#0 0x.* in main .*heap-origin.cc:}}[[@LINE-2]]
 
   // CHECK-ORIGINS: Uninitialized value was created by a heap allocation
   // CHECK-ORIGINS: {{#0 0x.* in .*malloc}}
-  // CHECK-ORIGINS: {{#1 0x.* in main .*heap-origin.cc:}}[[@LINE-8]]
+  // CHECK-ORIGINS: {{#1 0x.* in main .*heap-origin.cc:}}[[@LINE-7]]
 
   // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*heap-origin.cc:.* main}}
-  return 0;
 }

Modified: compiler-rt/trunk/lib/msan/lit_tests/stack-origin.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/lit_tests/stack-origin.cc?rev=190783&r1=190782&r2=190783&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/lit_tests/stack-origin.cc (original)
+++ compiler-rt/trunk/lib/msan/lit_tests/stack-origin.cc Mon Sep 16 08:25:26 2013
@@ -20,14 +20,12 @@
 int main(int argc, char **argv) {
   int x;
   int *volatile p = &x;
-  if (*p)
-    exit(0);
+  return *p;
   // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
-  // CHECK: {{#0 0x.* in main .*stack-origin.cc:}}[[@LINE-3]]
+  // CHECK: {{#0 0x.* in main .*stack-origin.cc:}}[[@LINE-2]]
 
   // CHECK-ORIGINS: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'main'
-  // CHECK-ORIGINS: {{#0 0x.* in main .*stack-origin.cc:}}[[@LINE-9]]
+  // CHECK-ORIGINS: {{#0 0x.* in main .*stack-origin.cc:}}[[@LINE-8]]
 
   // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*stack-origin.cc:.* main}}
-  return 0;
 }





More information about the llvm-commits mailing list