[asan][test] Fix build errors in loongarch64
authorYouling Tang <tangyouling@loongson.cn>
Tue, 1 Nov 2022 12:19:33 +0000 (20:19 +0800)
committerWeining Lu <luweining@loongson.cn>
Tue, 1 Nov 2022 12:21:56 +0000 (20:21 +0800)
commit867ff7c994b4b891c8d92f0dff6bac70f9d9dcf4
tree2dc12c5e9003bfe9631f5a1af5d45530f533ca88
parent5b27578fc52bdf06e2d81a271705a39266b047fe
[asan][test] Fix build errors in loongarch64

- Add get_bits_for_arch for loongarch64 detection, fix the following error,
```
$ make check-asan
-- sanitizer_common tests on "Linux" will run against "asan"
CMake Error at test/asan/CMakeLists.txt:22 (message):
  Unknown target architecture: loongarch64
Call Stack (most recent call first):
  test/asan/CMakeLists.txt:49 (get_bits_for_arch)
```

- Do not use __builtin_longjmp, fix the following error,
```
llvm-project/compiler-rt/lib/asan/tests/asan_test.cpp:635:3: error: __builtin_longjmp is not supported for the current target
  __builtin_longjmp((void**)buf, 1);
```

Differential Revision: https://reviews.llvm.org/D137012
compiler-rt/lib/asan/tests/asan_test.cpp
compiler-rt/test/asan/CMakeLists.txt