mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 05:46:06 +00:00

Currently codegen crashes trying to emit casting to bool &. It happens because bool type is converted to i1 and later then lvalue for reference is converted to i1*. But when codegen tries to load this lvalue it crashes trying to load value from this i1*. Differential Revision: http://reviews.llvm.org/D13325 llvm-svn: 249534
10 lines
252 B
C++
10 lines
252 B
C++
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
|
|
|
|
// CHECK-LABEL: main
|
|
int main(int argc, char **argv) {
|
|
// CHECK: load i8, i8* %
|
|
// CHECK-NEXT: trunc i8 %{{.+}} to i1
|
|
bool b = (bool &)argv[argc][1];
|
|
return b;
|
|
}
|