[compiler-rt] 469d546 - [dfsan] Re-enable origin tracking test cases

Jianzhou Zhao via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 5 18:42:33 PST 2021


Author: Jianzhou Zhao
Date: 2021-03-06T02:41:56Z
New Revision: 469d5462faea8a6a75fdbe7c267d1d79efe6b5e1

URL: https://github.com/llvm/llvm-project/commit/469d5462faea8a6a75fdbe7c267d1d79efe6b5e1
DIFF: https://github.com/llvm/llvm-project/commit/469d5462faea8a6a75fdbe7c267d1d79efe6b5e1.diff

LOG: [dfsan] Re-enable origin tracking test cases

Added: 
    

Modified: 
    compiler-rt/test/dfsan/lit.cfg.py
    compiler-rt/test/dfsan/origin_add_label.c
    compiler-rt/test/dfsan/origin_disabled.c
    compiler-rt/test/dfsan/origin_invalid.c
    compiler-rt/test/dfsan/origin_ld_lost.c
    compiler-rt/test/dfsan/origin_ldst.c
    compiler-rt/test/dfsan/origin_limit.c
    compiler-rt/test/dfsan/origin_memset.c
    compiler-rt/test/dfsan/origin_overlapped.c
    compiler-rt/test/dfsan/origin_set_label.c
    compiler-rt/test/dfsan/origin_untainted.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/dfsan/lit.cfg.py b/compiler-rt/test/dfsan/lit.cfg.py
index 4a818d35c065..4df9e98a766e 100644
--- a/compiler-rt/test/dfsan/lit.cfg.py
+++ b/compiler-rt/test/dfsan/lit.cfg.py
@@ -12,16 +12,12 @@
 clang_dfsan_cflags = (["-fsanitize=dataflow"] +
                       [config.target_cflags])
 
-clang_dfsan_debug_cflags = (clang_dfsan_cflags +
-                            config.debug_info_flags)
-
 clang_dfsan_cxxflags = config.cxx_mode_flags + clang_dfsan_cflags
 
 def build_invocation(compile_flags):
   return " " + " ".join([config.clang] + compile_flags) + " "
 
 config.substitutions.append( ("%clang_dfsan ", build_invocation(clang_dfsan_cflags)) )
-config.substitutions.append( ("%clang_debug_dfsan ", build_invocation(clang_dfsan_debug_cflags)) )
 config.substitutions.append( ("%clangxx_dfsan ", build_invocation(clang_dfsan_cxxflags)) )
 
 # Default test suffixes.

diff  --git a/compiler-rt/test/dfsan/origin_add_label.c b/compiler-rt/test/dfsan/origin_add_label.c
index ddd8f1526337..0d1920a7ce12 100644
--- a/compiler-rt/test/dfsan/origin_add_label.c
+++ b/compiler-rt/test/dfsan/origin_add_label.c
@@ -1,8 +1,8 @@
-// RUN: %clang_dfsan -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// RUN: %clang_dfsan -gmlt -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
 // RUN:     %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK < %t.out
 
-// RUN: %clang_dfsan -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true -mllvm -dfsan-instrument-with-call-threshold=0 %s -o %t && \
+// RUN: %clang_dfsan -gmlt -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true -mllvm -dfsan-instrument-with-call-threshold=0 %s -o %t && \
 // RUN:     %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK < %t.out
 
@@ -22,10 +22,14 @@ int main(int argc, char *argv[]) {
 
 // CHECK: Taint value 0xc {{.*}} origin tracking ()
 // CHECK: Origin value: {{.*}}, Taint value was stored to memory at
+// CHECK: #0 {{.*}} in main {{.*}}origin_add_label.c:[[@LINE-7]]
 
 // CHECK: Origin value: {{.*}}, Taint value was created at
+// CHECK: #0 {{.*}} in main {{.*}}origin_add_label.c:[[@LINE-11]]
 
 // CHECK: Taint value 0xc {{.*}} origin tracking ()
 // CHECK: Origin value: {{.*}}, Taint value was stored to memory at
+// CHECK: #0 {{.*}} in main {{.*}}origin_add_label.c:[[@LINE-14]]
 
 // CHECK: Origin value: {{.*}}, Taint value was created at
+// CHECK: #0 {{.*}} in main {{.*}}origin_add_label.c:[[@LINE-18]]

diff  --git a/compiler-rt/test/dfsan/origin_disabled.c b/compiler-rt/test/dfsan/origin_disabled.c
index 56e2a6939752..e1a8b48ce063 100644
--- a/compiler-rt/test/dfsan/origin_disabled.c
+++ b/compiler-rt/test/dfsan/origin_disabled.c
@@ -1,4 +1,4 @@
-// RUN: %clang_dfsan -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// RUN: %clang_dfsan -gmlt -mllvm -dfsan-fast-16-labels=true %s -o %t && \
 // RUN:     %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK < %t.out
 

diff  --git a/compiler-rt/test/dfsan/origin_invalid.c b/compiler-rt/test/dfsan/origin_invalid.c
index 9a852050d96b..fac015f54df0 100644
--- a/compiler-rt/test/dfsan/origin_invalid.c
+++ b/compiler-rt/test/dfsan/origin_invalid.c
@@ -1,4 +1,4 @@
-// RUN: %clang_dfsan -mllvm -dfsan-fast-16-labels=true -mllvm -dfsan-track-origins=1 %s -o %t && \
+// RUN: %clang_dfsan -gmlt -mllvm -dfsan-fast-16-labels=true -mllvm -dfsan-track-origins=1 %s -o %t && \
 // RUN:     %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK < %t.out
 

diff  --git a/compiler-rt/test/dfsan/origin_ld_lost.c b/compiler-rt/test/dfsan/origin_ld_lost.c
index 5921b7e5f794..384cbad782dd 100644
--- a/compiler-rt/test/dfsan/origin_ld_lost.c
+++ b/compiler-rt/test/dfsan/origin_ld_lost.c
@@ -1,4 +1,4 @@
-// RUN: %clang_dfsan -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// RUN: %clang_dfsan -gmlt -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
 // RUN:     %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK < %t.out
 //
@@ -18,3 +18,4 @@ int main(int argc, char *argv[]) {
 
 // CHECK: Taint value 0x4 {{.*}} origin tracking (foo)
 // CHECK: Origin value: {{.*}}, Taint value was created at
+// CHECK: #0 {{.*}} in main {{.*}}origin_ld_lost.c:[[@LINE-6]]

diff  --git a/compiler-rt/test/dfsan/origin_ldst.c b/compiler-rt/test/dfsan/origin_ldst.c
index 95fe86c2fa9a..6cf4d8545850 100644
--- a/compiler-rt/test/dfsan/origin_ldst.c
+++ b/compiler-rt/test/dfsan/origin_ldst.c
@@ -1,4 +1,24 @@
-// RUN: %clang_dfsan -DTEST64 -DALIGN=8 -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// RUN: %clang_dfsan -gmlt -DTEST64 -DALIGN=8 -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// RUN:     %run %t >%t.out 2>&1
+// RUN: FileCheck %s --check-prefix=CHECK < %t.out
+//
+// RUN: %clang_dfsan -gmlt -DTEST32 -DALIGN=4 -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// RUN:     %run %t >%t.out 2>&1
+// RUN: FileCheck %s --check-prefix=CHECK < %t.out
+//
+// RUN: %clang_dfsan -gmlt -DALIGN=2 -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// RUN:     %run %t >%t.out 2>&1
+// RUN: FileCheck %s --check-prefix=CHECK < %t.out
+//
+// rUN: %clang_dfsan -DTEST64 -DALIGN=5 -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// rUN:     %run %t >%t.out 2>&1
+// rUN: FileCheck %s --check-prefix=CHECK < %t.out
+//
+// rUN: %clang_dfsan -DTEST32 -DALIGN=3 -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// rUN:     %run %t >%t.out 2>&1
+// rUN: FileCheck %s --check-prefix=CHECK < %t.out
+//
+// RUN: %clang_dfsan -gmlt -DALIGN=1 -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
 // RUN:     %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK < %t.out
 //
@@ -37,15 +57,21 @@ int main(int argc, char *argv[]) {
 
 // CHECK: Taint value 0x8 {{.*}} origin tracking ()
 // CHECK: Origin value: {{.*}}, Taint value was stored to memory at
+// CHECK: #0 {{.*}} in main {{.*}}origin_ldst.c:[[@LINE-13]]
 
 // CHECK: Origin value: {{.*}}, Taint value was created at
+// CHECK: #0 {{.*}} in main {{.*}}origin_ldst.c:[[@LINE-17]]
 
 // CHECK: Taint value 0x4 {{.*}} origin tracking ()
 // CHECK: Origin value: {{.*}}, Taint value was stored to memory at
+// CHECK: #0 {{.*}} in main {{.*}}origin_ldst.c:[[@LINE-14]]
 
 // CHECK: Origin value: {{.*}}, Taint value was created at
+// CHECK: #0 {{.*}} in main {{.*}}origin_ldst.c:[[@LINE-18]]
 
 // CHECK: Taint value 0x4 {{.*}} origin tracking ()
 // CHECK: Origin value: {{.*}}, Taint value was stored to memory at
+// CHECK: #0 {{.*}} in main {{.*}}origin_ldst.c:[[@LINE-21]]
 
 // CHECK: Origin value: {{.*}}, Taint value was created at
+// CHECK: #0 {{.*}} in main {{.*}}origin_ldst.c:[[@LINE-25]]

diff  --git a/compiler-rt/test/dfsan/origin_limit.c b/compiler-rt/test/dfsan/origin_limit.c
index b45972da4534..4f14363df957 100644
--- a/compiler-rt/test/dfsan/origin_limit.c
+++ b/compiler-rt/test/dfsan/origin_limit.c
@@ -1,4 +1,4 @@
-// RUN: %clang_dfsan -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t
+// RUN: %clang_dfsan -gmlt -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t
 //
 // RUN: %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK < %t.out

diff  --git a/compiler-rt/test/dfsan/origin_memset.c b/compiler-rt/test/dfsan/origin_memset.c
index 0ffa5c6ab245..afc9855e04d6 100644
--- a/compiler-rt/test/dfsan/origin_memset.c
+++ b/compiler-rt/test/dfsan/origin_memset.c
@@ -1,8 +1,8 @@
-// RUN: %clang_dfsan -DOFFSET=0 -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// RUN: %clang_dfsan -gmlt -DOFFSET=0 -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
 // RUN:     %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK0 < %t.out
 
-// RUN: %clang_dfsan -DOFFSET=10 -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// RUN: %clang_dfsan -gmlt -DOFFSET=10 -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
 // RUN:     %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK10 < %t.out
 
@@ -38,5 +38,9 @@ int main(int argc, char *argv[]) {
 // CHECK0: Taint value 0x8 {{.*}} origin tracking ()
 // CHECK0: Origin value: {{.*}}, Taint value was created at
 
+// CHECK0: #0 {{.*}} in main {{.*}}origin_memset.c:[[@LINE-10]]
+
 // CHECK10: Taint value 0x10 {{.*}} origin tracking ()
 // CHECK10: Origin value: {{.*}}, Taint value was created at
+
+// CHECK10: #0 {{.*}} in main {{.*}}origin_memset.c:[[@LINE-14]]

diff  --git a/compiler-rt/test/dfsan/origin_overlapped.c b/compiler-rt/test/dfsan/origin_overlapped.c
index d038132c1160..98b4d5073376 100644
--- a/compiler-rt/test/dfsan/origin_overlapped.c
+++ b/compiler-rt/test/dfsan/origin_overlapped.c
@@ -1,4 +1,4 @@
-// RUN: %clang_dfsan -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// RUN: %clang_dfsan -gmlt -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
 // RUN:     %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK < %t.out
 
@@ -16,5 +16,8 @@ int main(int argc, char *argv[]) {
 
 // CHECK: Taint value 0x8 {{.*}} origin tracking (bar)
 // CHECK: Origin value: {{.*}}, Taint value was stored to memory at
+// CHECK: #0 {{.*}} in main {{.*}}origin_overlapped.c:[[@LINE-7]]
 
 // CHECK: Origin value: {{.*}}, Taint value was created at
+
+// CHECK: #0 {{.*}} in main {{.*}}origin_overlapped.c:[[@LINE-12]]

diff  --git a/compiler-rt/test/dfsan/origin_set_label.c b/compiler-rt/test/dfsan/origin_set_label.c
index 460bd2f29b24..41617e7df147 100644
--- a/compiler-rt/test/dfsan/origin_set_label.c
+++ b/compiler-rt/test/dfsan/origin_set_label.c
@@ -1,8 +1,8 @@
-// RUN: %clang_dfsan -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
+// RUN: %clang_dfsan -gmlt -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true %s -o %t && \
 // RUN:     %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK < %t.out
 
-// RUN: %clang_dfsan -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true -mllvm -dfsan-instrument-with-call-threshold=0 %s -o %t && \
+// RUN: %clang_dfsan -gmlt -mllvm -dfsan-track-origins=1 -mllvm -dfsan-fast-16-labels=true -mllvm -dfsan-instrument-with-call-threshold=0 %s -o %t && \
 // RUN:     %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK < %t.out
 
@@ -21,10 +21,14 @@ int main(int argc, char *argv[]) {
 
 // CHECK: Taint value 0x8 {{.*}} origin tracking ()
 // CHECK: Origin value: {{.*}}, Taint value was stored to memory at
+// CHECK: #0 {{.*}} in main {{.*}}origin_set_label.c:[[@LINE-7]]
 
 // CHECK: Origin value: {{.*}}, Taint value was created at
+// CHECK: #0 {{.*}} in main {{.*}}origin_set_label.c:[[@LINE-11]]
 
 // CHECK: Taint value 0x8 {{.*}} origin tracking ()
 // CHECK: Origin value: {{.*}}, Taint value was stored to memory at
+// CHECK: #0 {{.*}} in main {{.*}}origin_set_label.c:[[@LINE-14]]
 
 // CHECK: Origin value: {{.*}}, Taint value was created at
+// CHECK: #0 {{.*}} in main {{.*}}origin_set_label.c:[[@LINE-18]]

diff  --git a/compiler-rt/test/dfsan/origin_untainted.c b/compiler-rt/test/dfsan/origin_untainted.c
index 9a0809b10ad5..6404618a20c1 100644
--- a/compiler-rt/test/dfsan/origin_untainted.c
+++ b/compiler-rt/test/dfsan/origin_untainted.c
@@ -1,4 +1,4 @@
-// RUN: %clang_dfsan -mllvm -dfsan-fast-16-labels=true -mllvm -dfsan-track-origins=1 %s -o %t && \
+// RUN: %clang_dfsan -gmlt -mllvm -dfsan-fast-16-labels=true -mllvm -dfsan-track-origins=1 %s -o %t && \
 // RUN:     %run %t >%t.out 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK < %t.out
 


        


More information about the llvm-commits mailing list