[compiler-rt] 6ca178c - [asan] specify c++ version in tests to fix compile error

Emily Shi via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 19 10:08:24 PDT 2021


Author: Emily Shi
Date: 2021-03-19T10:08:18-07:00
New Revision: 6ca178cd78a99d682d0be43eff1a808c1bcf47e6

URL: https://github.com/llvm/llvm-project/commit/6ca178cd78a99d682d0be43eff1a808c1bcf47e6
DIFF: https://github.com/llvm/llvm-project/commit/6ca178cd78a99d682d0be43eff1a808c1bcf47e6.diff

LOG: [asan] specify c++ version in tests to fix compile error

If we don't specify the c++ version in these tests, it could cause compile errors because the compiler could default to an older c++

rdar://75247244

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D98913

Added: 
    

Modified: 
    compiler-rt/test/asan/TestCases/asan_update_allocation.cpp
    compiler-rt/test/asan/TestCases/lsan_crash.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/asan_update_allocation.cpp b/compiler-rt/test/asan/TestCases/asan_update_allocation.cpp
index 19f8073e0509..988a4f49f00e 100644
--- a/compiler-rt/test/asan/TestCases/asan_update_allocation.cpp
+++ b/compiler-rt/test/asan/TestCases/asan_update_allocation.cpp
@@ -1,4 +1,4 @@
-// RUN: %clangxx_asan -O0 %s -o %t
+// RUN: %clangxx_asan -O0 %s --std=c++11 -o %t
 
 // RUN: not %run %t 10 0 2>&1 | FileCheck %s --check-prefixes=CHECK,T0
 // RUN: not %run %t 10000000 0 2>&1 | FileCheck %s --check-prefixes=CHECK,T0

diff  --git a/compiler-rt/test/asan/TestCases/lsan_crash.cpp b/compiler-rt/test/asan/TestCases/lsan_crash.cpp
index 23c2569a0b73..09eddfde1373 100644
--- a/compiler-rt/test/asan/TestCases/lsan_crash.cpp
+++ b/compiler-rt/test/asan/TestCases/lsan_crash.cpp
@@ -1,4 +1,4 @@
-// RUN: %clangxx_asan -O2 %s -o %t && %run %t
+// RUN: %clangxx_asan -O2 %s --std=c++11 -o %t && %run %t
 
 #include <atomic>
 #include <memory>


        


More information about the llvm-commits mailing list