summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/PTX/stack-object.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/PTX/stack-object.ll')
-rw-r--r--test/CodeGen/PTX/stack-object.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/PTX/stack-object.ll b/test/CodeGen/PTX/stack-object.ll
new file mode 100644
index 0000000..65f8ee2
--- /dev/null
+++ b/test/CodeGen/PTX/stack-object.ll
@@ -0,0 +1,19 @@
+; RUN: llc < %s -march=ptx32 -mattr=sm20 | FileCheck %s
+
+define ptx_device float @stack1(float %a) {
+ ; CHECK: .local .align 4 .b8 __local0[4];
+ %a.2 = alloca float, align 4
+ ; CHECK: st.local.f32 [__local0], %f0
+ store float %a, float* %a.2
+ %a.3 = load float* %a.2
+ ret float %a.3
+}
+
+define ptx_device float @stack1_align8(float %a) {
+ ; CHECK: .local .align 8 .b8 __local0[4];
+ %a.2 = alloca float, align 8
+ ; CHECK: st.local.f32 [__local0], %f0
+ store float %a, float* %a.2
+ %a.3 = load float* %a.2
+ ret float %a.3
+}
OpenPOWER on IntegriCloud