Skip to content

Commit 76cffc2

Browse files
committed
[sanitizer] Add O_TMPFILE test
For #108291
1 parent 4ab22d7 commit 76cffc2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: rm -rf %t.tmp
22
// RUN: mkdir -p %t.tmp
3-
// RUN: %clangxx -O1 %s -o %t && %run %t %t.tmp/1
3+
// RUN: %clangxx -O1 %s -o %t && %run %t %t.tmp/1 %t.tmp
4+
5+
#define _GNU_SOURCE
46

57
#include <assert.h>
68
#include <fcntl.h>
@@ -19,6 +21,10 @@ void test(const char *path, int flags) {
1921
}
2022

2123
int main(int argc, char *argv[]) {
22-
assert(argc == 2);
24+
assert(argc == 3);
2325
test(argv[1], O_RDWR | O_CREAT);
26+
27+
#ifdef O_TMPFILE
28+
test(argv[2], O_RDWR | O_TMPFILE);
29+
#endif
2430
}

0 commit comments

Comments
 (0)