OSDN Git Service

[OpenMP] Fixing OpenMP/driver.c failing on 32-bit hosts
authorJoseph Huber <jhuber6@vols.utk.edu>
Wed, 21 Oct 2020 13:55:21 +0000 (09:55 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 21 Oct 2020 21:01:36 +0000 (17:01 -0400)
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

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

index bb58b38..2261cba 100644 (file)
@@ -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
index 004ee39..91161b8 100644 (file)
@@ -1,7 +1,6 @@
 # -*- Python -*-
 
 import os
-import sys
 import platform
 import re
 import subprocess
@@ -168,9 +167,11 @@ if re.match(r'^arm64(e)?-apple-(macos|darwin)', config.target_triple):
 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):