mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 20:13:40 +00:00
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:
committed by
Ron Evans
parent
fb33f3813d
commit
fce403b7a0
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user