brintos

brintos / llvm-project-archived public Read only

0
0
Text · 823 B · 45778bd Raw
23 lines · c
1/* RUN: %clang_cc1 -std=c89 -pedantic -Wno-c11-extensions -verify -emit-llvm -o -  %s | FileCheck %s2   RUN: %clang_cc1 -std=c99 -pedantic -Wno-c11-extensions -verify -emit-llvm -o -  %s | FileCheck %s3   RUN: %clang_cc1 -std=c11 -pedantic -verify -emit-llvm -o -  %s | FileCheck %s4   RUN: %clang_cc1 -std=c17 -pedantic -verify -emit-llvm -o -  %s | FileCheck %s5   RUN: %clang_cc1 -std=c2x -pedantic -verify -emit-llvm -o -  %s | FileCheck %s6 */7 8/* expected-no-diagnostics */9 10/* WG14 DR158: yes11 * Null pointer conversions12 */13void dr158(void) {14  int Val = (void *)0 == (int *)0;15  /* CHECK: %[[VAL:.+]] = alloca i3216     CHECK: store i32 1, ptr %[[VAL]]17   */18 19  (void)_Generic((int *)0, int * : 1); /* picks correct association */20  (void)_Generic((1 ? 0 : (int *)0), int * : 1); /* picks correct association */21}22 23