Index: test/Transforms/NaCl/rewrite-longjmp-noncall-uses.ll |
diff --git a/test/Transforms/NaCl/rewrite-longjmp-noncall-uses.ll b/test/Transforms/NaCl/rewrite-longjmp-noncall-uses.ll |
new file mode 100644 |
index 0000000000000000000000000000000000000000..53928567b2185e2debebe6c531faded14d6d2b0f |
--- /dev/null |
+++ b/test/Transforms/NaCl/rewrite-longjmp-noncall-uses.ll |
@@ -0,0 +1,23 @@ |
+; RUN: opt < %s -rewrite-pnacl-library-calls -S | FileCheck %s |
+; Check that the rewrite pass behaves correctly in the presence |
+; of various uses of longjmp that are not calls. |
+ |
+@fp = global void (i64*, i32)* @longjmp, align 8 |
+; CHECK: @fp = global void (i64*, i32)* @longjmp, align 8 |
+@arrfp = global [3 x void (i64*, i32)*] [void (i64*, i32)* null, void (i64*, i32)* @longjmp, void (i64*, i32)* null], align 16 |
+; CHECK: @arrfp = global [3 x void (i64*, i32)*] [void (i64*, i32)* null, void (i64*, i32)* @longjmp, void (i64*, i32)* null], align 16 |
+ |
+; CHECK: define internal void @longjmp(i64* %env, i32 %val) { |
Mark Seaborn
2013/05/13 23:39:58
Check definition of longjmp() too.
eliben
2013/05/14 17:38:58
Done elsewhere
|
+ |
+declare void @longjmp(i64*, i32) |
+ |
+; Function Attrs: nounwind |
Mark Seaborn
2013/05/13 23:39:58
What's this comment for? Remove?
eliben
2013/05/14 17:38:58
Done.
|
+define void @foo() { |
+entry: |
+ call void @somefunc(i8* bitcast (void (i64*, i32)* @longjmp to i8*)) |
+; CHECK: call void @somefunc(i8* bitcast (void (i64*, i32)* @longjmp to i8*)) |
+ ret void |
+} |
+ |
+declare void @somefunc(i8*) |
Mark Seaborn
2013/05/13 23:39:58
Put declaration before use?
eliben
2013/05/14 17:38:58
Done.
|
+ |