xref: /aosp_15_r20/external/compiler-rt/test/tsan/virtual_inheritance_compile_bug.cc (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1 // Regression test for https://github.com/google/sanitizers/issues/410.
2 // The C++ variant is much more compact that the LLVM IR equivalent.
3 
4 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
5 #include <stdio.h>
aaaAAA6 struct AAA              {  virtual long aaa () { return 0; } };  // NOLINT
7 struct BBB: virtual AAA { unsigned long bbb; };  // NOLINT
8 struct CCC: virtual AAA { };
9 struct DDD: CCC, BBB { DDD(); };  // NOLINT
DDD()10 DDD::DDD()  { }
main()11 int main() {
12   DDD d;
13   fprintf(stderr, "OK\n");
14 }
15 // CHECK: OK
16