Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(719)

Unified Diff: test/CodeGen/ARM/switch.ll

Issue 96065: non inline jumptables for arm Base URL: http://llvm.org/svn/llvm-project/llvm/trunk/
Patch Set: attempt at thumb suppport, undid refactoring Created 15 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/CodeGen/ARM/switch.ll
===================================================================
--- test/CodeGen/ARM/switch.ll (revision 0)
+++ test/CodeGen/ARM/switch.ll (revision 0)
@@ -0,0 +1,89 @@
+; Note: jump table has 7 entries
+; RUN: llvm-as < %s | llc -march=arm | \
+; RUN: grep .long | count 7
+; Note: no data section
+; RUN: llvm-as < %s | llc -march=arm | \
+; RUN: not grep .section
+;
+; Note: jump table has 7 entries + 1 entry for the table start
+; RUN: llvm-as < %s | llc -march=arm -no-inline-jumptables | \
+; RUN: grep .long | count 8
+; Note: jump table has 7 "BB" entries
+; RUN: llvm-as < %s | llc -march=arm -no-inline-jumptables | \
+; RUN: grep .long | grep BB | count 7
+; Note: has data section
+; RUN: llvm-as < %s | llc -march=arm -no-inline-jumptables | \
+; RUN: grep .xsection | count 1
+;
+; Note: jump table has 7 entries + 1 entry for the table start
+; RUN: llvm-as < %s | llc -march=arm -no-inline-jumptables -relocation-model=pic | \
+; RUN: grep .long | count 8
+; Note: jump table has 7 "set" entries
+; RUN: llvm-as < %s | llc -march=arm -no-inline-jumptables -relocation-model=pic | \
+; RUN: grep .long | grep set | count 7
+; Note: no data section
+; RUN: llvm-as < %s | llc -march=arm -no-inline-jumptables -relocation-model=pic | \
+; RUN: not grep .section
+
+
+define i32 @f(i32 %i) nounwind {
+entry:
+ %i_addr = alloca i32 ; <i32*> [#uses=2]
+ %retval = alloca i32 ; <i32*> [#uses=2]
+ %0 = alloca i32 ; <i32*> [#uses=8]
+ %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
+ store i32 %i, i32* %i_addr
+ %1 = load i32* %i_addr, align 4 ; <i32> [#uses=1]
+ switch i32 %1, label %bb7 [
+ i32 -2, label %bb
+ i32 -1, label %bb1
+ i32 0, label %bb2
+ i32 1, label %bb3
+ i32 2, label %bb4
+ i32 3, label %bb5
+ i32 4, label %bb6
+ ]
+
+bb: ; preds = %entry
+ store i32 33, i32* %0, align 4
+ br label %bb8
+
+bb1: ; preds = %entry
+ store i32 0, i32* %0, align 4
+ br label %bb8
+
+bb2: ; preds = %entry
+ store i32 7, i32* %0, align 4
+ br label %bb8
+
+bb3: ; preds = %entry
+ store i32 4, i32* %0, align 4
+ br label %bb8
+
+bb4: ; preds = %entry
+ store i32 3, i32* %0, align 4
+ br label %bb8
+
+bb5: ; preds = %entry
+ store i32 15, i32* %0, align 4
+ br label %bb8
+
+bb6: ; preds = %entry
+ store i32 9, i32* %0, align 4
+ br label %bb8
+
+bb7: ; preds = %entry
+ store i32 999, i32* %0, align 4
+ br label %bb8
+
+bb8: ; preds = %bb6, %bb5, %bb4, %bb3, %bb2, %bb1, %bb
+ %2 = load i32* %0, align 4 ; <i32> [#uses=1]
+ store i32 %2, i32* %retval, align 4
+ br label %return
+
+return: ; preds = %bb8
+ %retval9 = load i32* %retval ; <i32> [#uses=1]
+ ret i32 %retval9
+}
+
+
« no previous file with comments | « lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b