diff options
author | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
commit | 952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch) | |
tree | df8df0b0067b381eab470a3b8f28d14a552a6340 /test/CodeGenCXX/builtins.cpp | |
parent | ea266cad53e3d49771fa38103913d3ec7a166694 (diff) | |
download | FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz |
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/CodeGenCXX/builtins.cpp')
-rw-r--r-- | test/CodeGenCXX/builtins.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/test/CodeGenCXX/builtins.cpp b/test/CodeGenCXX/builtins.cpp index c9b0bff..98e2d1a 100644 --- a/test/CodeGenCXX/builtins.cpp +++ b/test/CodeGenCXX/builtins.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s // PR8839 extern "C" char memmove(); @@ -7,3 +7,22 @@ int main() { // CHECK: call {{signext i8|i8}} @memmove() return memmove(); } + +struct S; +// CHECK: define {{.*}} @_Z9addressofbR1SS0_( +S *addressof(bool b, S &s, S &t) { + // CHECK: %[[LVALUE:.*]] = phi + // CHECK: ret {{.*}}* %[[LVALUE]] + return __builtin_addressof(b ? s : t); +} + +extern "C" int __builtin_abs(int); // #1 +long __builtin_abs(long); // #2 +extern "C" int __builtin_abs(int); // #3 + +int x = __builtin_abs(-2); +// CHECK: store i32 2, i32* @x, align 4 + +long y = __builtin_abs(-2l); +// CHECK: [[Y:%.+]] = call i64 @_Z13__builtin_absl(i64 -2) +// CHECK: store i64 [[Y]], i64* @y, align 8 |