[compiler-rt] r351159 - Revert alignment assumptions changes
Vlad Tsyrklevich via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 14 19:38:02 PST 2019
Author: vlad.tsyrklevich
Date: Mon Jan 14 19:38:02 2019
New Revision: 351159
URL: http://llvm.org/viewvc/llvm-project?rev=351159&view=rev
Log:
Revert alignment assumptions changes
Revert r351104-6, r351109, r351110, r351119, r351134, and r351153. These
changes fail on the sanitizer bots.
Removed:
compiler-rt/trunk/test/fuzzer/AlignmentAssumptionTest.cpp
compiler-rt/trunk/test/fuzzer/fuzzer-alignment-assumption.test
compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-align_value-on-lvalue.cpp
compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-align_value-on-paramvar.cpp
compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-alloc_align-on-function-variable.cpp
compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-alloc_align-on-function.cpp
compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp
compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-assume_aligned-on-function.cpp
compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-blacklist.cpp
compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-three-params-variable.cpp
compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-three-params.cpp
compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-two-params.cpp
compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-openmp.cpp
compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-summary.cpp
compiler-rt/trunk/test/ubsan_minimal/TestCases/alignment-assumption.c
Modified:
compiler-rt/trunk/lib/ubsan/ubsan_checks.inc
compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc
compiler-rt/trunk/lib/ubsan/ubsan_handlers.h
compiler-rt/trunk/lib/ubsan/ubsan_interface.inc
compiler-rt/trunk/lib/ubsan_minimal/ubsan_minimal_handlers.cc
Modified: compiler-rt/trunk/lib/ubsan/ubsan_checks.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/ubsan_checks.inc?rev=351159&r1=351158&r2=351159&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/ubsan_checks.inc (original)
+++ compiler-rt/trunk/lib/ubsan/ubsan_checks.inc Mon Jan 14 19:38:02 2019
@@ -21,7 +21,6 @@ UBSAN_CHECK(GenericUB, "undefined-behavi
UBSAN_CHECK(NullPointerUse, "null-pointer-use", "null")
UBSAN_CHECK(PointerOverflow, "pointer-overflow", "pointer-overflow")
UBSAN_CHECK(MisalignedPointerUse, "misaligned-pointer-use", "alignment")
-UBSAN_CHECK(AlignmentAssumption, "alignment-assumption", "alignment")
UBSAN_CHECK(InsufficientObjectSize, "insufficient-object-size", "object-size")
UBSAN_CHECK(SignedIntegerOverflow, "signed-integer-overflow",
"signed-integer-overflow")
Modified: compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc?rev=351159&r1=351158&r2=351159&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc (original)
+++ compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc Mon Jan 14 19:38:02 2019
@@ -106,62 +106,6 @@ void __ubsan::__ubsan_handle_type_mismat
Die();
}
-static void handleAlignmentAssumptionImpl(AlignmentAssumptionData *Data,
- ValueHandle Pointer,
- ValueHandle Alignment,
- ValueHandle Offset,
- ReportOptions Opts) {
- Location Loc = Data->Loc.acquire();
- SourceLocation AssumptionLoc = Data->AssumptionLoc.acquire();
-
- ErrorType ET = ErrorType::AlignmentAssumption;
-
- if (ignoreReport(Loc.getSourceLocation(), Opts, ET))
- return;
-
- ScopedReport R(Opts, Loc, ET);
-
- uptr RealPointer = Pointer - Offset;
- uptr LSB = LeastSignificantSetBitIndex(RealPointer);
- uptr ActualAlignment = uptr(1) << LSB;
-
- uptr Mask = Alignment - 1;
- uptr MisAlignmentOffset = RealPointer & Mask;
-
- if (!Offset) {
- Diag(Loc, DL_Error, ET,
- "assumption of %0 byte alignment for pointer of type %1 failed")
- << Alignment << Data->Type;
- } else {
- Diag(Loc, DL_Error, ET,
- "assumption of %0 byte alignment (with offset of %1 byte) for pointer "
- "of type %2 failed")
- << Alignment << Offset << Data->Type;
- }
-
- if (!AssumptionLoc.isInvalid())
- Diag(AssumptionLoc, DL_Note, ET, "alignment assumption was specified here");
-
- Diag(RealPointer, DL_Note, ET,
- "%0address is %1 aligned, misalignment offset is %2 bytes")
- << (Offset ? "offset " : "") << ActualAlignment << MisAlignmentOffset;
-}
-
-void __ubsan::__ubsan_handle_alignment_assumption(AlignmentAssumptionData *Data,
- ValueHandle Pointer,
- ValueHandle Alignment,
- ValueHandle Offset) {
- GET_REPORT_OPTIONS(false);
- handleAlignmentAssumptionImpl(Data, Pointer, Alignment, Offset, Opts);
-}
-void __ubsan::__ubsan_handle_alignment_assumption_abort(
- AlignmentAssumptionData *Data, ValueHandle Pointer, ValueHandle Alignment,
- ValueHandle Offset) {
- GET_REPORT_OPTIONS(true);
- handleAlignmentAssumptionImpl(Data, Pointer, Alignment, Offset, Opts);
- Die();
-}
-
/// \brief Common diagnostic emission for various forms of integer overflow.
template <typename T>
static void handleIntegerOverflowImpl(OverflowData *Data, ValueHandle LHS,
Modified: compiler-rt/trunk/lib/ubsan/ubsan_handlers.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/ubsan_handlers.h?rev=351159&r1=351158&r2=351159&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/ubsan_handlers.h (original)
+++ compiler-rt/trunk/lib/ubsan/ubsan_handlers.h Mon Jan 14 19:38:02 2019
@@ -39,17 +39,6 @@ struct TypeMismatchData {
/// type.
RECOVERABLE(type_mismatch_v1, TypeMismatchData *Data, ValueHandle Pointer)
-struct AlignmentAssumptionData {
- SourceLocation Loc;
- SourceLocation AssumptionLoc;
- const TypeDescriptor &Type;
-};
-
-/// \brief Handle a runtime alignment assumption check failure,
-/// caused by a misaligned pointer.
-RECOVERABLE(alignment_assumption, AlignmentAssumptionData *Data,
- ValueHandle Pointer, ValueHandle Alignment, ValueHandle Offset)
-
struct OverflowData {
SourceLocation Loc;
const TypeDescriptor &Type;
Modified: compiler-rt/trunk/lib/ubsan/ubsan_interface.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/ubsan_interface.inc?rev=351159&r1=351158&r2=351159&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/ubsan_interface.inc (original)
+++ compiler-rt/trunk/lib/ubsan/ubsan_interface.inc Mon Jan 14 19:38:02 2019
@@ -10,8 +10,6 @@
//===----------------------------------------------------------------------===//
INTERFACE_FUNCTION(__ubsan_handle_add_overflow)
INTERFACE_FUNCTION(__ubsan_handle_add_overflow_abort)
-INTERFACE_FUNCTION(__ubsan_handle_alignment_assumption)
-INTERFACE_FUNCTION(__ubsan_handle_alignment_assumption_abort)
INTERFACE_FUNCTION(__ubsan_handle_builtin_unreachable)
INTERFACE_FUNCTION(__ubsan_handle_cfi_bad_type)
INTERFACE_FUNCTION(__ubsan_handle_cfi_check_fail)
Modified: compiler-rt/trunk/lib/ubsan_minimal/ubsan_minimal_handlers.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan_minimal/ubsan_minimal_handlers.cc?rev=351159&r1=351158&r2=351159&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan_minimal/ubsan_minimal_handlers.cc (original)
+++ compiler-rt/trunk/lib/ubsan_minimal/ubsan_minimal_handlers.cc Mon Jan 14 19:38:02 2019
@@ -95,7 +95,6 @@ void NORETURN CheckFailed(const char *fi
HANDLER_NORECOVER(name, msg)
HANDLER(type_mismatch, "type-mismatch")
-HANDLER(alignment_assumption, "alignment-assumption")
HANDLER(add_overflow, "add-overflow")
HANDLER(sub_overflow, "sub-overflow")
HANDLER(mul_overflow, "mul-overflow")
Removed: compiler-rt/trunk/test/fuzzer/AlignmentAssumptionTest.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/fuzzer/AlignmentAssumptionTest.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/fuzzer/AlignmentAssumptionTest.cpp (original)
+++ compiler-rt/trunk/test/fuzzer/AlignmentAssumptionTest.cpp (removed)
@@ -1,27 +0,0 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-
-// Test for alignment assumption failure.
-
-#include <assert.h>
-#include <climits>
-#include <cstddef>
-#include <cstdint>
-#include <cstdlib>
-#include <iostream>
-
-static volatile int32_t Sink;
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
- assert(Data);
- if (Size > 0 && Data[0] == 'H') {
- Sink = 1;
- if (Size > 1 && Data[1] == 'i') {
- Sink = 2;
- if (Size > 2 && Data[2] == '!') {
- __builtin_assume_aligned(Data, 0x80000000);
- }
- }
- }
- return 0;
-}
Removed: compiler-rt/trunk/test/fuzzer/fuzzer-alignment-assumption.test
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/fuzzer/fuzzer-alignment-assumption.test?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/fuzzer/fuzzer-alignment-assumption.test (original)
+++ compiler-rt/trunk/test/fuzzer/fuzzer-alignment-assumption.test (removed)
@@ -1,7 +0,0 @@
-RUN: rm -f %t-AlignmentAssumptionTest-Ubsan
-RUN: %cpp_compiler -fsanitize=alignment -fno-sanitize-recover=all %S/AlignmentAssumptionTest.cpp -o %t-AlignmentAssumptionTest-Ubsan
-RUN: not %run %t-AlignmentAssumptionTest-Ubsan 2>&1 | FileCheck %s
-CHECK: AlignmentAssumptionTest.cpp:22:34: runtime error: assumption of 2147483648 byte alignment for pointer of type 'const {{.*}} *' (aka 'const unsigned char *') failed
-CHECK: 0x{{.*}}: note: address is {{.*}} aligned, misalignment offset is {{.*}} byte
-
-CHECK: Test unit written to ./crash-
Removed: compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-align_value-on-lvalue.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-align_value-on-lvalue.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-align_value-on-lvalue.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-align_value-on-lvalue.cpp (removed)
@@ -1,30 +0,0 @@
-// RUN: %clang -x c -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-typedef char ** __attribute__((align_value(0x80000000))) aligned_char;
-
-struct ac_struct {
- aligned_char a;
-};
-
-char **load_from_ac_struct(struct ac_struct* x) {
- return x->a;
-}
-
-int main(int argc, char* argv[]) {
- struct ac_struct x;
- x.a = argv; // FIXME: it is weird that this does not also have an assumption.
- load_from_ac_struct(&x);
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-7]]:13: runtime error: assumption of 2147483648 byte alignment for pointer of type 'aligned_char' (aka 'char **') failed
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-15]]:32: note: alignment assumption was specified here
- // CHECK: 0x{{.*}}: note: address is {{.*}} aligned, misalignment offset is {{.*}} byte
-
- return 0;
-}
Removed: compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-align_value-on-paramvar.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-align_value-on-paramvar.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-align_value-on-paramvar.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-align_value-on-paramvar.cpp (removed)
@@ -1,24 +0,0 @@
-// RUN: %clang -x c -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-char** passthrough(__attribute__((align_value(0x80000000))) char **x) {
- return x;
-}
-
-int main(int argc, char* argv[]) {
- passthrough(argv);
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-5]]:10: runtime error: assumption of 2147483648 byte alignment for pointer of type 'char **' failed
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-7]]:35: note: alignment assumption was specified here
- // CHECK: 0x{{.*}}: note: address is {{.*}} aligned, misalignment offset is {{.*}} byte
-
- // FIXME: shouldn't there be an assumption on the caller's side too?
-
- return 0;
-}
Removed: compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-alloc_align-on-function-variable.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-alloc_align-on-function-variable.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-alloc_align-on-function-variable.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-alloc_align-on-function-variable.cpp (removed)
@@ -1,30 +0,0 @@
-// FIXME: Fails on android, armv7. Not sure what is going on.
-// XFAIL: *
-
-// RUN: %clang -x c -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-char **__attribute__((alloc_align(2)))
-passthrough(char **x, unsigned long alignment) {
- return x;
-}
-
-unsigned long alignment;
-
-int main(int argc, char* argv[]) {
- alignment = 0x80000000;
-
- passthrough(argv, alignment);
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-1]]:3: runtime error: assumption of 2147483648 byte alignment for pointer of type 'char **' failed
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-12]]:23: note: alignment assumption was specified here
- // CHECK: 0x{{.*}}: note: address is {{.*}} aligned, misalignment offset is {{.*}} byte
-
- return 0;
-}
Removed: compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-alloc_align-on-function.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-alloc_align-on-function.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-alloc_align-on-function.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-alloc_align-on-function.cpp (removed)
@@ -1,26 +0,0 @@
-// FIXME: Fails on android, armv7. Not sure what is going on.
-// XFAIL: *
-
-// RUN: %clang -x c -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-char **__attribute__((alloc_align(2)))
-passthrough(char **x, unsigned long alignment) {
- return x;
-}
-
-int main(int argc, char* argv[]) {
- passthrough(argv, 0x80000000);
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-1]]:3: runtime error: assumption of 2147483648 byte alignment for pointer of type 'char **' failed
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-8]]:23: note: alignment assumption was specified here
- // CHECK: 0x{{.*}}: note: address is {{.*}} aligned, misalignment offset is {{.*}} byte
-
- return 0;
-}
Removed: compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp (removed)
@@ -1,22 +0,0 @@
-// RUN: %clang -x c -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-char ** __attribute__((assume_aligned(0x80000000, 42))) passthrough(char** x) {
- return x;
-}
-
-int main(int argc, char* argv[]) {
- passthrough(argv);
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-1]]:3: runtime error: assumption of 2147483648 byte alignment (with offset of 42 byte) for pointer of type 'char **' failed
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-7]]:24: note: alignment assumption was specified here
- // CHECK: 0x{{.*}}: note: offset address is {{.*}} aligned, misalignment offset is {{.*}} byte
-
- return 0;
-}
Removed: compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-assume_aligned-on-function.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-assume_aligned-on-function.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-assume_aligned-on-function.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-attribute-assume_aligned-on-function.cpp (removed)
@@ -1,22 +0,0 @@
-// RUN: %clang -x c -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-char ** __attribute__((assume_aligned(0x80000000))) passthrough(char** x) {
- return x;
-}
-
-int main(int argc, char* argv[]) {
- passthrough(argv);
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-1]]:3: runtime error: assumption of 2147483648 byte alignment for pointer of type 'char **' failed
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-7]]:24: note: alignment assumption was specified here
- // CHECK: 0x{{.*}}: note: address is {{.*}} aligned, misalignment offset is {{.*}} byte
-
- return 0;
-}
Removed: compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-blacklist.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-blacklist.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-blacklist.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-blacklist.cpp (removed)
@@ -1,14 +0,0 @@
-// RUN: %clang -fsanitize=alignment -fno-sanitize-recover=alignment -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption "
-
-// RUN: rm -f %tmp
-// RUN: echo "[alignment]" >> %tmp
-// RUN: echo "fun:main" >> %tmp
-// RUN: %clang -fsanitize=alignment -fno-sanitize-recover=alignment -fsanitize-blacklist=%tmp -O0 %s -o %t && %run %t 2>&1
-
-int main(int argc, char* argv[]) {
- __builtin_assume_aligned(argv, 0x80000000);
- // CHECK: {{.*}}alignment-assumption-blacklist.cpp:[[@LINE-1]]:28: runtime error: assumption of 2147483648 byte alignment for pointer of type 'char **' failed
- // CHECK: 0x{{.*}}: note: address is {{.*}} aligned, misalignment offset is {{.*}} byte
-
- return 0;
-}
Removed: compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-three-params-variable.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-three-params-variable.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-three-params-variable.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-three-params-variable.cpp (removed)
@@ -1,21 +0,0 @@
-// RUN: %clang -x c -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-volatile long offset;
-
-int main(int argc, char* argv[]) {
- offset = 42;
-
- __builtin_assume_aligned(argv, 0x80000000, offset);
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-1]]:28: runtime error: assumption of 2147483648 byte alignment (with offset of 42 byte) for pointer of type 'char **' failed
- // CHECK: 0x{{.*}}: note: offset address is {{.*}} aligned, misalignment offset is {{.*}} byte
-
- return 0;
-}
Removed: compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-three-params.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-three-params.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-three-params.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-three-params.cpp (removed)
@@ -1,17 +0,0 @@
-// RUN: %clang -x c -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-int main(int argc, char* argv[]) {
- __builtin_assume_aligned(argv, 0x80000000, 42);
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-1]]:28: runtime error: assumption of 2147483648 byte alignment (with offset of 42 byte) for pointer of type 'char **' failed
- // CHECK: 0x{{.*}}: note: offset address is {{.*}} aligned, misalignment offset is {{.*}} byte
-
- return 0;
-}
Removed: compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-two-params.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-two-params.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-two-params.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-builtin_assume_aligned-two-params.cpp (removed)
@@ -1,17 +0,0 @@
-// RUN: %clang -x c -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-int main(int argc, char* argv[]) {
- __builtin_assume_aligned(argv, 0x80000000);
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-1]]:28: runtime error: assumption of 2147483648 byte alignment for pointer of type 'char **' failed
- // CHECK: 0x{{.*}}: note: address is {{.*}} aligned, misalignment offset is {{.*}} byte
-
- return 0;
-}
Removed: compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-openmp.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-openmp.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-openmp.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-openmp.cpp (removed)
@@ -1,19 +0,0 @@
-// RUN: %clang -x c -fsanitize=alignment -fopenmp-simd -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -fopenmp-simd -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -fopenmp-simd -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c -fsanitize=alignment -fopenmp-simd -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-// RUN: %clang -x c++ -fsanitize=alignment -fopenmp-simd -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -fopenmp-simd -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -fopenmp-simd -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-// RUN: %clang -x c++ -fsanitize=alignment -fopenmp-simd -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="error:"
-
-int main(int argc, char* argv[]) {
-#pragma omp for simd aligned(argv : 0x40000000)
- for(int x = 0; x < 1; x++)
- argv[x] = argv[x];
- // CHECK: {{.*}}alignment-assumption-{{.*}}.cpp:[[@LINE-3]]:30: runtime error: assumption of 1073741824 byte alignment for pointer of type 'char **' failed
- // CHECK: 0x{{.*}}: note: address is {{.*}} aligned, misalignment offset is {{.*}} byte
-
- return 0;
-}
Removed: compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-summary.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-summary.cpp?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-summary.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/alignment-assumption-summary.cpp (removed)
@@ -1,11 +0,0 @@
-// RUN: %clangxx -fsanitize=alignment %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOTYPE
-// RUN: %env_ubsan_opts=report_error_type=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE
-// REQUIRES: !ubsan-standalone && !ubsan-standalone-static
-
-int main(int argc, char* argv[]) {
- __builtin_assume_aligned(argv, 0x80000000);
- // CHECK-NOTYPE: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior {{.*}}summary.cpp:[[@LINE-1]]:28
- // CHECK-TYPE: SUMMARY: UndefinedBehaviorSanitizer: alignment-assumption {{.*}}summary.cpp:[[@LINE-2]]:28
- return 0;
-}
Removed: compiler-rt/trunk/test/ubsan_minimal/TestCases/alignment-assumption.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan_minimal/TestCases/alignment-assumption.c?rev=351158&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan_minimal/TestCases/alignment-assumption.c (original)
+++ compiler-rt/trunk/test/ubsan_minimal/TestCases/alignment-assumption.c (removed)
@@ -1,11 +0,0 @@
-// RUN: %clang -fsanitize=alignment %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK
-
-int main(int argc, char* argv[]) {
-// CHECK-NOT: alignment-assumption
-
- __builtin_assume_aligned(argv, 0x80000000);
-// CHECK: alignment-assumption
-// CHECK-NOT: alignment-assumption
-
- return 0;
-}
More information about the llvm-commits
mailing list