targets: match LLVM triple to the one Clang uses

The target triples have to match mostly to be able to link LLVM modules.
Linking LLVM modules is already possible (the triples already match),
but testing becomes much easier when they match exactly.

For macOS, I picked "macosx10.12.0". That's an old and unsupported
version, but I had to pick _something_. Clang by default uses
"macos10.4.0", which is much older.
This commit is contained in:
Ayke van Laethem
2021-11-04 00:22:42 +01:00
committed by Ron Evans
parent fb33f3813d
commit fce403b7a0
15 changed files with 29 additions and 16 deletions
+5
View File
@@ -107,6 +107,11 @@ func testClangAttributes(t *testing.T, options *compileopts.Options) {
}
defer mod.Dispose()
// Check whether the LLVM target matches.
if mod.Target() != config.Triple() {
t.Errorf("target has LLVM triple %#v but Clang makes it LLVM triple %#v", config.Triple(), mod.Target())
}
// Check the "target-cpu" string attribute of the add function.
add := mod.NamedFunction("add")
var cpu string