diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-05-29 15:09:15 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-05-29 15:09:15 +0000 |
commit | ec2c12646aee07bf6bb1b4092d538d5860fd0661 (patch) | |
tree | 8719a418f23b08d08f0e13ae2be86f7af3550143 /test/CodeGen/pointer-cmp-type.c | |
parent | 1e86b34f15f0502c13750ee1d6cf338def6e2242 (diff) |
Fix an extremely subtle bug with pointer comparisons: they have to be
unsigned because it's possible (at least in theory) to have
have both positive and negative pointers pointing to the same object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/pointer-cmp-type.c')
-rw-r--r-- | test/CodeGen/pointer-cmp-type.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/CodeGen/pointer-cmp-type.c b/test/CodeGen/pointer-cmp-type.c new file mode 100644 index 0000000000..02fc4c7675 --- /dev/null +++ b/test/CodeGen/pointer-cmp-type.c @@ -0,0 +1,3 @@ +// RUN: clang -emit-llvm %s -o - | grep "icmp ult" + +int a(char* a, char* b) {return a<b;} |