Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HWASan] Move LTO test to separate file.
The test fails on Android for an unknown reason but is still worth having for x86.
- Loading branch information
Showing
2 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Test globals with LTO, since it invokes the integrated assembler separately. | ||
// RUN: %clang_hwasan -flto %s -o %t | ||
// RUN: not %run %t 1 2>&1 | FileCheck %s | ||
|
||
// REQUIRES: pointer-tagging | ||
// UNSUPPORTED: android | ||
|
||
#include <stdlib.h> | ||
|
||
int x = 1; | ||
|
||
int main(int argc, char **argv) { | ||
// CHECK: Cause: global-overflow | ||
// CHECK: is located 0 bytes to the right of 4-byte global variable x {{.*}} in {{.*}}lto.c.tmp | ||
// CHECK-NOT: can not describe | ||
(&x)[atoi(argv[1])] = 1; | ||
} |