diff --git a/test/Transforms/ADCE/adcetest.ll b/test/Transforms/ADCE/adcetest.ll index 386d71c70d8..4a06cd9f396 100644 --- a/test/Transforms/ADCE/adcetest.ll +++ b/test/Transforms/ADCE/adcetest.ll @@ -1,7 +1,7 @@ ; This is the test case taken from Appel's book that illustrates a hard case ; that SCCP gets right, and when followed by ADCE, is completely eliminated ; -; RUN: if as < %s | opt -sccp -adce | dis | grep br +; RUN: if as < %s | opt -sccp -adce -simplifycfg | dis | grep br ; RUN: then exit 1 ; RUN: else exit 0 ; RUN: fi diff --git a/test/Transforms/ADCE/basictest.ll b/test/Transforms/ADCE/basictest.ll new file mode 100644 index 00000000000..d58150d49fb --- /dev/null +++ b/test/Transforms/ADCE/basictest.ll @@ -0,0 +1,14 @@ +; RUN: as < %s | opt -adce -simplifycfg | dis + +int "Test"(int %A, int %B) { +BB1: + br label %BB4 +BB2: + br label %BB3 +BB3: + %ret = phi int [%X, %BB4], [%B, %BB2] + ret int %ret +BB4: + %X = phi int [%A, %BB1] + br label %BB3 +} diff --git a/test/Transforms/ADCE/basictest1.ll b/test/Transforms/ADCE/basictest1.ll new file mode 100644 index 00000000000..bf99e5b815f --- /dev/null +++ b/test/Transforms/ADCE/basictest1.ll @@ -0,0 +1,96 @@ +; RUN: as < %s | opt -adce -simplifycfg | dis + +%FILE = type { int, ubyte*, ubyte*, ubyte, ubyte, uint, uint, uint } + %spec_fd_t = type { int, int, int, ubyte* } +%__iob = uninitialized global [20 x %FILE] ; <[20 x %FILE]*> [#uses=1] +%dbglvl = global int 4 ; [#uses=3] +%spec_fd = uninitialized global [3 x %spec_fd_t] ; <[3 x %spec_fd_t]*> [#uses=4] +%.LC9 = internal global [34 x sbyte] c"spec_read: fd=%d, > MAX_SPEC_FD!\0A\00" ; <[34 x sbyte]*> [#uses=1] +%.LC10 = internal global [4 x sbyte] c"EOF\00" ; <[4 x sbyte]*> [#uses=1] +%.LC11 = internal global [4 x sbyte] c"%d\0A\00" ; <[4 x sbyte]*> [#uses=1] +%.LC12 = internal global [17 x sbyte] c"spec_getc: %d = \00" ; <[17 x sbyte]*> [#uses=1] + +implementation ; Functions: + +declare int "fprintf"(%FILE*, sbyte*, ...) + +declare void "exit"(int) + +declare int "remove"(sbyte*) + +declare int "fputc"(int, %FILE*) + +declare uint "fwrite"(sbyte*, uint, uint, %FILE*) + +declare void "perror"(sbyte*) + +int "spec_getc"(int %fd) { +;