blob: c387c47ef93fc138e67c4b6e76c78363d3d9af9e [file] [log] [blame]
Chris Lattner51176ea2002-04-29 18:12:28 +00001; There should be NO references to the global v1. The local v1 should
2; have all of the references!
3;
4; Check by running globaldce, which will remove the constant if there are
5; no references to it!
6;
Dan Gohmanf2f6ce62009-09-11 18:01:28 +00007; RUN: opt < %s -globaldce -S | \
Reid Spencer90008f42007-04-15 10:07:55 +00008; RUN: not grep constant
Chris Lattner51176ea2002-04-29 18:12:28 +00009;
Duncan P. N. Exon Smith13f5c582014-08-19 21:08:27 +000010; RUN: verify-uselistorder %s
Chris Lattner51176ea2002-04-29 18:12:28 +000011
Tanya Lattner6e9bcee2008-02-14 07:57:12 +000012@v1 = internal constant i32 5
Chris Lattner51176ea2002-04-29 18:12:28 +000013
Tanya Lattner6e9bcee2008-02-14 07:57:12 +000014define i32 @createtask() {
15 %v1 = alloca i32 ;; Alloca should have one use!
David Blaikie7c9c6ed2015-02-27 21:17:42 +000016 %reg112 = load i32, i32* %v1 ;; This load should not use the global!
Tanya Lattner6e9bcee2008-02-14 07:57:12 +000017 ret i32 %reg112
18}
Chris Lattner51176ea2002-04-29 18:12:28 +000019