summaryrefslogtreecommitdiff
path: root/test/tsan/virtual_inheritance_compile_bug.cc
blob: 2a50c2e88d0136d04f116187e638aa8038059a87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Regression test for http://code.google.com/p/thread-sanitizer/issues/detail?id=3.
// The C++ variant is much more compact that the LLVM IR equivalent.

// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
#include <stdio.h>
struct AAA              {  virtual long aaa () { return 0; } };  // NOLINT
struct BBB: virtual AAA { unsigned long bbb; };  // NOLINT
struct CCC: virtual AAA { };
struct DDD: CCC, BBB { DDD(); };  // NOLINT
DDD::DDD()  { }
int main() {
  DDD d;
  printf("OK\n");
}
// CHECK: OK