statham-arm wrote:

> We're explicitly specifying the triple, so the host triple shouldn't matter. 
> And this test is currently passing on every buildbot. So what does this do?

It's true that the _test_ passes, because it only goes as far as LLVM IR, 
compiling the affected test file using `-emit-llvm`. But if I try going all the 
way to assembly, by replacing `-emit-llvm` with `-S`, then I do see the error:
```
$ build/bin/clang -cc1 -triple armv6m-eabi clang/test/CodeGen/pr45476.cpp -S -o 
/dev/null
error: Function 'foo' uses ARM instructions, but the target does not support 
ARM mode execution.
1 error generated.
```

If you run the clang driver, rather than `clang -cc1`, then there's no problem 
compiling this file to Armv6-M assembler, and of course it comes out in Thumb. 
But the `-v` output from the driver command below shows that that's because the 
driver has converted the triple into a Thumb one, passing `-triple 
thumbv6m-unknown-none-eabi` to the `clang -cc1` command.
```
build/bin/clang -v --target=arm-none-eabi -march=armv6m 
clang/test/CodeGen/pr45476.cpp -S -o /dev/null
```

So I agree that it looks as if `clang -cc1` is expecting to receive a triple 
that already states the right one of Arm and Thumb, and the handwritten `clang 
-cc1 -triple armv6m-eabi` in this test is a bit strange, even if it's not 
causing this `-emit-llvm` test to fail.

https://github.com/llvm/llvm-project/pull/166416
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to