diff options
author | Emilio Cobos Alvarez <emilio@crisal.io> | 2017-04-28 15:56:39 +0000 |
---|---|---|
committer | Emilio Cobos Alvarez <emilio@crisal.io> | 2017-04-28 15:56:39 +0000 |
commit | 485ad42521df7844c503deef0d4253f4e4ef53ff (patch) | |
tree | c5103e6b5d92ce416f4257ee694c7bbd6232eb93 /clang/test/Index/target-info.c | |
parent | 499de32ad03af6877ca2ee0780530ee4721b4062 (diff) | |
download | bcm5719-llvm-485ad42521df7844c503deef0d4253f4e4ef53ff.tar.gz bcm5719-llvm-485ad42521df7844c503deef0d4253f4e4ef53ff.zip |
[libclang] Expose some target information via the C API.
This allows users to query the target triple and target pointer width, which
would make me able to fix https://github.com/servo/rust-bindgen/issues/593 and
other related bugs in an elegant way (without having to manually parse the
target triple in the command line arguments).
Differential Revision: https://reviews.llvm.org/D32389
llvm-svn: 301648
Diffstat (limited to 'clang/test/Index/target-info.c')
-rw-r--r-- | clang/test/Index/target-info.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Index/target-info.c b/clang/test/Index/target-info.c new file mode 100644 index 00000000000..98a3ca32b57 --- /dev/null +++ b/clang/test/Index/target-info.c @@ -0,0 +1,6 @@ +// RUN: c-index-test -test-print-target-info %s --target=i386-unknown-linux-gnu | FileCheck %s +// RUN: c-index-test -test-print-target-info %s --target=x86_64-unknown-linux-gnu | FileCheck --check-prefix=CHECK-1 %s +// CHECK: TargetTriple: i386-unknown-linux-gnu +// CHECK: PointerWidth: 32 +// CHECK-1: TargetTriple: x86_64-unknown-linux-gnu +// CHECK-1: PointerWidth: 64 |