1 // RUN: %clang_cc1 -triple=x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
2 
3 // PR8839
4 extern "C" char memmove();
5 
main()6 int main() {
7   // CHECK: call {{signext i8|i8}} @memmove()
8   return memmove();
9 }
10 
11 struct S;
12 // CHECK: define {{.*}} @_Z9addressofbR1SS0_(
addressof(bool b,S & s,S & t)13 S *addressof(bool b, S &s, S &t) {
14   // CHECK: %[[LVALUE:.*]] = phi
15   // CHECK: ret {{.*}}* %[[LVALUE]]
16   return __builtin_addressof(b ? s : t);
17 }
18 
19 extern "C" int __builtin_abs(int); // #1
20 long __builtin_abs(long);          // #2
21 extern "C" int __builtin_abs(int); // #3
22 
23 int x = __builtin_abs(-2);
24 // CHECK:  store i32 2, i32* @x, align 4
25 
26 long y = __builtin_abs(-2l);
27 // CHECK:  [[Y:%.+]] = call i64 @_Z13__builtin_absl(i64 -2)
28 // CHECK:  store i64 [[Y]], i64* @y, align 8
29