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

2020-10-21 Thread David Tenty via Phabricator via cfe-commits
daltenty added a comment.

In D89696#2344797 , @jhuber6 wrote:

> In D89696#2344753 , @daltenty wrote:
>
>> In D89696#2344508 , @jhuber6 wrote:
>>
>>> @daltenty Do you think this will fix the problem on AIX?
>>
>> It's not just AIX that will have this problem I suspect. If you configure 
>> any cross-compiling build with a 64-bit host, targeting a 32-bit arch, your 
>> going to run into the problem. I think checking against a list of known 
>> 64-bit arches is good enough for the purposes here, but the check still 
>> needs to be against the target, not the host.
>>
>> Also, the frontend diagnostic looks like it is off for the same reason:
>>
>>   else if (getArchPtrSize(T) != getArchPtrSize(TT))
>> Diags.Report(diag::err_drv_incompatible_omp_arch)
>>
>> T seems to be the target triple, not the host, but the diagnostic reads: 
>> `pointer size is incompatible with host`.
>
> TT is the target triple, otherwise the error message would be backwards, x86 
> is the OpenMP target architecture and PPC is the host architecture. I'm not 
> sure what you mean by checking the target rather than the host. The target is 
> set explicitly by `-fopenmp-targets=`, since it's being set in the 
> test file we try to make sure that the host matches it. If this was just a 
> frontend test we could just specify the host Triple and be done with it. 
> Maybe we could add some CMake options for which offloading libraries were 
> built?

Sorry I think I understand what's maybe happening here. I guess the OpenMP 
terminology here doesn't mesh with really well with the LLVM usages. The term 
"host" seems to be overloaded to mean two different things, either the OpenMP 
host target arch ("OpenMP host") or the arch LLVM was compiled for ("LLVM host 
triple").

So in this case, with AIX we have:

The OpenMP target from commandine is x86
The architecture clang/llvm is compiled for is PPC64 ("LLVM host triple")
The architecture the frontend is set to emit for/target is PPC32 ("OpenMP host 
architecture", "LLVM target triple")

(This is also what makes the diagnostic confusing, is it talking about the 
OpenMP host or the compiler host?)

The lit infrastructure uses the LLVM meaning, so config.host_triple is the 
compiler host, not the LLVM target / OpenMP host architecture. That is what I 
mean when I say "check the target instead", I mean check the LLVM target 
instead of the LLVM host triple.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89696/new/

https://reviews.llvm.org/D89696

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2020-10-21 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment.

In D89696#2344753 , @daltenty wrote:

> In D89696#2344508 , @jhuber6 wrote:
>
>> @daltenty Do you think this will fix the problem on AIX?
>
> It's not just AIX that will have this problem I suspect. If you configure any 
> cross-compiling build with a 64-bit host, targeting a 32-bit arch, your going 
> to run into the problem. I think checking against a list of known 64-bit 
> arches is good enough for the purposes here, but the check still needs to be 
> against the target, not the host.
>
> Also, the frontend diagnostic looks like it is off for the same reason:
>
>   else if (getArchPtrSize(T) != getArchPtrSize(TT))
> Diags.Report(diag::err_drv_incompatible_omp_arch)
>
> T seems to be the target triple, not the host, but the diagnostic reads: 
> `pointer size is incompatible with host`.

TT is the target triple, otherwise the error message would be backwards, x86 is 
the OpenMP target architecture and PPC is the host architecture. I'm not sure 
what you mean by checking the target rather than the host. The target is set 
explicitly by `-fopenmp-targets=`, since it's being set in the test 
file we try to make sure that the host matches it. If this was just a frontend 
test we could just specify the host Triple and be done with it. Maybe we could 
add some CMake options for which offloading libraries were built?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89696/new/

https://reviews.llvm.org/D89696

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2020-10-21 Thread David Tenty via Phabricator via cfe-commits
daltenty added a comment.

In D89696#2344508 , @jhuber6 wrote:

> @daltenty Do you think this will fix the problem on AIX?

It's not just AIX that will have this problem I suspect. If you configure any 
cross-compiling build with a 64-bit host, targeting a 32-bit arch, your going 
to run into the problem. I think checking against a list of known 64-bit arches 
is good enough for the purposes here, but the check still needs to be against 
the target, not the host.

Also, the frontend diagnostic looks like it is off for the same reason:

  else if (getArchPtrSize(T) != getArchPtrSize(TT))
Diags.Report(diag::err_drv_incompatible_omp_arch)

T seems to be the target triple, not the host, but the diagnostic reads: 
`pointer size is incompatible with host`.




Comment at: clang/test/lit.cfg.py:172
+known_arches = ["x86_64", "mips64", "ppc64", "aarch64"]
+if (config.host_ldflags.find("-m32") < 0
+and any(config.host_triple.startswith(x) for x in known_arches)):

I don't think this check is meaningful. This just checks how llvm was built, it 
doesn't tell you anything about what clang driver is going to target out of the 
box, which is what we care about here.



Comment at: clang/test/lit.cfg.py:174
+and any(config.host_triple.startswith(x) for x in known_arches)):
   config.available_features.add("clang-64-bits")
 

Maybe this should be something like `clang-64-bit-default-target` instead to 
clarify what we mean.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89696/new/

https://reviews.llvm.org/D89696

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2020-10-21 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment.

@daltenty Do you think this will fix the problem on AIX?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89696/new/

https://reviews.llvm.org/D89696

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2020-10-21 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 299672.
jhuber6 added a comment.

Changing test to be similar to LLVM's method, checks the linker flags for 
32-bit library and only if the target triple is one of the known 64-bit triples.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89696/new/

https://reviews.llvm.org/D89696

Files:
  clang/test/lit.cfg.py
  clang/test/lit.site.cfg.py.in


Index: clang/test/lit.site.cfg.py.in
===
--- clang/test/lit.site.cfg.py.in
+++ clang/test/lit.site.cfg.py.in
@@ -31,6 +31,7 @@
 config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER', 
"@USE_Z3_SOLVER@")
 config.has_plugins = @LLVM_ENABLE_PLUGINS@
 config.clang_vendor_uti = "@CLANG_VENDOR_UTI@"
+config.host_ldflags = '@HOST_LDFLAGS@'
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.
Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -1,7 +1,6 @@
 # -*- Python -*-
 
 import os
-import sys
 import platform
 import re
 import subprocess
@@ -168,11 +167,14 @@
 if platform.system() not in ['Windows']:
 config.available_features.add('can-remove-opened-file')
 
-# Check 64-bit host
-if sys.maxsize > 2**32:
+# Features
+known_arches = ["x86_64", "mips64", "ppc64", "aarch64"]
+if (config.host_ldflags.find("-m32") < 0
+and any(config.host_triple.startswith(x) for x in known_arches)):
   config.available_features.add("clang-64-bits")
 
 
+
 def calculate_arch_features(arch_string):
 features = []
 for arch in arch_string.split():


Index: clang/test/lit.site.cfg.py.in
===
--- clang/test/lit.site.cfg.py.in
+++ clang/test/lit.site.cfg.py.in
@@ -31,6 +31,7 @@
 config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER', "@USE_Z3_SOLVER@")
 config.has_plugins = @LLVM_ENABLE_PLUGINS@
 config.clang_vendor_uti = "@CLANG_VENDOR_UTI@"
+config.host_ldflags = '@HOST_LDFLAGS@'
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.
Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -1,7 +1,6 @@
 # -*- Python -*-
 
 import os
-import sys
 import platform
 import re
 import subprocess
@@ -168,11 +167,14 @@
 if platform.system() not in ['Windows']:
 config.available_features.add('can-remove-opened-file')
 
-# Check 64-bit host
-if sys.maxsize > 2**32:
+# Features
+known_arches = ["x86_64", "mips64", "ppc64", "aarch64"]
+if (config.host_ldflags.find("-m32") < 0
+and any(config.host_triple.startswith(x) for x in known_arches)):
   config.available_features.add("clang-64-bits")
 
 
+
 def calculate_arch_features(arch_string):
 features = []
 for arch in arch_string.split():
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2020-10-20 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments.



Comment at: clang/test/OpenMP/driver-openmp-target.c:2
+// REQUIRES: x86-registered-target
+// REQUIRES: clang-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

daltenty wrote:
> This tests still fails on AIX, presumably because we have a 64-bit host but 
> the compiler is targeting 32-bit by default:
> 
> ```
> error: OpenMP target architecture 'x86_64-unknown-unknown' pointer size is 
> incompatible with host 'powerpc-ibm-aix7.2.0.0'
> ```
> 
> Maybe adjust the test to check the default target instead of just the host?
I'm not aware of any easy methods to do that, though one might exist. Easiest 
solution is just add a check that doesn't run this test on AIX, more complex 
would probably require taking the default target from the clang executable and 
parsing it using the same methods that Triple.cpp uses to get the architecture 
size. I'm not familiar with anything about AIX, any suggestions?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89696/new/

https://reviews.llvm.org/D89696

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2020-10-20 Thread David Tenty via Phabricator via cfe-commits
daltenty added inline comments.



Comment at: clang/test/OpenMP/driver-openmp-target.c:2
+// REQUIRES: x86-registered-target
+// REQUIRES: clang-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

This tests still fails on AIX, presumably because we have a 64-bit host but the 
compiler is targeting 32-bit by default:

```
error: OpenMP target architecture 'x86_64-unknown-unknown' pointer size is 
incompatible with host 'powerpc-ibm-aix7.2.0.0'
```

Maybe adjust the test to check the default target instead of just the host?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89696/new/

https://reviews.llvm.org/D89696

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2020-10-19 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG24df30efda61: [OpenMP] Fixing OpenMP/driver.c failing on 
32-bit hosts (authored by jhuber6).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89696/new/

https://reviews.llvm.org/D89696

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


Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -1,6 +1,7 @@
 # -*- Python -*-
 
 import os
+import sys
 import platform
 import re
 import subprocess
@@ -167,6 +168,10 @@
 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")
+
 
 def calculate_arch_features(arch_string):
 features = []
Index: clang/test/OpenMP/driver.c
===
--- clang/test/OpenMP/driver.c
+++ clang/test/OpenMP/driver.c
@@ -27,7 +27,6 @@
 
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 | FileCheck 
--check-prefix=CHECK-45-VERSION %s
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 -fopenmp-simd 
| FileCheck --check-prefix=CHECK-45-VERSION %s
-// 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: clang/test/OpenMP/driver-openmp-target.c
===
--- /dev/null
+++ clang/test/OpenMP/driver-openmp-target.c
@@ -0,0 +1,5 @@
+// REQUIRES: x86-registered-target
+// REQUIRES: clang-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: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -1,6 +1,7 @@
 # -*- Python -*-
 
 import os
+import sys
 import platform
 import re
 import subprocess
@@ -167,6 +168,10 @@
 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")
+
 
 def calculate_arch_features(arch_string):
 features = []
Index: clang/test/OpenMP/driver.c
===
--- clang/test/OpenMP/driver.c
+++ clang/test/OpenMP/driver.c
@@ -27,7 +27,6 @@
 
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 | FileCheck --check-prefix=CHECK-45-VERSION %s
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 -fopenmp-simd | FileCheck --check-prefix=CHECK-45-VERSION %s
-// 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: clang/test/OpenMP/driver-openmp-target.c
===
--- /dev/null
+++ clang/test/OpenMP/driver-openmp-target.c
@@ -0,0 +1,5 @@
+// REQUIRES: x86-registered-target
+// REQUIRES: clang-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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2020-10-19 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 299081.
jhuber6 added a comment.

Checking tests again.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89696/new/

https://reviews.llvm.org/D89696

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


Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -1,6 +1,7 @@
 # -*- Python -*-
 
 import os
+import sys
 import platform
 import re
 import subprocess
@@ -167,6 +168,10 @@
 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")
+
 
 def calculate_arch_features(arch_string):
 features = []
Index: clang/test/OpenMP/driver.c
===
--- clang/test/OpenMP/driver.c
+++ clang/test/OpenMP/driver.c
@@ -27,7 +27,6 @@
 
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 | FileCheck 
--check-prefix=CHECK-45-VERSION %s
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 -fopenmp-simd 
| FileCheck --check-prefix=CHECK-45-VERSION %s
-// 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: clang/test/OpenMP/driver-openmp-target.c
===
--- /dev/null
+++ clang/test/OpenMP/driver-openmp-target.c
@@ -0,0 +1,5 @@
+// REQUIRES: x86-registered-target
+// REQUIRES: clang-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: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -1,6 +1,7 @@
 # -*- Python -*-
 
 import os
+import sys
 import platform
 import re
 import subprocess
@@ -167,6 +168,10 @@
 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")
+
 
 def calculate_arch_features(arch_string):
 features = []
Index: clang/test/OpenMP/driver.c
===
--- clang/test/OpenMP/driver.c
+++ clang/test/OpenMP/driver.c
@@ -27,7 +27,6 @@
 
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 | FileCheck --check-prefix=CHECK-45-VERSION %s
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 -fopenmp-simd | FileCheck --check-prefix=CHECK-45-VERSION %s
-// 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: clang/test/OpenMP/driver-openmp-target.c
===
--- /dev/null
+++ clang/test/OpenMP/driver-openmp-target.c
@@ -0,0 +1,5 @@
+// REQUIRES: x86-registered-target
+// REQUIRES: clang-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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2020-10-19 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89696/new/

https://reviews.llvm.org/D89696

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2020-10-19 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision.
jhuber6 added a reviewer: jdoerfert.
Herald added subscribers: cfe-commits, guansong, yaxunl.
Herald added a project: clang.
jhuber6 requested review of this revision.
Herald added a subscriber: sstefan1.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89696

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


Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -1,6 +1,7 @@
 # -*- Python -*-
 
 import os
+import sys
 import platform
 import re
 import subprocess
@@ -167,6 +168,10 @@
 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")
+
 
 def calculate_arch_features(arch_string):
 features = []
Index: clang/test/OpenMP/driver.c
===
--- clang/test/OpenMP/driver.c
+++ clang/test/OpenMP/driver.c
@@ -27,7 +27,6 @@
 
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 | FileCheck 
--check-prefix=CHECK-45-VERSION %s
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 -fopenmp-simd 
| FileCheck --check-prefix=CHECK-45-VERSION %s
-// 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: clang/test/OpenMP/driver-openmp-target.c
===
--- /dev/null
+++ clang/test/OpenMP/driver-openmp-target.c
@@ -0,0 +1,5 @@
+// REQUIRES: x86-registered-target
+// REQUIRES: clang-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: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -1,6 +1,7 @@
 # -*- Python -*-
 
 import os
+import sys
 import platform
 import re
 import subprocess
@@ -167,6 +168,10 @@
 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")
+
 
 def calculate_arch_features(arch_string):
 features = []
Index: clang/test/OpenMP/driver.c
===
--- clang/test/OpenMP/driver.c
+++ clang/test/OpenMP/driver.c
@@ -27,7 +27,6 @@
 
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 | FileCheck --check-prefix=CHECK-45-VERSION %s
 // RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 -fopenmp-simd | FileCheck --check-prefix=CHECK-45-VERSION %s
-// 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: clang/test/OpenMP/driver-openmp-target.c
===
--- /dev/null
+++ clang/test/OpenMP/driver-openmp-target.c
@@ -0,0 +1,5 @@
+// REQUIRES: x86-registered-target
+// REQUIRES: clang-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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits