[compiler-rt] r261708 - [tests] Don't compile CFI C tests in C++ mode.

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 23 16:16:57 PST 2016


Author: samsonov
Date: Tue Feb 23 18:16:57 2016
New Revision: 261708

URL: http://llvm.org/viewvc/llvm-project?rev=261708&view=rev
Log:
[tests] Don't compile CFI C tests in C++ mode.

Modified:
    compiler-rt/trunk/test/cfi/icall/bad-signature.c
    compiler-rt/trunk/test/cfi/icall/external-call.c
    compiler-rt/trunk/test/cfi/lit.cfg

Modified: compiler-rt/trunk/test/cfi/icall/bad-signature.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/icall/bad-signature.c?rev=261708&r1=261707&r2=261708&view=diff
==============================================================================
--- compiler-rt/trunk/test/cfi/icall/bad-signature.c (original)
+++ compiler-rt/trunk/test/cfi/icall/bad-signature.c Tue Feb 23 18:16:57 2016
@@ -1,10 +1,10 @@
-// RUN: %clangxx -o %t1 %s
+// RUN: %clang -o %t1 %s
 // RUN: %t1 2>&1 | FileCheck --check-prefix=NCFI %s
 
-// RUN: %clangxx_cfi -o %t2 %s
+// RUN: %clang_cfi -o %t2 %s
 // RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s
 
-// RUN: %clangxx_cfi_diag -g -o %t3 %s
+// RUN: %clang_cfi_diag -g -o %t3 %s
 // RUN: %t3 2>&1 | FileCheck --check-prefix=CFI-DIAG %s
 
 #include <stdio.h>
@@ -18,7 +18,7 @@ int main() {
   fprintf(stderr, "1\n");
 
   // CFI-DIAG: runtime error: control flow integrity check for type 'void (int)' failed during indirect function call
-  // CFI-DIAG: f() defined here
+  // CFI-DIAG: f defined here
   ((void (*)(int))f)(42); // UB here
 
   // CFI-NOT: 2

Modified: compiler-rt/trunk/test/cfi/icall/external-call.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/icall/external-call.c?rev=261708&r1=261707&r2=261708&view=diff
==============================================================================
--- compiler-rt/trunk/test/cfi/icall/external-call.c (original)
+++ compiler-rt/trunk/test/cfi/icall/external-call.c Tue Feb 23 18:16:57 2016
@@ -1,4 +1,4 @@
-// RUN: %clangxx_cfi -o %t1 %s
+// RUN: %clang_cfi -lm -o %t1 %s
 // RUN: %t1 c 1 2>&1 | FileCheck --check-prefix=CFI %s
 // RUN: %t1 s 2 2>&1 | FileCheck --check-prefix=CFI %s
 

Modified: compiler-rt/trunk/test/cfi/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/lit.cfg?rev=261708&r1=261707&r2=261708&view=diff
==============================================================================
--- compiler-rt/trunk/test/cfi/lit.cfg (original)
+++ compiler-rt/trunk/test/cfi/lit.cfg Tue Feb 23 18:16:57 2016
@@ -7,11 +7,17 @@ config.test_source_root = os.path.dirnam
 
 clangxx = ' '.join([config.clang] + config.cxx_mode_flags)
 
+config.substitutions.append((r"%clang ", ' '.join([config.clang]) + ' '))
 config.substitutions.append((r"%clangxx ", clangxx + ' '))
 if config.lto_supported:
-  clangxx_cfi = ' '.join(config.lto_launch + [clangxx] + config.lto_flags + ['-flto -fsanitize=cfi '])
-  clangxx_cfi_diag = clangxx_cfi + '-fno-sanitize-trap=cfi -fsanitize-recover=cfi '
+  clang_cfi = ' '.join(config.lto_launch + [config.clang] + config.lto_flags + ['-flto -fsanitize=cfi '])
+  clangxx_cfi = clang_cfi + ' '.join(config.cxx_mode_flags) + ' '
+  diag_flags = '-fno-sanitize-trap=cfi -fsanitize-recover=cfi '
+  clang_cfi_diag = clang_cfi + diag_flags
+  clangxx_cfi_diag = clangxx_cfi + diag_flags
+  config.substitutions.append((r"%clang_cfi ", clang_cfi))
   config.substitutions.append((r"%clangxx_cfi ", clangxx_cfi))
+  config.substitutions.append((r"%clang_cfi_diag ", clang_cfi_diag))
   config.substitutions.append((r"%clangxx_cfi_diag ", clangxx_cfi_diag))
   config.substitutions.append((r"%clangxx_cfi_dso ", clangxx_cfi + '-fsanitize-cfi-cross-dso '))
   config.substitutions.append((r"%clangxx_cfi_dso_diag ", clangxx_cfi_diag + '-fsanitize-cfi-cross-dso '))




More information about the llvm-commits mailing list