summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRobert Lytton <robert@xmos.com>2014-01-27 17:56:25 +0000
committerRobert Lytton <robert@xmos.com>2014-01-27 17:56:25 +0000
commit1a2292614c23d98a8421ee7de872ac18a543be4c (patch)
treebc3bc33fb4dea053f3331f06337ae80255495d0b /clang/test
parent6bf8f803f21c1603731ac7fc3064dc3a1ef7a698 (diff)
downloadbcm5719-llvm-1a2292614c23d98a8421ee7de872ac18a543be4c.tar.gz
bcm5719-llvm-1a2292614c23d98a8421ee7de872ac18a543be4c.zip
XCore target exception handling
Implement __builtin_eh_return_data_regno() llvm-svn: 200231
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGen/xcore-abi.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/test/CodeGen/xcore-abi.c b/clang/test/CodeGen/xcore-abi.c
index 94a44c12827..f92f52e2c11 100644
--- a/clang/test/CodeGen/xcore-abi.c
+++ b/clang/test/CodeGen/xcore-abi.c
@@ -1,3 +1,4 @@
+// REQUIRES: xcore-registered-target
// RUN: %clang_cc1 -triple xcore -verify %s
_Static_assert(sizeof(long long) == 8, "sizeof long long is wrong");
_Static_assert(_Alignof(long long) == 4, "alignof long long is wrong");
@@ -112,10 +113,18 @@ void testbuiltin (void) {
// CHECK: call i32 @llvm.xcore.getps(i32 {{%[a-z0-9]+}})
// CHECK: call i32 @llvm.xcore.bitrev(i32 {{%[a-z0-9]+}})
// CHECK: call void @llvm.xcore.setps(i32 {{%[a-z0-9]+}}, i32 {{%[a-z0-9]+}})
- int i = __builtin_getid();
- unsigned int ui = __builtin_getps(i);
+ volatile int i = __builtin_getid();
+ volatile unsigned int ui = __builtin_getps(i);
ui = __builtin_bitrev(ui);
__builtin_setps(i,ui);
+
+ // CHECK: store volatile i32 0, i32* {{%[a-z0-9]+}}, align 4
+ // CHECK: store volatile i32 1, i32* {{%[a-z0-9]+}}, align 4
+ // CHECK: store volatile i32 -1, i32* {{%[a-z0-9]+}}, align 4
+ volatile int res;
+ res = __builtin_eh_return_data_regno(0);
+ res = __builtin_eh_return_data_regno(1);
+ res = __builtin_eh_return_data_regno(2);
}
// CHECK-LABEL: define zeroext i8 @testchar()
OpenPOWER on IntegriCloud