[compiler-rt] r182726 - Improve support for compiler-rt tests in CMake build.

Bill Wendling isanbard at gmail.com
Thu May 30 22:59:08 PDT 2013


Can't. It conflicts.

-bw

On May 30, 2013, at 10:35 PM, Alexey Samsonov <samsonov at google.com> wrote:

> Hi Bill!
> 
> On Fri, May 31, 2013 at 3:21 AM, Greg Fitzgerald <garious at gmail.com> wrote:
> Can you add this one to the release_33 branch too?
> 
> Do you mind backporting this for 3.3?
>  
> 
> Thanks,
> Greg
> 
> On Mon, May 27, 2013 at 2:35 AM, Alexey Samsonov <samsonov at google.com> wrote:
> > Author: samsonov
> > Date: Mon May 27 04:35:24 2013
> > New Revision: 182726
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=182726&view=rev
> > Log:
> > Improve support for compiler-rt tests in CMake build.
> >
> > Now compiler-rt tests run correctly if compiler-rt is checked out into
> > arbitrary directory (not necessarily projects/compiler-rt).
> > Patch by Greg Fitzgerald!
> >
> > Modified:
> >     compiler-rt/trunk/lib/asan/lit_tests/Unit/lit.cfg
> >     compiler-rt/trunk/lib/asan/lit_tests/Unit/lit.site.cfg.in
> >     compiler-rt/trunk/lib/asan/lit_tests/lit.cfg
> >     compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in
> >     compiler-rt/trunk/lib/lsan/lit_tests/Unit/lit.cfg
> >     compiler-rt/trunk/lib/lsan/lit_tests/Unit/lit.site.cfg.in
> >     compiler-rt/trunk/lib/lsan/lit_tests/lit.cfg
> >     compiler-rt/trunk/lib/lsan/lit_tests/lit.site.cfg.in
> >     compiler-rt/trunk/lib/msan/lit_tests/Unit/lit.cfg
> >     compiler-rt/trunk/lib/msan/lit_tests/Unit/lit.site.cfg.in
> >     compiler-rt/trunk/lib/msan/lit_tests/lit.cfg
> >     compiler-rt/trunk/lib/msan/lit_tests/lit.site.cfg.in
> >     compiler-rt/trunk/lib/sanitizer_common/tests/lit.cfg
> >     compiler-rt/trunk/lib/sanitizer_common/tests/lit.site.cfg.in
> >     compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.cfg
> >     compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.site.cfg.in
> >     compiler-rt/trunk/lib/tsan/lit_tests/lit.cfg
> >     compiler-rt/trunk/lib/tsan/lit_tests/lit.site.cfg.in
> >     compiler-rt/trunk/lib/ubsan/lit_tests/lit.cfg
> >     compiler-rt/trunk/lib/ubsan/lit_tests/lit.site.cfg.in
> >
> > Modified: compiler-rt/trunk/lib/asan/lit_tests/Unit/lit.cfg
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/Unit/lit.cfg?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/asan/lit_tests/Unit/lit.cfg (original)
> > +++ compiler-rt/trunk/lib/asan/lit_tests/Unit/lit.cfg Mon May 27 04:35:24 2013
> > @@ -11,9 +11,8 @@ def get_required_attr(config, attr_name)
> >    return attr_value
> >
> >  # Setup attributes common for all compiler-rt projects.
> > -llvm_src_root = get_required_attr(config, 'llvm_src_root')
> > -compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
> > -                                        "compiler-rt", "lib",
> > +compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
> > +compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root, "lib",
> >                                          "lit.common.unit.cfg")
> >  lit.load_config(config, compiler_rt_lit_unit_cfg)
> >
> >
> > Modified: compiler-rt/trunk/lib/asan/lit_tests/Unit/lit.site.cfg.in
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/Unit/lit.site.cfg.in?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/asan/lit_tests/Unit/lit.site.cfg.in (original)
> > +++ compiler-rt/trunk/lib/asan/lit_tests/Unit/lit.site.cfg.in Mon May 27 04:35:24 2013
> > @@ -3,6 +3,7 @@
> >
> >  config.target_triple = "@TARGET_TRIPLE@"
> >  config.llvm_src_root = "@LLVM_SOURCE_DIR@"
> > +config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
> >  config.llvm_build_mode = "@LLVM_BUILD_MODE@"
> >  config.asan_binary_dir = "@ASAN_BINARY_DIR@"
> >
> >
> > Modified: compiler-rt/trunk/lib/asan/lit_tests/lit.cfg
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/lit.cfg?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/asan/lit_tests/lit.cfg (original)
> > +++ compiler-rt/trunk/lib/asan/lit_tests/lit.cfg Mon May 27 04:35:24 2013
> > @@ -2,6 +2,14 @@
> >
> >  import os
> >
> > +def get_required_attr(config, attr_name):
> > +  attr_value = getattr(config, attr_name, None)
> > +  if not attr_value:
> > +    lit.fatal("No attribute %r in test configuration! You may need to run "
> > +              "tests from your build directory or add this attribute "
> > +              "to lit.site.cfg " % attr_name)
> > +  return attr_value
> > +
> >  # Setup config name.
> >  config.name = 'AddressSanitizer'
> >
> > @@ -30,14 +38,6 @@ if llvm_src_root is None:
> >    if not llvm_config:
> >      DisplayNoConfigMessage()
> >
> > -  # Validate that llvm-config points to the same source tree.
> > -  llvm_src_root = lit.util.capture(["llvm-config", "--src-root"]).strip()
> > -  asan_test_src_root = os.path.join(llvm_src_root, "projects", "compiler-rt",
> > -                                    "lib", "asan", "lit_tests")
> > -  if (os.path.realpath(asan_test_src_root) !=
> > -      os.path.realpath(config.test_source_root)):
> > -    DisplayNoConfigMessage()
> > -
> >    # Find out the presumed location of generated site config.
> >    llvm_obj_root = lit.util.capture(["llvm-config", "--obj-root"]).strip()
> >    asan_site_cfg = os.path.join(llvm_obj_root, "projects", "compiler-rt",
> > @@ -49,8 +49,9 @@ if llvm_src_root is None:
> >    raise SystemExit
> >
> >  # Setup attributes common for all compiler-rt projects.
> > -compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt",
> > -                                   "lib", "lit.common.cfg")
> > +compiler_rt_src_root = get_required_attr(config, "compiler_rt_src_root")
> > +compiler_rt_lit_cfg = os.path.join(compiler_rt_src_root, "lib",
> > +                                   "lit.common.cfg")
> >  if (not compiler_rt_lit_cfg) or (not os.path.exists(compiler_rt_lit_cfg)):
> >    lit.fatal("Can't find common compiler-rt lit config at: %r"
> >              % compiler_rt_lit_cfg)
> >
> > Modified: compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in (original)
> > +++ compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in Mon May 27 04:35:24 2013
> > @@ -5,6 +5,7 @@ config.target_triple = "@TARGET_TRIPLE@"
> >  config.host_os = "@HOST_OS@"
> >  config.llvm_src_root = "@LLVM_SOURCE_DIR@"
> >  config.llvm_obj_root = "@LLVM_BINARY_DIR@"
> > +config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
> >  config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
> >  config.clang = "@LLVM_BINARY_DIR@/bin/clang"
> >  config.compiler_rt_arch = "@COMPILER_RT_SUPPORTED_ARCH@"
> >
> > Modified: compiler-rt/trunk/lib/lsan/lit_tests/Unit/lit.cfg
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lit_tests/Unit/lit.cfg?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/lsan/lit_tests/Unit/lit.cfg (original)
> > +++ compiler-rt/trunk/lib/lsan/lit_tests/Unit/lit.cfg Mon May 27 04:35:24 2013
> > @@ -11,9 +11,8 @@ def get_required_attr(config, attr_name)
> >    return attr_value
> >
> >  # Setup attributes common for all compiler-rt projects.
> > -llvm_src_root = get_required_attr(config, 'llvm_src_root')
> > -compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
> > -                                        "compiler-rt", "lib",
> > +compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
> > +compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root, "lib",
> >                                          "lit.common.unit.cfg")
> >  lit.load_config(config, compiler_rt_lit_unit_cfg)
> >
> >
> > Modified: compiler-rt/trunk/lib/lsan/lit_tests/Unit/lit.site.cfg.in
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lit_tests/Unit/lit.site.cfg.in?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/lsan/lit_tests/Unit/lit.site.cfg.in (original)
> > +++ compiler-rt/trunk/lib/lsan/lit_tests/Unit/lit.site.cfg.in Mon May 27 04:35:24 2013
> > @@ -3,6 +3,7 @@
> >
> >  config.target_triple = "@TARGET_TRIPLE@"
> >  config.llvm_src_root = "@LLVM_SOURCE_DIR@"
> > +config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
> >  config.llvm_build_mode = "@LLVM_BUILD_MODE@"
> >  config.lsan_binary_dir = "@LSAN_BINARY_DIR@"
> >
> >
> > Modified: compiler-rt/trunk/lib/lsan/lit_tests/lit.cfg
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lit_tests/lit.cfg?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/lsan/lit_tests/lit.cfg (original)
> > +++ compiler-rt/trunk/lib/lsan/lit_tests/lit.cfg Mon May 27 04:35:24 2013
> > @@ -11,9 +11,8 @@ def get_required_attr(config, attr_name)
> >    return attr_value
> >
> >  # Setup attributes common for all compiler-rt projects.
> > -llvm_src_root = get_required_attr(config, 'llvm_src_root')
> > -compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
> > -                                        "compiler-rt", "lib",
> > +compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
> > +compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root, "lib",
> >                                          "lit.common.unit.cfg")
> >  lit.load_config(config, compiler_rt_lit_unit_cfg)
> >
> > @@ -24,8 +23,8 @@ config.name = 'LeakSanitizer'
> >  config.test_source_root = os.path.dirname(__file__)
> >
> >  # Setup attributes common for all compiler-rt projects.
> > -compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt",
> > -                                   "lib", "lit.common.cfg")
> > +compiler_rt_lit_cfg = os.path.join(compiler_rt_src_root, "lib",
> > +                                   "lit.common.cfg")
> >  if (not compiler_rt_lit_cfg) or (not os.path.exists(compiler_rt_lit_cfg)):
> >    lit.fatal("Can't find common compiler-rt lit config at: %r"
> >              % compiler_rt_lit_cfg)
> >
> > Modified: compiler-rt/trunk/lib/lsan/lit_tests/lit.site.cfg.in
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lit_tests/lit.site.cfg.in?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/lsan/lit_tests/lit.site.cfg.in (original)
> > +++ compiler-rt/trunk/lib/lsan/lit_tests/lit.site.cfg.in Mon May 27 04:35:24 2013
> > @@ -2,6 +2,7 @@ config.host_os = "@HOST_OS@"
> >  config.host_arch = "@HOST_ARCH@"
> >  config.llvm_build_mode = "@LLVM_BUILD_MODE@"
> >  config.llvm_src_root = "@LLVM_SOURCE_DIR@"
> > +config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
> >  config.llvm_obj_root = "@LLVM_BINARY_DIR@"
> >  config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
> >  config.clang = "@LLVM_BINARY_DIR@/bin/clang"
> >
> > Modified: compiler-rt/trunk/lib/msan/lit_tests/Unit/lit.cfg
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/lit_tests/Unit/lit.cfg?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/msan/lit_tests/Unit/lit.cfg (original)
> > +++ compiler-rt/trunk/lib/msan/lit_tests/Unit/lit.cfg Mon May 27 04:35:24 2013
> > @@ -11,9 +11,8 @@ def get_required_attr(config, attr_name)
> >    return attr_value
> >
> >  # Setup attributes common for all compiler-rt projects.
> > -llvm_src_root = get_required_attr(config, 'llvm_src_root')
> > -compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
> > -                                        "compiler-rt", "lib",
> > +compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
> > +compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root, "lib",
> >                                          "lit.common.unit.cfg")
> >  lit.load_config(config, compiler_rt_lit_unit_cfg)
> >
> >
> > Modified: compiler-rt/trunk/lib/msan/lit_tests/Unit/lit.site.cfg.in
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/lit_tests/Unit/lit.site.cfg.in?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/msan/lit_tests/Unit/lit.site.cfg.in (original)
> > +++ compiler-rt/trunk/lib/msan/lit_tests/Unit/lit.site.cfg.in Mon May 27 04:35:24 2013
> > @@ -3,6 +3,7 @@
> >
> >  config.target_triple = "@TARGET_TRIPLE@"
> >  config.llvm_src_root = "@LLVM_SOURCE_DIR@"
> > +config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
> >  config.llvm_build_mode = "@LLVM_BUILD_MODE@"
> >  config.msan_binary_dir = "@MSAN_BINARY_DIR@"
> >
> >
> > Modified: compiler-rt/trunk/lib/msan/lit_tests/lit.cfg
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/lit_tests/lit.cfg?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/msan/lit_tests/lit.cfg (original)
> > +++ compiler-rt/trunk/lib/msan/lit_tests/lit.cfg Mon May 27 04:35:24 2013
> > @@ -2,6 +2,14 @@
> >
> >  import os
> >
> > +def get_required_attr(config, attr_name):
> > +  attr_value = getattr(config, attr_name, None)
> > +  if not attr_value:
> > +    lit.fatal("No attribute %r in test configuration! You may need to run "
> > +              "tests from your build directory or add this attribute "
> > +              "to lit.site.cfg " % attr_name)
> > +  return attr_value
> > +
> >  # Setup config name.
> >  config.name = 'MemorySanitizer'
> >
> > @@ -30,14 +38,6 @@ if llvm_src_root is None:
> >    if not llvm_config:
> >      DisplayNoConfigMessage()
> >
> > -  # Validate that llvm-config points to the same source tree.
> > -  llvm_src_root = lit.util.capture(["llvm-config", "--src-root"]).strip()
> > -  msan_test_src_root = os.path.join(llvm_src_root, "projects", "compiler-rt",
> > -                                    "lib", "msan", "lit_tests")
> > -  if (os.path.realpath(msan_test_src_root) !=
> > -      os.path.realpath(config.test_source_root)):
> > -    DisplayNoConfigMessage()
> > -
> >    # Find out the presumed location of generated site config.
> >    llvm_obj_root = lit.util.capture(["llvm-config", "--obj-root"]).strip()
> >    msan_site_cfg = os.path.join(llvm_obj_root, "projects", "compiler-rt",
> > @@ -49,8 +49,9 @@ if llvm_src_root is None:
> >    raise SystemExit
> >
> >  # Setup attributes common for all compiler-rt projects.
> > -compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt",
> > -                                   "lib", "lit.common.cfg")
> > +compiler_rt_src_root = get_required_attr(config, "compiler_rt_src_root")
> > +compiler_rt_lit_cfg = os.path.join(compiler_rt_src_root, "lib",
> > +                                   "lit.common.cfg")
> >  if (not compiler_rt_lit_cfg) or (not os.path.exists(compiler_rt_lit_cfg)):
> >    lit.fatal("Can't find common compiler-rt lit config at: %r"
> >              % compiler_rt_lit_cfg)
> >
> > Modified: compiler-rt/trunk/lib/msan/lit_tests/lit.site.cfg.in
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/lit_tests/lit.site.cfg.in?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/msan/lit_tests/lit.site.cfg.in (original)
> > +++ compiler-rt/trunk/lib/msan/lit_tests/lit.site.cfg.in Mon May 27 04:35:24 2013
> > @@ -1,6 +1,7 @@
> >  config.target_triple = "@TARGET_TRIPLE@"
> >  config.host_os = "@HOST_OS@"
> >  config.llvm_src_root = "@LLVM_SOURCE_DIR@"
> > +config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
> >  config.llvm_obj_root = "@LLVM_BINARY_DIR@"
> >  config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
> >  config.clang = "@LLVM_BINARY_DIR@/bin/clang"
> >
> > Modified: compiler-rt/trunk/lib/sanitizer_common/tests/lit.cfg
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/lit.cfg?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/sanitizer_common/tests/lit.cfg (original)
> > +++ compiler-rt/trunk/lib/sanitizer_common/tests/lit.cfg Mon May 27 04:35:24 2013
> > @@ -11,9 +11,8 @@ def get_required_attr(config, attr_name)
> >    return attr_value
> >
> >  # Setup attributes common for all compiler-rt projects.
> > -llvm_src_root = get_required_attr(config, 'llvm_src_root')
> > -compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
> > -                                        "compiler-rt", "lib",
> > +compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
> > +compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root, "lib",
> >                                          "lit.common.unit.cfg")
> >  lit.load_config(config, compiler_rt_lit_unit_cfg)
> >
> >
> > Modified: compiler-rt/trunk/lib/sanitizer_common/tests/lit.site.cfg.in
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/lit.site.cfg.in?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/sanitizer_common/tests/lit.site.cfg.in (original)
> > +++ compiler-rt/trunk/lib/sanitizer_common/tests/lit.site.cfg.in Mon May 27 04:35:24 2013
> > @@ -3,6 +3,7 @@
> >
> >  config.llvm_obj_root = "@LLVM_BINARY_DIR@"
> >  config.llvm_src_root = "@LLVM_SOURCE_DIR@"
> > +config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
> >  config.llvm_build_mode = "@LLVM_BUILD_MODE@"
> >
> >  try:
> >
> > Modified: compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.cfg
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.cfg?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.cfg (original)
> > +++ compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.cfg Mon May 27 04:35:24 2013
> > @@ -11,9 +11,8 @@ def get_required_attr(config, attr_name)
> >    return attr_value
> >
> >  # Setup attributes common for all compiler-rt projects.
> > -llvm_src_root = get_required_attr(config, 'llvm_src_root')
> > -compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
> > -                                        "compiler-rt", "lib",
> > +compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
> > +compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root, "lib",
> >                                          "lit.common.unit.cfg")
> >  lit.load_config(config, compiler_rt_lit_unit_cfg)
> >
> >
> > Modified: compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.site.cfg.in
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.site.cfg.in?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.site.cfg.in (original)
> > +++ compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.site.cfg.in Mon May 27 04:35:24 2013
> > @@ -3,6 +3,7 @@
> >
> >  config.llvm_obj_root = "@LLVM_BINARY_DIR@"
> >  config.llvm_src_root = "@LLVM_SOURCE_DIR@"
> > +config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
> >  config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
> >  config.llvm_build_mode = "@LLVM_BUILD_MODE@"
> >
> >
> > Modified: compiler-rt/trunk/lib/tsan/lit_tests/lit.cfg
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/lit.cfg?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/tsan/lit_tests/lit.cfg (original)
> > +++ compiler-rt/trunk/lib/tsan/lit_tests/lit.cfg Mon May 27 04:35:24 2013
> > @@ -2,6 +2,14 @@
> >
> >  import os
> >
> > +def get_required_attr(config, attr_name):
> > +  attr_value = getattr(config, attr_name, None)
> > +  if not attr_value:
> > +    lit.fatal("No attribute %r in test configuration! You may need to run "
> > +              "tests from your build directory or add this attribute "
> > +              "to lit.site.cfg " % attr_name)
> > +  return attr_value
> > +
> >  # Setup config name.
> >  config.name = 'ThreadSanitizer'
> >
> > @@ -30,14 +38,6 @@ if llvm_src_root is None:
> >    if not llvm_config:
> >      DisplayNoConfigMessage()
> >
> > -  # Validate that llvm-config points to the same source tree.
> > -  llvm_src_root = lit.util.capture(["llvm-config", "--src-root"]).strip()
> > -  tsan_test_src_root = os.path.join(llvm_src_root, "projects", "compiler-rt",
> > -                                    "lib", "tsan", "lit_tests")
> > -  if (os.path.realpath(tsan_test_src_root) !=
> > -      os.path.realpath(config.test_source_root)):
> > -    DisplayNoConfigMessage()
> > -
> >    # Find out the presumed location of generated site config.
> >    llvm_obj_root = lit.util.capture(["llvm-config", "--obj-root"]).strip()
> >    tsan_site_cfg = os.path.join(llvm_obj_root, "projects", "compiler-rt",
> > @@ -49,8 +49,9 @@ if llvm_src_root is None:
> >    raise SystemExit
> >
> >  # Setup attributes common for all compiler-rt projects.
> > -compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt",
> > -                                   "lib", "lit.common.cfg")
> > +compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
> > +compiler_rt_lit_cfg = os.path.join(compiler_rt_src_root, "lib",
> > +                                   "lit.common.cfg")
> >  if (not compiler_rt_lit_cfg) or (not os.path.exists(compiler_rt_lit_cfg)):
> >    lit.fatal("Can't find common compiler-rt lit config at: %r"
> >              % compiler_rt_lit_cfg)
> >
> > Modified: compiler-rt/trunk/lib/tsan/lit_tests/lit.site.cfg.in
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/lit.site.cfg.in?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/tsan/lit_tests/lit.site.cfg.in (original)
> > +++ compiler-rt/trunk/lib/tsan/lit_tests/lit.site.cfg.in Mon May 27 04:35:24 2013
> > @@ -4,6 +4,7 @@
> >  config.clang = "@LLVM_BINARY_DIR@/bin/clang"
> >  config.host_os = "@HOST_OS@"
> >  config.llvm_src_root = "@LLVM_SOURCE_DIR@"
> > +config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
> >  config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
> >  config.target_triple = "@TARGET_TRIPLE@"
> >
> >
> > Modified: compiler-rt/trunk/lib/ubsan/lit_tests/lit.cfg
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/lit_tests/lit.cfg?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/ubsan/lit_tests/lit.cfg (original)
> > +++ compiler-rt/trunk/lib/ubsan/lit_tests/lit.cfg Mon May 27 04:35:24 2013
> > @@ -2,6 +2,14 @@
> >
> >  import os
> >
> > +def get_required_attr(config, attr_name):
> > +  attr_value = getattr(config, attr_name, None)
> > +  if not attr_value:
> > +    lit.fatal("No attribute %r in test configuration! You may need to run "
> > +              "tests from your build directory or add this attribute "
> > +              "to lit.site.cfg " % attr_name)
> > +  return attr_value
> > +
> >  # Setup config name.
> >  config.name = 'UndefinedBehaviorSanitizer'
> >
> > @@ -30,14 +38,6 @@ if llvm_src_root is None:
> >    if not llvm_config:
> >      DisplayNoConfigMessage()
> >
> > -  # Validate that llvm-config points to the same source tree.
> > -  llvm_src_root = lit.util.capture(["llvm-config", "--src-root"]).strip()
> > -  ubsan_test_src_root = os.path.join(llvm_src_root, "projects", "compiler-rt",
> > -                                     "lib", "ubsan", "lit_tests")
> > -  if (os.path.realpath(ubsan_test_src_root) !=
> > -      os.path.realpath(config.test_source_root)):
> > -    DisplayNoConfigMessage()
> > -
> >    # Find out the presumed location of generated site config.
> >    llvm_obj_root = lit.util.capture(["llvm-config", "--obj-root"]).strip()
> >    ubsan_site_cfg = os.path.join(llvm_obj_root, "projects", "compiler-rt",
> > @@ -49,8 +49,9 @@ if llvm_src_root is None:
> >    raise SystemExit
> >
> >  # Setup attributes common for all compiler-rt projects.
> > -compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt",
> > -                                   "lib", "lit.common.cfg")
> > +compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
> > +compiler_rt_lit_cfg = os.path.join(compiler_rt_src_root, "lib",
> > +                                   "lit.common.cfg")
> >  if not compiler_rt_lit_cfg or not os.path.exists(compiler_rt_lit_cfg):
> >    lit.fatal("Can't find common compiler-rt lit config at: %r"
> >              % compiler_rt_lit_cfg)
> >
> > Modified: compiler-rt/trunk/lib/ubsan/lit_tests/lit.site.cfg.in
> > URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/lit_tests/lit.site.cfg.in?rev=182726&r1=182725&r2=182726&view=diff
> > ==============================================================================
> > --- compiler-rt/trunk/lib/ubsan/lit_tests/lit.site.cfg.in (original)
> > +++ compiler-rt/trunk/lib/ubsan/lit_tests/lit.site.cfg.in Mon May 27 04:35:24 2013
> > @@ -4,6 +4,7 @@
> >  config.clang = "@LLVM_BINARY_DIR@/bin/clang"
> >  config.host_os = "@HOST_OS@"
> >  config.llvm_src_root = "@LLVM_SOURCE_DIR@"
> > +config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
> >  config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
> >  config.target_triple = "@TARGET_TRIPLE@"
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> 
> 
> -- 
> Alexey Samsonov, MSK





More information about the llvm-commits mailing list