brintos

brintos / llvm-project-archived public Read only

0
0
Text · 536 B · f3d8588 Raw
31 lines · c
1// REQUIRES: msp430-registered-target2// RUN: %clang -target msp430 -fPIC -S %s -o - | FileCheck %s3 4// Check the compilation does not crash as it was crashing before with "-fPIC" enabled5 6void *alloca(unsigned int size);7 8// CHECK: .globl foo9short foo(char** data, char encoding)10{11	char* encoding_addr = alloca(sizeof(char));12	*encoding_addr = encoding;13 14	char tmp3 = *encoding_addr;15	short conv2 = tmp3;16	short and = conv2 & 0xf;17 18	switch (and)19	{20	case 0 :21	case 4 :22	case 10 :23		return 1;24	case 11 :25		return 2;26	}27 28	return 0;29}30 31