aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/expr.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2009-01-11 23:22:37 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2009-01-11 23:22:37 +0000
commita0abe62904c139aa5d6257bf70ec21c1980f541f (patch)
tree10defce23e1ce473cbeaf8bb84e6b2a44d83fe11 /clang/test/CodeGenCXX/expr.cpp
parentfd22768b08338aae974fc118c0dd276f6a64899a (diff)
downloadllvm-a0abe62904c139aa5d6257bf70ec21c1980f541f.zip
llvm-a0abe62904c139aa5d6257bf70ec21c1980f541f.tar.gz
llvm-a0abe62904c139aa5d6257bf70ec21c1980f541f.tar.bz2
make ScalarExprEmitter::EmitCompare() emit the expression with the correct type instead of always zext it to an int
this fixes codegen of simple exprs in C++ like 'if (x != 0)' llvm-svn: 62060
Diffstat (limited to 'clang/test/CodeGenCXX/expr.cpp')
-rw-r--r--clang/test/CodeGenCXX/expr.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/expr.cpp b/clang/test/CodeGenCXX/expr.cpp
new file mode 100644
index 0000000..5b8efac
--- /dev/null
+++ b/clang/test/CodeGenCXX/expr.cpp
@@ -0,0 +1,5 @@
+// RUN: clang -emit-llvm -x c++ < %s
+
+void f(int x) {
+ if (x != 0) return;
+}