[clang] cd4a4ae - [OpenMP] Fixing OpenMP/driver.c failing on 32-bit hosts

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 21 14:01:49 PDT 2020


Author: Joseph Huber
Date: 2020-10-21T17:01:36-04:00
New Revision: cd4a4ae97a7ccfa381e06936cd0981cb7d978ec1

URL: https://github.com/llvm/llvm-project/commit/cd4a4ae97a7ccfa381e06936cd0981cb7d978ec1
DIFF: https://github.com/llvm/llvm-project/commit/cd4a4ae97a7ccfa381e06936cd0981cb7d978ec1.diff

LOG: [OpenMP] Fixing OpenMP/driver.c failing on 32-bit hosts

The changes made in D88594 caused the test OpenMP/driver.c to fail on a 32-bit host becuase it was offloading to a 64-bit architecture by default. The offloading test was moved to a new file and a feature was added to the lit config to check for a 64-bit host.

Reviewed By: daltenty

Differential Revision: https://reviews.llvm.org/D89904

Added: 
    

Modified: 
    clang/test/OpenMP/driver-openmp-target.c
    clang/test/lit.cfg.py

Removed: 
    


################################################################################
diff  --git a/clang/test/OpenMP/driver-openmp-target.c b/clang/test/OpenMP/driver-openmp-target.c
index bb58b386c06a..2261cbaa0d56 100644
--- a/clang/test/OpenMP/driver-openmp-target.c
+++ b/clang/test/OpenMP/driver-openmp-target.c
@@ -1,5 +1,5 @@
 // REQUIRES: x86-registered-target
-// REQUIRES: clang-64-bits
+// REQUIRES: clang-target-64-bits
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 -fopenmp-targets=x86_64-unknown-unknown -o - | FileCheck --check-prefix=CHECK-45-VERSION --check-prefix=CHECK-45-VERSION2 %s
 // CHECK-45-VERSION: #define _OPENMP 201511
 // CHECK-45-VERSION2: #define _OPENMP 201511

diff  --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index 004ee39a9795..91161b8244f2 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -1,7 +1,6 @@
 # -*- Python -*-
 
 import os
-import sys
 import platform
 import re
 import subprocess
@@ -168,9 +167,11 @@ def is_filesystem_case_insensitive():
 if platform.system() not in ['Windows']:
     config.available_features.add('can-remove-opened-file')
 
-# Check 64-bit host
-if sys.maxsize > 2**32:
-  config.available_features.add("clang-64-bits")
+# Features
+known_arches = ["x86_64", "mips64", "ppc64", "aarch64"]
+if (any(config.target_triple.startswith(x) for x in known_arches)):
+  config.available_features.add("clang-target-64-bits")
+
 
 
 def calculate_arch_features(arch_string):


        


More information about the cfe-commits mailing list