diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-07-26 23:11:03 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-07-26 23:11:03 +0000 |
commit | 0ebca28f1db9bc83b7a311d389282d401a75d9b9 (patch) | |
tree | fdc38bec8794d2a00654a3878bd5eabfe5860ca1 /clang/test/CodeGen | |
parent | 76f0cf457c361859f8361b4c9cce2f0a4eabc89a (diff) | |
download | bcm5719-llvm-0ebca28f1db9bc83b7a311d389282d401a75d9b9.tar.gz bcm5719-llvm-0ebca28f1db9bc83b7a311d389282d401a75d9b9.zip |
2nd argument of __builtin_expect must be evaluated
if it hs side-effect to matchgcc's behaviour.
Addresses radar 8172109.
llvm-svn: 109467
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r-- | clang/test/CodeGen/builtin-expect.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGen/builtin-expect.c b/clang/test/CodeGen/builtin-expect.c new file mode 100644 index 00000000000..8f02c4da78a --- /dev/null +++ b/clang/test/CodeGen/builtin-expect.c @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s + +int x; +int y(void); +void foo(); +void FUNC() { +// CHECK: [[call:%.*]] = call i32 @y + if (__builtin_expect (x, y())) + foo (); +} + |