diff options
author | Chris Lattner <sabre@nondot.org> | 2008-01-16 19:17:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-01-16 19:17:22 +0000 |
commit | a65e1f3b317643fa24a9d73a2d879244effc26e7 (patch) | |
tree | a2ec92b739b2ff1c6ead7028b3b602047c759222 /clang/test/CodeGen/statements.c | |
parent | 45b985c664ac7cee9dc13c72f5fdebe999e978a0 (diff) | |
download | bcm5719-llvm-a65e1f3b317643fa24a9d73a2d879244effc26e7.tar.gz bcm5719-llvm-a65e1f3b317643fa24a9d73a2d879244effc26e7.zip |
Move promoteExprToType from being a static method in SemaExpr.cpp to being
a method named ImpCastExprToType in Sema.
Use this method to insert implicit casts for case statements from their
operand type to the condition type of the switch. This fixes a crash on
test/CodeGen/statements.c, reported by Eli Friedman.
llvm-svn: 46083
Diffstat (limited to 'clang/test/CodeGen/statements.c')
-rw-r--r-- | clang/test/CodeGen/statements.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGen/statements.c b/clang/test/CodeGen/statements.c new file mode 100644 index 00000000000..46d19dbc529 --- /dev/null +++ b/clang/test/CodeGen/statements.c @@ -0,0 +1,9 @@ +// RUN: clang %s -emit-llvm + +void foo(int x) { +switch (x) { +case 111111111111111111111111111111111111111: +bar(); +} +} + |