From e23e0976c71775dba8e45e3c6eb6f316359939e5 Mon Sep 17 00:00:00 2001 From: Richard Osborne Date: Fri, 24 Jul 2009 00:38:20 +0000 Subject: [PATCH] Add tests for handling of globals and tls on the XCore. These currently fail but pass when run against r76652. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76923 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/XCore/globals.ll | 37 +++++++++++++++++++++++++++++++++++ test/CodeGen/XCore/tls.ll | 21 ++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 test/CodeGen/XCore/globals.ll create mode 100644 test/CodeGen/XCore/tls.ll diff --git a/test/CodeGen/XCore/globals.ll b/test/CodeGen/XCore/globals.ll new file mode 100644 index 00000000000..07d56a1a3a6 --- /dev/null +++ b/test/CodeGen/XCore/globals.ll @@ -0,0 +1,37 @@ +; RUN: llvm-as < %s | llc -march=xcore -mcpu=xs1b-generic | FileCheck %s +; XFAIL: * + +define i32 *@addr_G1() { +entry: +; CHECK: addr_G1: +; CHECK: ldaw r0, dp[G1] + ret i32* @G1 +} + +define i32 *@addr_G2() { +entry: +; CHECK: addr_G2: +; CHECK: ldaw r0, dp[G2] + ret i32* @G2 +} + +define i32 *@addr_G3() { +entry: +; CHECK: addr_G3: +; CHECK: ldaw r11, cp[G3] +; CHECK: mov r0, r11 + ret i32* @G3 +} + +@G1 = global i32 4712 +; CHECK: .section .dp.data,"awd",@progbits +; CHECK: G1: + +@G2 = global i32 0 +; CHECK: .section .dp.bss,"awd",@nobits +; CHECK: G2: + +@G3 = constant i32 9401 +; CHECK: .section .cp.rodata,"ac",@progbits +; CHECK: G3: + diff --git a/test/CodeGen/XCore/tls.ll b/test/CodeGen/XCore/tls.ll new file mode 100644 index 00000000000..d645608c48f --- /dev/null +++ b/test/CodeGen/XCore/tls.ll @@ -0,0 +1,21 @@ +; RUN: llvm-as < %s | llc -march=xcore -mcpu=xs1b-generic | FileCheck %s +; XFAIL: * + +define i32 *@addr_G() { +entry: +; CHECK: addr_G: +; CHECK: get r11, id + ret i32* @G +} + +@G = thread_local global i32 15 +; CHECK: .section .dp.data,"awd",@progbits +; CHECK: G: +; CHECK: .long 15 +; CHECK: .long 15 +; CHECK: .long 15 +; CHECK: .long 15 +; CHECK: .long 15 +; CHECK: .long 15 +; CHECK: .long 15 +; CHECK: .long 15 -- 2.34.1