diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Verifier/AmbiguousPhi.ll | 8 | ||||
-rw-r--r-- | test/Verifier/PhiGrouping.ll | 15 |
2 files changed, 23 insertions, 0 deletions
diff --git a/test/Verifier/AmbiguousPhi.ll b/test/Verifier/AmbiguousPhi.ll new file mode 100644 index 0000000000..7da71b0516 --- /dev/null +++ b/test/Verifier/AmbiguousPhi.ll @@ -0,0 +1,8 @@ + + +int "test"(int %i, int %j, bool %c) { + br bool %c, label %A, label %A +A: + %a = phi int [%i, %0], [%j, %0] ; Error, different values from same block! + ret int %a +} diff --git a/test/Verifier/PhiGrouping.ll b/test/Verifier/PhiGrouping.ll new file mode 100644 index 0000000000..71fbb1c4e5 --- /dev/null +++ b/test/Verifier/PhiGrouping.ll @@ -0,0 +1,15 @@ + + +int "test"(int %i, int %j, bool %c) { + br bool %c, label %A, label %B +A: + br label %C +B: + br label %C + +C: + %a = phi int [%i, %A], [%j, %B] + %x = add int %a, 0 ; Error, PHI's should be grouped! + %b = phi int [%i, %A], [%j, %B] + ret int %x +} |