Skip to content

Commit f8f8e39

Browse files
committed
Add sandbox_forbidden_functions.cpp test
1 parent a1dbb81 commit f8f8e39

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %clangxx %s -o %t && %run %t 2>&1 | FileCheck %s
2+
3+
// REQUIRES: target-x86 || target-x86_64
4+
5+
#include <stdio.h>
6+
#include <stdlib.h>
7+
8+
// Functions that sandboxes don't like. If a sanitizer calls it, this test will
9+
// likely fail. (There will be a false negative if the sanitizer only calls it
10+
// during an obscure code path that is not exercised by this test.)
11+
//
12+
// Known false positive: TSan with high-entropy ASLR (in a non-sandboxed
13+
// environment)
14+
extern "C" int personality(unsigned long) { abort(); }
15+
16+
int main(int argc, char **argv) {
17+
printf("Hello World!\n");
18+
return 0;
19+
}
20+
21+
// CHECK: Hello World!

0 commit comments

Comments
 (0)