diff options
author | Dan Gohman <sunfish@mozilla.com> | 2014-03-05 17:51:45 -0800 |
---|---|---|
committer | Dan Gohman <sunfish@mozilla.com> | 2014-03-05 18:51:17 -0800 |
commit | 8346647dd5ddc2d1f379cc530b20494a41e6ef31 (patch) | |
tree | d8445f8dbc4b8544e244cf8af53a27905ba2d064 /test | |
parent | 7b62a180c6985b59ee7df38d3e7358ba574ad7c8 (diff) |
Don't run a pass to strip dead prototypes; just ignore them.
Also, fix the code for supressing declarations for no-op intrinsics.
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/JS/dead-prototypes.ll | 9 | ||||
-rw-r--r-- | test/CodeGen/JS/invariant-intrinsics.ll | 17 | ||||
-rw-r--r-- | test/CodeGen/JS/lifetime-intrinsics.ll | 17 |
3 files changed, 43 insertions, 0 deletions
diff --git a/test/CodeGen/JS/dead-prototypes.ll b/test/CodeGen/JS/dead-prototypes.ll new file mode 100644 index 0000000000..2a723ed61e --- /dev/null +++ b/test/CodeGen/JS/dead-prototypes.ll @@ -0,0 +1,9 @@ +; RUN: llc -march=js < %s | not grep printf + +; llc shouldn't emit any code or bookkeeping for unused declarations. + +define void @foo() { + ret void +} + +declare i32 @printf(i8* nocapture, ...) diff --git a/test/CodeGen/JS/invariant-intrinsics.ll b/test/CodeGen/JS/invariant-intrinsics.ll new file mode 100644 index 0000000000..dc156a9ffb --- /dev/null +++ b/test/CodeGen/JS/invariant-intrinsics.ll @@ -0,0 +1,17 @@ +; RUN: llc -march=js < %s | not grep invariant + +; llc currently emits no code or bookkeeping for invariant intrinsic calls +; or declarations. + +declare void @bar(i8*) + +define void @foo() { + %p = alloca i8 + %i = call {}* @llvm.invariant.start(i64 1, i8* %p) + call void @bar(i8* %p) + call void @llvm.invariant.end({}* %i, i64 1, i8* %p) + ret void +} + +declare {}* @llvm.invariant.start(i64, i8* nocapture) +declare void @llvm.invariant.end({}*, i64, i8* nocapture) diff --git a/test/CodeGen/JS/lifetime-intrinsics.ll b/test/CodeGen/JS/lifetime-intrinsics.ll new file mode 100644 index 0000000000..e3d8560e30 --- /dev/null +++ b/test/CodeGen/JS/lifetime-intrinsics.ll @@ -0,0 +1,17 @@ +; RUN: llc -march=js < %s | not grep lifetime + +; llc currently emits no code or bookkeeping for lifetime intrinsic calls +; or declarations. + +declare void @bar(i8*) + +define void @foo() { + %p = alloca i8 + call void @llvm.lifetime.start(i64 1, i8* %p) + call void @bar(i8* %p) + call void @llvm.lifetime.end(i64 1, i8* %p) + ret void +} + +declare void @llvm.lifetime.start(i64, i8* nocapture) +declare void @llvm.lifetime.end(i64, i8* nocapture) |