summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2009-02-27 13:37:18 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2009-02-27 13:37:18 +0000
commit000421eade9a685bf67c9e80c1744fab4e3b04ec (patch)
tree61b0c1cb7f20a2e367f4fe2407229b9f0fe1c43e /llvm/test
parentb4b608c617fce281ed0b871fb1ef4a2e5e8d7166 (diff)
downloadbcm5719-llvm-000421eade9a685bf67c9e80c1744fab4e3b04ec.tar.gz
bcm5719-llvm-000421eade9a685bf67c9e80c1744fab4e3b04ec.zip
Refactor TLS code and add some tests. The tests and expected results are:
pic | declaration | linkage | visibility | !pic | declaration | external | default | tls1.ll tls2.ll | local exec pic | declaration | external | default | tls1-pic.ll tls2-pic.ll | general dynamic !pic | !declaration | external | default | tls3.ll tls4.ll | initial exec pic | !declaration | external | default | tls3-pic.ll tls4-pic.ll | general dynamic !pic | declaration | external | hidden | tls7.ll tls8.ll | local exec pic | declaration | external | hidden | X | local dynamic !pic | !declaration | external | hidden | tls9.ll tls10.ll | local exec pic | !declaration | external | hidden | X | local dynamic !pic | declaration | internal | default | tls5.ll tls6.ll | local exec pic | declaration | internal | default | X | local dynamic The ones marked with an X have not been implemented since local dynamic is not implemented. llvm-svn: 65632
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/tls1-pic.ll11
-rw-r--r--llvm/test/CodeGen/X86/tls1.ll17
-rw-r--r--llvm/test/CodeGen/X86/tls10.ll10
-rw-r--r--llvm/test/CodeGen/X86/tls2-pic.ll10
-rw-r--r--llvm/test/CodeGen/X86/tls2.ll19
-rw-r--r--llvm/test/CodeGen/X86/tls3-pic.ll11
-rw-r--r--llvm/test/CodeGen/X86/tls3.ll11
-rw-r--r--llvm/test/CodeGen/X86/tls4-pic.ll10
-rw-r--r--llvm/test/CodeGen/X86/tls4.ll10
-rw-r--r--llvm/test/CodeGen/X86/tls5.ll10
-rw-r--r--llvm/test/CodeGen/X86/tls6.ll10
-rw-r--r--llvm/test/CodeGen/X86/tls7.ll10
-rw-r--r--llvm/test/CodeGen/X86/tls8.ll10
-rw-r--r--llvm/test/CodeGen/X86/tls9.ll10
14 files changed, 132 insertions, 27 deletions
diff --git a/llvm/test/CodeGen/X86/tls1-pic.ll b/llvm/test/CodeGen/X86/tls1-pic.ll
new file mode 100644
index 00000000000..0674f798895
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tls1-pic.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic > %t
+; RUN: grep {leal i@TLSGD(,%ebx,1), %eax} %t
+; RUN: grep {call ___tls_get_addr@PLT} %t
+
+@i = thread_local global i32 15
+
+define i32 @f() {
+entry:
+ %tmp1 = load i32* @i
+ ret i32 %tmp1
+}
diff --git a/llvm/test/CodeGen/X86/tls1.ll b/llvm/test/CodeGen/X86/tls1.ll
index c4025034bce..ccff7180eb0 100644
--- a/llvm/test/CodeGen/X86/tls1.ll
+++ b/llvm/test/CodeGen/X86/tls1.ll
@@ -1,19 +1,10 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu | \
-; RUN: grep {movl %gs:i@NTPOFF, %eax}
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu | \
-; RUN: grep {leal i@NTPOFF(%eax), %eax}
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic | \
-; RUN: grep {leal i@TLSGD(,%ebx,1), %eax}
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movl %gs:i@NTPOFF, %eax} %t
-@i = thread_local global i32 15 ; <i32*> [#uses=2]
+@i = thread_local global i32 15
define i32 @f() {
entry:
- %tmp1 = load i32* @i ; <i32> [#uses=1]
+ %tmp1 = load i32* @i
ret i32 %tmp1
}
-
-define i32* @g() {
-entry:
- ret i32* @i
-}
diff --git a/llvm/test/CodeGen/X86/tls10.ll b/llvm/test/CodeGen/X86/tls10.ll
new file mode 100644
index 00000000000..a4f2fb1293b
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tls10.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movl %gs:0, %eax} %t
+; RUN: grep {leal i@NTPOFF(%eax), %eax} %t
+
+@i = external hidden thread_local global i32
+
+define i32* @f() {
+entry:
+ ret i32* @i
+}
diff --git a/llvm/test/CodeGen/X86/tls2-pic.ll b/llvm/test/CodeGen/X86/tls2-pic.ll
new file mode 100644
index 00000000000..0ecb6737ebb
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tls2-pic.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic > %t
+; RUN: grep {leal i@TLSGD(,%ebx,1), %eax} %t
+; RUN: grep {call ___tls_get_addr@PLT} %t
+
+@i = thread_local global i32 15
+
+define i32* @f() {
+entry:
+ ret i32* @i
+}
diff --git a/llvm/test/CodeGen/X86/tls2.ll b/llvm/test/CodeGen/X86/tls2.ll
index c9b73fba8c7..fb57ae1a391 100644
--- a/llvm/test/CodeGen/X86/tls2.ll
+++ b/llvm/test/CodeGen/X86/tls2.ll
@@ -1,19 +1,10 @@
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu | \
-; RUN: grep {movl %gs:(%eax), %eax}
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu | \
-; RUN: grep {addl i@INDNTPOFF, %eax}
-; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic | \
-; RUN: grep {leal i@TLSGD(,%ebx,1), %eax}
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movl %gs:0, %eax} %t
+; RUN: grep {leal i@NTPOFF(%eax), %eax} %t
-@i = external thread_local global i32 ; <i32*> [#uses=2]
+@i = thread_local global i32 15
-define i32 @f() {
-entry:
- %tmp1 = load i32* @i ; <i32> [#uses=1]
- ret i32 %tmp1
-}
-
-define i32* @g() {
+define i32* @f() {
entry:
ret i32* @i
}
diff --git a/llvm/test/CodeGen/X86/tls3-pic.ll b/llvm/test/CodeGen/X86/tls3-pic.ll
new file mode 100644
index 00000000000..80fad480582
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tls3-pic.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic > %t
+; RUN: grep {leal i@TLSGD(,%ebx,1), %eax} %t
+; RUN: grep {call ___tls_get_addr@PLT} %t
+
+@i = external thread_local global i32 ; <i32*> [#uses=2]
+
+define i32 @f() {
+entry:
+ %tmp1 = load i32* @i ; <i32> [#uses=1]
+ ret i32 %tmp1
+}
diff --git a/llvm/test/CodeGen/X86/tls3.ll b/llvm/test/CodeGen/X86/tls3.ll
new file mode 100644
index 00000000000..396e7901acc
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tls3.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movl i@INDNTPOFF, %eax} %t
+; RUN: grep {movl %gs:(%eax), %eax} %t
+
+@i = external thread_local global i32 ; <i32*> [#uses=2]
+
+define i32 @f() {
+entry:
+ %tmp1 = load i32* @i ; <i32> [#uses=1]
+ ret i32 %tmp1
+}
diff --git a/llvm/test/CodeGen/X86/tls4-pic.ll b/llvm/test/CodeGen/X86/tls4-pic.ll
new file mode 100644
index 00000000000..135d746bf58
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tls4-pic.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic > %t
+; RUN: grep {leal i@TLSGD(,%ebx,1), %eax} %t
+; RUN: grep {call ___tls_get_addr@PLT} %t
+
+@i = external thread_local global i32 ; <i32*> [#uses=2]
+
+define i32* @f() {
+entry:
+ ret i32* @i
+}
diff --git a/llvm/test/CodeGen/X86/tls4.ll b/llvm/test/CodeGen/X86/tls4.ll
new file mode 100644
index 00000000000..31466997d19
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tls4.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movl %gs:0, %eax} %t
+; RUN: grep {addl i@INDNTPOFF, %eax} %t
+
+@i = external thread_local global i32 ; <i32*> [#uses=2]
+
+define i32* @f() {
+entry:
+ ret i32* @i
+}
diff --git a/llvm/test/CodeGen/X86/tls5.ll b/llvm/test/CodeGen/X86/tls5.ll
new file mode 100644
index 00000000000..b32f5fc3342
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tls5.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movl %gs:i@NTPOFF, %eax} %t
+
+@i = internal thread_local global i32 15
+
+define i32 @f() {
+entry:
+ %tmp1 = load i32* @i
+ ret i32 %tmp1
+}
diff --git a/llvm/test/CodeGen/X86/tls6.ll b/llvm/test/CodeGen/X86/tls6.ll
new file mode 100644
index 00000000000..e0bcade8dd8
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tls6.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movl %gs:0, %eax} %t
+; RUN: grep {leal i@NTPOFF(%eax), %eax} %t
+
+@i = internal thread_local global i32 15
+
+define i32* @f() {
+entry:
+ ret i32* @i
+}
diff --git a/llvm/test/CodeGen/X86/tls7.ll b/llvm/test/CodeGen/X86/tls7.ll
new file mode 100644
index 00000000000..eafa5c2c246
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tls7.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movl %gs:i@NTPOFF, %eax} %t
+
+@i = hidden thread_local global i32 15
+
+define i32 @f() {
+entry:
+ %tmp1 = load i32* @i
+ ret i32 %tmp1
+}
diff --git a/llvm/test/CodeGen/X86/tls8.ll b/llvm/test/CodeGen/X86/tls8.ll
new file mode 100644
index 00000000000..4971fd23ba6
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tls8.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movl %gs:0, %eax} %t
+; RUN: grep {leal i@NTPOFF(%eax), %eax} %t
+
+@i = hidden thread_local global i32 15
+
+define i32* @f() {
+entry:
+ ret i32* @i
+}
diff --git a/llvm/test/CodeGen/X86/tls9.ll b/llvm/test/CodeGen/X86/tls9.ll
new file mode 100644
index 00000000000..31dffcc18c8
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tls9.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movl %gs:i@NTPOFF, %eax} %t
+
+@i = external hidden thread_local global i32
+
+define i32 @f() {
+entry:
+ %tmp1 = load i32* @i
+ ret i32 %tmp1
+}
OpenPOWER on IntegriCloud