| // Copyright 2012 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // libgcc on ARM might be compiled as thumb code, but our 5l |
| // can't handle that, so we have to disable this test on arm. |
| puts("testLibgcc is disabled on ARM because 5l cannot handle thumb library."); |
| #elif defined(__arm64__) && defined(__clang__) |
| puts("testLibgcc is disabled on ARM64 with clang due to lack of libgcc."); |
| int __absvsi2(int); // dummy prototype for libgcc function |
| // we shouldn't name the function abs, as gcc might use |
| int vabs(int x) { return __absvsi2(x); } |
| func testLibgcc(t *testing.T) { |
| for _, v := range table { |
| if o := C.vabs(v.in); o != v.out { |
| t.Fatalf("abs(%d) got %d, should be %d", v.in, o, v.out) |