[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / compiler-rt / test / tsan / Darwin / libcxx-shared-ptr-recursive.mm
bloba9a3a96f2adac7dee0b753fa19b85e42e9fc5ba7
1 // RUN: %clangxx_tsan %s -o %t -framework Foundation
2 // RUN: %run %t 2>&1 | FileCheck %s
4 #import <Foundation/Foundation.h>
6 #import <memory>
8 struct InnerStruct {
9   ~InnerStruct() {
10     fprintf(stderr, "~InnerStruct\n");
11   }
14 struct MyStruct {
15   std::shared_ptr<InnerStruct> inner_object;
16   ~MyStruct() {
17     fprintf(stderr, "~MyStruct\n");
18   }
21 int main(int argc, const char *argv[]) {
22   fprintf(stderr, "Hello world.\n");
24   {
25     std::shared_ptr<MyStruct> shared(new MyStruct());
26     shared->inner_object = std::shared_ptr<InnerStruct>(new InnerStruct());
27   }
29   fprintf(stderr, "Done.\n");
32 // CHECK: Hello world.
33 // CHECK: ~MyStruct
34 // CHECK: ~InnerStruct
35 // CHECK: Done.
36 // CHECK-NOT: WARNING: ThreadSanitizer