Unit tests for the new clang flags.
Details
Diff Detail
- Build Status
Buildable 1131 Build 1131: arc lint + arc unit
Event Timeline
test/tsan/atomic_free.cc | ||
---|---|---|
1–11 | Why not just use a pipe instead of writing to %t.out? If you're doing this only to maintain 80-column width, then you can split a line using a backslash: // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 \ // RUN: | FileCheck %s Anyway, I think RUN commands are allowed to be longer that 80 columns (but others probably disagree), there's a lot of tests already doing that. |
This revision causes failures on power for both BE and LE:
FAIL: ThreadSanitizer-powerpc64le :: simple_stack.c (237 of 339)
- TEST 'ThreadSanitizer-powerpc64le :: simple_stack.c' FAILED ****
Script:
/home/seurer/llvm/build/llvm-test2/./bin/clang -fsanitize=thread -Wall -m64 -gline-tables-only -O1 /home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/simple_stack.c -o /home/seurer/llvm/build/llvm-test2/projects/compiler-rt/test/tsan/POWERPC64LEConfig/Output/simple_stack.c.tmp && /home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/deflake.bash /home/seurer/llvm/build/llvm-test2/projects/compiler-rt/test/tsan/POWERPC64LEConfig/Output/simple_stack.c.tmp 2>&1 | FileCheck /home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/simple_stack.c
/home/seurer/llvm/build/llvm-test2/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -std=c++11 -O1 /home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/simple_stack.c -o /home/seurer/llvm/build/llvm-test2/projects/compiler-rt/test/tsan/POWERPC64LEConfig/Output/simple_stack.c.tmp -fno-sanitize-thread-func-entry-exit && /home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/deflake.bash /home/seurer/llvm/build/llvm-test2/projects/compiler-rt/test/tsan/POWERPC64LEConfig/Output/simple_stack.c.tmp 2>&1 | FileCheck --check-prefix=CHECK-FUNC-ENTRY-EXIT-OFF /home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/simple_stack.c
/home/seurer/llvm/build/llvm-test2/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -std=c++11 -O1 /home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/simple_stack.c -o /home/seurer/llvm/build/llvm-test2/projects/compiler-rt/test/tsan/POWERPC64LEConfig/Output/simple_stack.c.tmp -mllvm -tsan-instrument-func-entry-exit=0 && /home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/deflake.bash /home/seurer/llvm/build/llvm-test2/projects/compiler-rt/test/tsan/POWERPC64LEConfig/Output/simple_stack.c.tmp 2>&1 | FileCheck --check-prefix=CHECK-FUNC-ENTRY-EXIT-OFF /home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/simple_stack.c
Exit Code: 1
Command Output (stderr):
clang-4.0: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
/home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/simple_stack.c:84:36: error: expected string not found in input
// CHECK-FUNC-ENTRY-EXIT-OFF-NEXT: #1 main{{.*}} {{.*}}simple_stack.c:42{{(:3)?}} ({{.*}})
^
<stdin>:13:2: note: scanning from here
#1 StartThread(unsigned long*, void* (*)(void*)) /home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/simple_stack.c:36:3 (simple_stack.c.tmp+0x0000100e79c8)
^
<stdin>:19:90: note: possible intended match here
SUMMARY: ThreadSanitizer: data race /home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/simple_stack.c:6:10 in foo1()
^
In the new sets of tests the output being looked for is wrong.
Actual output:
Thread T1 (tid=131029, running) created by main thread at: #0 pthread_create /home/seurer/llvm/llvm-test2/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:902 (simple_stack.test2+0x00001005a3f0) #1 StartThread(unsigned long*, void* (*)(void*)) /home/seurer/llvm/llvm-test2/projects/compiler-rt/test/tsan/simple_stack.c:36 (simple_stack.test2+0x0000100e79c8)
What is being looked for:
CHECK-FUNC-ENTRY-EXIT-OFF: Thread T1 (tid={{.*}}, running) created by main thread at:
CHECK-FUNC-ENTRY-EXIT-OFF-NEXT: #0 pthread_create {{.*}} ({{.*}})
// CHECK-FUNC-ENTRY-EXIT-OFF-NEXT: #1 main{{.*}} {{.*}}simple_stack.c:42{{(:3)?}} ({{.*}})
Note the actual output has "StartThread" as the #1 function while "main" is being looked for.
This is true for the test for Thread T2 as well.
I'll look into that (meanwhile D26629 should make this test pass).
Apparently, on other platforms it look like this (from my local run on x86):
Thread T1 (tid=113512, running) created by main thread at: #0 pthread_create /usr/local/google/home/alekseys/llvm-dev/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:902 (simple_stack.c.tmp+0x00000043ea75) #1 main /usr/local/google/home/alekseys/llvm-dev/llvm/projects/compiler-rt/test/tsan/simple_stack.c:42 (simple_stack.c.tmp+0x00000049d75b)
Why not just use a pipe instead of writing to %t.out? If you're doing this only to maintain 80-column width, then you can split a line using a backslash:
Anyway, I think RUN commands are allowed to be longer that 80 columns (but others probably disagree), there's a lot of tests already doing that.