aboutsummaryrefslogtreecommitdiff
path: root/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
commit32f6209ea9a5a88ad3f8d7ad5e5b160b403d12da (patch)
treee19caf8ae6c8c4c0fd5298622b82d2d3aa8e31ba /test/CodeGenCXX/expr.cpp
parent9c199a0b6d37d2320b349739ee1c054fc117eb74 (diff)
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)' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62060 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/expr.cpp')
-rw-r--r--test/CodeGenCXX/expr.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/CodeGenCXX/expr.cpp b/test/CodeGenCXX/expr.cpp
new file mode 100644
index 0000000000..5b8efacdd7
--- /dev/null
+++ b/test/CodeGenCXX/expr.cpp
@@ -0,0 +1,5 @@
+// RUN: clang -emit-llvm -x c++ < %s
+
+void f(int x) {
+ if (x != 0) return;
+}