view compiler-rt/test/tsan/virtual_inheritance_compile_bug.cpp @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1d019706d866
children
line wrap: on
line source

// Regression test for https://github.com/google/sanitizers/issues/410.
// 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; }
};
struct BBB : virtual AAA {
  unsigned long bbb;
};
struct CCC: virtual AAA { };
struct DDD : CCC, BBB {
  DDD();
};
DDD::DDD()  { }
int main() {
  DDD d;
  fprintf(stderr, "OK\n");
}
// CHECK: OK