1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -w -emit-llvm %s -O1 -o - | FileCheck %s 2*f4a2713aSLionel Sambuc // Check for bug compatibility with gcc. 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambuc const int x __attribute((weak)) = 123; 5*f4a2713aSLionel Sambuc f(void)6*f4a2713aSLionel Sambucint* f(void) { 7*f4a2713aSLionel Sambuc return &x; 8*f4a2713aSLionel Sambuc } 9*f4a2713aSLionel Sambuc g(void)10*f4a2713aSLionel Sambucint g(void) { 11*f4a2713aSLionel Sambuc // CHECK: ret i32 123 12*f4a2713aSLionel Sambuc return *f(); 13*f4a2713aSLionel Sambuc } 14