-
Notifications
You must be signed in to change notification settings - Fork 1
[compiler-rt] Introduce rtsan clang frontend #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // RUN: %clang -target x86_64-unknown-linux -fsanitize=realtime %s -S -emit-llvm -o - | FileCheck %s | ||
| // RUN: %clang -O1 -target x86_64-unknown-linux -fsanitize=realtime %s -S -emit-llvm -o - | FileCheck %s | ||
| // RUN: %clang -O2 -target x86_64-unknown-linux -fsanitize=realtime %s -S -emit-llvm -o - | FileCheck %s | ||
| // RUN: %clang -O3 -target x86_64-unknown-linux -fsanitize=realtime %s -S -emit-llvm -o - | FileCheck %s | ||
| // RUN: %clang -target x86_64-unknown-linux -fsanitize=realtime %s -S -emit-llvm -flto=thin -o - | FileCheck %s | ||
| // RUN: %clang -O2 -target x86_64-unknown-linux -fsanitize=realtime %s -S -emit-llvm -flto=thin -o - | FileCheck %s | ||
| // RUN: %clang -target x86_64-unknown-linux -fsanitize=realtime %s -S -emit-llvm -flto -o - | FileCheck %s | ||
| // RUN: %clang -O2 -target x86_64-unknown-linux -fsanitize=realtime %s -S -emit-llvm -flto -o - | FileCheck %s | ||
|
|
||
| int foo(int *a) [[clang::nonblocking]] { return *a; } | ||
| // CHECK: __rtsan_realtime_enter | ||
|
||
| // CHECK: __rtsan_realtime_exit | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // RUN: %clangxx -fsanitize=realtime %s -o %t | ||
davidtrevelyan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // RUN: not %run %t 2>&1 | FileCheck %s | ||
| // UNSUPPORTED: ios | ||
|
|
||
| // Intent: Ensure that an intercepted call in a [[clang::nonblocking]] function | ||
| // is flagged as an error. Basic smoke test. | ||
|
|
||
| #include <stdlib.h> | ||
|
|
||
| void violation() [[clang::nonblocking]] { void *Ptr = malloc(2); } | ||
|
|
||
| int main() { | ||
| violation(); | ||
| return 0; | ||
| // CHECK: {{.*Real-time violation.*}} | ||
| // CHECK: {{.*malloc*}} | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // RUN: %clangxx %s -o %t | ||
| // RUN: %run %t 2>&1 | FileCheck %s | ||
| // UNSUPPORTED: ios | ||
|
|
||
| // Intent: Ensure [[clang::nonblocking]] has no impact if -fsanitize=realtime is not used | ||
|
|
||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
|
|
||
| // In this test, we don't use the -fsanitize=realtime flag, so nothing | ||
| // should happen here | ||
| void violation() [[clang::nonblocking]] { void *Ptr = malloc(2); } | ||
|
|
||
| int main() { | ||
| printf("Starting run\n"); | ||
| violation(); | ||
| printf("No violations ended the program\n"); | ||
| return 0; | ||
| // CHECK: {{.*Starting run.*}} | ||
| // CHECK NOT: {{.*Real-time violation.*}} | ||
| // CHECK NOT: {{.*malloc*}} | ||
| // CHECK: {{.*No violations ended the program.*}} | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.